-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure
executable file
·862 lines (752 loc) · 30.1 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
#! /bin/sh
# Usage: configure [options] [dirname [cc]]
# Examples:
# configure obj
# CC=gcc configure make.gcc
# CC=cc configure make.cc
# configure make.gcc gcc (deprecated)
# configure make.cc cc (deprecated)
# we source config.cache, therefore this file must be executed by the
# same shell as executes sub-configures.
# this is a real problem on such systems as Solaris if CONFIG_SHELL is
# bash whose config.cache cannot be loaded by /bin/sh
if test -z "${CONFIG_SHELL}" && test "`uname -s`" = SunOS; then
# On Solaris, /bin/sh is broken. We need bash.
if test -f /bin/bash; then
CONFIG_SHELL=/bin/bash
else
CONFIG_SHELL=`which bash`
fi
export CONFIG_SHELL
fi
if test -n "${CONFIG_SHELL}"; then
# ensure that CONFIG_SHELL is compatible with /bin/sh:
# if CONFIG_SHELL is bash, but /bin/sh is not, restart with bash
if test -n "`${CONFIG_SHELL} --version 2>/dev/null | grep bash 2>/dev/null`"
then # CONFIG_SHELL is bash
test -n "${BASH_VERSION}" || exec ${CONFIG_SHELL} $0 $*
fi
else
CONFIG_SHELL=/bin/sh
fi
# Download location of the newest libsigsegv release.
libsigsegv_url='https://ftp.gnu.org/gnu/libsigsegv/libsigsegv-2.12.tar.gz'
fail () { echo "$*" >&2; exit 1; }
info_help () {
cat << \EOP
Usage: configure [options] [dirname]
dirname: Name of directory in which to build CLISP. This allows you to build
CLISP with different compilers on the same machine or for different
architectures in the same filesystem, sharing the same source.
Default is "src".
options: The following options are recognized:
--help print this message and exit
--version print the CLISP version and exit
--config unix/INSTALL step 3: configuration only
--cbc unix/INSTALL steps 3-8: Configure, Build, Check
--cbcx Configure, Build, Check, Extra checks
The following options set installation parameters:
--srcdir=SRCDIR sets the source directory to SRCDIR
The following options are passed to subordinate `configure' scripts:
--quiet, --silent do not print `checking...' messages
Installation directories:
--prefix=PREFIX base directory for files to be installed
--exec-prefix=PREFIX base directory for architecture-dependent
files to be installed
--fsstnd=STYLE specify file system standard for installation
Fine tuning of the installation directories:
--bindir=DIR user executables
--libdir=DIR object code libraries
--includedir=DIR C header files
--datarootdir=DIR read-only arch.-independent data root
--datadir=DIR read-only architecture-independent data
--localedir=DIR locale-dependent data
--mandir=DIR man documentation
--infodir=DIR info documentation
--docdir=DIR documentation root
--htmldir=DIR html documentation
--dvidir=DIR TeX DVI documentation
--pdfdir=DIR PDF documentation
--psdir=DIR PostScript documentation
--elispdir=DIR Emacs Lisp files
--vimdir=DIR VIM files
--aclocaldir=DIR autoconf files
Enable and disable specific packages
--with-PACKAGE use PACKAGE
--without-PACKAGE do not use PACKAGE
PACKAGEs available (the default is the opposite of the following):
--without-ffcall do not support Foreign Function Interface
the default is to support it when available
--without-dynamic-modules no Dynamic Modules support
--without-unicode no Unicode support: character=8bit
--without-readline do not link with GNU readline
--with-threads=FLAVOR support multiple threads in one CLISP image
via OS threads [highly experimental - use at your own risk]
FLAVOR: POSIX_THREADS SOLARIS_THREADS WIN32_THREADS
--with-jitc=FLAVOR use a given Just-In-Time Compiler.
The only flavor at this time is lightning
(GNU lightning must be installed in the standard place).
--with-module=MODULE build with add-on MODULE
--help-modules list the modules included in the distribution
and information on building them
--hyperspec=URL the path to the Common Lisp HyperSpec (the default is
http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/
or the value of the environment variable CLHSROOT, if set)
--enable-portability favour portability over optimization: disable
optimizations that could lead to build failures
--with-gmalloc use the GNU malloc instead of of the libc one
(needed on HP-UX and OpenBSD)
--with-debug if you will need to debug the C sources
--edit-config edit config.lisp with ${EDITOR:-vi} before make
(useful with --cbc)
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
You can specify the location of dependencies using
EOP
`dirname $0`/src/configure --help | grep 'with.*prefix'
cat << \EOP
See also the --help-modules option.
Example:
configure --cbc built-with-gcc
su bin
cd built-with-gcc
make install
exit
Specifying the C compiler:
If you wish to specify the C compiler that will get used to build
CLISP, set the environment variables CC, CFLAGS, LIBS.
Put compiler flags that have to be passed to the preprocessor
into the CC variable, not the CFLAGS variable.
For example, if you want to use gcc in ANSI C mode,
execute the following before calling `configure':
setenv CC "gcc -ansi" if using csh
export CC="gcc -ansi" if using bash or ksh
CC="gcc -ansi"; export CC if using sh
If you have headers in a nonstandard directory <include dir>
set CPPFLAGS to "-I<include dir>"
If you have libraries in a nonstandard directory <lib dir>
set LDFLAGS to "-L<lib dir>"
Using GNU libiconv (only needed if you do not have GNU LIBC 2.2 or better):
If you want to use GNU libiconv which is not installed system-wide,
you may supply a --with-libiconv-prefix argument
(type './src/configure --help' for details).
The same goes for non-standard locations of libintl and libsigsegv.
EOP
}
# Abort in case something fails.
set -e
# Nuisances.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
srcdir=''
# http://www.gnu.org/software/autoconf/manual/html_node/Option-Checking.html
subdir_configure_args='--disable-option-checking'
have_explicit_libsigsegv_args=false
have_explicit_libffcall_args=false
makemake_args=''
do_config=''
do_cbc=''
argcount=0
edit_config=''
prev=''
passnext=''
do_ffi='default'
target=''
ignore_absence_of_libsigsegv=''
prefix="/usr/local"
exec_prefix=${prefix}
getarg(){ echo "$1" | sed 's,^[-_a-zA-Z0-9]*=,,'; }
all_modules=''
note_module(){
all_modules=${all_modules}" $1"
makemake_args=${makemake_args}" --with-module=$1"
}
explicit_prefix=''
note_prefix(){
explicit_prefix="$1"
}
for arg # in "$@"
do
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
# If the previous option needs an argument for subdir configures or
# makemake, pass it, otherwise set the variable
case "$passnext" in
configure)
subdir_configure_args="$subdir_configure_args $arg"
;;
makemake)
makemake_args="$makemake_args$arg"
;;
both)
makemake_args="$makemake_args$arg"
subdir_configure_args="$subdir_configure_args $arg"
if test "$prev" = prefix; then
note_prefix "$arg"
fi
;;
with-module)
note_module $arg
;;
*) eval "$prev=\$arg" ;;
esac
passnext=''
prev=''
else
case "$arg" in
--cbc)
do_config=1
do_cbc=1 ;;
--cbcx)
do_config=1
do_cbc=2 ;;
--config | --confi | --conf | --con | --co)
do_config=1 ;;
--edit-config | --edit-confi | --edit-conf | --edit-con | --edit-co | \
--edit-c | --edit- | --edit | --edi | --ed)
edit_config=1 ;;
--help | --hel | --he)
info_help
exit 0 ;;
--version | --versio | --versi | --vers | --ver | --ve | --v)
./src/configure --version
exit 0 ;;
--help-modules | --help-module | --help-modul | --help-modu | --help-mod | --help-mo | --help-m)
set +e
MODDIR=modules
echo "module sets found in the directory '${MODDIR}':"
MODLIST=`find ${MODDIR} -name link.sh -o -name link.sh.in | sed -e 's,^${MODDIR}/,,' -e 's,/[^/]*$,,' | sort`
for m in ${MODLIST}; do echo " "${m}; done
echo "to specify the location of external software:"
for m in src ${MODLIST}; do
CFG=./${m}/configure
if [ -x ${CFG} ]; then
tmp=${CFG}.with
${CFG} --help | grep ' --with-[a-zA-Z0-8]*-prefix' > ${tmp}
if test -s ${tmp}; then
echo "* ${m} (try also '${CFG} --help')"
cat ${tmp}
fi
rm -f ${tmp}
fi
done
exit 0 ;;
--srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir=`getarg "$arg"` ;;
--srcdir | --srcdi | --srcd | --src | --sr)
prev=srcdir
passnext=configure ;;
--prefix=* | --prefi=* | --pref=* | --pre=* | --pr=*)
subdir_configure_args="$subdir_configure_args $arg"
prefix=`getarg "$arg"`
note_prefix "${prefix}"
makemake_args="$makemake_args --prefix=${prefix}" ;;
--prefix | --prefi | --pref | --pre | --pr)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --prefix="
prev=prefix
passnext=both ;;
--exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | -exec=* | --exe=* | --ex=*)
subdir_configure_args="$subdir_configure_args $arg"
exec_prefix=`getarg "$arg"`
makemake_args="$makemake_args --exec-prefix="${exec_prefix} ;;
--exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | -exec | --exe | --ex)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --exec-prefix="
prev=exec_prefix
passnext=both ;;
--fsstnd=* | --fsstn=* | --fsst=* | --fss=* | --fs=* | --f=*)
makemake_args="$makemake_args --fsstnd="`getarg "$arg"` ;;
--bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --bindir="`getarg "$arg"` ;;
--bindir | --bindi | --bind | --bin | --bi)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --bindir="
prev=bindir
passnext=both ;;
--libdir=* | --libdi=* | --libd=* | --lib=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --libdir="`getarg "$arg"` ;;
--libdir | --libdi | --libd | --lib)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --libdir="
prev=libdir
passnext=both ;;
--includedir=* | --includedi=* | --included=* | --include=* | --includ=* | --inclu=* | --incl=* | --inc=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --includedir="`getarg "$arg"` ;;
--includedir | --includedi | --included | --include | --includ | --inclu | --incl | --inc)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --includedir="
prev=includedir
passnext=both ;;
--datarootdir=* | --datarootdi=* | --datarootd=* | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --datarootdir="`getarg "$arg"` ;;
--datarootdir | --datarootdi | --datarootd | --dataroot | --dataroo | --dataro | --datar)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --datarootdir="
prev=datarootdir
passnext=both ;;
--datadir=* | --datadi=* | --datad=* | --data=* | --dat=* | --da=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --datadir="`getarg "$arg"` ;;
--datadir | --datadi | --datad | --data | --dat | --da)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --datadir="
prev=datadir
passnext=both ;;
--localedir=* | --localedi=* | --localed=* | --locale=* | --local=* | --loca=* | --loc=* | --lo=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --localedir="`getarg "$arg"` ;;
--localedir | --localedi | --localed | --locale | --local | --loca | --loc | --lo)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --localedir="
prev=localedir
passnext=both ;;
--docdir=* | --docdi=* | --docd=* | --doc=* | --do=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --docdir="`getarg "$arg"` ;;
--docdir | --docdi | --docd | --doc | --do)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --docdir="
prev=docdir
passnext=both ;;
--mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --mandir="`getarg "$arg"` ;;
--mandir | --mandi | --mand | --man | --ma | --m)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --mandir="
prev=mandir
passnext=both ;;
--infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --infodir="`getarg "$arg"` ;;
--infodir | --infodi | --infod | --info | --inf)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --infodir="
prev=infodir
passnext=both ;;
--htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* | --ht=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --htmldir="`getarg "$arg"` ;;
--htmldir | --htmldi | --htmld | --html | --htm | --ht)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --htmldir="
prev=htmldir
passnext=both ;;
--dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --dvidir="`getarg "$arg"` ;;
--dvidir | --dvidi | --dvid | --dvi | --dv)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --dvidir="
prev=dvidir
passnext=both ;;
--psdir=* | --psdi=* | --psd=* | --ps=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --psdir="`getarg "$arg"` ;;
--psdir | --psdi | --psd | --ps)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --psdir="
prev=psdir
passnext=both ;;
--pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --pdfdir="`getarg "$arg"` ;;
--pdfdir | --pdfdi | --pdfd | --pdf | --pd)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --pdfdir="
prev=pdfdir
passnext=both ;;
--elispdir=* | --elispdi=* | --elispd=* | --elisp=* | --elis=* | --eli=* | --el=*)
makemake_args="$makemake_args --elispdir="`getarg "$arg"` ;;
--elispdir | --elispdi | --elispd | --elisp | --elis | --eli | --el)
makemake_args="$makemake_args --elispdir="
prev=elispdir
passnext=makemake ;;
--vimdir=* | --vimdi=* | --vimd=* | --vim=* | --vi=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --vimdir="`getarg "$arg"` ;;
--vimdir | --vimdi | --vimd | --vim | --vi)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --vimdir="
prev=vimdir
passnext=both ;;
--aclocaldir=* | --aclocaldi=* | --aclocald=* | --aclocal=*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --aclocaldir="`getarg "$arg"` ;;
--aclocaldir | --aclocaldi | --aclocald | --aclocal)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args --aclocaldir="
prev=aclocaldir
passnext=both ;;
--hyperspec=* | --hyperspe=* | --hypersp=* | --hypers=* | --hs=* | --hy=*)
makemake_args="$makemake_args --hyperspec="`getarg "$arg"` ;;
--quiet | --quie | --qui | --qu | --q | \
--silent | --silen | --sile | --sil | --si)
subdir_configure_args="$subdir_configure_args $arg" ;;
--host=* | --hos=* | --ho=*)
subdir_configure_args="$subdir_configure_args $arg" ;;
--host | --hos | --ho)
subdir_configure_args="$subdir_configure_args $arg"
prev=host
passnext=configure ;;
--build=* | --buil=* | --bui=* | --bu=*)
subdir_configure_args="$subdir_configure_args $arg" ;;
--build | --buil | --bui | --bu)
subdir_configure_args="$subdir_configure_args $arg"
prev=build
passnext=configure ;;
--with-debug)
makemake_args="--verbose=yes --with-debug $makemake_args" ;;
--without-ffcall | --with-ffcall=no | --with-no-ffcall)
subdir_configure_args="$subdir_configure_args $arg"
do_ffi="no" ;;
--with-ffcall | --with-ffcall=yes)
subdir_configure_args="$subdir_configure_args $arg"
do_ffi="yes" ;;
--without-dynamic-modules | --with-dynamic-modules=no)
makemake_args="--with-dynamic-modules=no ${makemake_args}" ;;
--with-mingw | --with-no-cygwin | --without-cygwin | --with-cygwin=no)
echo "$0: $arg is deprecated; use --build= or CC=... instead"
CC="${CC:-gcc} -mno-cygwin"; export CC;
makemake_args="$makemake_args --win32gcc" ;;
--with-module=*) note_module `getarg $arg` ;;
--with-module)
prev=with-module
passnext=with-module ;;
--with-* | --without-*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args $arg"
case "$arg" in
--with-libsigsegv-prefix* | --without-libsigsegv-prefix*) have_explicit_libsigsegv_args=true ;;
--with-libffcall-prefix* | --without-libffcall-prefix*) have_explicit_libffcall_args=true ;;
esac
;;
--enable-* | --disable-*)
subdir_configure_args="$subdir_configure_args $arg"
makemake_args="$makemake_args $arg" ;;
--ignore-absence-of-libsigsegv)
ignore_absence_of_libsigsegv=yes ;;
-*)
fail "$0: invalid argument $arg
$0: Try \`$0 --help'" ;;
*=*) # set a variable
var=`echo $arg | sed 's/\([^=]*\)=.*/\1/'`
val=`echo $arg | sed 's/[^=]*=\(.*\)/\1/'`
eval "$var='$val'"
export $var ;;
*) # Everything else counts as a positional argument
argcount=`expr $argcount + 1`
eval "POSARG$argcount=\$arg" ;;
esac
fi
done
test -n "$prev" && fail "$0: missing argument to --$prev
$0: Try \`$0 --help'"
DIRNAME=$POSARG1
COMPILER=$POSARG2 # deprecated
if test -z "$do_config" -a -z "$do_cbc"; then
# Default is --config
do_config=1
fi
# Add an implicit --with-libsegsegv-prefix option, based on --prefix,
# if no such option was explicitly given.
$have_explicit_libsigsegv_args || {
if test -n "$explicit_prefix"; then
subdir_configure_args="$subdir_configure_args --with-libsigsegv-prefix=${explicit_prefix}"
fi
}
# Add an implicit --with-libffcall-prefix option, based on --prefix,
# if no such option was explicitly given.
$have_explicit_libffcall_args || {
if test -n "$explicit_prefix"; then
subdir_configure_args="$subdir_configure_args --with-libffcall-prefix=${explicit_prefix}"
fi
}
# checking how to copy files
echo "blabla" > conftest.x
err=`/bin/sh -c "cp -p conftest.x conftest.y 2>&1 ; exit 0"`
if test -z "$err"; then
CP='cp -p'
else
CP='cp'
fi
rm -f conftest*
# get the absolute pathname from a possibly relative one
abs_pwd () { cd "$1" > /dev/null; pwd; }
# link FILE1 FILE2 is like `ln', but chooses the cheapest alternative:
# hard link if FILE1 and FILE2 on the same disk, else symbolic link if the
# system supports that, else file copy.
link () {
rm -f "$2";
# Note: With some versions of "ln" this does not work if FILE2 is a symlink.
if ln "$1" "$2" 2>/dev/null; then
:
else
srcfile_dirname=`echo "$1" | sed -e 's,/[^/]*$,,'`
test -n "$srcfile_dirname" || srcfile_dirname='/'
srcfile_basename=`echo "$1" | sed -e 's,^.*/,,'`
srcfile_absdirname=`abs_pwd "$srcfile_dirname"`
if ln -s "$srcfile_absdirname/$srcfile_basename" "$2" 2>/dev/null; then
:
else
$CP "$1" "$2"
fi
fi
}
# run n command...
# execute command, redirect to cbcstep${n}.log, and with SUCCEEDED or FAILED
run () {
log=$1; shift
{ $* && { echo "===> $* SUCCEEDED"; exit 0; } || echo "===> $* FAILED"; } 2>&1 | tee cbcstep${log}.log
}
# Note that we would need to call `/bin/pwd` if we wanted to compare two
# directories for equality. But here we only need to get _some_ absolute
# pathnames, hence `pwd` is enough.
if test -f /bin/pwd ; then
ABSPATHPWD=/bin/pwd
else
ABSPATHPWD=pwd
fi
abs_path_pwd () { cd "$1" > /dev/null; ${ABSPATHPWD}; }
INPLACE=''
if test -n "$srcdir" ; then
test -d "$srcdir" || fail "$0: srcdir: ($srcdir) nonexistent"
ABS_SRCDIR=`abs_pwd "$srcdir"`;
if [ "$DIRNAME" = "" ] ; then
DIRNAME='.'
fi
mkdir -p "${DIRNAME}";
REL_SRCDIR="$ABS_SRCDIR"
else
if test -f ./ANNOUNCE -a -f ./SUMMARY; then
srcdir='.'
ABS_SRCDIR=`abs_pwd "$srcdir"`
if [ "$DIRNAME" = "" ] ; then
DIRNAME=src
fi
else
test -f ../ANNOUNCE -a -f ../SUMMARY || \
fail "$0: source directory not found, use --srcdir option"
srcdir='..'
ABS_SRCDIR=`abs_pwd "$srcdir"`
if [ "$DIRNAME" = "" ] ; then
DIRNAME='.'
fi
fi
mkdir -p "${DIRNAME}";
if test `abs_path_pwd "$DIRNAME"/..` = `abs_path_pwd "$srcdir"` ; then
REL_SRCDIR='..'
else
REL_SRCDIR="$ABS_SRCDIR"
fi
fi
ABS_DIRNAME="`abs_pwd "$DIRNAME"`";
if test "`abs_path_pwd "$DIRNAME"`" = "`abs_path_pwd "$srcdir"/src`" ; then
INPLACE=yes
fi
case "$REL_SRCDIR" in
/*) RREL_SRCDIR="$REL_SRCDIR";;
*) RREL_SRCDIR="../$REL_SRCDIR";;
esac
# srcdir top level source directory
# (i.e. this script is $srcdir/configure)
# ABS_SRCDIR absolute srcdir
# REL_SRCDIR srcdir, relative to $DIRNAME
# RREL_SRCDIR srcdir, relative to $DIRNAME/anysubdir
# DIRNAME directory in which to build
# ABS_DIRNAME absolute DIRNAME
# INPLACE set if DIRNAME is the source directory, hence no links needed
if test -n "$do_config"; then
cd "$ABS_SRCDIR"
if [ "$COMPILER" != "" ] ; then
CC="$COMPILER"
export CC
fi
if test -n "$CC"; then
# cygwin comes with a true cross-compiler, i.e. one does
# ./configure CC=i686-w64-mingw32-gcc ...
# instead of ./configure --with-mingw
case "$CC" in
*gcc*)
CC_machine=`($CC -dumpmachine) 2>/dev/null` || :
case "$CC_machine" in
*mingw32* )
echo "cross-compiling for mingw"
subdir_configure_args="${subdir_configure_args} --build=$CC_machine" ;;
esac
;;
esac
fi
cd "${ABS_DIRNAME}"
echo "executing $REL_SRCDIR/src/configure $*"
if test -n "$do_cbc"; then
run 1 ${CONFIG_SHELL} $REL_SRCDIR/src/configure $subdir_configure_args --cache-file=config.cache
else
${CONFIG_SHELL} $REL_SRCDIR/src/configure $subdir_configure_args --cache-file=config.cache
fi
test -f "${ABS_DIRNAME}/intparam.h" || fail "error: configure could not generate intparam.h. Take a look at ${ABS_DIRNAME}/config.log."
test -f "${ABS_DIRNAME}/floatparam.h" || fail "error: configure could not generate floatparam.h. Take a look at ${ABS_DIRNAME}/config.log."
fi
. "${ABS_DIRNAME}/config.cache"
case ${ac_cv_host} in # mingw/msys
*mingw32*)
makemake_args="${makemake_args} --with-dynamic-modules=no --win32gcc" ;;
esac
test -n "${cl_cv_have_ffcall}" || cl_cv_have_ffcall=notchecked
cat <<EOF
Configure findings:
FFI: ${cl_cv_have_ffcall} (user requested: ${do_ffi})
readline: ${ac_cv_have_readline} (user requested: ${ac_cv_use_readline})
libsigsegv: ${gl_cv_lib_sigsegv}
EOF
# The user can set MAKE. In particular, on IRIX, VPATH builds require GNU make.
if test -z "${MAKE}"; then
MAKE=make
fi
# are any FFI modules requested?
ffi_modules=''
for module in ${all_modules}; do
mdir=${ABS_SRCDIR}/modules/${module}
test -d ${mdir} || fail "$0: ${mdir} is not an existing directory"
if test -r ${mdir}/configure.in; then
grep 'CL_MODULE_COMMON_CHECKS.*ffi' ${mdir}/configure.in > /dev/null 2>&1 && \
ffi_modules=${ffi_modules}" ${module}"
elif grep '.*\.c.*\.fas.*:\|.*\.fas.*\.c.*:' ${mdir}/Makefile > /dev/null 2>&1 ; then
ffi_modules=${ffi_modules}" ${module}"
elif grep ':use.*"FFI"' ${mdir}/*.lisp > /dev/null 2>&1; then
ffi_modules=${ffi_modules}" ${module}"
fi
done
if test -n "${ffi_modules}"; then
test ${do_ffi} = no && \
fail "$0: --without-ffcall is incompatible with requested module(s):${ffi_modules}"
test "${cl_cv_have_ffcall}" = yes || \
fail "$0: modules${ffi_modules} require FFI"
fi
if [ ${do_ffi} != no -a "${cl_cv_have_ffcall}" = yes ]; then
makemake_args="--with-dynamic-ffi ${makemake_args}"
fi
if [ "${gl_cv_lib_sigsegv}" != "yes" ]; then
if [ "${ignore_absence_of_libsigsegv}" = "yes" ]; then
echo "As you requested, we will proceed without libsigsegv..."
else
if [ "$ac_cv_build" = "$ac_cv_host" ]; then host_arg="";
else host_arg=" --host=$ac_cv_host --build=$ac_cv_build";
fi
cat <<EOF 1>&2
$0: libsigsegv was not detected, thus some features, such as
generational garbage collection and
stack overflow detection in interpreted Lisp code
cannot be provided.
Please install libsigsegv like this:
EOF
if [ "${CC+set}" = "set" ]; then
echo " CC='$CC'; export CC" 1>&2
fi
libsigsegv_targz=`echo "$libsigsegv_url" | sed -e 's|^.*/||'`
libsigsegv_dirname=`echo "$libsigsegv_targz" | sed -e 's|\.tar\.gz$||'`
cat <<EOF 1>&2
mkdir prerequisites; cd prerequisites; prefix=\`pwd\`/${ac_cv_host}
wget ${libsigsegv_url}
tar xfz ${libsigsegv_targz}
cd ${libsigsegv_dirname}
./configure${host_arg} --prefix=\${prefix} && ${MAKE} && ${MAKE} check && ${MAKE} install
cd ../..
rm -f ${DIRNAME}/config.cache
./configure --with-libsigsegv-prefix=\${prefix} $*
If you insist on building without libsigsegv, please pass
--ignore-absence-of-libsigsegv
to this script:
./configure --ignore-absence-of-libsigsegv $*
If you have installed libsigsegv, but clisp does not detect it,
you might have installed it incorrectly, see section 2 in in unix/INSTALL.
EOF
exit 1;
fi
fi
# CLISP needs a lot of stack space for bootstrapping,
# and insufficient stack space manifests itself via arbitrary GC errors.
# It was believed that 8192 is enough until power5 came along:
# https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=166347
# But this affects only the powerpc CPU, because it has lots of reserved space
# in its stack frame layout (see section 2.2.2 of
# "Power Architecture 64-Bit ELF V2 ABI Specification"
# https://members.openpowerfoundation.org/document/dl/576 ).
case ${ac_cv_host} in
*-*-rs6000 | *-*-rs6000-* | *-*-powerpc* | *-*-ppc*)
STACK_LIMIT=16384 ;;
*)
STACK_LIMIT=8192 ;;
esac
stacksizelimit=`ulimit -s 2>/dev/null || :` # cygwin /bin/sh ulimit is broken
# need 3 separate test calls because of "integer expression expected" errors
# when $stacksizelimit is "" or "unlimited" (no short-circuiting!)
set +e;
test -z "$stacksizelimit" || { test "$stacksizelimit" != unlimited && test "$stacksizelimit" -lt ${STACK_LIMIT}; }
STACK_TOO_SMALL=$? # 0=true => need to reset; 1=false => big enough
set -e
cd "$ABS_DIRNAME"
echo "./makemake $makemake_args > Makefile"
./makemake $makemake_args > Makefile
${MAKE} config.lisp
if test -z "$do_cbc"; then
echo
echo "To continue building CLISP, the following commands are recommended"
echo " (cf. unix/INSTALL step 4 ff):"
if test "$DIRNAME" != "."; then
echo " cd $DIRNAME"
fi
echo " ${EDITOR:-vi} config.lisp"
if [ "${STACK_TOO_SMALL}" = 0 ]; then
cat <<EOF
# The default stack size on your platform is insufficient
# and must be increased to at least ${STACK_LIMIT}. You must do either
# 'ulimit -s ${STACK_LIMIT}' (for Bourne shell derivatives, e.g., bash and zsh)
# or 'limit stacksize ${STACK_LIMIT}' (for C shell derivarives, e.g., tcsh)
EOF
fi
cat <<EOF
${MAKE}
# CLISP self-test:
${MAKE} check
# Test non-portable features and modules
${MAKE} extracheck mod-check
EOF
else
if [ -n "${edit_config}" ]; then
${MAKE} config.lisp
${EDITOR:-vi} config.lisp
fi
if [ "${STACK_TOO_SMALL}" = 0 ]; then
set +e; ulimit -s ${STACK_LIMIT} 2>/dev/null; set -e;
fi
run 2 ${MAKE}
run 3 ${MAKE} check
if test "$do_cbc" = 2; then
run 4 ${MAKE} extracheck
run 5 ${MAKE} base-mod-check
# Disabled because the rawsock tests hang on Solaris.
# run 6 ${MAKE} full-mod-check
fi
# report results:
for log in 1 2 3 4 5 # 6
do
stepresult=`sed -n -e '$p' cbcstep${log}.log`
echo "Step ${log} ${stepresult}"
done
# Fail if one of the commands "make" or "make check" failed.
# "make extracheck" and "make mod-check" are allowed to fail.
sed -n -e '$p' cbcstep2.log | grep ' SUCCEEDED$' >/dev/null || exit 1
sed -n -e '$p' cbcstep3.log | grep ' SUCCEEDED$' >/dev/null || exit 1
if test "$do_cbc" != 2; then
cat <<EOF
# Now you can test non-portable features and modules:
${MAKE} extracheck mod-check
EOF
fi
fi