View Full Version : Concerning C_Flags


habdin
Salamo 3alaikom,

I don't know much about C_flags. I assumed they are parameters given to the compiler to compile a certain for optimum function for a certain machine. Please note that I don't have a single experience in programming so please try to explain it to me in a very simple understandable language. What about C++ programs? I mean is the C_flags thing confined to C programs or does it do the same thing for C++ programs?

Thanks and Salam.

alaa
C_FLAGS (it has to be all captials) is for the C language compiler flags.
CXX_FLAGS for C++ flags
LD_FLAGS for the linker
and I think CPP_FLAGS for the preprocessor.

cheers,
Alaa

uniball
It's
CFLAGS: C compiler flags
CXXFLAGS: C++ compiler flags
CC: The actual C compiler
CXX: The actual C++ compiler

habdin
Alsalamo 3alaikom,

How can we use those flags? Can those flags be put in .bashrc?

Thanks and Salam.

uniball
1- export CFLAGS="foo"
./configure
export before configure

2- CFLAGS="foo" ./configure
no export

3- make CFLAGS="foo"
no export for make

4- echo "CFLAGS=\"foo\"" >> ~/.profile
;)

alaa
and yes you can put them in the bashrc just remember to export them.

export CXX_FLAGS="-g"
or
CXX_FLAGS="-g"
export CXX_FLAGS

OneOfOne
optimization flags : http://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/Optimize-Options.html#Optimize%20Options
my flags : -march=pentium4 -pipe -fomit-frame-pointer -fforce-addr -ftracer -mfpmath=sse -falign-functions=4 -fprefetch-loop-arrays -O3 -fno-unit-at-a-time -fno-unroll-loops
ps : the "-fno-unit-at-a-time -fno-unroll-loops" is because gcc-3.3 doesnt like the -O3 option that much.
peace

alaa
sorry guys CFLAGS has no underscore, must be all this PHP programming making my head soft.

cheers,
Alaa