-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.in
819 lines (775 loc) · 20.3 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
# Public domain
#
# This is a BSDBuild configure script source. The ./configure script is
# generated from this file via mkconfigure(1). For more information, see:
# http://bsdbuild.hypertriton.com/.
#
# Version information
PACKAGE("Agar")
VERSION("1.5.0")
RELEASE("A Mild Breeze upon the Brow of the Dead")
# Register options for configure --help
REGISTER_SECTION("Global Agar options:")
REGISTER("--enable-<library>", "Build libraries (gui|vg|math|dev|au) [all]")
REGISTER("--enable-debug", "General debugging [no]")
REGISTER("--enable-legacy", "Deprecated interfaces [yes]")
REGISTER("--enable-threads", "Thread safety [check]")
REGISTER("--enable-warnings", "Suggested compiler warnings [no]")
REGISTER("--with-pthreads[=PREFIX]", "POSIX Threads support [check]")
REGISTER_SECTION("Options specific to CORE library:")
REGISTER("--enable-debug-core", "Expensive AG_Object debugging [no]")
REGISTER("--enable-network", "Network interface [check]")
REGISTER("--with-db4[=PREFIX]", "AG_Db: Berkeley DB backend [check]")
REGISTER("--with-mysql[=PREFIX]", "AG_Db: MySQL backend [no]")
REGISTER("--with-iconv[=PREFIX]", "Character set conversion [check]")
REGISTER_SECTION("Options specific to MATH library:")
REGISTER("--with-<mode>-fp", "Precision (single|double|quad) [double]")
REGISTER("--with-altivec", "AltiVec-optimized routines [check]")
REGISTER("--with-altivec-inline", "Inline Altivec-optimized routines [no]")
REGISTER("--with-sse", "SSE-optimized routines [check]")
REGISTER("--with-sse-inline", "Inline SSE-optimized routines [no]")
REGISTER("--without-sse[234]", "Disable SSE2/SSE3 [check]")
REGISTER_SECTION("Options specific to AU library:")
REGISTER("--with-sndfile[=PREFIX]", "Enable sndfile support [check]")
REGISTER("--with-portaudio[=PREFIX]", "Enable portaudio driver [check]")
REGISTER_SECTION("Options specific to GUI library:")
REGISTER("--enable-debug-gui", "Expensive GUI debugging [no]")
REGISTER("--with-freetype[=PREFIX]", "Enable FreeType support [check]")
REGISTER("--with-fontconfig[=PREFIX]", "Enable Fontconfig support [check]")
REGISTER("--with-gl[=PREFIX]", "OpenGL rendering support [check]")
REGISTER("--with-jpeg[=PREFIX]", "Built-in JPEG image support [check]")
REGISTER("--with-png[=PREFIX]", "Built-in PNG image support [check]")
REGISTER("--with-x[=PREFIX]", "Build with X windows support [check]")
REGISTER("--with-xinerama[=PREFIX]", "Build with Xinerama support [check]")
REGISTER("--with-glx[=PREFIX]", "Enable accelerated X driver [check]")
REGISTER("--with-sdl[=PREFIX]", "Enable SDL 1.2 driver [check]")
REGISTER("--with-sdl2[=PREFIX]", "Enable SDL 2.0 driver [check]")
REGISTER("--with-wgl", "Enable MS Windows driver [check]")
REGISTER("--with-cocoa", "Enable MacOS X Cocoa driver [check]")
REGISTER("--with-uim[=PREFIX]", "Enable UIM input method [no]")
DEFAULT_DIR(DATADIR, "${PREFIX}/share/agar")
DEFAULT_DIR(LOCALEDIR, "${DATADIR}/locale")
DEFAULT_DIR(TTFDIR, "${DATADIR}/fonts")
DEFAULT_DIR(INCLDIR, "${PREFIX}/include/agar")
if [ "${DATADIR}" = "NONE" ]; then
HDEFINE(LOCALEDIR, "NONE")
MDEFINE(LOCALEDIR, "NONE")
HDEFINE(TTFDIR, "NONE")
MDEFINE(TTFDIR, "NONE")
fi
# Tests
REQUIRE(cc)
CHECK(cc_attributes)
CHECK(objc)
CHECK(sys_types)
CHECK(stdlib_h)
CHECK(unistd_h)
CHECK(limits_h)
CHECK(float_h)
CHECK(math)
CHECK(math_c99)
CHECK(getpwuid)
CHECK(getpwnam_r)
CHECK(getenv)
CHECK(getuid)
CHECK(strsep)
CHECK(asprintf)
CHECK(snprintf)
CHECK(vsnprintf)
CHECK(vasprintf)
CHECK(signal)
CHECK(setjmp)
CHECK(strtoll)
CHECK(strtold)
CHECK(byte_order)
CHECK(dlopen)
CHECK(dyld)
CHECK(shl_load)
CHECK(gettimeofday)
CHECK(select)
CHECK(glob)
CHECK(getopt)
CHECK(execvp)
CHECK(clock_gettime)
CHECK(clock_win32)
CHECK(nanosleep)
CHECK(kqueue)
CHECK(timerfd)
CHECK(csidl)
CHECK(xbox)
# C compiler options
C_DEFINE(_AGAR_INTERNAL)
C_DEFINE(_BSD_SOURCE)
C_NO_SECURE_WARNINGS()
#C_EXTRA_WARNINGS()
#C_FATAL_WARNINGS()
if [ "${enable_warnings}" = "yes" ]; then
C_OPTION(-Wall)
C_OPTION(-Werror)
C_OPTION(-Wmissing-prototypes)
C_OPTION(-Wno-switch)
MDEFINE(WNO_UNINITIALIZED, "-Wno-uninitialized")
else
MDEFINE(WNO_UNINITIALIZED, "")
fi
if [ "${enable_debug}" = "yes" ]; then
HDEFINE(AG_DEBUG, "yes")
MDEFINE(CFLAGS, "${CFLAGS} -g")
else
HUNDEF(AG_DEBUG)
fi
if [ "${enable_debug_core}" = "yes" ]; then
HDEFINE(AG_DEBUG_CORE, "yes")
else
HUNDEF(AG_DEBUG_CORE)
fi
if [ "${enable_debug_gui}" = "yes" ]; then
HDEFINE(AG_DEBUG_GUI, "yes")
else
HUNDEF(AG_DEBUG_GUI)
fi
if [ "${enable_legacy}" != "no" ]; then
HDEFINE(AG_LEGACY, "yes")
else
HUNDEF(AG_LEGACY)
fi
#
# Options specific to the Agar-GUI library.
#
if [ "${enable_gui}" != "no" ]; then
HDEFINE(ENABLE_GUI, "yes")
MDEFINE(SUBDIR_gui, "gui")
# Enable SDL support if the SDL library is found.
if [ "${with_sdl}" != "no" ]; then
CHECK(sdl, 1.2.0, ${prefix_sdl})
if [ "${HAVE_SDL}" != "yes" ]; then
if [ "${with_sdl}" = "yes" ]; then
echo "*"
echo "* --with-sdl was requested, but the SDL "
echo "* library was not found."
echo "*"
exit 1
else
HUNDEF(HAVE_SDL)
fi
fi
else
HUNDEF(HAVE_SDL)
fi
# Enable SDL2 support if the SDL2 library is found.
if [ "${with_sdl2}" != "no" ]; then
CHECK(sdl, 2.0.8, ${prefix_sdl2})
if [ "${HAVE_SDL2}" != "yes" ]; then
if [ "${with_sdl2}" = "yes" ]; then
echo "*"
echo "* --with-sdl2 was requested, but the SDL2 "
echo "* library was not found."
echo "*"
exit 1
else
HUNDEF(HAVE_SDL2)
fi
fi
else
HUNDEF(HAVE_SDL2)
fi
# Enable OpenGL support if an OpenGL library is found.
if [ "${with_gl}" != "no" ]; then
CHECK(opengl, 0, ${prefix_gl})
if [ "${HAVE_OPENGL}" = "yes" ]; then
MDEFINE(SDL_CFLAGS, "$SDL_CFLAGS $OPENGL_CFLAGS")
else
if [ "${with_gl}" = "yes" ]; then
echo "*"
echo "* --with-gl was requested, but no OpenGL"
echo "* library was found."
echo "*"
exit 1
else
HUNDEF(HAVE_OPENGL)
fi
fi
else
HUNDEF(HAVE_OPENGL)
fi
# Enable X Windows support if Xlib is found.
if [ "${with_x}" != "no" ]; then
CHECK(x11, 0, ${prefix_x})
if [ "${HAVE_X11}" != "yes" ]; then
if [ "${with_x}" = "yes" ]; then
echo "*"
echo "* --with-x was requested, but Xlib "
echo "* was not found."
echo "*"
exit 1
else
HUNDEF(HAVE_X11)
fi
fi
if [ "${with_xinerama}" != "no" ]; then
CHECK(xinerama, 0, ${prefix_xinerama})
if [ "${HAVE_XINERAMA}" != "yes" ]; then
if [ "${with_xinerama}" = "yes" ]; then
echo "*"
echo "* --with-xinerama was requested, but the "
echo "* Xinerama extension was not found."
echo "*"
exit 1
else
HUNDEF(HAVE_XINERAMA)
fi
fi
else
HUNDEF(HAVE_XINERAMA)
fi
else
HUNDEF(HAVE_X11)
fi
# Enable MacOS X / Cocoa support if Cocoa is found.
if [ "${with_cocoa}" != "no" ]; then
CHECK(cocoa, 0)
if [ "${HAVE_COCOA}" != "yes" ]; then
if [ "${with_cocoa}" = "yes" ]; then
echo "*"
echo "* --with-cocoa was requested, but the "
echo "* Cocoa framework was not found."
echo "*"
exit 1
else
HUNDEF(HAVE_COCOA)
fi
fi
else
HUNDEF(HAVE_COCOA)
fi
#
# Platform-specific OpenGL APIs
#
if [ "${HAVE_OPENGL}" = "yes" ]; then
# Enable GLX support if the GLX library is found.
if [ "${with_glx}" != "no" ]; then
CHECK(glx, 1.4, ${prefix_glx})
if [ "${HAVE_GLX}" != "yes" ]; then
if [ "${with_glx}" = "yes" ]; then
echo "*"
echo "* --with-glx was requested, but no"
echo "* compatible GLX library was found."
echo "*"
exit 1
else
HUNDEF(HAVE_GLX)
fi
fi
else
HUNDEF(HAVE_GLX)
fi
# Enable WGL support on Windows.
if [ "${with_wgl}" != "no" ]; then
CHECK(wgl, 0)
if [ "${HAVE_WGL}" != "yes" ]; then
if [ "${with_wgl}" = "yes" ]; then
echo "*"
echo "* --with-wgl was requested, but the"
echo "* WGL test has failed."
echo "*"
exit 1
else
HUNDEF(HAVE_WGL)
fi
fi
else
HUNDEF(HAVE_WGL)
fi
else
HUNDEF(HAVE_WGL)
HUNDEF(HAVE_GLX)
fi
# Enable Freetype support if the Freetype library is found. Otherwise
# fall back to the bitmap font engine.
if [ "${with_freetype}" != "no" ]; then
CHECK(freetype, 7.0.1, ${prefix_freetype})
if [ "${HAVE_FREETYPE}" != "yes" ]; then
echo "*"
echo "* The FreeType library was not found, aborting!"
echo "*"
echo "* Agar needs FreeType to display vector fonts"
echo "* (http://www.freetype.org/)."
echo "*"
echo "* If you really want to use Agar's built-in"
echo "* monospace bitmap font engine (not recommended),"
echo "* please use: ./configure --without-freetype"
echo "*"
exit 1
fi
else
HUNDEF(HAVE_FREETYPE)
fi
# Use fontconfig if available.
if [ "${with_fontconfig}" != "no" ]; then
CHECK(fontconfig, 2.6.0, ${prefix_fontconfig})
else
HUNDEF(HAVE_FONTCONFIG)
fi
# Enable JPEG format support if libjpeg is found.
if [ "${with_jpeg}" != "no" ]; then
CHECK(jpeg, 0, ${prefix_jpeg})
if [ "${HAVE_JPEG}" != "yes" ]; then
if [ "${with_jpeg}" = "yes" ]; then
echo "*"
echo "* --with-jpeg was requested, but libjpeg"
echo "* was not found."
echo "*"
exit 1
else
HUNDEF(HAVE_JPEG)
fi
fi
else
HUNDEF(HAVE_JPEG)
fi
# Enable PNG format support if libpng is found.
if [ "${with_png}" != "no" ]; then
CHECK(png, 1.2.49, ${prefix_png})
if [ "${HAVE_PNG}" != "yes" ]; then
if [ "${with_png}" = "yes" ]; then
echo "*"
echo "* --with-png was requested, but libpng"
echo "* was not found."
echo "*"
exit 1
else
HUNDEF(HAVE_PNG)
HUNDEF(HAVE_LIBPNG14)
fi
fi
else
HUNDEF(HAVE_PNG)
HUNDEF(HAVE_LIBPNG14)
fi
else
HUNDEF(ENABLE_GUI)
MDEFINE(SUBDIR_gui, "")
HUNDEF(HAVE_SDL)
HUNDEF(HAVE_SDL2)
HUNDEF(HAVE_X11)
HUNDEF(HAVE_COCOA)
HUNDEF(HAVE_OPENGL)
HUNDEF(HAVE_GLX)
HUNDEF(HAVE_WGL)
HUNDEF(HAVE_FREETYPE)
HUNDEF(HAVE_FONTCONFIG)
HUNDEF(HAVE_JPEG)
HUNDEF(HAVE_PNG)
HUNDEF(HAVE_LIBPNG14)
fi
# Enable network interface unless requested otherwise.
if [ "${enable_network}" != "no" ]; then
CHECK(getaddrinfo)
CHECK(siocgifconf)
CHECK(sockopts)
CHECK(winsock)
MDEFINE(HAVE_NETWORK, "yes")
HDEFINE(AG_NETWORK, "yes")
else
MDEFINE(HAVE_NETWORK, "no")
HUNDEF(AG_NETWORK)
HUNDEF(HAVE_GETADDRINFO)
HUNDEF(HAVE_SETSOCKOPT)
HUNDEF(HAVE_SO_OOBINLINE)
HUNDEF(HAVE_SO_REUSEPORT)
HUNDEF(HAVE_SO_TIMESTAMP)
HUNDEF(HAVE_SO_NOSIGPIPE)
HUNDEF(HAVE_SO_LINGER)
HUNDEF(HAVE_SO_ACCEPTFILTER)
HUNDEF(HAVE_WINSOCK1)
HUNDEF(HAVE_WINSOCK2)
HUNDEF(HAVE_SIOCGIFCONF)
fi
# Enable Berkeley DB backend for AG_Db if available.
if [ "${with_db4}" != "no" ]; then
CHECK(db4, 0, ${prefix_db4})
if [ "${HAVE_DB4}" != "yes" ]; then
if [ "${with_db4}" = "yes" ]; then
echo "*"
echo "* --with-db4 was requested, but Berkeley DB"
echo "* was not found."
echo "*"
exit 1
else
HUNDEF(HAVE_DB4)
fi
fi
else
HUNDEF(HAVE_DB4)
fi
# Enable MySQL backend for AG_Db if requested.
if [ "${with_mysql}" = "yes" ]; then
CHECK(mysql, 5.5.8, ${prefix_mysql})
if [ "${HAVE_MYSQL}" != "yes" ]; then
if [ "${with_mysql}" = "yes" ]; then
echo "*"
echo "* --with-mysql was requested, but libmysqlclient"
echo "* was not found."
echo "*"
exit 1
else
HUNDEF(HAVE_MYSQL)
fi
fi
else
HUNDEF(HAVE_MYSQL)
fi
# Enable threads support if POSIX threads are available.
if [ "${enable_threads}" != "no" ]; then
CHECK(pthreads, 0, ${prefix_pthreads})
if [ "${HAVE_PTHREADS}" = "yes" ];
then
HDEFINE(AG_THREADS, "yes")
if [ "${HAVE_PTHREADS_XOPEN}" = "no" ]; then
if [ "${HAVE_PTHREAD_MUTEX_RECURSIVE}" = "no" ]; then
if [ "${HAVE_PTHREAD_MUTEX_RECURSIVE_NP}" = "no" ]; then
HUNDEF(AG_THREADS)
if [ "${enable_threads}" = "yes" ]; then
echo "*"
echo "* --enable-threads was given, but your"
echo "* pthreads library seems to lack support"
echo "* for recursive mutexes."
echo "*"
exit 1
fi
fi
fi
fi
else
HUNDEF(AG_THREADS)
if [ "${enable_threads}" = "yes" ]; then
echo "*"
echo "* --enable-threads was given, but no pthreads"
echo "* library was found on your system."
echo "*"
exit 1
fi
fi
else
HUNDEF(AG_THREADS)
HUNDEF(HAVE_PTHREADS)
HUNDEF(HAVE_PTHREADS_XOPEN)
#
# Lock macros expand to no-ops when compiled !AG_THREADS, which may
# result in unused variables in some places.
#
if [ "${enable_warnings}" = "yes" ]; then
C_OPTION(-Wno-unused)
fi
fi
# Enable UIM input method support if requested.
if [ "${with_uim}" = "yes" ]; then
CHECK(uim, 1.8.0, ${prefix_uim})
if [ "${HAVE_UIM}" != "yes" ]; then
if [ "${with_uim}" = "yes" ]; then
echo "*"
echo "* --with-uim was requested, but the uim "
echo "* framework is not installed."
echo "*"
exit 1
else
HUNDEF(HAVE_UIM)
fi
fi
else
HUNDEF(HAVE_UIM)
fi
# Enable NLS if requested explicitely.
if [ "${enable_nls}" = "yes" ]; then
CHECK(iconv, 0, ${prefix_iconv})
CHECK(gettext, 0, ${prefix_gettext})
if [ "${HAVE_GETTEXT}" != "yes" ]; then
echo "*"
echo "* --enable-nls was given but gettext was not found."
echo "*"
exit 1
fi
else
HUNDEF(HAVE_ICONV)
HUNDEF(HAVE_GETTEXT)
fi
#
# Options specific to the Agar-Math library
#
if [ "${enable_math}" != "no" ]; then
HDEFINE(ENABLE_MATH, "yes")
MDEFINE(SUBDIR_math, "math")
else
HUNDEF(ENABLE_MATH)
MDEFINE(SUBDIR_math, "")
fi
# Enable AltiVec optimizations if compiler supports AltiVec.
if [ "${with_altivec}" != "no" ]; then
CHECK(altivec)
if [ "${HAVE_ALTIVEC}" != "yes" ]; then
if [ "${with_altivec}" = "yes" ]; then
echo "*"
echo "* --with-altivec was requested, but "
echo "* AltiVec is not supported by compiler"
echo "*"
exit 1
else
HUNDEF(HAVE_ALTIVEC)
HUNDEF(HAVE_ALTIVEC_H)
HUNDEF(INLINE_ALTIVEC)
fi
else
if [ "${with_altivec_inline}" = "yes" ]; then
HDEFINE(INLINE_ALTIVEC, "yes")
else
HUNDEF(INLINE_ALTIVEC)
fi
fi
else
HUNDEF(HAVE_ALTIVEC)
HUNDEF(HAVE_ALTIVEC_H)
HUNDEF(INLINE_ALTIVEC)
fi
#
# Enable SSE optimizations if compiler supports intrinsics. Note that the
# library performs a CPU check, so enabling SSE will not break the build
# on non-SSE machines (unless --with-sse-inline is used, in which case
# the resulting build will be SSE-dependent).
#
if [ "${with_sse}" != "no" ]; then
CHECK(sse)
if [ "${HAVE_SSE}" != "yes" ]; then
if [ "${with_sse}" = "yes" ]; then
echo "*"
echo "* --with-sse was requested, but SSE "
echo "* intrinsics not supported by compiler"
echo "*"
exit 1
else
HUNDEF(HAVE_SSE)
HUNDEF(INLINE_SSE)
fi
else
if [ "${with_sse_inline}" = "yes" ]; then
HDEFINE(INLINE_SSE, "yes")
else
HUNDEF(INLINE_SSE)
fi
if [ "${with_sse2}" = "no" ]; then
HUNDEF(HAVE_SSE2)
fi
if [ "${with_sse3}" = "no" ]; then
HUNDEF(HAVE_SSE3)
fi
fi
else
HUNDEF(HAVE_SSE)
HUNDEF(HAVE_SSE2)
HUNDEF(HAVE_SSE3)
HUNDEF(INLINE_SSE)
fi
# Specify floating-point precision to use.
if [ "${with_single_fp}" = "yes" ]; then
if [ "${HAVE_MATH_C99}" != "yes" ]; then
echo "*"
echo "* --with-single-fp was requested, but your compiler does"
echo "* not support the C99 math routines (sinf(), etc)."
echo "*"
exit 1
fi
HDEFINE(SINGLE_PRECISION, "yes")
else
HUNDEF(SINGLE_PRECISION)
fi
if [ "${with_double_fp}" != "no" ]; then
HDEFINE(DOUBLE_PRECISION, "yes")
else
HUNDEF(DOUBLE_PRECISION)
fi
if [ "${with_quad_fp}" = "yes" ]; then
if [ "${HAVE_LONG_DOUBLE}" != "yes" ]; then
echo "*"
echo "* --with-quad-fp was requested, but your compiler"
echo "* does not support the C99 long double type."
echo "*"
exit 1
fi
if [ "${HAVE_MATH_C99}" != "yes" ]; then
echo "*"
echo "* --with-quad-fp was requested, but the C99 math"
echo "* routines (sinl(), etc.) are not available."
echo "*"
exit 1
fi
HDEFINE(QUAD_PRECISION, "yes")
else
HUNDEF(QUAD_PRECISION)
fi
#
# Options specific to the Agar-VG library
#
if [ "${enable_vg}" != "no" -a "${enable_gui}" != "no" ]; then
HDEFINE(ENABLE_VG, "yes")
MDEFINE(SUBDIR_vg, "vg")
else
HUNDEF(ENABLE_VG)
MDEFINE(SUBDIR_vg, "")
fi
#
# Options specific to the Agar-DEV library
#
if [ "${enable_dev}" != "no" -a "${enable_gui}" != "no" ]; then
HDEFINE(ENABLE_DEV, "yes")
MDEFINE(SUBDIR_dev, "dev")
else
HUNDEF(ENABLE_DEV)
MDEFINE(SUBDIR_dev, "")
fi
#
# Options specific to the Agar-AU library
#
if [ "${enable_au}" != "no" -a "${enable_audio}" != "no" ]; then
CHECK(sndfile, 1.0.21, ${prefix_sndfile})
if [ "${HAVE_SNDFILE}" = "yes" ]; then
HDEFINE(ENABLE_AU, "yes")
MDEFINE(SUBDIR_au, "au")
CHECK(portaudio, 19.0, ${prefix_portaudio})
else
if [ "${enable_au}" = "yes" -o "${enable_audio}" = "yes" ]; then
echo "*"
echo "* --enable-au was requested, but the sndfile library"
echo "* (required) is not installed."
echo "*"
exit 1
fi
HUNDEF(ENABLE_AU)
MDEFINE(SUBDIR_au, "")
HUNDEF(HAVE_SNDFILE)
HUNDEF(HAVE_PORTAUDIO)
fi
else
HUNDEF(ENABLE_AU)
MDEFINE(SUBDIR_au, "")
HUNDEF(HAVE_SNDFILE)
HUNDEF(HAVE_PORTAUDIO)
fi
#
# Conditionally compiled sources in Agar-Core
#
MDEFINE(SRCS_CORE, "")
if [ "${HAVE_SNPRINTF}" != "yes" ]; then
MAPPEND(SRCS_CORE, "snprintf.c")
fi
if [ "${HAVE_CLOCK_WIN32}" = "yes" ]; then
MAPPEND(SRCS_CORE, "time_win32.c")
fi
if [ "${HAVE_CLOCK_GETTIME}" = "yes" ]; then
if [ "${HAVE_NANOSLEEP}" = "yes" ]; then
MAPPEND(SRCS_CORE, "time_posix.c")
fi
if [ "${HAVE_PTHREADS}" = "yes" ]; then
MAPPEND(SRCS_CORE, "time_renderer.c")
fi
fi
if [ "${HAVE_GETTIMEOFDAY}" = "yes" ]; then
if [ "${HAVE_SELECT}" = "yes" ]; then
MAPPEND(SRCS_CORE, "time_gettimeofday.c")
fi
fi
if [ "${HAVE_DB4}" = "yes" ]; then
MAPPEND(SRCS_CORE, "db_bdb.c")
fi
if [ "${HAVE_MYSQL}" = "yes" ]; then
MAPPEND(SRCS_CORE, "db_mysql.c")
fi
if [ "${HAVE_NETWORK}" = "yes" ]; then
MAPPEND(SRCS_CORE, "net.c net_dummy.c")
if [ "${HAVE_WINSOCK1}" = "yes" ]; then
MAPPEND(SRCS_CORE, "net_winsock1.c")
fi
if [ "${HAVE_WINSOCK2}" = "yes" ]; then
MAPPEND(SRCS_CORE, "net_winsock2.c")
fi
if [ "${HAVE_GETADDRINFO}" = "yes" ]; then
MAPPEND(SRCS_CORE, "net_bsd.c")
fi
fi
if [ "${HAVE_GETPWUID}" = "yes" ]; then
MAPPEND(SRCS_CORE, "user_posix.c")
fi
if [ "${HAVE_XBOX}" = "yes" ]; then
MAPPEND(SRCS_CORE, "user_xbox.c xbox.c")
fi
if [ "${HAVE_CSIDL}" = "yes" ]; then
MAPPEND(SRCS_CORE, "user_win32.c")
fi
#
# Conditionally compiled sources in Agar-GUI
#
MDEFINE(SRCS_GUI, "")
if [ "${HAVE_SDL}" = "yes" ]; then
MAPPEND(SRCS_GUI, "drv_sdl_common.c drv_sdlfb.c")
if [ "${HAVE_OPENGL}" = "yes" ]; then
MAPPEND(SRCS_GUI, "drv_sdlgl.c")
fi
fi
if [ "${HAVE_SDL2}" = "yes" ]; then
MAPPEND(SRCS_GUI, "drv_sdl2_common.c drv_sdl2.c")
fi
if [ "${HAVE_OPENGL}" = "yes" ]; then
MAPPEND(SRCS_GUI, "drv_gl_common.c")
if [ "${HAVE_GLX}" = "yes" ]; then
MAPPEND(SRCS_GUI, "drv_glx.c")
fi
if [ "${HAVE_WGL}" = "yes" ]; then
MAPPEND(SRCS_GUI, "drv_wgl.c")
fi
fi
if [ "${HAVE_COCOA}" = "yes" ]; then
MAPPEND(SRCS_GUI, "drv_cocoa.m")
fi
#
# Conditionally compiled sources in Agar-AU
#
MDEFINE(SRCS_AU, "")
if [ "${AG_THREADS}" = "yes" ]; then
if [ "${HAVE_SNDFILE}" = "yes" ]; then
MAPPEND(SRCS_AU, "au_dev_file.c")
fi
if [ "${HAVE_PORTAUDIO}" = "yes" ]; then
MAPPEND(SRCS_AU, "au_dev_pa.c")
fi
fi
# Set up configure script output
C_INCPREP($BLD/include/agar)
C_INCDIR($BLD/include)
C_INCDIR_CONFIG($BLD/include/agar/config)
# Generate the "foo-config" scripts.
CONFIG_SCRIPT(agar-config,\
"-I${INCLDIR} ${SDL_CFLAGS} ${SDL2_CFLAGS} ${FREETYPE_CFLAGS} ${FONTCONFIG_CFLAGS} \
${OPENGL_CFLAGS} ${X11_CFLAGS} ${GLX_CFLAGS} ${XINERAMA_CFLAGS} \
${COCOA_CFLAGS} ${MATH_CFLAGS} ${PNG_CFLAGS} ${PTHREADS_CFLAGS} \
${DB4_CFLAGS} ${MYSQL_CFLAGS} ${GETTEXT_CFLAGS} ${DSO_CFLAGS} \
${CLOCK_CFLAGS} ${UIM_CFLAGS} ${ICONV_CFLAGS}",\
"-L${LIBDIR} -lag_gui -lag_core ${SDL_LIBS} ${SDL2_LIBS} ${FREETYPE_LIBS} \
${FONTCONFIG_LIBS} ${OPENGL_LIBS} ${X11_LIBS} ${XINERAMA_LIBS} \
${COCOA_LIBS} ${MATH_LIBS} ${JPEG_LIBS} ${PNG_LIBS} ${PTHREADS_LIBS} \
${DB4_LIBS} ${MYSQL_LIBS} ${GETTEXT_LIBS} ${DSO_LIBS} ${CLOCK_LIBS} \
${UIM_LIBS} ${ICONV_LIBS}")
CONFIG_SCRIPT(agar-core-config,\
"-I${INCLDIR} ${MATH_CFLAGS} ${GETTEXT_CFLAGS} ${DSO_CFLAGS} \
${CLOCK_CFLAGS} ${ICONV_CFLAGS}",\
"-L${LIBDIR} -lag_core ${MATH_LIBS} ${PTHREADS_LIBS} ${DB4_LIBS} \
${MYSQL_LIBS} ${GETTEXT_LIBS} ${DSO_LIBS} ${CLOCK_LIBS} ${ICONV_LIBS}")
CONFIG_SCRIPT(agar-dev-config,\
"-I${INCLDIR}",\
"-L${LIBDIR} -lag_dev")
CONFIG_SCRIPT(agar-math-config,\
"-I${INCLDIR} ${MATH_CFLAGS} ${ALTIVEC_CFLAGS} \
${SSE_CFLAGS} ${SSE2_CFLAGS} ${SSE3_CFLAGS} ${MATH_CFLAGS}", \
"-L${LIBDIR} -lag_math ${MATH_LIBS}")
CONFIG_SCRIPT(agar-vg-config,\
"-I${INCLDIR}", "-L${LIBDIR} -lag_vg")
CONFIG_SCRIPT(agar-au-config,\
"-I${INCLDIR} ${PORTAUDIO_CFLAGS} ${SNDFILE_CFLAGS}",\
"-L${LIBDIR} -lag_au ${PORTAUDIO_LIBS} ${SNDFILE_LIBS}")