autoconf
[Top][All Lists]
Advanced

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

Re: conditionally using libtool


From: Ralf Wildenhues
Subject: Re: conditionally using libtool
Date: Sat, 29 Apr 2006 17:50:41 +0200
User-agent: Mutt/1.5.11+cvs20060403

* Bob Rossi wrote on Sat, Apr 29, 2006 at 12:15:49PM CEST:
> On Sat, Apr 29, 2006 at 09:09:19AM +0200, Ralf Wildenhues wrote:
> > * Bob Rossi wrote on Sat, Apr 29, 2006 at 04:00:03AM CEST:
> > > 
> > > Can I do something in configure.in that says 
> > >   if .. 
> > >     AM_LIBTOOL
> > >   fi;
> > > 
> > > or is this invalid?
> > 
> > This is invalid and will break at unfortunate places.

> Thanks for the advice. This was definatly a typo on my part. I'm using
> AC_PROG_LIBTOOL.

> However, I was burned before by putting a macro in an 'if' statement.

Right.

> I was wondering if it was OK to use AC_PROG_LIBTOOL in an if
> statement.

No.  To put it very explicitly: the code Russ posted may cause seemingly
unrelated breakage.  You get to keep the pieces.  And yes, it also may
"just happen to work".

One example for why it may break in really weird ways: say, you use two
macros which both AC_REQUIRE([AC_PROG_SED]) (which is a realistic
situation when Autoconf-2.60 and Libtool-2.0 are out).  Say
AC_PROG_LIBTOOL happens to be used earlier in configure.ac, like this:

  if $whatever; then
    AC_PROG_LIBTOOL
  fi

then the expansion of AC_PROG_SED will happen right after the if
condition.  The other macro that needs it, which, say, is called
unconditionally, will assume AC_PROG_SED has already been expanded.
But if $whatever turns out to be false, the corresponding code will
not be run.

The AS_IF of Autoconf-2.60 will mediate this somewhat.  But until
then I can only warn of such usage.

Cheers,
Ralf




reply via email to

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