autoconf
[Top][All Lists]
Advanced

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

Conditional change of C++ compiler flags


From: Alex Farber
Subject: Conditional change of C++ compiler flags
Date: Wed, 26 May 2010 08:24:14 +0300

I want to add --enable-debug switch to my configure script, which replaces
default "-g O3" compiler options with "-g3 -O0". My attempt is obviously
incorrect:

AC_ARG_ENABLE( debug,
    [  --enable-debug,  Enable debug build],
    [ CXXFLAGS="${CXXFLAGS} -g3 -O0"] )

This gives compiler command line: "-g O3 g3 -O0" instead of desired "-g3
-O0"
Also, automake manual doesn't recommend to touch CXXFLAGS variable, leaving
it completely to user. What is correct way to do this?


reply via email to

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