[RFA/commit] Cannot find in-tree libiconv.a after reconfigure.

Joel Brobecker brobecker@adacore.com
Wed Dec 30 09:03:00 GMT 2009

To reproduce the problem: build GDB once with an in-tree lilbiconv.
Then touch configure and rebuild.  The build will fail because
the path to libiconv.a has suddenly disappeared.

    gcc -g [...] /libiconv.a [...]

That's my mistake, when I changed the AM_ICONV to link against
/path/to/libiconv.a instead of using -L/path/to -liconv.
The /path/to was stored inside a variable (BUILD_LIBICONV_LIBDIR)
which is computed inside a region that is only evaluated during
the first configure, due to an AC_CACHE_CHECK. As a result, during
the reconfigure, the variable was undefined.

The fix was to change the variable name to am_cv_build_libiconv_path.
That way, this variable gets cached as well.  I am not sure whether
this is relying on a implementation side-effect, or whether all _cv_
variables were meant to be cached - the autoconf documentation is not
entirely clear about that.

2009-12-30  Joel Brobecker  <brobecker@adacore.com>

        * acinclude.m4 (AM_ICONV): If we find an in-tree libiconv.a
        that we can use, then cache the path to this archive.
        * configure: Regenerate.

Tested on x86_linux by building GDB from scratch, and then rebuilding GDB
after having touch'ed gdb/configure.

I'm planning on committing this change in a few days, if there are no

-------------- next part --------------
A non-text attachment was scrubbed...
Name: reconf.diff
Type: text/x-diff
Size: 2916 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20091230/68017dc0/attachment.bin>

More information about the Gdb-patches mailing list