4 misc/tools/xonotic-map-compiler-autobuild download
7 if [ ! -f "netradiant/install/q3map2.x86" ] ; then
8 msg "q3map2 needed! Building netradiant..."
13 misc/tools/xonotic-map-compiler_from_all ./data/xonotic-maps.pk3dir/maps/$1
26 export CC="$CC -DSUPPORTIPV6"
50 case "`$CC -dumpversion`" in
51 [5-9]*|[1-9][0-9]*|4.[3-9]*|4.[1-9][0-9]*)
53 # -march=native is broken < 4.3
54 if $CC -mtune=native -march=native misc/tools/conftest.c -o conftest >/dev/null 2>&1; then
55 export CC="$CC -mtune=native -march=native"
59 if [ -n "$WE_HATE_OUR_USERS" ]; then
60 export CC="$CC -fno-common"
69 if [ -n "$WE_HATE_OUR_USERS" ]; then
70 TARGETS="sv-$debug cl-$debug"
71 elif [ x"`uname`" = x"Darwin" ]; then
74 TARGETS="sv-$debug cl-$debug sdl-$debug"
77 # AGL cannot be compiled on systems with a kernel > 10.x (Snow Leopard)
79 TARGETS="sv-$debug sdl-$debug"
82 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"
84 TARGETS="sv-$debug cl-$debug sdl-$debug"
86 if [ $# -gt 0 ] && [ x"$1" = x"" ]; then
87 # if we give the command make the arg "", it will surely fail (invalid filename),
88 # so better handle it as an empty client option
91 elif [ -n "$1" ]; then
98 TARGETS="$TARGETS sdl-$debug"
101 TARGETS="$TARGETS cl-$debug"
102 if $snowleopardhack; then
103 export CC="$CC -arch i386"
107 TARGETS="$TARGETS cl-$debug"
110 TARGETS="$TARGETS sv-$debug"
113 BAD_TARGETS="$BAD_TARGETS $X"
117 if [ -n "$TARGETS" ]; then # at least a valid client
119 else # no valid client, let's assume this option is not meant to be a client then
120 TARGETS=$TARGETS_SAVE
124 if [ -z "$MAKEFLAGS" ]; then
125 ncpus=`getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1`
126 if [ $ncpus -gt 1 ]; then
129 if [ -n "$WE_HATE_OUR_USERS" ]; then
130 MAKEFLAGS="$MAKEFLAGS DP_MAKE_TARGET=mingw LIB_JPEG= CFLAGS_LIBJPEG="
134 # workaround ARM issue in DP's makefile.inc
139 MAKEFLAGS="$MAKEFLAGS CFLAGS_SSE= CFLAGS_SSE2="
143 if ! verbose $CC misc/tools/conftest.c -o conftest; then
145 msg "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
146 msg "~~~~~~~~~~ COMPILER ~~~~~~~~~~"
147 msg "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
148 msg "~~~~~~~~~~~~~~_...._~~~~~~~~~~"
149 msg "~~~~~~~~~~~,-' \\\`-._~~~~~~"
150 msg "~~~~~~~~~~/ --. >< \\~~~~~"
151 msg "~~~~~~~~~/ (*)> -<: \\~~~~"
152 msg "~~~~~~~~~( ^~-' (*) )~~~~"
153 msg "~~~~~~~~~\\ ^+-_/ |~~~~"
154 msg "~~~~~~~~~~\\ {vvv} |~~~~"
155 msg "~~~~~~~~~~,\\ , {^^^},/~~~~~"
156 msg "~~~~~~~~,/ \`---.....-'~~W~~~~"
157 msg "~~~~~~,/ \\_____/_\\_W~~/~~~~~"
158 msg "~~~~~/ /~~~\\__/~~~~~~"
159 msg "~~~~/ /~~~~~~~~~~~~~~"
160 msg "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
161 msg "~~~~~~~ Y U NO COMPILE ~~~~~~~"
162 msg "~~~~~~~~~~~~ CODE ~~~~~~~~~~~~"
163 msg "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
169 verbose cd "$d0/d0_blind_id"
170 if ! $compiled0; then
171 # compilation of crypto library failed
172 # use binaries then, if we can...
174 if [ -n "$WE_HATE_OUR_USERS" ]; then
175 verbose cp "$d0/misc/buildfiles/win32/libd0_blind_id"-* .libs/
176 verbose cp "$d0/misc/buildfiles/win32/libd0_rijndael"-* .libs/
177 verbose cp "$d0/misc/buildfiles/win32/libgmp"-* .libs/
183 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libd0_blind_id".* .libs/
184 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libd0_rijndael".* .libs/
185 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libgmp".* .libs/
186 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/"
189 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libd0_blind_id".* .libs/
190 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libd0_rijndael".* .libs/
191 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libgmp".* .libs/
192 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/"
200 verbose cp "$d0/misc/buildfiles/osx/Xonotic.app/Contents/MacOS/libd0_blind_id".* .libs/
201 verbose cp "$d0/misc/buildfiles/osx/Xonotic.app/Contents/MacOS/libd0_rijndael".* .libs/
211 if [ -f Makefile ]; then
212 verbose make $MAKEFLAGS distclean
215 if ! [ -f Makefile ]; then
216 verbose sh autogen.sh
219 verbose make $MAKEFLAGS
222 verbose cd "$d0/gmqcc"
224 verbose make $MAKEFLAGS clean
226 if [ -n "$WE_HATE_OUR_USERS" ]; then
227 verbose make $MAKEFLAGS gmqcc.exe
229 verbose make $MAKEFLAGS gmqcc
232 verbose cd "$d0/data/xonotic-data.pk3dir"
234 verbose make QCC="../../../../gmqcc/gmqcc" "$@" $MAKEFLAGS clean
236 verbose make QCC="../../../../gmqcc/gmqcc" "$@" $MAKEFLAGS
237 # 4 levels up: data, xonotic-data, qcsrc, server
239 verbose cd "$d0/darkplaces"
240 if [ x"$BAD_TARGETS" = x" " ]; then
241 $ECHO "Warning: invalid empty client, default clients will be used."
244 verbose make $MAKEFLAGS clean
246 for T in $TARGETS; do
247 verbose make $MAKEFLAGS STRIP=: "$@" "$T"
249 for T in $BAD_TARGETS; do
250 $ECHO "Warning: discarded invalid client $T."
253 verbose "$SELF" update-maps
256 if [ -n "$WE_HATE_OUR_USERS" ]; then
258 export PATH="$d0/misc/buildfiles/win32:$d0/d0_blind_id/.libs:$PATH"
259 elif [ x"`uname`" = x"Darwin" ]; then
260 export DYLD_LIBRARY_PATH="$d0/misc/buildfiles/osx/Xonotic.app/Contents/MacOS:$d0/d0_blind_id/.libs"
261 export DYLD_FRAMEWORK_PATH="$d0/misc/buildfiles/osx/Xonotic.app/Contents/Frameworks"
264 export LD_LIBRARY_PATH="$d0/d0_blind_id/.libs"
283 if ! [ -x "darkplaces/darkplaces$client" ]; then
284 if [ -x "darkplaces/darkplaces$client.exe" ]; then
287 $ECHO "Client darkplaces/darkplaces$client not found, aborting"
291 set -- "darkplaces/darkplaces$client" -xonotic "$@"
293 # if pulseaudio is running: USE IT
294 if [ -z "$SDL_AUDIODRIVER" ] && ! [ -n "$WE_HATE_OUR_USERS" ] && ! [ x"`uname`" = x"Darwin" ]; then
295 if ps -C pulseaudio >/dev/null; then
296 if ldd /usr/lib/libSDL.so 2>/dev/null | grep pulse >/dev/null; then
297 export SDL_AUDIODRIVER=pulse
304 if [ x"$USE_GDB" = x"yes" ]; then
305 set -- gdb --args "$@"
307 elif [ x"$USE_GDB" = x"core" ]; then
308 set -- gdb --batch -x savecore.gdb --args "$@"
310 elif which catchsegv >/dev/null 2>&1; then
311 set -- catchsegv "$@"
313 if [ x"$USE_RLWRAP" != x"no" ] && which rlwrap >/dev/null 2>&1; then
314 set -- rlwrap -A -g '^quit' -q "\"" -r -S ']' -w 100 "$@"
318 if [ -f xonotic.core ]; then
319 if yesno "The program has CRASHED. Do you want to examine the core dump?"; then
320 gdb "$binary" xonotic.core
321 #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
322 # tar cvzf xonotic.core.tar.gz xonotic.core darkplaces/*.c darkplaces/*.h
324 # rm -f xonotic.core.tar.gz
326 $ECHO "The core dump can be examined later by"
327 $ECHO " gdb $binary xonotic.core"
333 $ECHO " $SELF compile [-c] [-r|-p] [-0] [sdl|glx|wgl|agl|dedicated]"
334 $ECHO " $SELF update-maps"
335 $ECHO " $SELF run [sdl|glx|wgl|agl|dedicated] options..."