diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 144 |
1 files changed, 56 insertions, 88 deletions
@@ -35,10 +35,7 @@ sdlconfig="sdl-config" exesuffix="" libsuffix=".so" dsound="no" -wave="???" dinput="no" -oss="no" -evdev="no" zlib="yes" png="no" jpeg="no" @@ -56,13 +53,14 @@ targets="" executables="" libraries="" hardlink="no" -asm="no" +asm="???" +cpu="" anticheat="no" singleuser="no" gldriver="libGL.so.1" indriver="" homedir="~/.q2pro" -defcfg="/etc/default/q2pro" +sitecfg="/etc/default/q2pro" asmflags="" logfile="console.log" cfgfile="config.cfg" @@ -82,49 +80,6 @@ if [ -z "$CFLAGS" ]; then CFLAGS="-O2 -Wall -Wstrict-prototypes" fi -# detect host CPU -cpu=`uname -m` -case $cpu in -i386|i486|i586|i686) -cpu="i386" -asm="yes" -CFLAGS="-ffloat-store -ffast-math $CFLAGS" -;; -ia64) -cpu="ia64" -;; -x86_64|amd64) -cpu="x86_64" -;; -arm*) -cpu="arm" -;; -*) -cpu="unknown" -;; -esac - -# detect host OS -targetos=`uname -s` -case $targetos in -CYGWIN*) -mingw="yes" -CFLAGS="-mno-cygwin $CFLAGS" -;; -MINGW*) -mingw="yes" -;; -*BSD) -make="gmake" -oss="yes" -;; -Linux) -oss="yes" -evdev="yes" -dl="yes" -;; -esac - #parse options for opt do case $opt in @@ -138,6 +93,8 @@ for opt do ;; --enable-mingw) mingw="yes" ; sdl="no" ;; + --cpu=*) cpu=`echo $opt | cut -d '=' -f 2` + ;; --cc=*) cc=`echo $opt | cut -d '=' -f 2` ;; --make=*) make=`echo $opt | cut -d '=' -f 2` @@ -158,10 +115,6 @@ for opt do ;; --enable-dinput) dinput="yes" ;; - --disable-wave) wave="no" - ;; - --disable-oss) oss="no" - ;; --disable-zlib) zlib="no" ;; --enable-png) png="yes" @@ -205,11 +158,8 @@ echo " --disable-client do not build client" echo " --enable-server build dedicated server" echo " --enable-openffa build OpenFFA deathmatch mod" echo " --enable-mingw enable Windows build" -echo " --enable-dsound enable DirectSound driver" -echo " --enable-dinput enable DirectInput driver" -echo " --disable-wave disable WAVE sound driver" -echo " --disable-oss disable OSS driver" -echo " --disable-evdev disable Evdev driver" +echo " --enable-dsound enable direct sound driver" +echo " --enable-dinput enable direct input driver" echo " --disable-zlib disable linking with zlib" echo " --enable-png enable linking with PNG library" echo " --enable-jpeg enable linking with JPEG library" @@ -228,6 +178,50 @@ echo "Object files are built in the directory from which configure is run." exit 1 fi +# detect host CPU +if [ -z "$cpu" ] ; then + cpu=`uname -m` +fi +case $cpu in +i386|i486|i586|i686) +cpu="i386" +if [ "$asm" != "no" ] ; then + asm="yes" +fi +CFLAGS="-ffloat-store -ffast-math $CFLAGS" +;; +ia64) +cpu="ia64" +;; +x86_64|amd64) +cpu="x86_64" +;; +arm*) +cpu="arm" +;; +*) +cpu="unknown" +;; +esac + +# detect host OS +targetos=`uname -s` +case $targetos in +CYGWIN*) +mingw="yes" +CFLAGS="-mno-cygwin $CFLAGS" +;; +MINGW*) +mingw="yes" +;; +*BSD) +make="gmake" +;; +Linux) +dl="yes" +;; +esac + if [ "$mingw" = "yes" ]; then if [ "$cpu" = "i386" ]; then cpu="x86" @@ -238,17 +232,12 @@ if [ "$mingw" = "yes" ]; then pathsep='\\' exesuffix=".exe" libsuffix=".dll" - oss="no" - evdev="no" sdl="no" gldriver="opengl32" exported="__attribute__((dllexport))" homedir="" asmflags="-DUNDERSCORES" cfgfile="q2config.cfg" - if [ "$wave" != "no" ]; then - wave="yes" - fi else pathsep="/" exported="__attribute__((visibility(\"default\")))" @@ -324,16 +313,10 @@ if [ "$mingw" = "no" ]; then fi echo "zlib support $zlib" if [ "$client" = "yes" ]; then + echo "Direct input $dinput" + echo "Direct sound $dsound" echo "PNG support $png" echo "JPEG support $jpeg" - if [ "$mingw" = "yes" ]; then - echo "DInput support $dinput" - echo "DSound support $dsound" - echo "WAVE sound support $wave" - else - echo "OSS support $oss" - echo "Evdev support $evdev" - fi fi test "$cpu" = "i386" && echo "i386 assembly $asm" @@ -441,7 +424,7 @@ echo "#define COM_DEMOCACHE_NAME \"$democache\"" >> $config_h echo "#define SCREENSHOTS_DIRECTORY \"$screenshots\"" >> $config_h echo "#define SCORESHOTS_DIRECTORY \"$scoreshots\"" >> $config_h -test "$mingw" = "no" && echo "#define DEFCFG \"$defcfg\"" >> $config_h +test "$mingw" = "no" && echo "#define SYS_SITECFG_NAME \"$sitecfg\"" >> $config_h echo "#define CPUSTRING \"$cpu\"" >> $config_h echo "#define BUILDSTRING \"$targetos\"" >> $config_h @@ -451,8 +434,6 @@ echo "#define PATH_SEP_STRING \"$pathsep\"" >> $config_h echo "#define DEFAULT_OPENGL_DRIVER \"$gldriver\"" >> $config_h -echo "#define DEFAULT_INPUT_DRIVER \"$indriver\"" >> $config_h - if [ "$dl" = "yes" ]; then echo "USE_DL=yes" >> $config_mk fi @@ -462,6 +443,8 @@ if [ "$zlib" = "yes" ]; then echo "ZLIB_LDFLAGS=-lz" >> $config_mk echo "ZLIB_CFLAGS=" >> $config_mk echo "#define USE_ZLIB 1" >> $config_h +else + echo "#define USE_ZLIB 0" >> $config_h fi if [ "$png" = "yes" ]; then @@ -491,21 +474,6 @@ if [ "$sdl" = "yes" ]; then fi fi -if [ "$oss" = "yes" ]; then - echo "USE_OSS=yes" >> $config_mk - echo "#define USE_OSS 1" >> $config_h -fi - -if [ "$evdev" = "yes" ]; then - echo "USE_EVDEV=yes" >> $config_mk - echo "#define USE_EVDEV 1" >> $config_h -fi - -if [ "$wave" = "yes" ]; then - echo "USE_WAVE=yes" >> $config_mk - echo "#define USE_WAVE 1" >> $config_h -fi - if [ "$dsound" = "yes" ]; then echo "USE_DSOUND=yes" >> $config_mk echo "#define USE_DSOUND 1" >> $config_h |