faccessat: Move AC_LIBOBJ invocation to module description.
authorBruno Haible <bruno@clisp.org>
Wed, 9 Nov 2011 01:15:01 +0000 (02:15 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 9 Nov 2011 01:15:01 +0000 (02:15 +0100)
* m4/faccessat.m4 (gl_PREREQ_FACCESSAT): New macro.
(gl_FUNC_FACESSAT): Don't test for access() here. Move AC_LIBOBJ
invocation from here...
* modules/faccessat (configure.ac): ... to here. Invoke
gl_PREREQ_FACCESSAT.

ChangeLog
m4/faccessat.m4
modules/faccessat

index 65c96fe..48b51c7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2011-11-08  Bruno Haible  <bruno@clisp.org>
 
+       faccessat: Move AC_LIBOBJ invocation to module description.
+       * m4/faccessat.m4 (gl_PREREQ_FACCESSAT): New macro.
+       (gl_FUNC_FACESSAT): Don't test for access() here. Move AC_LIBOBJ
+       invocation from here...
+       * modules/faccessat (configure.ac): ... to here. Invoke
+       gl_PREREQ_FACCESSAT.
+
+2011-11-08  Bruno Haible  <bruno@clisp.org>
+
        faccessat: Simplify autoconf macro.
        * m4/faccessat.m4 (gl_FUNC_FACCESSAT): Don't require gl_FUNC_OPENAT,
        gl_FUNC_EUIDACCESS.
index 7f679f9..640ae0b 100644 (file)
@@ -1,4 +1,4 @@
-# serial 4
+# serial 5
 # See if we need to provide faccessat replacement.
 
 dnl Copyright (C) 2009-2011 Free Software Foundation, Inc.
@@ -11,11 +11,18 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_FACCESSAT],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+  dnl Persuade glibc <unistd.h> to declare faccessat().
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-  AC_CHECK_FUNCS_ONCE([access])
+
   AC_CHECK_FUNCS_ONCE([faccessat])
   if test $ac_cv_func_faccessat = no; then
     HAVE_FACCESSAT=0
-    AC_LIBOBJ([faccessat])
   fi
 ])
+
+# Prerequisites of lib/faccessat.m4.
+AC_DEFUN([gl_PREREQ_FACCESSAT],
+[
+  AC_CHECK_FUNCS_ONCE([access])
+])
index 6fc4354..e73f5ca 100644 (file)
@@ -21,6 +21,10 @@ euidaccess      [test $HAVE_FACCESSAT = 0]
 
 configure.ac:
 gl_FUNC_FACCESSAT
+if test $HAVE_FACCESSAT = 0; then
+  AC_LIBOBJ([faccessat])
+  gl_PREREQ_FACCESSAT
+fi
 gl_MODULE_INDICATOR([faccessat])
 gl_UNISTD_MODULE_INDICATOR([faccessat])