On Mon, 2007-07-23 at 23:27 +0200, Bruno Haible wrote:
> Hello,
> mkdir confdir1
> mkdir confdir2
> echo ... > confdir1/conftest.h
> echo ... > confdir2/conftest.h
> save_CPPFLAGS="$CPPFLAGS"
> CPPFLAGS="$CPPFLAGS -Iconfdir1 -Iconfdir2"
> AC_PREPROC_IFELSE([#include <conftest.h>], ...)
> CPPFLAGS="$save_CPPFLAGS"
>
> ? This should be more robust.
Hi,
Yes, that sounds good. Note that I have not done a copyright assignment
for gnulib, however this change is trivial.
Peter
--- m4/include_next.m4 2007-07-06 02:26:24.799263725 +0000
+++ m4/include_next.m4 2007-07-23 22:04:41.633470389 +0000
@@ -11,9 +11,23 @@
AC_LANG_PREPROC_REQUIRE()
AC_CACHE_CHECK([whether the preprocessor supports include_next],
[gl_cv_have_include_next],
- [AC_PREPROC_IFELSE([#include_next <stddef.h>],
+ [mkdir conftestd1 conftestd2
+cat << _gl_EOF > conftestd1/conftest.h
+#include_next <conftest.h>
+_gl_EOF
+cat << _gl_EOF > conftestd2/conftest.h
+int main () {
+ return 0;
+}
+_gl_EOF
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2"
+AC_LINK_IFELSE([#include <conftest.h>],
[gl_cv_have_include_next=yes],
- [gl_cv_have_include_next=no])])
+ [gl_cv_have_include_next=no])
+rm -rf conftestd1 conftestd2
+CPPFLAGS="$save_CPPFLAGS"
+])
if test $gl_cv_have_include_next = yes; then
dnl FIXME: Remove HAVE_INCLUDE_NEXT and update everything that uses it