2 # Empire - A multi-player, client/server Internet based war game.
3 # Copyright (C) 1986-2015, Dave Pare, Jeff Bailey, Thomas Ruschak,
4 # Ken Stevens, Steve McClure, Markus Armbruster
6 # Empire is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 # See files README, COPYING and CREDITS in the root of the source
22 # tree for related information and legal notices. It is expected
23 # that future projects/authors will amend these files as needed.
27 # configure.ac: Autoconf input file
29 # Known contributors to this file:
30 # Markus Armbruster, 2005-2015
32 # Process this file with autoconf to produce a configure script.
34 # Autoconf makes checking for and programming around assorted ancient
35 # crap relatively painless. But why bother? Just rely on C89 and
36 # POSIX, and when something breaks on some oddball machine, see
37 # whether it's worth fixing.
40 AC_INIT([Wolfpack Empire], [4.3.34], [wolfpack@wolfpackempire.com], [empire],
41 [http://www.wolfpackempire.com/])
42 AC_CONFIG_SRCDIR([include/combat.h])
43 AC_CONFIG_AUX_DIR([build-aux])
44 AC_CONFIG_MACRO_DIR([m4])
45 AC_CONFIG_HEADERS([config.h])
48 ### Checks for programs
54 # Private automake macro, tsk, tsk, tsk...
57 AC_ARG_VAR(NROFF, [nroff command])
58 AC_CHECK_PROG(NROFF, groff, [GROFF_NO_SGR= groff -Tascii -U], nroff)
60 # not really a check for a program, but close enough
61 if test -d $srcdir/.git; then revctrl=git
64 AC_SUBST(revctrl,$revctrl)
66 # Not a program, but need to check this early
70 ### Checks for libraries
73 LIBS="$LIBS_SOCKETS $LIBS"
78 ### Checks for header files
81 ### Checks for typedefs, structures, and compiler characteristics
83 # Enable useful warnings
84 # clang needs to be tested with -Werror=unknown-warning-option
85 AX_CHECK_COMPILE_FLAG([-Werror=unknown-warning-option],
86 [cflags_test="-Werror=unknown-warning-option"],
88 MY_APPEND_COMPILE_FLAGS([-Wall -Wextra dnl
89 -Wmissing-prototypes dnl
93 -Wstrict-prototypes dnl
94 -Wno-unused-parameter dnl
95 ], [], [$cflags_test])
97 # Our carg() conflicts with libm's TODO clean that up
98 MY_APPEND_COMPILE_FLAGS([-fno-builtin-carg])
100 # No multiple definitions of uninitialized global variables
101 MY_APPEND_COMPILE_FLAGS([-fno-common])
104 ### Checks for library functions
106 AC_CHECK_FUNCS(getaddrinfo getpass)
110 ### Site configuration
112 # Can't be bothered to make MAXNOC configurable right now.
113 AC_DEFINE([MAXNOC], [99],
114 [The maximum number of countries])
116 AC_ARG_VAR([EMPIREHOST], [Default host (client only) [127.0.0.1]])
117 test "$EMPIREHOST" || EMPIREHOST=127.0.0.1
119 AC_ARG_VAR([EMPIREPORT], [Default port (client and server) [6665]])
120 test "$EMPIREPORT" || EMPIREPORT=6665
122 AC_ARG_WITH([pthread],
123 AS_HELP_STRING([--with-pthread],
124 [use POSIX threads]))
126 # Select thread package
128 if test "$with_pthread" != no; then
129 if test "$ax_pthread_ok" = yes; then
133 if test -z "$with_pthread" || test "$with_pthread" = no; then
134 if test "$ac_cv_func_makecontext" = yes; then
137 if test $Windows_API = yes; then
141 if test -z "$empthread"; then
142 AC_MSG_ERROR([No usable thread package found])
146 LWP) AC_DEFINE([EMPTH_LWP], 1, [Define to use LWP threads]) ;;
147 POSIX) AC_DEFINE([EMPTH_POSIX], 1, [Define to use POSIX threads]) ;;
148 Windows) AC_DEFINE([EMPTH_W32], 1, [Define to use Windows threads]) ;;
158 AC_SUBST(LIBS_client)
159 AC_SUBST(LIBS_server)
161 AC_CONFIG_FILES([GNUmakefile])
162 AC_CONFIG_COMMANDS([stamp-h],
165 mkdir -p `cd $srcdir && git ls-files \
166 | sed -n 's,/@<:@^/@:>@*$,,gp' | uniq`
169 mkdir -p `sed s/.*=// <$srcdir/sources.mk | tr ' ' '\012' \
170 | sed -n '/\//s,/@<:@^/@:>@*$,,gp'| uniq`
172 mkdir -p info.html info.nr lib
178 AC_MSG_NOTICE([-= Configuration summary =-])
179 AC_MSG_NOTICE([Thread package: $empthread])
180 AC_MSG_NOTICE([ terminfo: $with_terminfo])
181 AC_MSG_NOTICE([ EMPIREHOST: $EMPIREHOST])
182 AC_MSG_NOTICE([ EMPIREPORT: $EMPIREPORT])