From dd5848b18dd95feb771055453a473a73a6eb7cfb Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Wed, 25 Jul 2007 08:11:26 +0000 Subject: [PATCH] Fix the include_next test so that it rejects AIX 4.3 xlc. --- ChangeLog | 9 +++++++++ m4/include_next.m4 | 28 +++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fa33df85be..e3286fba7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-07-25 Peter O'Gorman + Bruno Haible + + * m4/include_next.m4 (gl_INCLUDE_NEXT): Test whether #include_next + really works. Needed because AIX 4.3 "xlc -E" doesn't understand + #include_next, gives a diagnostic about it, but reports no error in + the exit code. + Reported by Gary V. Vaughan . + 2007-07-24 Ben Pfaff Improve name: "count-one-bits" is better than "popcount". diff --git a/m4/include_next.m4 b/m4/include_next.m4 index 4dc84c958c..7ce472bc0a 100644 --- a/m4/include_next.m4 +++ b/m4/include_next.m4 @@ -1,4 +1,4 @@ -# include_next.m4 serial 3 +# include_next.m4 serial 4 dnl Copyright (C) 2006, 2007 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,9 +11,31 @@ AC_DEFUN([gl_INCLUDE_NEXT], AC_LANG_PREPROC_REQUIRE() AC_CACHE_CHECK([whether the preprocessor supports include_next], [gl_cv_have_include_next], - [AC_PREPROC_IFELSE([#include_next ], + [rm -rf conftestd1 conftestd2 + mkdir conftestd1 conftestd2 + cat < conftestd1/conftest.h +#define DEFINED_IN_CONFTESTD1 +#include_next +#ifdef DEFINED_IN_CONFTESTD2 +int foo; +#else +#error "include_next doesn't work" +#endif +EOF + cat < conftestd2/conftest.h +#ifndef DEFINED_IN_CONFTESTD1 +#error "include_next test doesn't work" +#endif +#define DEFINED_IN_CONFTESTD2 +EOF + save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2" + AC_COMPILE_IFELSE([#include ], [gl_cv_have_include_next=yes], - [gl_cv_have_include_next=no])]) + [gl_cv_have_include_next=no]) + CPPFLAGS="$save_CPPFLAGS" + rm -rf conftestd1 conftestd2 + ]) if test $gl_cv_have_include_next = yes; then dnl FIXME: Remove HAVE_INCLUDE_NEXT and update everything that uses it -- 2.30.2