httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <...@engelschall.com>
Subject Re: config/3728: Default compile doesn't have "-O" set
Date Thu, 22 Apr 1999 09:26:33 GMT

In article <Pine.LNX.3.96dg4.990420210537.30703Y-100000@twinlark.arctic.org> you wrote:

> Yeah I ran into this as well... I suppose the reason we don't put -O in
> there by default everywhere is because it's known to be broken in some
> places. 
> 
> But I think for at least the sparc and i386 targets we should default -O
> if the user doesn't specify their own CFLAGS or something. 

Sounds reasonable. We can even check whether the compiler is additionally GCC
and then use -O2 instead of -O which is usually also a safe approach for GCCs?

> I just started using apaci recently.  Is the right way to do this:
> 
> env CFLAGS='-Wall -O2 -g' ./configure --blahblah

Yes, although strictly speaking the correct traditional _Apache_ way would be
to use the OPTIM variable for the optimization flags (but because GNU Autoconf
only knows CFLAGS one usually don't uses OPTIM on the APACI command line).

While hacking I usually compile Apache from within a script this way:

   CC=egcc \
   CFLAGS="-pipe -O -pedantic \
           -Wall -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes \
           -Wmissing-declarations -Wnested-externs -Winline" \ 
   ./configure \
           --with-layout=GNU \
           --target=apache \
           --prefix=/tmp/apache

while on all production machines my BnP toolkit uses:

   BnP::cmd(#  compiler to use for building
            "CC=pgcc " .
            "CFLAGS='-pipe -O2' " .
            #  set the OpenSSL to use
            "SSL_BASE=$prefix/lib/openssl " .
            #  the APACI script
            "./configure " .
            #  set some rules
            "--target=apache " .
            "--with-layout=GNU " .
            "--enable-rule=SHARED_CORE " .
            "--enable-rule=SHARED_CHAIN " .
            #  set installation paths
            "--prefix=$prefix " .
            "--sbindir=$prefix/bin " .
            "--sysconfdir=$prefix/etc/apache " .
            "--libexecdir=$prefix/lib/apache " .
            "--datadir=$prefix/lib/internal " .
            "--localstatedir=$vardir " .
            #  set Perl interpreter to use for scripts
            "--activate-module=src/modules/perl/libperl.a " .
            "--with-perl=$prefix/bin/perl " .
            #  set suEXEC facility parameters
            "--enable-suexec " .
            "--suexec-caller=www " .
            "--suexec-userdir=.www " .
            #  set modules to build
            "--enable-module=most " .
            "--enable-module=example " .
            "--enable-module=mmap_static " .
            "--enable-module=ssl " .
            "--enable-module=perl " .
            #  enable DSO for maximum of modules
            "--enable-shared=max "
    );
                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Mime
View raw message