-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure
10683 lines (10389 loc) · 343 KB
/
configure
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
#!/bin/sh
#
# Do not edit!
# This file was generated from configure.in by BSDBuild 3.2.
#
# To regenerate this file, get the latest BSDBuild release from
# http://hypertriton.com/bsdbuild/, and use the command:
#
# $ cat configure.in | mkconfigure > configure
#
# Copyright (c) 2001-2015 Hypertriton, Inc. <http://hypertriton.com/>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
# USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
PACKAGE="Untitled"
VERSION=""
RELEASE=""
optarg=
for arg
do
case "$arg" in
-*=*)
optarg=`echo "$arg" | sed 's/[-_a-zA-Z0-9]*=//'`
;;
*)
optarg=
;;
esac
case "$arg" in
--build=*)
build_arg=$optarg
;;
--host=*)
host_arg=$optarg
;;
--target=*)
target=$optarg
;;
--emul-os=*)
PROJ_TARGET=$optarg
;;
--byte-order=*)
byte_order=$optarg
;;
--prefix=*)
prefix=$optarg
;;
--exec-prefix=*)
exec_prefix=$optarg
;;
--sysconfdir=*)
sysconfdir=$optarg
;;
--bindir=*)
bindir=$optarg
;;
--libdir=*)
libdir=$optarg
;;
--moduledir=*)
moduledir=$optarg
;;
--libexecdir=*)
libexecdir=$optarg
;;
--datadir=*)
datadir=$optarg
;;
--statedir=* | --localstatedir=*)
statedir=$optarg
;;
--localedir=*)
localedir=$optarg
;;
--mandir=*)
mandir=$optarg
;;
--infodir=* | --datarootdir=* | --docdir=* | --htmldir=* | --dvidir=* | --pdfdir=* | --psdir=* | --sharedstatedir=* | --sbindir=*)
;;
--enable-*)
option=`echo $arg | sed -e 's/--enable-//' -e 's/=.*//'`
option=`echo $option | sed 's/-/_/g'`
case "$arg" in
*=*)
eval "enable_${option}='$optarg'"
eval "prefix_${option}='$optarg'"
;;
*)
eval "enable_${option}=yes"
;;
esac
;;
--disable-*)
option=`echo $arg | sed -e 's/--disable-//'`;
option=`echo $option | sed 's/-/_/g'`
eval "enable_${option}=no"
;;
--with-*)
option=`echo $arg | sed -e 's/--with-//' -e 's/=.*//'`
option=`echo $option | sed 's/-/_/g'`
case "$arg" in
*=*)
eval "with_${option}='$optarg'"
eval "prefix_${option}='$optarg'"
;;
*)
eval "with_${option}=yes"
;;
esac
;;
--without-*)
option=`echo $arg | sed -e 's/--without-//'`;
option=`echo $option | sed 's/-/_/g'`
eval "with_${option}=no"
;;
--x-includes=*)
with_x_includes=$optarg
;;
--x-libraries=*)
with_x_libraries=$optarg
;;
--help)
show_help=yes
;;
--version)
show_version=yes
;;
--srcdir=*)
srcdir=$optarg
;;
--testdir=*)
testdir=$optarg
;;
--cache=*)
cache=$optarg
;;
--includes=*)
includes=$optarg
;;
--cache-file=*)
;;
--config-cache | -C)
;;
*)
echo "invalid argument: $arg"
echo "try ./configure --help"
exit 1
;;
esac
done
if [ -e "/bin/echo" ]; then
/bin/echo -n ""
if [ $? = 0 ]; then
ECHO_N="/bin/echo -n"
else
ECHO_N="echo -n"
fi
else
ECHO_N="echo -n"
fi
PERL=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/perl" ]; then
PERL="${path}/perl"
break
fi
done
PKGCONFIG=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/pkg-config" ]; then
PKGCONFIG="${path}/pkg-config"
break
fi
done
if [ "${prefix}" != "" ]; then
PREFIX="$prefix"
else
PREFIX="/usr/local"
fi
if [ "${exec_prefix}" != "" ]; then
EXEC_PREFIX="$exec_prefix"
else
EXEC_PREFIX="${PREFIX}"
fi
if [ "${srcdir}" != "" ]; then
if [ "${PERL}" = "" ]; then
echo "*"
echo "* Separate build (--srcdir) requires perl, but there is"
echo "* no perl interpreter to be found in your PATH."
echo "*"
exit 1
fi
SRC=${srcdir}
else
SRC=`pwd`
fi
BLD=`pwd`
SRCDIR="${SRC}"
BLDDIR="${BLD}"
if [ "${testdir}" != "" ]; then
echo "Configure tests will be executed in ${testdir}"
if [ ! -e "${testdir}" ]; then
echo "Creating ${testdir}"
mkdir ${testdir}
fi
else
testdir="."
fi
if [ "${includes}" = "" ]; then
includes="yes"
fi
case "${includes}" in
yes|no)
;;
link)
if [ "${with_proj_generation}" ]; then
echo "Cannot use --includes=link with --with-proj-generation!"
exit 1
fi
;;
*)
echo "Usage: --includes [yes|no|link]"
exit 1
;;
esac
if [ "${srcdir}" = "" ]; then
cat << EOT > configure.dep.pl
#!/usr/bin/env perl
# Public domain.
# Scan Makefiles for "include .depend" and generate empty ".depend" files,
# such that make can be run prior to an initial "make depend".
#
my %V = ();
sub MakefileIncludesDepend (\$\$)
{
my \$path = shift;
my \$cwd = shift;
if (!open(MF, \$path)) {
return (0);
}
my @lines = ();
foreach \$_ (<MF>) {
chop;
if (/^(.+)\\\\\$/) { # Expansion
\$line .= \$1;
} else { # New line
if (\$line) {
push @lines, \$line . \$_;
\$line = '';
} else {
push @lines, \$_;
}
}
}
foreach \$_ (@lines) {
if (/^\\s*#/) { next; }
if (/^\\t/) { next; }
s/\\\$\\{(\\w+)\\}/\$V{\$1}/g;
if (/^\\s*(\\w+)\\s*=\\s*"(.+)"\$/ ||
/^\\s*(\\w+)\\s*=\\s*(.+)\$/) {
\$V{\$1} = \$2;
} elsif (/^\\s*(\\w+)\\s*\\+=\\s*"(.+)"\$/ ||
/^\\s*(\\w+)\\s*\\+=\\s*(.+)\$/) {
if (exists(\$V{\$1}) && \$V{\$1} ne '') {
\$V{\$1} .= ' '.\$2;
} else {
\$V{\$1} = \$2;
}
}
if (/^\\s*include\\s+(.+)\$/) {
if (\$1 eq '.depend' ||
MakefileIncludesDepend(\$cwd.'/'.\$1, \$cwd)) {
return (1);
}
}
}
close(MF);
return (0);
}
sub Scan (\$)
{
my \$dir = shift;
unless (opendir(CWD, \$dir)) {
print STDERR "\$dir: opendir: \$!; ignoring\\n";
return;
}
%V = ();
if (-e \$dir.'/Makefile' &&
MakefileIncludesDepend("\$dir/Makefile", \$dir)) {
if (open(OUT, ">\$dir/.depend")) {
close(OUT);
} else {
print STDERR "\$dir/.depend: \$!; ignoring\\n";
}
}
foreach my \$ent (readdir(CWD)) {
my \$file = \$dir.'/'.\$ent;
if (\$ent =~ /^\\./) {
next;
}
if (-d \$file) {
Scan(\$file);
next;
}
}
closedir(CWD);
}
if (@ARGV < 1) {
print STDERR "Usage: gen-dotdepend.pl [directory]\\n";
exit(1);
}
Scan(\$ARGV[0]);
EOT
if [ "${PERL}" != "" ]; then
${PERL} configure.dep.pl .
rm -f configure.dep.pl
else
echo "*"
echo "* Warning: No perl was found. Perl is required for automatic"
echo "* generation of .depend files. You may need to create empty"
echo "* .depend files where it is required."
echo "*"
fi
fi
if [ "${show_help}" = "yes" ]; then
echo "This configure script was generated by BSDBuild 3.2."
echo "<http://bsdbuild.hypertriton.com/>"
echo ""
echo "Usage: ./configure [options]"
echo ""
echo "Standard build options:"
echo " --bindir=DIR Executables for common users [PREFIX/bin]"
echo " --build=STRING Host environment for build [auto-detect]"
echo " --byte-order=STRING Byte order for build (LE|BE) [auto-detect]"
echo " --cache=DIR Cache ./configure results in directory [none]"
echo " --datadir=DIR|NONE Data files for program use [PREFIX/share]"
echo " --enable-nls Multi-language support [no]"
echo " --exec-prefix=DIR Machine-dependent installation base [PREFIX]"
echo " --host=STRING Cross-compile for target environment [BUILD]"
echo " --includes=STRING Preprocess C headers (yes|no|link) [yes]"
echo " --libdir=DIR System libraries [PREFIX/lib]"
echo " --libexecdir=DIR Executables for program use [PREFIX/libexec]"
echo " --localedir=DIR Multi-language support locales [DATADIR/locale]"
echo " --mandir=DIR Manual page documentation [PREFIX/man]"
echo " --moduledir=DIR|NONE Dynamically loaded modules [PREFIX/lib]"
echo " --prefix=DIR Installation base [/usr/local]"
echo " --srcdir=DIR Source directory for concurrent build [.]"
echo " --statedir=DIR|NONE Modifiable single-machine data [PREFIX/var]"
echo " --sysconfdir=DIR|NONE System configuration files [PREFIX/etc]"
echo " --testdir=DIR Execute all tests in this directory [.]"
echo " --with-bundles Generate application/library bundles [yes]"
echo " --with-catman Install cat files for manual pages [auto-detect]"
echo " --with-ctags Generate ctags(1) tag files [no]"
echo " --with-docs Generate printable documentation [no]"
echo " --with-gettext Use gettext for multi-language [auto-detect]"
echo " --with-libtool Specify path to libtool [bundled]"
echo " --with-manlinks Add manual entries for every function [no]"
echo " --with-manpages Generate Unix manual pages [yes]"
echo ""
echo "Global Agar options:"
echo " --enable-<library> Build libraries (gui|vg|math|dev|au) [all]"
echo " --enable-debug General debugging [no]"
echo " --enable-legacy Deprecated interfaces [yes]"
echo " --enable-threads Thread safety [check]"
echo " --enable-warnings Suggested compiler warnings [no]"
echo " --with-pthreads[=PREFIX] POSIX Threads support [check]"
echo ""
echo "Options specific to CORE library:"
echo " --enable-debug-core Expensive AG_Object debugging [no]"
echo " --enable-network Network interface [check]"
echo " --with-db4[=PREFIX] AG_Db: Berkeley DB backend [check]"
echo " --with-mysql[=PREFIX] AG_Db: MySQL backend [no]"
echo " --with-iconv[=PREFIX] Character set conversion [check]"
echo ""
echo "Options specific to MATH library:"
echo " --with-<mode>-fp Precision (single|double|quad) [double]"
echo " --with-altivec AltiVec-optimized routines [check]"
echo " --with-altivec-inline Inline Altivec-optimized routines [no]"
echo " --with-sse SSE-optimized routines [check]"
echo " --with-sse-inline Inline SSE-optimized routines [no]"
echo " --without-sse[234] Disable SSE2/SSE3 [check]"
echo ""
echo "Options specific to AU library:"
echo " --with-sndfile[=PREFIX] Enable sndfile support [check]"
echo " --with-portaudio[=PREFIX] Enable portaudio driver [check]"
echo ""
echo "Options specific to GUI library:"
echo " --enable-debug-gui Expensive GUI debugging [no]"
echo " --with-freetype[=PREFIX] Enable FreeType support [check]"
echo " --with-fontconfig[=PREFIX] Enable Fontconfig support [check]"
echo " --with-gl[=PREFIX] OpenGL rendering support [check]"
echo " --with-jpeg[=PREFIX] Built-in JPEG image support [check]"
echo " --with-png[=PREFIX] Built-in PNG image support [check]"
echo " --with-x[=PREFIX] Build with X windows support [check]"
echo " --with-xinerama[=PREFIX] Build with Xinerama support [check]"
echo " --with-glx[=PREFIX] Enable accelerated X driver [check]"
echo " --with-sdl[=PREFIX] Enable SDL 1.2 driver [check]"
echo " --with-sdl2[=PREFIX] Enable SDL 2.0 driver [check]"
echo " --with-wgl Enable MS Windows driver [check]"
echo " --with-cocoa Enable MacOS X Cocoa driver [check]"
echo " --with-uim[=PREFIX] Enable UIM input method [no]"
exit 1
fi;
if [ "${show_version}" = "yes" ]; then
echo "BSDBuild 3.2"
exit 0
fi;
if [ "${srcdir}" != "" ]; then
build_guessed=`sh ${srcdir}/mk/config.guess`
else
build_guessed=`sh mk/config.guess`
fi
if [ $? != 0 ]; then
echo "mk/config.guess failed"
exit 1
fi
if [ "${build_arg}" != "" ]; then
build="${build_arg}"
else
build="${build_guessed}"
fi
if [ "${host_arg}" != "" ]; then
host="${host_arg}"
else
host="${build}"
fi
if [ "${host}" != "${build_guessed}" ]; then
CROSS_COMPILING="yes"
else
CROSS_COMPILING="no"
fi
if [ "${with_bundles}" != "no" ]; then
case "${host}" in
arm-apple-darwin*)
PROG_BUNDLE="iOS"
;;
*-*-darwin*)
PROG_BUNDLE="OSX"
;;
esac
fi
echo "BSDBuild 3.2 (http://bsdbuild.hypertriton.com)"
echo "#!/bin/sh" > config.status
echo "# Generated by configure script (BSDBuild 3.2)." >> config.status
echo "Generated by configure script (BSDBuild 3.2)." > config.log
if [ -e "Makefile.config" ]; then
echo "* Overwriting existing Makefile.config"
fi
echo "# Generated by configure script (BSDBuild 3.2)." > Makefile.config
echo "" >> Makefile.config
echo "BUILD=${build}" >> Makefile.config
echo "HOST=${host}" >> Makefile.config
echo "CROSS_COMPILING=${CROSS_COMPILING}" >> Makefile.config
echo "SRCDIR=${SRC}" >> Makefile.config
echo "BLDDIR=${BLD}" >> Makefile.config
$ECHO_N "./configure" >> config.log
$ECHO_N "./configure" >> config.status
for arg
do
$ECHO_N " $arg" >> config.log
$ECHO_N " $arg" >> config.status
done
echo "" >> config.log
echo "" >> config.status
if [ -e "$BLD/include/agar/config" ]; then
echo "* Overwriting $BLD/include/agar/config directory"
rm -fR "$BLD/include/agar/config"
fi
mkdir -p "$BLD/include/agar/config"
if [ $? != 0 ]; then
echo "Could not create $BLD/include/agar/config directory."
exit 1
fi
cat << EOT > conftest.1
.\" COMMENT
.Dd
.Dd NOVEMBER 23, 2009
.Dt TEST 1
.Os
.ds vT Test
.ds oS Test 1.0
.Sh NAME
.Nm test
.Nd Test document
.Sh DESCRIPTION
EOT
HAVE_MANDOC="no"
MANDOC=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/mandoc" ]; then
cat conftest.1 | ${path}/mandoc -Tascii >/dev/null
if [ "$?" = "0" ]; then
HAVE_MANDOC="yes"
MANDOC="${path}/mandoc"
break;
fi
elif [ -x "${path}/nroff" ]; then
cat conftest.1 | ${path}/nroff -Tmandoc >/dev/null
if [ "$?" = "0" ]; then
HAVE_MANDOC="yes"
MANDOC="${path}/nroff -Tmandoc"
break;
fi
fi
done
rm -f conftest.1
if [ "${HAVE_MANDOC}" = "no" ]; then
if [ "${with_manpages}" = "yes" ]; then
echo "*"
echo "* --with-manpages was requested, but either the"
echo "* nroff(1)/mandoc(1) utility or the mdoc(7) macro"
echo "* package were not found."
echo "*"
exit 1
fi
echo "HAVE_MANDOC=no" >> Makefile.config
echo "NOMAN=yes" >> Makefile.config
echo "NOMANLINKS=yes" >> Makefile.config
else
echo "HAVE_MANDOC=yes" >> Makefile.config
echo "MANDOC=${MANDOC}" >> Makefile.config
if [ "${with_catman}" = "no" ]; then
echo "NOCATMAN=yes" >> Makefile.config
else
if [ "${with_catman}" = "yes" ]; then
echo "NOCATMAN=no" >> Makefile.config
else
case "${host}" in
*-*-freebsd*)
echo "NOCATMAN=yes" >> Makefile.config
;;
*)
echo "NOCATMAN=no" >> Makefile.config
;;
esac
fi
fi
if [ "${with_manpages}" = "no" ]; then
echo "NOMAN=yes" >> Makefile.config
echo "NOMANLINKS=yes" >> Makefile.config
else
if [ "${with_manlinks}" != "yes" ]; then
echo "NOMANLINKS=yes" >> Makefile.config
fi
fi
fi
if [ "${with_docs}" = "no" ]; then
echo "NODOC=yes" >> Makefile.config
fi
if [ "${enable_nls}" = "yes" ]; then
ENABLE_NLS="yes"
echo "#ifndef ENABLE_NLS" > $BLD/include/agar/config/enable_nls.h
echo "#define ENABLE_NLS \"$ENABLE_NLS\"" >> $BLD/include/agar/config/enable_nls.h
echo "#endif" >> $BLD/include/agar/config/enable_nls.h
echo "hdefs[\"ENABLE_NLS\"] = \"$ENABLE_NLS\"" >>configure.lua
msgfmt=""
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/msgfmt" ]; then
msgfmt=${path}/msgfmt
break
fi
done
if [ "${msgfmt}" != "" ]; then
HAVE_GETTEXT="yes"
else
HAVE_GETTEXT="no"
fi
echo "#ifndef ENABLE_NLS" > $BLD/include/agar/config/enable_nls.h
echo "#define ENABLE_NLS \"$ENABLE_NLS\"" >> $BLD/include/agar/config/enable_nls.h
echo "#endif" >> $BLD/include/agar/config/enable_nls.h
echo "hdefs[\"ENABLE_NLS\"] = \"$ENABLE_NLS\"" >>configure.lua
else
ENABLE_NLS="no"
HAVE_GETTEXT="no"
echo "#undef ENABLE_NLS" >$BLD/include/agar/config/enable_nls.h
echo "hdefs[\"ENABLE_NLS\"] = nil" >>configure.lua
fi;
CTAGS=""
if [ "${with_ctags}" = "yes" ]; then
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/ectags" ]; then
CTAGS="${path}/ectags"
break
fi
done
if [ "${CTAGS}" = "" ]; then
for path in `echo $PATH | sed 's/:/ /g'`; do
if [ -x "${path}/ctags" ]; then
CTAGS="${path}/ctags"
break
fi
done
fi
fi
echo "CTAGS=${CTAGS}" >> Makefile.config
if [ "${prefix_libtool}" != "" -a "${prefix_libtool}" != "bundled" ]; then
LIBTOOL_BUNDLED="no"
LIBTOOL="${prefix_libtool}"
else
LIBTOOL_BUNDLED="yes"
LIBTOOL=\${TOP}/mk/libtool/libtool
fi
echo "LIBTOOL_BUNDLED=${LIBTOOL_BUNDLED}" >> Makefile.config
echo "LIBTOOL=${LIBTOOL}" >> Makefile.config
echo "PREFIX?=${PREFIX}" >> Makefile.config
echo "#ifndef PREFIX" > $BLD/include/agar/config/prefix.h
echo "#define PREFIX \"$PREFIX\"" >> $BLD/include/agar/config/prefix.h
echo "#endif" >> $BLD/include/agar/config/prefix.h
echo "hdefs[\"PREFIX\"] = \"$PREFIX\"" >>configure.lua
if [ "${bindir}" != "" ]; then
BINDIR="${bindir}"
BINDIR_SPECIFIED="yes"
else
BINDIR="${PREFIX}/bin"
fi
echo "#ifndef BINDIR" > $BLD/include/agar/config/bindir.h
echo "#define BINDIR \"$BINDIR\"" >> $BLD/include/agar/config/bindir.h
echo "#endif" >> $BLD/include/agar/config/bindir.h
echo "hdefs[\"BINDIR\"] = \"$BINDIR\"" >>configure.lua
if [ "${libdir}" != "" ]; then
LIBDIR="${libdir}"
LIBDIR_SPECIFIED="yes"
else
LIBDIR="${PREFIX}/lib"
fi
echo "#ifndef LIBDIR" > $BLD/include/agar/config/libdir.h
echo "#define LIBDIR \"$LIBDIR\"" >> $BLD/include/agar/config/libdir.h
echo "#endif" >> $BLD/include/agar/config/libdir.h
echo "hdefs[\"LIBDIR\"] = \"$LIBDIR\"" >>configure.lua
if [ "${moduledir}" != "" ]; then
MODULEDIR="${moduledir}"
MODULEDIR_SPECIFIED="yes"
else
MODULEDIR="${PREFIX}/lib"
fi
echo "#ifndef MODULEDIR" > $BLD/include/agar/config/moduledir.h
echo "#define MODULEDIR \"$MODULEDIR\"" >> $BLD/include/agar/config/moduledir.h
echo "#endif" >> $BLD/include/agar/config/moduledir.h
echo "hdefs[\"MODULEDIR\"] = \"$MODULEDIR\"" >>configure.lua
if [ "${libexecdir}" != "" ]; then
LIBEXECDIR="${libexecdir}"
LIBEXECDIR_SPECIFIED="yes"
else
LIBEXECDIR="${PREFIX}/libexec"
fi
echo "#ifndef LIBEXECDIR" > $BLD/include/agar/config/libexecdir.h
echo "#define LIBEXECDIR \"$LIBEXECDIR\"" >> $BLD/include/agar/config/libexecdir.h
echo "#endif" >> $BLD/include/agar/config/libexecdir.h
echo "hdefs[\"LIBEXECDIR\"] = \"$LIBEXECDIR\"" >>configure.lua
if [ "${datadir}" != "" ]; then
DATADIR="${datadir}"
DATADIR_SPECIFIED="yes"
else
DATADIR="${PREFIX}/share"
fi
echo "#ifndef DATADIR" > $BLD/include/agar/config/datadir.h
echo "#define DATADIR \"$DATADIR\"" >> $BLD/include/agar/config/datadir.h
echo "#endif" >> $BLD/include/agar/config/datadir.h
echo "hdefs[\"DATADIR\"] = \"$DATADIR\"" >>configure.lua
if [ "${statedir}" != "" ]; then
STATEDIR="${statedir}"
STATEDIR_SPECIFIED="yes"
else
STATEDIR="${PREFIX}/var"
fi
echo "#ifndef STATEDIR" > $BLD/include/agar/config/statedir.h
echo "#define STATEDIR \"$STATEDIR\"" >> $BLD/include/agar/config/statedir.h
echo "#endif" >> $BLD/include/agar/config/statedir.h
echo "hdefs[\"STATEDIR\"] = \"$STATEDIR\"" >>configure.lua
if [ "${sysconfdir}" != "" ]; then
SYSCONFDIR="${sysconfdir}"
SYSCONFDIR_SPECIFIED="yes"
else
SYSCONFDIR="${PREFIX}/etc"
fi
echo "#ifndef SYSCONFDIR" > $BLD/include/agar/config/sysconfdir.h
echo "#define SYSCONFDIR \"$SYSCONFDIR\"" >> $BLD/include/agar/config/sysconfdir.h
echo "#endif" >> $BLD/include/agar/config/sysconfdir.h
echo "hdefs[\"SYSCONFDIR\"] = \"$SYSCONFDIR\"" >>configure.lua
if [ "${localedir}" != "" ]; then
LOCALEDIR="${localedir}"
LOCALEDIR_SPECIFIED="yes"
else
LOCALEDIR="${DATADIR}/locale"
fi
echo "#ifndef LOCALEDIR" > $BLD/include/agar/config/localedir.h
echo "#define LOCALEDIR \"$LOCALEDIR\"" >> $BLD/include/agar/config/localedir.h
echo "#endif" >> $BLD/include/agar/config/localedir.h
echo "hdefs[\"LOCALEDIR\"] = \"$LOCALEDIR\"" >>configure.lua
if [ "${mandir}" != "" ]; then
MANDIR="${mandir}"
MANDIR_SPECIFIED="yes"
else
MANDIR="${PREFIX}/man"
fi
echo "#ifndef MANDIR" > $BLD/include/agar/config/mandir.h
echo "#define MANDIR \"$MANDIR\"" >> $BLD/include/agar/config/mandir.h
echo "#endif" >> $BLD/include/agar/config/mandir.h
echo "hdefs[\"MANDIR\"] = \"$MANDIR\"" >>configure.lua
PACKAGE="Agar"
echo "#ifndef PACKAGE" > $BLD/include/agar/config/package.h
echo "#define PACKAGE \"$PACKAGE\"" >> $BLD/include/agar/config/package.h
echo "#endif" >> $BLD/include/agar/config/package.h
echo "hdefs[\"PACKAGE\"] = \"$PACKAGE\"" >>configure.lua
VERSION="1.5.0"
echo "#ifndef VERSION" > $BLD/include/agar/config/version.h
echo "#define VERSION \"$VERSION\"" >> $BLD/include/agar/config/version.h
echo "#endif" >> $BLD/include/agar/config/version.h
echo "hdefs[\"VERSION\"] = \"$VERSION\"" >>configure.lua
RELEASE="A Mild Breeze upon the Brow of the Dead"
echo "#ifndef RELEASE" > $BLD/include/agar/config/release.h
echo "#define RELEASE \"$RELEASE\"" >> $BLD/include/agar/config/release.h
echo "#endif" >> $BLD/include/agar/config/release.h
echo "hdefs[\"RELEASE\"] = \"$RELEASE\"" >>configure.lua
if [ "${DATADIR_SPECIFIED}" != "yes" ]; then
DATADIR="${PREFIX}/share/agar"
echo "#ifndef DATADIR" > $BLD/include/agar/config/datadir.h
echo "#define DATADIR \"$DATADIR\"" >> $BLD/include/agar/config/datadir.h
echo "#endif" >> $BLD/include/agar/config/datadir.h
echo "hdefs[\"DATADIR\"] = \"$DATADIR\"" >>configure.lua
fi;
if [ "${LOCALEDIR_SPECIFIED}" != "yes" ]; then
LOCALEDIR="${DATADIR}/locale"
echo "#ifndef LOCALEDIR" > $BLD/include/agar/config/localedir.h
echo "#define LOCALEDIR \"$LOCALEDIR\"" >> $BLD/include/agar/config/localedir.h
echo "#endif" >> $BLD/include/agar/config/localedir.h
echo "hdefs[\"LOCALEDIR\"] = \"$LOCALEDIR\"" >>configure.lua
fi;
if [ "${TTFDIR_SPECIFIED}" != "yes" ]; then
TTFDIR="${DATADIR}/fonts"
echo "#ifndef TTFDIR" > $BLD/include/agar/config/ttfdir.h
echo "#define TTFDIR \"$TTFDIR\"" >> $BLD/include/agar/config/ttfdir.h
echo "#endif" >> $BLD/include/agar/config/ttfdir.h
echo "hdefs[\"TTFDIR\"] = \"$TTFDIR\"" >>configure.lua
fi;
if [ "${INCLDIR_SPECIFIED}" != "yes" ]; then
INCLDIR="${PREFIX}/include/agar"
echo "#ifndef INCLDIR" > $BLD/include/agar/config/incldir.h
echo "#define INCLDIR \"$INCLDIR\"" >> $BLD/include/agar/config/incldir.h
echo "#endif" >> $BLD/include/agar/config/incldir.h
echo "hdefs[\"INCLDIR\"] = \"$INCLDIR\"" >>configure.lua
fi;
if [ "${DATADIR}" = "NONE" ]
then
LOCALEDIR="NONE"
echo "#ifndef LOCALEDIR" > $BLD/include/agar/config/localedir.h
echo "#define LOCALEDIR \"$LOCALEDIR\"" >> $BLD/include/agar/config/localedir.h
echo "#endif" >> $BLD/include/agar/config/localedir.h
echo "hdefs[\"LOCALEDIR\"] = \"$LOCALEDIR\"" >>configure.lua
LOCALEDIR="NONE"
TTFDIR="NONE"
echo "#ifndef TTFDIR" > $BLD/include/agar/config/ttfdir.h
echo "#define TTFDIR \"$TTFDIR\"" >> $BLD/include/agar/config/ttfdir.h
echo "#endif" >> $BLD/include/agar/config/ttfdir.h
echo "hdefs[\"TTFDIR\"] = \"$TTFDIR\"" >>configure.lua
TTFDIR="NONE"
fi
$ECHO_N "checking for a C compiler..."
$ECHO_N "checking for a C compiler..." >> config.log
if [ "$CROSS_COMPILING" = "yes" ]; then
CROSSPFX="${host}-"
else
CROSSPFX=""
fi
if [ "$CC" = "" ]; then
for i in `echo $PATH |sed 's/:/ /g'`; do
if [ -x "${i}/${CROSSPFX}cc" ]; then
if [ -f "${i}/${CROSSPFX}cc" ]; then
CC="${i}/${CROSSPFX}cc"
break
fi
elif [ -x "${i}/${CROSSPFX}gcc" ]; then
if [ -f "${i}/${CROSSPFX}gcc" ]; then
CC="${i}/${CROSSPFX}gcc"
break
fi
fi
done
if [ "$CC" = "" ]; then
echo "*"
echo "* Cannot find ${CROSSPFX}cc or ${CROSSPFX}gcc in default PATH."
echo "* You may need to set the CC environment variable."
echo "*"
echo "Cannot find ${CROSSPFX}cc or ${CROSSPFX}gcc in PATH." >> config.log
HAVE_CC="no"
echo "no"
else
HAVE_CC="yes"
echo "yes, ${CC}"
echo "yes, ${CC}" >> config.log
fi
else
HAVE_CC="yes"
echo "using ${CC}"
fi
if [ "${HAVE_CC}" = "yes" ]; then
$ECHO_N "checking whether the C compiler works..."
$ECHO_N "checking whether the C compiler works..." >> config.log
cat << 'EOT' > conftest.c
int main(int argc, char *argv[]) { return (0); }
EOT
$CC -o conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "no"
echo "no (test failed to compile)" >> config.log
HAVE_CC="no"
else
HAVE_CC="yes"
fi
if [ "${HAVE_CC}" = "yes" ]; then
if [ "${EXECSUFFIX}" = "" ]; then
EXECSUFFIX=""
for OUTFILE in conftest.exe conftest conftest.*; do
if [ -f $OUTFILE ]; then
case $OUTFILE in
*.c | *.cc | *.m | *.o | *.obj | *.bb | *.bbg | *.d | *.pdb | *.tds | *.xcoff | *.dSYM | *.xSYM )
;;
*.* )
EXECSUFFIX=`expr "$OUTFILE" : '[^.]*\(\..*\)'`
break ;;
* )
break ;;
esac;
fi
done
if [ "$EXECSUFFIX" != "" ]; then
echo "yes (it outputs $EXECSUFFIX files)"
echo "yes (it outputs $EXECSUFFIX files)" >> config.log
else
echo "yes"
echo "yes" >> config.log
fi
echo "#ifndef EXECSUFFIX" > $BLD/include/agar/config/execsuffix.h
echo "#define EXECSUFFIX \"$EXECSUFFIX\"" >> $BLD/include/agar/config/execsuffix.h
echo "#endif" >> $BLD/include/agar/config/execsuffix.h
echo "hdefs[\"EXECSUFFIX\"] = \"$EXECSUFFIX\"" >>configure.lua
else
echo "yes"
echo "yes" >> config.log
fi
fi
rm -f conftest.c conftest$EXECSUFFIX
TEST_CFLAGS=""
fi
if [ "${HAVE_CC}" = "yes" ]; then
$ECHO_N "cc: checking for compiler warning options..."
$ECHO_N "cc: checking for compiler warning options..." >> config.log
MK_COMPILE_STATUS="OK"
cat << EOT > conftest.c
int main(int argc, char *argv[]) { return (0); }
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest conftest.c " >>config.log
$CC $CFLAGS $TEST_CFLAGS -Wall -Werror -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_CC_WARNINGS="yes"
echo "#ifndef HAVE_CC_WARNINGS" > $BLD/include/agar/config/have_cc_warnings.h
echo "#define HAVE_CC_WARNINGS \"$HAVE_CC_WARNINGS\"" >> $BLD/include/agar/config/have_cc_warnings.h
echo "#endif" >> $BLD/include/agar/config/have_cc_warnings.h
echo "hdefs[\"HAVE_CC_WARNINGS\"] = \"$HAVE_CC_WARNINGS\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_CC_WARNINGS="no"
echo "#undef HAVE_CC_WARNINGS" >$BLD/include/agar/config/have_cc_warnings.h
echo "hdefs[\"HAVE_CC_WARNINGS\"] = nil" >>configure.lua
fi;
rm -f conftest.c $testdir/conftest$EXECSUFFIX
if [ "${HAVE_CC_WARNINGS}" = "yes" ]; then
TEST_CFLAGS="-Wall" # -Werror"
fi;
$ECHO_N "cc: checking for long double..."
$ECHO_N "cc: checking for long double..." >> config.log
MK_COMPILE_STATUS="OK"
cat << EOT > conftest.c
#include <stdio.h>
int
main(int argc, char *argv[])
{
long double ld = 0.1;
printf("%Lf", ld);
return (ld == 1.0);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_LONG_DOUBLE="yes"
echo "#ifndef HAVE_LONG_DOUBLE" > $BLD/include/agar/config/have_long_double.h
echo "#define HAVE_LONG_DOUBLE \"$HAVE_LONG_DOUBLE\"" >> $BLD/include/agar/config/have_long_double.h
echo "#endif" >> $BLD/include/agar/config/have_long_double.h
echo "hdefs[\"HAVE_LONG_DOUBLE\"] = \"$HAVE_LONG_DOUBLE\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_LONG_DOUBLE="no"
echo "#undef HAVE_LONG_DOUBLE" >$BLD/include/agar/config/have_long_double.h
echo "hdefs[\"HAVE_LONG_DOUBLE\"] = nil" >>configure.lua
fi;
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "cc: checking for long long..."
$ECHO_N "cc: checking for long long..." >> config.log
MK_COMPILE_STATUS="OK"
cat << EOT > conftest.c
int
main(int argc, char *argv[])
{
long long ll = -1;
unsigned long long ull = 1;
return (ll != -1 || ull != 1);
}
EOT
echo "$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c" >>config.log
$CC $CFLAGS $TEST_CFLAGS -o $testdir/conftest conftest.c 2>>config.log
if [ $? != 0 ]; then
echo "-> failed ($?)" >> config.log
MK_COMPILE_STATUS="FAIL($?)"
fi
if [ "${MK_COMPILE_STATUS}" = "OK" ]; then
echo "yes"
echo "yes" >> config.log
HAVE_LONG_LONG="yes"
echo "#ifndef HAVE_LONG_LONG" > $BLD/include/agar/config/have_long_long.h
echo "#define HAVE_LONG_LONG \"$HAVE_LONG_LONG\"" >> $BLD/include/agar/config/have_long_long.h
echo "#endif" >> $BLD/include/agar/config/have_long_long.h
echo "hdefs[\"HAVE_LONG_LONG\"] = \"$HAVE_LONG_LONG\"" >>configure.lua
else
echo "no"
echo "no" >> config.log
HAVE_LONG_LONG="no"
echo "#undef HAVE_LONG_LONG" >$BLD/include/agar/config/have_long_long.h
echo "hdefs[\"HAVE_LONG_LONG\"] = nil" >>configure.lua
fi;
rm -f conftest.c $testdir/conftest$EXECSUFFIX
$ECHO_N "cc: checking for cygwin environment..."
$ECHO_N "cc: checking for cygwin environment..." >> config.log
MK_COMPILE_STATUS="OK"
cat << EOT > conftest.c
#include <sys/types.h>
#include <sys/stat.h>
#include <windows.h>
int
main(int argc, char *argv[]) {
struct stat sb;
DWORD rv;
rv = GetFileAttributes("foo");
stat("foo", &sb);