1
dnl I would like to do this to generate the version number...
2
dnl AC_DEFUN([AUTOMATIC_VERSION],syscmd([sh batch/make/version .]))
4
dnl but have to do this with version generated in bootstrap.sh instead for some reason
7
dnl Comment this out to disable autoconf custom directories:
8
m4_include(accustomdir.m4)
10
dnl Process this file with autoconf to produce a configure script.
11
AC_INIT(Armagetronad,AUTOMATIC_VERSION)
13
dnl flag telling the status message whether some files will be installed outside of prefix
19
dnl those two are apparently included in AC_CANONICAL_TARGET
20
dnl AC_CANONICAL_BUILD
26
dnl detect which link commant to use
29
dnl check whether m4 is available for documentation processing
30
AC_CHECK_PROG(HAVE_M4,m4,true,false)
31
AM_CONDITIONAL(HAVE_M4, test $HAVE_M4 = true)
33
dnl check whether date accepts -r to refer to a file
34
AM_CONDITIONAL(DATE_R, date +"%Y" -r $0 > /dev/null 2>&1)
40
AC_ARG_VAR(XML2_CONFIG,[Configuration script of libxml2 to use, defaults to xml2-config])
41
AC_ARG_VAR(CXXFLAGS,Flags passed to the C++ compiler)
42
AC_ARG_VAR(DEBUGLEVEL,[Debug level for developers, normal users can safely ignore it. Accepted values go from 0 to 5. See README-DEVELOPER for details.])
43
AC_ARG_VAR(CODELEVEL,[Code checking strictness level for developers, normal users can safely ignore it. Accepted values go from 0 to 4. See README-DEVELOPER for details.])
44
AC_ARG_VAR(docstyle,[Documentation style for cross-building of documentation. Possible values: unix, web and windows.])
46
dnl a modern autoconf is required to process this
52
AC_HELP_STRING([--enable-glout],
53
[enable graphical output; otherwise, compile a dedicated server (default=enabled)]),
54
[case "${enableval}" in
55
yes) build_dedicated=false
58
no) build_dedicated=true
61
*) AC_MSG_ERROR(bad value ${enableval} for --enable-glout) ;;
62
esac],[build_dedicated=false])
64
# flag to set when mockup versions of the executables should be built to save
65
# compile time when testing the release process
66
AM_CONDITIONAL(BUILDFAKERELEASE, test "$ARMAGETRONAD_FAKERELEASE" != "")
68
# set replacement variables for dedicated server
69
progtitle_serverorclient=" Client"
71
if test x$build_dedicated = xtrue; then
72
progtitle_serverorclient=" Server"
73
progtitle_server=" Server"
75
AC_SUBST(progtitle_serverorclient)
76
AC_SUBST(progtitle_server)
77
AC_SUBST(build_dedicated)
78
AC_SUBST(build_regular)
80
dnl AC_ARG_ENABLE(glout,
81
dnl [ --enable-glout enable graphical output; otherwise, compile
82
dnl a dedicated server (default=enabled)],,
86
AC_HELP_STRING([--enable-master],
87
[Build the master server]),
88
[case "${enableval}" in
89
yes) armamaster=true ;;
90
no) armamaster=false ;;
91
*) AC_MSG_ERROR(bad value ${enableval} for --enable-master) ;;
92
esac],[armamaster=false])
94
AM_CONDITIONAL(BUILDMASTER, test x$armamaster = xtrue)
97
AC_HELP_STRING([--enable-main],
98
[Build the main program]),
99
[case "${enableval}" in
100
yes) armamain=true ;;
101
no) armamain=false ;;
102
*) AC_MSG_ERROR(bad value ${enableval} for --enable-main) ;;
103
esac],[armamain=true])
105
# consistency check of the three build flags
106
test x$armamain = xfalse && build_dedicated=false build_regular=false
107
test x$build_dedicated = xfalse && test x$build_regular = xfalse && buildmain=false
109
AM_CONDITIONAL(BUILDDEDICATED, test x$build_dedicated = xtrue)
110
AM_CONDITIONAL(BUILDREGULAR, test x$build_regular = xfalse)
111
AM_CONDITIONAL(BUILDMAIN, test x$armamain = xtrue)
113
AC_ARG_ENABLE(memmanager,
114
AC_HELP_STRING([--enable-memmanager],
115
[enable custom memory manager on systems that allow it (default=disabled)]),,
116
enable_memmanager=no)
119
AC_HELP_STRING([--enable-music],
120
[compile in support for background music (default=disabled)]),,
123
AC_ARG_ENABLE(krawall,
124
AC_HELP_STRING([--enable-krawall],
125
[enable special code for the krawall gaming network (user authentification...) (default=disabled)]),,
128
AC_ARG_ENABLE(krawallserver,
129
AC_HELP_STRING([--enable-krawallserver],
130
[enable special code for the krawall gaming network SERVER (user database query...). dont't touch this! (default=disabled)]),,
131
enable_krawallserver=no)
133
AC_ARG_ENABLE(automakedefaults,
134
AC_HELP_STRING([--enable-automakedefaults],
135
[enforce the default installation directories as set by automake. localstatedir=prefix/var violates the FHS, so this is off by default.]),,
136
enable_automakedefaults=no enable_automakedefaults_default=yes)
139
AC_HELP_STRING([--enable-dirty],
140
[allow dirty GL initialisation (like used with SDL 1.0) even if you have SDL 1.1 or up (default=disabled)]),,
143
AC_ARG_ENABLE(sysinstall,
144
AC_HELP_STRING([--enable-sysinstall],
145
[will install configuration files to /etc/armagetron and create a user if possible (default=enabled)]),,
146
enable_sysinstall=yes)
148
AC_ARG_ENABLE(useradd,
149
AC_HELP_STRING([--enable-useradd],
150
[will create a user during installation (default=enabled; requires --enable-sysinstall or a manual call of the sysinstall script)]),,
151
enable_useradd=yes enable_useradd_default=yes)
152
AC_SUBST(enable_useradd)
155
AC_HELP_STRING([--enable-etc],
156
[will create links in /etc to the configuration files (default=enabled; requires --enable-sysinstall or a manual call of the sysinstall script)]),,
157
enable_etc=yes enable_etc_default=yes)
160
AC_ARG_ENABLE(desktop,
161
AC_HELP_STRING([--enable-desktop],
162
[will try to integrate into your desktop environment via menu entries (default=enabled; requires --enable-sysinstall or a manual call of the sysinstall script)]),,
164
AC_SUBST(enable_desktop)
167
AC_ARG_ENABLE(initscripts,
168
AC_HELP_STRING([--enable-initscripts=location],
169
[will install init scripts for the servers into <location>(default=enabled; requires --enable-sysinstall; <location> defaults to /etc/init.d or /etc/rc.d)]),
170
test "x${enableval}" = "xyes" || initdir=${enableval}
171
test "x${enableval}" = "xno" || enable_initscripts=yes,
172
enable_initscripts=yes enable_initscripts_default=yes
173
# disable initscripts if no server is beeing built
174
test x$build_dedicated = xfalse && test x$armamaster = xfalse && enable_initscripts=no
176
AC_SUBST(enable_initscripts)
178
AC_ARG_ENABLE(restoreold,
179
AC_HELP_STRING([--enable-restoreold],
180
[will try to install links to previous installation on uninstallation in multiver mode (default=enabled; requires --enable-sysinstall or a manual call of the sysinstall script)]),,
181
enable_restoreold=yes)
182
AC_SUBST(enable_restoreold)
184
AC_ARG_ENABLE(uninstall,
185
AC_HELP_STRING([--enable-uninstall@<:@=cmd@:>@],
186
[will install an uninstaller script (default=enabled)]),
187
if test "$enableval" = "no"; then
191
external_uninstall_cmd=$enableval
193
enable_uninstall=yes)
194
AC_SUBST(external_uninstall_cmd)
196
AC_ARG_ENABLE(multiver,
197
AC_HELP_STRING([--enable-multiver@<:@=slot@:>@],
198
[allow multiple versions to coexist by storing them in different directories (default=disabled)]),
199
if test "$enableval" = "no"; then
203
multiver_slot="$enableval"
208
AC_HELP_STRING([--enable-games],
209
[decorates all installation paths with "games" (default=enabled)]),,
212
if test x$enable_krawall = xyes; then
213
AC_DEFINE(KRAWALL,,enables krawall)
216
if test x$enable_krawallserver = xyes; then
217
AC_DEFINE(KRAWALL_SERVER,,enables krawall server)
220
dnl developer CXXFLAGS
221
test -z "$DEBUGLEVEL" && DEBUGLEVEL=0
222
test -z "$CODELEVEL" && CODELEVEL=0
224
test $DEBUGLEVEL -ge 1 && CXXFLAGS="$CXXFLAGS -O0 -g"
225
test $DEBUGLEVEL -ge 2 && CXXFLAGS="$CXXFLAGS -DDEBUG"
226
test $DEBUGLEVEL -ge 3 && enable_memmanager=yes
227
test $DEBUGLEVEL -ge 4 && CXXFLAGS="$CXXFLAGS -DDEBUG_EXPENSIVE"
228
test $DEBUGLEVEL -ge 5 && CXXFLAGS="$CXXFLAGS -DMEM_DEB"
230
dnl default CXX flags: optimize for size if no optimization optimization has been selected yet
231
test -z "`echo $CXXFLAGS | grep "\-O"`" && CXXFLAGS="$CXXFLAGS -O2"
233
test $CODELEVEL -ge 1 && CXXFLAGS="$CXXFLAGS -Wall"
234
dnl test $CODELEVEL -ge 2 && CXXFLAGS="$CXXFLAGS -Wshadow -Wpointer-arith -Wfloat-equal -W -Wcast-qual -Wcast-align -Wconversion -Wunreachable-code --pedantic -Winline"
235
test $CODELEVEL -ge 2 && CXXFLAGS="$CXXFLAGS -Wpointer-arith -W -Wcast-qual -Wcast-align -Wconversion --pedantic -Wno-unused-parameter"
236
test $CODELEVEL -ge 3 && CXXFLAGS="$CXXFLAGS -Weffc++ -Wshadow -Winline -Wfloat-equal"
237
test $CODELEVEL -ge 4 && CXXFLAGS="$CXXFLAGS -Werror"
239
# work arond known cause of warnings in SDL headers
240
test $CODELEVEL -ge 2 && test x$build_dedicated = xtrue || CXXFLAGS="$CXXFLAGS -Wno-long-long"
242
dnl determine whether "games" should be put into paths: not if it was
243
dnl requested with --disable-games or if "games" is already included
247
games_suffix_config=/
249
if test "${enable_games}" = "yes"; then
250
test -z "`echo ${datadir} | grep games`" && games_suffix_data=/games/
251
test -z "`echo ${prefix} | grep games`" && games_suffix_doc=/games/
252
test -z "`echo ${sysconfdir} | grep games`" && games_suffix_config=/games/
253
test -z "`echo ${localstatedir} | grep games`" && games_suffix_var=/games/
255
AC_SUBST(games_suffix_data)
256
AC_SUBST(games_suffix_config)
257
AC_SUBST(games_suffix_doc)
258
AC_SUBST(games_suffix_var)
260
dnl determine memmanager state
261
if test x$enable_memmanager != xyes ; then
262
AC_DEFINE(DONTUSEMEMMANAGER)
265
dnl LibTool configuration
266
dnl AC_LIBTOOL_DLOPEN
270
AC_CONFIG_HEADER(config.h)
273
dnl Checks for programs.
287
AC_CHECK_PROG(HAVE_GMAKE, gmake, yes, no)
288
if test ${HAVE_GMAKE} = no && make --version | head -n 1 | grep -v "GNU make" 2>&1 /dev/null; then
289
AC_MSG_ERROR([GNU make (gmake) is currently required for compilation.])
292
AC_CHECK_PROG(HAVE_BASH, bash, yes, no)
293
if test ${HAVE_BASH} = no; then
294
AC_MSG_ERROR([GNU Bourne-Again SHell (bash) is currently required for compilation.])
297
dnl testing a nifty make feature: silent inclu[]des
300
dnl determine the program name and title
301
if test "x$progtitle" = "x" ; then
302
progtitle="Armagetron Advanced"
305
if test "x$progname" = "x" ; then
306
progname=armagetronad
309
prognamebase=$progname
312
AC_SUBST(prognamebase)
314
AM_CONDITIONAL(USE_SYSINSTALL, test "$enable_sysinstall" = "yes")
315
AM_CONDITIONAL(USE_UNINSTALL, test "$enable_uninstall" = "yes")
317
AM_CONDITIONAL(ALLOW_MULTIPLE_VERSIONS, test "$enable_multiver" = "yes")
318
AC_SUBST(enable_multiver)
319
if test "$enable_multiver" = "yes"; then
320
if test "$multiver_slot" = "yes"; then
321
multiver_slot="$PACKAGE_VERSION"
323
progdir_suffix="-$multiver_slot"
324
executable_suffix="-$multiver_slot"
329
AC_SUBST(progdir_suffix)
330
AC_SUBST(executable_suffix)
332
dnl AC_DEFINE(PROGDIR_SUFFIX,\"$progdir_suffix\",[Define to the suffix of all installation folders])
333
AC_DEFINE_UNQUOTED(PROGDIR_SUFFIX,"${progdir_suffix}",[Define to the suffix of all installation folders])
336
AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define if you have the type socklen_t.]),,[#include <sys/types.h>
337
#include <sys/socket.h>])
339
# tells the makefile if the data files need to be installed
343
test "$docstyle" = "" && docstyle=unix
345
# find good default of init script directory
346
initdirdefault=/etc/init.d
347
for candidate in /etc/rc.d /etc/init.d; do
348
test -d ${candidate} && initdirdefault=${candidate}
351
# configuration for various unix flavours
356
if test x$have_x = xyes; then
357
CFLAGS="$CFLAGS $X_CFLAGS"
358
CXXFLAGS="$CXXFLAGS $X_CFLAGS"
370
AC_DEFINE(DONTUSEMEMMANAGER, 1, [Define if you dont want to use a custom memory manager.])
375
SDL_CONFIG=sdl-config
377
dnl *************************************************
378
dnl GL AND MATHLIB SELECTION ( SYSTEM DEPENDANT)
379
dnl *************************************************
381
*-*-cygwin* | *-*-mingw32*)
382
AC_DEFINE(WIN32, 1, [Windows 9x/NT/2k/XP])
384
SYS_GL_LIB="opengl32"
388
AC_DEFINE(BEOS, 1, [BeOS])
394
AC_DEFINE(MACOSX, 1, [Mac OS X])
398
#LIBS="$LIBS -framework GLU -framework Quicktime -lsmpeg"
401
AC_DEFINE(AIX, 1, [AIX])
403
if test x$ac_cv_prog_gcc = xyes; then
404
CXXFLAGS="$CXXFLAGS -mthreads"
410
AC_DEFINE(SOLARIS, 1, [Solaris])
411
AC_DEFINE(CAUTION_WALL, 1, [Define if your system deos not like the pointer tricks in eWall.h.])
412
LIBS="$LIBS -lnsl -lsocket"
416
AC_DEFINE(LINUX, 1, [GNU/Linux])
420
# OpenBSD, almost like generic Unix, but needs different init script handling
421
initdirdefault=OpenBSD
425
# FreeBSD, sdl-config is specialized to sdl11-config there
426
SDL_CONFIG=sdl11-config
437
#processor specific setup
446
#disable memory manager; it may depend on processor features
447
AC_DEFINE(DONTUSEMEMMANAGER)
453
dnl *************************************************
455
dnl *************************************************
457
test -z "$XML2_CONFIG" && XML2_CONFIG=xml2-config
459
# if test x$armamain = xtrue; then
460
AC_CHECK_LIB(xml2,xmlParseMemory,
461
#export CXXFLAGS="$CXXFLAGS `$XML2_CONFIG --cflags`"
462
export CPPFLAGS="$CPPFLAGS `$XML2_CONFIG --cflags`"
463
export LIBS="`$XML2_CONFIG --libs` $LIBS"
464
AC_DEFINE(HAVE_LIBXML2, 1, [Define if you have the xml2 library (-lxml2).]),
465
AC_MSG_ERROR([You need the library xml2 to compile Armagetron. Read the file doc/install_linux.html.])
466
,`$XML2_CONFIG --libs`)
468
AC_CHECK_FUNC(xmlParserInputBufferCreateFilenameDefault,
470
AC_DEFINE(HAVE_LIBXML2_WO_PIBCREATE, 1, [Define if your xml2 library is obsolete (lacks xmlParserInputBufferCreateFilenameDefault).])
472
Your xml2 library is obsolete!
473
Map validation will be insecure and may fail!
478
if test x$build_regular = xfalse; then
481
Configuring dedicated server, skipping libraries...
483
AC_DEFINE(DEDICATED,,[Define if you wish to compile a dedicated server])
485
progname=${prognamebase}-dedicated
493
if test x$enable_dirty = xyes; then
494
AC_DEFINE(DIRTY,,[Define if you wish to use the old and dirty OpenGL
495
initialization method])
500
dnl *************************************************
502
dnl *************************************************
504
if test $MATHLIB ; then
505
AC_CHECK_LIB($MATHLIB, exp,,
507
You do not have the standard math library libm. Check
508
config.log for error messages and fix that.]
513
dnl *************************************************
515
dnl *************************************************
517
AC_MSG_CHECKING(whether SDL is installed)
518
if SDLLIBS=`${SDL_CONFIG} --libs`; then
519
AC_MSG_RESULT([yes, '${SDL_CONFIG} --libs' gave ${SDLLIBS}])
520
AC_MSG_CHECKING(what name the SDL library is know under)
521
SDLLIB=SDL`echo ${SDLLIBS} | sed -e "s,.*-lSDL,," -e "s, .*$,,"`
522
if test -z ${SDLLIB}; then
523
SDLLIB=`${SDLLIBS} | sed -e "s,.*-l,," -e "s, .*$,,"`
524
if test -z ${SDLLIB}; then
525
AC_MSG_RESULT([failed, taking default: SDL])
528
AC_MSG_RESULT([failed, taking anything from ${SDL_CONFIG} output: ${SDLLIB}])
531
AC_MSG_RESULT(${SDLLIB})
534
AC_MSG_RESULT(no, trying default name)
539
AC_CHECK_LIB($SDLLIB,SDL_Init,
540
CXXFLAGS="$CXXFLAGS `${SDL_CONFIG} --cflags`"
541
CPPFLAGS="$CPPFLAGS `${SDL_CONFIG} --cflags`"
544
LIBS="${SDLLIBS} $LIBS"
546
AC_DEFINE(HAVE_LIBSDL,,[Define if you have the library SDL]),
547
AC_MSG_ERROR([You need the library SDL to compile Armagetron. Read the file doc/install_linux.html.])
550
dnl *************************************************
552
dnl *************************************************
554
if test x$enable_music = xyes; then
555
AC_CHECK_LIB(SDL_mixer,Mix_OpenAudio,
556
AC_DEFINE(HAVE_LIBSDL_MIXER, 1, [Define if you have the SDL_mixer library (-lSDL_mixer).])
557
LIBS="-lSDL_mixer $LIBS",
559
SDL_mixer library not found. You will not hear music.])
564
dnl *************************************************
565
dnl Winsock on windows cross-compile
566
dnl *************************************************
568
if test "`${SDL_CONFIG} --libs | grep windows`" ; then
569
AC_CHECK_LIB(wsock32, main)
572
dnl *************************************************
574
dnl *************************************************
576
if test $SYS_GL_LIB && echo $LIBS | grep -v "\-lGL" > /dev/null; then
578
dnl AC_CHECK_LIB($SYS_GL_LIB, glEnd,,
580
AC_CHECK_LIB($SYS_GL_LIB, glVertex3f,,
581
AC_MSG_RESULT([OpenGL not found. Maybe it needs X11 to compile? Checking that...])
582
AC_CHECK_LIB(X11,main,
583
LIBS="-lX11 -L/usr/X11R6/lib $LIBS"
585
AC_DEFINE(HAVE_LIBX11, 1, [Define if you have the X11 library (-lX11).])
588
Standard X11 library needed by OpenGL not found.
590
AC_CHECK_LIB(Xext,main,-L/usr/X11R6/lib)
591
AC_CHECK_LIB(Xt,main,-L/usr/X11R6/lib)
592
AC_CHECK_LIB(Xi,main,-L/usr/X11R6/lib)
593
AC_CHECK_LIB(Xmu,main,-L/usr/X11R6/lib)
594
AC_CHECK_LIB($SYS_GL_LIB, glBegin,,AC_MSG_ERROR([
595
You need Mesa or an OpenGL-System to compile Armagetron.
596
Maybe your libGL needs the X libraries and your system does not
597
find them? Read the file doc/install_linux.html.]),-L/usr/X11R6/lib)
600
dnl check for 3DFX-MESA
601
dnl AC_CHECK_LIB(GL,XMesaSetFXmode,AC_DEFINE(HAVE_FXMESA),,)
605
dnl *************************************************
607
dnl *************************************************
610
if test $SYS_GLU_LIB && echo $LIBS | grep -v "\-lGLU" > /dev/null; then
612
dnl AC_CHECK_LIB($SYS_GLU_LIB, gluBuild2DMipmaps,,
613
AC_CHECK_LIB($SYS_GLU_LIB, gluBuild3DMipmaps,,
615
You need GLU to compile Armagetron; it SHOULD have come with OpenGL.
616
Read the file doc/install_linux.html.]))
620
dnl *************************************************
622
dnl *************************************************
624
dnl AC_CHECK_LIB(g++, main,,
625
dnl AC_MSG_WARN([C++ standard library not found. You can ignore this warning on non-GNU-systems.]))
627
AC_CHECK_LIB(z, main,,
628
AC_MSG_ERROR([You need libz to compile Armagetron.]))
630
AC_CHECK_LIB(png, main,,
631
AC_MSG_ERROR([You need libpng to compile Armagetron.]))
633
AC_CHECK_LIB(jpeg, main,,
635
libjpeg not found. Expect small graphical errors ( missing moviepack title screen ).]
639
AC_CHECK_LIB(SDL_image, IMG_Load,,
640
dnl AC_CHECK_LIB(IMG, main,,
641
AC_MSG_ERROR([You need libIMG/SDL_image to compile Armagetron.]
645
dnl look for the right header for SDL_image
646
AC_CHECK_HEADERS(SDL_image.h,,
648
AC_MSG_WARN([SDL_image header not found where it should be ( the SDL include directory ).
650
AC_CHECK_HEADERS(SDL/SDL_image.h,,
652
SDL_image header not found. The library is there, so something must be unusual
653
in your setup: SDL_image.h does not reside in the same folder as the rest of the SDL
654
inlcudes and not in any SDL subdirectory in the inclue path. If you know the
655
correct path to it, edit src/render/rTexture.cpp and enter it there.])]
662
dnl look for the right way to include the opengl headers
663
AC_CHECK_HEADERS( SDL_opengl.h,,
664
AC_CHECK_HEADERS( SDL/SDL_opengl.h,,
665
AC_CHECK_HEADERS( GL/gl.h,,
666
AC_CHECK_HEADERS( OpenGL/gl.h,,
667
AC_MSG_ERROR([OpenGL header not found.])
674
fi dnl (dedicated server)
676
if test "`$CXX -v 2>&1 | grep -v executing | grep pgcc`" ; then
681
You are using PGCC to compile Armagetron. Due to a bug in PGCC,
682
exception handling needs to be disabled. This makes the server
683
mode vulnerable to an attack that causes the server to block or
684
crash. (The attack is still detected, but nothing can be done
685
about it. You will get the message \"I told you not to use PGCC!\")
689
CXXFLAGS="$CXXFLAGS -fno-exceptions -DNOEXCEPT"
694
dnl Replace `main' with a function in -lpthread:
696
dnl Checks for header files.
698
AC_CHECK_HEADERS(unistd.h)
700
dnl Checks for typedefs, structures, and compiler characteristics.
703
dnl Checks for library functions.
704
AC_CHECK_FUNCS(select)
705
AC_CHECK_FUNCS(atan2f sinf cosf tanf sqrtf logf expf fabsf floorf)
706
AC_CHECK_FUNCS(wmemset)
708
# if the compiler is GCC -Os produces faulty code (exceptions cause crashes), at least on AMD64. Replace it with -O2.
709
test -z "`$CXX --version | grep '(GCC)'`" || CXXFLAGS="`echo $CXXFLAGS | sed -e 's,-Os,-O2,g' `" CFLAGS="`echo $CFLAGS | sed -e 's,-Os,-O2,g' `"
711
dnl add current directories to include search path
712
CXXFLAGS="-I. -I.. $CXXFLAGS"
716
AC_DEFINE_UNQUOTED(TOP_SOURCE_DIR,"${srcdir}", [Define the top source directory])
717
AC_DEFINE_UNQUOTED(PROGNAME,"${progname}", [Define the short progam name (with possible -dedicated suffix)])
718
AC_DEFINE_UNQUOTED(PROGNAMEBASE,"${prognamebase}", [Define the short progam name])
721
test x${realprefix} = xNONE && realprefix=${ac_default_prefix}
722
AC_DEFINE_UNQUOTED(PREFIX,"${realprefix}",[Define to the compiled in prefix where most game directories will be children of])
723
realexecprefix=${exec_prefix}
724
test x${realexecprefix} = xNONE && realexecprefix=${realprefix}
726
AM_CONDITIONAL(NEEDDATA, test "$needdata" = "yes" )
728
#test universal variables
729
dnl univar1=\${prefix}/foo
731
dnl AC_SUBST_UNIVERSAL(univar1)
732
dnl AC_SUBST_UNIVERSAL(univar2)
733
dnl AC_AA_PATH(tridir,${prefix}/tri,[trinary data],[PREFIX/tri])
735
# set and export init directory
736
test "x$initdir" = "xlocation" && initdir=${initdirdefault}
738
AC_AA_PATH_NOSUFFIX_RAW(initdir)
740
if test "x$enable_automakedefaults" = "xno"; then
741
# DEVIATION FROM AUTOMAKE DEFAULT for better FHS compatibility:
742
# automake puts localstatedir to ${prefix}/var. This violates
743
# the FHS condition that /usr needs to be mountable read-only
744
# (except for installing/uninstalling software), so we put it
745
# by default to /var. Relocation does not suffer as no files
746
# are installed there initially.
747
if test "x$build_dedicated" = "xtrue" || test "x$armamaster" = "xtrue"; then
748
AC_MSG_CHECKING(whether to bend localstatedir to /var)
749
if test "x${localstatedir}" = "x\${prefix}/var"; then
750
if test -d `eval echo ${localstatedir}`; then
751
AC_MSG_RESULT([no, the automake default exists])
755
test "x$enable_automakedefaults_default" = "xyes" && OUTSIDE_OF_PREFIX=yes
758
AC_MSG_RESULT([no, it has been overridden by the user])
761
# this is not the best way to do it as the user has to set
762
# --localstatedir=/usr/local/var and not --localstatedir=\${prefix}/var
763
# to override it, but I could not find anything better.
765
# ANOTHER DEVIATION: if --enable-games is set and the bindir
766
# is the default, try to find an alternative binary directory
767
# that also lies in the path, but has /games in it.
768
if test "x${bindir}" = "x\${exec_prefix}/bin" && test "x$enable_games" = "xyes"; then
769
for alt in bin/games games games/bin; do
770
AC_MSG_CHECKING([alternative binary path ${realexecprefix}/${alt}])
771
if test -d ${realexecprefix}/${alt} && echo ${PATH} | grep ${realexecprefix}/${alt} > /dev/null; then
772
bindir=\${exec_prefix}/${alt}
773
AC_MSG_RESULT(possible)
778
# echo binary path : ${bindir}
782
# paths given by autoconf relevant to us
783
# raw paths. No suffix, nothing to do but make them known
784
AC_AA_PATH_NOSUFFIX_RAW(prefix)
785
AC_AA_PATH_NOSUFFIX_RAW(exec_prefix)
787
# check whether those are part of suffix and disable relocability if not
788
AC_AA_PATH_PREPARE_BINRELOC(bindir,\${exec_prefix})
789
AC_AA_PATH_NOSUFFIX_RAW(bindir)
790
AC_AA_PATH_PREPARE_BINRELOC(sbindir,\${exec_prefix})
791
AC_AA_PATH_NOSUFFIX_RAW(sbindir)
793
# the full program on those: add (/games)/armagetronad(-dedicated) suffix,
794
# check relocability. The suffix can be overridden any time, before or after
796
AC_AA_PATH_PREPARE_BINRELOC(datadir,\${prefix})
797
AC_AA_PATH_RAW(datadir)
798
AC_AA_PATH_PREPARE_BINRELOC(sysconfdir,\${prefix})
799
AC_AA_PATH_RAW(sysconfdir)
800
AC_AA_PATH_PREPARE(localstatedir)
801
AC_AA_PATH_RAW(localstatedir)
802
AC_AA_PATH_PREPARE(infodir)
803
AC_AA_PATH_RAW(infodir)
804
AC_AA_PATH_PREPARE(mandir)
805
AC_AA_PATH_RAW(mandir)
809
AC_AA_PATH(scriptdir,${aa_datadir}/scripts,[shell scripts],[DATADIR/scripts])
812
AC_AA_PATH_PREPARE(docdir)
813
AC_AA_PATH(docdir,${datadir}/doc,[documentation],[DATADIR/doc])
816
AC_AA_PATH_PREPARE(rundir)
818
AC_AA_PATH(rundir,${localstatedir}/run,[PID files],[LOCALSTATEDIR/run])
821
AC_AA_PATH_PREPARE(logdir)
823
AC_AA_PATH(logdir,${localstatedir}/log,[server logs],[LOCALSTATEDIR/log])
825
# state files of previous version to move to new location
826
oldvardirdefault=/var/${progname}/var
827
test "x$enable_games" = "xyes" && oldvardirdefault=/var/games/${progname}/var
828
AC_AA_PATH_WITH(oldvardir,\${prefix}${oldvardirdefault},[directory where the state files of a previous version may be kept; they'll be moved to their new place on installation.],[oldvardir])
829
AC_ARG_ENABLE(migratestate,AC_HELP_STRING([--enable-migratestate],
830
[tries to move old server state data to its new location (default=enabled)]),,
831
enable_migratestate=yes)
832
AC_SUBST_UNIVERSAL(enable_migratestate)
834
# determine whether binreloc should be used
835
# this needs to come after all AC_AA_PATH_PREPARE_BINRELOC macros.
838
# disable user addition for client
839
test x$build_dedicated = xtrue -o x$armamaster = xtrue || enable_useradd=no enable_useradd_default=no
841
# export relocatability to all systems (doesn't strictly have to
842
# go through the 'determine at build time' mechanism, but it doesn't hurt.
843
relocatable=${br_cv_binreloc}
844
AC_SUBST_UNIVERSAL(relocatable)
846
AC_USE_SUBST_UNIVERSAL
849
AC_OUTPUT(src/Makefile
853
language/languages.txt
854
config/rc.config config/aiplayers.cfg
855
src/doc/Makefile src/doc/net/Makefile src/doc/Doxyfile
857
src/thirdparty/Makefile
858
src/thirdparty/particles/Makefile
862
desktop/armagetronad.desktop
865
# m4_define(FULLEVAL,stage1=`eval echo $1`; stage2
867
echo "Configuration complete!"
869
echo "Options selected are:"
870
echo " Build Regular Game Client: $build_regular"
871
echo " Build Dedicated Server: $build_dedicated"
872
echo " Build Master Server: $armamaster"
874
echo "Installation options:"
875
echo " Prefix: $prefix"
877
if test x$build_dedicated = xtrue -o x$armamaster = xtrue ;
879
echo " Build with Krawall authentication support (server): $enable_krawallserver"
880
echo " Init scripts will be installed in : $initdir"
881
echo " Dynamic data will be kept in : `eval echo ${aa_localstatedir}`"
882
echo " PID files will be kept in : `eval echo ${rundir}`"
883
echo " Log files will be kept in : `eval echo ${logdir}`"
884
echo " Add user to run server : $enable_useradd"
887
echo " Binaries will be installed in : `eval echo ${bindir}`"
888
echo " Static data will be installed in : `eval echo ${aa_datadir}`"
889
echo " Configuration will be installed in : `eval echo ${aa_sysconfdir}`"
890
echo " Documentation will be installed in : `eval echo ${aa_docdir}`"
891
test "x$enable_etc" = "xyes" && echo " Link to configuration will go to : /etc/${progname}"
892
echo " Music support: $enable_music"
893
echo " Build with Krawall authentication support: $enable_krawall"
894
echo " Use dirty SDL initialization: $enable_dirty"
895
echo " Call sysinstall: $enable_sysinstall"
896
if test "$enable_uninstall" = "yes" &&
897
test "$external_uninstall_cmd" != ""; then
898
uninstall_info=" (external: \"$external_uninstall_cmd\")"
902
echo " Generate uninstall: $enable_uninstall$uninstall_info"
903
if test "$enable_multiver" = "yes"; then
904
multiver_info=" (slot \"$multiver_slot\")"
908
echo " Allow multiple versions: $enable_multiver$multiver_info"
909
echo " Use custom memory manager: $enable_memmanager"
910
echo " Debug level: $DEBUGLEVEL"
911
echo " Code level: $CODELEVEL"
913
# print warning about behavior deviating from automake's defaults
915
test "x$OUTSIDE_OF_PREFIX" = "xyes" && SWITCHES=" --enable-automakedefaults"
916
test "x$enable_useradd_default" = "xyes" && OUTSIDE_OF_PREFIX=yes SWITCHES="${SWITCHES} --disable-useradd"
917
test "x$enable_etc_default" = "xyes" && OUTSIDE_OF_PREFIX=yes SWITCHES="${SWITCHES} --disable-etc"
918
test x$build_dedicated = xtrue -o x$armamaster = xtrue && test "x$enable_initscripts_default" = "xyes" && echo "${initdir}" | grep '^/etc/' > /dev/null && OUTSIDE_OF_PREFIX=yes SWITCHES="${SWITCHES} --disable-initscripts"
919
if test "x$OUTSIDE_OF_PREFIX" = "xyes"; then
921
echo "Warning: The configure script decided that, to better work on your system,"
922
echo " it would be a good idea to modify files outside of ${prefix}"
923
echo " during installation or while running. If you disagree, rerun configure with"
925
echo " after consulting \"configure --help\" for the effects; if you want to get rid"
926
echo " of this warning, pass the corresponding opposite switches."