# HG changeset patch # User Eric Blake # Date 1242917292 -7200 # Node ID dc80f2cc1327e93bef82395fc818d28e2b469d84 # Parent ee81f977f3baa61147984c8d8d1ff9d99c6cb3ae Second attempt to work around an AIX 5.3, 6.1 compiler bug with include_next. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-05-21 Eric Blake + Bruno Haible + + Second attempt to work around an AIX 5.3, 6.1 compiler bug with + include_next. Fix of 2008-11-20 commit. + * m4/include_next.m4 (gl_CHECK_NEXT_HEADERS): Also set + NEXT_AS_FIRST_DIRECTIVE_FOO_H. + * lib/math.in.h: Use NEXT_AS_FIRST_DIRECTIVE_MATH_H instead of + NEXT_MATH_H. + * modules/math (Makefile.am): Substitute NEXT_AS_FIRST_DIRECTIVE_MATH_H + instead of NEXT_MATH_H. + 2009-05-21 Bruno Haible Avoid redefinition warnings for SIZE_MAX. diff --git a/lib/math.in.h b/lib/math.in.h --- a/lib/math.in.h +++ b/lib/math.in.h @@ -22,7 +22,7 @@ #endif /* The include_next requires a split double-inclusion guard. */ -#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_MATH_H@ +#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@ #ifndef _GL_MATH_H #define _GL_MATH_H diff --git a/m4/include_next.m4 b/m4/include_next.m4 --- a/m4/include_next.m4 +++ b/m4/include_next.m4 @@ -1,4 +1,4 @@ -# include_next.m4 serial 12 +# include_next.m4 serial 13 dnl Copyright (C) 2006-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -104,8 +104,14 @@ # For each arg foo.h, if #include_next works, define NEXT_FOO_H to be # ''; otherwise define it to be # '"///usr/include/foo.h"', or whatever other absolute file name is suitable. +# Also, if #include_next works as first preprocessing directive in a file, +# define NEXT_AS_FIRST_DIRECTIVE_FOO_H to be ''; otherwise define it to +# be +# '"///usr/include/foo.h"', or whatever other absolute file name is suitable. # That way, a header file with the following line: # #@INCLUDE_NEXT@ @NEXT_FOO_H@ +# or +# #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@ # behaves (after sed substitution) as if it contained # #include_next # even if the compiler does not support include_next. @@ -167,5 +173,15 @@ AC_SUBST( AS_TR_CPP([NEXT_]m4_quote(m4_defn([gl_HEADER_NAME]))), [AS_VAR_GET([gl_next_header])]) + if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next = buggy; then + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next' + gl_next_as_first_directive='<'gl_HEADER_NAME'>' + else + # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include' + gl_next_as_first_directive=AS_VAR_GET([gl_next_header]) + fi + AC_SUBST( + AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_quote(m4_defn([gl_HEADER_NAME]))), + [$gl_next_as_first_directive]) AS_VAR_POPDEF([gl_next_header])]) ]) diff --git a/modules/math b/modules/math --- a/modules/math +++ b/modules/math @@ -22,7 +22,7 @@ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \ sed -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ - -e 's|@''NEXT_MATH_H''@|$(NEXT_MATH_H)|g' \ + -e 's|@''NEXT_AS_FIRST_DIRECTIVE_MATH_H''@|$(NEXT_AS_FIRST_DIRECTIVE_MATH_H)|g' \ -e 's|@''GNULIB_CEILF''@|$(GNULIB_CEILF)|g' \ -e 's|@''GNULIB_CEILL''@|$(GNULIB_CEILL)|g' \ -e 's|@''GNULIB_FLOORF''@|$(GNULIB_FLOORF)|g' \