summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-04-23 15:02:41 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-04-23 15:02:41 +0000
commit49e6170b49fbb933eddec6d0e3f946320c68832f (patch)
tree88d228d6f89103710074fdba041ce80584d5caa6 /configure
parent8c795585fb0c6c9178d9981f6943da04b7279205 (diff)
Added `dumpents' server command.
Added support for `cl_noskins' value of 2 (default all female skins to `female/athena', all male skins to `male/grunt'). Renamed `scoreshot' command to `aashot', added `aadump' command. Fixed several alignment issues on ARM architecture. Server browser menu now indicates full and password protected servers with color codes. Implemented history search in console with Ctrl+R, Ctrl+S. Removed `cl_railtrail_alpha' variable, all `cl_rail*_color' variables now accept colors in #RRGGBBAA format. Added `map_override' cvar (enables loading map entity lump from external maps/*.ent file). Made `quit' command accept extra arguments. Made `draw' command accept arbitrary colors in #RRGGBBAA format. Fixed debian packages.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure128
1 files changed, 75 insertions, 53 deletions
diff --git a/configure b/configure
index 0e60b33..ad24495 100755
--- a/configure
+++ b/configure
@@ -4,12 +4,20 @@
# q2pro configuration script by [SkulleR]
# -----------------------------
-# defaults
+# build directories
sources=$(dirname $0)
if [ "$sources" = "." ]; then
sources=`pwd`
fi
+
+if [ ! -f $sources/source/common.c ] ; then
+ echo "ERROR: $sources does not look like Q2PRO source tree"
+ exit 1
+fi
+
outdir=`pwd`
+
+# defaults
prefix="/usr/local"
datadir="share/games/quake2"
libdir="lib/games/quake2"
@@ -23,6 +31,7 @@ windres="windres"
strip="strip"
mingw="no"
pngconfig="libpng-config"
+sdlconfig="sdl-config"
exesuffix=""
libsuffix=".so"
dsound="no"
@@ -66,9 +75,11 @@ scoreshots="scoreshots"
revision="226"
tmpc="/tmp/q2pro-${RANDOM}.c"
tmpo="/tmp/q2pro-${RANDOM}.o"
+config_mk="config.mk"
+config_h="config.h"
if [ -z "$CFLAGS" ]; then
- CFLAGS="-ffast-math -O2"
+ CFLAGS="-O2 -Wall -Wstrict-prototypes"
fi
# detect host CPU
@@ -77,6 +88,7 @@ case $cpu in
i386|i486|i586|i686)
cpu="i386"
asm="yes"
+CFLAGS="-ffloat-store -ffast-math $CFLAGS"
;;
ia64)
cpu="ia64"
@@ -84,6 +96,9 @@ cpu="ia64"
x86_64|amd64)
cpu="x86_64"
;;
+arm*)
+cpu="arm"
+;;
*)
cpu="unknown"
;;
@@ -93,17 +108,11 @@ esac
targetos=`uname -s`
case $targetos in
CYGWIN*)
-targetos="Windows"
mingw="yes"
-sdl="no"
-wave="yes"
CFLAGS="-mno-cygwin $CFLAGS"
;;
MINGW*)
-targetos="Windows"
mingw="yes"
-sdl="no"
-wave="yes"
;;
*BSD)
make="gmake"
@@ -219,43 +228,47 @@ echo "Object files are built in the directory from which configure is run."
exit 1
fi
-if [ "$singleuser" = "yes" ]; then
- prefix=""
- datadir="."
- libdir="."
- refdir="."
- bindir=""
- mandir=""
- homedir=""
-fi
-
if [ "$mingw" = "yes" ]; then
- targetos="Windows"
+ if [ "$cpu" = "i386" ]; then
+ cpu="x86"
+ targetos="Win32"
+ else
+ targetos="Win64"
+ fi
pathsep='\\'
exesuffix=".exe"
libsuffix=".dll"
oss="no"
evdev="no"
+ sdl="no"
gldriver="opengl32"
- gamelib="gamex86.dll"
exported="__attribute__((dllexport))"
homedir=""
asmflags="-DUNDERSCORES"
cfgfile="q2config.cfg"
- if [ "$wave" = "???" ]; then
+ if [ "$wave" != "no" ]; then
wave="yes"
fi
else
pathsep="/"
- gamelib="game$cpu.so"
exported="__attribute__((visibility(\"default\")))"
- if [ ! -z "$prefix" ]; then
- datadir="$prefix/$datadir"
- libdir="$prefix/$libdir"
- refdir="$prefix/$refdir"
- bindir="$prefix/$bindir"
- mandir="$prefix/$mandir"
+ if [ "$singleuser" = "yes" ]; then
+ prefix=""
+ datadir="."
+ libdir="."
+ refdir="."
+ bindir=""
+ mandir=""
+ homedir=""
+ else
+ if [ ! -z "$prefix" ]; then
+ datadir="$prefix/$datadir"
+ libdir="$prefix/$libdir"
+ refdir="$prefix/$refdir"
+ bindir="$prefix/$bindir"
+ mandir="$prefix/$mandir"
+ fi
fi
# check if -fvisibility is supported
@@ -268,6 +281,13 @@ else
LDFLAGS="-Wl,--no-undefined $LDFLAGS"
fi
+gamelib="game$cpu.so"
+
+vpath="\$(SRCDIR)/source"
+if [ "$client" = "yes" ]; then
+ vpath="$vpath \$(SRCDIR)/asm"
+fi
+
if [ ! -z "$cross_prefix" ]; then
cc="$cross_prefix-$cc"
windres="$cross_prefix-$windres"
@@ -275,6 +295,7 @@ if [ ! -z "$cross_prefix" ]; then
pngconfig="$cross_prefix-$pngconfig"
fi
+# echo configuration info
echo "Build client $client"
if [ "$client" = "yes" ]; then
if [ "$hardlink" = "yes" ]; then
@@ -316,31 +337,11 @@ if [ "$client" = "yes" ]; then
fi
test "$cpu" = "i386" && echo "i386 assembly $asm"
-CFLAGS="-I\$(OUTDIR) -MF \$*.d -MMD -Wall -Wno-missing-braces -Wno-strict-aliasing -Wstrict-prototypes -pipe -ffloat-store $CFLAGS"
+CFLAGS="-I\$(OUTDIR) -MF \$*.d -MMD -pipe $CFLAGS -Wno-strict-aliasing"
#LDFLAGS="$LDFLAGS"
-config_mk="config.mk"
-config_h="config.h"
-
-echo "# Generated by configure - do not modify" > $config_mk
-echo "// Generated by configure - do not modify" > $config_h
-
-test "$mingw" = "yes" && echo "MINGW=$mingw" >> $config_mk
-echo "CC=$cc" >> $config_mk
-echo "WINDRES=$windres" >> $config_mk
-echo "STRIP=$strip" >> $config_mk
-echo "MAKE=$make" >> $config_mk
-echo "SRCDIR=$sources" >> $config_mk
-echo "OUTDIR=$outdir" >> $config_mk
-echo "EXESUFFIX=$exesuffix" >> $config_mk
-echo "LIBSUFFIX=$libsuffix" >> $config_mk
-echo "#define LIBSUFFIX \"$libsuffix\"" >> $config_h
-echo "VPATH=\$(SRCDIR)/source \$(SRCDIR)/asm" >> $config_mk
-echo "CFLAGS=$CFLAGS" >> $config_mk
-echo "LDFLAGS=$LDFLAGS" >> $config_mk
-test "$mingw" = "yes" && echo "RESFLAGS=-I\$(OUTDIR) -I\$(SRCDIR)/source" >> $config_mk
-test "$asm" = "yes" && echo "ASMFLAGS=$asmflags" >> $config_mk
+# determine what needs to be built
if [ "$client" = "yes" ]; then
targets="$targets q2pro"
executables="$executables q2pro$exesuffix"
@@ -372,9 +373,30 @@ fi
if [ "$openffa" = "yes" ]; then
targets="$targets openffa"
- #libraries="$libraries $gamelib"
+ libraries="$libraries $gamelib"
fi
+
+# build configuration files
+echo "# Generated by configure - do not modify" > $config_mk
+echo "// Generated by configure - do not modify" > $config_h
+
+test "$mingw" = "yes" && echo "MINGW=$mingw" >> $config_mk
+echo "CC=$cc" >> $config_mk
+echo "WINDRES=$windres" >> $config_mk
+echo "STRIP=$strip" >> $config_mk
+echo "MAKE=$make" >> $config_mk
+echo "SRCDIR=$sources" >> $config_mk
+echo "OUTDIR=$outdir" >> $config_mk
+echo "EXESUFFIX=$exesuffix" >> $config_mk
+echo "LIBSUFFIX=$libsuffix" >> $config_mk
+echo "#define LIBSUFFIX \"$libsuffix\"" >> $config_h
+echo "VPATH=$vpath" >> $config_mk
+echo "CFLAGS=$CFLAGS" >> $config_mk
+echo "LDFLAGS=$LDFLAGS" >> $config_mk
+test "$mingw" = "yes" && echo "RESFLAGS=-I\$(OUTDIR) -I\$(SRCDIR)/source" >> $config_mk
+test "$asm" = "yes" && echo "ASMFLAGS=$asmflags" >> $config_mk
+
echo "TARGETS=$targets" >> $config_mk
echo "BINARIES=$executables $libraries" >> $config_mk
echo "EXECUTABLES=$executables" >> $config_mk
@@ -458,8 +480,8 @@ fi
if [ "$sdl" = "yes" ]; then
echo "USE_SDL=yes" >> $config_mk
- echo "SDL_LDFLAGS=`sdl-config --libs`" >> $config_mk
- echo "SDL_CFLAGS=`sdl-config --cflags`" >> $config_mk
+ echo "SDL_LDFLAGS=$($sdlconfig --libs)" >> $config_mk
+ echo "SDL_CFLAGS=$($sdlconfig --cflags)" >> $config_mk
echo "#define USE_SDL 1" >> $config_h
if [ "$x11" = "yes" ]; then
echo "USE_X11=yes" >> $config_mk