-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathconfigure
executable file
·1863 lines (1615 loc) · 59.4 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
#*=====================================================================*/
#* serrano/prgm/project/hop/hop/configure */
#* ------------------------------------------------------------- */
#* Author : Manuel Serrano */
#* Creation : Sat Jul 31 06:49:37 2004 */
#* Last change : Sun Nov 17 13:24:57 2024 (serrano) */
#* Copyright : 2004-24 Manuel Serrano */
#* ------------------------------------------------------------- */
#* HOP autoconfiguration */
#*=====================================================================*/
#*---------------------------------------------------------------------*/
#* User flags */
#*---------------------------------------------------------------------*/
prefix=/usr/local
bigloo=bigloo
if [ "$HOPBIGLOO " != " " ]; then
bigloo=$HOPBIGLOO
fi
afile=bglafile
jfile=bgljfile
btags=bgltags
bdepend=bgldepend
cc=
hostcc=cc
flashcc=/usr/bin/mtasc
fflags="-main -version 9 -cp /usr/share/mtasc/std -cp /usr/share/mtasc/std8 -swf"
backend=native
platform=pc
link=dynamic
unzip=unzip
gzip="gzip -9"
install="install -m a+r,u+r"
jar="jar cfm"
javac=javac
devmode=product
debug=no
bcflags="-O3 -fstackable -fsharing -L \$(BUILDLIBDIR) -srfi bigloo-compile"
bhflags=-unsafe
btflags="-gtrace"
hflags="-Os"
bglpcre=required
bglunistring=required
bcflagsdev=""
bcflagsdbg="-copt -g -O2"
bcflagsdbg2="-g -cg"
bcflagspmem="-pmem -O2 -fno-user-inlining"
bcflagspmem2="-pmem2 -fno-user-inlining"
bcflagsopt="-unsafe -O3 -fstackable"
bcflagsrts="-unsafe -safee"
bcflagsmodules="-unsafe"
bscm2jsflags="-unsafe"
bhopcflags="-q"
blflags="-copt \$(CPICFLAGS) -L \$(BUILDLIBDIR) -srfi bigloo-compile"
mimetypes=/etc/mime.types
jsmimetype="application/x-javascript"
cssmimetype="text/css"
libraries="hop http hopwidget web hopscheme scheme2js multimedia sqlite js2scheme hopscript nodejs openpgp"
bglcloselibs="web multimedia openpgp"
extralibs=$EXTRALIBS
bglextralibs="biglooweb bigloomultimedia biglooopenpgp"
hopapplibs=
closure=
hostbigloo=bigloo
#*---------------------------------------------------------------------*/
#* Private variables */
#*---------------------------------------------------------------------*/
version="3.7.0"
devel=
license=academic
hopc=$PWD/bin/hopc
hop=$PWD/bin/hop
bglcpp=$PWD/scheme2js/runtime/bglcpp
branch="`echo $version | sed 's/[0-9][0-9]*$/x/'`"
date=`date +"%d %B %Y"`
url="http://hop.inria.fr"
docurl="http://hop-dev.inria.fr/home/lang.html"
etcdir=$prefix/etc
bindir=$prefix/bin
libdir=$prefix/lib
incdir=$prefix/include
sharedir=$prefix/share/hop
mansec=man1
mandir=$prefix/man/$mansec
webletsdir=
nodemodulesdir=
contribsdir=$prefix/share/hop/contribs
docdir=$prefix/share/doc/hop/$version
buildlibdir=$PWD/lib/hop/$version
buildsharedir=$PWD/share
distribdir=$HOME/prgm/distrib
distribdir=$HOME/prgm/project/hop/repository
buildbindir=$PWD/bin
buildspecific=
installspecific=
bigloorequired=4.6a
bigloourl=http://www-sop.inria.fr/indes/fp/Bigloo
svn=ssh://[email protected]/hop
if [ "$USER " = "serrano " ]; then
distribdir=$HOME/prgm/distrib
repodir=$HOME/prgm/project/hop/repository
else
distribdir=.
repodir=.
fi
# User controlled optional features
ssl=""
locevent="true"
nodoc=
tls=
zeroconf="#f"
zeroconfbe="no"
avahi=""
upnp=""
uv=""
hopsrfis=""
rts="hop-dom.js hop-event.js hop-serialize.js hop-request.js hop-lib.js hopscheme.js hop-require.js hop-boot.js hop-react.js"
bglfail=false;
hopservicebase="/hop"
hopjssanssuffix='"hop"'
hopjsfiles='"hop-autoconf.js" "runtime.js" "hop-boot.js" "hop-react.js"'
for p in $rts; do
hopjsfiles="$hopjsfiles \"$p\"";
done
arch=noarch
mach=
androidapp=hopdroid
echo "configuring with [$*]..." > config.status
# Argument parsing
while : ; do
case $1 in
"")
break;;
--prefix=*)
prefix="`echo $1 | sed 's/^[^=]*=//'`";
bindir=$prefix/bin;
libdir=$prefix/lib;
incdir=$prefix/include;
sharedir=$prefix/share/hop;
mandir=$prefix/man/$mansec;
etcdir=$prefix/etc;
contribsdir=$prefix/share/hop/contribs
docdir=$prefix/share/doc/hop;;
--etcdir=*)
etcdir="`echo $1 | sed 's/^[^=]*=//'`";;
--bindir=*)
bindir="`echo $1 | sed 's/^[^=]*=//'`";;
--libdir=*)
libdir="`echo $1 | sed 's/^[^=]*=//'`";;
--includedir=*)
incdir="`echo $1 | sed 's/^[^=]*=//'`";;
--sharedir=*)
sharedir="`echo $1 | sed 's/^[^=]*=//'`";;
--mandir=*)
mandir="`echo $1 | sed 's/^[^=]*=//'`"/$mansec;;
--webletsdir=*)
webletsdir="`echo $1 | sed 's/^[^=]*=//'`";;
--contribsdir=*)
contribsdir="`echo $1 | sed 's/^[^=]*=//'`";;
--docdir=*)
docdir="`echo $1 | sed 's/^[^=]*=//'`";;
--distribdir=*)
distribdir="`echo $1 | sed 's/^[^=]*=//'`";;
--build-bindir=*)
buildbindir="`echo $1 | sed 's/^[^=]*=//'`";
bigloo=$buildbindir/bigloo;
afile=$buildbindir/bglafile;
jfile=$buildbindir/bgljfile;
hop=$buildbindir/hop;
hopc=$buildbindir/hopc;;
--mimetypes=*)
mimetypes="`echo $1 | sed 's/^[^=]*=//'`";;
--jsmimetype=*)
jsmimetype="`echo $1 | sed 's/^[^=]*=//'`";;
--cssmimetype=*)
cssmimetype="`echo $1 | sed 's/^[^=]*=//'`";;
--hop=*)
hop="`echo $1 | sed 's/^[^=]*=//'`";;
--hopc=*)
hopc="`echo $1 | sed 's/^[^=]*=//'`";;
--bigloo=*)
bigloo="`echo $1 | sed 's/^[^=]*=//'`";
hostbigloo="`echo $1 | sed 's/^[^=]*=//'`";;
--host-bigloo=*)
hostbigloo="`echo $1 | sed 's/^[^=]*=//'`";;
--build-bigloo=*)
bigloo="`echo $1 | sed 's/^[^=]*=//'`";;
--bigloo-pcre=*)
bglpcre="`echo $1 | sed 's/^[^=]*=//'`";;
--bigloo-unistring=*)
bglunistring="`echo $1 | sed 's/^[^=]*=//'`";;
--bglafile=*)
afile="`echo $1 | sed 's/^[^=]*=//'`";;
--bigloolibdir=*)
bigloolibdir="`echo $1 | sed 's/^[^=]*=//'`";;
--bigloobindir=*)
bigloobindir="`echo $1 | sed 's/^[^=]*=//'`";;
--backend=*)
backend="`echo $1 | sed 's/^[^=]*=//'`";;
--link=*)
link="`echo $1 | sed 's/^[^=]*=//'`";;
--afile=*)
afile="`echo $1 | sed 's/^[^=]*=//'`";;
--btags=*)
btags="`echo $1 | sed 's/^[^=]*=//'`";;
--bdepend=*)
bdepend="`echo $1 | sed 's/^[^=]*=//'`";;
--cc=*)
cc="`echo $1 | sed 's/^[^=]*=//'`";;
--hostcc=*)
hostcc="`echo $1 | sed 's/^[^=]*=//'`";;
--bcflags=*)
bcflags="`echo $1 | sed 's/^[-a-z]*=//'`";;
--bldflags=*)
bldflags="`echo $1 | sed 's/^[-a-z]*=//'`";;
--ldhopopts=*)
ldhopopts="`echo $1 | sed 's/^[-a-z]*=//'`";;
--extra-bcflags=*)
bcflags="$bcflags $(echo $1 | sed 's/^[-a-z]*=//')";;
--blflags=*)
blflags="`echo $1 | sed 's/^[-a-z]*=//'`";;
--bhflags=*)
bhflags="`echo $1 | sed 's/^[-a-z]*=//'`";;
--hflags=*)
hflags="`echo $1 | sed 's/^[-a-z]*=//'`";;
--bcflagsdev=*)
bcflagsdev="`echo $1 | sed 's/^[-a-z]*=//'`";;
--ccflags=*)
ccflags="`echo $1 | sed 's/^[-a-z]*=//'`";;
--devel)
devmode="devel";
bcflagsrts=-cg;
bcflagsmodules=-cg;
bcflagsdev=-cg;
bscm2jsflags=;
bcflags="$bcflags -Wall -Wno-slot -srfi devel -cg";;
--debug)
devmode="debug";
debug=yes;
bcflagsrts=-g;
bcflagsmodules=-g;
bscm2jsflags=-g;
bhopcflags=-g;
ccflagsdebug=-g;
hflags="$hflags -g";
bcflags="$bcflags $bcflagsdbg -Wall -Wno-slot -srfi devel -srfi debug";;
--debug-inline)
devmode="debug-inline";
debug=yes;
bcflagsrts=-g;
bcflagsmodules=-g;
bscm2jsflags=-g;
bhopcflags=-g;
ccflagsdebug=-g;
hflags="$hflags -g";
bcflags="$bcflags $bcflagsdbg -Wall -Wno-slot -srfi devel -srfi debug -srfi disable-inline";;
--debug-cache)
devmode="debug-cache";
debug=yes;
bcflagsrts=-g;
bcflagsmodules=-g;
bscm2jsflags=-g;
bhopcflags=-g;
ccflagsdebug=-g;
hflags="$hflags -g";
bcflags="$bcflags $bcflagsdbg -Wall -Wno-slot -srfi devel -srfi debug -srfi disable-cache";;
--debug2)
devmode="debug2";
debug=yes;
bcflagsrts=-g;
bcflagsmodules=-g;
bscm2jsflags=-g;
bhopcflags=-g;
hflags=-g;
bcflags="$bcflags $bcflagsdbg2 -Wall -Wno-slot -srfi devel -srfi debug -srfi disable-inline";;
--debug-c)
bcflags="$bcflags -cg";;
--pmem)
devmode="pmem";
debug=no;
bscm2jsflags=-pmem;
bcflags="$bcflags $bcflagspmem";;
--pmem2)
devmode="pmem2";
debug=no;
bscm2jsflags=-pmem2;
bcflags="$bcflags $bcflagspmem2";;
--optimize)
bcflags="$bcflags $bcflagsopt";;
--profile)
bscm2jsflags=;
ccflagsprofile="-DHOP_PROFILE=1";
bcflagsprofile="-srfi profile";;
--enable-ssl)
ssl=yes;;
--disable-ssl)
ssl=no;;
--enable-avahi)
avahi=yes;;
--disable-avahi)
avahi=no;;
--enable-upnp)
upnp=yes;;
--disable-upnp)
upnp=no;;
--disable-libuv)
uv=no;
libuv=no;;
--gzip=*)
gzip="`echo $1 | sed 's/^[^=]*=//'`";;
--install=*)
install="`echo $1 | sed 's/^[^=]*=//'`";;
--enable-locevent)
locevent=true;;
--disable-locevent)
locevent=false;;
--enable-tls)
tls=yes;;
--disable-tls)
tls=no;;
--disable-doc)
nodoc=yes;;
--enable-doc)
nodoc=;;
--srfi=*)
hopsrfis="$hopsrfis `echo $1 | sed 's/^[^=]*=//'`";;
--library=*)
libraries="$libraries `echo $1 | sed 's/^[^=]*=//'`";;
--macosx-bundle|--macosx)
bcflags="$bcflags -copt -I../arch/macosx";
arch=macosx;;
--android)
buildspecific=build-android;
installspecific=install-android;
arch=android;;
--android-app=*)
androidapp="`echo $1 | sed 's/^[^=]*=//'`"
;;
--closure=*)
closure="`echo $1 | sed 's/^[^=]*=//'`"
;;
--alloc=*)
alloc="`echo $1 | sed 's/^[^=]*=//'`"
;;
-*)
if [ "$1" != "--help" ]; then
echo "*** Configure error, unknown option $1" >&2;
echo >&2;
fi
echo "Usage: configure [options]" >&2;
echo "" >&2;
echo "Path:" >&2;
echo " --prefix=dir................ prefix to HOP install" >&2;
echo " --etcdir=dir................ Hop etc directory" >&2;
echo " --bindir=dir................ alternative Hop bin directory" >&2;
echo " --libdir=dir................ alternative Hop lib directory" >&2;
echo " --includedir=dir............ alternative Hop include directory" >&2;
echo " --sharedir=dir.............. alternative Hop share directory" >&2;
echo " --mandir=dir................ alternative Hop man directory" >&2;
echo " --webletsdir=dir............ alternative Hop weblets directory" >&2;
echo " --contribsdir=dir........... alternative Hop contribs directory" >&2;
echo " --docdir=dir................ alternative Hop doc directory" >&2;
echo "" >&2;
echo "Misc:" >&2;
echo " --mimetypes=file............ default mime.types file" >&2;
echo " --jsmimetype=type........... default 'text/javascript'" >&2;
echo " --cssmimetype=type.......... default 'text/css'" >&2;
echo "" >&2;
echo "Features:" >&2;
echo " --[enable|disable]-doc...... enables documentation generation" >&2;
echo " --[enable|disable]-ssl...... enables SSL support" >&2;
echo " --[enable|disable]-locevent. enables location event support" >&2;
echo " --[enable|disable]-avahi.... enables AVAHI support" >&2;
echo " --[enable|disable]-upnp..... enables UPNP support" >&2;
echo " --[enable|disable]-libuv.... disables LIBUV support" >&2;
echo " --[enable|disable]-tls...... disables thread local storage support" >&2;
echo " --srfi=sym.................. activates this srfi (comptime and runtime)" >&2;
echo "" >&2;
echo "Cross compilation and OS dependencies:" >&2;
echo " --build-bindir=dir.......... cross compilers path ($buildbindir)" >&2;
echo " --hop=comp.................. the Hop binary ($hop)" >&2;
echo " --hopc=comp................. the Hopc binary ($hopc)" >&2;
echo " --bigloo=comp............... set both build and host Bigloo compilers ($bigloo/$hostbigloo)" >&2;
echo " --build-bigloo=comp......... the build Bigloo compiler ($bigloo)" >&2;
echo " --host-bigloo=comp.......... the host Bigloo compiler ($hostbigloo)" >&2;
echo " --bigloobindir=path......... the Bigloo bin-dir path" >&2;
echo " --bigloolibdir=path......... the Bigloo lib-dir path" >&2;
echo " --bigloo-prce=yes|no........ enable/disable libunistring" >&2;
echo " --bigloo-unistring=yes|no... enable/disable pcre" >&2;
echo " --backend=backend........... the execution platform [native,jvm,dotnet]" >&2;
echo " --link=method............... the link method [static,dynamic,library]" >&2;
echo " --afile=afile............... the Bigloo afile tool" >&2;
echo " --btags=btags............... the Bigloo btags tool" >&2;
echo " --bdepend=bdepend........... the Bigloo dependence tool" >&2;
echo " --gzip...................... the GNU zipper ($gzip)" >&2;
echo " --install................... the installer ($install)" >&2;
echo " --cc=cc..................... the C compiler" >&2;
echo " --hostcc=cc................. default host C compiler" >&2;
echo " --bcflags=args.............. the Bigloo C compilation options" >&2;
echo " --bldflags=args............. the Bigloo C link options" >&2;
echo " --ldhopopts=args............ the Hop specific Bigloo C link options" >&2;
echo " --extra-bcflags=args........ additional Bigloo compilation options" >&2;
echo " --bcflagsdev=args........... the devel Bigloo options" >&2;
echo " --blflags=args.............. the link options" >&2;
echo " --bhflags=args.............. the heap options" >&2;
echo " --hflags=args............... the hopc options" >&2;
echo " --ccflags=args.............. the C compilation options" >&2;
echo " --android................... prepares the production of an Android apk" >&2;
echo " --macosx.................... prepares the production of a MacOSX bundle" >&2;
echo "" >&2;
echo "Misc settings:" >&2;
echo " --devel..................... enables devel mode (safe but not debug)" >&2;
echo " --debug[2].................. enables Bigloo debug mode" >&2;
echo " --debug-c................... enables C debug mode" >&2;
echo " --pmem[2]................... enables memory profiling mode" >&2;
echo " --profile................... enables Bigloo profiling mode" >&2;
echo " --optimize.................. enables Bigloo optimization mode (default)" >&2;
echo " --closure=comp.............. path to closure compiler" >&2;
echo "" >&2;
echo "Experimental features:" >&2;
echo " --alloc=classic|worker...... allocator method [worker]" >&2
exit 255;
esac
shift
done
# patch the bigloobindir path
if [ "$bigloobindir " = " " -a "$bigloo " != "bigloo " ]; then
bigloobindir=`dirname $bigloo`;
fi
if [ "$bigloobindir " != " " ]; then
if [ "$bigloo " = "bigloo " ]; then
bigloo=$bigloobindir/bigloo
fi
if [ "$afile " = "bglafile " ]; then
afile=$bigloobindir/bglafile
fi
if [ "$jfile " = "bgljfile " ]; then
jfile=$bigloobindir/bgljfile
fi
if [ "$btags " = "bgltags " ]; then
btags=$bigloobindir/bgltags
fi
if [ "$bdepend " = "bgldepend " ]; then
bdepend=$bigloobindir/bgldepend
fi
fi
#*---------------------------------------------------------------------*/
#* Versioning */
#*---------------------------------------------------------------------*/
if [ ! -x .hoprelease ]; then
cat > .hoprelease <<EOF
#!/bin/sh
major=$version
state=$devel
minor=
EOF
chmod a+rx .hoprelease
fi
. ./.hoprelease
if [ "$state " != "$devel " ]; then
state=$devel
minor=1
cat > .hoprelease <<EOF
#!/bin/sh
major=$version
state=$devel
minor=1
EOF
chmod a+rx .hoprelease
fi
if [ "$state " != " " ]; then
minorversion=-$state$minor
else
minorversion=
fi
#*---------------------------------------------------------------------*/
#* license */
#*---------------------------------------------------------------------*/
hopsrfis="$hopsrfis license-$license"
#*---------------------------------------------------------------------*/
#* First check that bigloo exists and is recent enough */
#*---------------------------------------------------------------------*/
if [ ! -f $bigloo ]; then
which $bigloo > /dev/null 2> /dev/null
if [ "$?" != "0" ]; then
echo "*** ERROR:configure:bigloo. Aborting!" >&2
echo "Can't find bigloo. You need at least version $(bigloorequired)." >&2
echo "It may be downloaded at:" >&2
echo " $bigloourl" >&2
exit 1;
fi
fi
# check the Bigloo version
bglversion=`$bigloo -q -eval "(exit (display (bigloo-config 'release-number)))"`
$bigloo -q -eval "(exit (if (string>=? (bigloo-config 'release-number) \"$bigloorequired\") 0 1))"
if [ $? != "0" ]; then
echo "*** ERROR:configure:bigloo. Aborting!" >&2
echo "Your version of Bigloo ($bglversion) is too old. Release" >&2
echo " $bigloorequired" >&2
echo "or more recent is required. It may be downloaded at:" >&2
echo " $bigloourl" >&2
exit 1;
fi
# check the Bigloo libraries
bgllibdir=`$bigloo -q -eval "(begin (print (bigloo-config 'library-directory)) (exit 0))"`
bglsharedsuffix=`$bigloo -q -eval "(begin (print (bigloo-config 'shared-lib-suffix)) (exit 0))"`
for lib in libbigloo_s-$bglversion.a libbigloo_u-$bglversion.a libbigloo_s_mt-$bglversion.$bglsharedsuffix libbigloo_u_mt-$bglversion.$bglsharedsuffix; do
if [ ! -f $bgllibdir/$lib ]; then
echo "*** ERROR:configure:bigloo not propertly installed, library missing ($lib)" >&2
echo "$bgllibdir/$lib" >&2
exit 1
fi
done
#*---------------------------------------------------------------------*/
#* checking awk */
#*---------------------------------------------------------------------*/
echo "toto:tutu" | awk -F: '{ print $1 }' 2> /dev/null > /dev/null
if [ $? != "0" ]; then
echo "*** ERROR:configure:awk. Aborting!" >&2
echo "Awk command missing or not running correctly." >&2
exit 1;
fi
#*---------------------------------------------------------------------*/
#* Check the backend */
#*---------------------------------------------------------------------*/
case $backend in
"native")
break;;
*)
echo "*** Configure error, Illegal backend $backend" >&2;
echo "see configure --help" >&2;
exit -1;
esac
#*---------------------------------------------------------------------*/
#* We are now able to set the correct value for cc since we know */
#* what Bigloo is. */
#*---------------------------------------------------------------------*/
if [ "$bigloolibdir " = " " ]; then
bigloolibdir=`$bigloo -q -eval "(begin (print (bigloo-config 'library-directory)) (exit 0))"`
else
bcflags="$bcflags -lib-dir $bigloolibdir"
ldhopopts="-L$bigloolibdir"
fi
if [ "$cc " = " " ]; then
cc=`$bigloo -lib-dir $bigloolibdir $bcflags -eval '(begin (print *cc*) (exit 0))'`
else
bcflags="$bcflags -cc $cc"
fi
if [ "$ccflags " = " " ]; then
ccflags=`grep '^CFLAGS=' $bigloolibdir/Makefile.config | sed 's/^[A-Z]*=//'`
if [ "$debug " = "yes " ]; then
ccflags=`echo $ccflags | sed 's/[-]O[0-9]//'`
fi
ccflags="$ccflags -I$bigloolibdir \$(CPICFLAGS) \$(CNANFLAGS)"
fi
if [ "$alloc " = "classic " ]; then
ccflags="$ccflags -DHOP_ALLOC_POLICY=1"
fi
if [ ! -f $bigloolibdir/Makefile.config ]; then
echo "Bigloo not properly installed, file missing:" >&2;
echo " $bigloolibdir/Makefile.config" >&2;
exit -1;
fi
#*---------------------------------------------------------------------*/
#* Check that Bigloo compiles and binary runs */
#*---------------------------------------------------------------------*/
tmp=`$bigloo -eval '(begin (print (os-tmp)) (exit 0))'`
cat > $tmp/bigloo-test-hop.scm <<EOF
(module test (main main))
(define (main args)
(exit (-fx 1 (string->integer (cadr args)))))
EOF
$bigloo $tmp/bigloo-test-hop.scm -o $tmp/bigloo-test-hop || exit 1
$tmp/bigloo-test-hop 1 || exit 1
rm -f $tmp/bigloo-test-hop $tmp/bigloo-test-hop.scm $tmp/bigloo-test-hop.o
#*---------------------------------------------------------------------*/
#* Check the Bigloo required libraries */
#*---------------------------------------------------------------------*/
if [ ! -f $bigloolibdir/web.heap ]; then
echo "*** ERROR:configure:bigloo web." >&2;
echo "" >&2;
echo "This error is due to a bad Bigloo installation. It might be that" >&2;
echo "you have installed Bigloo without the WEB support. Please" >&2;
echo "check your Bigloo installation." >&2;
echo "" >&2
bglfail=true;
fi
if [ ! -f $bigloolibdir/multimedia.heap ]; then
echo "*** ERROR:configure:bigloo multimedia." >&2;
echo "" >&2;
echo "This error is due to a bad Bigloo installation. It might be that" >&2;
echo "you have installed Bigloo without the MULTIMEDIA support. Please" >&2;
echo "check your Bigloo installation." >&2;
echo "" >&2
bglfail=true;
fi
#*---------------------------------------------------------------------*/
#* Check hostcc */
#*---------------------------------------------------------------------*/
cat > $tmp/hostcc-test.c <<EOF
int main( int argc, char *argv[] ) {
return 0;
}
EOF
$hostcc $tmp/hostcc-test.c -o $tmp/hostcc.out \
|| (echo "*** ERROR: incorrect hostcc ($hostcc)"; exit 1) || exit 1
$tmp/hostcc.out 1 \
|| (echo "*** ERROR: incorrect hostcc compilation"; exit 1) || exit 1
rm -f $tmp/hostcc.out $tmp/hostcc-test.c
#*---------------------------------------------------------------------*/
#* SSL */
#*---------------------------------------------------------------------*/
if [ "$ssl " = " " ]; then
if [ ! -f $bigloolibdir/ssl.heap ]; then
ssl=no
else
ssl=yes
fi
fi
if [ "$ssl" = "yes" ]; then
if [ ! -f $bigloolibdir/ssl.heap ]; then
echo "*** ERROR:configure:bigloo ssl." >&2;
echo "" >&2;
echo "This error is due to a bad Bigloo installation. It might be that" >&2;
echo "you have installed Bigloo without the SSL support. Please" >&2;
echo "check your Bigloo installation, or configure Hop without ssl." >&2;
echo "" >&2
bglfail=true;
fi
hopsrfis="$hopsrfis enable-ssl"
libraries="$libraries ssl"
bglcloselibs="$bglcloselibs ssl"
extralibs="$""(OPENSSLLIB) $extralibs"
bglextralibs="$bglextralibs bigloossl"
fi
#*---------------------------------------------------------------------*/
#* Threads */
#*---------------------------------------------------------------------*/
if [ ! -f $bigloolibdir/pthread.heap ]; then
echo "*** ERROR:configure:bigloo pthread missing." >&2;
echo "" >&2;
echo "Hop needs Bigloo multi-thread support but it appears that" >&2;
echo "the installed Bigloo compiler does not support multi-threading." >&2;
echo "You must either, configure Hop without multi-threading support" >&2;
echo "or re-configure and re-install your Bigloo compiler." >&2;
echo "" >&2
bglfail=true
else
libraries="$libraries pthread"
bglcloselibs="$bglcloselibs pthread"
bglextralibs="$bglextralibs bigloopthread"
bigloopthlib="bigloopthread"
bigloopthlibs="-lbigloopthread_s-$""(RELEASE)"
bigloopthlibu="-lbigloopthread_u-$""(RELEASE)"
bigloogc="-lbigloogc_fth-$""(RELEASE)"
bhopcflags="-q --js-worker-slave"
fi
#*---------------------------------------------------------------------*/
#* Avahi */
#*---------------------------------------------------------------------*/
if [ "$avahi " = " " ]; then
if [ -f $bigloolibdir/avahi.heap ]; then
avahi=yes
else
avahi=no
fi
fi
if [ "$avahi " = "yes " ]; then
if [ ! -f $bigloolibdir/avahi.heap ]; then
echo "*** ERROR:configure:bigloo avahi." >&2;
echo "" >&2;
echo "You have request a avahi support but it appears that" >&2;
echo "the installed Bigloo compiler does not support avahi." >&2;
echo "You must either, configure Hop without avahi support" >&2;
echo "or re-configure and re-install your Bigloo compiler." >&2;
echo "" >&2
bglfail=true;
fi
hopsrfis="$hopsrfis enable-avahi"
zeroconf="#t"
zeroconfbe="avahi"
libraries="$libraries avahi"
bglcloselibs="$bglcloselibs avahi"
bglextralibs="$bglextralibs biglooavahi"
fi
#*---------------------------------------------------------------------*/
#* Upnp */
#*---------------------------------------------------------------------*/
if [ "$upnp " = " " ]; then
if [ -f $bigloolibdir/upnp.heap ]; then
upnp=yes
else
upnp=no
fi
fi
if [ "$upnp " = "yes " ]; then
if [ ! -f $bigloolibdir/upnp.heap ]; then
echo "*** ERROR:configure:bigloo upnp." >&2;
echo "" >&2;
echo "You have request a upnp support but it appears that" >&2;
echo "the installed Bigloo compiler does not support upnp." >&2;
echo "You must either, configure Hop without upnp support" >&2;
echo "or re-configure and re-install your Bigloo compiler." >&2;
echo "" >&2
bglfail=true;
fi
hopsrfis="$hopsrfis enable-upnp"
libraries="$libraries upnp"
bglcloselibs="$bglcloselibs upnp"
bglextralibs="$bglextralibs biglooupnp"
fi
#*---------------------------------------------------------------------*/
#* uv */
#*---------------------------------------------------------------------*/
if [ "$uv " = " " ]; then
if [ -f $bigloolibdir/libuv.heap ]; then
uv=yes
else
uv=no
fi
fi
if [ "$uv " = "no " ]; then
if [ "$libuv " != "no " ]; then
echo "*** ERROR:configure:bigloo libuv." >&2;
echo "" >&2;
echo "Bigloo LIBUV is not installed on your machine." >&2;
echo "" >&2;
echo "LIBUV is strongly recommended for better performance. It is then" >&2;
echo "advised to install LIBUV and re-install Bigloo before compiling Hop." >&2;
echo "However, if you want to give Hop a try without LIBUV, configure it" >&2;
echo "with the \"--disable-libuv\" option." >&2;
echo "" >&2
bglfail=true;
fi
else
hopsrfis="$hopsrfis enable-libuv"
libraries="$libraries libuv"
bglcloselibs="$bglcloselibs libuv"
extralibs="-luv $extralibs"
bglextralibs="$bglextralibs bigloolibuv"
fi
#*---------------------------------------------------------------------*/
#* unistring */
#*---------------------------------------------------------------------*/
haveunistring=`$bigloo -lib-dir $bigloolibdir -q -eval "(exit (display (bigloo-config 'have-unistring)))"`
if [ "$haveunistring " != "#t " -a "$bglunistring " != "no " ]; then
echo "*** ERROR:configure: your Bigloo setting does not support \"unistring\"." >&2
echo " As a consequence JavaScript locale comparison are not correctly supported." >&2
echo " If you known what you are doing and if you don't need string locale " >&2
echo " comparison, re-configure Hop with the following option:" >&2
echo " ./configure --bigloo-unistring=no ..." >&2
echo "" >&2
bglfail=true;
fi
#*---------------------------------------------------------------------*/
#* pcre */
#*---------------------------------------------------------------------*/
pcre=`$bigloo -lib-dir $bigloolibdir -q -eval "(exit (display (bigloo-config 'regexp)))"`
if [ "$pcre " != "pcre " -a "$pcre " != "pcre2 " -a "$bglpcre " != "no " ]; then
echo "*** ERROR:configure: your Bigloo setting does not support \"pcre\"." >&2
echo " As a consequence JavaScript regular expressions are not fully supported." >&2
echo " If you known what you are doing and if you don't want compatible regexp" >&2
echo " re-configure Hop with the following option:" >&2
echo " ./configure --bigloo-pcre=no ..." >&2
echo " Otherwise, install pcre and re-configure and re-compile Bigloo first." >&2
echo "" >&2
bglfail=true;
fi
#*---------------------------------------------------------------------*/
#* tls */
#*---------------------------------------------------------------------*/
if [ "$tls " != "no " ]; then
tls=`bigloo -q -eval "(exit (display (bigloo-config 'thread-local-storage))))"`
if [ "$tls " = "#t " ]; then
hopsrfis="enable-tls $hopsrfis";
fi
fi
#*---------------------------------------------------------------------*/
#* libbacktrace */
#*---------------------------------------------------------------------*/
if [ -f $bigloolibdir/libbacktrace.heap ]; then
libraries="$libraries libbacktrace"
bglcloselibs="$bglcloselibs libbacktrace"
bglextralibs="$bglextralibs bigloolibbacktrace"
fi
if [ "$devmode " = "debug " -o "$devmode " = "debug-inline " ]; then
bcflagsrts="$bcflagsrts -gtrace0"
bcflagsmodules="$bcflagsmodules -gtrace0"
bhopcflags="$bhopcflags -gtrace0"
hflags="$hflags -gtrace0"
bhflags=""
fi
#*---------------------------------------------------------------------*/
#* bgl test completion */
#*---------------------------------------------------------------------*/
if [ "$bglfail " = "true " ]; then
echo "When re-configuring Bigloo, it might be useful to use the configure option" >&2
echo "\"--abort-missing\" that will force the Bigloo configuration process to fail" >&2
echo "as soon as one important Bigloo library is missing." >&2
exit 1
fi
#*---------------------------------------------------------------------*/
#* Then check if bglafile exists this is a good indicator of a */
#* correct Bigloo installation. */
#*---------------------------------------------------------------------*/
$afile runtime/*.scm > /dev/null 2> /dev/null
if [ $? != "0" ]; then
echo "*** ERROR:configure:$afile. Aborting"
echo ""
echo "This error is due to a bad Bigloo installation. It might be that"
echo "you have installed Bigloo but not ran \"ldconfig\" afterward."
echo "In such a case, binaries produced by Bigloo cannot be executed"
echo "because the loader cannot find the Bigloo dynamic library."
exit 1;
fi
#*---------------------------------------------------------------------*/
#* NODEMODULES dir */
#*---------------------------------------------------------------------*/
if [ "$nodemodulesdir " = " " ]; then
nodemodulesdir=$libdir/hop/$version/node_modules;
fi
#*---------------------------------------------------------------------*/
#* Weblets dir */
#*---------------------------------------------------------------------*/
if [ "$webletsdir " = " " ]; then
webletsdir=$libdir/hop/$version/weblets;
fi
#*---------------------------------------------------------------------*/
#* Srfis */
#*---------------------------------------------------------------------*/
for srfi in $hopsrfis; do
bcflags="$bcflags -srfi $srfi";