Re: [Freeciv-Dev] compile options

2014-09-11 Thread Christian Knoke

Hello,

can anyone tell me about compiler options for gcc esp. used in freeciv?

Which are used? 

Are they different in SVN and release? 

Where are they set? 

How does environment setting for CFLAGS and CXXFLAGS affect the presets?


What I noticed so far: 

- environement has effect (which?)

- it makes a difference if CFLAGS is empty vs. CFLAGS not set

- --enable-debug changes options (how?)


I did not find it in http://freeciv.wikia.com/wiki/Building_Freeciv_from_source 

Christian






Christian Knoke wrote on Sep 10, 13:52 (+0200):
 Christian Knoke wrote on Sep 10, 13:05 (+0200):
  
  How do I set gcc options correctly?
  
  make -j 4 clean
  ./autogen.sh
  export CFLAGS=-O0
  export CXXFLAGS=${CFLAGS}
  ./configure
  make -j 4
  
  is what I currently do.
 
 I am testing with S2_5 R26260
 
 $ env | grep FLAGS
 ./autogen.sh
 make -j 4
 client$ ls -l freeciv-gtk2
 -rwxr-xr-x 1 chris chris 8775873 10. Sep 13:33 freeciv-gtk2
 
 
 export CFLAGS=-O2
 export CXXFLAGS=${CFLAGS}
 $ env | grep FLAGS
 CXXFLAGS=-O2
 CFLAGS=-O2
 ./autogen.sh
 make -j 4
 $ ls -l client/freeciv-gtk2
 -rwxr-xr-x 1 chris chris 2599529 10. Sep 13:40 client/freeciv-gtk2
 
 
 export CFLAGS=
 export CXXFLAGS=${CFLAGS}
 $ env | grep FLAGS
 CXXFLAGS=
 CFLAGS=  
 ./autogen.sh
 make -j 4   
 ls -l client/freeciv-gtk2-r26260-emptyflags
 -rwxr-xr-x 1 chris chris 2923988 10. Sep 13:28 
 client/freeciv-gtk2-r26260-emptyflags
 
 If I set no flags at all, the binary size is 8.7 mb. If I set gcc flags to
 -O2 what I think is waht default is in freeciv, size goes down to 2.9 mb
 If I set empty flags (what means I think, no optimization), the size is also
 down to 2.9 mb
 
 So I wonder why -O2 is so different from default. What is wrong?
 
 Christian


-- 
Christian Knoke* * *http://cknoke.de
* * * * * * * * *  Ceterum censeo Microsoft esse dividendum.

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] compile options

2014-09-10 Thread Christian Knoke

How do I set gcc options correctly?

make -j 4 clean
./autogen.sh
export CFLAGS=-O0
export CXXFLAGS=${CFLAGS}
./configure
make -j 4

is what I currently do.

Christian

-- 
Christian Knoke* * *http://cknoke.de
* * * * * * * * *  Ceterum censeo Microsoft esse dividendum.

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] compile options

2014-09-10 Thread Christian Knoke
Christian Knoke wrote on Sep 10, 13:05 (+0200):
 
 How do I set gcc options correctly?
 
 make -j 4 clean
 ./autogen.sh
 export CFLAGS=-O0
 export CXXFLAGS=${CFLAGS}
 ./configure
 make -j 4
 
 is what I currently do.

I am testing with S2_5 R26260

$ env | grep FLAGS
./autogen.sh
make -j 4
client$ ls -l freeciv-gtk2
-rwxr-xr-x 1 chris chris 8775873 10. Sep 13:33 freeciv-gtk2


export CFLAGS=-O2
export CXXFLAGS=${CFLAGS}
$ env | grep FLAGS
CXXFLAGS=-O2
CFLAGS=-O2
./autogen.sh
make -j 4
$ ls -l client/freeciv-gtk2
-rwxr-xr-x 1 chris chris 2599529 10. Sep 13:40 client/freeciv-gtk2


export CFLAGS=
export CXXFLAGS=${CFLAGS}
$ env | grep FLAGS
CXXFLAGS=
CFLAGS=  
./autogen.sh
make -j 4   
ls -l client/freeciv-gtk2-r26260-emptyflags
-rwxr-xr-x 1 chris chris 2923988 10. Sep 13:28 
client/freeciv-gtk2-r26260-emptyflags

If I set no flags at all, the binary size is 8.7 mb. If I set gcc flags to
-O2 what I think is waht default is in freeciv, size goes down to 2.9 mb
If I set empty flags (what means I think, no optimization), the size is also
down to 2.9 mb

So I wonder why -O2 is so different from default. What is wrong?

Christian

-- 
Christian Knoke* * *http://cknoke.de
* * * * * * * * *  Ceterum censeo Microsoft esse dividendum.

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev