[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Document conftest.err for AC_LINK_IFELSE, possibly AC_RUN_IFELSE

From: Dave Hart
Subject: Document conftest.err for AC_LINK_IFELSE, possibly AC_RUN_IFELSE
Date: Mon, 21 Mar 2011 20:40:39 +0000

In investigating and coming up with a patch
to fix NTP and libevent's detection of ld --gc-sections support to
work correctly on NetBSD, I tripped over an unexpected difference
between AC_LINK_IFELSE and AC_RUN_IFELSE.  Briefly, I wanted to change
a AC_LINK_IFELSE which grep'ped conftest.err for mention of
gc-sections to run the test program as well.  My first attempt
involved changing AC_LINK_IFELSE to AC_RUN_IFELSE with an extra
argument to set the result for cross-compilation.  As I eventually
discovered, it can be dangerous to (a) rely on autoconf internals and
(b) assume AC_RUN_IFELSE is essentially a superset of AC_LINK_IFELSE.

At least with Autoconf 2.68 and automake 1.11.1, AC_RUN_IFELSE does
not redirect the compile & link command's stderr to conftest.err as
AC_LINK_IFELSE does.  To achieve what I wanted, I fell back to
AC_LINK_IFELSE with m4sh code in the action-if-true to handle the
cross-compilation result, or invoke ./conftest manually to examine its
exit code.  That still leaves me relying on an Autoconf internal, as I
couldn't find any documentation of conftest.err usability in
action-if-true of AC_LINK_IFELSE.

Is there objection to documenting conftest.err availability in
action-if-true (or both action-if-true and action-if-false) of
AC_LINK_IFELSE?  I'm open to a better way to achieve my goal of
linking a test program with access to the compile/link stderr, then
running it.

My preferred better way would be to modify and document AC_RUN_IFELSE
to also provide conftest.err to its true and false action snippets.

The first pair of links lead to the entire patch I provided for NTP
bug 1844, including two variants of the --gc-sections detection fix,
one for libevent and one for NTP:

This pair of links lead to a single copy of the changes I'm referring to:

I apologize if this would have been better suited to autoconf-patches.
 Given I have not prepared a patch, I wasn't sure which list was more

Dave Hart

reply via email to

[Prev in Thread] Current Thread [Next in Thread]