Jump to content

About *FLAGS


Sandro
 Share

Recommended Posts

Hello everyone; I was wondering what differences there may be between in make.conf

 



CFLAGS="-march=native -O2 -pipe -mfpmath=sse"
CXXFLAGS="-march=native -O2 -pipe -mfpmath=sse"
FFLAGS="-march=native -O2 -pipe -mfpmath=sse"
FCFLAGS="-march=native -O2 -pipe -mfpmath=sse"
 
And:
 
CFLAGS="${CFLAGS} -march=native -O2 -pipe -mfpmath=sse"
CXXFLAGS="$(CXXFLAGS} -march=native -O2 -pipe -mfpmath=sse"
FFLAGS="${FFLAGS} -march=native -O2 -pipe -mfpmath=sse"
FCFLAGS="${FCFLAGS} -march=native -O2 -pipe -mfpmath=sse"


 


That is, and please forgive my ignorance, if using eg CFLAGS="xyz" 

override CFLAGS or their are adding as the default CFLAGS. 

 

Because in that case it would be useless to declare CFLAGS = "${CFLAGS} xyz" 

 

Please forgive my ignorance. :(

 

I just want to understand "meticulously" and in every detail this system :)

Link to comment
Share on other sites

  • Funtoo Linux BDFL

Sure, here's the info. The way the variables in /etc/make.conf are "merged" into the defaults in the profile is a fairly complex process, but...

 

There is really no difference for the *FLAGS, since there is only a very generic default.

 

You want to make sure you use the FOO="${FOO} blah" format when you have lines earlier in the same file that define FOO. If you do not, they you will overwrite your earlier settings. If you use FOO="${FOO} blah", then you will *add* blah to your existing settings you defined earlier in the same file.

 

 

How variables are handled in /etc/make.conf is interesting -- there are two types of variables. Regular variables, and "incrementals". The incrementals are:

 

"USE", "USE_EXPAND", "USE_EXPAND_HIDDEN",
"FEATURES", "ACCEPT_KEYWORDS",
"CONFIG_PROTECT_MASK", "CONFIG_PROTECT",
"IUSE_IMPLICIT",
"PRELINK_PATH", "PRELINK_PATH_MASK",
"PROFILE_ONLY_VARIABLES",
 "USE_EXPAND_IMPLICIT", "USE_EXPAND_UNPREFIXED"
 
The most common incremental is USE. What makes use incremental? "Incremental" means that if you set this in /etc/make.conf:
 
USE="foo"
 
... then "foo" will be *added* to your existing USE setting. This makes it incremental.
 
To totally wipe your USE, you must do:
 
USE="-* foo"
 
If something is NOT an incremental, then you can wipe the variable by going:
 
FOO="bar"
 
and to preserve existing settings for non-incremental, if there are any, you must do:
 
FOO="${FOO} bar"
 
CFLAGS, etc. are non-incremental, but there are just basic defaults of typically "-O2 -pipe", so generally people just override.
 
-Daniel
Link to comment
Share on other sites


In efect using:

CFLAGS="-${CFLAGS} -march=native -O2 -pipe -mfpmath=sse"
CXXFLAGS="${CXXFLAGS} -march=native -O2 -pipe -mfpmath=sse"
FFLAGS="${FFLAGS} -march=native -O2 -pipe -mfpmath=sse"
FCFLAGS="${FCFLAGS} -march=native -O2 -pipe -mfpmath=sse"
LDFLAGS="${LDFLAGS} -Wl,--hash-style=gnu"
i obtain

 
CFLAGS="--O2 -pipe -march=native -O2 -pipe -mfpmath=sse"
CXXFLAGS="-O2 -pipe -march=native -O2 -pipe -mfpmath=sse"
FFLAGS=" -march=native -O2 -pipe -mfpmath=sse"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,--hash-style=gnu"

 

Using instead:

[code]
Ci7Ht ~ # grep  FLAGS /etc/make.conf 
CFLAGS="-march=native -O2 -pipe -mfpmath=sse"
CXXFLAGS="-march=native -O2 -pipe -mfpmath=sse"
FFLAGS="-march=native -O2 -pipe -mfpmath=sse"
FCFLAGS="-march=native -O2 -pipe -mfpmath=sse"
LDFLAGS="-Wl,--hash-style=gnu"
[/code]

then :

Ci7Ht ~ # emerge --info|grep FLAGS
CFLAGS="-march=native -O2 -pipe -mfpmath=sse"
CXXFLAGS="-march=native -O2 -pipe -mfpmath=sse"
FFLAGS="-march=native -O2 -pipe -mfpmath=sse"
LDFLAGS="-Wl,--hash-style=gnu"
[/code]

Then it s3eems thata may be use "incremental/append" about LDFLAGS. Cause in other situations informations are "redundant"

 

Thank You Great Daniel !!! :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...