forked from msikma/allegro-4.2.2-xc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
1009 lines (858 loc) · 32.2 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
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#-----------------------------------------------------------------------------#
# Process this file with autoconf to produce a configure script.
#
# Note we no longer use `autoheader' to produce
# include/allegro/platform/alunixac.hin.
# If you AC_DEFINE a new symbol in this file, you must add it there also.
#
# Feel free to use # to denote comments. Traditionally we used `dnl' but it
# looks too cluttered.
#-----------------------------------------------------------------------------#
AC_INIT
AC_CONFIG_AUX_DIR(misc)
AC_PREREQ(2.53)
AC_ARG_PROGRAM
#-----------------------------------------------------------------------------#
dnl Build CFLAGS from scratch
CFLAGS=
dnl Enable asm code in the library (default)
AC_ARG_ENABLE(asm,
[ --enable-asm[=x] enable the use of asm code [default=yes]],
test "X$enableval" != "Xno" && allegro_enable_asm=yes,
allegro_enable_asm=yes)
dnl Enable 8-bpp color depth (default).
AC_ARG_ENABLE(color8,
[ --enable-color8[=x] enable support for 8-bpp modes [default=yes]],
test "X$enableval" != "Xno" && AC_DEFINE(ALLEGRO_COLOR8),
AC_DEFINE(ALLEGRO_COLOR8))
dnl Enable 16-bpp color depth (default).
AC_ARG_ENABLE(color16,
[ --enable-color16[=x] enable support for 16-bpp modes [default=yes]],
test "X$enableval" != "Xno" && AC_DEFINE(ALLEGRO_COLOR16),
AC_DEFINE(ALLEGRO_COLOR16))
dnl Enable 24-bpp color depth (default).
AC_ARG_ENABLE(color24,
[ --enable-color24[=x] enable support for 24-bpp modes [default=yes]],
test "X$enableval" != "Xno" && AC_DEFINE(ALLEGRO_COLOR24),
AC_DEFINE(ALLEGRO_COLOR24))
dnl Enable 32-bpp color depth (default).
AC_ARG_ENABLE(color32,
[ --enable-color32[=x] enable support for 32-bpp modes [default=yes]],
test "X$enableval" != "Xno" && AC_DEFINE(ALLEGRO_COLOR32),
AC_DEFINE(ALLEGRO_COLOR32))
#-----------------------------------------------------------------------------#
dnl Enable static library.
AC_ARG_ENABLE(static,
[ --enable-static[=x] build static libraries [default=no]],
test "X$enableval" != "Xno" && allegro_static_libraries=yes)
dnl Enable shared library.
AC_ARG_ENABLE(shared,
[ --enable-shared[=x] build shared libraries [default=yes]],
test "X$enableval" != "Xno" && allegro_shared_libraries=yes,
allegro_shared_libraries=yes)
dnl Enable building normal library (default).
AC_ARG_ENABLE(stdlib,
[ --enable-stdlib[=x] enable building normal library [default=yes]],
test "X$enableval" != "Xno" && allegro_build_normal_library=yes,
allegro_build_normal_library=yes)
dnl Enable building debugging library.
AC_ARG_ENABLE(dbglib,
[ --enable-dbglib[=x] enable building debugging library [default=no]],
test "X$enableval" != "Xno" && allegro_build_debugging_library=yes)
dnl Enable building profiling library.
AC_ARG_ENABLE(proflib,
[ --enable-proflib[=x] enable building profiling library [default=no]],
test "X$enableval" != "Xno" && allegro_build_profiling_library=yes)
dnl Enable building debugging programs.
AC_ARG_ENABLE(dbgprog,
[ --enable-dbgprog[=x] enable building debugging programs [default=no]],
test "X$enableval" != "Xno" && allegro_build_debugging_programs=yes)
dnl Enable building profiling programs.
AC_ARG_ENABLE(profprog,
[ --enable-profprog[=x] enable building profiling programs [default=no]],
test "X$enableval" != "Xno" && allegro_build_profiling_programs=yes)
dnl Link programs with static library rather than shared (if available)
AC_ARG_ENABLE(staticprog,
[ --enable-staticprog[=x] link programs with static library [default=no]],
test "X$enableval" != "Xno" && allegro_build_static_programs=yes)
dnl Enable x86 processor-specific optimizations.
AC_ARG_ENABLE(opts,
[ --enable-opts=CPU enable x86 processor optimizations [pentium]],
test "X$enableval" != "Xyes" && allegro_optimizations=$enableval,
allegro_optimizations=pentium)
dnl Enable x86 processor-specific exclusive optimizations.
AC_ARG_ENABLE(exclopts,
[ --enable-exclopts=CPU enable x86 processor exclusive optimizations [none]],
test "X$enableval" != "Xyes" && allegro_exclusive_optimizations=$enableval,
allegro_exclusive_optimizations=none)
dnl Sanity check on shared/static options
if test "X$allegro_static_libraries" != "Xyes"; then
if test "X$allegro_shared_libraries" != "Xyes"; then
AC_MSG_WARN([static and shared libraries all disabled, assuming shared])
allegro_shared_libraries=yes
fi
elif test "X$allegro_shared_libraries" != "Xyes"; then
allegro_build_static_programs=yes
fi
dnl How strict should we be about compiler warnings
AC_ARG_ENABLE(strictwarn,
[ --enable-strictwarn[=x] produce strict compiler warnings [default=no]],
test "X$enableval" != "Xno" && allegro_strict_warnings=yes)
if test "X$allegro_strict_warnings" = "Xyes"; then
_warnmode="Building Allegro with strict warnings."
else
_warnmode="Ignoring compiler warnings."
fi
#-----------------------------------------------------------------------------#
dnl Enable magic main (default: no).
AC_ARG_ENABLE(magicmain,
[ --enable-magicmain[=x] enable magic main [default=no]],
test "X$enableval" = "Xyes" && AC_DEFINE(ALLEGRO_WITH_MAGIC_MAIN,1,[Define if you need to use a magic main.]))
#-----------------------------------------------------------------------------#
dnl Check that $prefix is set (needed for ALLEGRO_ACTEST_GCC_INCLUDE_PREFIX)
test "$prefix" = NONE && prefix=/usr/local
dnl Check for tools.
AC_PROG_CC
ALLEGRO_ACTEST_GCC_VERSION
ALLEGRO_ACTEST_GCC_INCLUDE_PREFIX
AC_PROG_CPP
ALLEGRO_ACTEST_GCC_CXX
ALLEGRO_ACTEST_PROG_LD_S
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S
dnl LDCONFIG is used for installing shared libraries, in Linux/ELF at least
AC_PATH_PROG(LDCONFIG, ldconfig, [echo ought to run ldconfig], $PATH:/sbin:/usr/sbin)
dnl MAKEINFO is needed for producing the info pages
AC_PATH_PROG(MAKEINFO, makeinfo, [echo ought to run makeinfo], $PATH:/sbin:/usr/sbin)
dnl INSTALL_INFO is needed for installing the info pages
AC_PATH_PROG(INSTALL_INFO, install-info, [echo ought to run install-info], $PATH:/sbin:/usr/sbin)
#-----------------------------------------------------------------------------#
dnl Test for processor type.
ALLEGRO_ACTEST_PROCESSOR_TYPE
dnl Test for -mtune i386 option
if test "X$allegro_cv_processor_type" = "Xi386"; then
ALLEGRO_ACTEST_GCC_I386_MTUNE
fi
dnl Test for -mtune AMD64 option
if test "X$allegro_cv_processor_type" = "Xamd64"; then
ALLEGRO_ACTEST_GCC_AMD64_MTUNE
fi
dnl Test for asm support.
if test "X$allegro_enable_asm" = "Xyes"; then
if test "X$allegro_cv_processor_type" = "Xi386"; then
ALLEGRO_MAYBE_ASM_FILES=ALLEGRO_SRC_I386_FILES
_code_features="i386 asm"
dnl Test for MMX support.
ALLEGRO_ACTEST_SUPPORT_MMX
if test "X$allegro_cv_support_mmx" = "Xyes"; then
AC_DEFINE(ALLEGRO_MMX,1,[Define if assembler supports MMX.])
_code_features="$_code_features, MMX"
fi
dnl Test for SSE support.
ALLEGRO_ACTEST_SUPPORT_SSE
if test "X$allegro_cv_support_sse" = "Xyes"; then
AC_DEFINE(ALLEGRO_SSE,1,[Define if assembler supports SSE.])
_code_features="$_code_features, SSE"
fi
elif test "X$allegro_cv_processor_type" = "Xamd64"; then
ALLEGRO_MAYBE_ASM_FILES=ALLEGRO_SRC_AMD64_FILES
_code_features="amd64 asm"
dnl MMX support available if AMD64 is available, but we can't use it yet.
dnl AC_DEFINE(ALLEGRO_MMX,1,[Define if assembler supports MMX.])
dnl _code_features="$_code_features, MMX"
dnl SSE support available if AMD64 is available, but we can't use it yet.
dnl AC_DEFINE(ALLEGRO_SSE,1,[Define if assembler supports SSE.])
dnl _code_features="$_code_features, SSE"
fi
fi
if test -z "$ALLEGRO_MAYBE_ASM_FILES"; then
ALLEGRO_MAYBE_ASM_FILES=ALLEGRO_SRC_C_FILES
CFLAGS="$CFLAGS -DALLEGRO_NO_ASM"
AC_DEFINE(ALLEGRO_NO_ASM,1,
[Define for Unix platforms, to use C convention for bank switching.])
_code_features="C only"
fi
AC_SUBST(ALLEGRO_MAYBE_ASM_FILES)
dnl Test for underscore prepended by compiler.
ALLEGRO_ACTEST_ASM_PREFIX
if test "$allegro_cv_asm_prefix" != ""; then
AC_DEFINE_UNQUOTED(ALLEGRO_ASM_PREFIX, "$allegro_cv_asm_prefix",
[Define if compiler prepends underscore to symbols.])
fi
dnl Test target machine endianess.
AC_C_BIGENDIAN([
AC_DEFINE(ALLEGRO_BIG_ENDIAN,1,[Define if target machine is big endian.])
_code_features="big endian, $_code_features"
],[
AC_DEFINE(ALLEGRO_LITTLE_ENDIAN,1,[Define if target machine is little endian.])
_code_features="little endian, $_code_features"
])
dnl Test for MAP_FAILED presence.
ALLEGRO_ACTEST_MAP_FAILED
if test "$Xallegro_cv_have_map_failed" = "Xno"; then
AC_DEFINE(MAP_FAILED, [(void *)-1],
[Define to (void *)-1, if MAP_FAILED is not defined.])
fi
dnl Test for sched_yield (SunOS).
ALLEGRO_ACTEST_SCHED_YIELD
if test "X$allegro_cv_support_sched_yield" = "Xyes"; then
AC_DEFINE(ALLEGRO_HAVE_SCHED_YIELD,1,[Define if sched_yield is provided by some library.])
fi
dnl Test for constructor attribute support.
ALLEGRO_ACTEST_CONSTRUCTOR
if test "X$allegro_support_constructor" = "Xyes"; then
AC_DEFINE(ALLEGRO_USE_CONSTRUCTOR,1,
[Define if constructor attribute is supported.])
fi
dnl Test for modules support.
ALLEGRO_ACTEST_MODULES
if test -n "$allegro_support_modules"; then
AC_DEFINE(ALLEGRO_WITH_MODULES,1,
[Define if dynamically loaded modules are supported.])
_modules="Some drivers will be built as dynamic modules."
else
_modules="All drivers will be statically linked."
fi
dnl Do we need to pass the include prefix to the compiler?
if test "$allegro_cv_support_include_prefix" = "yes"; then
INCLUDE_PREFIX="$prefix"
else
INCLUDE_PREFIX=
fi
AC_SUBST(INCLUDE_PREFIX)
dnl Which version of library to link with (static, shared, normal, debugging, profiling)?
if test "X$allegro_build_debugging_programs" = "Xyes"; then
COMPILE_PROGRAM=COMPILE_DEBUG
COMPILE_CXX_PROGRAM=COMPILE_CXX_DEBUG
COMPILE_S_PROGRAM=COMPILE_S_DEBUG
PROG_LDFLAGS="-g \$(LDFLAGS)"
LIB_TO_LINK=alld
PLUGIN_LIB=lib/unix/libaddat.a
allegro_build_debugging_library=yes
_programs="debug"
elif test "X$allegro_build_profiling_programs" = "Xyes"; then
COMPILE_PROGRAM=COMPILE_PROFILE
COMPILE_CXX_PROGRAM=COMPILE_CXX_PROFILE
COMPILE_S_PROGRAM=COMPILE_S_PROFILE
PROG_LDFLAGS="-pg \$(LDFLAGS)"
LIB_TO_LINK=allp
PLUGIN_LIB=lib/unix/libapdat.a
allegro_build_profiling_library=yes
_programs="profile"
else
COMPILE_PROGRAM=COMPILE_NORMAL
COMPILE_CXX_PROGRAM=COMPILE_CXX_NORMAL
COMPILE_S_PROGRAM=COMPILE_S_NORMAL
if test "X$allegro_cv_prog_ld_s" = "Xyes"; then
PROG_LDFLAGS="-s \$(LDFLAGS)"
else
PROG_LDFLAGS="\$(LDFLAGS)"
fi
LIB_TO_LINK=alleg
PLUGIN_LIB=lib/unix/libaldat.a
allegro_build_normal_library=yes
_programs="release"
fi
if test "X$allegro_build_static_programs" = "Xyes"; then
LIBALLEG=lib/unix/lib$LIB_TO_LINK.a
LINK_LIBALLEG="$LIBALLEG \$(LIBS)"
LINK_WITH_STATIC_LIBS=yes
allegro_static_libraries=yes
_programs="statically linked $_programs"
else
LIBALLEG="lib/unix/lib${LIB_TO_LINK}-\$(shared_version).so lib/unix/lib${LIB_TO_LINK}_unsharable.a"
LINK_LIBALLEG="-Llib/unix -l${LIB_TO_LINK}-\$(shared_version) -l${LIB_TO_LINK}_unsharable -lm"
LINK_WITH_STATIC_LIBS=no
allegro_shared_libraries=yes
_programs="dynamically linked $_programs"
fi
AC_SUBST(LIBALLEG)
AC_SUBST(LINK_LIBALLEG)
AC_SUBST(PLUGIN_LIB)
AC_SUBST(COMPILE_PROGRAM)
AC_SUBST(COMPILE_CXX_PROGRAM)
AC_SUBST(COMPILE_S_PROGRAM)
AC_SUBST(PROG_LDFLAGS)
AC_SUBST(LIB_TO_LINK)
AC_SUBST(LINK_WITH_STATIC_LIBS)
dnl Which libraries to build (static, shared, normal, debugging, profiling)?
ALLEGRO_LIB_TARGETS=
if test "X$allegro_static_libraries" = "Xyes"; then
_libraries=" static"
if test "X$allegro_build_normal_library" = "Xyes"; then
ALLEGRO_LIB_TARGETS="$ALLEGRO_LIB_TARGETS lib/unix/liballeg.a"
_libraries="$_libraries release"
fi
if test "X$allegro_build_debugging_library" = "Xyes"; then
ALLEGRO_LIB_TARGETS="$ALLEGRO_LIB_TARGETS lib/unix/liballd.a"
_libraries="$_libraries debug"
fi
if test "X$allegro_build_profiling_library" = "Xyes"; then
ALLEGRO_LIB_TARGETS="$ALLEGRO_LIB_TARGETS lib/unix/liballp.a"
_libraries="$_libraries profile"
fi
fi
if test "X$allegro_shared_libraries" = "Xyes"; then
if test -n "$_libraries"; then
_libraries="$_libraries,"
fi
_libraries="$_libraries shared"
if test "X$allegro_build_normal_library" = "Xyes"; then
ALLEGRO_LIB_TARGETS="$ALLEGRO_LIB_TARGETS lib/unix/liballeg-\$(shared_version).so lib/unix/liballeg_unsharable.a"
_libraries="$_libraries release"
fi
if test "X$allegro_build_debugging_library" = "Xyes"; then
ALLEGRO_LIB_TARGETS="$ALLEGRO_LIB_TARGETS lib/unix/liballd-\$(shared_version).so lib/unix/liballd_unsharable.a"
_libraries="$_libraries debug"
fi
if test "X$allegro_build_profiling_library" = "Xyes"; then
ALLEGRO_LIB_TARGETS="$ALLEGRO_LIB_TARGETS lib/unix/liballp-\$(shared_version).so lib/unix/liballp_unsharable.a"
_libraries="$_libraries profile"
fi
fi
AC_SUBST(ALLEGRO_LIB_TARGETS)
#-----------------------------------------------------------------------------#
dnl Test for debugging with Fortify.
ALLEGRO_ACTEST_DEBUG_WITH_FORTIFY
if test -n "$allegro_debug_with_fortify"; then
LIBS="$LIBS -lfortify"
fi
dnl Test for debugging with DMalloc.
ALLEGRO_ACTEST_DEBUG_WITH_DMALLOC
if test -n "$allegro_debug_with_dmalloc"; then
LIBS="$LIBS -ldmalloc"
fi
#-----------------------------------------------------------------------------#
dnl Enable pthreads
dnl Note this test must come before the test for JACK.
AC_ARG_ENABLE(pthreads,
[ --enable-pthreads[=x] enable use of pthreads [default=yes]],
test "X$enableval" != "Xno" && allegro_enable_pthreads=yes,
allegro_enable_pthreads=yes)
_do_pthread="no"
dnl Test for pthreads.
if test "X$allegro_enable_pthreads" = "Xyes"; then
ALLEGRO_ACTEST_PTHREADS
if test "X$allegro_cv_support_pthreads" = "Xyes"; then
AC_DEFINE(ALLEGRO_HAVE_LIBPTHREAD,1, [Define if you have the pthread library.])
_do_pthread="yes"
fi
fi
if test "$_do_pthread" = yes; then
_code_features="multithreaded, $_code_features"
else
_code_features="signals instead of threads, $_code_features"
fi
#-----------------------------------------------------------------------------#
#
# Sound drivers
#
dnl Test for OSS drivers.
ALLEGRO_ACTEST_OSSDIGI
if test -n "$allegro_support_ossdigi"; then
AC_DEFINE(ALLEGRO_WITH_OSSDIGI,1,[Define if OSS DIGI driver is supported.])
_enabled_modules="ossdigi $_enabled_modules"
else
_disabled_modules="ossdigi $_disabled_modules"
fi
ALLEGRO_ACTEST_OSSMIDI
if test -n "$allegro_support_ossmidi"; then
AC_DEFINE(ALLEGRO_WITH_OSSMIDI,1,[Define if OSS MIDI driver is supported.])
_enabled_modules="ossmidi $_enabled_modules"
else
_disabled_modules="ossmidi $_disabled_modules"
fi
dnl Test for ALSA drivers.
ALLEGRO_ACTEST_ALSADIGI
if test "$allegro_cv_support_alsadigi" = yes; then
AC_DEFINE(ALLEGRO_WITH_ALSADIGI,1,[Define if ALSA DIGI driver is supported.])
if test "$allegro_cv_alsa_version" = 9; then
AC_DEFINE(ALLEGRO_ALSA_VERSION,9,[Define to the installed ALSA version.])
else
AC_DEFINE(ALLEGRO_ALSA_VERSION,5,[Define to the installed ALSA version.])
fi
_enabled_modules="alsadigi $_enabled_modules"
else
_disabled_modules="alsadigi $_disabled_modules"
fi
ALLEGRO_ACTEST_ALSAMIDI
if test "$allegro_cv_support_alsamidi" = yes; then
AC_DEFINE(ALLEGRO_WITH_ALSAMIDI,1,[Define if ALSA MIDI driver is supported.])
if test "$allegro_cv_alsa_version" = 9; then
AC_DEFINE(ALLEGRO_ALSA_VERSION,9,[Define to the installed ALSA version.])
else
AC_DEFINE(ALLEGRO_ALSA_VERSION,5,[Define to the installed ALSA version.])
fi
_enabled_modules="alsamidi $_enabled_modules"
else
_disabled_modules="alsamidi $_disabled_modules"
fi
dnl Test for ESD drivers.
ALLEGRO_ACTEST_ESDDIGI
if test -n "$allegro_support_esddigi"; then
AC_DEFINE(ALLEGRO_WITH_ESDDIGI,1,[Define if ESD DIGI driver is supported.])
_enabled_modules="esddigi $_enabled_modules"
else
_disabled_modules="esddigi $_disabled_modules"
fi
dnl Test for aRts drivers.
ALLEGRO_ACTEST_ARTSDIGI
if test -n "$allegro_support_artsdigi"; then
AC_DEFINE(ALLEGRO_WITH_ARTSDIGI,1,[Define if aRts DIGI driver is supported.])
_enabled_modules="artsdigi $_enabled_modules"
else
_disabled_modules="artsdigi $_disabled_modules"
fi
dnl Test for SGI AL drivers.
ALLEGRO_ACTEST_SGIALDIGI
if test "$allegro_cv_support_sgialdigi" = yes; then
AC_DEFINE(ALLEGRO_WITH_SGIALDIGI,1,[Define if SGI AL DIGI driver is supported.])
_enabled_modules="sgialdigi $_enabled_modules"
else
_disabled_modules="sgialdigi $_disabled_modules"
fi
dnl Test for JACK driver
ALLEGRO_ACTEST_JACK
if test "X$allegro_cv_support_jackdigi" = "Xyes"; then
if test "X$_do_pthread" = "Xyes"; then
AC_DEFINE(ALLEGRO_WITH_JACKDIGI,1,[Define if JACK DIGI driver is supported.])
_enabled_modules="jackdigi $_enabled_modules"
else
echo Warning: Jack will be disabled, since pthreads support is missing/disabled.
_disabled_modules="jackdigi $_disabled_modules"
fi
else
_disabled_modules="jackdigi $_disabled_modules"
fi
#-----------------------------------------------------------------------------#
dnl Test for System V procfs
ALLEGRO_ACTEST_SV_PROCFS
if test "$allegro_sv_procfs" = yes; then
AC_DEFINE(ALLEGRO_HAVE_SV_PROCFS_H,1,
[Define to 1 if you have a System V sys/procfs.h])
ALLEGRO_ACTEST_PROCFS_ARGCV
if test "$allegro_procfs_argcv" = yes; then
AC_DEFINE(ALLEGRO_HAVE_PROCFS_ARGCV,1,
[Define to 1 if procfs reveals argc and argv])
fi
fi
dnl Test for Solaris like getexecname().
ALLEGRO_ACTEST_SYS_GETEXECNAME
if test "$allegro_sys_getexecname" = yes; then
AC_DEFINE(ALLEGRO_HAVE_GETEXECNAME,1,
[Define to 1 if you have getexecname])
fi
#-----------------------------------------------------------------------------#
#
# X-Windows
#
ALLEGRO_ACTEST_SUPPORT_XWINDOWS
if test "$allegro_support_xwindows" = yes; then
ALLEGRO_MAYBE_XWINDOWS_FILES=ALLEGRO_SRC_X_FILES
ALLEGRO_MAYBE_LIB_X_EXE_SOURCES=ALLEGRO_LIB_X_EXE_SOURCES
ALLEGRO_MAYBE_LIB_X_EXES=ALLEGRO_LIB_X_EXES
else
ALLEGRO_MAYBE_XWINDOWS_FILES=ALLEGRO_EMPTY_LIST
ALLEGRO_MAYBE_LIB_X_EXE_SOURCES=ALLEGRO_EMPTY_LIST
ALLEGRO_MAYBE_LIB_X_EXES=ALLEGRO_EMPTY_LIST
fi
AC_SUBST(ALLEGRO_MAYBE_XWINDOWS_FILES)
AC_SUBST(ALLEGRO_MAYBE_LIB_X_EXE_SOURCES)
AC_SUBST(ALLEGRO_MAYBE_LIB_X_EXES)
AC_SUBST(ALLEGRO_XWINDOWS_LIBDIR)
if test "X$allegro_support_xf86dga2" = "Xyes"; then
_enabled_modules="dga2 $_enabled_modules"
else
_disabled_modules="dga2 $_disabled_modules"
fi
#-----------------------------------------------------------------------------#
#
# Linux console
#
dnl Enable Linux console support
AC_ARG_ENABLE(linux,
[ --enable-linux[=x] enable Linux console support [default=yes]],
test "X$enableval" != "Xno" && allegro_enable_linux=yes,
allegro_enable_linux=yes)
dnl Enable Linux console VGA driver
AC_ARG_ENABLE(vga,
[ --enable-vga[=x] enable VGA graphics driver [default=yes]],
test "X$enableval" != "Xno" && allegro_enable_vga=yes,
allegro_enable_vga=yes)
dnl Enable Linux console fbcon driver
AC_ARG_ENABLE(fbcon,
[ --enable-fbcon[=x] enable fbcon graphics driver [default=yes]],
test "X$enableval" != "Xno" && allegro_enable_fbcon=yes,
allegro_enable_fbcon=yes)
dnl Enable Linux console VBE/AF driver
AC_ARG_ENABLE(vbeaf,
[ --enable-vbeaf[=x] enable VBE/AF graphics driver [default=no]],
test "X$enableval" != "Xno" && allegro_enable_vbeaf=yes,
allegro_enable_vbeaf=no)
dnl Enable Linux console SVGAlib driver
AC_ARG_ENABLE(svgalib,
[ --enable-svgalib[=x] enable SVGAlib graphics driver [default=yes]],
test "X$enableval" != "Xno" && allegro_enable_svgalib=yes,
allegro_enable_svgalib=yes)
dnl Some miscellaneous defines.
ALLEGRO_MAYBE_LINUX_FILES=ALLEGRO_EMPTY_LIST
allegro_support_linux=no
allegro_system=`uname -s | tr A-Z a-z`
case "$allegro_system" in
*linux*)
if test "X$allegro_enable_linux" = "Xyes"; then
AC_DEFINE(ALLEGRO_LINUX,1,[Define if target platform is linux.])
ALLEGRO_MAYBE_LINUX_FILES=ALLEGRO_SRC_LINUX_FILES
allegro_support_linux=yes
AC_CHECK_HEADER(sys/io.h,
AC_DEFINE(ALLEGRO_HAVE_SYS_IO_H, 1))
AC_CHECK_HEADER(linux/joystick.h,
AC_DEFINE(ALLEGRO_HAVE_LINUX_JOYSTICK_H, 1))
AC_CHECK_HEADER(linux/input.h,
AC_DEFINE(ALLEGRO_HAVE_LINUX_INPUT_H, 1))
if test "X$allegro_cv_processor_type" = "Xi386" -a "X$allegro_enable_vga" = "Xyes"; then
allegro_support_vga=yes
AC_DEFINE(ALLEGRO_LINUX_VGA,1,
[Define to enable Linux console VGA driver.])
_enabled_modules="vga $_enabled_modules"
else
_disabled_modules="vga $_disabled_modules"
fi
if test "X$allegro_cv_processor_type" = "Xi386" -a "X$allegro_enable_vbeaf" = "Xyes"; then
AC_DEFINE(ALLEGRO_LINUX_VBEAF,1,
[Define to enable Linux console VBE/AF driver.])
_enabled_modules="vbeaf $_enabled_modules"
else
_disabled_modules="vbeaf $_disabled_modules"
fi
_do_fbcon="no"
if test "X$allegro_enable_fbcon" = "Xyes"; then
ALLEGRO_ACTEST_FBCON
if test "X$allegro_cv_support_fbcon" = "Xyes"; then
AC_DEFINE(ALLEGRO_LINUX_FBCON,1,
[Define to enable Linux console fbcon driver.])
_do_fbcon="yes"
fi
fi
if test "$_do_fbcon" = yes; then
_enabled_modules="fbcon $_enabled_modules"
else
_disabled_modules="fbcon $_disabled_modules"
fi
_do_svgalib="no"
if test "X$allegro_enable_svgalib" = "Xyes"; then
ALLEGRO_ACTEST_SVGALIB
if test "X$allegro_cv_support_svgalib" = "Xyes"; then
AC_DEFINE(ALLEGRO_LINUX_SVGALIB,1,
[Define to enable Linux console SVGAlib driver.])
_do_svgalib="yes"
if test -z "$allegro_support_modules"; then
LIBS="-lvga $LIBS"
fi
if test "X$allegro_cv_have_vga_version" = "Xyes"; then
AC_DEFINE(ALLEGRO_LINUX_SVGALIB_HAVE_VGA_VERSION,1,
[Define if SVGAlib driver can check vga_version.])
fi
fi
fi
if test "$_do_svgalib" = yes; then
_enabled_modules="svgalib $_enabled_modules"
else
_disabled_modules="svgalib $_disabled_modules"
fi
fi
;;
esac
_linux_console="Linux console support:"
if test "X$allegro_support_linux" != "Xyes"; then
_linux_console="$_linux_console disabled"
else
_linux_console="$_linux_console enabled"
fi
AC_SUBST(ALLEGRO_MAYBE_LINUX_FILES)
#-----------------------------------------------------------------------------#
#
# Modules
#
if test -n "$allegro_support_modules"; then
dnl VGA/ModeX.
if test "X$allegro_support_vga" = "Xyes"; then
ALLEGRO_MODULE_TARGETS="$ALLEGRO_MODULE_TARGETS lib/unix/alleg-vga.so"
fi
dnl SVGAlib.
if test "X$allegro_cv_support_svgalib" = "Xyes"; then
ALLEGRO_MODULE_TARGETS="$ALLEGRO_MODULE_TARGETS lib/unix/alleg-svgalib.so"
fi
dnl fbcon.
if test "X$allegro_cv_support_fbcon" = "Xyes"; then
ALLEGRO_MODULE_TARGETS="$ALLEGRO_MODULE_TARGETS lib/unix/alleg-fbcon.so"
fi
dnl DGA2.
if test "X$allegro_support_xf86dga2" = "Xyes"; then
ALLEGRO_MODULE_TARGETS="$ALLEGRO_MODULE_TARGETS lib/unix/alleg-dga2.so"
fi
dnl ALSA DIGI.
if test "X$allegro_cv_support_alsadigi" = "Xyes"; then
ALLEGRO_MODULE_TARGETS="$ALLEGRO_MODULE_TARGETS lib/unix/alleg-alsadigi.so"
fi
dnl ALSA MIDI.
if test "X$allegro_cv_support_alsamidi" = "Xyes"; then
ALLEGRO_MODULE_TARGETS="$ALLEGRO_MODULE_TARGETS lib/unix/alleg-alsamidi.so"
fi
dnl ESD DIGI.
if test "X$allegro_support_esddigi" = "Xyes"; then
ALLEGRO_MODULE_TARGETS="$ALLEGRO_MODULE_TARGETS lib/unix/alleg-esddigi.so"
fi
dnl aRts DIGI.
if test "X$allegro_support_artsdigi" = "Xyes"; then
ALLEGRO_MODULE_TARGETS="$ALLEGRO_MODULE_TARGETS lib/unix/alleg-artsdigi.so"
fi
dnl SGI AL DIGI.
if test "X$allegro_cv_support_sgialdigi" = "Xyes"; then
ALLEGRO_MODULE_TARGETS="$ALLEGRO_MODULE_TARGETS lib/unix/alleg-sgialdigi.so"
fi
dnl JACK DIGI.
if test "X$allegro_cv_support_jackdigi" = "Xyes"; then
ALLEGRO_MODULE_TARGETS="$ALLEGRO_MODULE_TARGETS lib/unix/alleg-jackdigi.so"
fi
fi
AC_SUBST(ALLEGRO_MODULE_TARGETS)
#-----------------------------------------------------------------------------#
dnl Additional libraries.
LIBS="-lm $LIBS"
case "$allegro_system" in
*darwin*)
AC_DEFINE(ALLEGRO_DARWIN,1,[Define if target platform is Darwin.])
LIBS="-lcc_dynamic $LIBS"
AR="\$(LD) -r -keep_private_externs -o"
;;
*)
AR="ar rvs"
;;
esac
AC_SUBST(LIBS)
AC_SUBST(AR)
#-----------------------------------------------------------------------------#
# Headers, features, functions and macros.
AC_CHECK_HEADER(dirent.h, AC_DEFINE(ALLEGRO_HAVE_DIRENT_H, 1))
AC_CHECK_HEADER(inttypes.h, AC_DEFINE(ALLEGRO_HAVE_INTTYPES_H, 1))
AC_CHECK_HEADER(stdint.h, AC_DEFINE(ALLEGRO_HAVE_STDINT_H, 1))
AC_CHECK_HEADER(sys/stat.h, AC_DEFINE(ALLEGRO_HAVE_SYS_STAT_H, 1))
AC_CHECK_HEADER(sys/time.h, AC_DEFINE(ALLEGRO_HAVE_SYS_TIME_H, 1))
AC_CHECK_HEADER(sys/time.h, AC_DEFINE(ALLEGRO_HAVE_SYS_TIME_H, 1))
AC_CHECK_HEADER(sys/utsname.h, AC_DEFINE(ALLEGRO_HAVE_SYS_UTSNAME_H, 1))
# If the C compiler does not fully support the `const' keyword,
# define `const' to be empty.
AC_C_CONST
# If the C compiler supports the keyword `inline', do nothing.
# Otherwise define `inline' to `__inline__' or `__inline' if it
# accepts one of those, otherwise define `inline' to be empty.
AC_C_INLINE
# Define `size_t' to a suitable type, if standard headers do not define it.
# Note this defines a bunch of other macros named HAVE_* so we don't use it.
AC_TYPE_SIZE_T
# If `signal.h' declares `signal' as returning a pointer to a
# function returning `void', define `RETSIGTYPE' to be `void';
# otherwise, define it to be `int'.
AC_TYPE_SIGNAL
AC_CHECK_FUNC(mmap, AC_DEFINE(ALLEGRO_HAVE_MMAP, 1))
AC_CHECK_FUNC(mprotect, AC_DEFINE(ALLEGRO_HAVE_MPROTECT, 1))
AC_CHECK_FUNC(memcmp, AC_DEFINE(ALLEGRO_HAVE_MEMCMP, 1))
AC_CHECK_FUNC(mkstemp, AC_DEFINE(ALLEGRO_HAVE_MKSTEMP, 1))
AC_CHECK_FUNC(stricmp, AC_DEFINE(ALLEGRO_HAVE_STRICMP, 1))
AC_CHECK_FUNC(strlwr, AC_DEFINE(ALLEGRO_HAVE_STRLWR, 1))
AC_CHECK_FUNC(strupr, AC_DEFINE(ALLEGRO_HAVE_STRUPR, 1))
AC_CHECK_FUNC(sysconf, AC_DEFINE(ALLEGRO_HAVE_SYSCONF, 1))
#-----------------------------------------------------------------------------#
dnl Tweak header files for library build
CFLAGS="$CFLAGS -DALLEGRO_LIB_BUILD"
dnl How to compile C and asm files.
if test -n "$GCC"; then
if test "X$allegro_strict_warnings" = "Xyes"; then
WFLAGS="-Wall -W -Wstrict-prototypes -Wno-unused-parameter -Werror"
else
WFLAGS="-Wall -Wno-unused"
fi
if test "X$allegro_cv_processor_type" = "Xi386"; then
if test "$allegro_exclusive_optimizations" != none; then
TARGET_ARCH="-march=$allegro_exclusive_optimizations"
elif test "X$allegro_cv_support_i386_mtune" = "Xyes"; then
TARGET_ARCH="-mtune=$allegro_optimizations"
else
TARGET_ARCH="-mcpu=$allegro_optimizations"
fi
elif test "X$allegro_cv_processor_type" = "Xamd64"; then
dnl Change default pentium->athlon64
if test "X$allegro_optimizations" = "Xpentium"; then
allegro_optimizations="k8"
fi
if test "$allegro_exclusive_optimizations" != none; then
TARGET_ARCH="-march=$allegro_exclusive_optimizations"
elif test "X$allegro_cv_support_amd64_mtune" = "Xyes"; then
TARGET_ARCH="-mtune=$allegro_optimizations"
else
TARGET_ARCH="-mcpu=$allegro_optimizations"
fi
else
TARGET_ARCH=
fi
dnl Allow to specify additional flags.
CFLAGS="$CFLAGS $XCFLAGS"
WFLAGS="$WFLAGS $WCFLAGS"
dnl In this order...
ALLEGRO_DEBUG_CFLAGS="$CFLAGS -g $WFLAGS -DDEBUGMODE"
if test "X$allegro_debug_with_fortify" = "Xyes"; then
ALLEGRO_DEBUG_CFLAGS="$ALLEGRO_DEBUG_CFLAGS -DFORTIFY"
fi
if test "X$allegro_debug_with_dmalloc" = "Xyes"; then
ALLEGRO_DEBUG_CFLAGS="$ALLEGRO_DEBUG_CFLAGS -DDMALLOC"
fi
ALLEGRO_PROFILE_CFLAGS="$CFLAGS -pg $TARGET_ARCH -O2 -funroll-loops -ffast-math $WFLAGS"
if test "X$allegro_cv_support_fomit_frame_pointer" = "Xyes"; then
CFLAGS="$CFLAGS $TARGET_ARCH -O2 -funroll-loops -ffast-math -fomit-frame-pointer $WFLAGS"
else
CFLAGS="$CFLAGS $TARGET_ARCH -O2 -funroll-loops -ffast-math $WFLAGS"
fi
ALLEGRO_SFLAGS="-x assembler-with-cpp"
ALLEGRO_SHAREDLIB_CFLAGS="-fPIC -DALLEGRO_SHARED"
else
ALLEGRO_DEBUG_CFLAGS="$CFLAGS"
ALLEGRO_PROFILE_CFLAGS="$CFLAGS"
ALLEGRO_SFLAGS=
ALLEGRO_SHAREDLIB_CFLAGS=
fi
AC_SUBST(CFLAGS)
AC_SUBST(ALLEGRO_DEBUG_CFLAGS)
AC_SUBST(ALLEGRO_PROFILE_CFLAGS)
AC_SUBST(ALLEGRO_SFLAGS)
AC_SUBST(ALLEGRO_SHAREDLIB_CFLAGS)
#-----------------------------------------------------------------------------#
dnl How to compile C++ files.
if test "X$allegro_cv_support_cplusplus" = "Xyes"; then
CXX="$CC"
CXXFLAGS="-fno-exceptions $CFLAGS"
ALLEGRO_DEBUG_CXXFLAGS="-fno-exceptions $ALLEGRO_DEBUG_CFLAGS"
ALLEGRO_PROFILE_CXXFLAGS="-fno-exceptions $ALLEGRO_PROFILE_CFLAGS"
else
CXX=
CXXFLAGS=
ALLEGRO_DEBUG_CXXFLAGS=
ALLEGRO_PROFILE_CXXFLAGS=
fi
AC_SUBST(CXX)
AC_SUBST(CXXFLAGS)
AC_SUBST(ALLEGRO_DEBUG_CXXFLAGS)
AC_SUBST(ALLEGRO_PROFILE_CXXFLAGS)
#-----------------------------------------------------------------------------#
#
# Informational
#
cat > makefile.info << EOF
$_modules
Enabled modules: $_enabled_modules
Disabled modules: $_disabled_modules
Generated code: $_code_features
Generated libraries:$_libraries
Compiled programs: $_programs
$_warnmode
$_x11
$_linux_console
EOF
dnl Warn if neither X11 nor Linux console support is going to be built,
dnl or just if X11 support is not going to be built.
if test "X$allegro_support_xwindows" != "Xyes"; then
if test "X$allegro_support_linux" != "Xyes"; then
cat >> makefile.info << EOF
Warning: the library will not be built with either X11 or Linux console
support. This configuration is useless for most purposes.
EOF
else
cat >> makefile.info << EOF
Warning: the library will not be built with X11 support.
If you were expecting X11 support then you may need to install
the appropriate development packages from your distribution.
Otherwise, ignore this warning (it's just that a lot of new
users trip up on this).
EOF
fi
fi
dnl Warn if passed --enable-dbg-with-fortify
if test -n "$allegro_debug_with_fortify"; then
if test -z "$allegro_build_debugging_library"; then
cat >> makefile.info << EOF
Warning: the library will not be built with Fortify support.
The support is only enabled with the debug version.
EOF
fi
if test -z "$allegro_build_debugging_programs"; then
cat >> makefile.info << EOF
Warning: the programs will not be built with Fortify support.
The support is only enabled with the debug version.
EOF
fi
fi
dnl Warn if passed --enable-dbg-with-dmalloc
if test -n "$allegro_debug_with_dmalloc"; then
if test -z "$allegro_build_debugging_library"; then
cat >> makefile.info << EOF
Warning: the library will not be built with DMalloc support.
The support is only enabled with the debug version.
EOF
fi
if test -z "$allegro_build_debugging_programs"; then
cat >> makefile.info << EOF
Warning: the programs will not be built with DMalloc support.
The support is only enabled with the debug version.
EOF
fi
fi
#-----------------------------------------------------------------------------#
#
# Output
#
dnl Prepare initial dependencies file (if missing).
if test -f "$srcdir/makefile.dep"; then
if test `cd "$srcdir" ; pwd` != `cd . ; pwd`; then
cp "$srcdir/makefile.dep" makefile.dep
dnl Wait for a moment, to ensure the makefile gets a nice late
dnl timestamp, otherwise `makefile.dep' looks too new.
echo 'Having a snooze...'
sleep 1
fi
elif test ! -f makefile.dep; then
allegro_make_depend="yes"
fi
dnl Prepare alunixac.h.
AC_CONFIG_HEADER(include/allegro/platform/alunixac.h:include/allegro/platform/alunixac.hin)
dnl Cosmetics for allegro-config
FRAMEWORKS=
AC_SUBST(FRAMEWORKS)
dnl Prepare makefile and allegro-config.
AC_OUTPUT(makefile:makefile.in allegro-config:misc/allegro-config.in,
[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
dnl The makefile doesn't work with non-GNU make so test for its presence.
if ${MAKE-make} -v -f /dev/null 2>/dev/null | grep -i "gnu" >/dev/null; then
gnu_make="yes"
fi
dnl Run "make depend" if necessary.
if test "X$allegro_make_depend" = "Xyes"; then
if test "X$gnu_make" = "Xyes"; then
${MAKE-make} depend
else
AC_MSG_WARN([Non-GNU make detected, trying gmake to build dependencies.])
gmake depend
fi
fi
dnl Display configuration informations
if test "X$gnu_make" = "Xyes"; then
${MAKE-make} info
else
gmake info