[GRASS5] Re: configure script and optimization

Markus Neteler neteler at itc.it
Fri Sep 2 10:28:23 EDT 2005


Hello Paul,

On Fri, Sep 02, 2005 at 03:09:26PM +0100, Paul Kelly wrote:
> Hello Markus
> 
> On Fri, 2 Sep 2005, Markus Neteler wrote:
> 
> >>
> >>            CFLAGS_OPTIMIZE=-O2
> >>            # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings
> >>            # when you inline the string and math operations.  Turn this 
> >>            off to
> >>            # get rid of the warnings.
> >>            #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES 
> >>            -D__NO_MATH_INLINES"
> >>           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> >
> >
> >Paul, do you remember the reason for this modification?
> >http://grass.itc.it/pipermail/grass-commit/2004-July/012136.html
> 
> I don't think that is relevant as CFLAGS_OPTIMIZE isn't actually used 
> anywhere

good point, I didn't realize that (so, false alarm).

> (to answer your question it was copied from the most recent 
> version in the Tcl/Tk source at the time and seemed to work well so I 
> re-used it).
> 
> I suspect the -O2 is being added in automatically by autoconf at some 
> stage. Search for -O2 in the configure script and you will see there are 
> some occurences that are not sourced from either configure.in nor 
> aclocal.m4.
> You could manually edit the configure script after editing it perhaps: this
> looks very suspicious:
> 
> echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
> if test "$ac_test_CXXFLAGS" = set; then
>   CXXFLAGS="$ac_save_CXXFLAGS"
> elif test $ac_cv_prog_cxx_g = yes; then
>   if test "$GXX" = yes; then
>     CXXFLAGS="-g -O2"
>   else
>     CXXFLAGS="-g"
>   fi
> else
>   if test "$GXX" = yes; then
>     CXXFLAGS="-O2"
>   else
>     CXXFLAGS=
>   fi
> fi
> 
> but I suspect the more robust solution is to explicitly set CXXFLAGS as 
> well as CFLAGS, i.e. something like:
> CFLAGS="-g -Wall" CXXFLAGS="-g -Wall" ./configure ...
> 
> Does that work?

Yep:

grep 'O2\|CFLA' include/Make/Platform.make
CFLAGS_DEBUG        = -g
CFLAGS_OPTIMIZE     = -O2
CFLAGS_WARNING      = -Wall -Wconversion -Wno-implicit-int
SHLIB_CFLAGS        = -fPIC
CFLAGS1             = -g -Wall
COMPILE_FLAGS       = $(CPPFLAGS) $(CFLAGS1) $(CFLAGS_WARNING) $(INCLUDE_DIRS)
XCFLAGS             =  -I/usr/X11R6/include
GDALCFLAGS          = -I/usr/local/include
PROJINC             =  $(GDALCFLAGS)

Thanks,

 Markus




More information about the grass-dev mailing list