automake
[Top][All Lists]
Advanced

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

RE: How are env variables passed to the compilation process


From: Andy Falanga (afalanga)
Subject: RE: How are env variables passed to the compilation process
Date: Wed, 11 Mar 2015 23:20:37 +0000

> -----Original Message-----
> From: Nick Bowler [mailto:address@hidden
> Sent: Tuesday, March 10, 2015 5:55 PM
> To: Andy Falanga (afalanga)
> Cc: address@hidden
> Subject: Re: How are env variables passed to the compilation process
> 
> 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...

Hm ... I'll have to look over the configure.ac and Makefile.am files.  I don't 
think there was anything that overrode these.  However, I've been learning and 
have found that I made so many changes along the way, I'm probably forgetting 
something.

> 
> > 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.

This was done out of desperation to get those flags into the compiler because 
I've got a strange segfault when loading this library on Ubuntu.  The nice 
thing is that I can get away with some assumptions like this.  This tool isn't 
used outside of the company and we will be building with gcc for Linux.

Thanks for confirming my understanding.  Now, I'll have to weed through the 
files to see where I left something, or placed something new, that overrides 
the flags placed on the command line.

Andy



reply via email to

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