Re: configure questions

Chris Seawood <[email protected]> Thu, 11 Apr 2002 09:52:02 -0700
Newsgroups gmane.comp.mozilla.builds
Organization Peace and Love, Inc.
Message-ID <[email protected]>
Jonathan Wilson wrote:
> I am currently working on bug 134113.
> The first step is to add a special switch (that will be set in mozconfig 
> or by passing to configure) that will tell the configure system that you 
> want to use GCC instead of MSVC to build with.


> Questions:
> 1.what should I use as a switch? (I recon something like use_cygwin_gcc 
> but I want to make sure I folow any established standards for this)

The standard is to pass the non-default compiler to configure via the CC 
env variable.
env CC=gcc ./configure

The problem that we'll have is that most configure scripts use gcc as 
the default so that's what people will expect.

> 2.how would this then get set in the mozconfig? (would I just add 
> use_cygwin_gcc=1 to mozconfig)?

CC=gcc

> 4.how do I make sure my flag is passed onto the configure scripts for NSPR?

NSPR will inherit the CC variable that's passed into the toplevel configure.

> and 5.within the configure script, how do I test the status of my flag?

There are already variables established for determining whether or not 
you're using GCC, GNU_CC & GNU_CXX.

> (looking at existing examples, its got something to do with a command 
> called test, how do I use that?)

Um.  You really should pick up a book on shell scripting before touching 
configure.in.  In the meantime, 'man bash' and look for "CONDITIONAL 
EXPRESSIONS".

> Either that or change the test for _win32_msvc so that it tests for 
> _win32_msvc as before but also tests to see that use_cygwin_gcc is clear 
> before setting the skip flags.

If you pass CC=gcc into configure, _WIN32_MSVC will never be set.  The 
exception to that is if you use the MKS or NS uname but that can easy be 
fixed by making those use the same case block as cygwin.

- cls
--
"In the beginning the Universe was created.  This has made a lot
  of people very angry and been widely regarded as a bad move."
    - Douglas Adams, The Restaurant At The End Of The Universe