Aggressively optimize the checks against Boost libraries.
commit7e5098a6a174232f5aa36f5369d996f98e2b1905
authorBenoit Sigoure <tsuna@lrde.epita.fr>
Mon, 19 Nov 2007 23:28:02 +0000 (20 00:28 +0100)
committerBenoit Sigoure <tsuna@lrde.epita.fr>
Tue, 20 Nov 2007 00:11:18 +0000 (20 01:11 +0100)
treef32765029241c2309c036f3a2a83d3ec01dd9ed7
parent8690769991d3b9115d43ff656b5240dd18ebe747
Aggressively optimize the checks against Boost libraries.

Checking for Boost libraries that require linking was very slow
because it took several iteration to discover the proper link flags
to use to properly compile+link a C++ test file.  The test file was
thus compiled over and over again until the right set of flag is
found.  Compilation is time-consuming, especially with Boost, so the
trick is to compile the file once and then try to link it.
Unfortunately, Autoconf doesn't seem to allow this and always wants
to delete the intermediate object file.  This file thus bypasses one
of the Autoconf internal macro to retain the object file.
On a test case which checks for 2 libraries, the configure time is
reduced by a factor of 5 on my laptop (~100s -> ~20s).
* build-aux/boost.m4 (BOOST_FIND_LIB): Compile the test file once
and then try to link it.
(_BOOST_AC_LINK_IFELSE): Fork of the Autoconf macro _AC_LINK_IFELSE.
Optimization suggested by David Herring.

Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
ChangeLog
build-aux/boost.m4