+2010-09-17 Bruno Haible <bruno@clisp.org>
+
+ 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 <eblake@redhat.com>
m4sh: fix today's AS_BOX regression
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"
]])],
[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