]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* acspecific.m4 (_AC_FUNC_STAT, AC_FUNC_STAT, AC_FUNC_LSTAT): New
authorAkim Demaille <akim@epita.fr>
Mon, 10 Jul 2000 10:27:02 +0000 (10:27 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 10 Jul 2000 10:27:02 +0000 (10:27 +0000)
macros, from Jim's stat.m4 and lstat.m4 serial 6.
* doc/autoconf.texi (Particular Functions): Document
* acfunctions: Add them.

ChangeLog
NEWS
acfunctions
acspecific.m4
doc/autoconf.texi
lib/autoconf/specific.m4
lib/autoscan/functions

index eab8ed141e074d9446f448e5c0f7f34226151a5c..f6b40bf603ef245024e84c41188e55a96039dec5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-07-10  Akim Demaille  <akim@epita.fr>
+
+       * acspecific.m4 (_AC_FUNC_STAT, AC_FUNC_STAT, AC_FUNC_LSTAT): New
+       macros, from Jim's stat.m4 and lstat.m4 serial 6.
+       * doc/autoconf.texi (Particular Functions): Document
+       * acfunctions: Add them.
+
 2000-07-10  Akim Demaille  <akim@epita.fr>
 
        AC_LIBOBJ when used by AC_REPLACE_FUNCS should not complain for
diff --git a/NEWS b/NEWS
index bc658a3637d570957175828677ddd44eb82e1b7e..a6e8124bd1d1ca3bc404a707f29499a86b18afa5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -171,7 +171,7 @@ test cases in this new frame work.
 
 ** Specific Macros
 - AC_FUNC_CHOWN, AC_FUNC_MALLOC, AC_FUNC_STRERROR_R,
-  AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
+  AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK, AC_FUNC_STAT, AC_FUNC_LSTAT.
   New.
 
 - AC_FUNC_GETGROUPS
index 7099d0a1a71efc7f179efc90c6c0b790d2765d6b..fc96257b234bb7213383feb9de1eb6041ae6ce22 100644 (file)
@@ -10,7 +10,7 @@ getloadavg    AC_FUNC_GETLOADAVG
 getpgrp                AC_FUNC_GETPGRP
 index          AC_HEADER_STDC
 ioctl          AC_PROG_GCC_TRADITIONAL
-lstat          AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
+lstat          AC_FUNC_LSTAT
 major          AC_HEADER_MAJOR
 malloc         AC_FUNC_MALLOC
 makedev                AC_HEADER_MAJOR
@@ -26,6 +26,7 @@ rindex                AC_HEADER_STDC
 setpgrp                AC_FUNC_SETPGRP
 setvbuf                AC_FUNC_SETVBUF_REVERSED
 signal         AC_TYPE_SIGNAL
+stat           AC_FUNC_STAT
 strcoll                AC_FUNC_STRCOLL
 strerror_r     AC_FUNC_STRERROR_R
 strftime       AC_FUNC_STRFTIME
index a83769579a9530df278c95b05818b2b858684ad2..cf7113af11cf6054ff992f5ac768c9e502664495 100644 (file)
@@ -1715,6 +1715,47 @@ fi
 ])# AC_FUNC_SETPGRP
 
 
+# _AC_FUNC_STAT(STAT | LSTAT)
+# ---------------------------
+# Determine whether stat or lstat have the bug that it succeeds when
+# given the zero-length file name argument.  The stat and lstat from
+# SunOS4.1.4 and the Hurd (as of 1998-11-01) do this.
+#
+# If it does, then define HAVE_STAT_EMPTY_STRING_BUG (or
+# HAVE_LSTAT_EMPTY_STRING_BUG) and arrange to compile the wrapper
+# function.
+define([_AC_FUNC_STAT],
+[AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])dnl
+AC_CACHE_CHECK([whether $1 accepts an empty string],
+               [ac_cv_func_$1_empty_string_bug],
+[AC_TRY_RUN(
+[#include <sys/types.h>
+#include <sys/stat.h>
+
+int
+main ()
+{
+  struct stat sbuf;
+  exit ($1 ("", &sbuf) ? 1 : 0);
+}],
+            [ac_cv_func_$1_empty_string_bug=yes],
+            [ac_cv_func_$1_empty_string_bug=no],
+            [ac_cv_func_$1_empty_string_bug=yes])])
+if test $ac_cv_func_$1_empty_string_bug = yes; then
+  AC_LIBOBJ([$1])
+  AC_DEFINE_UNQUOTED(AC_TR_CPP([HAVE_$1_EMPTY_STRING_BUG]), 1,
+                     [Define if `$1' has the bug that it succeeds when
+                      given the zero-length file name argument.])
+fi
+])# _AC_FUNC_STAT
+
+
+# AC_FUNC_STAT & AC_FUNC_LSTAT
+# ----------------------------
+AC_DEFUN([AC_FUNC_STAT],  [_AC_FUNC_STAT(stat)])
+AC_DEFUN([AC_FUNC_LSTAT], [_AC_FUNC_STAT(lstat)])
+
+
 # AC_FUNC_STRERROR_R
 # ------------------
 AC_DEFUN([AC_FUNC_STRERROR_R],
index 5dd707fd4d9b3a80e4901624be32316b8acdb0ca..97f641c4b26f59b104ec8daaafb7255359bbeffe 100644 (file)
@@ -2900,6 +2900,22 @@ two process ID as arguments.  This macro does not check whether
 first call @code{AC_CHECK_FUNC} for @code{setpgrp}.
 @end defmac
 
+@defmac AC_FUNC_STAT
+@defmacx AC_FUNC_LSTAT
+@maindex FUNC_STAT
+@maindex FUNC_LSTAT
+@cvindex HAVE_STAT_EMPTY_STRING_BUG
+@cvindex HAVE_LSTAT_EMPTY_STRING_BUG
+Determine whether @code{stat} or @code{lstat} have the bug that it
+succeeds when given the zero-length file name argument.  The @code{stat}
+and @code{lstat} from SunOS4.1.4 and the Hurd (as of 1998-11-01) do
+this.
+
+If it does, then define @code{HAVE_STAT_EMPTY_STRING_BUG} (or
+@code{HAVE_LSTAT_EMPTY_STRING_BUG}) and ask for an @code{AC_LIBOBJ}
+replacement of it.
+@end defmac
+
 @defmac AC_FUNC_SETVBUF_REVERSED
 @maindex FUNC_SETVBUF_REVERSED
 @cvindex SETVBUF_REVERSED
index a83769579a9530df278c95b05818b2b858684ad2..cf7113af11cf6054ff992f5ac768c9e502664495 100644 (file)
@@ -1715,6 +1715,47 @@ fi
 ])# AC_FUNC_SETPGRP
 
 
+# _AC_FUNC_STAT(STAT | LSTAT)
+# ---------------------------
+# Determine whether stat or lstat have the bug that it succeeds when
+# given the zero-length file name argument.  The stat and lstat from
+# SunOS4.1.4 and the Hurd (as of 1998-11-01) do this.
+#
+# If it does, then define HAVE_STAT_EMPTY_STRING_BUG (or
+# HAVE_LSTAT_EMPTY_STRING_BUG) and arrange to compile the wrapper
+# function.
+define([_AC_FUNC_STAT],
+[AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])dnl
+AC_CACHE_CHECK([whether $1 accepts an empty string],
+               [ac_cv_func_$1_empty_string_bug],
+[AC_TRY_RUN(
+[#include <sys/types.h>
+#include <sys/stat.h>
+
+int
+main ()
+{
+  struct stat sbuf;
+  exit ($1 ("", &sbuf) ? 1 : 0);
+}],
+            [ac_cv_func_$1_empty_string_bug=yes],
+            [ac_cv_func_$1_empty_string_bug=no],
+            [ac_cv_func_$1_empty_string_bug=yes])])
+if test $ac_cv_func_$1_empty_string_bug = yes; then
+  AC_LIBOBJ([$1])
+  AC_DEFINE_UNQUOTED(AC_TR_CPP([HAVE_$1_EMPTY_STRING_BUG]), 1,
+                     [Define if `$1' has the bug that it succeeds when
+                      given the zero-length file name argument.])
+fi
+])# _AC_FUNC_STAT
+
+
+# AC_FUNC_STAT & AC_FUNC_LSTAT
+# ----------------------------
+AC_DEFUN([AC_FUNC_STAT],  [_AC_FUNC_STAT(stat)])
+AC_DEFUN([AC_FUNC_LSTAT], [_AC_FUNC_STAT(lstat)])
+
+
 # AC_FUNC_STRERROR_R
 # ------------------
 AC_DEFUN([AC_FUNC_STRERROR_R],
index 7099d0a1a71efc7f179efc90c6c0b790d2765d6b..fc96257b234bb7213383feb9de1eb6041ae6ce22 100644 (file)
@@ -10,7 +10,7 @@ getloadavg    AC_FUNC_GETLOADAVG
 getpgrp                AC_FUNC_GETPGRP
 index          AC_HEADER_STDC
 ioctl          AC_PROG_GCC_TRADITIONAL
-lstat          AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
+lstat          AC_FUNC_LSTAT
 major          AC_HEADER_MAJOR
 malloc         AC_FUNC_MALLOC
 makedev                AC_HEADER_MAJOR
@@ -26,6 +26,7 @@ rindex                AC_HEADER_STDC
 setpgrp                AC_FUNC_SETPGRP
 setvbuf                AC_FUNC_SETVBUF_REVERSED
 signal         AC_TYPE_SIGNAL
+stat           AC_FUNC_STAT
 strcoll                AC_FUNC_STRCOLL
 strerror_r     AC_FUNC_STRERROR_R
 strftime       AC_FUNC_STRFTIME