[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LIBTOOL_DEPS wrong when AC_CANONICAL_BUILD not called before initial
From: |
Ralf Wildenhues |
Subject: |
Re: LIBTOOL_DEPS wrong when AC_CANONICAL_BUILD not called before initializing libtool |
Date: |
Sat, 15 Mar 2008 14:38:27 +0100 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
Hello Jakub,
* Jakub Bogusz wrote on Fri, Mar 14, 2008 at 08:18:55PM CET:
> On Fri, Mar 14, 2008 at 07:53:13PM +0100, Jakub Bogusz wrote:
> > Reduced test:
> >
> > #v+
> > AC_INIT([libtool-test], [0])
> >
> > if test "$with_canonical" != ""; then
> > AC_CANONICAL_HOST
> > fi
> >
> > AC_LIBTOOL_WIN32_DLL
> > AC_PROG_LIBTOOL
> >
> > echo "NM: $NM"
> > echo "OBJDUMP: $OBJDUMP"
> > #v-
Thanks, but the above is a problem that cannot be solved with current
Autoconf. The issue is that an AC_REQUIRE'ment is met by any previously
expanded macro, autoconf cannot see the fact that AC_CANONICAL_HOST was
expanded inside a shell conditional.
The way to avoid this is to simply not put AC_CANONICAL_HOST inside a
shell conditional in the first place. If the original problematic code
you had used some other macro there instead, which itself AC_REQUIRE'd
AC_CANONICAL_HOST, then the way to solve that setup is to use
AS_IF([test $some_conditional],
[MACRO_THAT_REQUIRES_AC_CANONICAL_HOST])
because in that case (with Autoconf 2.61+), AC_CANONICAL_HOST will be
expanded outside (before) the if statement. For more information, you
can e.g. read this thread
<http://thread.gmane.org/gmane.comp.sysutils.autoconf.general/10187/focus=10188>
and the one referenced in that message, and the doc pointers given
there.
> And I've just found another problem related to AC_CANONICAL_BUILD placed
> to late (or ltmain= substitution too early). For this one cross compiler
> is not needed. Just add one more line at the end of the above configure.ac:
>
> echo "LIBTOOL_DEPS: $LIBTOOL_DEPS"
>
> then regenerate configure.
>
> `./configure` output ends with:
> LIBTOOL_DEPS: /ltmain.sh
>
> `./configure --with-canonical` output ends with:
> LIBTOOL_DEPS: ./ltmain.sh
>
> Note the missing "." in the first case. It's because of empty ac_aux_dir
> (used for ltmain substitution in configure) which is set by one of
> AC_CONFIG_AUX_DIR* macros, with default one called from
> AC_CANONICAL_BUILD.
That's really still the same issue, with the undocumented Autoconf macro
AC_CONFIG_AUX_DIR_DEFAULT.
Cheers,
Ralf