4 misc/tools/xonotic-map-compiler-autobuild download
17 export CC="$CC -DSUPPORTIPV6"
41 case "`$CC -dumpversion`" in
42 [5-9]*|[1-9][0-9]*|4.[3-9]*|4.[1-9][0-9]*)
44 # -march=native is broken < 4.3
45 if $CC -mtune=native -march=native misc/tools/conftest.c -o conftest >/dev/null 2>&1; then
46 export CC="$CC -mtune=native -march=native"
50 if [ -n "$WE_HATE_OUR_USERS" ]; then
51 export CC="$CC -fno-common"
60 if [ -n "$WE_HATE_OUR_USERS" ]; then
61 TARGETS="sv-$debug cl-$debug"
62 elif [ x"`uname`" = x"Darwin" ]; then
65 TARGETS="sv-$debug cl-$debug sdl-$debug"
68 # AGL cannot be compiled on systems with a kernel > 10.x (Snow Leopard)
70 TARGETS="sv-$debug sdl-$debug"
73 export CC="$CC -fno-reorder-blocks -I$PWD/misc/buildfiles/osx/Xonotic.app/Contents/Frameworks/SDL.framework/Headers -F$PWD/misc/buildfiles/osx/Xonotic.app/Contents/Frameworks"
75 TARGETS="sv-$debug cl-$debug sdl-$debug"
77 if [ $# -gt 0 ] && [ x"$1" = x"" ]; then
78 # if we give the command make the arg "", it will surely fail (invalid filename),
79 # so better handle it as an empty client option
82 elif [ -n "$1" ]; then
89 TARGETS="$TARGETS sdl-$debug"
92 TARGETS="$TARGETS cl-$debug"
93 if $snowleopardhack; then
94 export CC="$CC -arch i386"
98 TARGETS="$TARGETS cl-$debug"
101 TARGETS="$TARGETS sv-$debug"
104 BAD_TARGETS="$BAD_TARGETS $X"
108 if [ -n "$TARGETS" ]; then # at least a valid client
110 else # no valid client, let's assume this option is not meant to be a client then
111 TARGETS=$TARGETS_SAVE
115 if [ -z "$MAKEFLAGS" ]; then
116 ncpus=`getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1`
117 if [ $ncpus -gt 1 ]; then
120 if [ -n "$WE_HATE_OUR_USERS" ]; then
121 MAKEFLAGS="$MAKEFLAGS DP_MAKE_TARGET=mingw LIB_JPEG= CFLAGS_LIBJPEG="
125 # workaround ARM issue in DP's makefile.inc
130 MAKEFLAGS="$MAKEFLAGS CFLAGS_SSE= CFLAGS_SSE2="
134 if ! verbose $CC misc/tools/conftest.c -o conftest; then
136 msg "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
137 msg "~~~~~~~~~~ COMPILER ~~~~~~~~~~"
138 msg "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
139 msg "~~~~~~~~~~~~~~_...._~~~~~~~~~~"
140 msg "~~~~~~~~~~~,-' \\\`-._~~~~~~"
141 msg "~~~~~~~~~~/ --. >< \\~~~~~"
142 msg "~~~~~~~~~/ (*)> -<: \\~~~~"
143 msg "~~~~~~~~~( ^~-' (*) )~~~~"
144 msg "~~~~~~~~~\\ ^+-_/ |~~~~"
145 msg "~~~~~~~~~~\\ {vvv} |~~~~"
146 msg "~~~~~~~~~~,\\ , {^^^},/~~~~~"
147 msg "~~~~~~~~,/ \`---.....-'~~W~~~~"
148 msg "~~~~~~,/ \\_____/_\\_W~~/~~~~~"
149 msg "~~~~~/ /~~~\\__/~~~~~~"
150 msg "~~~~/ /~~~~~~~~~~~~~~"
151 msg "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
152 msg "~~~~~~~ Y U NO COMPILE ~~~~~~~"
153 msg "~~~~~~~~~~~~ CODE ~~~~~~~~~~~~"
154 msg "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
160 verbose cd "$d0/d0_blind_id"
161 if ! $compiled0; then
162 # compilation of crypto library failed
163 # use binaries then, if we can...
165 if [ -n "$WE_HATE_OUR_USERS" ]; then
166 verbose cp "$d0/misc/buildfiles/win32/libd0_blind_id"-* .libs/
167 verbose cp "$d0/misc/buildfiles/win32/libd0_rijndael"-* .libs/
168 verbose cp "$d0/misc/buildfiles/win32/libgmp"-* .libs/
174 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libd0_blind_id".* .libs/
175 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libd0_rijndael".* .libs/
176 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libgmp".* .libs/
177 MAKEFLAGS="$MAKEFLAGS DP_CRYPTO_STATIC_LIBDIR=../misc/builddeps/dp.linux64/lib/ DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR=../misc/builddeps/dp.linux64/lib/ DP_GMP_STATIC_LIBDIR=../misc/builddeps/dp.linux64/lib/"
180 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libd0_blind_id".* .libs/
181 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libd0_rijndael".* .libs/
182 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libgmp".* .libs/
183 MAKEFLAGS="$MAKEFLAGS DP_CRYPTO_STATIC_LIBDIR=../misc/builddeps/dp.linux32/lib/ DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR=../misc/builddeps/dp.linux32/lib/ DP_GMP_STATIC_LIBDIR=../misc/builddeps/dp.linux32/lib/"
191 verbose cp "$d0/misc/buildfiles/osx/Xonotic.app/Contents/MacOS/libd0_blind_id".* .libs/
192 verbose cp "$d0/misc/buildfiles/osx/Xonotic.app/Contents/MacOS/libd0_rijndael".* .libs/
202 if [ -f Makefile ]; then
203 verbose make $MAKEFLAGS distclean
206 if ! [ -f Makefile ]; then
207 verbose sh autogen.sh
210 verbose make $MAKEFLAGS
213 verbose cd "$d0/gmqcc"
215 verbose make $MAKEFLAGS clean
217 if [ -n "$WE_HATE_OUR_USERS" ]; then
218 verbose make $MAKEFLAGS gmqcc.exe
220 verbose make $MAKEFLAGS gmqcc
223 verbose cd "$d0/data/xonotic-data.pk3dir"
225 verbose make QCC="../../../../gmqcc/gmqcc" "$@" $MAKEFLAGS clean
227 verbose make QCC="../../../../gmqcc/gmqcc" "$@" $MAKEFLAGS
228 # 4 levels up: data, xonotic-data, qcsrc, server
230 verbose cd "$d0/darkplaces"
231 if [ x"$BAD_TARGETS" = x" " ]; then
232 $ECHO "Warning: invalid empty client, default clients will be used."
235 verbose make $MAKEFLAGS clean
237 for T in $TARGETS; do
238 verbose make $MAKEFLAGS STRIP=: "$@" "$T"
240 for T in $BAD_TARGETS; do
241 $ECHO "Warning: discarded invalid client $T."
244 verbose "$SELF" update-maps
247 if [ -n "$WE_HATE_OUR_USERS" ]; then
249 export PATH="$d0/misc/buildfiles/win32:$d0/d0_blind_id/.libs:$PATH"
250 elif [ x"`uname`" = x"Darwin" ]; then
251 export DYLD_LIBRARY_PATH="$d0/misc/buildfiles/osx/Xonotic.app/Contents/MacOS:$d0/d0_blind_id/.libs"
252 export DYLD_FRAMEWORK_PATH="$d0/misc/buildfiles/osx/Xonotic.app/Contents/Frameworks"
255 export LD_LIBRARY_PATH="$d0/d0_blind_id/.libs"
274 if ! [ -x "darkplaces/darkplaces$client" ]; then
275 if [ -x "darkplaces/darkplaces$client.exe" ]; then
278 $ECHO "Client darkplaces/darkplaces$client not found, aborting"
282 set -- "darkplaces/darkplaces$client" -xonotic "$@"
284 # if pulseaudio is running: USE IT
285 if [ -z "$SDL_AUDIODRIVER" ] && ! [ -n "$WE_HATE_OUR_USERS" ] && ! [ x"`uname`" = x"Darwin" ]; then
286 if ps -C pulseaudio >/dev/null; then
287 if ldd /usr/lib/libSDL.so 2>/dev/null | grep pulse >/dev/null; then
288 export SDL_AUDIODRIVER=pulse
295 if [ x"$USE_GDB" = x"yes" ]; then
296 set -- gdb --args "$@"
298 elif [ x"$USE_GDB" = x"core" ]; then
299 set -- gdb --batch -x savecore.gdb --args "$@"
301 elif which catchsegv >/dev/null 2>&1; then
302 set -- catchsegv "$@"
304 if [ x"$USE_RLWRAP" != x"no" ] && which rlwrap >/dev/null 2>&1; then
305 set -- rlwrap -A -g '^quit' -q "\"" -r -S ']' -w 100 "$@"
309 if [ -f xonotic.core ]; then
310 if yesno "The program has CRASHED. Do you want to examine the core dump?"; then
311 gdb "$binary" xonotic.core
312 #elif yesno "You did not want to examine the core dump. Do you want to provide it - including your DarkPlaces checkout - to the Xonotic developers?"; then
313 # tar cvzf xonotic.core.tar.gz xonotic.core darkplaces/*.c darkplaces/*.h
315 # rm -f xonotic.core.tar.gz
317 $ECHO "The core dump can be examined later by"
318 $ECHO " gdb $binary xonotic.core"
324 $ECHO " $SELF compile [-c] [-r|-p] [-0] [sdl|glx|wgl|agl|dedicated]"
325 $ECHO " $SELF update-maps"
326 $ECHO " $SELF run [sdl|glx|wgl|agl|dedicated] options..."