-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure.in
308 lines (249 loc) · 8.55 KB
/
configure.in
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
dnl Process this file with autoconf to produce a configure script.
dnl Created by anjuta, later hardly modified by Johannes Nicolai
AC_INIT(src/Robot.cc)
AC_CONFIG_AUX_DIR(config)
dnl Version numbers
RTB_MAJOR_VERSION=1
RTB_MINOR_VERSION=0
RTB_MICRO_VERSION=9
RTB_EXTRA_VERSION=[-Ext]
RTB_RPM_RELEASE=1
RTB_LAST_RELEASED_VERSION=1.0.8
RTB_LAST_RELEASED_RELEASE=2
RTB_VERSION=$RTB_MAJOR_VERSION.$RTB_MINOR_VERSION.$RTB_MICRO_VERSION$RTB_EXTRA_VERSION
RTB_RPM_VERSION="$RTB_VERSION"-"$RTB_RPM_RELEASE"
AC_SUBST(RTB_MAJOR_VERSION)
AC_SUBST(RTB_MINOR_VERSION)
AC_SUBST(RTB_MICRO_VERSION)
AC_SUBST(RTB_RPM_RELEASE)
AC_SUBST(RTB_RPM_VERSION)
AC_SUBST(RTB_VERSION)
VERSION=$RTB_VERSION
PACKAGE=RealTimeBattle
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE",[Package name])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION",[version number])
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
dnl Automake initialization
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
AM_CONFIG_HEADER(config.h)
dnl Search for install_info
AC_PATH_PROG(install_info, install-info, no, $PATH:/sbin:/usr/sbin/:/usr/local/sbin)
INSTALL_INFO=$install_info
dnl Search for sgml-tools
AC_CHECK_PROG(sgml2html, sgml2html, yes, no)
AM_CONDITIONAL(SGML2HTML, test x$sgml2html = xyes)
AC_CHECK_PROG(sgml2latex, sgml2latex, yes, no)
AM_CONDITIONAL(SGML2LATEX, test x$sgml2latex = xyes)
AC_CHECK_PROG(sgml2info, sgml2info, yes, no)
AM_CONDITIONAL(SGML2INFO, test x$sgml2info = xyes)
AC_CHECK_PROG(sgml2txt, sgml2txt, yes, no)
AM_CONDITIONAL(SGML2TXT, test x$sgml2txt = xyes)
AC_CHECK_PROG(sgml2lyx, sgml2lyx, yes, no)
AM_CONDITIONAL(SGML2LYX, test x$sgml2lyx = xyes)
AC_CHECK_PROG(sgml2rtf, sgml2rtf, yes, no)
AM_CONDITIONAL(SGML2RTF, test x$sgml2rtf = xyes)
dnl Checks for programs.
AC_PROG_CXX
AC_PROG_INSTALL
AC_PREFIX_DEFAULT(/usr/local)
dnl switch to C++ mode
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AM_PROG_CC_STDC
AC_ISC_POSIX
dnl Check for header files
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h strings.h sys/time.h unistd.h floatingpoint.h sys/types.h)
AC_EGREP_HEADER(RLIMIT_NPROC, sys/resource.h, AC_DEFINE(HAVE_RLIMIT_NPROC,1,[cheat_check]))
# network support
AC_ARG_ENABLE(network, [ --enable-network make a version with network support], enable_network=yes, enable_network=no)
AM_CONDITIONAL(NO_NETWORK, test x$enable_network = xno)
# graphics / GTK
AC_ARG_ENABLE(graphics, [ --disable-graphics make a version without a GUI], enable_graphics=no, enable_graphics=yes)
AM_CONDITIONAL(NO_GRAPHICS, test x$enable_graphics = xno)
if test x$enable_graphics = "xyes"; then
dnl Here we test whether we have to link against lsocket and lnsl
ETR_SOCKET_NSL
fi
# Check for GTK+.
if test "x$enable_graphics" = "xyes"; then
dnl Checks for libraries.
PKG_CHECK_MODULES([GTK], [gtk+-2.0 gdk-2.0],,[ AC_MSG_ERROR("Could not find gtk libs: $GTK_PKG_ERRORS")])
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_CFLAGS)
fi
dnl debugging options
AC_ARG_ENABLE(debug, [
RealTimeBattle options:
--enable-debug[=no/yes]
turn on debugging [default=no]],,
enable_debug=no)
dnl compile warning options
AC_ARG_ENABLE(compile-warnings,
[ --enable-compile-warnings turn on compile time warnings],
, enable_compile_warnings=no)
WARNING_FLAGS="-Wall"
PROFILE_FLAGS="-pg"
if test "x$enable_compile_warnings" = "xyes"; then
CXXFLAGS="$CXXFLAGS $WARNING_FLAGS"
fi
dnl enable profiling
AC_ARG_ENABLE(prof, [], enable_prof=yes, enable_prof=no)
if test "x$enable_prof" = "xyes"; then
CXXFLAGS="$CXXFLAGS $PROFILEFLAGS"
fi
changequote(,)dnl
if test "x$enable_debug" = "xyes"; then
case " $CXXFLAGS " in
*[\ \ ]-g[\ \ ]*) ;;
*) CXXFLAGS="$CXXFLAGS -g " ;;
esac
case " $CFLAGS " in
*[\ \ ]-g[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -g " ;;
esac
CXXFLAGS=`echo "$CXXFLAGS " | sed "s/-O[0-9]* //"`
CFLAGS=`echo "$CXXFLAGS " | sed "s/-O[0-9]* //"`
else
CXXFLAGS=`echo "$CXXFLAGS " | sed "s/-g //"`
CFLAGS=`echo "$CFLAGS " | sed "s/-g //"`
if test "x$enable_debug" = "xno"; then
CPPFLAGS="$CPPFLAGS -DNDEBUG"
fi
fi
changequote([,])dnl
AC_ARG_ENABLE(rpm, [ --enable-rpm=[opts] used when making RPM-packages], use_rpm=yes, use_rpm=no)
changequote(,)dnl
if test "x$use_rpm" = "xyes"; then
CXXFLAGS="$enable_rpm"
CFLAGS="$enable_rpm"
INSTALL_INFO=no
fi
changequote([,])dnl
AM_CONDITIONAL(ENABLE_RPM, test x$use_rpm = xyes)
AC_ARG_WITH(rtb_dir,
[ --with-rtb-dir=[path] directory for rtb installation
[EPREFIX/games/RealTimeBattle]],,
with_rtb_dir=['${exec_prefix}/games/RealTimeBattle'])
RTB_DIR=$with_rtb_dir
AC_SUBST(RTB_DIR)
DOCS_DIR=[${RTB_DIR}/Documentation]
AC_SUBST(DOCS_DIR)
AC_SUBST(INSTALL_INFO)
RTB_EXPAND_DIR(ROBOTDIR, "${RTB_DIR}/Robots")
AC_SUBST(ROBOTDIR)
RTB_EXPAND_DIR(ARENADIR, "${RTB_DIR}/Arenas")
AC_SUBST(ARENADIR)
AC_DEFINE_UNQUOTED(ROBOTDIR, "$ROBOTDIR",[robothome])
AC_DEFINE_UNQUOTED(ARENADIR, "$ARENADIR",[arenahome])
AC_ARG_WITH(nls_localedir,
[ --with-nls-localedir=[path] Data directory for NLS, parent of locale
[DATADIR/locale]],,
with_nls_localedir=['${datadir}/locale'])
RTB_EXPAND_DIR(RTB_LOCALEDIR, "${with_nls_localedir}")
AC_SUBST(RTB_LOCALEDIR)
RTB_EXPAND_DIR(RTB_LOCALEDIR, "${RTB_LOCALEDIR}") #Need to expand twice!
AC_DEFINE_UNQUOTED(RTB_LOCALEDIR, "$RTB_LOCALEDIR",[localehome])
AC_CHECK_LIB(stdc++, getc,stdcxx=yes,
AC_MSG_ERROR(You need to have libstdc++ installed))
AC_CHECK_HEADER(vector,,
AC_MSG_ERROR(You need to have the libstdc++ headers installed))
if test "x$stdcxx" = "xyes"; then
STDCXX_LIBS=-lstdc++
fi
AC_SUBST(STDCXX_LIBS)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T
AC_HEADER_TIME
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(select)
AC_CHECK_FUNC(getopt_long,, [getopt=yes])
AM_CONDITIONAL(NO_GETOPT_LONG, test x$getopt = xyes)
AC_CHECK_LIB(xpg4, setlocale)
dnl Initialize localization support
AM_GNU_GETTEXT
AM_GNU_GETTEXT_VERSION(0.14.1)
dnl Checks for Additional stuffs.
GETTEXT_PACKAGE=RealTimeBattle
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTTEXT_PACKAGE", [Package name for gettext])
dnl begin of robot specific checks (only needed for perl , joystick and java bots )
dnl Check if linux joystick api is availabe (used for joypad_robot)
AC_CHECK_HEADERS(linux/joystick.h,[linuxjoystickavailable="yes"],[linuxjoystickavailable="false"; AC_MSG_WARN([No joystick API found, cannot compile joypad robot])])
AM_CONDITIONAL([linuxjoystickavailable],[test x$linuxjoystickavailable = "xyes"])
dnl now configure java
AC_CHECK_CLASSPATH
AC_PROG_JAVAC
AM_CONDITIONAL([javacavailable],[test "x$JAVAC" != x])
AC_PROG_JAVA
AM_CONDITIONAL([javaavailable],[test "x$JAVA" != x])
dnl now configure perl
AX_SYS_PERLSHARPBANG
AM_CONDITIONAL([perlavailable],[test "x$PERL_SHEBANG" != x ])
dnl now configure python
AX_WITH_PYTHON(2.2, missing)
AM_CONDITIONAL([pythonavailable],[test "x$PYTHON" != "xmissing"])
AC_SUBST(PYTHON)
dnl now configure the RealTimeBattle Team Framework with the Brotfrucht strategy
if test -d "$srcdir/rtb-team-framework"; then
AC_CONFIG_SUBDIRS([rtb-team-framework])
else
AC_MSG_WARN(["You have deleted the RealTimeBattle Team Framework, so this part is not to be built!"])
fi
dnl restore language
AC_LANG_RESTORE
dnl Finally, the default behavior of msgmerge breaks 2-byte character
dnl encodings, as used in ja.po and others.
dnl We fix this by forcing the "-w 0" option on all msgmerge calls.
AC_OUTPUT_COMMANDS(
[if test -f po/Makefile ; then
if grep 'MSGMERGE = PATH=../src:$$PATH msgmerge -w 0' po/Makefile >/dev/null 2>&1 ; then
# has already been modified
:
else
echo modifying po/Makefile
mv -f po/Makefile po/Makefile.tmp
sed -e 's/MSGMERGE = PATH=..\/src:$$PATH msgmerge/MSGMERGE = PATH=..\/src:$$PATH msgmerge -w 0/' po/Makefile.tmp > po/Makefile
rm po/Makefile.tmp
fi
fi])
AC_OUTPUT([
m4/Makefile
intl/Makefile
Makefile
po/Makefile.in
Arenas/Makefile
Packages/Makefile
Packages/rpm/Makefile
Packages/debian/Makefile
Packages/freebsd/Makefile
Documentation/Makefile
Documentation/German/Makefile
Documentation/Spanish/Makefile
Documentation/French/Makefile
src/Makefile
Robots/Makefile
Robots/seek_and_destroy/Makefile
Robots/rotate_and_fire/Makefile
Robots/empty/Makefile
Robots/xt-bot/Makefile
Robots/thomas2/Makefile
Robots/joypad_robot/Makefile
Robots/jBot/Makefile
Robots/jBot/jBot.robot
Robots/perl-Skeleton/perl-Skeleton.robot
Robots/perl-Skeleton/Makefile
Robots/perl/perl.robot
Robots/perl/Makefile
Robots/raziel/raziel.py.robot
Robots/raziel/Makefile
Robots/php-simple/Makefile
Robots/php/Makefile
include/Makefile
])