]> git.pond.sub.org Git - empserver/blob - src/client/configure.ac
e7e373adb9da59e065124964f6d589f305aebfa4
[empserver] / src / client / configure.ac
1 #
2 #   Empire - A multi-player, client/server Internet based war game.
3 #   Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
4 #                            Ken Stevens, Steve McClure
5 #
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.
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, write to the Free Software
18 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 #
20 #   ---
21 #
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.
25 #
26 #   ---
27 #
28 #   configure.ac: Autoconf input file
29 #
30 #   Known contributors to this file:
31 #      Markus Armbruster, 2005-2008
32 #
33 # Process this file with autoconf to produce a configure script.
34
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.
39
40 AC_PREREQ(2.59)
41 AC_INIT([Empire Client], [4.3.20], [wolfpack@wolfpackempire.com])
42 AC_CONFIG_SRCDIR([empire.6])
43 AC_CONFIG_HEADERS([config.h])
44
45
46 ### Checks for programs.
47 AC_PROG_CC
48 AC_PROG_INSTALL
49
50
51 ### Checks for libraries.
52 AC_SEARCH_LIBS([setupterm], [termlib termcap curses ncurses])
53 LIB_SOCKET_NSL
54 # TODO merge this into LIB_SOCKET_NSL?
55 if test "$ac_cv_search_gethostbyname" = no; then
56     dnl Can't search ws2_32 for gethostbyname using AC_SEARCH_LIBS, because
57     dnl it requires #include <winsock2.h> to work.
58     AC_MSG_CHECKING([for gethostbyname in -lws2_32])
59     save_LIBS=$LIBS
60     LIBS="-lws2_32 $LIBS"
61     AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <winsock2.h>]],
62                                     [[gethostbyname ("");]])],
63                    [ws2_res=yes], [LIBS=save_LIBS ws2_res=no])
64     AC_MSG_RESULT([$ws2_res])
65 fi
66
67 ### Checks for header files.
68
69
70 ### Checks for typedefs, structures, and compiler characteristics.
71
72 AC_MSG_CHECKING([for Windows])
73 AC_COMPILE_IFELSE(
74     [AC_LANG_SOURCE([[#ifdef _WIN32
75 #Here's a nickel, kid
76 #endif]])],
77     [Windows_res=no],
78     [Windows_res=yes CFLAGS="$CFLAGS -mthreads"])
79 AC_MSG_RESULT([$Windows_res])
80
81
82 ### Checks for library functions.
83
84 AC_CHECK_FUNCS(getaddrinfo)
85
86
87 ### Site configuration
88
89 AC_ARG_VAR([EMPIREHOST], [Default host [blitz.wolfpackempire.com]])
90 test "$EMPIREHOST" || EMPIREHOST=blitz.wolfpackempire.com
91
92 AC_ARG_VAR([EMPIREPORT], [Default port [6789]])
93 test "$EMPIREPORT" || EMPIREPORT=6789
94
95
96 ### Output
97
98 AC_CONFIG_FILES([Makefile ipglob.c])
99 AC_OUTPUT