autoconf
[Top][All Lists]
Advanced

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

Re: mozilla's configure.in


From: Akim Demaille
Subject: Re: mozilla's configure.in
Date: 19 Oct 2001 12:23:25 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

>>>>> "Chris" == Chris Seawood <address@hidden> writes:

Chris> Hi, I'm the build maintainer for Mozilla.  

Hi!

Chris> This is partially understandable as we do some bad things like
Chris> calling AC_OUTPUT_SUBDIRS manually so that we can add options
Chris> to subconfigures. 

Yeah, that's bad.  The real thingy is asking for us to provide the
service you need.

Chris> However, the problem that he was getting hung up on was that
Chris> autoconf only expands some macros once, while our configure.in
Chris> calls some of them twice.  Specifically, we do:

> if test -n "$CROSS_COMPILE"; then
> <check for HOST_CC>
> <check for CC searching ${target}-gcc && ${target_alias}-gcc>
> AC_PROG_CC - to actually run the compile test
> else
> AC_PROG_CC
> <set HOST_CC=CC>
> fi

Chris> He was told that this was wrong.  Specifically,he was told:

>> That's correct, using conditional checking with Autoconf is a very
>> bad idea.  You should never do that.  Always check, and perform
>> conditional actions, but don't make conditional checks.

Chris> I probably zoned out on the discussion that covered this but
Chris> what was the purpose of only expanding the macros once?

That's a different question than the one that was asked.  The question
to which I answered is

        Is doing

        if foo; then
          AC_PROG_CC
        fi

        a bad idea?

and the answer is, yes, this is a bad idea beacuse AC_PROG_CC might
(and does) AC_REQUIRE things.  If AC_REQUIREd macros were already
expanded, then no problem.  But if it was not, then what happens is:

if foo; then
  SOME_REQUIREMENT_OF_PROG_CC
  AC_PROG_CC
fi

and if later another macro is requiring SOME_REQUIREMENT_OF_PROG_CC,
then, because your execution does not go through the if foo, the
requirements are not run.

Never run tests conditionally.  Perform too much checks, but
conditional actions.

Now, afa you are concerned, I don't see too much problems with writing
it with a single, non conditioned, AC_PROG_CC, is there?



reply via email to

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