-
Notifications
You must be signed in to change notification settings - Fork 19
/
configure
executable file
·902 lines (767 loc) · 16.9 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
#!/bin/sh
#
# ScummC configure
# Copyright (C) 2005-2006 Alban Bedel
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
#
# Get the current date
#
config_date=`date`
#
# Default config
#
debug=yes
gtk=yes
ft=yes
sdl=yes
readline=yes
CF_HOST=cf-shell.sf.net
CF_PATH=scummc/trunk
##
## Override head and tail
##
if [ "`(echo line1 ; echo line2) | tail -1 2>/dev/null`" = "line2" ] ; then
_tail() { tail -$1 2>/dev/null ; }
else
_tail() { tail -n $1 2>/dev/null ; }
fi
if [ "`(echo line1 ; echo line2) | head -1 2>/dev/null`" = "line1" ] ; then
_head() { head -$1 2>/dev/null ; }
else
_head() { head -n $1 2>/dev/null ; }
fi
##
## Save the flags for --reconfigure
##
CONFIGURE_FLAGS=
for a in "$@" ; do
a=`echo "$a" | sed "s/'/'\"'\"'/g"`
CONFIGURE_FLAGS="$CONFIGURE_FLAGS '$a'"
done
##
## Get the host name, we need it for some options
##
[ -z "$HOST" ] && HOST=`uname -n | cut -d . -f 1`
##
## Parse the command line options
##
while [ -n "$1" ] ; do
case "$1" in
--cc)
CC=$2
shift
;;
--make)
MAKE=$2
shift
;;
--bison)
BISON=$2
shift
;;
--xsltproc)
XSLTPROC=$2
shift
;;
--target)
TARGET=$2
shift
;;
--hostname)
HOST=$2
shift
;;
--pkg-config)
PKGCONFIG=$2
shift
;;
--pkg-config-libdir)
export PKG_CONFIG_LIBDIR=$2
shift
;;
--disable-gtk)
gtk=no
;;
--disable-freetype)
ft=no
;;
--disable-sdl)
sdl=no
;;
--disable-readline)
readline=no
;;
--cflags)
CFLAGS=$2
shift
;;
--ldflags)
LDFLAGS=$2
shift
;;
--debug)
debug=yes
;;
--release)
debug=no
;;
--buildroot)
BUILDROOT=$2
shift
;;
--pager)
PAGER=$2
shift
;;
--md5sum)
MD5SUM=$2
shift
;;
--doxygen)
DOXYGEN=$2
shift
;;
--cf-user)
CF_USER=$2
shift
;;
--cf-host)
CF_HOST=$2
shift
;;
--cf-path)
CF_PATH=$2
shift
;;
--set-default-target)
shift
if [ -z "$1" ] ; then
echo "You must specify a new default target."
exit 1
fi
cfg=`sed 's,^ *#.*,,; s,?=,=,' config.$HOST.mak 2> /dev/null`
if [ $? -ne 0 ] ; then
echo "Failed to parse config.$HOST.mak."
exit 1
fi
eval $cfg
if [ "$TARGET" = "$1" ] ; then
echo "$1 is already the default target."
exit
fi
found=false
for t in "$BUILDROOT"/*/config.mak ; do
if [ "$t" = "$BUILDROOT/$1/config.mak" ] ; then
found=true
break
fi
done
if $found ; then
sed "s,TARGET?=.*,TARGET?=$1," config.$HOST.mak > config.$HOST.mak.new
mv config.$HOST.mak.new config.$HOST.mak
echo "Default target set to $1."
exit
else
echo "Target '$1' doesn't exist."
exit 1
fi
;;
--reconfigure)
cfg=`sed 's,^ *#.*,,; s,?=,=,' config.$HOST.mak 2> /dev/null`
if [ $? -ne 0 ] ; then
echo "Failed to parse config.$HOST.mak."
exit 1
fi
eval $cfg
shift
eval $0 $CONFIGURE_FLAGS $@
exit
;;
-h|--help)
cat <<EOF
Usage: $0 [OPTIONS]...
-h, --help display this help and exit
--cc COMPILER use this compiler
--make MAKE use this make
--bison BISON use this bison
--xsltproc XSLTPROC use this XSLT processor
--pager PAGER use this pager to show the logs
--md5sum MD5SUM use this md5 sum
--doxygen DOXYGEN use this doxygen
--target TARGET override the target system
--hostname NAME override the hostname
--debug configure a debug target
--release configure a release target
--buildroot DIR set the build directory
--srcdir DIR set the source directory
--cflags FLAGS set the CFLAGS
--ldflags FLAGS set the LDFLAGS
--disable-gtk disable gtk
--disable-freetype disable freetype
--disable-sdl disable SDL
--pkg-config PKGCONFIG use this pkg-config
--pkg-config-libdir DIR set \$PKG_CONFIG_LIBDIR, useful for cross compile
--cf-user NAME set the username to use for the compile farm
--cf-host HOST override the compile farm host
--cf-path PATH set the path to the sources on the compile farm,
the path must be relatif to home.
--set-default-target TRG change the default make target
--reconfigure OPTS re-run this script with the last arguments.
optionally appending some others.
EOF
exit
;;
*)
echo "Unknown command line option: $1"
exit 1
;;
esac
shift
done
##
## Let's configure
##
echo
echo "Configuring ScummC on $HOST"
echo
## We start by looking at the tools needed for the build
## Look on what we are running, we need that later
hostsys=`uname -s | tr [A-Z] [a-z]`
echo "Host system: $hostsys"
## And from where
[ -z "$SRCDIR" ] && SRCDIR=`pwd`
echo "Sources: $SRCDIR"
##
## Find the compiler
##
if [ -z "$CC" ] ; then
## Try gcc first some system don't have cc
if type gcc 2> /dev/null >&2 ; then
CC=gcc
elif type cc 2> /dev/null >&2 ; then
CC=cc
else
echo "Failed to find the C compiler, use --cc or set \$CC."
exit 1
fi
else
type $CC 2> /dev/null >&2
if [ $? -ne 0 ] ; then
echo "Can't run $CC"
exit 1
fi
fi
## Try to find what it is for a compiler
$CC -v 2> /dev/null >&2
if [ $? -ne 0 ] ; then
echo "Failed to run compiler $CC."
exit 1
fi
tmp=`$CC -v 2>&1 | grep -Eo '[[:alnum:]]+ version [[:alnum:].]+' | _head 1`
## Pickup the compiler name and version
ccname=`echo "$tmp" | cut -d ' ' -f 1`
ccver=`echo "$tmp" | cut -d ' ' -f 3`
echo "Compiler: $CC ($ccname $ccver)"
##
## Check the compiler version
##
case "$ccname" in
gcc)
serie=`echo $ccver | cut -d . -f 1`
major=`echo $ccver | cut -d . -f 2`
minor=`echo $ccver | cut -d . -f 3`
if [ $serie -lt 2 ] ; then
echo "GCC $ccver is way too old. Get at least 2.95.3."
exit 1
elif [ $serie -eq 2 ] ; then
if [ $major -lt 95 ] ; then
echo "GCC $ccver is way too old. Get at least 2.95.3."
exit 1
elif [ $minor -lt 3 ] ; then
echo "GCC $ccver is too old. Get at least 2.95.3."
exit 1
fi
fi
;;
esac
##
## Look for the target
##
if [ -z "$TARGET" ] ; then
## Some compiler can tell their target
case "$ccname" in
gcc)
TARGET=`$CC -dumpmachine 2> /dev/null`
;;
tcc)
## Assume i386 with tcc
TARGET="i386-unknown-$hostsys"
;;
esac
## Otherwise take the host as target
if [ -z "$TARGET" ] ; then
TARGET=`uname -m`"-unknown-$hostsys"
fi
fi
# Workaround for native mingw32
[ "$TARGET" = "mingw32" ] && TARGET=i686-pc-mingw32
cpu=`echo "$TARGET" | cut -d - -f 1`
sys=`echo "$TARGET" | cut -d - -f 3`
[ -z "$sys" ] && sys=`echo "$TARGET" | cut -d - -f 2`
if [ -z "$cpu" -o -z "$sys" ] ; then
echo "Invalid target: $TARGET"
exit 1
fi
##
## Define the cpu related stuff
##
case "$cpu" in
i[3-9]86|x86_64|alpha)
endian=little
;;
ppc|powerpc|sparc)
endian=big
;;
*)
echo "Unknown cpu: $cpu"
exit 1
;;
esac
if [ "$endian" = "little" ] ; then
little_endian_def='#define IS_LITTLE_ENDIAN 1'
big_endian_def='#undef IS_BIG_ENDIAN'
else
little_endian_def='#undef IS_LITTLE_ENDIAN'
big_endian_def='#define IS_BIG_ENDIAN 1'
fi
##
## Define the system related stuff
##
case $sys in
*mingw*)
sys=mingw
EXESUF=.exe
;;
*cygwin*)
sys=cygwin
EXESUF=.exe
;;
esac
sys_def='#define IS_'`echo $sys | tr [a-z] [A-Z] | tr -c -d [A-Z]`' 1'
if [ "$debug" = 'yes' ] ; then
TARGET="$cpu-$sys-$ccname-$ccver-debug"
else
TARGET="$cpu-$sys-$ccname-$ccver-release"
fi
echo "Target system: $TARGET ($endian endian)"
## Set the base C/LDFLAGS
## We need -I. for config.h and the other generated includes
CFLAGS="$CFLAGS -Wall"
LDFLAGS="$LDFLAGS -lm"
if [ $debug = "yes" ] ; then
CFLAGS="$CFLAGS -g -I. -I$SRCDIR"
LDFLAGS="$LDFLAGS -g"
else
CFLAGS="$CFLAGS -O3 -I. -I$SRCDIR"
fi
##
## Look for make, BSD make will fail with -version
##
## We need at least 3.80
##
if [ -z "$MAKE" ] ; then
if make -version 2> /dev/null >&2 ; then
MAKE=make
elif gmake -version 2> /dev/null >&2 ; then
MAKE=gmake
else
echo "Failed to find make"
exit 1
fi
else
type $MAKE 2> /dev/null >&2
if [ $? -ne 0 ] ; then
echo "Can't run $MAKE"
exit 1
fi
fi
makever=`$MAKE -version | _head 1 | sed 's/,.*//'`
echo "$makever" | grep '^GNU Make' 2> /dev/null >&2
if [ $? -ne 0 ] ; then
echo "GNU Make is required."
exit 1
fi
makever=`echo "$makever" | sed 's/GNU Make *//; s/version *//; s/ *$//'`
major=`echo $makever | cut -d . -f 1`
minor=`echo $makever | cut -d . -f 2`
if [ $major -lt 3 ] ; then
echo "GNU Make $makever is way too old, at least 3.80 is required."
exit 1
elif [ $major -eq 3 -a $minor -lt 80 ] ; then
echo "GNU Make $makever is too old, at least 3.80 is required."
exit 1
fi
echo "GNU Make: $MAKE ($makever)"
##
## Look for bison
##
## TODO: Find minimal version
##
if [ -z "$BISON" ] ; then
if type bison 2> /dev/null >&2 ; then
BISON=bison
else
echo "Failed to find bison."
exit 1
fi
else
type $BISON 2> /dev/null >&2
if [ $? -ne 0 ] ; then
echo "Can't run $BISON"
exit 1
fi
fi
bisonver=`$BISON --version | _head 1 | tr -c -d '[[:digit:].]'`
bisonver_major="`echo $bisonver | sed 's/\..*//'`"
bisonver_minor="`echo $bisonver | sed 's/[0-9]*\.//; s/\..*//; s/[[:alpha:]]*//g'`"
if [ $bisonver_major -lt 2 ] || [ $bisonver_major -eq 2 -a $bisonver_minor -lt 7 ] ; then
echo "Bison ($bisonver) is too old, version 2.7 is required."
exit 1
else
echo "Bison: $BISON ($bisonver)"
fi
if [ $debug = "yes" ] ; then
BISONFLAGS="$BISONFLAGS -d -v"
else
BISONFLAGS="$BISONFLAGS -d"
fi
##
## XSLT processor for the help messages
##
if [ -z "$XSLTPROC" ] ; then
if type xsltproc 2> /dev/null >&2 ; then
XSLTPROC=xsltproc
fi
else
type $XSLTPROC 2> /dev/null >&2 || XSLTPROC=
fi
[ -z "$XSLTPROC" ] && echo "XSLT processor: no" || \
echo "XSLT processor: $XSLTPROC"
##
## Pager for the log viewer
##
if [ -z "$PAGER" ] ; then
if type less 2> /dev/null >&2 ; then
PAGER=less
elif type more 2> /dev/null >&2 ; then
PAGER=more
fi
else
type $PAGER 2> /dev/null >&2 || PAGER=
fi
[ -z "$PAGER" ] && echo "Pager: no" || echo "Pager: $PAGER"
##
## md5sum for the tests
##
if [ -z "$MD5SUM" ] ; then
if type md5sum 2> /dev/null >&2 ; then
MD5SUM=md5sum
elif type md5 2> /dev/null >&2 ; then
MD5SUM=md5
fi
else
type $MD5SUM 2> /dev/null >&2 || MD5SUM=
fi
[ -z "$MD5SUM" ] && echo "Md5sum: no" || echo "Md5sum: $MD5SUM"
##
## Enable the compile farm support
##
if [ -n "$CF_USER" ] ; then
echo "Compile farm: ${CF_USER}@${CF_HOST}:${CF_PATH}"
else
echo "Compile farm: no"
fi
##
## Doxygen
##
if [ -z "$DOXYGEN" ] ; then
if type doxygen 2> /dev/null >&2 ; then
DOXYGEN=doxygen
fi
else
type $DOXYGEN 2> /dev/null >&2 || DOXYGEN=
fi
[ -z "$DOXYGEN" ] && echo "Doxygen: no" || echo "Doxygen: $DOXYGEN"
##
## Setup the build directory
##
[ -z "$BUILDROOT" ] && BUILDROOT="build.$HOST"
BUILDDIR="$BUILDROOT/$TARGET"
echo
echo "Setting up build directory $BUILDDIR"
echo
mkdir -p "$BUILDDIR"
if [ $? -ne 0 ] ; then
echo "Failed to create build directory $BUILDDIR"
exit 1
fi
##
## Check if we can run the binaries built
##
cat <<EOF > $BUILDDIR/test.c
int main(void) {
return 0;
}
EOF
$CC -o $BUILDDIR/test.bin $CFLAGS $BUILDDIR/test.c 2> /dev/null && \
$BUILDDIR/test.bin 2> /dev/null
if [ $? -eq 0 ] ; then
CAN_EXEC=yes
echo "Can execute built binaries: yes"
else
CAN_EXEC=no
echo "Can execute built binaries: no"
fi
##
## Check if we can run the test suite
##
if [ -n "$MD5SUM" -a "$CAN_EXEC" = yes ] ; then
CAN_TEST=yes
echo "Can run the tests: yes"
else
CAN_TEST=no
echo "Can run the tests: no"
fi
cat > config.$HOST.mak <<EOF
## ScummC config.$HOST.mak
## This file is generated, don't edit.
## $config_date
HOST=$HOST
CONFIGURE_FLAGS="$CONFIGURE_FLAGS"
SRCDIR?=$SRCDIR
BUILDROOT?=$BUILDROOT
TARGET?=$TARGET
MAKE?=$MAKE
PAGER?=$PAGER
MD5SUM?=$MD5SUM
DOXYGEN?=$DOXYGEN
CF_USER?=$CF_USER
CF_HOST?=$CF_HOST
CF_PATH?="$CF_PATH"
EOF
## Put the makefile in there
ln -sf "$SRCDIR/Makefile.target" "$BUILDDIR/Makefile"
if [ $? -ne 0 ] ; then
echo "Failed to link Makefile.target to $BUILDDIR/Makefile"
exit 1
fi
##
## Now look for the optional libs
##
##
## Check if we run on gnu libc
##
cat <<EOF | $CC -E -o /dev/null - 2> /dev/null
#include <stdlib.h>
#ifndef __GLIBC__
#error "Not glibc"
#endif
EOF
if [ $? -eq 0 ] ; then
CFLAGS="$CFLAGS -D_GNU_SOURCE"
echo "GNU C Library: yes"
else
echo "GNU C Library: no"
fi
##
## Check if we have asprintf()
##
cat <<EOF > $BUILDDIR/test.c
#include <stdio.h>
int main(void) {
char* str;
return asprintf(&str,"test");
}
EOF
$CC -o $BUILDDIR/test.bin $CFLAGS $BUILDDIR/test.c 2> /dev/null
if [ $? -eq 0 ] ; then
asprintf=yes
asprintf_def='#define HAVE_ASPRINTF 1'
else
asprintf=no
asprintf_def='#undef HAVE_ASPRINTF'
fi
rm -f $BUILDDIR/test.c $BUILDDIR/test.bin
echo "asprintf(): $asprintf"
##
## Get pkg-config
##
[ -z "$PKGCONFIG" ] && PKGCONFIG=pkg-config
##
## GTK+ 2.4
##
gtk_def='#undef HAVE_GTK'
if [ "$gtk" != "no" ] ; then
gtk=no
if ( $PKGCONFIG --exists gtk+-2.0 ) 2> /dev/null ; then
gtkver=`( $PKGCONFIG --modversion gtk+-2.0 ) 2> /dev/null`
if $PKGCONFIG --atleast-version=2.4 gtk+-2.0 ; then
gtk=yes
gtk_def='#define HAVE_GTK 1'
gtk_cflags=`$PKGCONFIG --cflags gtk+-2.0`
gtk_ldflags=`$PKGCONFIG --libs gtk+-2.0`
echo "Gtk+2.4: yes ($gtkver)"
else
echo "Gtk+2.4: no ($gtkver)"
fi
else
echo "Gtk+2.4: no"
fi
else
echo "Gtk+2.4: disabled"
fi
##
## Freetype
##
## TODO: Find minimal version
##
ft_def='#undef HAVE_FT'
if [ "$ft" != "no" ] ; then
ft=no
ftver=`( $PKGCONFIG --modversion freetype2 ) 2> /dev/null`
if [ $? -eq 0 ] ; then
ft=yes
ft_def='#define HAVE_FT 1'
ft_cflags=`$PKGCONFIG --cflags freetype2`
ft_ldflags=`$PKGCONFIG --libs freetype2`
echo "Freetype: yes ($ftver)"
else
echo "Freetype: no"
fi
else
echo "Freetype: disabled"
fi
##
## SDL
##
sdl_def='#undef HAVE_SDL'
if [ "$sdl" != "no" ] ; then
sdl=no
sdlver=`( $PKGCONFIG --modversion sdl ) 2> /dev/null`
if [ $? -eq 0 ] ; then
sdl=yes
sdl_def='#define HAVE_SDL 1'
sdl_cflags=`$PKGCONFIG --cflags sdl`
sdl_ldflags=`$PKGCONFIG --libs sdl`
echo "SDL: yes ($sdlver)"
else
echo "SDL: no"
fi
else
echo "SDL: disabled"
fi
##
## readline
##
readline_def='#undef HAVE_READLINE'
if [ "$readline" != "no" ] ; then
readline=no
cat <<EOF > $BUILDDIR/test.c
#include <stdlib.h>
#include <stdio.h>
#include <readline/readline.h>
int main(void) {
char* str = readline("prompt");
return 0;
}
EOF
$CC -o $BUILDDIR/test.bin $CFLAGS $BUILDDIR/test.c \
$LDFLAGS -lreadline -ltermcap 2> /dev/null
if [ $? -eq 0 ] ; then
readline=yes
readline_def='#define HAVE_READLINE 1'
readline_cflags=
readline_ldflags='-lreadline -ltermcap'
echo "realine: yes"
else
echo "readline: no"
fi
else
echo "readline: disabled"
fi
##
## Write out the whole config
##
echo
echo "Writing $BUILDDIR/config.mak"
cat > "$BUILDDIR/config.mak" <<EOF
## ScummC $BUILDDIR/config.mak
## This file is generated, don't edit.
## $config_date
HOST=$HOST
TARGET=$TARGET
SRCDIR=$SRCDIR
BUILDDIR=$BUILDDIR
CC=$CC
MAKE=$MAKE
BISON=$BISON
XSLTPROC=$XSLTPROC
EXESUF=$EXESUF
DEBUG=$debug
CAN_EXEC=$CAN_EXEC
CAN_TEST=$CAN_TEST
CFLAGS=$CFLAGS
LDFLAGS=$LDFLAGS
BISONFLAGS=$BISONFLAGS
HAVE_GTK=$gtk
GTK_CFLAGS=$gtk_cflags
GTK_LDFLAGS=$gtk_ldflags
HAVE_FT=$ft
FT_CFLAGS=$ft_cflags
FT_LDFLAGS=$ft_ldflags
HAVE_SDL=$sdl
SDL_CFLAGS=$sdl_cflags
SDL_LDFLAGS=$sdl_ldflags
HAVE_READLINE=$readline
READLINE_CFLAGS=$readline_cflags
READLINE_LDFLAGS=$readline_ldflags
EOF
echo "Writing $BUILDDIR/config.h"
cat > "$BUILDDIR/config.h" <<EOF
//# ScummC $BUILDDIR/config.h
//# This file is generated, don't edit.
//# $config_date
// Target system
$sys_def
// Target endianess
$little_endian_def
$big_endian_def
// allocate printf
$asprintf_def
// GTK
$gtk_def
// Freetype
$ft_def
// SDL
$sdl_def
// READLINE
$readline_def
EOF
echo
echo "Configured ScummC for $TARGET,"
echo "you can now run '$MAKE' to build it."
echo