changeset 16056:23fe834fffdb

openat: Conditionalize dependencies. * lib/openat.c: Reduce the scope of some #includes. * modules/openat (Depends-on): Add conditions.
author Bruno Haible <bruno@clisp.org>
date Tue, 08 Nov 2011 13:02:02 +0100
parents 8063ffd1fa6d
children 8877c8da8a68
files ChangeLog lib/openat.c modules/openat
diffstat 3 files changed, 22 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- 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
--- a/lib/openat.c
+++ b/lib/openat.c
@@ -47,10 +47,6 @@
 #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 @@
 
 #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").
--- a/modules/openat
+++ b/modules/openat
@@ -9,20 +9,20 @@
 m4/mode_t.m4
 
 Depends-on:
-at-internal
-dosname
-errno
+fcntl-h
 extensions
-fchdir
-fcntl-h
-fstat
 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