[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How are env variables passed to the compilation process
From: |
Nick Bowler |
Subject: |
Re: How are env variables passed to the compilation process |
Date: |
Tue, 10 Mar 2015 19:55:08 -0400 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On 2015-03-10 22:04 +0000, Andy Falanga (afalanga) wrote:
[...]
> I go through the list of output made by the build process and discover
> that the build process didn't do what seems to be the "standard"
> options, "-O2 -g". Neither of these were used. So, I thought I'd
> add them. I did this:
>
> make clean
> ./configure CFLAGS="-ggdb -O0" CXXFLAGS="-ggdb -O2"
> make
>
> Much to my surprise, the "-ggdb -O0" didn't appear then either. Did I
> miss something? Isn't this how they are set?
Normally this is fine. If it is not working, then probably your
configure and/or Makefile are ignoring the user-set values. For
example, code like this...
> CPPFLAGS=" -D__linux__ -DADT_TRACE_ENABLE=0"
>
> if [[ $debug = "true" ]]; then
> CFLAGS=" -O0 -ggdb"
> CXXFLAGS=" -std=c++0x -O0 -ggdb"
> else
> CFLAGS=" -O2 -g"
> CXXFLAGS="-std=c++0x -O2 -g"
> fi
...will override any user assignment to CPPFLAGS, CFLAGS and CXXFLAGS.
It is also basically guaranteed to fail on any compiler that is not
compatible with GCC.
Cheers,
--
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)