From: Bruno Haible Date: Fri, 17 Sep 2010 15:50:34 +0000 (-0600) Subject: AC_FUNC_STRNLEN: more realistic cross-compilation guess X-Git-Tag: v2.68~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12d158217c3f4c235ab5bedd188d3907f925f142;p=thirdparty%2Fautoconf.git AC_FUNC_STRNLEN: more realistic cross-compilation guess * lib/autoconf/functions.m4 (AC_FUNC_STRNLEN): Require AC_CANONICAL_HOST. When cross-compiling, guess it works everywhere except on AIX. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index 77103020..f89b4126 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-09-17 Bruno Haible + + AC_FUNC_STRNLEN: more realistic cross-compilation guess + * lib/autoconf/functions.m4 (AC_FUNC_STRNLEN): Require + AC_CANONICAL_HOST. When cross-compiling, guess it works everywhere + except on AIX. + 2010-09-16 Eric Blake m4sh: fix today's AS_BOX regression diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4 index 235def3f..f03991ba 100644 --- a/lib/autoconf/functions.m4 +++ b/lib/autoconf/functions.m4 @@ -1673,6 +1673,7 @@ LIBS="-lintl $LIBS"])])dnl AN_FUNCTION([strnlen], [AC_FUNC_STRNLEN]) AC_DEFUN([AC_FUNC_STRNLEN], [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])dnl +AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles AC_CACHE_CHECK([for working strnlen], ac_cv_func_strnlen_working, [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[ #define S "foobar" @@ -1692,7 +1693,11 @@ AC_CACHE_CHECK([for working strnlen], ac_cv_func_strnlen_working, ]])], [ac_cv_func_strnlen_working=yes], [ac_cv_func_strnlen_working=no], - [ac_cv_func_strnlen_working=no])]) + [# Guess no on AIX systems, yes otherwise. + case "$host_os" in + aix*) ac_cv_func_strnlen_working=no;; + *) ac_cv_func_strnlen_working=yes;; + esac])]) test $ac_cv_func_strnlen_working = no && AC_LIBOBJ([strnlen]) ])# AC_FUNC_STRNLEN