-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathconfigure.ac
818 lines (697 loc) · 22.3 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
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
### configure.ac for STklos
###
### Author: Erick Gallesio [eg@unice.fr]
### Creation date: 28-Dec-1999 21:19 (eg)
AC_PREREQ([2.69])
AC_INIT([stklos],[2.10]) # Set also VERSION_STATUS to stable when changing version
VERSION_STATUS=unstable # and reset it to unstable after releasing
#
# Grab configure options before it is too late
#
CONF_OPT=""; HAS_CC=""; HAS_CFLAGS=""; HAS_LDFLAGS=""; HAS_CPPFLAGS=""
PDFDIR="";HTMLDIR=""; DOCDIR=""; LIBDIR=""; DATADIR="";
for opt in "$@"
do
case $opt in
CC=*) HAS_CC=1 ;;
CFLAGS=*) HAS_CFLAGS=1;;
LDLAGS=*) HAS_LDLAGS=1;;
CPPFLAGS=*) HAS_CPPFLAGS=1;;
--docdir=*) DOCDIR=${docdir};;
--pdfdir=*) PDFDIR=${pdfdir};;
--htmldir=*) HTMLDIR=${htmldir};;
--libdir=*) LIBDIR=${libdir};;
--datadir=*) DATADIR=${datadir};;
esac
if test "X$opt" = "X--no-create" -o "X$opt" = "X--no-recursion"
then
# These options are added when configure is older than configure.ac
true
else
CONF_OPT="$CONF_OPT \\\"$opt\\\""
fi
done
# export CC, CFLAGS and all for configure scripts launched by this configure script
export CC CFLAGS LDFLAGS CPPFLAGS
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR(src/stklos.c)
AC_CONFIG_HEADERS(src/stklosconf.h)
AC_CANONICAL_HOST
### Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_AWK
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_RANLIB
# AC_PROG_LEX
AC_PROG_MKDIR_P
AC_CHECK_PROG(PKGCONFIG, pkg-config, "pkg-config", "false")
AC_CHECK_PROG(ASCIIDOCTOR, asciidoctor, "asciidoctor", "../adoc-fake.sh")
if test "$ASCIIDOCTOR" = "asciidoctor"
then
REPORT_ASCIIDOCTOR="yes (since Asciidoctor is installed)"
else
REPORT_ASCIIDOCTOR="no (install Asciidoctor to rebuild documentation)"
fi
### Checks for header files.
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h malloc.h memory.h netdb.h netinet/in.h nlist.h stdlib.h string.h strings.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h execinfo.h])
### Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_C_BIGENDIAN
### Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FORK
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_FUNC_MKTIME
AC_FUNC_REALLOC
AC_FUNC_STRCOLL
AC_FUNC_STRTOD
AC_CHECK_FUNCS([atexit dup2 endpwent floor getcwd gethostbyaddr gethostbyname gethostname getpass clock_gettime glob inet_ntoa isascii memchr memmove memset mkdir modf putenv rmdir select socket sqrt strcasecmp strchr strerror strrchr strstr strtoul utimensat])
AC_CHECK_FUNCS(backtrace, , AC_CHECK_LIB(execinfo, backtrace))
### ======================================================================
### Various stuff done by hand
### ======================================================================
### Initialize prefix
if test X$prefix = XNONE ;then prefix=$ac_default_prefix; fi
### Determine the options necessary for dynamic loading (even if disabled later)
if test X$LD = X
then
LD="ld"
fi
# DLLIBS is used for dynamically loaded libraries on broken systems
DLLIBS=""
eval `env CC=$CC LD=$LD /bin/sh ./utils/shlib-options`
case $OS in
SUNOS)
CFLAGS="$CFLAGS -DSOLARIS";
LIBS="$LIBS -lsocket -lrt -lnsl -lpthread"
;;
UNKNOWN)
echo ""
echo "**** STklos has no support for your system (`uname -s`)."
echo "**** Please modify the script \"utils/shlib-options\" to add support"
echo "**** for your system (it's easy) and rerun the configure script."
echo "**** Thanks for sending your modifications to <bugs _at_ stklos.net>"
exit 1
;;
esac
# Manage standard options --docdir, --pdfdir, --htmldir
# By default, autoconf uses
# docdir = ${prefix}/share/doc/stklos
# pdfdir = ${docdir}
# htmldir = ${docdir}
# To permit to have several versions of STklos installed, and to avoid
# cluttering the doc directory, we use
# docdir = ${prefix}/share/doc/stklos/${VERSION}
# pdfdir = ${docdir}/pdf
# htmldir = ${docdir}/html
# Of course, if the user specify any option, we use the value he/she gave
if test "X$DOCDIR" = "X" ; then
# user has not given a "--docdir" option. Use our own convention
docdir="${prefix}/share/doc/${PACKAGE_TARNAME}/${VERSION}"
DOCDIR=${docdir}
fi
if test "X$PDFDIR" = "X" ; then
# user has not given a "--pdfdir" option. Use our own convention
pdfdir="${docdir}/pdf"
fi
if test "X$HTMLDIR" = "X" ; then
# user has not given a "--htmldir" option. Use our own convention
htmldir="${docdir}/html"
fi
# Manage standard options --libdir and --datadir
# If the user doesn't specify these option, we fix
# libdir to ${prefix}/lib/
# datadir to ${prefix}/share
# Otherwise, we take the user provided values.
#
# In any case, we will place our files in the stklos/${VERSION} subdir
if test "X$LIBDIR" = "X" ; then
# user has not given a "--libdir" option. Use ${prefix}/lib/stklos/${VERSION}
libdir="${prefix}/lib/${PACKAGE_TARNAME}/${VERSION}"
fi
if test "X$DATADIR" = "X" ; then
# user has not given a "--datadir" option. Use ${prefix}/share/stklos/${VERSION}
datadir="${prefix}/share/${PACKAGE_TARNAME}/${VERSION}"
fi
### Initialize the extra conf file in src
PREFIX=${prefix}
SCMDIR=${datadir}
EXECDIR=${libdir}
INCLUDEDIR=${includedir}
### Determine the kind of the machine which is running this script
BUILD_OS=$os-$version
BUILD_ARCH=`uname -m`
OS_NAME=$OS
case $OS in
LINUX)
v=`echo $version | sed -e 's/^\([[0-9]]*\)\.\([[0-9\]]*\).*/\1_\2/'`
;;
DARWIN)
v=`echo $version | sed -e 's/^\([[0-9]]*\).*/\1/'`
;;
*)
v=`echo $version | sed -e 's/[[^0-9]]/_/g'`
esac
OS_NAME_VERSION=${OS}_$v;
###
### Checks for libraries.
###
SYST_LIBS=""
COMP_LIBS=""
SYST_LIBS_SHOW=""
### Check for dynamic loading
AC_CHECK_FUNC(dlopen, HAVE_DLOPEN="yes",
AC_CHECK_LIB(dl, dlopen, LIBS="-ldl $LIBS"&&HAVE_DLOPEN="yes"))
if test "X$HAVE_DLOPEN" = "Xyes"
then
AC_DEFINE(HAVE_DLOPEN, 1, [System provides dlopen])
fi
###
### To thread or not to thread?
###
AC_CHECK_LIB(pthread, pthread_create, deflt_threads=pthreads, deflt_threads=none)
AC_ARG_ENABLE(threads,
[AS_HELP_STRING([--enable-threads],
[enable Posix threads support (enabled by default)])],
THREADS=$enableval,
THREADS=$deflt_threads)
AC_LANG(C)
### Now look at what threads we want
case "$THREADS" in
no | none | single)
THREADS=none
STR_THREADS="no"
AC_DEFINE(THREADS_NONE, [], [No thread support])
;;
posix | pthreads | yes)
### Check for pthreads
AC_CHECK_LIB(pthread, pthread_create, LIBS="-lpthread $LIBS",
[AC_MSG_ERROR([Missing PThread library])])
THREADS=pthreads
STR_THREADS="yes"
AC_DEFINE(THREADS_PTHREADS, [], [PThread support])
AC_CHECK_FUNCS([pthread_cancel])
;;
*)
AC_MSG_ERROR([Unknown thread system: $THREADS])
;;
esac
#XX
#XX ### Add the options _REENTRANT and GC_LINUX_THREADS if we are on Linux
#XX case "$THREADS" in
#XX none) true ;;
#XX *) case `uname -s` in
#XX Linux*) STKCFLAGS="-D_REENTRANT=1 -DGC_LINUX_THREADS=1";;
#XX esac
#XX esac
#XX
### Automake nightmare
AM_CONDITIONAL(PTHREADS, test "$THREADS" = pthreads)
AM_CONDITIONAL(NO_THREAD, test "$THREADS" = none)
# ----------------------------------------------------------------------
# GC support
# ----------------------------------------------------------------------
echo "*****"
echo "***** GC support"
echo "*****"
# Try to determine if libgc is installed
if ${PKGCONFIG} --exists bdw-gc ;then
HAVE_GC="yes"
else
AC_CHECK_LIB(gc, GC_malloc, HAVE_GC="yes", HAVE_GC="no", $LIBS)
fi
# Test if the user wants to force the use of our GC lib
AC_ARG_WITH(provided-gc,
[ --with-provided-gc use the provided Boehm GC library],
PROV_GC="$withval", PROV_GC="no")
if test "$HAVE_GC" = "no" -o "$PROV_GC" = "yes"
then
echo "... Configuring libgc"
(cd gc; ./configure --prefix=$prefix --enable-static \
--includedir=$prefix/include/stklos \
--enable-threads=$THREADS) || { echo "Cannot configure the GC"; exit; }
GC=gc
GCINC='-I$(BASEDIR)/gc/include'
GCLIB="../gc/.libs/libgc.a"
COMP_LIBS="libgc $COMP_LIBS"
else
echo "... Using system libgc library"
GC=""
if $PKGCONFIG --exists bdw-gc ;then
GCINC=$($PKGCONFIG bdw-gc --cflags)
GCLIB=$($PKGCONFIG bdw-gc --libs)
GCVER=$(${PKGCONFIG} --modversion bdw-gc)
else
GCINC=""
GCLIB="-lgc"
fi
DLLIBS="$DLLIBS -lgc"
AC_DEFINE(HAVE_GC, 1, [Use system GC])
SYST_LIBS="libgc $SYST_LIBS"
SYST_LIBS_SHOW="gc ($GCVER) $SYST_LIBS_SHOW"
fi
# ----------------------------------------------------------------------
# GMP support
# ----------------------------------------------------------------------
echo "*****"
echo "***** GMP support"
echo "*****"
# Try to determine if libgmp is installed
if ${PKGCONFIG} --exists gmp ;then
HAVE_GMP="yes"
GMPKG="present"
else
# check for GMP pre-version 3.0
AC_CHECK_LIB(gmp, mpz_init_set, HAVE_GMP="yes", HAVE_GMP="no")
# check for GMP version post 3.0
if test "$HAVE_GMP" = "no" ;then
AC_CHECK_LIB(gmp, __gmpz_init_set, HAVE_GMP="yes", HAVE_GMP="no")
fi
fi
# Test if the user wants to force the use of our GMP lib
# (2 names available for that --with-provided-bignum or (legacy) --with-gmp-light
AC_ARG_WITH(provided-bignum,
[ --with-provided-bignum use the provided Bignum (GMPlite) library],
PROV_GMP="$withval", PROV_GMP="no")
if test "$PROV_GMP" = "no" ;then
AC_ARG_WITH(gmp-light,
[ --with-gmp-light a synonym for --with-provided-bignum],
PROV_GMP="$withval", PROV_GMP="no")
fi
if test "$HAVE_GMP" = "no" -o "$PROV_GMP" = "yes"
then
echo "... Configuring libgmp"
(cd gmp; CC=${CC} CFLAGS="${CFLAGS} -I../src -DFOR_STKLOS=1" ./configure \
--prefix=$prefix) || { echo "Cannot configure the GMP"; exit; }
GMP=gmp
GMPINC='-I$(BASEDIR)/gmp'
GMPLIB="../gmp/.libs/libgmp.a"
COMP_LIBS="libgmp $COMP_LIBS"
else
echo "... Using system libgmp library"
GMP=""
if $PKGCONFIG --exists gmp ;then
GMPINC="$($PKGCONFIG --cflags gmp)"
GMPLIB="$($PKGCONFIG --libs gmp)"
GMPVER=$(${PKGCONFIG} --modversion gmp)
else
GMPINC=""
GMPLIB="-lgmp"
fi
DLLIBS="$DLLIBS $GMPLIB"
AC_DEFINE(HAVE_GMP, 1, [Use system GMP])
SYST_LIBS="libgmp $SYST_LIBS"
SYST_LIBS_SHOW="gmp ($GMPVER) $SYST_LIBS_SHOW"
fi
# ----------------------------------------------------------------------
# PCRE2 support
# ----------------------------------------------------------------------
echo "*****"
echo "***** Regexp support"
echo "*****"
# Try to determine if libpcre2 is installed
if ${PKGCONFIG} --exists libpcre2-8 libpcre2-posix ;then
HAVE_PCRE2="yes"
PCRE2PKG="present"
else
AC_CHECK_LIB(pcre2-8, pcre2_config_8, HAVE_PCRE2="yes", HAVE_PCRE2="no", $LIBS)
fi
# Test if the user wants to force the use of our PCRE2 lib
AC_ARG_WITH(provided-regexp,
[ --with-provided-regexp use the provided Regexp (PCRE2) library],
PROV_PCRE2="$withval", PROV_PCRE2="no")
if test "$HAVE_PCRE2" = "no" -o "$PROV_PCRE2" = "yes"
then
echo "... Configuring libpcre2"
(cd pcre2; ./configure --prefix=$prefix --disable-shared --disable-cpp) || \
{ echo "Cannot configure PCRE2"; exit; }
PCRE2=pcre2
PCRE2INC="-I../pcre2/src"
PCRE2LIB="../pcre2/.libs/libpcre2-posix.a ../pcre2/.libs/libpcre2-8.a"
COMP_LIBS="libpcre2 $COMP_LIBS"
else
echo "... Using system libpcre2 library"
if $PKGCONFIG --exists libpcre2-8 libpcre2-posix ;then
PCRE2INC="$($PKGCONFIG --cflags libpcre2-8 libpcre2-posix) "
PCRE2LIB="$($PKGCONFIG --libs libpcre2-8 libpcre2-posix)"
PCRE2VER=$(${PKGCONFIG} --modversion libpcre2-posix)
else
PCRE2INC=""
PCRE2LIB="-lpcre-8 -lpcre2-posix"
fi
DLLIBS="$DLLIBS $PCRE2LIB"
AC_DEFINE(HAVE_PCRE2, 1 , [We use our version of pcre])
SYST_LIBS="libpcre2 $SYST_LIBS"
SYST_LIBS_SHOW="pcre2 ($PCRE2VER) $SYST_LIBS_SHOW"
fi
# ----------------------------------------------------------------------
# FFI support
# ----------------------------------------------------------------------
echo "*****"
echo "***** FFI support"
echo "*****"
# Check if the user wants FFI included or not.
# The autoconf variable AVOID_FFI will be set here to either "yes" or "no".
# *** If it's set to "no", then the --with-provided-ffi won't even be
# verified.
AC_ARG_ENABLE(ffi,
[AS_HELP_STRING([--enable-ffi],
[enable FFI support (enabled by default)])])
case "$enable_ffi" in
no|false|0) AVOID_FFI="yes";;
*) AVOID_FFI="no" ;;
esac
if test "$AVOID_FFI" = "no"
then
# Try to determine if libffi is installed
if ${PKGCONFIG} --exists libffi ;then
HAVE_FFI="yes"
else
AC_CHECK_LIB(ffi, ffi_prep_cif, HAVE_FFI="yes", HAVE_FFI="no", $LIBS)
fi
# Test if the user wants to force the use of our FFI lib
AC_ARG_WITH(provided-ffi,
[ --with-provided-ffi use the provided FFI library],
PROV_FFI="$withval", PROV_FFI="no")
if test "$HAVE_FFI" = "no" -o "$PROV_FFI" = "yes"
then
echo "... Configuring libffi"
(cd ffi; ./configure --disable-structs --disable-raw-api --disable-shared \
--prefix=$prefix) || { echo "Cannot configure libffi"; exit; }
FFI="ffi"
FFIINC="-I../ffi/$(./config.guess)/include"
FFILIB="../ffi/$(./config.guess)/.libs/libffi.a"
COMP_LIBS="libffi $COMP_LIBS"
else
echo "... Using system libffi library"
FFI=""
if $PKGCONFIG --exists libffi ;then
FFIINC=$($PKGCONFIG libffi --cflags)
FFILIB=$($PKGCONFIG libffi --libs)
FFIVER=$($PKGCONFIG --modversion libffi)
else
FFIINC="-I/usr/include/ffi"
FFILIB="-lffi"
DLLIBS="$DLLIBS $FFILIB"
fi
DLLIBS="$DLLIBS $FFILIB"
SYST_LIBS="libffi $SYST_LIBS"
SYST_LIBS_SHOW="ffi ($FFIVER) $SYST_LIBS_SHOW"
fi
STR_FFI="yes"
# The following "HAVE_FFI" is defined so the compiler will actually
# compile the code for it.
AC_DEFINE(HAVE_FFI, 1, [System provides FFI])
else
echo "... NOT using FFI"
STR_FFI="no"
fi
# ----------------------------------------------------------------------
# Control fixnum and flonum parameters
# ----------------------------------------------------------------------
AC_ARG_ENABLE(fast_math_control,
[AS_HELP_STRING([--enable-fast-math-control],
[verify arguments to fx and fl functions (enabled by default)])])
case "$enable_fast_math_control" in
no|false|0) CONTROL_FX_PARAMETERS=0; CONTROL_FX="no";;
*) CONTROL_FX_PARAMETERS=1; CONTROL_FX="yes";;
esac
###
### See in what direction the stack grows (code stolen from Sawfish)
###
AC_RUN_IFELSE([AC_LANG_SOURCE([[ int inner (char *foo) { char bar; return !(foo >= &bar); }
int main (void) { char foo; return inner (&foo); } ]])],[STACK_DIRECTION="DOWN"],[STACK_DIRECTION="UP"],[echo "Stack direction is not detected when cross compiling for now"])
###
### Configuration for extensions
###
## --- GTKLOS
GTK_CFLAGS=""
HAVE_GTK=0
HAVE_CANVAS=0
GOOCANV=absent
GOOVERS=""
# Do we have GTK+?
if ${PKGCONFIG} --exists gtk+-3.0
then
GTK_CFLAGS=`${PKGCONFIG} --cflags gtk+-3.0`
HAVE_GTK=1
fi
# Do we have goocanvas?
if ${PKGCONFIG} --exists goocanvas-3.0
then
GOOVERS=goocanvas-3.0
else
if ${PKGCONFIG} --exists goocanvas-2.0
then
GOOVERS=goocanvas-2.0
fi
fi
if test "X${GOOVERS}" != "X"
then
GTK_CFLAGS=`${PKGCONFIG} --cflags ${GOOVERS}`
HAVE_GTK=1
HAVE_CANVAS=1
GOOCANV=present
fi
###
### SFI-176 stuff
###
C_VERSION=`((${CC} --version||${CC} -version) | head -n 1)2>/dev/null || echo "???"}`
C_COMPILE=""
C_LINK=""
# c.compile property
for arg in ${CC} ${CFLAGS} ${SH_MAIN_LOAD_FLAGS}
do
C_COMPILE="${C_COMPILE}\\\"${arg}\\\" "
done
# c.link property
for arg in ${CC} ${LDLAGS} ${GMPLIB} ${PCRE2LIB} ${FFILIB} ${GCLIB} -lm
do
C_LINK="${C_LINK}\\\"${arg}\\\" "
done
SH_LIB_COMPILE=""
SH_LIB_LINK=""
# stklos.shlib.compile property
inc=-I${prefix}/include/$PACKAGE
for arg in ${CC} ${SH_COMP_FLAGS} ${inc} ${inc}/gc
do
SH_LIB_COMPILE="${SH_LIB_COMPILE}\\\"${arg}\\\" "
done
# stklos.shlib.link property
for arg in ${SH_LOADER} ${SH_LOAD_FLAGS}
do
SH_LIB_LINK="${SH_LIB_LINK}\\\"${arg}\\\" "
done
###
### Finishing ...
###
# See if we must add CC, {C,LD,CPP}FLAGS to the arguments stored in $CONF_OPT
if test "X$HAS_CC" = "X" ;then
CONF_OPT="$CONF_OPT \\\"CC=$CC\\\""
fi
if test "X$HAS_CFLAGS" = "X" ;then
CONF_OPT="$CONF_OPT \\\"CFLAGS=$CFLAGS\\\""
fi
if test "X$HAS_LDFLAGS" = "X" ;then
CONF_OPT="$CONF_OPT \\\"LDFLAGS=$LDFLAGS\\\""
fi
if test "X$HAS_CFLAGS" = "X" ;then
CONF_OPT="$CONF_OPT \\\"CPPFLAGS=$CPPFLAGS\\\""
fi
# Build the CONF_SUMMARY variable
confdirs="("
confdirs="${confdirs} #:libdir \\\"$libdir\\\" #:datadir \\\"$datadir\\\""
confdirs="${confdirs} #:docdir \\\"$docdir\\\" #:htmldir \\\"$htmldir\\\" #:pdfdir \\\"$pdfdir\\\""
confdirs="${confdirs})"
confsum="("
confsum="${confsum} #:system ($SYST_LIBS) #:compiled ($COMP_LIBS) #:configure ($CONF_OPT)"
confsum="${confsum} #:dirs ${confdirs}"
confsum="${confsum})"
CONF_SUMMARY="${confsum}"
# Determine the STRIP command to use
if test "X$STRIP" = "X" ;then
STRIPCMD=strip
else
STRIPCMD=$STRIP
fi
UNAME_O=""
case `uname -s` in
*Linux*)
UNAME_O=`uname -o | sed -e 's=/=_='`
;;
*) # Darwin, for instance, does not support -o. Use the result of uname -s
UNAME_O=`uname -s`
;;
esac
# Adapt libraries that must be loaded for systems with broken RTLD_GLOBAL (as Android)
RDLINE=""; # Necessary for Android
case $UNAME_O in
Android) # Test if we have readline lib or libedit
DLLIBS="$DLLIBS -lc -lm"
AC_CHECK_LIB(readline, readline, HAVE_READLINE="yes", HAVE_READLINE="no", $LIBS)
if test "$HAVE_READLINE" = "yes" ;then
RDLINE="-lreadline";
else
AC_CHECK_LIB(edit, readline, HAVE_LIBEDIT="yes", HAVE_LIBEDIT="no", $LIBS)
if test "$HAVE_LIBEDIT" = "yes" ;then
RDLINE="-ledit";
fi
fi;;
*) DLLIBS="";;
esac
# Get configure/compilation directory
COMP_DIR=`pwd`
# Add information to VERSION
FULL_VERSION=$VERSION
if test $VERSION_STATUS = "unstable"
then
# This code duplicates some code from "utils/generate-git-info"
# but it makes things simpler
git_version=`git --version 2>/dev/null || true`
if test "X$git_version" != "X"
then
# Git is installed
git_patch="`git describe --tags | sed -Ee 's/.*-(.*)-.*/\1/'`"
if test "X$git_patch" != "X"
then
FULL_VERSION="$VERSION.$git_patch"
fi
else
FULL_VERSION=$VERSION-unstable
fi
fi
### Output files
AC_SUBST(STKCFLAGS)
AC_SUBST(VERSION)
AC_SUBST(FULL_VERSION)
AC_SUBST(VERSION_STATUS)
AC_SUBST(HAVE_DLOPEN)
AC_SUBST(OS_FLAVOUR)
AC_SUBST(UNAME_O)
AC_SUBST(GMP)
AC_SUBST(GMPLIB)
AC_SUBST(GMPINC)
AC_SUBST(PREFIX)
AC_SUBST(SCMDIR)
AC_SUBST(EXECDIR)
AC_SUBST(INCLUDEDIR)
AC_SUBST(BUILD_OS)
AC_SUBST(BUILD_ARCH)
AC_SUBST(OS_NAME)
AC_SUBST(OS_NAME_VERSION)
AC_SUBST(SH_COMP_FLAGS)
AC_SUBST(SH_LOAD_FLAGS)
AC_SUBST(SH_LOADER)
AC_SUBST(SH_SUFFIX)
AC_SUBST(SH_LIB_SUFFIX)
AC_SUBST(SH_MAIN_LOAD_FLAGS)
AC_SUBST(COMPOBJ)
AC_SUBST(COMPSRC)
AC_SUBST(STACK_DIRECTION)
AC_SUBST(HAVE_GNOME)
AC_SUBST(LDAP_LIB)
AC_SUBST(STRIPCMD)
AC_SUBST(COMP_DIR)
#GC
AC_SUBST(GC)
AC_SUBST(GCLIB)
AC_SUBST(GCINC)
# PCRE2
AC_SUBST(PCRE2)
AC_SUBST(PCRE2LIB)
AC_SUBST(PCRE2INC)
AC_SUBST(PCRE2PKG)
# FFI
AC_SUBST(FFI)
AC_SUBST(FFILIB)
AC_SUBST(FFIINC)
# readline completion support
AC_SUBST(RDLINE)
AC_SUBST(THREADS)
AC_SUBST(CONF_SUMMARY)
AC_SUBST(CONTROL_FX_PARAMETERS)
AC_SUBST(DLLIBS)
AC_SUBST(SYST_LIBS)
AC_SUBST(COMP_LIBS)
AC_SUBST(C_VERSION)
AC_SUBST(C_COMPILE)
AC_SUBST(C_LINK)
AC_SUBST(SH_LIB_COMPILE)
AC_SUBST(SH_LIB_LINK)
AC_SUBST(C_LINK)
# DOC
AC_SUBST(ASCIIDOCTOR)
# Extensions
AC_SUBST(HAVE_GTK)
AC_SUBST(HAVE_CANVAS)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GOOCANV)
AC_SUBST(GOOVERS)
AC_CONFIG_FILES([Makefile src/Makefile src/extraconf.h doc/Makefile
doc/refman/Makefile doc/vm/Makefile doc/hacking/Makefile
doc/pp/Makefile
lib/Makefile utils/Makefile utils/stklos-config
utils/stklos-script examples/Makefile examples/C-module/Makefile
lib/Match.d/Makefile lib/SILex.d/Makefile lib/Lalr.d/Makefile
lib/scheme/Makefile
lib/scheme/regex/Makefile lib/scheme/vector/Makefile
lib/srfi/Makefile lib/stklos/Makefile lib/streams/Makefile
tests/Makefile
doc/stklos.1 doc/stklos-config.1 doc/stklos-compile.1
doc/stklos-genlex.1 doc/stklos-pp.1 doc/stklos-script.1
lib/srfi/160/Makefile
extensions/Makefile
extensions/gtklos/Makefile
extensions/gtklos/doc/Makefile
extensions/gtklos/lib/stklos/Makefile
extensions/gtklos/lib/stklos/gtklos-config.h
extensions/gtklos/lib/stklos/gtklos.stk
extensions/gtklos/demos/Makefile
extensions/curl/Makefile
extensions/curl/lib/stklos/Makefile
extensions/curl/demos/Makefile
extensions/curl/doc/Makefile
extensions/fuse/Makefile
extensions/fuse/lib/stklos/Makefile
extensions/fuse/demos/Makefile
])
AC_OUTPUT
# Add a src/git-config.h if we don't have one
(cd src; ../utils/generate-git-info)
chmod 0755 utils/stklos-config utils/stklos-script
# COMP_LIBS_SHOW is a "shorter" version of COMP_LIBS
COMP_LIBS_SHOW=`echo $COMP_LIBS | sed -e "s/lib//g"`
echo " "
echo " "
echo "SUMMARY"
echo "*******"
echo " System: " $BUILD_OS
echo " OS nick: " $OS_NAME_VERSION
echo " OS type: " $OS_FLAVOUR
echo " Install prefix: " $prefix
echo " C compiler binary: " $CC
echo " C compiler version: " $C_VERSION
echo " Compilation flags: " $CFLAGS
echo " Loader: " $LD
echo " Thread support: " $STR_THREADS
echo " FFI support: " $STR_FFI
echo " Control fx parameters: " $CONTROL_FX
echo " System libraries used: " $SYST_LIBS_SHOW
echo " Compiled libraries: " $COMP_LIBS_SHOW
echo " STklos load prefix: " $PREFIX
echo " Binary load path: " $EXECDIR
echo " Scheme load path: " $SCMDIR
echo " Documentation dir: " $DOCDIR
echo " Documentation update: " $REPORT_ASCIIDOCTOR
echo " "
echo "If this is correct, you can just type 'make' now at your shell prompt."
echo "Otherwise, re-run 'configure' with correct options."
echo " "