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

Reply via email to