openat: Conditionalize dependencies.
authorBruno Haible <bruno@clisp.org>
Tue, 8 Nov 2011 12:02:02 +0000 (13:02 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 8 Nov 2011 12:02:02 +0000 (13:02 +0100)
* lib/openat.c: Reduce the scope of some #includes.
* modules/openat (Depends-on): Add conditions.

ChangeLog
lib/openat.c
modules/openat

index 6efe313..e1d1200 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-11-08  Bruno Haible  <bruno@clisp.org>
+
+       openat: Conditionalize dependencies.
+       * lib/openat.c: Reduce the scope of some #includes.
+       * modules/openat (Depends-on): Add conditions.
+
 2011-11-07  Jim Meyering  <meyering@redhat.com>
 
        maint.mk: extract GPG key ID without using a temporary file
index a12fe20..3225326 100644 (file)
@@ -47,10 +47,6 @@ orig_openat (int fd, char const *filename, int flags, mode_t mode)
 #include <string.h>
 #include <sys/stat.h>
 
-#include "dosname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
-#include "openat-priv.h"
-#include "save-cwd.h"
-
 #if HAVE_OPENAT
 
 /* Like openat, but work around Solaris 9 bugs with trailing slash.  */
@@ -144,6 +140,10 @@ rpl_openat (int dfd, char const *filename, int flags, ...)
 
 #else /* !HAVE_OPENAT */
 
+# include "dosname.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+# include "openat-priv.h"
+# include "save-cwd.h"
+
 /* Replacement for Solaris' openat function.
    <http://www.google.com/search?q=openat+site:docs.sun.com>
    First, try to simulate it via open ("/proc/self/fd/FD/FILE").
index 995c280..f2da9bc 100644 (file)
@@ -9,20 +9,20 @@ m4/openat.m4
 m4/mode_t.m4
 
 Depends-on:
-at-internal
-dosname
-errno
-extensions
-fchdir
 fcntl-h
-fstat
+extensions
 largefile
-open
-openat-die
-openat-h
-save-cwd
-stdbool
-sys_stat
+openat-h        [test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1]
+stdbool         [test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1]
+sys_stat        [test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1]
+fstat           [test $REPLACE_OPENAT = 1]
+at-internal     [test $HAVE_OPENAT = 0]
+dosname         [test $HAVE_OPENAT = 0]
+errno           [test $HAVE_OPENAT = 0]
+fchdir          [test $HAVE_OPENAT = 0]
+open            [test $HAVE_OPENAT = 0]
+openat-die      [test $HAVE_OPENAT = 0]
+save-cwd        [test $HAVE_OPENAT = 0]
 
 configure.ac:
 gl_FUNC_OPENAT