[GRASS5] Re: configure script and optimization

Paul Kelly paul-grass at stjohnspoint.co.uk
Fri Sep 2 10:09:26 EDT 2005


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 (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?

Paul




More information about the grass-dev mailing list