LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Autoconf's default CXXFLAGS (https://www.linuxquestions.org/questions/programming-9/autoconfs-default-cxxflags-325719/)

Nicholas Bishop 05-21-2005 01:26 PM

Autoconf's default CXXFLAGS
 
I've been learning about Autoconf, attempting to make "./configure && make" work correctly in some graphics software I'm writing. I'm confused about the effects of AC_PROG_CXX. It seems its primary purpose is to detect which C++ compiler to use, which makes sense. But then, according to the info page, it does this:
Quote:

If output variable `CXXFLAGS' was not already set, set it to `-g
-O2' for the GNU C++ compiler (`-O2' on systems where G++ does not
accept `-g'), or `-g' for other compilers.
This is a reasonable default, but what if I don't want either O2 optimization or -g? Of course the user of the configure script can export CXXFLAGS=-Ofoo and then AC_PROG_CXX leaves CXXFLAGS alone, but I would like to be able to provide my own reasonable default that would override AC_PROG_CXX, yet that could still be overridden by the user. Is there a good way to do this?


All times are GMT -5. The time now is 02:29 PM.