forked from freeciv/freeciv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
696 lines (603 loc) · 21 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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
dnl configure.in for freeciv
dnl Process this file with autoconf to produce a configure script.
dnl Initialize with some random file to ensure the source is here.
AC_INIT(common/game.c)
AC_CONFIG_AUX_DIR(bootstrap)
AM_CONFIG_HEADER(config.h)
dnl May not be quite correct, but autoconf version 2.9 is reported
dnl not to work, and version 2.12 is known to work:
AC_PREREQ(2.12)
PACKAGE=freeciv
dnl client/server should always have the same major and minor versions
dnl different patch versions are compatible
sinclude(version.in)
VERSION_WITHOUT_LABEL=${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}
VERSION=${VERSION_WITHOUT_LABEL}${VERSION_LABEL}
dnl Similar to following are already done by AM_INIT_AUTOMAKE:
dnl (but different in terms of producing quoted vs bare strings)
dnl AC_DEFINE_UNQUOTED(PACKAGE, $PACKAGE)
dnl AC_DEFINE_UNQUOTED(VERSION, $VERSION)
dnl AC_SUBST(VERSION)
AC_DEFINE_UNQUOTED(MAJOR_VERSION, $MAJOR_VERSION)
AC_DEFINE_UNQUOTED(MINOR_VERSION, $MINOR_VERSION)
AC_DEFINE_UNQUOTED(PATCH_VERSION, $PATCH_VERSION)
AC_DEFINE_UNQUOTED(VERSION_LABEL, "${VERSION_LABEL}")
AC_DEFINE_UNQUOTED(VERSION_STRING, "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}${VERSION_LABEL}")
AC_DEFINE_UNQUOTED(IS_DEVEL_VERSION, $IS_DEVEL_VERSION)
AC_DEFINE_UNQUOTED(IS_BETA_VERSION, $IS_BETA_VERSION)
dnl Initialize automake stuff
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
AM_MAINTAINER_MODE
FC_CHECK_AUTH
dnl no=do not compile server, yes=compile server, *=error
AC_ARG_ENABLE(server,
[ --disable-server do not compile the server],
[case "${enableval}" in
yes) server=true ;;
no) server=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-server) ;;
esac], [server=true])
AM_CONDITIONAL(SERVER, test x$server = xtrue)
AC_ARG_WITH(readline,
[ --with-readline support fancy command line editing],
WITH_READLINE=$withval, dnl yes/no - required to use / never use
WITH_READLINE="maybe" dnl maybe - use if found [default]
)
dnl no=do not compile client, yes=guess it, *=use this client or error
AC_ARG_ENABLE(client,
[ --enable-client[=no/yes/xaw3d/xaw/gtk/gtk2/win32]
compile a client [default=yes] (if yes, guess type)],
[case "${enableval}" in
yes) client=yes ;;
no) client=no ;;
xaw3d) client=xaw
WITH_XAW3D=1 ;;
gtk2) client=gtk-2.0 ;;
gtk2.0) client=gtk-2.0 ;;
gtk20) client=gtk-2.0 ;;
*) client="${enableval}"
if test ! -d "${srcdir}/client/gui-$client" ; then
AC_MSG_ERROR(bad value ${enableval} for --enable-client)
fi ;;
esac], [client=yes])
AM_CONDITIONAL(CLIENT, test x$client != xno)
dnl You MUST build ftwl to use the ftwl client
AC_ARG_ENABLE(ftwl,
[ --enable-ftwl[=no/x11/sdl]
compile ftwl [default=no]],
[case "${enableval}" in
x11) ftwl=x11 ;;
sdl) ftwl=sdl ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-ftwl) ;;
esac], [ftwl=no])
AM_CONDITIONAL(FTWL, test x$ftwl != xno)
if test "$ftwl" = no && test "$client" = ftwl ; then
AC_MSG_ERROR(You must use --enable-ftwl to use the ftwl client)
fi
AC_ARG_WITH(xaw,
[ --with-xaw use the Xaw widget set for the xaw client],
WITH_XAW=1
)
AC_ARG_WITH(xaw3d,
[ --with-xaw3d use the Xaw3d widget set for the xaw client],
WITH_XAW3D=1
)
AC_ARG_ENABLE(make_data,
[ --disable-make-data do not recurse make into data directories
(ok to disable unless you will 'make install')],
[case "${enableval}" in
yes) make_data=true ;;
no) make_data=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-make-data) ;;
esac], [make_data=true])
AM_CONDITIONAL(MAKE_DATA, test x$make_data = xtrue)
AC_ARG_ENABLE(make_include,
[ --enable-make-include force make to recurse into include directory
(useful for 'make tags')],
[case "${enableval}" in
yes) make_include=true ;;
no) make_include=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-make-include) ;;
esac], [make_include=false])
AM_CONDITIONAL(MAKE_CLIENT_INCLUDE, test "$make_include" = "true")
AC_ARG_ENABLE(cvs_deps,
[ --disable-cvs-deps remove cvs-source deps calcs, which require gmake,gcc],,
enable_cvs_deps="maybe"
)
CVS_DEPS=$enable_cvs_deps
AC_SUBST(CVS_DEPS)
AC_ARG_WITH(efence,
[ --with-efence use Electric Fence, malloc debugger ],
WITH_EFENCE=1
)
dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_LN_S
AC_PROG_RANLIB
AC_CHECK_TOOL(AR, ar)
if test -z $AR; then
AC_MSG_ERROR([*** 'ar' missing. Install binutils, fix your \$PATH, or set \$AR manually. ***])
fi
AC_CHECK_PROG(UNAME,uname,uname,:)
dnl Programs already checked by AM_INIT_AUTOMAKE:
dnl AC_PROG_MAKE_SET
dnl I18n support
ALL_LINGUAS="ca cs da de en_GB es et fi fr he_IL hu it ja nl nb no pl pt pt_BR ro ru sv uk"
AM_GNU_GETTEXT(,need-ngettext)
dnl AM_GNU_GETTEXT doesn't have all features we want
dnl or they don't behave correctly.
dnl Old gettext binaries don't understand plurals. (ngettext, msgid_plural)
dnl and there are some problems with missing ngettext.
if test "$USE_NLS" = "yes"; then
dnl nls_cv_force_use_gnu_gettext is set by AM_GNU_GETTEXT
dnl it is "yes" when --with-included-gettext is given
if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
have_working_ngettext=0
AC_CHECK_LIB(c, ngettext,
[AC_MSG_CHECKING(whether libc's ngettext works at runtime)
FC_CHECK_NGETTEXT_RUNTIME(,have_working_ngettext=1,)],)
if test "$have_working_ngettext" = "0"; then
AC_CHECK_LIB(intl, ngettext,
[AC_MSG_CHECKING(whether libintl's ngettext works at runtime)
FC_CHECK_NGETTEXT_RUNTIME("-lintl",have_working_ngettext=1,)],)
fi
if test "$have_working_ngettext" = "0"; then
AC_MSG_ERROR(I haven't found a working ngettext function in your system.
Try --with-included-gettext or --disable-nls. Read ABOUT-NLS.)
fi
fi
if test "$IS_BETA_VERSION" = "1" || test "$IS_DEVEL_VERSION" = "1"; then
AC_MSG_CHECKING(for GNU xgettext version >= 0.10.36)
xgettext_version=`$XGETTEXT --version 2>&1 | grep GNU | sed 's/"/ /g'`
AC_TRY_RUN([
#include <stdio.h>
const char *version = "$xgettext_version";
int main()
{
const char *p = version;
int major = 0, minor = 0, patch = 0;
while (*p != '\0' && (*p < '0' || *p > '9')) {
p++;
}
if (*p == '\0') {
return 1;
}
sscanf(p, "%d.%d.%d", &major, &minor, &patch);
if (major < 1 && (minor < 10 || (minor == 10 && patch < 36))) {
return 1;
}
return 0;
}
],
AC_MSG_RESULT(yes)
,
[
AC_MSG_RESULT(no)
AC_MSG_WARN(You may have problems with creating pox files. \
Please update your gettext package.)
]
,
echo error
)
AC_MSG_CHECKING(for GNU msgfmt version >= 0.10.36)
msgfmt_version=`$MSGFMT --version 2>&1 | grep GNU | sed 's/"/ /g'`
AC_TRY_RUN([
#include <stdio.h>
const char *version = "$msgfmt_version";
int main()
{
const char *p = version;
int major = 0, minor = 0, patch = 0;
while (*p != '\0' && (*p < '0' || *p > '9')) {
p++;
}
if (*p == '\0') {
return 1;
}
sscanf(p, "%d.%d.%d", &major, &minor, &patch);
if (major < 1 && (minor < 10 || (minor == 10 && patch < 35))) {
return 1;
}
return 0;
}
],
AC_MSG_RESULT(yes)
,
[
AC_MSG_RESULT(no)
AC_MSG_ERROR(You are unable to create *.gmo files.
This is development version which doesn't include them. Please update your
gettext package. We recommend you versions >= 0.10.38. Or use
--disable-nls instead.)
]
,
echo error
)
fi
fi
dnl note this has to match the path installed by po/Makefile
FC_EXPAND_DIR(LOCALEDIR, "$datadir/locale")
AC_DEFINE_UNQUOTED(LOCALEDIR, "$LOCALEDIR")
EXTRA_GCC_DEBUG_CFLAGS=""
if test -n "$GCC"; then
EXTRA_GCC_DEBUG_CFLAGS="$CFLAGS"
CFLAGS="-Wall -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations"
fi
FC_DEBUG
FC_VARIADIC_MACROS
FC_VARIABLE_ARRAYS
if test "$CVS_DEPS" = "maybe"; then
dnl Should also check for gmake?
if test -n "$GCC"; then
CVS_DEPS="yes"
else
CVS_DEPS="no"
fi
fi
dnl BeOS-specific settings
if test x`$UNAME -s` = xBeOS ; then
AC_DEFINE(SOCKET_ZERO_ISNT_STDIN)
CFLAGS="$CFLAGS -Wno-multichar"
LDFLAGS="$LDFLAGS -x none"
if test x$enable_debug = xyes ; then
CFLAGS="$CFLAGS -gdwarf-2"
LDFLAGS="$LDFLAGS -gdwarf-2"
fi
ARFLAGS=${ARFLAGS:-cru}
AC_SUBST(ARFLAGS)
fi
dnl Windows-specific settings
AC_MINGW32
if test x"$MINGW32" = "xyes"; then
AC_DEFINE(SOCKET_ZERO_ISNT_STDIN)
AC_DEFINE(ALWAYS_ROOT)
AC_DEFINE(WIN32_NATIVE)
AC_DEFINE(HAVE_WINSOCK)
LIBS="$LIBS -lwsock32"
fi
dnl Check libUTF8
AC_ARG_WITH(libutf8,
AC_HELP_STRING([--with-libutf8],
[Use the libutf8 library (needed for some systems)]),
[with_libutf8=$withval], [with_libutf8=no])
if test "$MINGW32" = yes || test "$with_libutf8" = yes; then
AC_CHECK_HEADER(libutf8.h, [],
AC_MSG_ERROR([Could not find libutf8 library (libutf8.h)]))
AC_DEFINE(HAVE_LIBUTF8_H, 1, [Use libutf8's stdio functions])
LIBS="$LIBS -lutf8"
fi
dnl Check for zlib (needed for libpng)
AC_CHECK_LIB(z, gzgets, ,
AC_MSG_ERROR([Could not find zlib library.]), )
AC_CHECK_HEADER(zlib.h, ,
AC_MSG_ERROR([zlib found but not zlib.h.
You may need to install a zlib \"development\" package.]))
dnl Check and compile ftwl
if test "$ftwl" = x11 ; then
FTWL_CFLAGS=`freetype-config --cflags`
FTWL_LIBS="-L/usr/X11R6/lib -lX11 -lpng "`freetype-config --libs`
fi
if test "$ftwl" = sdl ; then
FTWL_CFLAGS=`sdl-config --cflags`" "`freetype-config --cflags`
FTWL_LIBS=`sdl-config --libs`" -lpng "`freetype-config --libs`
fi
dnl Check for libiconv (which is usually included in glibc, but may be
dnl distributed separately).
AM_ICONV
AM_LIBCHARSET
AM_LANGINFO_CODESET
if test "$am_cv_func_iconv" != yes; then
AC_MSG_ERROR([Iconv is missing. You can get it from http://gnu.org/, \
or try using --with-libiconv-prefix.].])
fi
LIBS="$LIBS $LIBICONV"
dnl Check and choose clients
if test x$client != xno; then
dnl if specified --with-xaw or --with-xaw3d, assume --enable-client=xaw
if test x$client = xyes; then
if test -n "$WITH_XAW" || test -n "$WITH_XAW3D"; then
client=xaw
fi
fi
dnl if need to guess client, announce checking
if test x$client = xyes; then
AC_CHECKING([for which client to compile:])
fi
dnl Gtk-2.0-specific overrides
FC_GTK2_CLIENT
dnl Gtk-specific overrides
FC_GTK_CLIENT
dnl SDL-specific overrides
FC_SDL_CLIENT
dnl Xaw-specific overrides
FC_XAW_CLIENT
if test "$client" = ftwl ; then
AC_MSG_CHECKING([will compile gui-ftwl])
AC_MSG_RESULT([yes])
CLIENT_CFLAGS="$CLIENT_FLAGS $FTWL_FLAGS"
CLIENT_LIBS="$CLIENT_LIBS $FTWL_LIBS"
fi
dnl BeOS-specific overrides
if test "$client" = beos || test "$client" = yes ; then
if test x`$UNAME -s` = xBeOS ; then
CLIENT_CFLAGS=
CLIENT_LIBS="-Lgui-beos/lib -lBdhGame -lBdhDialog -lBdh -ltranslation -lbe -lroot"
found_client=yes
fi
if test "x$found_client" = "xyes"; then
client=beos
elif test "$client" = "beos"; then
AC_MSG_ERROR(specified client 'beos' not configurable)
fi
fi
dnl Win32-specific overrides
FC_WIN32_CLIENT
dnl Stub-specific overrides
if test "$client" = stub ; then
found_client=yes
if test "x$found_client" = "xyes"; then
client=stub
elif test "$client" = "stub"; then
AC_MSG_ERROR(specified client 'stub' not configurable)
fi
fi
dnl If client still "yes", error out since we couldn't guess it
if test "$client" = yes ; then
AC_MSG_ERROR(could not guess which client to compile)
fi
dnl Check for sound support, sets SOUND_CFLAGS, SOUND_LIBS, ESD, SDL & WINMM
FC_CHECK_SOUND()
gui_sources="gui-$client"
fi
AC_SUBST(gui_sources)
AC_SUBST(CLIENT_CFLAGS)
AC_SUBST(CLIENT_LIBS)
AC_SUBST(CLIENT_LDFLAGS)
AC_SUBST(SOUND_CFLAGS)
AC_SUBST(SOUND_LIBS)
AC_SUBST(VERSION_WITHOUT_LABEL)
AM_CONDITIONAL(ESD, test x"$ESD" = "xyes")
AM_CONDITIONAL(ALSA, test "x$ALSA" = "xyes")
AM_CONDITIONAL(SDL, test x"$SDL_mixer" = "xyes")
AM_CONDITIONAL(WINMM, test x"$WINMM" = "xyes")
AM_CONDITIONAL(CLIENT_GUI_SDL, test "$gui_sources" = "gui-sdl")
AM_CONDITIONAL(CLIENT_GUI_GTK, test "$gui_sources" = "gui-gtk")
AM_CONDITIONAL(CLIENT_GUI_GTK_2_0, test "$gui_sources" = "gui-gtk-2.0")
AM_CONDITIONAL(CLIENT_GUI_XAW, test "$gui_sources" = "gui-xaw")
AM_CONDITIONAL(CLIENT_GUI_BEOS, test "$gui_sources" = "gui-beos")
AM_CONDITIONAL(CLIENT_GUI_STUB, test "$gui_sources" = "gui-stub")
AM_CONDITIONAL(CLIENT_GUI_WIN32, test "$gui_sources" = "gui-win32")
AM_CONDITIONAL(CLIENT_GUI_FTWL, test "$gui_sources" = "gui-ftwl")
AM_CONDITIONAL(FTWL, test "$ftwl" != "no")
AM_CONDITIONAL(FTWL_X11, test "$ftwl" = "x11")
AM_CONDITIONAL(FTWL_SDL, test "$ftwl" = "sdl")
dnl Checks for additional server libraries:
if test x$server = xtrue; then
dnl Readline library and header files.
FC_HAS_READLINE()
AC_CHECK_FUNC(pow)
if test $ac_cv_func_pow = no; then
AC_CHECK_LIB(m, pow, SERVER_LIBS="$SERVER_LIBS -lm",
AC_MSG_ERROR(Did not find math lib!))
fi
fi
AC_SUBST(SERVER_LIBS)
AC_CHECK_LIB(nls,main)
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(fcntl.h sys/time.h sys/types.h unistd.h sys/utsname.h \
stdbool.h sys/file.h libintl.h)
dnl Avoid including the unix emulation layer if we build mingw executables
dnl There would be type conflicts between winsock and bsd/unix includes
if test "x$MINGW32" != "xyes"; then
AC_CHECK_HEADERS(arpa/inet.h netdb.h netinet/in.h pwd.h sys/ioctl.h \
sys/select.h sys/signal.h sys/socket.h sys/termio.h \
sys/uio.h termios.h)
fi
if test x$client = xxaw; then
dnl Want to get appropriate -I flags:
fc_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $CLIENT_CFLAGS"
AC_CHECK_HEADER(X11/xpm.h, ,
AC_MSG_ERROR(need X11/xpm.h header; perhaps try/adjust --with-xpm-include))
CPPFLAGS="$fc_save_CPPFLAGS"
fi
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_TIME
AC_STRUCT_TM
AC_CHECK_TYPES([socklen_t])
dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_FUNC_STRCOLL
AC_FUNC_VPRINTF
AC_FUNC_VSNPRINTF
AC_CHECK_FUNCS([fileno ftime gethostname getpwuid inet_aton \
select snooze strerror strcasecmp strncasecmp \
strlcat strlcpy strstr usleep vsnprintf uname flock \
gethostbyname connect bind])
AC_CHECK_FUNC([fork], AC_DEFINE(HAVE_WORKING_FORK))
AC_MSG_CHECKING(for working gettimeofday)
FC_CHECK_GETTIMEOFDAY_RUNTIME(,AC_DEFINE(HAVE_GETTIMEOFDAY),)
dnl Check for extra socket libraries.
dnl If the AC_CHECK_FUNCS check finds the function, we don't look any
dnl further. This is rumoured to prevent choosing the wrong libs on IRIX.
if test $ac_cv_func_gethostbyname = no; then
AC_CHECK_LIB(nsl, gethostbyname, LIBS="-lnsl $LIBS")
fi
if test $ac_cv_func_connect = no; then
AC_CHECK_LIB(socket, connect, LIBS="-lsocket $LIBS")
fi
if test $ac_cv_func_bind = no; then
AC_CHECK_LIB(bind, gethostbyaddr, LIBS="-lbind $LIBS")
fi
dnl The use of both AC_FUNC_VSNPRINTF and AC_CHECK_FUNCS(vsnprintf) is
dnl deliberate.
dnl Windows fdopen does not work with sockets.
if test "x$MINGW32" != "xyes"; then
AC_CHECK_FUNCS(fdopen)
fi
dnl We would AC_CHECK_FUNCS for socket as well, except it is complicated
dnl by the fact that the -lsocket is in X_EXTRA_LIBS and/or SERVER_LIBS,
dnl and not in LIBS.
dnl Now check if non blocking sockets are possible
dnl (if fcntl or ioctl exists)
AC_CHECK_FUNC(fcntl,
[AC_DEFINE(HAVE_FCNTL)
AC_DEFINE(NONBLOCKING_SOCKETS)],
[AC_CHECK_FUNC(ioctl,
[AC_DEFINE(HAVE_IOCTL)
AC_DEFINE(NONBLOCKING_SOCKETS)])])
dnl Checks if SIGPIPE is usable
AC_MSG_CHECKING([for SIGPIPE])
AC_TRY_COMPILE([#include <signal.h>],[signal (SIGPIPE, SIG_IGN)],
[AC_MSG_RESULT([yes])
AC_DEFINE(HAVE_SIGPIPE)],
[AC_MSG_RESULT([no])])
dnl export where the datadir is going to be installed
FC_EXPAND_DIR(FREECIV_DATADIR, "$datadir/freeciv")
if test x"$MINGW32" = xyes; then
AC_DEFINE_UNQUOTED(DEFAULT_DATA_PATH, ".;data;~/.freeciv;$FREECIV_DATADIR")
else
AC_DEFINE_UNQUOTED(DEFAULT_DATA_PATH, ".:data:~/.freeciv:$FREECIV_DATADIR")
fi
dnl This has to be last library
if test -n "$WITH_EFENCE"; then
AC_CHECK_LIB(efence, malloc, [
if test "x$LIBS" = "x"; then
LIBS = -lefence
else
LIBS="$LIBS -lefence"
fi])
fi
dnl Freeciv uses a non-standard macro, Q_(), to handle cases of qualified
dnl translatable strings and macro PL_() to handle plural forms.
dnl Since the Gettext supplied Autoconf support
dnl doesn't seem to have a way to add new keywords to its xgettext call,
dnl we do the following.
dnl The Gettext supplied Autoconf support starts with 'po/Makefile.in.in',
dnl and builds 'po/Makefile.in' then 'po/Makefile'. In order for the
dnl commonly used _() and N_() macros to work, there should be somewhere
dnl in that 'po/Makefile' a call to xgettext with "--keyword=_" and
dnl "--keyword=N_" as arguments. To support Q_() and PL_(),
dnl the following simply dnl replaces instances of
dnl "--keyword=N_" with "--keyword=N_ --keyword=Q_ --keyword=PL_:1,2"
dnl in the 'po/Makefile' file.
AC_OUTPUT_COMMANDS(
[if test -f po/Makefile ; then
if grep 'keyword=N_ --keyword=Q_ --keyword=PL_:1,2' po/Makefile >/dev/null 2>&1 ; then
# has already been extended
:
else
echo extending po/Makefile
mv -f po/Makefile po/Makefile.tmp
sed -e 's/--keyword=N_/--keyword=N_ --keyword=Q_ --keyword=PL_:1,2/g' po/Makefile.tmp > po/Makefile
rm po/Makefile.tmp
fi
fi])
dnl Vast quantities of meaningless errors from xgettext is also annoying.
dnl We fix this by forcing xgettext to assume all files are C source files.
AC_OUTPUT_COMMANDS(
[if test -f po/Makefile ; then
if grep 'language=C --files-from=\$(srcdir)/POTFILES.in' po/Makefile >/dev/null 2>&1 ; then
# has already been silenced
:
else
echo silencing po/Makefile
mv -f po/Makefile po/Makefile.tmp
sed -e 's/--files-from=$(srcdir)\/POTFILES.in/--language=C --files-from=$(srcdir)\/POTFILES.in/' po/Makefile.tmp > po/Makefile
rm po/Makefile.tmp
fi
fi])
dnl Most of the C comments copied to freeciv.pot are spurious;
dnl change to only copy those with prefix "TRANS:"
dnl Also add --escape to the arguments to convert extended
dnl characters to escape characters. This affects some of the
dnl gui-mui strings, which use 0x1B escape character.
AC_OUTPUT_COMMANDS(
[if test -f po/Makefile ; then
if grep 'add-comments="TRANS:" --escape' po/Makefile >/dev/null 2>&1 ; then
# has already been modified
:
else
echo modifying po/Makefile add-comments/escape
mv -f po/Makefile po/Makefile.tmp
sed -e 's/add-comments/add-comments="TRANS:" --escape/' po/Makefile.tmp > po/Makefile
rm po/Makefile.tmp
fi
fi])
dnl The BeOS sys/uio.h is broken. This kluges it out of existence.
dnl (This still causes lots of spurious changes to config.h on BeOS.)
AC_OUTPUT_COMMANDS(
[if test x`uname -s` = xBeOS ; then
if grep '#define HAVE_SYS_UIO_H 1' config.h >/dev/null 2>&1 ; then
echo kluging config.h
mv -f config.h config.h.tmp
sed -e 's/#define HAVE_SYS_UIO_H 1/#undef HAVE_SYS_UIO_H/g' config.h.tmp > config.h
rm config.h.tmp
fi
fi])
if test -n "$GCC"; then
CFLAGS="$EXTRA_GCC_DEBUG_CFLAGS $CFLAGS"
fi
dnl Rebuild 'configure' whenever version.in changes, if maintainer mode enabled.
CONFIGURE_DEPENDENCIES="$CONFIGURE_DEPENDENCIES \$(top_srcdir)/version.in"
AC_SUBST([CONFIGURE_DEPENDENCIES])
dnl Make sure that config.h changes when ever CPPFLAGS or CFLAGS
dnl change so everything gets rebuilt. LDFLAGS is not handled here
dnl since change in it should not cause recompilation, only relinking.
AC_DEFINE_UNQUOTED(FC_STORE_CPPFLAGS, "$CPPFLAGS")
AC_DEFINE_UNQUOTED(FC_STORE_CFLAGS, "$CFLAGS")
AC_OUTPUT(Makefile
data/Makefile
data/flags/Makefile
data/misc/Makefile
data/isophex/Makefile
data/isotrident/Makefile
data/trident/Makefile
data/default/Makefile
data/civ1/Makefile
data/civ2/Makefile
data/scenario/Makefile
data/nation/Makefile
data/history/Makefile
utility/Makefile
utility/ftwl/Makefile
common/Makefile
common/aicore/Makefile
ai/Makefile
tests/Makefile
client/Makefile
client/agents/Makefile
client/include/Makefile
client/gui-sdl/Makefile
client/gui-gtk/Makefile
client/gui-gtk-2.0/Makefile
client/gui-xaw/Makefile
client/gui-win32/Makefile
client/gui-ftwl/Makefile
client/gui-stub/Makefile
server/Makefile
server/generator/Makefile
server/userdb/Makefile
manual/Makefile
intl/Makefile
po/Makefile.in
doc/Makefile
doc/man/Makefile
doc/de/Makefile
doc/fr/Makefile
doc/it/Makefile
doc/ja/Makefile
doc/nl/Makefile
doc/sv/Makefile
civ:bootstrap/civ.in
ser:bootstrap/ser.in
freeciv.spec:bootstrap/freeciv.spec.in
bootstrap/undep.sh
data/Freeciv
client/freeciv.desktop:bootstrap/freeciv.desktop.in,
[ chmod +x bootstrap/undep.sh civ ser ; bootstrap/undep.sh ])