httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <>
Subject Re: Configure and non-gcc platforms
Date Sun, 03 Aug 1997 00:58:41 GMT
On Sat, 2 Aug 1997, Jim Jagielski wrote:

> Marc Slemko wrote:
> > 
> > On Sat, 2 Aug 1997, Jim Jagielski wrote:
> > 
> > > Marc Slemko wrote:
> > > > 
> > > > Configure likes setting -O2 far too much.  In fact, when I want to use
> > > > different compiler that doesn't grok -O2 I have to work to do so.  Just
> > > > setting CC in Configure doesn't work.  Adding a blank "OPTIM=" line
> > > > doesn't work.  I actually need something on the OPTIM= line that is
> > > > non-blank so Configure won't default to -O2.  
> > > > 
> > > > Configure should know about what 
> > > 
> > > Would you prefer Configure use a default of -O instead?
> > > 
> > > Of course setting CC won't change it, because that just sets the compiler.
> > 
> > -O2 is a flag put in there for gcc.  It is not something that most
> > compilers understand.  If we aren't using gcc, we shouldn't add a default
> > of -O2.
> Course, 'cc' could be 'gcc' in disguise...

Certainly.  Note that we check for gcc first, do we not?  I think there
are few systems that use gcc for "cc" that don't also have a link to

IMHO, you either need to only use -O2 for "gcc" or you need to try running
"$CC -v" and see if you get anything resembling gcc out of it.  

Of course, I wouldn't be suprised if some versions of gcc didn't support
-O2.  cc on BSD/OS 2.x is gcc 1.x which doesn't support -O3, but it does
do -O2.  Of course, on BSD/OS that is really meant as the kernel compiler
anyway and you have other ugly hacks to do real things...  Not something
to worry much about me thinks.

> > 
> > > Setting OPTIM to "blank" reduces to a default, so of course that
> > > wouldn't work.
> > 
> > The problem is that it is bogus to have to put some fake placeholder in
> > there if you don't want any optimization flags.
> > 
> > My suggestion is that we only add -O2 if we are using gcc, and not add any
> > optimization flags otherwise.
> I would agree to a "downgrade" to -O instead of -O2 for a default.
> I don't think any other "magic transformations" of the setting
> of OPTIM should be done, though

The problem is that right now we are doing "magic transformations".  From
the user's perspective, if they just want to use a compiler without -O2
they will think it is bad magic that -O2 keeps showing up and they can't
get rid of it.

> > 
> > > > 
> > > > Oh, I think it would be cool if helpers/TestLib output error messages
to a
> > > > file and then either gave a prompt about where the file was from Configure
> > > > if it failed or automatically displayed it.  
> > > 
> > > Why? I toyed with a '-s' flag to it; By default TestLib would
> > > display all error messages and adding -s to it would make it
> > > silent. I still have that code if it's voted as a +1
> > 
> > So that I can figure out what the heck is wrong.  Otherwise I have no way
> > to see how it is trying to compile the program to see that is is using
> > option x (eg. -O2) where it shouldn't be.
> The idea behind Configure is to create a Makefile with settings as
> "accurate" as possible, but not to totally ensure that the settings
> are workable. For example, I could set CC to 'flurg' and OPTIM
> to '-blarf' if I wanted to in Configuration and Configure would
> happily create Makefile with those settings, even if it was total
> nonsense, the assumption being that the "user knows best".
> After all, once Makefile is done, and one actually does a 'make',
> the problem become clear. :)

But the problem is that Configure is the one adding bad settings and if
Configure can't make TestLib work because it has wrong flags, then I don't
even _get_ a Makefile out of it to see what is wrong.

> > 
> > I don't particularily care how it is done, but just being told "it doesn't
> > work" without being told what doesn't work and without being able to try
> > it myself (since it removes the Makefile, etc. at exit) is not good.
> I haven't seen this... does Configure actually remove Makefile
> if CC and OPTIM don't happily live together?? If so, then that _is_
> a bug. Or are you talking about TestLib? If so, then there's an
> argument to be made that TestLib shouldn't block error messages,
> and it's one that I would most likely vote +1 on.

No, it just won't make it the Makefile because it will fail TestLib.  You
should be able to replicate this by setting CC to [usr/]/bin/false. 
Because, as Dean says, for testing libraries error messages are normal we
should either add the right options to let you pick, or simply have
TestLib always output to a debug file.  Then Configure can simply display
the contents of that file when TestLib fails.  In other situations, the
user (developer...) can look at it themself. 

> > 
> > > 
> > > > 
> > > > We should also have a way to override the TestLib test that is documented
> > > > in the error message.  Eg. "touch .no-it-isn't-really-broken to override
> > > > the test".
> > > > 
> > > 
> > > Huh?
> > 
> > If someone just wants to say "no, trust me" to bypass the TestLib bit then
> > they should be able to without hacking Configure.
> > 
> Gotcha... Right now TestLib is used to check for an ANSI compiler
> and various libs. It would be easy to add a flag to Configure that
> made it bypass these tests, but I don't see when it would be
> needed... After all, if the TestLib compile fails, the "real"
> one almost certainly will as well.

Sure, but I want to _see_ it fail.  There is a PR in the database about
SC3.x (Sun's $$$ C compiler) not working in a couple of minor ways that
can be fixed without _too_ much effort, but you can never get that far if
TestLib barfs.  It can also give people a warm fuzzy feeling to see that
things really do try to choke when they force compile it, and it isn't
just Apache deciding that their OS sucks for no reason. 

View raw message