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

Re: Recommend place to set CXXFLAGS="-O2 -mcpu=xscale -mtune=xscale"



On Fri, Feb 01, 2008 at 06:58:41AM -0800, slugmanbashi wrote:
> I have  http://libtorrent.rakshasa.no/wiki/LibTorrentKnownIssues read  that
> it is recommended to set CXXFLAGS="-O2 -mcpu=xscale -mtune=xscale" before
> compiling on the NSLU2.
> 
> I mostly compile Debian packages on the NSLU2.
> Id like to know where/how I should set the CXXFLAGS flag.
> 
> Should I add
> CXXFLAGS= -O2 -mcpu=xscale -mtune=xscale
> or
> DEB_CONFIGURE_SCRIPT_ENV += CXXFLAGS="-O2 -mcpu=xscale -mtune=xscale"
> to the debian/rules file of the debian source package? And if so is there a
> specific location it should be added ?
> 
> Or should I just add 
> export CXXFLAGS="-O2 -mcpu=xscale -mtune=xscale"
> to my ~/.bashrc file.
> 
> The reason I ask is that when I add CXXFLAGS= -O2 -mcpu=xscale -mtune=xscale
> to the debian/rules file of some packages, the CXXFLAGS flag setting is seen
> in the gcc output while the the package compiles. On others it is not. I
> can't be sure that the CXXFLAGS setting is always being applied. 
> When I export the CXXFLAGS setting in the ~/.bashrc file, the CXXFLAGS flag
> setting is never seen in the gcc output while the the package compiles.
> 
> Id appreciate it if someone could advise how and where CXXFLAGS should be
> set and how one checks if the flag was applied post compile job.

I would think CFLAGS was even more important (way more C code than C++
code after all).

Some makefiles may follow what you set in your environment, some don't.
I don't think there is any universal method that would handle
everything, although just setting them in your environment (can be in
your .bashrc or something like that) ought to cover a large number of
packages.  Of course it is also possible for a package's build rules to
override that and set their own, so really short of editing build rules
to be sure, there is no way to enforce it.

--
Len Sorensen


Reply to: