autoconf
[Top][All Lists]
Advanced

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

Re: Get rid of `-g' in CXXFLAGS


From: Frank A. Uepping
Subject: Re: Get rid of `-g' in CXXFLAGS
Date: Sat, 2 Aug 2003 11:20:28 +0200

On Saturday 02 August 2003 07:46, Richard Bos wrote:
> Op vrijdag 1 augustus 2003 21:38, schreef Frank A. Uepping:
> > Unfortuantely AC_PROG_CXX includes the `-g' option in CXXFLAGS,
> > with what I am not happy with.
> > How can I get rid of the `-g' flag in a way that doesn't *clobber* a user
> > supplied CXXFLAGS?
> > (However, I assume resetting CXXFLAGS entirely is not wise, isn't it?)
> > Is there any AC_ switch for it, or do I have to hack some shell code
> > around AC_PROG_CXX?
> >
> > /FAU
>
> It seems defined in /usr/share/autoconf/autoconf/c.m4
>
> where you have:
> CXXFLAGS="-g"
> AC_CACHE_CHECK(whether $CXX accepts -g, ac_cv_prog_cxx_g,
>                [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
>                                    [ac_cv_prog_cxx_g=yes],
>                                    [ac_cv_prog_cxx_g=no])])
> 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
> fi[]dnl
>
> I would expect no "-g" by default as well, and to be able to tell configure
> use "-g" with e.g. an argument "enable-debug".

That is what I found reasonable too.
I think the best way to achieve this is to alter directely the AC_PROG_CXX 
macro.

/FAU





reply via email to

[Prev in Thread] Current Thread [Next in Thread]