~swag/armagetronad/0.2.9-sty+ct+ap-fork

1 by luke-jr
Unify tags/branches of modules released together
1
dnl I would like to do this to generate the version number...
2
dnl AC_DEFUN([AUTOMATIC_VERSION],syscmd([sh batch/make/version .]))
3
4
dnl but have to do this with version generated in bootstrap.sh instead for some reason
5
m4_include(version)
6
7
dnl Comment this out to disable autoconf custom directories: 
8
m4_include(accustomdir.m4)
9
10
dnl Process this file with autoconf to produce a configure script.
563.24.48 by z-man
Completed rebranding for debian packages.
11
AC_INIT(armagetronad,AUTOMATIC_VERSION)
1 by luke-jr
Unify tags/branches of modules released together
12
563.1.560 by Daniel Lee Harple
Get rid of configure warning about ignoring the datarootdir setting.
13
dnl FIXME: remove this in the future, when automake decides to actually set datarootdir by default
14
dnl http://www.gnu.org/software/hello/manual/autoconf/Changed-Directory-Variables.html
15
AC_DEFUN([AC_DATAROOTDIR_CHECKED])
16
563.1.77 by Manuel Moos
added a couple of automake variables to the registered ones.
17
#set
18
#echo args : "$@"
19
#exit 1
20
1 by luke-jr
Unify tags/branches of modules released together
21
dnl flag telling the status message whether some files will be installed outside of prefix
22
OUTSIDE_OF_PREFIX=no
23
24
dnl system type
25
AC_CANONICAL_TARGET
26
27
dnl those two are apparently included in AC_CANONICAL_TARGET
28
dnl AC_CANONICAL_BUILD
29
dnl AC_CANONICAL_HOST
30
31
AC_PROG_RANLIB
32
AM_INIT_AUTOMAKE
33
34
dnl detect which link commant to use
35
AC_PROG_LN_S
36
37
dnl check whether m4 is available for documentation processing
38
AC_CHECK_PROG(HAVE_M4,m4,true,false)
39
AM_CONDITIONAL(HAVE_M4, test $HAVE_M4 = true)
40
41
dnl check whether date accepts -r to refer to a file
42
AM_CONDITIONAL(DATE_R, date +"%Y" -r $0 > /dev/null 2>&1)
43
44
dnl export version
45
version=$VERSION
46
AC_SUBST(version)
47
48
AC_ARG_VAR(XML2_CONFIG,[Configuration script of libxml2 to use, defaults to xml2-config])
49
AC_ARG_VAR(CXXFLAGS,Flags passed to the C++ compiler)
50
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.])
51
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.])
52
AC_ARG_VAR(docstyle,[Documentation style for cross-building of documentation. Possible values: unix, web and windows.])
490 by z-man
added progname and progtitle to the variables saved in config.status.
53
AC_ARG_VAR(progname,[Program short name, default: armagetronad.])
54
AC_ARG_VAR(progtitle,[Program long name, default: Armagetron Advanced.])
563.1.77 by Manuel Moos
added a couple of automake variables to the registered ones.
55
AC_ARG_VAR(APBUILD_CXX1,[Autopackage ABI 1 C++ compiler.])
56
AC_ARG_VAR(APBUILD_CXX2,[Autopackage ABI 2 C++ compiler.])
57
AC_ARG_VAR(APBUILD_CC,[Autopackage C compiler.])
58
AC_ARG_VAR(CXX_ABI,[Autopackage C++ ABI version.])
59
AC_ARG_VAR(APBUILD_STATIC,[Autopackage static libraries.])
1 by luke-jr
Unify tags/branches of modules released together
60
61
dnl a modern autoconf is required to process this
62
AC_PREREQ(2.50)
63
64
build_regular=true
65
563.1.381 by Manuel Moos
Reduced per-netobject/per-client memory cost.
66
have_lzma=false
67
    AC_ARG_WITH(maxclients, AC_HELP_STRING([--with-maxclients],[sets the hardcoded limit for the number of connected clients (default: 16 for clients and 32 for dedicated servers)]),
68
[ 
563.1.385 by Manuel Moos
Moved MAXCLIENTS from CXXFLAGS to config.h.
69
    AC_DEFINE_UNQUOTED(MAXCLIENTS,${withval},maximal number of clients)
563.1.381 by Manuel Moos
Reduced per-netobject/per-client memory cost.
70
])
71
563.1.278 by epsy46
moved things around, groupped --enable-krawall, --enable-armathentication and --enable-authentication, and slowly killing --disable-glout
72
AC_ARG_ENABLE(dedicated,
73
     AC_HELP_STRING([--enable-dedicated],
74
		[enables dedicated server; otherwise, compile a client (default=disabled)]),
1 by luke-jr
Unify tags/branches of modules released together
75
     [case "${enableval}" in
563.1.278 by epsy46
moved things around, groupped --enable-krawall, --enable-armathentication and --enable-authentication, and slowly killing --disable-glout
76
       yes) build_dedicated=true
77
			build_regular=false
78
	   	;;
79
       no)  build_dedicated=false
1 by luke-jr
Unify tags/branches of modules released together
80
			build_regular=true
81
	    ;;
563.1.278 by epsy46
moved things around, groupped --enable-krawall, --enable-armathentication and --enable-authentication, and slowly killing --disable-glout
82
       *) AC_MSG_ERROR(bad value ${enableval} for --enable-dedicated) ;;
1 by luke-jr
Unify tags/branches of modules released together
83
     esac],[build_dedicated=false])
84
85
86
dnl AC_ARG_ENABLE(glout,
87
dnl [  --enable-glout          enable graphical output; otherwise, compile
88
dnl                          a dedicated server (default=enabled)],,
89
dnl enable_glout=yes)
90
91
AC_ARG_ENABLE(master,
92
     AC_HELP_STRING([--enable-master],
93
		[Build the master server]),
94
     [case "${enableval}" in
95
       yes) armamaster=true ;;
96
       no)  armamaster=false ;;
97
       *) AC_MSG_ERROR(bad value ${enableval} for --enable-master) ;;
98
     esac],[armamaster=false])
99
	 
100
AM_CONDITIONAL(BUILDMASTER, test x$armamaster = xtrue)
101
102
AC_ARG_ENABLE(main,
103
     AC_HELP_STRING([--enable-main],
104
		[Build the main program]),
105
     [case "${enableval}" in
106
       yes) armamain=true ;;
107
       no)  armamain=false ;;
108
       *) AC_MSG_ERROR(bad value ${enableval} for --enable-main) ;;
109
     esac],[armamain=true])
110
563.1.278 by epsy46
moved things around, groupped --enable-krawall, --enable-armathentication and --enable-authentication, and slowly killing --disable-glout
111
AC_ARG_ENABLE(glout,
112
     AC_HELP_STRING([--enable-glout],
113
		[Inverse alias of --enable-dedicated]),
114
     [case "${enableval}" in
115
       yes) build_dedicated=false
116
			build_regular=true
117
	   	;;
118
       no)  build_dedicated=true
119
			build_regular=false
120
	    ;;
121
       *) AC_MSG_ERROR(bad value ${enableval} for --enable-glout) ;;
563.1.279 by epsy46
fixed stuff i didn't notice on first shot
122
     esac],)
563.1.278 by epsy46
moved things around, groupped --enable-krawall, --enable-armathentication and --enable-authentication, and slowly killing --disable-glout
123
1 by luke-jr
Unify tags/branches of modules released together
124
# consistency check of the three build flags	 
125
test x$armamain = xfalse && build_dedicated=false build_regular=false
277 by z-man
Don't check for libxml if only the master server should be built.
126
test x$build_dedicated = xfalse && test x$build_regular = xfalse && armamain=false
1 by luke-jr
Unify tags/branches of modules released together
127
128
AM_CONDITIONAL(BUILDDEDICATED, test x$build_dedicated = xtrue)
277 by z-man
Don't check for libxml if only the master server should be built.
129
AM_CONDITIONAL(BUILDREGULAR, test x$build_regular = xtrue)
1 by luke-jr
Unify tags/branches of modules released together
130
AM_CONDITIONAL(BUILDMAIN, test x$armamain = xtrue)
131
563.1.278 by epsy46
moved things around, groupped --enable-krawall, --enable-armathentication and --enable-authentication, and slowly killing --disable-glout
132
# flag to set when mockup versions of the executables should be built to save
133
# compile time when testing the release process
134
AM_CONDITIONAL(BUILDFAKERELEASE, test "$ARMAGETRONAD_FAKERELEASE" != "")
135
136
# set replacement variables for dedicated server
137
progtitle_serverorclient=" Client"
138
progtitle_server=""
139
if test x$build_dedicated = xtrue; then
140
   progtitle_serverorclient=" Server"
141
   progtitle_server=" Server"
142
fi
143
AC_SUBST(progtitle_serverorclient)
144
AC_SUBST(progtitle_server)
145
AC_SUBST(build_dedicated)
146
AC_SUBST(build_regular)
147
1 by luke-jr
Unify tags/branches of modules released together
148
AC_ARG_ENABLE(memmanager,
149
	AC_HELP_STRING([--enable-memmanager],
150
		[enable custom memory manager on systems that allow it (default=disabled)]),,
151
enable_memmanager=no)
152
153
AC_ARG_ENABLE(music,
154
	AC_HELP_STRING([--enable-music],
155
		[compile in support for background music (default=disabled)]),,
156
enable_music=no)
157
308 by luke-jr
--disable-respawn configure option
158
AC_ARG_ENABLE(respawn,
159
	AC_HELP_STRING([--enable-respawn],
310 by z-man
Disabled respawning by default, and clarified its status as a hack.
160
		[enable unsupported, hacky, impossible to deactivate at runtime, deathmatch mode. Use at your own risk. (default=disabled)]),,
161
enable_respawn=no)
308 by luke-jr
--disable-respawn configure option
162
563.1.279 by epsy46
fixed stuff i didn't notice on first shot
163
AC_ARG_ENABLE(krawall,
164
	AC_HELP_STRING([--enable-krawall],
165
		[enable special visuals for the krawall gaming network (default=disabled)]),,
1 by luke-jr
Unify tags/branches of modules released together
166
enable_krawall=no)
167
563.1.279 by epsy46
fixed stuff i didn't notice on first shot
168
dnl start alias group
169
AC_ENABLE(armathentication,
170
    [echo $enableval; case "${enableval}" in
171
       yes) enable_armathentication=yes
172
	   	;;
173
       no)  enable_armathentication=no
174
	    ;;
175
       *) AC_MSG_ERROR(bad value ${enableval} for --enable-armathentication) ;;
176
     esac],enable_armathentication=no
177
     )
178
179
AC_ARG_ENABLE(authentication,
180
    AC_HELP_STRING([--enable-authentication],
181
		[enable server side code for the krawall style user authentication (default=disabled)]),
182
    [case "${enableval}" in
183
       yes) enable_armathentication=yes
184
	   	;;
185
       no)  enable_armathentication=no
186
	    ;;
187
       *) AC_MSG_ERROR(bad value ${enableval} for --enable-authentication) ;;
188
     esac],
189
    )
190
dnl end alias group
1 by luke-jr
Unify tags/branches of modules released together
191
AC_ARG_ENABLE(automakedefaults,
192
	AC_HELP_STRING([--enable-automakedefaults],
193
		[enforce the default installation directories as set by automake. localstatedir=prefix/var violates the FHS, so this is off by default.]),,
194
enable_automakedefaults=no enable_automakedefaults_default=yes)
195
196
AC_ARG_ENABLE(dirty,
197
	AC_HELP_STRING([--enable-dirty],
198
		[allow dirty GL initialisation (like used with SDL 1.0) even if you have SDL 1.1 or up (default=disabled)]),,
199
enable_dirty=no)
200
201
AC_ARG_ENABLE(sysinstall,
202
	AC_HELP_STRING([--enable-sysinstall],
203
		[will install configuration files to /etc/armagetron and create a user if possible (default=enabled)]),,
204
enable_sysinstall=yes)
205
206
AC_ARG_ENABLE(useradd,
207
	AC_HELP_STRING([--enable-useradd],
208
		[will create a user during installation (default=enabled; requires --enable-sysinstall or a manual call of the sysinstall script)]),,
209
enable_useradd=yes enable_useradd_default=yes)
210
AC_SUBST(enable_useradd)
211
212
AC_ARG_ENABLE(etc,
213
	AC_HELP_STRING([--enable-etc],
214
		[will create links in /etc to the configuration files (default=enabled; requires --enable-sysinstall or a manual call of the sysinstall script)]),,
215
enable_etc=yes enable_etc_default=yes)
216
AC_SUBST(enable_etc)
217
218
AC_ARG_ENABLE(desktop,
219
	AC_HELP_STRING([--enable-desktop],
220
		[will try to integrate into your desktop environment via menu entries (default=enabled; requires --enable-sysinstall or a manual call of the sysinstall script)]),,
221
enable_desktop=yes)
222
AC_SUBST(enable_desktop)
223
224
initdir=location
225
AC_ARG_ENABLE(initscripts,
226
	AC_HELP_STRING([--enable-initscripts=location],
227
		[will install init scripts for the servers into <location>(default=enabled; requires --enable-sysinstall; <location> defaults to /etc/init.d or /etc/rc.d)]),
228
test "x${enableval}" = "xyes" || initdir=${enableval}
229
test "x${enableval}" = "xno" || enable_initscripts=yes,
230
enable_initscripts=yes enable_initscripts_default=yes
231
# disable initscripts if no server is beeing built
232
test x$build_dedicated = xfalse && test x$armamaster = xfalse && enable_initscripts=no
233
initdir=location)
234
AC_SUBST(enable_initscripts)
235
236
AC_ARG_ENABLE(restoreold,
237
	AC_HELP_STRING([--enable-restoreold],
238
		[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)]),,
239
enable_restoreold=yes)
240
AC_SUBST(enable_restoreold)
241
242
AC_ARG_ENABLE(uninstall,
243
	AC_HELP_STRING([--enable-uninstall@<:@=cmd@:>@],
563.24.118 by Manuel Moos
Reactivating uninstall script generation now that it is working again.
244
		[will install an uninstaller script (default=enabled)]),
1 by luke-jr
Unify tags/branches of modules released together
245
if test "$enableval" = "no"; then
246
	enable_uninstall=no
247
else
248
	enable_uninstall=yes
249
	external_uninstall_cmd=$enableval
250
fi,
563.24.118 by Manuel Moos
Reactivating uninstall script generation now that it is working again.
251
enable_uninstall=yes)
1 by luke-jr
Unify tags/branches of modules released together
252
AC_SUBST(external_uninstall_cmd)
253
254
AC_ARG_ENABLE(multiver,
255
	AC_HELP_STRING([--enable-multiver@<:@=slot@:>@],
256
		[allow multiple versions to coexist by storing them in different directories (default=disabled)]),
257
if test "$enableval" = "no"; then
258
	enable_multiver=no
259
else
260
	enable_multiver=yes
261
	multiver_slot="$enableval"
262
fi,
263
enable_multiver=no)
264
265
AC_ARG_ENABLE(games,
266
	AC_HELP_STRING([--enable-games],
267
		[decorates all installation paths with "games" (default=enabled)]),,
268
enable_games=yes)
269
126 by z-man
Added prototypes for lag compensation functions so they can be integrated in the Windows/Mac projects before they're actually used.
270
AC_ARG_ENABLE(enginecoredebug,
271
     AC_HELP_STRING([--enable-enginecoredebug],
272
		[Apply debugging options to engine core (for DEBUGLEVEL>0, defaults to enabled)]),
273
     [case "${enableval}" in
274
       yes) enginecoredebug=true ;;
275
       no)  enginecoredebug=false ;;
276
       *) AC_MSG_ERROR(bad value ${enableval} for --enable-enginecoredebug) ;;
277
     esac],[enginecoredebug=true])
278
	 
279
AM_CONDITIONAL(ENGINECOREDEBUG, test x$enginecoredebug = xtrue)
280
308 by luke-jr
--disable-respawn configure option
281
if test x$enable_respawn = xyes; then
310 by z-man
Disabled respawning by default, and clarified its status as a hack.
282
AC_DEFINE(RESPAWN_HACK,,enables hacky support for deathmatch mode)
308 by luke-jr
--disable-respawn configure option
283
fi
284
1 by luke-jr
Unify tags/branches of modules released together
285
if test x$enable_krawall = xyes; then
286
AC_DEFINE(KRAWALL,,enables krawall)
287
fi
288
516 by z-man
Merging branch 0.2.8-auth from revision 7558 to 7721:
289
if test x$enable_armathentication = xyes; then
1 by luke-jr
Unify tags/branches of modules released together
290
AC_DEFINE(KRAWALL_SERVER,,enables krawall server)
291
fi
292
293
dnl developer CXXFLAGS
294
test -z "$DEBUGLEVEL" && DEBUGLEVEL=0
295
test -z "$CODELEVEL" && CODELEVEL=0
296
126 by z-man
Added prototypes for lag compensation functions so they can be integrated in the Windows/Mac projects before they're actually used.
297
dnl default CXX flags: optimize a bit if no optimization optimization has been selected yet
298
test -z "`echo $CXXFLAGS | grep "\-O"`" && CXXFLAGS="$CXXFLAGS -O2"
299
563.1.153 by z-man
Added -O0 to debug configuration, just in case.
300
test $DEBUGLEVEL -ge 1 && CXXFLAGS="`echo $CXXFLAGS | sed -e 's,-O.,,'` -g -O0"
1 by luke-jr
Unify tags/branches of modules released together
301
test $DEBUGLEVEL -ge 2 && CXXFLAGS="$CXXFLAGS -DDEBUG"
302
test $DEBUGLEVEL -ge 3 && enable_memmanager=yes
303
test $DEBUGLEVEL -ge 4 && CXXFLAGS="$CXXFLAGS -DDEBUG_EXPENSIVE"
304
test $DEBUGLEVEL -ge 5 && CXXFLAGS="$CXXFLAGS -DMEM_DEB"
305
563.1.395 by Manuel Moos
Added one top level call of AX_CXXFLAGS_GCC_OPTION() to fix bug 307790.
306
dnl oddly, this macro needs to be called once unconditionally, or automake
563.1.412 by Manuel Moos
Make sure nonsense GCC option doesn't get added even if it is accepted.
307
dnl borks up. Backup CXXFLAGS and restore them in case the test passes. Which it does
308
dnl for some versions of GCC.
309
CXXFLAGS_BACK="${CXXFLAGS}"
563.1.411 by Manuel Moos
Added check for silly GCC flag to avoid creation of file named "ption".
310
AX_CXXFLAGS_GCC_OPTION(-nobodyreadsconfigureoutputanyway)
563.1.412 by Manuel Moos
Make sure nonsense GCC option doesn't get added even if it is accepted.
311
CXXFLAGS="${CXXFLAGS_BACK}"
563.1.395 by Manuel Moos
Added one top level call of AX_CXXFLAGS_GCC_OPTION() to fix bug 307790.
312
563.1.387 by Manuel Moos
Only add -Wno-strict-overflow if the compiler supports it.
313
if test $CODELEVEL -ge 1; then
314
    CXXFLAGS="$CXXFLAGS -Wall"
315
    
563.1.395 by Manuel Moos
Added one top level call of AX_CXXFLAGS_GCC_OPTION() to fix bug 307790.
316
    dnl careful, only supported on GCC 4.2 and later
317
    AX_CXXFLAGS_GCC_OPTION(-Wno-strict-overflow)
563.1.387 by Manuel Moos
Only add -Wno-strict-overflow if the compiler supports it.
318
fi
319
1 by luke-jr
Unify tags/branches of modules released together
320
dnl test $CODELEVEL -ge 2 && CXXFLAGS="$CXXFLAGS -Wshadow -Wpointer-arith -Wfloat-equal -W -Wcast-qual -Wcast-align -Wconversion -Wunreachable-code --pedantic -Winline"
563.1.366 by Manuel Moos
-Wconversion got a lot more pedantic and annoying in GCC 4.3, so moving it up one code level.
321
test $CODELEVEL -ge 2 && CXXFLAGS="$CXXFLAGS -Wpointer-arith -W -Wcast-qual -Wcast-align --pedantic -Wno-unused-parameter"
322
test $CODELEVEL -ge 3 && CXXFLAGS="$CXXFLAGS -Weffc++ -Wshadow -Winline -Wfloat-equal -Wconversion"
1 by luke-jr
Unify tags/branches of modules released together
323
test $CODELEVEL -ge 4 && CXXFLAGS="$CXXFLAGS -Werror"
324
325
# work arond known cause of warnings in SDL headers
326
test $CODELEVEL -ge 2 && test x$build_dedicated = xtrue || CXXFLAGS="$CXXFLAGS -Wno-long-long"
327
328
dnl determine whether "games" should be put into paths: not if it was
329
dnl requested with --disable-games or if "games" is already included
330
dnl in the data path
331
games_suffix_data=/
332
games_suffix_doc=/
333
games_suffix_config=/
334
games_suffix_var=/
335
if test "${enable_games}" = "yes"; then
336
      test -z "`echo ${datadir}       | grep games`" && games_suffix_data=/games/
337
      test -z "`echo ${prefix}        | grep games`" && games_suffix_doc=/games/
338
      test -z "`echo ${sysconfdir}    | grep games`" && games_suffix_config=/games/
339
      test -z "`echo ${localstatedir} | grep games`" && games_suffix_var=/games/
340
fi
341
AC_SUBST(games_suffix_data)
342
AC_SUBST(games_suffix_config)
343
AC_SUBST(games_suffix_doc)
344
AC_SUBST(games_suffix_var)
345
346
dnl determine memmanager state
347
if test x$enable_memmanager != xyes ; then
348
  AC_DEFINE(DONTUSEMEMMANAGER)
349
fi
350
351
dnl LibTool configuration
352
dnl AC_LIBTOOL_DLOPEN
353
dnl AM_PROG_LIBTOOL
354
355
dnl Header file
356
AC_CONFIG_HEADER(config.h)
357
358
359
dnl Checks for programs.
360
361
dnl C Compiler:
531 by z-man
Better test for ZThread. Taken from official Automake macro, and modified that it actually works.
362
AC_PROG_CC
1 by luke-jr
Unify tags/branches of modules released together
363
AC_PROG_CPP
364
365
dnl C++ Compiler:
366
AC_PROG_CXX
367
AC_PROG_CXXCPP
368
dnl AC_OBJEXT
369
370
dnl Make:
371
dnl AC_PROG_MAKE_SET
372
373
AC_CHECK_PROG(HAVE_GMAKE, gmake, yes, no)
374
if test ${HAVE_GMAKE} = no && make --version | head -n 1 | grep -v "GNU make" 2>&1 /dev/null; then
375
   AC_MSG_ERROR([GNU make (gmake) is currently required for compilation.])
376
fi
377
378
AC_CHECK_PROG(HAVE_BASH, bash, yes, no)
379
if test ${HAVE_BASH} = no; then
380
   AC_MSG_ERROR([GNU Bourne-Again SHell (bash) is currently required for compilation.])
381
fi
382
383
dnl testing a nifty make feature: silent inclu[]des
384
AC_SINCLUDE
385
386
dnl determine the program name and title
387
if test "x$progtitle" = "x" ; then
388
  progtitle="Armagetron Advanced"
389
fi
390
391
if test "x$progname" = "x" ; then
392
  progname=armagetronad
393
fi
394
395
prognamebase=$progname
396
AC_SUBST(progtitle)
397
AC_SUBST(progname)
398
AC_SUBST(prognamebase)
399
400
AM_CONDITIONAL(USE_SYSINSTALL, test "$enable_sysinstall" = "yes")
401
AM_CONDITIONAL(USE_UNINSTALL, test "$enable_uninstall" = "yes")
402
403
AM_CONDITIONAL(ALLOW_MULTIPLE_VERSIONS, test "$enable_multiver" = "yes")
404
AC_SUBST(enable_multiver)
405
if test "$enable_multiver" = "yes"; then
406
  if test "$multiver_slot" = "yes"; then
407
    multiver_slot="$PACKAGE_VERSION"
408
  fi
409
   progdir_suffix="-$multiver_slot"
410
   executable_suffix="-$multiver_slot"
411
else
412
   progdir_suffix=""
413
   executable_suffix=""
414
fi
415
AC_SUBST(progdir_suffix)
416
AC_SUBST(executable_suffix)
417
418
dnl AC_DEFINE(PROGDIR_SUFFIX,\"$progdir_suffix\",[Define to the suffix of all installation folders])
419
AC_DEFINE_UNQUOTED(PROGDIR_SUFFIX,"${progdir_suffix}",[Define to the suffix of all installation folders])
420
421
dnl type checks
422
AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define if you have the type socklen_t.]),,[#include <sys/types.h>
423
#include <sys/socket.h>])
424
425
# tells the makefile if the data files need to be installed
426
needdata=yes
427
AC_SUBST(needdata)
428
429
test "$docstyle" = "" && docstyle=unix
430
431
# find good default of init script directory
432
initdirdefault=/etc/init.d
433
for candidate in /etc/rc.d /etc/init.d; do
434
    test -d ${candidate} && initdirdefault=${candidate}
435
done
436
437
# configuration for various unix flavours
438
define(GENERICUNIX,[
439
        MATHLIB="m"
251 by z-man
Reverted last change, checking for linkage is the right thing for functions.
440
        if test x$build_regular = xtrue; then
441
                AC_PATH_X
442
                AC_PATH_XTRA
443
        fi
1 by luke-jr
Unify tags/branches of modules released together
444
        if test x$have_x = xyes; then
445
            CFLAGS="$CFLAGS $X_CFLAGS"
446
            CXXFLAGS="$CXXFLAGS $X_CFLAGS"
447
            LIBS="$X_LIBS $LIBS"
448
            SYS_GL_LIB="GL"
449
            SYS_GLU_LIB="GLU"
450
        else
451
            SYS_GL_LIB="GL"
452
            SYS_GLU_LIB="GLU"
453
        fi
454
]
455
)
456
457
define(SAFEUNIX,[
458
        AC_DEFINE(DONTUSEMEMMANAGER, 1, [Define if you dont want to use a custom memory manager.])
459
GENERICUNIX
460
]
461
)
462
52 by z-man
Made SDL_CONFIG settable from the outside.
463
SDL_CONFIG_DEFAULT=sdl-config
1 by luke-jr
Unify tags/branches of modules released together
464
465
dnl *************************************************
466
dnl GL AND  MATHLIB SELECTION ( SYSTEM DEPENDANT)
467
dnl *************************************************
468
case "$target" in
469
    *-*-cygwin* | *-*-mingw32*)
470
	AC_DEFINE(WIN32, 1, [Windows 9x/NT/2k/XP])
471
        MATHLIB=""
472
        SYS_GL_LIB="opengl32"
473
        SYS_GLU_LIB="glu32"
474
        ;;
475
    *-*-beos*)
476
	AC_DEFINE(BEOS, 1, [BeOS])
477
        MATHLIB=""
478
        SYS_GL_LIB="GL"
479
        SYS_GLU_LIB="GLU"
480
        ;;
481
    *-*-darwin*)
482
	AC_DEFINE(MACOSX, 1, [Mac OS X])
483
        MATHLIB=""
484
        SYS_GL_LIB=""
485
        SYS_GLU_LIB=""
486
        #LIBS="$LIBS -framework GLU -framework Quicktime -lsmpeg"
487
        ;;
488
    *-*-aix*)
489
	AC_DEFINE(AIX, 1, [AIX])
490
        MATHLIB=""
491
        if test x$ac_cv_prog_gcc = xyes; then
492
            CXXFLAGS="$CXXFLAGS -mthreads"
493
	fi
494
        SYS_GL_LIB=""
495
        SYS_GLU_LIB=""
496
        ;;
497
    *-*-solaris*)
498
	AC_DEFINE(SOLARIS, 1, [Solaris])
499
	AC_DEFINE(CAUTION_WALL, 1, [Define if your system deos not like the pointer tricks in eWall.h.])
500
        LIBS="$LIBS -lnsl -lsocket"
501
SAFEUNIX
502
        ;;
503
    *-*-linux* )
504
    	AC_DEFINE(LINUX, 1, [GNU/Linux])
505
GENERICUNIX
506
		;;
507
    *-*-openbsd* )
508
        # OpenBSD, almost like generic Unix, but needs different init script handling
509
        initdirdefault=OpenBSD
510
SAFEUNIX
511
        ;;
512
    *-*-freebsd* )
513
        # FreeBSD, sdl-config is specialized to sdl11-config there
52 by z-man
Made SDL_CONFIG settable from the outside.
514
        SDL_CONFIG_DEFAULT=sdl11-config
1 by luke-jr
Unify tags/branches of modules released together
515
SAFEUNIX
516
        ;;
517
    *)
518
        # generic unix
519
SAFEUNIX
520
        ;;
521
esac
522
52 by z-man
Made SDL_CONFIG settable from the outside.
523
test -z "$SDL_CONFIG" && SDL_CONFIG=$SDL_CONFIG_DEFAULT
524
1 by luke-jr
Unify tags/branches of modules released together
525
AC_SUBST(docstyle)
526
527
#processor specific setup
528
case "$target" in
529
    i*86-*-*)
530
        ;;
531
   	x86_64-*-*)
532
        ;;
533
    sparc-*-*)
534
        ;;
535
    *)
536
		#disable memory manager; it may depend on processor features
537
		AC_DEFINE(DONTUSEMEMMANAGER)
538
        ;;
539
esac
540
541
AC_CACHE_SAVE
542
543
dnl *************************************************
544
dnl         libxml2
545
dnl *************************************************
546
277 by z-man
Don't check for libxml if only the master server should be built.
547
if test x$armamain = xtrue; then
548
1 by luke-jr
Unify tags/branches of modules released together
549
test -z "$XML2_CONFIG" && XML2_CONFIG=xml2-config
550
563.1.316 by luke-jr
echo is not portable, so use touch and printf
551
if ! $XML2_CONFIG --libs > /dev/null; then
52 by z-man
Made SDL_CONFIG settable from the outside.
552
  AC_MSG_ERROR([Fatal error: the libxml2 configuration script $XML2_CONFIG does not work/exist.])
553
fi
554
1 by luke-jr
Unify tags/branches of modules released together
555
# if test x$armamain = xtrue; then
556
AC_CHECK_LIB(xml2,xmlParseMemory,
307 by z-man
properly checking for libpng-config and some other cleanups. CXXFLAGS and
557
CPPFLAGS="$CPPFLAGS `$XML2_CONFIG --cflags`"
558
LIBS="`$XML2_CONFIG --libs` $LIBS"
1 by luke-jr
Unify tags/branches of modules released together
559
AC_DEFINE(HAVE_LIBXML2, 1, [Define if you have the xml2 library (-lxml2).]),
563.24.59 by Manuel Moos
Rebranding support for configure error messages.
560
AC_MSG_ERROR([You need the library xml2 to compile ${progtitle}. Read the file doc/install_linux.html.])
1 by luke-jr
Unify tags/branches of modules released together
561
,`$XML2_CONFIG --libs`)
562
563
AC_CHECK_FUNC(xmlParserInputBufferCreateFilenameDefault,
564
,
322 by luke-jr
preliminary error-on-old-libxml2 (pre 2.6.11)
565
AC_MSG_ERROR([
1 by luke-jr
Unify tags/branches of modules released together
566
	Your xml2 library is obsolete!
322 by luke-jr
preliminary error-on-old-libxml2 (pre 2.6.11)
567
	Please upgrade to 2.6.11 or later
1 by luke-jr
Unify tags/branches of modules released together
568
])
569
)
570
# fi
571
516 by z-man
Merging branch 0.2.8-auth from revision 7558 to 7721:
572
dnl *************************************************
563.1.335 by epsy
Reverted epsy's revert
573
dnl         Armathentication Threading
516 by z-man
Merging branch 0.2.8-auth from revision 7558 to 7721:
574
dnl *************************************************
575
576
if test x$enable_armathentication = xyes; then
577
563.14.6 by epsy
disable pthread
578
dnl ACX_PTHREAD([
579
580
dnl LIBS="${PTHREAD_LIBS} ${LIBS}"
581
dnl CXXFLAGS="${CXXFLAGS} ${PTHREAD_CFLAGS}"
582
dnl CC="${PTHREAD_CC}"
583
dnl AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.])
584
585
dnl ],[
563.1.340 by Bazaarmagetron
Empty merge to keep the peace between svn and bzr.
586
546 by Manuel Moos
Requiring the most recent zthreads now.
587
AM_PATH_ZTHREAD_AA(2.3.2)
533 by z-man
Ok, now really fixed the libZThread compilation.
588
CXXFLAGS="${CXXFLAGS} ${ZTHREAD_CXXFLAGS}"
589
LIBS="${LIBS} ${ZTHREAD_LIBS}"
277 by z-man
Don't check for libxml if only the master server should be built.
590
563.14.6 by epsy
disable pthread
591
dnl ])
563.1.340 by Bazaarmagetron
Empty merge to keep the peace between svn and bzr.
592
516 by z-man
Merging branch 0.2.8-auth from revision 7558 to 7721:
593
fi # krawall
594
fi # armamain
595
479 by z-man
Everyone gets a math library, even dedicated servers.
596
dnl *************************************************
597
dnl         math
598
dnl *************************************************
599
600
if test $MATHLIB ; then
601
AC_CHECK_LIB($MATHLIB, exp,,
602
	AC_MSG_WARN([
603
	You do not have the standard math library libm. Check
604
	config.log for error messages and fix that.]
605
	)
606
)
607
fi
608
1 by luke-jr
Unify tags/branches of modules released together
609
if test x$build_regular = xfalse; then
610
 AC_MSG_RESULT([
611
 
612
 Configuring dedicated server, skipping libraries...
613
 ])
614
 AC_DEFINE(DEDICATED,,[Define if you wish to compile a dedicated server])
615
616
 progname=${prognamebase}-dedicated
617
 AC_SUBST(progname)
618
 
619
 needdata=no
620
 AC_SUBST(needdata)
621
else
622
623
624
if test x$enable_dirty = xyes; then
625
  AC_DEFINE(DIRTY,,[Define if you wish to use the old and dirty OpenGL
626
  initialization method])
627
fi
628
629
630
dnl *************************************************
631
dnl         SDL
632
dnl *************************************************
633
634
AC_MSG_CHECKING(whether SDL is installed)
635
if SDLLIBS=`${SDL_CONFIG} --libs`; then
307 by z-man
properly checking for libpng-config and some other cleanups. CXXFLAGS and
636
    AC_MSG_RESULT(yes)
1 by luke-jr
Unify tags/branches of modules released together
637
fi
638
639
CPPFLAGS="$CPPFLAGS `${SDL_CONFIG} --cflags`"
640
LIBS="${SDLLIBS} $LIBS"
307 by z-man
properly checking for libpng-config and some other cleanups. CXXFLAGS and
641
642
AC_CHECK_FUNC(SDL_Init,
1 by luke-jr
Unify tags/branches of modules released together
643
AC_DEFINE(HAVE_LIBSDL,,[Define if you have the library SDL]),
563.24.59 by Manuel Moos
Rebranding support for configure error messages.
644
AC_MSG_ERROR([You need the library SDL to compile ${progtitle}. Read the file doc/install_linux.html.])
307 by z-man
properly checking for libpng-config and some other cleanups. CXXFLAGS and
645
,)
1 by luke-jr
Unify tags/branches of modules released together
646
647
dnl *************************************************
648
dnl         SDL_Mixer
649
dnl *************************************************
650
651
if test x$enable_music = xyes; then
652
 AC_CHECK_LIB(SDL_mixer,Mix_OpenAudio,
653
 AC_DEFINE(HAVE_LIBSDL_MIXER, 1, [Define if you have the SDL_mixer library (-lSDL_mixer).])
654
 LIBS="-lSDL_mixer $LIBS",
655
 AC_MSG_WARN([
656
 SDL_mixer library not found. You will not hear music.])
657
 enable_music=no
658
 ,)
659
fi
660
661
dnl *************************************************
662
dnl  Winsock on windows cross-compile
663
dnl *************************************************
664
665
if test "`${SDL_CONFIG} --libs | grep windows`" ; then
563.24.63 by Luke Dashjr
main is not a valid hack for AC_CHECK_LIB... use valid values
666
	AC_CHECK_LIB(wsock32, connect)
1 by luke-jr
Unify tags/branches of modules released together
667
fi
668
669
dnl *************************************************
670
dnl         GL
671
dnl *************************************************
672
673
if test $SYS_GL_LIB && echo $LIBS | grep -v "\-lGL" > /dev/null; then
674
675
dnl AC_CHECK_LIB($SYS_GL_LIB, glEnd,,
676
677
AC_CHECK_LIB($SYS_GL_LIB, glVertex3f,,
678
 AC_MSG_RESULT([OpenGL not found. Maybe it needs X11 to compile? Checking that...])
563.24.63 by Luke Dashjr
main is not a valid hack for AC_CHECK_LIB... use valid values
679
 AC_CHECK_LIB(X11,XOpenDisplay,
1 by luke-jr
Unify tags/branches of modules released together
680
  LIBS="-lX11 -L/usr/X11R6/lib $LIBS"
681
  AC_DEFINE(HAVE_LIBX11, 1, [Define if you have the X11 library (-lX11).])
682
  ,
683
  AC_MSG_WARN([
684
  Standard X11 library needed by OpenGL not found.
685
  ]),-L/usr/X11R6/lib)
563.24.63 by Luke Dashjr
main is not a valid hack for AC_CHECK_LIB... use valid values
686
 AC_CHECK_LIB(Xext,XextFindDisplay,-L/usr/X11R6/lib)
687
  AC_CHECK_LIB(Xt,XtFree,-L/usr/X11R6/lib)
688
 AC_CHECK_LIB(Xi,XOpenDevice,-L/usr/X11R6/lib)
689
 AC_CHECK_LIB(Xmu,XmuDrawLogo,-L/usr/X11R6/lib)
1 by luke-jr
Unify tags/branches of modules released together
690
AC_CHECK_LIB($SYS_GL_LIB, glBegin,,AC_MSG_ERROR([
563.24.59 by Manuel Moos
Rebranding support for configure error messages.
691
  You need Mesa or an OpenGL-System to compile ${progtitle}.
1 by luke-jr
Unify tags/branches of modules released together
692
  Maybe your libGL needs the X libraries and your system does not
693
  find them? Read the file doc/install_linux.html.]),-L/usr/X11R6/lib)
694
)
695
696
dnl check for 3DFX-MESA
697
dnl AC_CHECK_LIB(GL,XMesaSetFXmode,AC_DEFINE(HAVE_FXMESA),,)
698
699
fi
700
701
dnl *************************************************
702
dnl         GLU
703
dnl *************************************************
704
705
706
if test $SYS_GLU_LIB && echo $LIBS | grep -v "\-lGLU" > /dev/null; then
707
708
dnl AC_CHECK_LIB($SYS_GLU_LIB, gluBuild2DMipmaps,,
709
AC_CHECK_LIB($SYS_GLU_LIB, gluBuild3DMipmaps,,
710
AC_MSG_ERROR([
563.24.59 by Manuel Moos
Rebranding support for configure error messages.
711
You need GLU to compile ${progtitle}; it SHOULD have come with OpenGL.
1 by luke-jr
Unify tags/branches of modules released together
712
Read the file doc/install_linux.html.]))
713
714
fi
715
716
dnl *************************************************
717
dnl         Other Stuff
718
dnl *************************************************
719
563.24.63 by Luke Dashjr
main is not a valid hack for AC_CHECK_LIB... use valid values
720
dnl AC_CHECK_LIB(g++, cin,,
1 by luke-jr
Unify tags/branches of modules released together
721
dnl AC_MSG_WARN([C++ standard library not found. You can ignore this warning on non-GNU-systems.]))
722
563.24.149 by z-man
Removing indirect dependencies.
723
dnl AC_CHECK_LIB(z, gzread,,
724
dnl AC_MSG_ERROR([You need libz to compile ${progtitle}.]))
1 by luke-jr
Unify tags/branches of modules released together
725
307 by z-man
properly checking for libpng-config and some other cleanups. CXXFLAGS and
726
AC_MSG_CHECKING(whether libpng is installed)
727
if PNGLIBS=`libpng-config --libs`; then
728
    AC_MSG_RESULT(yes)
729
fi
730
731
CPPFLAGS="$CPPFLAGS `libpng-config --cflags`"
732
LIBS="$LIBS $PNGLIBS"
733
563.24.62 by Luke Dashjr
png_sig_cmp is in both libpng12 and libpng14, where as png_check_sig is only libpng12 --ssuominen
734
AC_CHECK_FUNC(png_sig_cmp,
307 by z-man
properly checking for libpng-config and some other cleanups. CXXFLAGS and
735
,
563.24.59 by Manuel Moos
Rebranding support for configure error messages.
736
AC_MSG_ERROR([You need libpng to compile ${progtitle}.]))
1 by luke-jr
Unify tags/branches of modules released together
737
563.24.149 by z-man
Removing indirect dependencies.
738
dnl AC_CHECK_LIB(jpeg, jpeg_read_header,,
739
dnl	AC_MSG_WARN([
740
dnl	libjpeg not found. Expect small graphical errors ( missing moviepack title screen ).]
741
dnl	)
742
dnl )
1 by luke-jr
Unify tags/branches of modules released together
743
744
AC_CHECK_LIB(SDL_image, IMG_Load,,
745
dnl AC_CHECK_LIB(IMG, main,,
563.24.59 by Manuel Moos
Rebranding support for configure error messages.
746
AC_MSG_ERROR([You need the library SDL_image to compile ${progtitle}.]
1 by luke-jr
Unify tags/branches of modules released together
747
dnl )
748
))
749
750
dnl look for the right header for SDL_image
751
AC_CHECK_HEADERS(SDL_image.h,,
752
[
753
AC_MSG_WARN([SDL_image header not found where it should be ( the SDL include directory ).
754
Trying fallback.])
755
AC_CHECK_HEADERS(SDL/SDL_image.h,,
756
[AC_MSG_WARN([
757
SDL_image header not found. The library is there, so something must be unusual
758
in your setup: SDL_image.h does not reside in the same folder as the rest of the SDL
759
inlcudes and not in any SDL subdirectory in the inclue path. If you know the
760
correct path to it, edit src/render/rTexture.cpp and enter it there.])]
761
)
762
]
763
)
764
765
ifelse(,,,
766
[
767
dnl look for the right way to include the opengl headers
768
AC_CHECK_HEADERS( SDL_opengl.h,,
769
AC_CHECK_HEADERS( SDL/SDL_opengl.h,,
770
AC_CHECK_HEADERS( GL/gl.h,,
771
AC_CHECK_HEADERS( OpenGL/gl.h,,
772
AC_MSG_ERROR([OpenGL header not found.])
773
)
774
)
775
)
776
)
777
])
778
779
fi dnl (dedicated server)
780
781
if test "`$CXX -v 2>&1 | grep -v executing | grep pgcc`"  ; then
782
AC_MSG_WARN(
783
[
784
785
563.24.59 by Manuel Moos
Rebranding support for configure error messages.
786
You are using PGCC to compile ${progtitle}. Due to a bug in PGCC,
1 by luke-jr
Unify tags/branches of modules released together
787
exception handling needs to be disabled. This makes the server
788
mode vulnerable to an attack that causes the server to block or
789
crash. (The attack is still detected, but nothing can be done 
790
about it. You will get the message \"I told you not to use PGCC!\")
791
792
793
])
794
CXXFLAGS="$CXXFLAGS -fno-exceptions -DNOEXCEPT"
795
fi
796
797
798
dnl Checks for header files.
799
AC_HEADER_STDC
800
AC_CHECK_HEADERS(unistd.h)
801
802
dnl Checks for typedefs, structures, and compiler characteristics.
803
AC_C_CONST
804
805
dnl Checks for library functions.
806
AC_CHECK_FUNCS(select)
333 by z-man
Added test for isspace() function.
807
AC_CHECK_FUNCS(isblank atan2f sinf cosf tanf sqrtf logf expf fabsf floorf)
1 by luke-jr
Unify tags/branches of modules released together
808
AC_CHECK_FUNCS(wmemset)
809
810
# if the compiler is GCC -Os produces faulty code (exceptions cause crashes), at least on AMD64. Replace it with -O2.
811
test -z "`$CXX --version | grep '(GCC)'`" || CXXFLAGS="`echo $CXXFLAGS | sed -e 's,-Os,-O2,g' `" CFLAGS="`echo $CFLAGS | sed -e 's,-Os,-O2,g' `"
812
813
dnl add current directories to include search path
307 by z-man
properly checking for libpng-config and some other cleanups. CXXFLAGS and
814
CPPFLAGS="-I. -I.. $CPPFLAGS"
1 by luke-jr
Unify tags/branches of modules released together
815
816
# define
817
AC_DEFINE_UNQUOTED(TOP_SOURCE_DIR,"${srcdir}", [Define the top source directory])
818
AC_DEFINE_UNQUOTED(PROGNAME,"${progname}", [Define the short progam name (with possible -dedicated suffix)])
819
AC_DEFINE_UNQUOTED(PROGNAMEBASE,"${prognamebase}", [Define the short progam name])
820
821
realprefix=${prefix}
822
test x${realprefix} = xNONE && realprefix=${ac_default_prefix}
823
AC_DEFINE_UNQUOTED(PREFIX,"${realprefix}",[Define to the compiled in prefix where most game directories will be children of])
824
realexecprefix=${exec_prefix}
825
test x${realexecprefix} = xNONE && realexecprefix=${realprefix}
826
827
AM_CONDITIONAL(NEEDDATA, test "$needdata" = "yes" )
828
829
#test universal variables
830
dnl univar1=\${prefix}/foo
831
dnl univar2=bar
832
dnl AC_SUBST_UNIVERSAL(univar1)
833
dnl AC_SUBST_UNIVERSAL(univar2)
834
dnl AC_AA_PATH(tridir,${prefix}/tri,[trinary data],[PREFIX/tri])
835
836
# set and export init directory
837
test "x$initdir" = "xlocation" && initdir=${initdirdefault}
838
AC_SUBST(initdir)
839
AC_AA_PATH_NOSUFFIX_RAW(initdir)
840
841
if test "x$enable_automakedefaults" = "xno"; then
842
    # DEVIATION FROM AUTOMAKE DEFAULT for better FHS compatibility:
843
    # automake puts localstatedir to ${prefix}/var. This violates
844
    # the FHS condition that /usr needs to be mountable read-only
845
    # (except for installing/uninstalling software), so we put it 
846
    # by default to /var. Relocation does not suffer as no files
847
    # are installed there initially.
848
    if test "x$build_dedicated" = "xtrue" || test "x$armamaster" = "xtrue"; then
849
        AC_MSG_CHECKING(whether to bend localstatedir to /var)
850
        if test "x${localstatedir}" = "x\${prefix}/var"; then
851
            if test -d `eval echo ${localstatedir}`; then
852
                AC_MSG_RESULT([no, the automake default exists])
853
            else
854
                AC_MSG_RESULT(yes)
855
                localstatedir=/var
856
                test "x$enable_automakedefaults_default" = "xyes" && OUTSIDE_OF_PREFIX=yes
857
            fi
858
        else
859
            AC_MSG_RESULT([no, it has been overridden by the user])
860
        fi
861
    fi
862
    # this is not the best way to do it as the user has to set
863
    # --localstatedir=/usr/local/var and not --localstatedir=\${prefix}/var
864
    # to override it, but I could not find anything better.
865
866
    # ANOTHER DEVIATION: if --enable-games is set and the bindir
867
    # is the default, try to find an alternative binary directory
868
    # that also lies in the path, but has /games in it.
869
    if test "x${bindir}" = "x\${exec_prefix}/bin" && test "x$enable_games" = "xyes"; then
870
        for alt in bin/games games games/bin; do
871
            AC_MSG_CHECKING([alternative binary path ${realexecprefix}/${alt}])
872
            if test -d ${realexecprefix}/${alt} && echo ${PATH} | grep ${realexecprefix}/${alt} > /dev/null; then
873
                bindir=\${exec_prefix}/${alt}
874
                AC_MSG_RESULT(possible)
875
            else
876
                AC_MSG_RESULT(no)
877
            fi
878
        done
879
        # echo binary path : ${bindir}
880
    fi
881
fi
882
883
# paths given by autoconf relevant to us
884
# raw paths. No suffix, nothing to do but make them known
885
AC_AA_PATH_NOSUFFIX_RAW(prefix)
886
AC_AA_PATH_NOSUFFIX_RAW(exec_prefix)
887
888
# check whether those are part of suffix and disable relocability if not
889
AC_AA_PATH_PREPARE_BINRELOC(bindir,\${exec_prefix})
890
AC_AA_PATH_NOSUFFIX_RAW(bindir)
891
AC_AA_PATH_PREPARE_BINRELOC(sbindir,\${exec_prefix})
892
AC_AA_PATH_NOSUFFIX_RAW(sbindir)
893
894
# the full program on those: add (/games)/armagetronad(-dedicated) suffix,
895
# check relocability. The suffix can be overridden any time, before or after
896
# this block.
897
AC_AA_PATH_PREPARE_BINRELOC(datadir,\${prefix})
898
AC_AA_PATH_RAW(datadir)
899
AC_AA_PATH_PREPARE_BINRELOC(sysconfdir,\${prefix})
900
AC_AA_PATH_RAW(sysconfdir)
901
AC_AA_PATH_PREPARE(localstatedir)
902
AC_AA_PATH_RAW(localstatedir)
903
AC_AA_PATH_PREPARE(infodir)
904
AC_AA_PATH_RAW(infodir)
905
AC_AA_PATH_PREPARE(mandir)
906
AC_AA_PATH_RAW(mandir)
907
908
# additional paths:
909
# scripts
311 by z-man
Backported Luke's directory fix.
910
AC_AA_PATH_NOSUFFIX(scriptdir,${aa_datadir}/scripts,[shell scripts],[DATADIR/scripts])
1 by luke-jr
Unify tags/branches of modules released together
911
912
# documentation
913
AC_AA_PATH_PREPARE(docdir)
914
AC_AA_PATH(docdir,${datadir}/doc,[documentation],[DATADIR/doc])
915
916
# PID files
917
AC_AA_PATH_PREPARE(rundir)
918
rundir_suffix=""
919
AC_AA_PATH(rundir,${localstatedir}/run,[PID files],[LOCALSTATEDIR/run])
920
921
# log files
922
AC_AA_PATH_PREPARE(logdir)
923
logdir_suffix=""
924
AC_AA_PATH(logdir,${localstatedir}/log,[server logs],[LOCALSTATEDIR/log])
925
926
# state files of previous version to move to new location
927
oldvardirdefault=/var/${progname}/var
928
test "x$enable_games" = "xyes" && oldvardirdefault=/var/games/${progname}/var
929
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])
930
AC_ARG_ENABLE(migratestate,AC_HELP_STRING([--enable-migratestate],
931
        [tries to move old server state data to its new location (default=enabled)]),,
932
        enable_migratestate=yes)
933
AC_SUBST_UNIVERSAL(enable_migratestate)
934
935
# determine whether binreloc should be used
936
# this needs to come after all AC_AA_PATH_PREPARE_BINRELOC macros.
937
AM_BINRELOC
938
939
# disable user addition for client
940
test x$build_dedicated = xtrue -o x$armamaster = xtrue || enable_useradd=no enable_useradd_default=no
941
942
# export relocatability to all systems (doesn't strictly have to
943
# go through the 'determine at build time' mechanism, but it doesn't hurt.
944
relocatable=${br_cv_binreloc}
945
AC_SUBST_UNIVERSAL(relocatable)
946
947
AC_USE_SUBST_UNIVERSAL
948
AC_AA_REPLACEPATHS
949
307 by z-man
properly checking for libpng-config and some other cleanups. CXXFLAGS and
950
export CPPFLAGS
951
export CXXFLAGS
952
export LIBS
953
1 by luke-jr
Unify tags/branches of modules released together
954
AC_OUTPUT(src/Makefile
955
src/first/Makefile
956
Makefile
957
batch/Makefile
958
language/languages.txt
959
config/rc.config config/aiplayers.cfg
960
src/doc/Makefile src/doc/net/Makefile src/doc/Doxyfile
961
src/doc/html.m4
962
src/thirdparty/Makefile
963
src/thirdparty/particles/Makefile
964
resource/Makefile
965
config/Makefile
966
desktop/Makefile
967
desktop/armagetronad.desktop
968
)
969
970
# m4_define(FULLEVAL,stage1=`eval echo $1`; stage2 
971
972
echo "Configuration complete!"
973
echo ""
974
echo "Options selected are:"
975
echo "     Build Regular Game Client: $build_regular"
976
echo "     Build Dedicated Server: $build_dedicated"
977
echo "     Build Master Server: $armamaster"
978
echo ""
979
echo "Installation options:"
980
echo "     Prefix: $prefix"
981
echo ""
982
if test x$build_dedicated = xtrue -o x$armamaster = xtrue ;
983
then
516 by z-man
Merging branch 0.2.8-auth from revision 7558 to 7721:
984
echo "     Build with Armathentication support (server): $enable_armathentication"
1 by luke-jr
Unify tags/branches of modules released together
985
echo "     Init scripts will be installed in  : $initdir"
986
echo "     Dynamic data will be kept in       : `eval echo ${aa_localstatedir}`"
987
echo "     PID files will be kept in          : `eval echo ${rundir}`"
988
echo "     Log files will be kept in          : `eval echo ${logdir}`"
989
echo "     Add user to run server             : $enable_useradd"
990
echo ""
991
fi
992
echo "     Binaries will be installed in      : `eval echo ${bindir}`"
993
echo "     Static data will be installed in   : `eval echo ${aa_datadir}`"
994
echo "     Configuration will be installed in : `eval echo ${aa_sysconfdir}`"
995
echo "     Documentation will be installed in : `eval echo ${aa_docdir}`"
996
test "x$enable_etc" = "xyes" && echo "     Link to configuration will go to   : /etc/${progname}"
997
echo "     Music support: $enable_music"
998
echo "     Build with Krawall authentication support: $enable_krawall"
999
echo "     Use dirty SDL initialization: $enable_dirty"
1000
echo "     Call sysinstall: $enable_sysinstall"
1001
if test "$enable_uninstall" = "yes" &&
1002
   test "$external_uninstall_cmd" != ""; then
1003
	uninstall_info=" (external: \"$external_uninstall_cmd\")"
1004
else
1005
	uninstall_info=""
1006
fi
1007
echo "     Generate uninstall: $enable_uninstall$uninstall_info"
1008
if test "$enable_multiver" = "yes"; then
1009
	multiver_info=" (slot \"$multiver_slot\")"
1010
else
1011
	multiver_info=""
1012
fi
1013
echo "     Allow multiple versions: $enable_multiver$multiver_info"
1014
echo "     Use custom memory manager: $enable_memmanager"
307 by z-man
properly checking for libpng-config and some other cleanups. CXXFLAGS and
1015
echo "     Debug level : $DEBUGLEVEL"
1016
echo "     Code level  : $CODELEVEL"
1017
echo "     CPPFLAGS    : $CPPFLAGS"
1018
echo "     CXXFLAGS    : $CXXFLAGS"
1019
echo "     LIBS        : $LIBS"
1 by luke-jr
Unify tags/branches of modules released together
1020
1021
# print warning about behavior deviating from automake's defaults
1022
SWITCHES=""
1023
test "x$OUTSIDE_OF_PREFIX" = "xyes" && SWITCHES=" --enable-automakedefaults"
1024
test "x$enable_useradd_default" = "xyes" && OUTSIDE_OF_PREFIX=yes SWITCHES="${SWITCHES} --disable-useradd"
1025
test "x$enable_etc_default" = "xyes" && OUTSIDE_OF_PREFIX=yes SWITCHES="${SWITCHES} --disable-etc"
1026
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"
1027
if test "x$OUTSIDE_OF_PREFIX" = "xyes"; then
1028
    echo ""
1029
    echo "Warning: The configure script decided that, to better work on your system,"
1030
    echo "  it would be a good idea to modify files outside of ${prefix}"
1031
    echo "   during installation or while running. If you disagree, rerun configure with"
1032
    echo "   ${SWITCHES}"
1033
    echo "  after consulting \"configure --help\" for the effects; if you want to get rid"
1034
    echo "  of this warning, pass the corresponding opposite switches."
1035
    echo ""
1036
fi
1037