Show that we are checking things, and add check for S_ISWHT to allow for compilation...
authorFabian Groffen <grobian@gentoo.org>
Mon, 15 Oct 2007 08:23:25 +0000 (08:23 -0000)
committerFabian Groffen <grobian@gentoo.org>
Mon, 15 Oct 2007 08:23:25 +0000 (08:23 -0000)
svn path=/main/branches/prefix/; revision=8127

configure.in
src/chpathtool.c

index c23cc011b9127f0153d0b849954615f0a8ac2f19..eb5ba83217e8be406318928f72d1e85809214a55 100644 (file)
@@ -53,10 +53,8 @@ AC_CHECK_HEADERS([sys/stat.h sys/types.h dirent.h sys/time.h alloca.h])
 AC_CHECK_HEADERS([fcntl.h])
 
 AC_CHECK_LIB([c], [readdir])
-AC_CHECK_LIB([c], [strcpy])
-AC_CHECK_LIB([c], [strstr])
-AC_CHECK_LIB([c], [memcpy])
 
+AC_MSG_CHECKING([for the *time fields in struct stat])
 AC_TRY_LINK([
                         #include <sys/types.h>
                         #include <sys/stat.h>
@@ -70,6 +68,7 @@ AC_TRY_LINK([
                 ], [
                         AC_DEFINE(ATIMESPEC, st_atimespec, [atime for this platform])
                         AC_DEFINE(MTIMESPEC, st_mtimespec, [mtime for this platform])
+                        AC_MSG_RESULT([st_*timespec])
                 ], [
 AC_TRY_LINK([
                         #include <sys/types.h>
@@ -84,8 +83,29 @@ AC_TRY_LINK([
                 ], [
                         AC_DEFINE(ATIMESPEC, st_atim, [atime for this platform])
                         AC_DEFINE(MTIMESPEC, st_mtim, [mtime for this platform])
+                        AC_MSG_RESULT([st_*tim])
                 ]
 )
+                ], [
+                       AC_MSG_ERROR([cannot determine])
+                ]
+)
+
+AC_MSG_CHECKING([if S_ISWHT can be used])
+AC_TRY_LINK([
+                        #include <sys/types.h>
+                        #include <sys/stat.h>
+                        #ifdef HAVE_FCNTL_H
+                        #include <fcntl.h>
+                        #endif
+                ], [
+                        struct stat s;
+                        if (S_ISWHT(s.st_mode)) {}
+                ], [
+                        AC_DEFINE(HAVE_S_ISWHT, 1, [defined when S_ISWHT exists])
+                        AC_MSG_RESULT([yes])
+                ], [
+                        AC_MSG_RESULT([no])
                 ]
 )
 
index 032032def9bee974f77ff83bc07ec52bfabee713..b1295af040da0bb60d0a162198e5ad145eafaf54 100644 (file)
@@ -211,7 +211,7 @@ int dirwalk(char *src, char *srcp, char *trg, char *trgp) {
                                S_ISBLK(s.st_mode) ||
                                S_ISCHR(s.st_mode) ||
                                S_ISFIFO(s.st_mode) ||
-#ifdef _POSIX_C_SOURCE
+#ifdef HAVE_S_ISWHT
                                S_ISWHT(s.st_mode) ||
 #endif
                                S_ISSOCK(s.st_mode)