bug-automake
[Top][All Lists]
Advanced

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

Re: Can't call AC_PROG_CXX conditionally


From: Ralf Corsepius
Subject: Re: Can't call AC_PROG_CXX conditionally
Date: 19 Nov 2002 11:55:22 +0100

Am Die, 2002-11-19 um 09.39 schrieb Akim Demaille:
>  >> Well, if that's the way you want to say it, I can't do anything.  My
>  >> opinion is that this is indeed a serious problem, but in itself does
>  >> not suffice to throw away Autoconf.  It's been like this since the
>  >> very first day of Autoconf.
>  Ralf> I don't know. As a matter of fact, with autoconf<=2.52 this seemed to
>  Ralf> have worked
> 
> ``seemed'' is truly the right word.
> 
> /tmp % cat configure.in                                           nostromo 
> 9:31
> AC_PREREQ(2.13)
> AC_INIT
> if false; then
>   AC_PROG_CC
> fi
> AC_CHECK_FUNCS(printf exit)
> AC_OUTPUT
> /tmp % autoconf2.13                                               nostromo 
> 9:33
> /tmp % ./configure                                                nostromo 
> 9:33
> creating cache ./config.cache
> checking for printf... yes
> checking for exit... yes
> updating cache ./config.cache
> creating ./config.status
> 
> It `seems' to work, but notice it really didn't try to find a
> compiler: there is only the fact that CC *defaults* to cc, which is OK
> on my machine.
> 
> 
>  Ralf> First of all, I would expect a diagnosis at the time autoconf or
>  Ralf> automake is run for cases autoconf/automake can't handle.
>  Ralf> At present time, autoconf generates configure scripts that work at
>  Ralf> random.
> 
> Well, I somewhat disagree with you: the behavior is not pleasant,
> yes.  But it is ``random'' when you get out of the lines.
They are random, when you have 100s of configure scripts laying around
in a deep subtree - This is the situation I am facing, Depending upon
configuration arguments in use, this sometimes triggers the bug,
sometimes not (because a configure script is not used), or works. 

>   The lines
> are: no test should be optional, only decisions.

That's another problem: It is inapplicable in many cases, because in
such cases you normally want to switch between alternatives.

>  >> For instance, what do you expect for
>  >> 
>  >> AC_INIT
>  >> if false; then
>  >> AC_PROG_CXX
>  >> fi
>  >> AC_LANG(C++)
>  >> AC_CHECK_FUNCS(foo)
>  Ralf> IMO, this is a pathological case.
> 
> Ah, OK.  I thought we were addressing this very one.
The difference between your and my example I see is:
You are using the AC_CHECK outside of the if-block, while I used blocks
sorted per language. (if cxx_enabled; then AC_PROC_CXX; CXX-checks...;
else ...)

Ralf






reply via email to

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