[Top][All Lists]
[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: |
18 Nov 2002 23:36:05 +0100 |
Am Mon, 2002-11-18 um 20.23 schrieb Akim Demaille:
> >> Something should be done, agreed.
>
> Ralf> Should? You must be kidding - face it: autoconf is broken to an extend
> Ralf> it is not applicable in real world, anymore.
>
> 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.
I don't know. As a matter of fact, with autoconf<=2.52 this seemed to
have worked
> I'd like to know what's the behavior people would expect in such a
> case.
First of all, I would expect a diagnosis at the time autoconf or
automake is run for cases autoconf/automake can't handle.
At present time, autoconf generates configure scripts that work at
random.
> For instance, what do you expect for
>
> AC_INIT
> if false; then
> AC_PROG_CXX
> fi
> AC_LANG(C++)
> AC_CHECK_FUNCS(foo)
IMO, this is a pathological case.
A typical Makefile using CXX conditionally looks similiar to this:
AC_INIT
AC_ARG_ENABLE(cxx ...)
if enable_cxx
AC_PROG_CXX
AC_CHECK_<something>
AM_CONDITIONAL( ..., yes)
else
....
AM_CONDITIONAL(...,no)
fi
AM_CONDITIONAL(....)
In your particular case I would expect one of 3 possibilities:
1. Autoconf issuing an error "Can't handle this" (c.f. how automake
treats conditional AM_CONDITIONALs)
2. Autoconf to ignore all AC_CHECK_* if CXX is not defined/unset.
3. Autoconf to abort if CXX is not defined/set.
> Or even what you expect for the Makefiles.
>
> Autoconf was designed with the fundamental fact that compiler (=
> language support) is not an option: it's a must. Now people want
> optional language support; it has to be designed.
> It is not at all clear to me that the above example is valid.
Neither to me. But compare it to the example above, or the example I had
attached to my initial report.
> It
> seems to me that the requirement for a compiler holds for the whole
> configure,
Hmm, I thought it the scope of the compile was defined by using
AC_LANG_PUSH/POP, this would mean if AC_PROG_CC and AC_PROG_CXX are used
consecutively it should apply an implicit PUSH/POP rsp. autoconf should
refuse to accept this.
Ralf