[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: call AC_DISABLE_SHARED "conditionally" for a certain host
From: |
Ralf Wildenhues |
Subject: |
Re: call AC_DISABLE_SHARED "conditionally" for a certain host |
Date: |
Tue, 14 Feb 2006 23:44:21 +0100 |
User-agent: |
Mutt/1.5.9i |
[ removing the autoconf list ]
> * Florian Schricker wrote on Tue, Feb 14, 2006 at 11:03:50AM CET:
> >
> > AC_CANONICAL_HOST
> > case "$host" in
> > *-*-linux* | *-*-darwin*)
> > ;;
> > *-*-mingw32*)
> > AC_DISABLE_SHARED
> > ;;
> > esac
> >
> > But I guess I am missing something; it does not work. Running this
> > configure on GNU/Linux gives:
> >
> > checking whether to build shared libraries...
> > checking whether to build static libraries... yes
>
> Confirmed with both branch-1-5 and HEAD.
> I'm inclined to "fix" this by adjusting the documentation, not the
> implementation of these macros.
Hrmpf. CVS HEAD Libtool's new interface actually leaves less
flexibility for the user there.
This will not work:
case $host in
foo) set_shared=disable-shared ;;
*) set_shared= ;;
esac
LT_INIT([$set_shared])
because the arguments to LT_INIT are interpreted at m4 time already.
And this
case $host in
foo) LT_INIT([disable-shared]) ;;
*) LT_INIT ;;
esac
will cause *major* breakage (thanks to AC_REQUIRE). :-/
Even this, broken as it is for other reasons:
AS_IF([test "$host_os" = linux-gnu],
[LT_INIT],
[AS_IF([test "$host_os" = mingw32]
[LT_INIT([disable-shared])])])
will not work: we make sure LT_INIT is expanded only once.
Luckily we do have full backward compatible support for
AC_DISABLE_SHARED and related macros, including their respective bugs.
I'm just wondering whether we should reconsider obsoleting it: I regard
the aforementioned use as quite suitable.
Another lesson learned: There should be an AS_CASE.
Cheers,
Ralf