/
configure.ac.template
215 lines (177 loc) · 5.43 KB
/
configure.ac.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
AC_INIT([csl], [0.8.2])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_HEADER([src/config.h])
AC_LANG_CPLUSPLUS
AC_PROG_CXX
AC_PROG_CC
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_PROG_RANLIB
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
PKG_LIB_VERSION="1:0:0"
AC_SUBST([PKG_LIB_VERSION])
DEFAULT_COMPILER_FLAGS="-Wall -fsigned-char"
CFLAGS="$CFLAGS $DEFAULT_COMPILER_FLAGS"
CXXFLAGS="$CXXFLAGS $DEFAULT_COMPILER_FLAGS"
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST([GETTEXT_PACKAGE])
IT_PROG_INTLTOOL([0.34.2], [no-xml])
IT_PO_SUBDIR([po-engine])
PLUGINS_INTLTOOL
# wxWidgets tests
# ---------------
WX_CONFIG=wx-config
AC_ARG_WITH(wx-config,
AC_HELP_STRING([--with-wx-config=FILE], [custom wx-config script]), [
AS_IF([test "$withval" != "yes" -a "$withval" != ""], [
WX_CONFIG=$withval
])
])
AC_DEFUN([WX_TEST], [
AC_REQUIRE([AC_PROG_AWK])
AC_MSG_CHECKING([wxWidgets version])
AS_IF([wx_version=`$WX_CONFIG --version`], [
AC_MSG_RESULT([$wx_version])
], [
AC_MSG_RESULT([not found])
AC_MSG_ERROR([wxWidgets is required. Try --with-wx-config.])
])
])
AC_DEFUN([WX_CHECK_SETUP], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
#include <wx/setup.h>
]], [[
#ifndef $1
#error failed
#endif
]])
], [$2], [$3]
)
])
# wxWidgets
# ---------
WX_TEST
wx_ver_min2=2008010
wx_ver_min3=2009004
wx_ver=`echo $wx_version | $AWK 'BEGIN { FS = "."; } { printf "% d", ($1 * 1000 + $2) * 1000 + $3;}'`
if test $(($wx_ver/1000)) -ge 2009 -a "$wx_ver" -ge "$wx_ver_min3" || \
test $(($wx_ver/1000)) -lt 2009 -a "$wx_ver" -ge "$wx_ver_min2"
then
WX_CXXFLAGS=" `$WX_CONFIG --cxxflags | sed -e 's/-fno-exceptions/g/;s/-I/-isystem /g'`"
WX_LIBS="`$WX_CONFIG --libs base,adv,core,net,richtext,qa,xml,html,xml,aui`"
else
AC_MSG_ERROR([wxWidgets 2.8.10 (2.8 series) or 2.9.4 (3.0 series) or newer is required])
fi
AC_SUBST(WX_LIBS)
AC_SUBST(WX_CXXFLAGS)
CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS"
AC_MSG_CHECKING([wxWidgets charset])
WX_CHECK_SETUP([wxUSE_UNICODE_UTF8], [wx_charset=utf8], [
WX_CHECK_SETUP([wxUSE_UNICODE], [wx_charset=unicode], [
wx_charset=ansi
AC_MSG_WARN([you should using an unicode version of wxWidgets])
])
])
AC_MSG_RESULT([$wx_charset])
# Speech dispatcher
# -----------------
AC_ARG_ENABLE(speechd, AC_HELP_STRING([--disable-speechd], [disable speech-dispatcher support]),
[use_speechd="$enableval"], [use_speechd="yes"]
)
AS_IF([test "x$use_speechd" = xyes], [
PKG_CHECK_MODULES([SPEECHD], [speech-dispatcher], [
AC_DEFINE([HAVE_LIBSPEECHD_08_H], [1], [""])
CXXFLAGS="$CXXFLAGS $SPEECHD_CFLAGS"
], [
AC_CHECK_HEADERS([libspeechd.h], [SPEECHD_LIBS="-lspeechd"], [use_speechd="no"])
])
])
# GeoIP
#------
AC_ARG_WITH([internal_geoip],
AC_HELP_STRING([--with-internal-geoip], [with internal_geoip @<:@default=check@:>@]),
[with_internal_geoip=$withval], [with_internal_geoip=check]
)
AS_IF([test "x$with_internal_geoip" != xyes], [
AC_CHECK_HEADERS([GeoIP.h], [
AC_CHECK_LIB([GeoIP], [GeoIP_new], [
with_internal_geoip="no"
], [
with_internal_geoip=${with_internal_geoip}_failed
])
], [
with_internal_geoip=${with_internal_geoip}_failed
])
AS_IF([test "x$with_internal_geoip" = xno_failed], [
AC_MSG_ERROR([--with-internal-geoip=no but libGeoIP couldn't be found.])
])
])
AS_IF([test "x$with_internal_geoip" != xno], [
AC_CHECK_HEADERS([stdint.h])
AC_CHECK_FUNCS([gettimeofday localtime_r socket inet_ntoa])
AC_CHECK_FUNC([gethostbyname_r], [
AC_EGREP_HEADER([int.*gethostbyname_r], [netdb.h], [
AC_DEFINE([GETHOSTBYNAME_R_RETURNS_INT], [1], [""])
])
])
with_internal_geoip="yes"
AC_DEFINE_UNQUOTED([GEOIPDATADIR], [""], [""])
])
# precompiled headers
#--------------------
AC_MSG_CHECKING([whether to use precompiled headers])
AC_ARG_ENABLE(pch, AC_HELP_STRING([--disable-pch], [don't use precompiled headers]),
[use_pch="$enableval"], [use_pch="yes"]
)
AS_IF([test "x$enable_dependency_tracking" = xno], [
use_pch="no"
])
AS_IF([test "x$use_pch" = xyes], [
use_pch="no"
AS_IF([test "x$GCC" = xyes], [
AS_IF([gcc_version=`$CC -dumpversion` > /dev/null 2>&1], [
major=`echo $gcc_version | cut -d. -f1`
minor=`echo $gcc_version | sed "s/@<:@-,a-z,A-Z@:>@.*//" | cut -d. -f2`
AS_IF([test -n "$major" -a -n "$minor" -a $major -ge 4], [
use_pch="yes"
])
])
])
])
AC_MSG_RESULT([$use_pch])
# conditionals and automake output
#---------------------------------
AM_CONDITIONAL([WITH_INTERNAL_GEOIP], [test "x$with_internal_geoip" = xyes])
AM_CONDITIONAL([ENABLE_PCH], [test "x$use_pch" = xyes])
AC_OUTPUT(Makefile
data/Makefile
data/maps/Makefile
data/maps/Sauerbraten/254/Makefile
data/maps/Sauerbraten/256/Makefile
data/maps/Sauerbraten/Makefile
po/Makefile.in
po-engine/Makefile.in
src/Makefile
src/engine/Makefile
src/engine/tools/Makefile
src/pch/Makefile
src/plugin/Makefile
src/plugins/Makefile
src/tools/Makefile
PLUGINS_MAKEFILES)
echo
echo -e "--------------------------------------------------"
echo -e "$PACKAGE $VERSION"
echo
echo -e "Install prefix................. : $prefix"
echo
echo -e "wxWidgets version.............. : $wx_version ($wx_charset)"
echo -e "Build using precompiled headers : $use_pch"
echo
echo -e "Speech-dispatcher support...... : $use_speechd"
echo -e "Use internal libGeoIP.......... : $with_internal_geoip"
echo
echo -e "Enabled plugins................ : PLUGINS_ENABLED"
echo -e "--------------------------------------------------"
echo