-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
674 lines (581 loc) · 21.9 KB
/
configure.ac
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
AC_INIT([1oom], [1.0])
VERSION_1OOM=v1.0
AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static], [enable static builds]))
AC_ARG_ENABLE(modebug, AS_HELP_STRING([--enable-modebug], [add debugging options]))
AC_ARG_WITH(readline, AS_HELP_STRING([--without-readline], [do not try to use the readline library]))
AC_ARG_WITH(samplerate, AS_HELP_STRING([--without-samplerate], [do not try to use libsamplerate]))
AC_ARG_ENABLE(tools, AS_HELP_STRING([--disable-tools], [disables extra tools]))
AC_ARG_ENABLE(uiclassic, AS_HELP_STRING([--disable-uiclassic], [disables classic UI]))
AC_ARG_ENABLE(uicmdline, AS_HELP_STRING([--disable-uicmdline], [disables cmdline UI]))
AC_ARG_ENABLE(hwsdl1, AS_HELP_STRING([--disable-hwsdl1], [disables SDL1 HW]))
AC_ARG_ENABLE(hwsdl1audio, AS_HELP_STRING([--disable-hwsdl1audio], [disables SDL1 HW audio support]))
AC_ARG_ENABLE(hwsdl1gl, AS_HELP_STRING([--disable-hwsdl1gl], [disables SDL1 HW OpenGL support]))
AC_ARG_ENABLE(hwsdl2, AS_HELP_STRING([--disable-hwsdl2], [disables SDL2 HW]))
AC_ARG_ENABLE(hwsdl2audio, AS_HELP_STRING([--disable-hwsdl2audio], [disables SDL2 HW audio support]))
AC_ARG_ENABLE(hwalleg4, AS_HELP_STRING([--disable-hwalleg4], [disables Allegro 4 HW]))
AC_ARG_ENABLE(hwx11, AS_HELP_STRING([--disable-hwx11], [disables Xorg HW]))
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([-Wall foreign])
AM_SILENT_RULES
AC_CANONICAL_HOST
user_cflags=$CFLAGS
AC_PROG_CC_C99
AC_PROG_CPP
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(STRIP, strip, :)
AC_CHECK_PROG(GIT, git, git, :)
AC_PROG_INSTALL
AC_C_BIGENDIAN
if test -z "$user_cflags" ; then
dnl Check for the type of compiler first.
if test x"$GCC" = "xyes" ; then
warnings_c="-Wall -Wno-inline -Wstrict-prototypes"
dnl Set appropriate optimization options (better than the default -g -O)
dnl if using GCC.
dnl If the user has specified her own `CFLAGS', we do not override them.
optimization_c="-O3"
dnl Use -g if available.
if test x"$ac_cv_prog_cc_g" = "xyes" ; then
CFLAGS="-g $optimization_c $warnings_c"
else
CFLAGS="$optimization_c $warnings_c"
fi
fi
dnl (If not on GCC, just keep the defaults, which are very conservative).
fi
dnl Check whether the options are OK.
AC_PROG_CC_C99
dnl - check common stuff
AC_CHECK_HEADERS(inttypes.h stdbool.h)
AC_CHECK_FUNCS(atexit strcasecmp)
dnl - git version
USE_GIT="no"
if test x"$GIT" != "x"; then
gitversion=`$GIT -C $srcdir describe --tags`
if test x"$gitversion" != "x"; then
USE_GIT=$GIT
fi
fi
AC_SUBST(USE_GIT)
dnl - OS detection
dnl - check for win32 headers
AC_CHECK_HEADERS([wtypes.h winnt.h], [is_win32=yes; AC_DEFINE(IS_WINDOWS,, [Compiling for Windows])], [is_win32=no],
[[#ifdef HAVE_WTYPES_H
#include <wtypes.h>
#endif
#ifdef HAVE_WINNT_H
#include <winnt.h>
#endif
]])
dnl - check for msdos
if test x"$host_vendor" = "xgo32" -o x"$host_vendor" = "xmsdos" -o x"$host_os" = "xmsdosdjgpp"; then
is_msdos=yes
else
is_msdos=false
fi
dnl - optional features
if test x"$enable_static" = "xyes"; then
LDFLAGS="$LDFLAGS -static"
fi
if test x"$enable_modebug" = "xyes"; then
AC_DEFINE(FEATURE_MODEBUG,,[Add debugging options.])
fi
dnl - check for pkg-config
dnl The failing result is "false" for $pkg_config --exists foo to fail.
AC_CHECK_TOOLS(pkg_config, pkg-config, false)
dnl - readline
dnl Check whether we have GNU readline.
dnl The user can force us to not use it with `--without-readline'.
READLINE=""
READLINE_LIBS=
if test x"$with_readline" != "xno"; then
unset ac_cv_lib_readline_readline
old_LIBS="$LIBS"
AC_CHECK_LIB(readline, readline,
[ READLINE="" READLINE_LIBS="-lreadline"],
[],,)
if test "$ac_cv_lib_readline_readline" = "no"; then
unset ac_cv_lib_readline_readline
AC_CHECK_LIB(readline, readline,
[ READLINE="" READLINE_LIBS="-lreadline -ltermcap"],
[], [-ltermcap],)
fi
if test "$ac_cv_lib_readline_readline" = "no"; then
unset ac_cv_lib_readline_readline
AC_CHECK_LIB(readline, readline,
[ READLINE="" READLINE_LIBS="-lreadline -lncurses"],
[], [-lncurses],)
fi
if test "$ac_cv_lib_readline_readline" = "yes"; then
AC_CHECK_HEADERS(readline/readline.h, [AC_DEFINE(HAVE_READLINE,, [readline available])])
AC_CHECK_LIB(readline, rl_readline_name,
[ AC_DEFINE(HAVE_RLNAME,,
[Does the `readline' library support `rl_readline_name'?]) ],,)
fi
LIBS="${old_LIBS}"
fi
AC_SUBST(READLINE)
AC_SUBST(READLINE_LIBS)
dnl - libsamplerate
SAMPLERATE_LIBS=
AS_IF([test x"$with_samplerate" != "xno"], [
AC_CHECK_LIB(samplerate, src_new, [have_samplerate=yes; SAMPLERATE_LIBS="-lsamplerate"], [
AS_IF([test "x$with_samplerate" = "xyes"], [AC_MSG_FAILURE(
[--with-samplerate was given, but test for libsamplerate failed])
])
])
])
AC_SUBST(SAMPLERATE_LIBS)
if test x"$have_samplerate" = "xyes"; then
AC_DEFINE(HAVE_SAMPLERATE,,[Enable libsamplerate])
fi
dnl - SDL1
dnl Check and setup SDL 1.2 compilation.
AM_CONDITIONAL(COMPILE_HW_SDL, false)
AM_CONDITIONAL(COMPILE_HW_SDL1, false)
HW_SDL1_CFLAGS=
HW_SDL1_LIBS=
if test x"$enable_hwsdl1" != "xno"; then
dnl check for sdl-config
AC_CHECK_TOOLS(sdl_config, sdl-config, no)
old_cflags=$CFLAGS
old_LIBS="$LIBS"
old_sdl_libs=$HW_SDL1_LIBS
dnl First check for user supplied libs/cflags.
dnl In none are given, try sdl-config.
dnl If no sdl-config was found, try pkg-config.
dnl If this fails, we assume that there are no extra CFLAGS
dnl and that libSDL can be found in the default lib search path.
if test x"$SDL1_LIBS" != "x" -o x"$SDL1_CFLAGS" != "x"; then
HW_SDL1_CFLAGS="$CFLAGS $SDL1_CFLAGS"
HW_SDL1_LIBS="$SDL1_LIBS"
elif test x"$sdl_config" != "xno"; then
HW_SDL1_CFLAGS="$CFLAGS `$sdl_config --cflags`"
if test x"$enable_static" = "xyes"; then
HW_SDL1_LIBS="`$sdl_config --static-libs`"
else
HW_SDL1_LIBS="`$sdl_config --libs`"
fi
elif $pkg_config --exists sdl; then
HW_SDL1_CFLAGS="$CFLAGS `$pkg_config --cflags sdl`"
if test x"$enable_static" = "xyes"; then
HW_SDL1_LIBS="`$pkg_config --static --libs sdl`"
else
HW_SDL1_LIBS="`$pkg_config --libs sdl`"
fi
else
HW_SDL1_LIBS="-lSDL"
fi
CFLAGS="$HW_SDL1_CFLAGS"
LIBS="$HW_SDL1_LIBS"
dnl check for the SDL.h header
AC_CHECK_HEADERS(SDL.h,[AC_CHECK_LIB(SDL, SDL_SetVideoMode,
[],
[CFLAGS=$old_cflags; break],$EXTRA_SDL1_LIBS)],
[CFLAGS=$old_cflags; break],$EXTRA_SDL1_LIBS)
LIBS="$old_LIBS"
if test x"$ac_cv_lib_SDL_SDL_SetVideoMode" != "xyes"; then
AC_MSG_WARN([SDL1 headers and/or libraries missing!])
else
AC_DEFINE(USE_HWSDL1,,[Enable SDL1 HW support.])
AM_CONDITIONAL(COMPILE_HW_SDL1, true)
AM_CONDITIONAL(COMPILE_HW_SDL, true)
have_sdl1=yes
if test x"$enable_hwsdl1audio" != "xno"; then
dnl check for SDL_mixer
AC_MSG_CHECKING(for the SDL_mixer library)
old_sdl_libs="$HW_SDL1_LIBS"
if test x"$SDL1MIXER_LIBS" != "x"; then
HW_SDL1_LIBS="$HW_SDL1_LIBS $SDL1MIXER_LIBS"
elif $pkg_config --exists SDL_mixer; then
if test x"$enable_static" = "xyes"; then
HW_SDL1_LIBS="`$pkg_config --static --libs SDL_mixer`"
else
HW_SDL1_LIBS="`$pkg_config --libs SDL_mixer`"
fi
else
HW_SDL1_LIBS="$HW_SDL1_LIBS -lSDL_mixer"
fi
LIBS="$old_LIBS $HW_SDL1_LIBS"
AC_TRY_LINK([#include "SDL_mixer.h"],
[Mix_LoadMUS(0)],
[AC_MSG_RESULT(yes);
have_sdl1mixer=yes],
[AC_MSG_RESULT(no);
HW_SDL1_LIBS="$old_sdl_libs"])
LIBS="$old_LIBS"
if test x"$have_sdl1mixer" = "xyes"; then
AC_DEFINE(HAVE_SDL1MIXER,,[Enable SDL_mixer])
else
AC_MSG_ERROR([SDL_mixer not found! Either install it or use --disable-hwsdl1audio to disable audio for the SDL1 binaries.])
fi
fi
if test x"$enable_hwsdl1gl" != "xno"; then
dnl check for OpenGL libs
AC_MSG_CHECKING(for the OpenGL library)
old_sdl_libs="$HW_SDL1_LIBS"
HW_SDL1_LIBS="$HW_SDL1_LIBS -lGL"
LIBS="$old_LIBS $HW_SDL1_LIBS"
AC_TRY_LINK([#include "SDL_opengl.h"],
[glViewport(1,2,3,4)],
[AC_MSG_RESULT(yes);
have_sdl1gl_lib=yes],
[AC_MSG_RESULT(no);
HW_SDL1_LIBS="$old_sdl_libs"])
LIBS="$old_LIBS"
if test x"$have_sdl1gl_lib" != "xyes"; then
AC_MSG_CHECKING(whether we can use the opengl32 library)
old_sdl_libs="$HW_SDL1_LIBS"
HW_SDL1_LIBS="$HW_SDL1_LIBS -lopengl32"
LIBS="$LIBS $HW_SDL1_LIBS"
AC_TRY_LINK([#include "SDL_opengl.h"],
[glViewport(1,2,3,4)],
[AC_MSG_RESULT(yes);
have_sdl1gl_lib=yes],
[AC_MSG_RESULT(no);
HW_SDL1_LIBS="$old_sdl_libs"])
LIBS="$old_LIBS"
fi
if test x"$have_sdl1gl_lib" = "xyes"; then
AC_DEFINE(HAVE_SDL1GL,,[Enable SDL1 OpenGL])
else
AC_MSG_ERROR([SDL1 OpenGL not available! Either fix it or use --disable-hwsdl1gl to disable graphics resizing for the SDL1 binaries.])
fi
fi
AC_MSG_CHECKING(for the SDLmain library)
old_sdl_libs="$HW_SDL1_LIBS"
HW_SDL1_LIBS="$HW_SDL1_LIBS -lSDLmain -lSDL"
LIBS="$LIBS $HW_SDL1_LIBS"
AC_TRY_LINK([#include "SDL_main.h"
int main(int argc, char *argv[])
{ return 0; }
#undef main
#define main something_else],
[return 0;],
[AC_MSG_RESULT(yes);
have_sdlmain=yes],
[AC_MSG_RESULT(no);
HW_SDL1_LIBS="$old_sdl_libs"])
LIBS="$old_LIBS"
if test x"$have_sdlmain" != "xyes"; then
AC_MSG_CHECKING(whether we can use the SDLmain library when adding -lmingw32)
old_sdl_libs="$HW_SDL1_LIBS"
HW_SDL1_LIBS="$HW_SDL1_LIBS -lmingw32 -lSDLmain -lSDL"
LIBS="$LIBS $HW_SDL1_LIBS"
AC_TRY_LINK([#include "SDL_main.h"
int main(int argc, char *argv[])
{ return 0; }
#undef main
#define main something_else],
[return 0;],
[AC_MSG_RESULT(yes);
have_sdlmain=yes],
[AC_MSG_RESULT(no);
HW_SDL1_LIBS="$old_sdl_libs"])
LIBS="$old_LIBS"
fi
if test x"$have_sdlmain" = "xyes"; then
AC_DEFINE(HAVE_SDLMAIN,,[Enable SDLmain replacement])
fi
fi
CFLAGS="$old_cflags"
LIBS="$old_LIBS"
fi
AC_SUBST(HW_SDL1_CFLAGS)
AC_SUBST(HW_SDL1_LIBS)
dnl - SDL2
dnl Check and setup SDL 2 compilation.
AM_CONDITIONAL(COMPILE_HW_SDL2, false)
HW_SDL2_CFLAGS=
HW_SDL2_LIBS=
if test x"$enable_hwsdl2" != "xno"; then
dnl check for sdl2-config
AC_CHECK_TOOLS(sdl2_config, sdl2-config, no)
old_cflags=$CFLAGS
old_LIBS="$LIBS"
old_sdl_libs=$HW_SDL2_LIBS
dnl First check for user supplied libs/cflags.
dnl In none are given, try sdl2-config.
dnl If no sdl2-config was found, try pkg-config.
dnl If this fails, we assume that there are no extra CFLAGS
dnl and that libSDL2 can be found in the default lib search path.
if test x"$SDL2_LIBS" != "x" -o x"$SDL2_CFLAGS" != "x"; then
HW_SDL2_CFLAGS="$CFLAGS $SDL2_CFLAGS"
HW_SDL2_LIBS="$SDL2_LIBS"
elif test x"$sdl2_config" != "xno"; then
HW_SDL2_CFLAGS="$CFLAGS `$sdl2_config --cflags`"
if test x"$enable_static" = "xyes"; then
HW_SDL2_LIBS="`$sdl2_config --static-libs`"
else
HW_SDL2_LIBS="`$sdl2_config --libs`"
fi
elif $pkg_config --exists sdl2; then
HW_SDL2_CFLAGS="$CFLAGS `$pkg_config --cflags sdl2`"
if test x"$enable_static" = "xyes"; then
HW_SDL2_LIBS="`$pkg_config --static --libs sdl2`"
else
HW_SDL2_LIBS="`$pkg_config --libs sdl2`"
fi
else
HW_SDL2_LIBS="-lSDL2"
fi
CFLAGS="$HW_SDL2_CFLAGS"
LIBS="$HW_SDL2_LIBS"
dnl check for the SDL.h header
AS_UNSET(ac_cv_header_SDL_h)
AC_CHECK_HEADERS(SDL.h,[AC_CHECK_LIB(SDL2, SDL_CreateTexture,
[],
[CFLAGS=$old_cflags; break],$EXTRA_SDL2_LIBS)],
[CFLAGS=$old_cflags; break],$EXTRA_SDL2_LIBS)
LIBS="$old_LIBS"
if test x"$ac_cv_lib_SDL2_SDL_CreateTexture" != "xyes"; then
AC_MSG_WARN([SDL2 headers and/or libraries missing!])
else
AC_DEFINE(USE_HWSDL2,,[Enable SDL2 HW support.])
AM_CONDITIONAL(COMPILE_HW_SDL2, true)
AM_CONDITIONAL(COMPILE_HW_SDL, true)
have_sdl2=yes
if test x"$enable_hwsdl2audio" != "xno"; then
dnl check for SDL2_mixer
AC_MSG_CHECKING(for the SDL2_mixer library)
old_sdl_libs="$HW_SDL2_LIBS"
if test x"$SDL2MIXER_LIBS" != "x"; then
HW_SDL2_LIBS="$HW_SDL2_LIBS $SDL2MIXER_LIBS"
elif $pkg_config --exists SDL2_mixer; then
if test x"$enable_static" = "xyes"; then
HW_SDL2_LIBS="`$pkg_config --static-libs SDL2_mixer`"
else
HW_SDL2_LIBS="`$pkg_config --libs SDL2_mixer`"
fi
else
HW_SDL2_LIBS="$HW_SDL2_LIBS -lSDL2_mixer"
fi
LIBS="$old_LIBS $HW_SDL2_LIBS"
AS_UNSET(ac_cv_header_SDL_mixer_h)
AC_TRY_LINK([#include "SDL_mixer.h"],
[Mix_LoadMUS(0)],
[AC_MSG_RESULT(yes);
have_sdl2mixer=yes],
[AC_MSG_RESULT(no);
HW_SDL2_LIBS="$old_sdl_libs"])
LIBS="$old_LIBS"
if test x"$have_sdl2mixer" = "xyes"; then
AC_DEFINE(HAVE_SDL2MIXER,,[Enable SDL2_mixer])
else
AC_MSG_ERROR([SDL2_mixer not found! Either install it or use --disable-hwsdl2audio to disable audio for the SDL2 binaries.])
fi
fi
AC_MSG_CHECKING(for the SDL2main library)
old_sdl_libs="$HW_SDL2_LIBS"
HW_SDL2_LIBS="$HW_SDL2_LIBS -lSDL2main -lSDL2"
LIBS="$LIBS $HW_SDL2_LIBS"
AC_TRY_LINK([#include "SDL_main.h"
int main(int argc, char *argv[])
{ return 0; }
#undef main
#define main something_else],
[return 0;],
[AC_MSG_RESULT(yes);
have_sdl2main=yes],
[AC_MSG_RESULT(no);
HW_SDL2_LIBS="$old_sdl_libs"])
LIBS="$old_LIBS"
if test x"$have_sdl2main" = "xyes"; then
AC_DEFINE(HAVE_SDL2MAIN,,[Enable SDL2main replacement])
fi
fi
CFLAGS="$old_cflags"
LIBS="$old_LIBS"
fi
AC_SUBST(HW_SDL2_CFLAGS)
AC_SUBST(HW_SDL2_LIBS)
dnl - Allegro 4
dnl Check and setup Allegro 4 compilation.
AM_CONDITIONAL(COMPILE_HW_ALLEG4, false)
HW_ALLEG4_LIBS=
if test x"$enable_hwalleg4" != "xno"; then
old_LIBS="$LIBS"
dnl check for the allegro.h header
AC_CHECK_HEADERS(allegro.h,[AC_CHECK_LIB(alleg, allegro_exit,
[],
[break],$EXTRA_ALLEG4_LIBS)],
[break],$EXTRA_ALLEG4_LIBS)
if test x"$ac_cv_lib_alleg_allegro_exit" != "xyes"; then
AC_MSG_WARN([Allegro 4 headers and/or libraries missing!])
else
AC_MSG_CHECKING(for Allegro version 4)
AC_TRY_LINK([#include "allegro.h"
#if ALLEGRO_VERSION != 4
#error "not version 4"
#endif
],
[return 0;],
[AC_MSG_RESULT(yes);
have_alleg4=yes],
[AC_MSG_RESULT(no);
have_alleg4=no])
if test x"$have_alleg4" = "xyes"; then
AC_DEFINE(USE_HWALLEG4,,[Enable Allegro 4 HW support.])
AM_CONDITIONAL(COMPILE_HW_ALLEG4, true)
HW_ALLEG4_LIBS="-lalleg"
else
AC_MSG_WARN([Allegro is not version 4!])
fi
fi
LIBS="$old_LIBS"
fi
AC_SUBST(HW_ALLEG4_LIBS)
dnl - X11 interface, no need to check, X11 presence is part of autotools system requirements
AM_CONDITIONAL(COMPILE_HW_X11, false)
HW_X11_CFLAGS=
HW_X11_LIBS=
if test x"$enable_hwx11" != "xno"; then
old_LIBS="$LIBS"
AC_DEFINE(USE_X11,,[Enable Xorg HW support.])
AC_MSG_CHECKING(for Xorg)
AM_CONDITIONAL(COMPILE_HW_X11, true)
HW_X11_LIBS="-lX11 -lXext"
AC_MSG_RESULT(yes)
if ( uname -m | grep -Eq 'x86_64|i686|amd64' ); then
HW_X11_CFLAGS="-msse2 -ftree-vectorize"
have_simd=yes
fi
if ( uname -m | grep -Eq 'armv[7-8]' ); then
HW_X11_CFLAGS="-mfpu=neon -ftree-vectorize"
have_simd=yes
fi
have_x11=yes
LIBS="$old_LIBS"
fi
AC_SUBST(HW_X11_LIBS)
AC_SUBST(HW_X11_CFLAGS)
dnl - setup the system-specific object files
if test x"$is_win32" = "xyes"; then
OS_DIR="\$(top_builddir)/src/os/win32"
OS_SRC_DIR="\$(top_srcdir)/src/os/win32"
BINDIST_SCRIPT="\$(top_srcdir)/make-bindist_win32.sh"
AM_CONDITIONAL(COMPILE_UNIX, false)
AM_CONDITIONAL(COMPILE_WIN32, true)
AM_CONDITIONAL(COMPILE_MSDOS, false)
elif test x"$is_msdos" = "xyes"; then
OS_DIR="\$(top_builddir)/src/os/msdos"
OS_SRC_DIR="\$(top_srcdir)/src/os/msdos"
BINDIST_SCRIPT="\$(top_srcdir)/make-bindist_msdos.sh"
AM_CONDITIONAL(COMPILE_UNIX, false)
AM_CONDITIONAL(COMPILE_WIN32, false)
AM_CONDITIONAL(COMPILE_MSDOS, true)
else
OS_DIR="\$(top_builddir)/src/os/unix"
OS_SRC_DIR="\$(top_srcdir)/src/os/unix"
BINDIST_SCRIPT="\$(top_srcdir)/make-bindist_install.sh"
AM_CONDITIONAL(COMPILE_UNIX, true)
AM_CONDITIONAL(COMPILE_WIN32, false)
AM_CONDITIONAL(COMPILE_MSDOS, false)
fi
OS_LIBS="$OS_DIR/libos.a"
OS_INCLUDES="-I$OS_SRC_DIR"
dnl - build exe opions
if test x"$enable_uicmdline" != "xno"; then
AM_CONDITIONAL(COMPILE_UICMDLINE, true)
else
AM_CONDITIONAL(COMPILE_UICMDLINE, false)
fi
if test x"$enable_uiclassic" != "xno"; then
AM_CONDITIONAL(COMPILE_UICLASSIC, true)
if test x"$have_sdl1" = "xyes"; then
AM_CONDITIONAL(COMPILE_UICLASSIC_SDL1, true)
have_classic_hw=yes
else
AM_CONDITIONAL(COMPILE_UICLASSIC_SDL1, false)
fi
if test x"$have_sdl2" = "xyes"; then
AM_CONDITIONAL(COMPILE_UICLASSIC_SDL2, true)
have_classic_hw=yes
else
AM_CONDITIONAL(COMPILE_UICLASSIC_SDL2, false)
fi
if test x"$have_alleg4" = "xyes"; then
AM_CONDITIONAL(COMPILE_UICLASSIC_ALLEG4, true)
have_classic_hw=yes
else
AM_CONDITIONAL(COMPILE_UICLASSIC_ALLEG4, false)
fi
if test x"$have_x11" = "xyes"; then
AM_CONDITIONAL(COMPILE_UICLASSIC_X11, true)
have_classic_hw=yes
else
AM_CONDITIONAL(COMPILE_UICLASSIC_X11, false)
fi
else
AM_CONDITIONAL(COMPILE_UICLASSIC, false)
AM_CONDITIONAL(COMPILE_UICLASSIC_SDL1, false)
AM_CONDITIONAL(COMPILE_UICLASSIC_SDL2, false)
AM_CONDITIONAL(COMPILE_UICLASSIC_ALLEG4, false)
AM_CONDITIONAL(COMPILE_UICLASSIC_X11, false)
fi
if test x"$enable_tools" != "xno"; then
AM_CONDITIONAL(COMPILE_TOOLS, true)
if test x"$have_sdl1" = "xyes"; then
AM_CONDITIONAL(COMPILE_TOOLS_SDL1, true)
else
AM_CONDITIONAL(COMPILE_TOOLS_SDL1, false)
fi
if test x"$have_sdl2" = "xyes"; then
AM_CONDITIONAL(COMPILE_TOOLS_SDL2, true)
else
AM_CONDITIONAL(COMPILE_TOOLS_SDL2, false)
fi
if test x"$have_alleg4" = "xyes"; then
AM_CONDITIONAL(COMPILE_TOOLS_ALLEG4, true)
else
AM_CONDITIONAL(COMPILE_TOOLS_ALLEG4, false)
fi
AM_CONDITIONAL(COMPILE_TOOLS_X11, false)
else
AM_CONDITIONAL(COMPILE_TOOLS, false)
AM_CONDITIONAL(COMPILE_TOOLS_SDL1, false)
AM_CONDITIONAL(COMPILE_TOOLS_SDL2, false)
AM_CONDITIONAL(COMPILE_TOOLS_ALLEG4, false)
AM_CONDITIONAL(COMPILE_TOOLS_X11, false)
fi
if test x"$enable_uiclassic" != "xno" -a x"$have_classic_hw" != "xyes"; then
AC_MSG_ERROR([classic UI enabled but no suitable HW library found!])
fi
dnl - finish up
AC_SUBST(VERSION_1OOM)
AC_SUBST(HAVE_READLINE)
AC_SUBST(EXTRA_SDL1_LIBS)
AC_SUBST(EXTRA_SDL2_LIBS)
AC_SUBST(EXTRA_ALLEG4_LIBS)
AC_SUBST(EXTRA_X11_LIBS)
AC_SUBST(OS_INCLUDES)
AC_SUBST(OS_LIBS)
AC_SUBST(OS_DIR)
AC_SUBST(OS_SRC_DIR)
AC_SUBST(BINDIST_SCRIPT)
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_FILES([Makefile
doc/Makefile
doc/ext/Makefile
src/Makefile
src/game/Makefile
src/os/Makefile
src/os/unix/Makefile
src/os/win32/Makefile
src/os/msdos/Makefile
src/ui/Makefile
src/ui/cmdline/Makefile
src/ui/classic/Makefile
src/ui/nop/Makefile
src/hw/Makefile
src/hw/nop/Makefile
src/hw/sdl/Makefile
src/hw/sdl/1/Makefile
src/hw/sdl/2/Makefile
src/hw/alleg/Makefile
src/hw/alleg/4/Makefile
src/hw/x11/Makefile
])
AC_OUTPUT