autoconf-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Autoconf source repository branch, master, updated. v2.69-3-g7


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.69-3-g7fbb553
Date: Thu, 03 May 2012 16:55:31 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=7fbb553727ed7e0e689a17594b58559ecf3ea6e9

The branch, master has been updated
       via  7fbb553727ed7e0e689a17594b58559ecf3ea6e9 (commit)
       via  926a43c86d0c6c896079fd0f1363f943075e43b7 (commit)
      from  2d4eb959325a8c7af0c03c9ed580c563b04d77cb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7fbb553727ed7e0e689a17594b58559ecf3ea6e9
Author: Bruno Haible <address@hidden>
Date:   Wed May 2 23:02:49 2012 +0200

    functions: improve cross-compilation guesses for glibc system hosts
    
    Paul and Eric suggested that improving the cross-compilation guesses
    for targets that are glibc systems would be welcome here [1][2].
    
    This patch modifies the cross-compilation behaviour of
      AC_FUNC_CHOWN
      AC_FUNC_GETGROUPS
      AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
      AC_FUNC_MALLOC
      AC_FUNC_MMAP
      AC_FUNC_REALLOC
      AC_FUNC_STRCOLL
    so that when the target is a glibc system (or, in case of AC_FUNC_MALLOC
    and AC_FUNC_REALLOC, any known "good" Unix system), the guess is
    "yes it works" rather than "guessing no".
    
    This is important because some of these macros are used in Gnulib, and
    in case of "guessing no" Gnulib provides extra workaround code, and
      1) Generally, when targetting embedded systems, code size should be
         minimized,
      2) In [3], unnecessary workaround code will look like a Glibc bug.
    
    This patch also changes the configure output to "guessing yes" or
    "guessing no" in a case where the ac_cv_* variable is undocumented.
    
    [1] http://lists.gnu.org/archive/html/bug-gnulib/2012-05/msg00010.html
    [2] http://lists.gnu.org/archive/html/bug-gnulib/2012-05/msg00013.html
    [3] http://sourceware.org/glibc/wiki/Testing/Gnulib
    
    This patch was tested with the simple configure.ac file
    =============== configure.ac ==================
    AC_INIT([dummy], [0])
    AC_FUNC_CHOWN
    AC_FUNC_GETGROUPS
    AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
    AC_FUNC_MALLOC
    AC_FUNC_MMAP
    AC_FUNC_REALLOC
    AC_FUNC_STRCOLL
    AC_OUTPUT
    ===============================================
    
    * lib/autoconf/functions.m4 (AC_FUNC_CHOWN): Require AC_CANONICAL_HOST.
    When cross-compiling to a glibc system, guess yes.
    (AC_FUNC_GETGROUPS): Likewise.
    (AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK): Likewise.
    (AC_FUNC_STRCOLL): Likewise.
    (_AC_FUNC_MALLOC_IF): Require AC_CANONICAL_HOST. When cross-compiling
    to a know Unix system other than AIX and OSF/1, guess yes.
    (_AC_FUNC_REALLOC_IF): Likewise.
    (AC_FUNC_MMAP): Require AC_CANONICAL_HOST. When cross-compiling to a
    system with a Linux kernel, guess yes.

commit 926a43c86d0c6c896079fd0f1363f943075e43b7
Author: Eric Blake <address@hidden>
Date:   Thu May 3 09:28:20 2012 -0600

    doc: fix another bad @xref
    
    Obviously, I didn't fully test commit f35498d.
    
    * doc/autoconf.texi (Limitations of Builtins): Add a comma.
    
    Signed-off-by: Eric Blake <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 doc/autoconf.texi         |    2 +-
 lib/autoconf/functions.m4 |   76 ++++++++++++++++++++++++++++++++++++--------
 2 files changed, 63 insertions(+), 15 deletions(-)

diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 34ca213..393e38f 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -17874,7 +17874,7 @@ for an @command{echo} that does not interpret @samp{\} 
or leading
 @samp{-}. With Solaris @command{ksh}, it is possible to use @code{print
 -r --} for this role instead.
 
address@hidden, , Limitations of Shell Builtins} for a discussion of
address@hidden, , Limitations of Shell Builtins}, for a discussion of
 portable alternatives to both @command{printf} and @command{echo}.
 
 
diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4
index 6f21fd5..97cb7b9 100644
--- a/lib/autoconf/functions.m4
+++ b/lib/autoconf/functions.m4
@@ -423,6 +423,7 @@ AU_ALIAS([AC_ALLOCA], [AC_FUNC_ALLOCA])
 AN_FUNCTION([chown], [AC_FUNC_CHOWN])
 AC_DEFUN([AC_FUNC_CHOWN],
 [AC_REQUIRE([AC_TYPE_UID_T])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
 AC_CHECK_HEADERS(unistd.h)
 AC_CACHE_CHECK([for working chown], ac_cv_func_chown_works,
 [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
@@ -443,7 +444,12 @@ AC_CACHE_CHECK([for working chown], ac_cv_func_chown_works,
 ]])],
               [ac_cv_func_chown_works=yes],
               [ac_cv_func_chown_works=no],
-              [ac_cv_func_chown_works=no])
+              [case "$host_os" in # ((
+                         # Guess yes on glibc systems.
+                 *-gnu*) ac_cv_func_chown_works=yes ;;
+                         # If we don't know, assume the worst.
+                 *)      ac_cv_func_chown_works=no ;;
+               esac])
 rm -f conftest.chown
 ])
 if test $ac_cv_func_chown_works = yes; then
@@ -625,6 +631,7 @@ AN_FUNCTION([getgroups], [AC_FUNC_GETGROUPS])
 AC_DEFUN([AC_FUNC_GETGROUPS],
 [AC_REQUIRE([AC_TYPE_GETGROUPS])dnl
 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
 AC_CHECK_FUNC(getgroups)
 
 # If we don't yet have getgroups, see if it's in -lbsd.
@@ -643,15 +650,22 @@ if test $ac_cv_func_getgroups = yes; then
        return getgroups (0, 0) == -1;]])],
                  [ac_cv_func_getgroups_works=yes],
                  [ac_cv_func_getgroups_works=no],
-                 [ac_cv_func_getgroups_works=no])
+                 [case "$host_os" in # ((
+                            # Guess yes on glibc systems.
+                    *-gnu*) ac_cv_func_getgroups_works="guessing yes" ;;
+                            # If we don't know, assume the worst.
+                    *)      ac_cv_func_getgroups_works="guessing no" ;;
+                  esac])
    ])
 else
   ac_cv_func_getgroups_works=no
 fi
-if test $ac_cv_func_getgroups_works = yes; then
-  AC_DEFINE(HAVE_GETGROUPS, 1,
-           [Define to 1 if your system has a working `getgroups' function.])
-fi
+case "$ac_cv_func_getgroups_works" in
+  *yes)
+    AC_DEFINE(HAVE_GETGROUPS, 1,
+             [Define to 1 if your system has a working `getgroups' function.])
+    ;;
+esac
 LIBS=$ac_save_LIBS
 ])# AC_FUNC_GETGROUPS
 
@@ -847,7 +861,8 @@ fi
 # calls lstat a second time when necessary.
 AN_FUNCTION([lstat], [AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
 AC_DEFUN([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
-[AC_CACHE_CHECK(
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
+AC_CACHE_CHECK(
        [whether lstat correctly handles trailing slash],
        [ac_cv_func_lstat_dereferences_slashed_symlink],
 [rm -f conftest.sym conftest.file
@@ -861,7 +876,12 @@ if test "$as_ln_s" = "ln -s" && ln -s conftest.file 
conftest.sym; then
      return lstat ("conftest.sym/", &sbuf) == 0;])],
                [ac_cv_func_lstat_dereferences_slashed_symlink=yes],
                [ac_cv_func_lstat_dereferences_slashed_symlink=no],
-               [ac_cv_func_lstat_dereferences_slashed_symlink=no])
+               [case "$host_os" in # ((
+                          # Guess yes on glibc systems.
+                  *-gnu*) ac_cv_func_lstat_dereferences_slashed_symlink=yes ;;
+                          # If we don't know, assume the worst.
+                  *)      ac_cv_func_lstat_dereferences_slashed_symlink=no ;;
+                esac])
 else
   # If the `ln -s' command failed, then we probably don't even
   # have an lstat function.
@@ -886,6 +906,7 @@ fi
 # If `malloc (0)' properly handled, run IF-WORKS, otherwise, IF-NOT.
 AC_DEFUN([_AC_FUNC_MALLOC_IF],
 [AC_REQUIRE([AC_HEADER_STDC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
 AC_CHECK_HEADERS(stdlib.h)
 AC_CACHE_CHECK([for GNU libc compatible malloc], ac_cv_func_malloc_0_nonnull,
 [AC_RUN_IFELSE(
@@ -899,7 +920,14 @@ char *malloc ();
                 [return ! malloc (0);])],
               [ac_cv_func_malloc_0_nonnull=yes],
               [ac_cv_func_malloc_0_nonnull=no],
-              [ac_cv_func_malloc_0_nonnull=no])])
+              [case "$host_os" in # ((
+                 # Guess yes on platforms where we know the result.
+                 *-gnu* | freebsd* | netbsd* | openbsd* \
+                 | hpux* | solaris* | cygwin* | mingw*)
+                   ac_cv_func_malloc_0_nonnull=yes ;;
+                 # If we don't know, assume the worst.
+                 *) ac_cv_func_malloc_0_nonnull=no ;;
+               esac])])
 AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2])
 ])# _AC_FUNC_MALLOC_IF
 
@@ -1199,7 +1227,8 @@ AU_ALIAS([AM_FUNC_MKTIME], [AC_FUNC_MKTIME])
 # ------------
 AN_FUNCTION([mmap], [AC_FUNC_MMAP])
 AC_DEFUN([AC_FUNC_MMAP],
-[AC_CHECK_HEADERS_ONCE([stdlib.h unistd.h sys/param.h])
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
+AC_CHECK_HEADERS_ONCE([stdlib.h unistd.h sys/param.h])
 AC_CHECK_FUNCS([getpagesize])
 AC_CACHE_CHECK([for working mmap], [ac_cv_func_mmap_fixed_mapped],
 [AC_RUN_IFELSE([AC_LANG_SOURCE([AC_INCLUDES_DEFAULT]
@@ -1340,7 +1369,12 @@ main ()
 }]])],
               [ac_cv_func_mmap_fixed_mapped=yes],
               [ac_cv_func_mmap_fixed_mapped=no],
-              [ac_cv_func_mmap_fixed_mapped=no])])
+              [case "$host_os" in # ((
+                         # Guess yes on platforms where we know the result.
+                 linux*) ac_cv_func_mmap_fixed_mapped=yes ;;
+                         # If we don't know, assume the worst.
+                 *)      ac_cv_func_mmap_fixed_mapped=no ;;
+               esac])])
 if test $ac_cv_func_mmap_fixed_mapped = yes; then
   AC_DEFINE([HAVE_MMAP], [1],
            [Define to 1 if you have a working `mmap' system call.])
@@ -1391,6 +1425,7 @@ AU_ALIAS([AM_FUNC_OBSTACK], [AC_FUNC_OBSTACK])
 # If `realloc (0, 0)' is properly handled, run IF-WORKS, otherwise, IF-NOT.
 AC_DEFUN([_AC_FUNC_REALLOC_IF],
 [AC_REQUIRE([AC_HEADER_STDC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
 AC_CHECK_HEADERS(stdlib.h)
 AC_CACHE_CHECK([for GNU libc compatible realloc], ac_cv_func_realloc_0_nonnull,
 [AC_RUN_IFELSE(
@@ -1404,7 +1439,14 @@ char *realloc ();
                 [return ! realloc (0, 0);])],
               [ac_cv_func_realloc_0_nonnull=yes],
               [ac_cv_func_realloc_0_nonnull=no],
-              [ac_cv_func_realloc_0_nonnull=no])])
+              [case "$host_os" in # ((
+                 # Guess yes on platforms where we know the result.
+                 *-gnu* | freebsd* | netbsd* | openbsd* \
+                 | hpux* | solaris* | cygwin* | mingw*)
+                   ac_cv_func_realloc_0_nonnull=yes ;;
+                 # If we don't know, assume the worst.
+                 *) ac_cv_func_realloc_0_nonnull=no ;;
+               esac])])
 AS_IF([test $ac_cv_func_realloc_0_nonnull = yes], [$1], [$2])
 ])# AC_FUNC_REALLOC
 
@@ -1723,14 +1765,20 @@ AU_ALIAS([AC_SETVBUF_REVERSED], 
[AC_FUNC_SETVBUF_REVERSED])
 # ---------------
 AN_FUNCTION([strcoll], [AC_FUNC_STRCOLL])
 AC_DEFUN([AC_FUNC_STRCOLL],
-[AC_CACHE_CHECK(for working strcoll, ac_cv_func_strcoll_works,
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
+AC_CACHE_CHECK(for working strcoll, ac_cv_func_strcoll_works,
 [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
   [[return (strcoll ("abc", "def") >= 0 ||
         strcoll ("ABC", "DEF") >= 0 ||
         strcoll ("123", "456") >= 0)]])],
               ac_cv_func_strcoll_works=yes,
               ac_cv_func_strcoll_works=no,
-              ac_cv_func_strcoll_works=no)])
+              [case "$host_os" in # ((
+                         # Guess yes on glibc systems.
+                 *-gnu*) ac_cv_func_strcoll_works=yes ;;
+                         # If we don't know, assume the worst.
+                 *)      ac_cv_func_strcoll_works=no ;;
+               esac])])
 if test $ac_cv_func_strcoll_works = yes; then
   AC_DEFINE(HAVE_STRCOLL, 1,
            [Define to 1 if you have the `strcoll' function and it is properly


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

[Prev in Thread] Current Thread [Next in Thread]