From: Bruno Haible Date: Wed, 5 Jul 2006 12:46:39 +0000 (+0000) Subject: Fix for cross-compilation. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8af80d6b025bc0fb5b8aafbf947d5c19c7133991;p=pspp Fix for cross-compilation. --- diff --git a/m4/ChangeLog b/m4/ChangeLog index d11fddef55..0311116792 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,9 @@ +2006-07-03 Bruno Haible + + * strndup.m4 (gl_FUNC_STRNDUP): When cross-compiling, check whether + the function exists, before testing against AIX. + Reported by Martin Lambers . + 2006-07-04 Paul Eggert * absolute-header.m4 (gl_ABSOLUTE_HEADER): Prepend three slashes diff --git a/m4/strndup.m4 b/m4/strndup.m4 index 48b15cc035..e333f5cfdb 100644 --- a/m4/strndup.m4 +++ b/m4/strndup.m4 @@ -1,4 +1,4 @@ -# strndup.m4 serial 6 +# strndup.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, @@ -27,13 +27,15 @@ AC_DEFUN([gl_FUNC_STRNDUP], return s[13] != '\0';]])], [gl_cv_func_strndup=yes], [gl_cv_func_strndup=no], - [AC_EGREP_CPP([too risky], [ + [AC_CHECK_FUNC([strndup], + [AC_EGREP_CPP([too risky], [ #ifdef _AIX - too risky + too risky #endif - ], - [gl_cv_func_strndup=no], - [gl_cv_func_strndup=yes])])]) + ], + [gl_cv_func_strndup=no], + [gl_cv_func_strndup=yes])], + [gl_cv_func_strndup=no])])]) if test $gl_cv_func_strndup = yes; then AC_DEFINE([HAVE_STRNDUP], 1, [Define if you have the strndup() function and it works.])