[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
faccessat: autoconf macro idiom
From: |
Bruno Haible |
Subject: |
faccessat: autoconf macro idiom |
Date: |
Wed, 9 Nov 2011 02:15:25 +0100 |
User-agent: |
KMail/1.13.6 (Linux/2.6.37.6-0.5-desktop; KDE/4.6.0; x86_64; ; ) |
Now that 'openat' is cleaned up, it is easy to make the 'faccessat' module
follow the codins style / idioms from May 2011.
2011-11-08 Bruno Haible <address@hidden>
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.
--- m4/faccessat.m4.orig Wed Nov 9 02:10:28 2011
+++ m4/faccessat.m4 Wed Nov 9 02:08:58 2011
@@ -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 @@
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])
+])
--- modules/faccessat.orig Wed Nov 9 02:10:28 2011
+++ modules/faccessat Wed Nov 9 02:08:45 2011
@@ -21,6 +21,10 @@
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])
--
In memoriam The inmates of the Daugavpils Ghetto
<http://en.wikipedia.org/wiki/Daugavpils_Ghetto>
- faccessat: autoconf macro idiom,
Bruno Haible <=