Re: [gtkmm] Compilation time



>Daniel Elstner <daniel elstner gmx net> writes:
>> 2) don't use -O2 for devel builds
>
>I've been wondering - how to do this cleanly with Automake so that
>the optimizations are only turned off for developer builds? Currently
>I simply do something like this:
>
>  CXXFLAGS = @CXXFLAGS@ $(DEPS_CFLAGS) -Wall -O0
>
>But I'm sure I'll forget to remove the -O0 (minus oh zero) when I'm
>ready to release. :-)

i typically use
  
  ./configure --enable-optimize

when i want an optimized build, which in turn relies on a construct
like this in the configure.{ac,in} file:

CXXFLAGS="-g -D_REENTRANT"
OPT_CXXFLAGS="-D_REENTRANT -O6 -mcpu=i686 -march=i686 -fomit-frame-pointer -ffast-math -fstrength-reduce -fmove-all-movables"

if test x"$GXX" = xyes ; then
   CXXFLAGS="$CXXFLAGS -Wall"
   OPT_CXXFLAGS="$OPT_CXXFLAGS -Wall"
fi

AC_ARG_ENABLE(optimize,
     [  --enable-optimize       ask the compiler for its best optimizations.],
     [ if test x$enable_optimize != xno ; then CXXFLAGS="$OPT_CXXFLAGS" ; fi ])

the rest of the time, i compile with just the default flags (-g
-D_REENTRANT) plus -Wall.

--p





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]