]> git.pond.sub.org Git - empserver/blob - configure.ac
edit: Don't show loyalty, plague stage and time as percentages
[empserver] / configure.ac
1 #
2 #   Empire - A multi-player, client/server Internet based war game.
3 #   Copyright (C) 1986-2013, Dave Pare, Jeff Bailey, Thomas Ruschak,
4 #                 Ken Stevens, Steve McClure, Markus Armbruster
5 #
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.
10 #
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.
15 #
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/>.
18 #
19 #   ---
20 #
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.
24 #
25 #   ---
26 #
27 #   configure.ac: Autoconf input file
28 #
29 #   Known contributors to this file:
30 #      Markus Armbruster, 2005-2013
31 #
32 # Process this file with autoconf to produce a configure script.
33
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.
38
39 AC_PREREQ(2.64)
40 AC_INIT([Wolfpack Empire], [4.3.32], [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])
46
47
48 ### Checks for programs
49 AC_PROG_AWK
50 AC_PROG_INSTALL
51 AC_PROG_RANLIB
52 AC_PROG_CC
53 AC_SUBST(GCC)
54 AM_PROG_CC_C_O
55 # Private automake macro, tsk, tsk, tsk...
56 _AM_DEPENDENCIES(CC)
57
58 AC_ARG_VAR(NROFF, [nroff command])
59 AC_CHECK_PROG(NROFF, groff, [GROFF_NO_SGR= groff -Tascii -U], nroff)
60
61 # not really a check for a program, but close enough
62 if test -d $srcdir/.git; then revctrl=git
63 else revctrl=
64 fi
65 AC_SUBST(revctrl,$revctrl)
66
67 # Not a program, but need to check this early
68 MY_WINDOWS_API
69
70
71 ### Checks for libraries
72 AX_PTHREAD
73 LIBS_util="$LIBS"
74 LIBS="$LIBS_SOCKETS $LIBS"
75 AX_LIB_SOCKET_NSL
76 LIBS_server="$LIBS"
77
78
79 ### Checks for header files
80
81
82 ### Checks for typedefs, structures, and compiler characteristics
83
84 AC_C_CHAR_UNSIGNED
85
86
87 ### Checks for library functions
88
89 AC_CHECK_FUNCS(getaddrinfo getpass)
90 MY_FUNC_MAKECONTEXT
91
92
93 ### Site configuration
94
95 # Can't be bothered to make MAXNOC configurable right now.
96 AC_DEFINE([MAXNOC], [99],
97           [The maximum number of countries])
98
99 AC_ARG_VAR([EMPIREHOST], [Default host (client only) [127.0.0.1]])
100 test "$EMPIREHOST" || EMPIREHOST=127.0.0.1
101
102 AC_ARG_VAR([EMPIREPORT], [Default port (client and server) [6665]])
103 test "$EMPIREPORT" || EMPIREPORT=6665
104
105 AC_ARG_WITH([pthread],
106             AS_HELP_STRING([--with-pthread],
107                            [use POSIX threads]))
108
109 # Select thread package
110 empthread=
111 if test "$with_pthread" != no; then
112     if test "$ax_pthread_ok" = yes; then
113         empthread=POSIX
114     fi
115 fi
116 if test -z "$with_pthread" || test "$with_pthread" = no; then
117     if test "$ac_cv_func_makecontext" = yes; then
118         empthread=LWP
119     fi
120     if test $Windows_API = yes; then
121         empthread=Windows
122     fi
123 fi
124 if test -z "$empthread"; then
125     AC_MSG_ERROR([No usable thread package found])
126 fi
127 AC_SUBST(empthread)
128 case $empthread in
129 LWP)    AC_DEFINE([EMPTH_LWP], 1, [Define to use LWP threads]) ;;
130 POSIX)  AC_DEFINE([EMPTH_POSIX], 1, [Define to use POSIX threads]) ;;
131 Windows) AC_DEFINE([EMPTH_W32], 1, [Define to use Windows threads]) ;;
132 esac
133
134 MY_WITH_TERMINFO
135 LIBS_client="$LIBS"
136
137
138 ### Output
139
140 LIBS="$LIBS_util"
141 AC_SUBST(LIBS_client)
142 AC_SUBST(LIBS_server)
143
144 AC_CONFIG_FILES([GNUmakefile])
145 AC_CONFIG_COMMANDS([stamp-h],
146         [case $revctrl in
147         git)
148             mkdir -p `cd $srcdir && git ls-files \
149                 | sed -n 's,/@<:@^/@:>@*$,,gp' | uniq`
150             ;;
151         *)
152             mkdir -p `sed s/.*=// <$srcdir/sources.mk | tr ' ' '\012' \
153                 | sed -n '/\//s,/@<:@^/@:>@*$,,gp'| uniq`
154         esac
155         mkdir -p info.html info.nr lib
156         touch stamp-h],
157         [revctrl=$revctrl])
158 AC_OUTPUT
159
160 AC_MSG_NOTICE([])
161 AC_MSG_NOTICE([-= Configuration summary =-])
162 AC_MSG_NOTICE([Thread package: $empthread])
163 AC_MSG_NOTICE([      terminfo: $with_terminfo])
164 AC_MSG_NOTICE([    EMPIREHOST: $EMPIREHOST])
165 AC_MSG_NOTICE([    EMPIREPORT: $EMPIREPORT])