[omniORB] patch: support for compilation tuning using enviroment vars.

Bastiaan Bakker Bastiaan.Bakker@lifeline.nl
Tue Nov 19 16:37:00 2002


> I saw your patch before, but I haven't had time to look at it yet. I
> don't think it's quite right at the moment, since with your patch the
> default is for no optimisation, where before it was for -O2.

If you don't explicitly set CFLAGS/CXXFLAGS, ./configure will set them
to '-g -O2' automatically, at least when using gcc/g++. The
documentation for the AC_PROG_CXX does not comment on why other
compilers don't get '-O2'. 

> configure certainly ought to obey CXXFLAGS etc environment variables,
> so I'll definitely check something along those lines in.
> 
> Can you rework the patch so it still uses optimisation if CXXFLAGS is
> not explicitly set?  I think there might also be an issue with some

I guess adding

dnl ** CFLAGS/CXXFLAGS defaults when not using gcc/g++
if test "$ac_cv_cxx_compiler_gnu" = "no"; then
  if test "$ac_cv_env_CFLAGS_set" = "no"; then
    CFLAGS="-O"
  fi

  if test "$ac_cv_env_CXXFLAGS_set" = "no"; then
    CXXFLAGS="-O2"
  fi
fi

to configure.ac should do the trick, but I can't test it because
./configure still recognizes g++ even if I rename it.

> platforms overriding CXXFLAGS in the makefiles.

I guess you know which makefiles you're talking about, so I'll leave
that one for you :-)

Cheers,

Bastiaan Bakker
LifeLine Networks bv

> 
> Cheers,
> 
> Duncan.
> 
> -- 
>  -- Duncan Grisby         --
>   -- duncan@grisby.org     --
>    -- http://www.grisby.org --