I have a feeling that this is a known problem with no good solution, but
in poking around a bit in the Autoconf manual, I didn't see where it was
mentioned.  This is probably a documentation bug report asking for a
mention somewhere in Dependencies Between Macros.

The following configure.ac does very strange things:

AC_INIT([test], [1.0], [EMAIL PROTECTED])
if test true = false ; then
    AC_CHECK_HEADERS([foo.h])
fi
if test true = true ; then
    AC_CHECK_HEADERS([stdio.h])
fi

windlord:~/tmp/test> ./configure
checking stdio.h usability... no
checking stdio.h presence... no
checking for stdio.h... no

Inspecting config.log reveals that Autoconf is quietly using empty
variables for the preprocessor and compiler.  Presumably what's happened
is that the prerequisite macros for AC_CHECK_HEADERS were expanded in the
first conditional and therefore never run.

The only real solution that I can think of for this is to put the code for
all prerequisite macros at the top of configure outside of any user
conditionals, but that too may break in some circumstances.

Obviously, this is a reduced test case; the actual case that triggered
this involved several layers of complex macros that just happened to
create, on one system, a situation equivalent to the above.

-- 
Russ Allbery ([EMAIL PROTECTED])             <http://www.eyrie.org/~eagle/>


_______________________________________________
Autoconf mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/autoconf

Reply via email to