* Lee Elliott -- Tuesday 12 August 2003 21:13:
> On Sunday 10 August 2003 06:24, Norman Vine wrote:
> > -O2 -march=pentium3 -msse -mfpmath=sse
>
> How do I go about specifying these flags when I compile? Is there a command
> line option or do I need to add them to one of the build files?
./configure tells you about it:
$ ./configure --help
...
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
headers in a nonstandard directory <include dir>
CPP C preprocessor
CXX C++ compiler command
CXXFLAGS C++ compiler flags
Some of these will always be the same for all things that you
compile, so it's useful to define them globally, e.g. in
~/.bashrc or ~/.profile:
export CFLAGS="-march=pentium3"
but you'll want to set some of them for fgfs only:
$ export CXXFLAGS="$CXXFLAGS -msse -mfpmath=sse"
$ ./configure --prefix=/usr/local
or
$ CXXFLAGS="$CXXFLAGS -msse -mfpmath=sse" ./confiure
or even better: write a configure script or Makefile for all
your fgfs subsystems. I've got something like this:
$ conf
$ FlightGear/
$ SimGear/
$ plib/
$ ...
whereby "conf" is my central configuration script
(simplyfied and shortened):
$ cat conf
#!/bin/bash
set -e
aclocal
autoheader
automake -a
autoconf
MACH="-march=i686"
DEBUG="-g"
OPT="-O0"
export CFLAGS="$DEBUG -Wall $OPT -pipe $MACH"
export CXXFLAGS="$DEBUG -Wall $OPT -pipe $MACH"
export LDFLAGS="$DEBUG"
case `pwd` in
*plib)
echo ">> plib <<"
./configure \
--prefix=/usr/local
;;
*SimGear)
echo ">> SimGear <<"
./configure \
--prefix=/usr/local \
--with-jpeg-factory
;;
*FlightGear)
CXXFLAGS="$CXXFLAGS -DFG_USE_CLOUDS_3D" ./configure \
--prefix=/usr/local \
--with-multiplayer
*)
echo "pardon?"
;;
esac
Now I only need to enter the respective directory and call conf.
It will automatically pick up the right branch:
$ cd FlightGear
$ ../conf
m.
_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel