changeset 7356:0af37e82a5e3

* fsusage.m4 (gl_STATFS_TRUNCATES): Avoid unused variable. * getdate.m4 (gl_C_COMPOUND_LITERALS): Likewise. * jm-winsz1.m4 (gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H): Likewise; also add missing comma that caused broken test. * link-follow.m4 (gl_AC_FUNC_LINK_FOLLOWS_SYMLINK): Include stdlib.h, for `abort'. * ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Avoid unused variables. * mkdir-slash.m4 (gl_FUNC_MKDIR_TRAILING_SLASH): Check for and include unistd.h if present, for `rmdir'. * physmem.m4 (gl_SYS__SYSTEM_CONFIGURATION): Avoid unused variables. * putenv.m4 (gl_FUNC_PUTENV): Rewrite using AC_RUN_IFELSE, and in the process include standard headers for prototypes. * readutmp.m4 (gl_READUTMP): Require AC_GNU_SOURCE, so utmpxname gets declared on GNU/Linux. * rmdir-errno.m4 (gl_FUNC_RMDIR_NOTEMPTY): Check for and include unistd.h, for `rmdir'. * time_r.m4 (gl_TIME_R): Avoid unused variables.
author Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
date Fri, 22 Sep 2006 18:09:47 +0000
parents c2852b1c0fb6
children 28f050736570
files m4/ChangeLog m4/fsusage.m4 m4/getdate.m4 m4/jm-winsz1.m4 m4/link-follow.m4 m4/ls-mntd-fs.m4 m4/mkdir-slash.m4 m4/physmem.m4 m4/putenv.m4 m4/readutmp.m4 m4/rmdir-errno.m4 m4/time_r.m4
diffstat 12 files changed, 71 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,5 +1,25 @@
 2006-09-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+	* fsusage.m4 (gl_STATFS_TRUNCATES): Avoid unused variable.
+	* getdate.m4 (gl_C_COMPOUND_LITERALS): Likewise.
+	* jm-winsz1.m4 (gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H): Likewise;
+	also add missing comma that caused broken test.
+	* link-follow.m4 (gl_AC_FUNC_LINK_FOLLOWS_SYMLINK): Include
+	stdlib.h, for `abort'.
+	* ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Avoid unused
+	variables.
+	* mkdir-slash.m4 (gl_FUNC_MKDIR_TRAILING_SLASH): Check for and
+	include unistd.h if present, for `rmdir'.
+	* physmem.m4 (gl_SYS__SYSTEM_CONFIGURATION): Avoid unused
+	variables.
+	* putenv.m4 (gl_FUNC_PUTENV): Rewrite using AC_RUN_IFELSE, and
+	in the process include standard headers for prototypes.
+	* readutmp.m4 (gl_READUTMP): Require AC_GNU_SOURCE, so utmpxname
+	gets declared on GNU/Linux.
+	* rmdir-errno.m4 (gl_FUNC_RMDIR_NOTEMPTY): Check for and include
+	unistd.h, for `rmdir'.
+	* time_r.m4 (gl_TIME_R): Avoid unused variables.
+
 	* fnmatch.m4 (_AC_FUNC_FNMATCH_IF): Avoid expression that is
 	always true.
 	* strndup.m4 (gl_FUNC_STRNDUP): include stdlib.h, for `free'.
--- a/m4/fsusage.m4
+++ b/m4/fsusage.m4
@@ -1,4 +1,4 @@
-#serial 21
+#serial 22
 # Obtaining file system usage information.
 
 # Copyright (C) 1997, 1998, 2000, 2001, 2003, 2004, 2005, 2006 Free Software
@@ -242,7 +242,8 @@
 #endif
 #include <sys/types.h>
 #include <sys/vfs.h>]],
-    [[struct statfs t; long c = *(t.f_spare);]])],
+    [[struct statfs t; long c = *(t.f_spare);
+      if (c) return 0;]])],
     [fu_cv_sys_truncating_statfs=yes],
     [fu_cv_sys_truncating_statfs=no])])
   if test $fu_cv_sys_truncating_statfs = yes; then
--- a/m4/getdate.m4
+++ b/m4/getdate.m4
@@ -1,4 +1,4 @@
-# getdate.m4 serial 11
+# getdate.m4 serial 12
 dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,7 +8,8 @@
 [
   AC_CACHE_CHECK([for compound literals], gl_cv_compound_literals,
   [AC_TRY_COMPILE([struct s { int i, j; }; struct s s = (struct s) { 1, 2 };],
-    [struct s t = (struct s) { 3, 4 };],
+    [struct s t = (struct s) { 3, 4 };
+     if (t.i != 0) return 0;],
     gl_cv_compound_literals=yes,
     gl_cv_compound_literals=no)])
   if test $gl_cv_compound_literals = yes; then
--- a/m4/jm-winsz1.m4
+++ b/m4/jm-winsz1.m4
@@ -1,6 +1,6 @@
-#serial 8
+#serial 9
 
-# Copyright (C) 1996, 1999, 2001, 2002, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1996, 1999, 2001, 2002, 2004, 2006 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -30,13 +30,15 @@
      jm_cv_sys_struct_winsize_needs_sys_ptem_h,
      [jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes
       if test $ac_cv_sys_posix_termios = yes; then
-	AC_TRY_COMPILE([#include <termios.h>]
-	  [struct winsize x;],
+	AC_TRY_COMPILE([#include <termios.h>],
+	  [struct winsize x;
+	   if (sizeof x > 0) return 0;],
           [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
       fi
       if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
 	AC_TRY_COMPILE([#include <sys/ptem.h>],
-	  [struct winsize x;],
+	  [struct winsize x;
+	   if (sizeof x > 0) return 0;],
 	  [], [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
       fi])
    if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
--- a/m4/link-follow.m4
+++ b/m4/link-follow.m4
@@ -1,4 +1,4 @@
-#serial 8
+#serial 9
 dnl Run a program to determine whether link(2) follows symlinks.
 dnl Set LINK_FOLLOWS_SYMLINKS accordingly.
 
@@ -20,6 +20,7 @@
 #       include <sys/types.h>
 #       include <sys/stat.h>
 #       include <unistd.h>
+#       include <stdlib.h>
 
 #       define SAME_INODE(Stat_buf_1, Stat_buf_2) \
 	  ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \
--- a/m4/ls-mntd-fs.m4
+++ b/m4/ls-mntd-fs.m4
@@ -1,4 +1,4 @@
-#serial 24
+#serial 25
 # How to list mounted file systems.
 
 # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2006 Free Software
@@ -141,7 +141,8 @@
 # endif
 #endif
 ],
-                    [ struct mntent *mnt = 0; char *table = MOUNTED; ],
+                    [ struct mntent *mnt = 0; char *table = MOUNTED;
+		      if (sizeof mnt > 0 && table > 0) return 0;],
 		    fu_cv_sys_mounted_getmntent1=yes,
 		    fu_cv_sys_mounted_getmntent1=no)])
     AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
--- a/m4/mkdir-slash.m4
+++ b/m4/mkdir-slash.m4
@@ -1,6 +1,6 @@
-#serial 4
+#serial 5
 
-# Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2004, 2006 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -10,6 +10,7 @@
 # trailing slashes.
 AC_DEFUN([gl_FUNC_MKDIR_TRAILING_SLASH],
 [dnl
+  AC_CHECK_HEADERS_ONCE(unistd.h)
   AC_CACHE_CHECK([whether mkdir fails due to a trailing slash],
     gl_cv_func_mkdir_trailing_slash_bug,
     [
@@ -19,6 +20,9 @@
 #       include <sys/types.h>
 #       include <sys/stat.h>
 #       include <stdlib.h>
+#       ifdef HAVE_UNISTD_H
+#         include <unistd.h>
+#       endif
 	int main ()
 	{
 	  rmdir ("confdir-slash");
--- a/m4/physmem.m4
+++ b/m4/physmem.m4
@@ -1,4 +1,4 @@
-# physmem.m4 serial 6
+# physmem.m4 serial 7
 dnl Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -12,7 +12,8 @@
     [AC_LINK_IFELSE([AC_LANG_PROGRAM(
 		      [[#include <sys/systemcfg.h>
 		      ]],
-		      [double x = _system_configuration.physmem;])],
+		      [double x = _system_configuration.physmem;
+		       if (x > 0.0) return 0;])],
       [gl_cv_var__system_configuration=yes],
       [gl_cv_var__system_configuration=no])])
 
--- a/m4/putenv.m4
+++ b/m4/putenv.m4
@@ -1,4 +1,4 @@
-# putenv.m4 serial 11
+# putenv.m4 serial 12
 dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,25 +11,21 @@
 
 AC_DEFUN([gl_FUNC_PUTENV],
 [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
-  [AC_TRY_RUN([
-    int
-    main ()
-    {
-      /* Put it in env.  */
-      if (putenv ("CONFTEST_putenv=val"))
-        return 1;
+  [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[
+    /* Put it in env.  */
+    if (putenv ("CONFTEST_putenv=val"))
+      return 1;
 
-      /* Try to remove it.  */
-      if (putenv ("CONFTEST_putenv"))
-        return 1;
+    /* Try to remove it.  */
+    if (putenv ("CONFTEST_putenv"))
+      return 1;
 
-      /* Make sure it was deleted.  */
-      if (getenv ("CONFTEST_putenv") != 0)
-        return 1;
+    /* Make sure it was deleted.  */
+    if (getenv ("CONFTEST_putenv") != 0)
+      return 1;
 
-      return 0;
-    }
-	      ],
+    return 0;
+	      ])],
 	     jm_cv_func_svid_putenv=yes,
 	     jm_cv_func_svid_putenv=no,
 	     dnl When crosscompiling, assume putenv is broken.
--- a/m4/readutmp.m4
+++ b/m4/readutmp.m4
@@ -1,4 +1,4 @@
-# readutmp.m4 serial 11
+# readutmp.m4 serial 12
 dnl Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,6 +6,9 @@
 
 AC_DEFUN([gl_READUTMP],
 [
+  dnl Persuade utmpx.h to declare utmpxname
+  AC_REQUIRE([AC_GNU_SOURCE])
+
   AC_CHECK_HEADERS_ONCE(utmp.h utmpx.h)
   if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
     AC_LIBOBJ([readutmp])
--- a/m4/rmdir-errno.m4
+++ b/m4/rmdir-errno.m4
@@ -1,4 +1,4 @@
-#serial 7
+#serial 8
 
 # Copyright (C) 2000, 2001, 2005, 2006 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
@@ -12,6 +12,7 @@
 # test runs a test to determine the actual numeric value.
 AC_DEFUN([gl_FUNC_RMDIR_NOTEMPTY],
 [dnl
+  AC_CHECK_HEADERS_ONCE(unistd.h)
   AC_CACHE_CHECK([for rmdir-not-empty errno value],
     gl_cv_func_rmdir_errno_not_empty,
     [
@@ -21,6 +22,9 @@
       AC_TRY_RUN([
 #include <stdio.h>
 #include <errno.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 	int main ()
 	{
 	  FILE *s;
--- a/m4/time_r.m4
+++ b/m4/time_r.m4
@@ -19,7 +19,8 @@
        [/* We don't need to append 'restrict's to the argument types,
 	   even though the POSIX signature has the 'restrict's,
 	   since C99 says they can't affect type compatibility.  */
-	struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;],
+	struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;
+        if (ptr) return 0;],
        [gl_cv_time_r_posix=yes],
        [gl_cv_time_r_posix=no])])
   if test $gl_cv_time_r_posix = yes; then