2 # Empire - A multi-player, client/server Internet based war game.
3 # Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
4 # Ken Stevens, Steve McClure
6 # This program 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 2 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, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 # See files README, COPYING and CREDITS in the root of the source
23 # tree for related information and legal notices. It is expected
24 # that future projects/authors will amend these files as needed.
28 # configure.ac: Autoconf input file
30 # Known contributors to this file:
31 # Markus Armbruster, 2005-2008
33 # Process this file with autoconf to produce a configure script.
35 # Autoconf makes checking for and programming around assorted ancient
36 # crap relatively painless. But why bother? Just rely on C89 and
37 # POSIX, and when something breaks on some oddball machine, see
38 # whether it's worth fixing.
41 AC_INIT([Wolfpack Empire], [4.3.12], [wolfpack@wolfpackempire.com], [empire])
42 AC_CONFIG_SRCDIR([include/combat.h])
43 AC_CONFIG_MACRO_DIR([m4])
44 AC_CONFIG_HEADERS([config.h])
47 ### 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)
67 ### Checks for libraries
70 # TODO merge this into LIB_SOCKET_NSL?
73 LIBS="-lws2_32 $LIBS" ;;
76 # TODO turn this into a macro?
78 AC_SEARCH_LIBS([setupterm], [termlib termcap curses ncurses])
79 # FIXME if not found, complain and switch off highlighting
80 termlibs=`echo $LIBS | sed s/\`echo $save_LIBS | sed 's/././g'\`'$//'`
85 ### Checks for header files
88 ### Checks for typedefs, structures, and compiler characteristics
93 ### Checks for library functions
95 AC_CHECK_FUNCS(getaddrinfo)
99 ### Site configuration
101 # Can't be bothered to make MAXNOC configurable right now.
102 AC_DEFINE([MAXNOC], [99],
103 [The maximum number of countries])
105 AC_ARG_VAR([EMPIREHOST], [Default host (client only) [127.0.0.1]])
106 test "$EMPIREHOST" || EMPIREHOST=127.0.0.1
108 AC_ARG_VAR([EMPIREPORT], [Default port (client and server) [6665]])
109 test "$EMPIREPORT" || EMPIREPORT=6665
111 AC_ARG_WITH([pthread],
112 AS_HELP_STRING([--with-pthread],
113 [use POSIX threads]))
115 # Select thread package
117 if test "$with_pthread" != no; then
118 if test "$acx_pthread_ok" = yes; then
122 if test -z "$with_pthread" || test "$with_pthread" = no; then
123 if test "$ac_cv_func_makecontext" = yes; then
131 if test -z "$empthread"; then
132 AC_MSG_ERROR([No usable thread package found])
135 AC_MSG_NOTICE([Using $empthread threads])
137 LWP) AC_DEFINE([EMPTH_LWP], 1, [Define to use LWP threads]) ;;
138 POSIX) AC_DEFINE([EMPTH_POSIX], 1, [Define to use POSIX threads]) ;;
139 Windows) AC_DEFINE([EMPTH_W32], 1, [Define to use Windows threads]) ;;
145 AC_CONFIG_FILES([GNUmakefile])
146 AC_CONFIG_COMMANDS([stamp-h],
149 mkdir -p `cd $srcdir && git-ls-files \
150 | sed -n 's,/@<:@^/@:>@*$,,gp' | uniq`
153 mkdir -p `sed s/.*=// <$srcdir/sources.mk | tr ' ' '\012' \
154 | sed -n '/\//s,/@<:@^/@:>@*$,,gp'| uniq`
156 mkdir -p info.html info.nr lib