-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure
executable file
·1660 lines (1545 loc) · 41 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
#########################################################################
# #
# Galax #
# XQuery Engine #
# #
# Copyright 2001-2006. #
# Distributed only by permission. #
# #
#########################################################################
# $Id: configure,v 1.24 2008/03/12 22:30:57 simeon Exp $ #
#--- Options ---
# value -1: off by command line ("forced")
# value 0: off by default
# value 1: on by default
# value 2: on by command line ("forced")
version="1.0"
ocaml_version="4.01"
# Function: print_options()
# Description:
# Print the current values of all options
#
print_options () {
for opt in $eoptions
do
e="o=\$enable_$opt"
eval "$e"
uopt=`echo $opt | sed -e 's/_/-/g'`
if [ $o -gt 0 ]
then
echo " -enable-$uopt"
else
echo " -disable-$uopt"
fi
done
for opt in $woptions
do
e="o=\$with_$opt"
eval "$e"
uopt=`echo $opt | sed -e 's/_/-/g'`
if [ $o -gt 0 ]
then
echo " -with-$uopt"
else
echo " -without-$uopt"
fi
done
for opt in $poptions
do
e="o=\$$opt"
eval "$e"
uopt=`echo $opt | sed -e 's/_/-/g'`
echo " -$uopt $o"
done
for opt in $coptions
do
e="o=\$copt_$opt"
eval "$e"
echo " $opt $o"
done
}
usage() {
echo "Configure [options]"
echo "[options]"
echo "-help Print this help message"
for opt in $eoptions
do
e="help=\$help_enable_$opt"
eval "$e"
uopt=`echo $opt | sed -e 's/_/-/g'`
echo "-enable-$uopt:"
echo "-disable-$uopt:"
echo " $help"
done
for opt in $woptions
do
e="help=\$help_with_$opt"
eval "$e"
uopt=`echo $opt | sed -e 's/_/-/g'`
echo "-with-$uopt:"
echo "-without-$uopt:"
echo " $help"
done
for opt in $poptions
do
e="help=\$help_$opt"
eval "$e"
uopt=`echo $opt | sed -e 's/_/-/g'`
echo "-$uopt arg:"
echo " $help"
done
}
# Set default values for configuration variables
# local: This is the root directory that serves as the default
# for dependent libraries and includes, as well as the
# default root directory for installing GALAX.
# local_bin: This is the local library (default=local/bin)
# local_lib: This is the local library (default=local/lib)
# local_inc: This is the local include (default=local/include)
#
# galax_home: This is where Galax will be installed (default=local)
# galax_bin: This is where Galax binaries will be installed (default=$galax_home/bin)
# galax_lib: This is where Galax libraries will be installed (default=$galax_home/lib)
# galax_camllib: This is where the CAML interface and libraries are installed (default=$galax_lib/caml)
# galax_usecases: This is where the usecases files are installed (default=$galax_home/usecases)
# galax_regress: This is where the regress files are installed (default=$galax_home/regress)
# galax_examples: This is where the examples files are installed (default=$galax_home/examples)
# galax_config: This is where the sample Makefiles are installed (default=$galax_home/config)
# galax_capi: This is where the C API files are installed (default=$galax_lib/c)
# galax_javaapi: This is where the JAVA API files are installed (default=$galax_lib/java)
# galax_man: This is where Galax documentation will be installed (default=$galax_home/doc)
#
# ocaml_home: This is where OCaml 3.10 is installed (default=local)
# ocaml_bin: This is where ocamlc is installed (default=$ocaml_home/bin)
# ocaml_major_version: O'Caml major version number
# ocaml_minor_version: O'Caml minor version number
# ocaml_lib: This is where ocamlc is installed (default=$ocaml_home/lib)
# ocaml_stdlib: This is where the OCaml std-lib is installed (default=$ocaml_lib/ocaml/std-lib)
# ocaml_pkglib: This is where the OCaml pkg-lib is installed (default=$ocaml_lib/ocaml/pkg-lib)
# ocaml_pcre: This is where the OCaml PCRE interface is installed (default=$ocaml_pkglib/pcre)
# ocaml_netstring: This is where the OCaml netstring files are installed (default=$ocaml_pkglib/netstring)
# ocaml_netstring_pcre: This is where the OCaml netstring files are installed (default=$ocaml_pkglib/netstring-pcre)
# ocaml_equeue: This is where the OCaml equeue files are installed (default=$ocaml_pkglib/equeue)
# ocaml_netclient: This is where the OCaml netclient files are installed (default=$ocaml_pkglib/netclient)
# ocaml_netsys: This is where the OCaml netsys files are installed (default=$ocaml_pkglib/netstring)
# ocaml_pxp: This is where the OCaml PXP files are installed (default=$ocaml_pkglib/pxp-engine)
# ocaml_pxp_utf8: This is where the OCaml PXP UTF8 files are installed (default=$ocaml_pkglib/pxp-lex-utf8)
# ocaml_pxp_iso88591: This is where the OCaml PXP UTF8 files are installed (default=$ocaml_pkglib/pxp-lex-iso88591)
# ocaml_camomile: This is where the OCaml Camomile files are installed (default=$ocaml_pkglib/camomile)
# ocaml_idl: This is where the OCaml ocamlidl package is installed (default=$ocaml_home)
# ocaml_idl_bin: This is where the OCaml ocamlidl bin is installed (default=$ocaml_home/bin)
# ocaml_libasumrun: This is where libasmrun.a is located (default=$ocaml_stdlib)
# clib_pcre: This is where the PCRE C library is installed (default=$local/lib)
# clib_bdb_lib: This is where the BDB C library is installed (default=$local/lib)
# clib_bdb_inc: This is where the BDB C header is installed (default=$local/include)
# clib_bdb_name: This is the name of the BDB C library (default=libdb.a)
#
# java_home: This is the home directory for the JDK installation (default=$local if with_java selected)
# java_bin: This is the bin directory for javac (default=$java_home/bin)
# java_inc: This is the include directory
# java_sysinc: This is the OS-dependent java include directory
#
# package_dir: The directory to write the source package to (default=..)
#
# with{out}_utf8: Compile Galax with{out} support for UTF8 character encoding (default with)
# with{out}_iso88591 Compile Galax with{out} support for ISO 88591 character encoding (default with)
# with{out}_jungle Compile Galax with{out} support for the Jungle storage interface (default without)
# with{out}_c Compile Galax with{out} support for the C API (default with)
# with{out}_java Compile Galax with{out} support for the JAVA API (default without)
# with{out}_shared Compile API libraries with{out} support for shared libraries (default without)
# with{out}_galaxd Compile threaded Galax server daemon (default without)
#
# These variables are automatically set based on the current environment
#
config_user=`id -u -nr`
config_dir=`pwd`
config_date=`date`
config_cmd="$0 $*"
config_out="config/Makefile.conf"
package_dir=".."
package_src=`pwd`
# These can all be set from the command line
#
local=/usr/local
local_bin=
local_lib=
local_inc=
galax_home=
galax_bin=
galax_lib=
galax_camllib=
galax_usecases=
galax_examples=
galax_config=
galax_capi=
galax_javaapi=
galax_man=
ocaml_bin=
ocaml_lib=
ocaml_home=
ocaml_stdlib=
ocaml_pkglib=
ocaml_pcre=
ocaml_netstring=
ocaml_netstring_pcre=
ocaml_equeue=
ocaml_netclient=
ocaml_netsys=
ocaml_pxp=
ocaml_pxp_utf8=
ocaml_pxp_iso88591=
ocaml_camomile=
ocaml_idl=
ocaml_idl_bin=
ocaml_libasmrun=
clib_bdb_lib=
clib_bdb_inc=
clib_bdb_name=
clib_pcre=
java_home=
java_bin=
with_utf8=1
with_iso88591=1
with_jungle=0
with_c=0
with_java=0
with_shared=1
with_galaxd=0
enable_profiling=0
regression=PLEASESET
galax_regression=PLEASESET
host_type="unknown"
ccoption=
poptions="local local_bin local_lib local_include"
poptions="$poptions galax_home galax_bin galax_lib galax_camllib galax_usecases galax_examples galax_regress galax_config galax_capi galax_javaapi galax_man regression galax_regression"
poptions="$poptions ocaml_home ocaml_bin ocaml_lib ocaml_stdlib ocaml_pkglib ocaml_pcre ocaml_netstring ocaml_netstring_pcre ocaml_equeue ocaml_netclient ocaml_netsys ocaml_pxp ocaml_pxp_utf8 ocaml_pxp_iso88591 ocaml_camomile ocaml_idl ocaml_idl_bin ocaml_libasmrun"
poptions="$poptions clib_bdb_lib clib_bdb_inc clib_bdb_name clib_pcre"
poptions="$poptions java_home java_bin java_inc java_sysinc"
poptions="$poptions regression galax_regression host_type ccoption"
poptions="$poptions package_dir"
woptions="utf8 iso88591 jungle c java shared galaxd"
eoptions="profiling"
coptions="CC CCFLAGS MKSHAREDLIB MKSHAREDLIBFLAGS CCLIBS SUPPORTS_SHARED_LIBRARIES"
help_local="The root directory where Galax is installed and other packages are found"
help_local_bin="The local bin directory"
help_local_lib="The local lib directory"
help_local_inc="The local include directory"
help_galax_home="The root directory where Galax is installed"
help_galax_bin="The directory where Galax executables are installed"
help_galax_lib="The directory where Galax libraries are installed"
help_galax_camllib="The directory where Galax OCaml libraries are installed"
help_galax_usecases="The directory where Galax use case files are installed"
help_galax_examples="The directory where Galax example programs are installed"
help_galax_config="The directory where Galax configuration Makefiles are installed"
help_galax_regress="The directory where Galax regression tests are installed"
help_galax_capi="The directory where Galax C API files are installed"
help_galax_javaapi="The directory where Galax Java API files are installed"
help_galax_man="The directory where Galax documentation is installed"
help_ocaml_home="The root directory for the OCaml installation"
help_ocaml_bin="The bin directory where the OCaml compiler is installed"
help_ocaml_major_version="The OCaml major version number"
help_ocaml_minor_version="The OCaml minor version number"
help_ocaml_lib="The lib directory where the OCaml libraries are installed"
help_ocaml_stdlib="The directory where OCaml standard library files are installed"
help_ocaml_pkglib="The directory where OCaml package library files are installed"
help_ocaml_pcre="The directory where the OCaml PCRE library is installed"
help_ocaml_netstring="The directory where the OCaml netstring library is installed"
help_ocaml_netstring_pcre="The directory where the OCaml netstring-pcre library is installed"
help_ocaml_netclient="The directory where the OCaml netclient library is installed"
help_ocaml_equeue="The directory where the OCaml equeue library is installed"
help_ocaml_netsys="The directory where the OCaml netsys library is installed"
help_ocaml_pxp="The directory where the OCaml PXP library is installed"
help_ocaml_pxp_utf8="The directory where the OCaml UTF8 PXP library is installed"
help_ocaml_pxp_iso88591="The directory where the OCaml ISO 88591 PXP library is installed"
help_ocaml_camomile="The directory where the OCaml Camomile library is installed"
help_ocaml_idl="The directory where the OCaml IDL package is installed"
help_ocaml_idl_bin="The directory where the OCaml IDL compiler is installed"
help_ocaml_libasmrun="The directory where the OCaml libasmrun.a is installed"
help_clib_bdb_lib="The directory where the Berkeley DB library is installed (libdb.a)"
help_clib_bdb_inc="The directory where the Berkeley DB header is installed (db.h)"
help_clib_bdb_name="The name of the Berkeley DB library"
help_clib_pcre="The directory where the PCRE C library is installed"
help_java_home="The directory where the jdk is installed"
help_java_bin="The directory where javac is installed"
help_java_inc="The directory where jni.h is installed"
help_java_sysinc="The directory where system-dependent headers included by jni.h are installed"
help_regression="The directory where the XQuery 1.0 regression test suite is installed"
help_galax_regression="The directory where the Galax regression test suite is installed"
help_host_type="The type of system Galax is being built for (automatically detected)"
help_ccoption="The C compiler to use"
help_package_dir="The directory to write the source package to"
help_with_utf8="Include/exclude support for the UTF8 character set (default=with)"
help_with_iso88591="Include/exclude support for the ISO 88591 character set (default=with)"
help_with_jungle="Include/exclude support for the Jungle XML document database (default=without)"
help_with_c="Include/exclude support for the Galax C API (default without)"
help_with_java="Include/exclude support for the Galax Java API (default without)"
help_with_shared="Include/exclude support for shared libraries (default with)"
help_enable_profiling="Enable/disable support for profiling (default disable)"
# These variables are derived from other
# variables
#
tool_ocamlfind=
tool_ocamlc=
tool_ocamlopt=
tool_ocamldep=
tool_ocamllex=
tool_ocamlyacc=
tool_ocamlmktop=
tool_ocamlmklib=
tool_camlp4o=
tool_camlidl=
tool_java=
tool_javac=
tool_javadoc=
tool_javah=
tool_jar=
# These variables determine things that are required
#
need_copt=0
# Function: findpath(prog)
# Description:
# Find the first directory in $PATH containing prog.
#
findpath() {
OIFS=$IFS
IFS=':'
for dir in $PATH
do
if [ -z "$dir" ]
then
dir=.
fi
if [ -f $dir/$1 ]
then
echo $dir
IFS=$OIFS
return 0
fi
done
IFS=$OIFS
return 1
}
# Function: check_popt(path-name)
# Description:
# Check to see if the given path-name is one of the supported
# paths for configuration purposes
#
check_popt() {
for x in $poptions
do
if [ "$x" = "$1" ]
then
return 0
fi
done
echo "Unknown path option: $1" >&2
exit 1
}
# Function: check_wopt(opt)
# Description:
# Check to see if the given with{out}-name is one of the supported
# with{out} options.
#
check_wopt() {
for x in $woptions
do
if [ "$x" = "$1" ]
then
return 0
fi
done
echo "Unknown with option: $1" >&2
exit 1
}
# Function: check_eopt(opt)
# Description:
# Check to see if the given {en|dis}able-name is one of the supported
# enable options
#
check_eopt() {
for x in $eoptions
do
if [ "$x" = "$1" ]
then
return 0
fi
done
echo "Unknown enable option: $1" >&2
exit 1
}
echo "Configuring Galax $version..." >&2
# Process command line arguments
#
while [ "$#" -gt 0 ]
do
case "$1" in
-enable-*)
opt=`echo "$1" | sed -e 's/-enable-//' -e 's/-/_/g'`
check_eopt "$opt"
eval "enable_$opt=2"
shift
;;
-disable-*)
opt=`echo "$1" | sed -e 's/-disable-//' -e 's/-/_/g'`
check_eopt "$opt"
eval "enable_$opt=-1"
shift
;;
-with-*)
opt=`echo "$1" | sed -e 's/-with-//' -e 's/-/_/g'`
check_wopt "$opt"
eval "with_$opt=2"
shift
;;
-without-*)
opt=`echo "$1" | sed -e 's/-without-//' -e 's/-/_/g'`
check_wopt "$opt"
eval "with_$opt=-1"
shift
;;
-version)
echo "$version"
exit 0
;;
-?|-help)
usage
exit 0
;;
-*)
opt=`echo "$1" | sed -e 's/^-*//' -e 's/-/_/g'`
check_popt "$opt"
eval "$opt=$2"
shift 2
;;
*)
echo "Unknown option: $1"
usage
exit 1
;;
esac
done
# Determine the system type
#
if [ "$host_type" = "unknown" ]
then
host_type=`./config/config.guess`
if [ -z "$host_type" ]
then
echo "Cannot guess host type"
echo "You must specify one with the -host-type option"
exit 2
fi
fi
host=`./config/config.sub $host_type`
if [ -z "$host_type" ]
then
echo "Please specify the correct host type with the -host-type option"
exit 2
fi
echo "Configuring for a $host ..."
# Set up values based on the command line options
#
# local, local_bin, local_lib, and local_inc
#
if [ -z "$local_bin" ]
then
local_bin=$local/bin
fi
if [ -z "$local_lib" ]
then
local_lib=$local/lib
fi
if [ -z "$local_inc" ]
then
local_inc=$local/include
fi
# galax_*
#
if [ -z "$galax_home" ]
then
galax_home=$local/galax
fi
if [ -z "$galax_bin" ]
then
galax_bin=$galax_home/bin
fi
if [ -z "$galax_lib" ]
then
galax_lib=$galax_home/lib
fi
if [ -z "$galax_man" ]
then
galax_man=$galax_home/doc
fi
if [ -z "$galax_camllib" ]
then
galax_camllib=$galax_lib/caml
fi
if [ -z "$galax_usecases" ]
then
galax_usecases=$galax_home/usecases
fi
if [ -z "$galax_examples" ]
then
galax_examples=$galax_home/examples
fi
if [ -z "$galax_regress" ]
then
galax_regress=$galax_home/regress
fi
if [ -z "$galax_config" ]
then
galax_config=$galax_home/config
fi
if [ -z "$galax_capi" ]
then
galax_capi=$galax_lib/c
fi
if [ -z "$galax_javaapi" ]
then
galax_javaapi=$galax_lib/java
fi
# OCAML directories
#
if [ -z "$ocaml_bin" ]
then
if [ -n "$ocaml_home" ]
then
ocaml_bin=$ocaml_home/bin
else
ocaml_bin=`findpath ocamlc`
if [ -z "$ocaml_bin" ]
then
ocaml_home=$local;
ocaml_bin=$local/bin
else
ocaml_home=$ocaml_bin/..
fi
fi
echo "Setting ocaml_bin to $ocaml_bin"
ocamlv=`$ocaml_bin/ocaml -version | sed -e 's/.*version //g'`
ocaml_major_version=`echo ${ocamlv} | sed -e 's/+.*//g' | sed -e 's/\.[0-9]$//g'`
if [ "${ocaml_major_version}" != "${ocaml_version}" ]
then
echo "ERROR: Expected OCaml major version ${ocaml_version}, found ${ocaml_major_version}"
exit 1
fi
ocaml_minor_version=`echo $ocamlv | sed -e 's/[0-9]\.[0-9][0-9]\.//g'`
echo "Setting ocaml_major_version to $ocaml_major_version"
echo "Setting ocaml_minor_version to $ocaml_minor_version"
fi
for i in ocamlfind ocamlc ocamlopt ocamldep ocamllex ocamlyacc ocamlmktop ocamlmklib camlp4o
do
printf "%s" "Finding OCaml tool $i..."
if [ -n "$ocaml_bin" -a -x "$ocaml_bin/$i" ]
then
xtool="$ocaml_bin/$i"
eval "tool_$i=$xtool"
elif xtool=`findpath $i`
then
eval "tool_$i=$xtool"
fi
if [ -n "$xtool" ]
then
echo "Found!"
else
echo "ERROR: Unable to find OCaml tool $i"
if [ "$i" != "ocamlfind" -a "$i" != "ocamlopt" ]
then
exit 1
fi
fi
done
if [ -z "$ocaml_lib" ]
then
if [ -d "$ocaml_home/lib" ]
then
ocaml_lib="$ocaml_home/lib"
fi
fi
printf "%s" "Checking for standard OCaml libraries... "
if [ -z "$ocaml_stdlib" ]
then
if [ -n "$ocaml_lib" ]
then
if [ -d "$ocaml_lib/ocaml" -a -f "$ocaml_lib/ocaml/stdlib.cma" ]
then
ocaml_stdlib="$ocaml_lib/ocaml"
fi
fi
if [ -z "$ocaml_stdlib" ]
then
ocaml_stdlib=`$ocaml_bin/ocamlc -where`
fi
fi
for i in nums.cma unix.cma str.cma bigarray.cma
do
if [ ! -f "$ocaml_stdlib/$i" ]
then
echo "ERROR: unable to find $i in $ocaml_stdlib"
exit 1
else
printf "%s" "$i "
fi
done
echo "Found!"
if [ -z "$ocaml_libasmrun" ]
then
if [ -d "$ocaml_stdlib" -a -f "$ocaml_stdlib/libasmrun.a" ]
then
ocaml_libasmrun=$ocaml_stdlib
fi
fi
if [ -z "$ocaml_pkglib" ]
then
if [ -n "$ocaml_lib" ]
then
if [ -d "$ocaml_lib/ocaml/pkg-lib" ]
then
ocaml_pkglib="$ocaml_lib/ocaml/pkg-lib"
elif [ -d "$ocaml_lib/ocaml/site-lib" ]
then
ocaml_pkglib="$ocaml_lib/ocaml/site-lib"
fi
fi
fi
printf "%s" "Checking for OCaml PCRE library... "
if [ -z "$ocaml_pcre" ]
then
if [ -n "$ocaml_pkglib" -a -d "$ocaml_pkglib/pcre" -a -f "$ocaml_pkglib/pcre/pcre.cmi" ]
then
ocaml_pcre="$ocaml_pkglib/pcre"
elif [ -n "$tool_ocamlfind" ]
then
ocaml_pcre=`$tool_ocamlfind query pcre 2>/dev/null`
fi
fi
if [ -n "$ocaml_pcre" -a -f "$ocaml_pcre/pcre.cmi" ]
then
echo "found"
else
echo "ERROR: unable to find pcre.cmi in $ocaml_pcre"
exit 1
fi
printf "%s" "Checking for OCaml netstring library... "
if [ -z "$ocaml_netstring" ]
then
if [ -n "$ocaml_pkglib" -a -d "$ocaml_pkglib/netstring" -a -f "$ocaml_pkglib/netstring/netstring_str.cmi" ]
then
ocaml_netstring="$ocaml_pkglib/netstring"
elif [ -n "$tool_ocamlfind" ]
then
ocaml_netstring=`$tool_ocamlfind query netstring 2>/dev/null`
fi
fi
if [ -n "$ocaml_netstring" -a -f "$ocaml_netstring/netstring_str.cmi" ]
then
echo "found"
else
echo "ERROR: unable to find netstring_str.cmi in $ocaml_netstring"
exit 1
fi
printf "%s" "Checking for OCaml netstring-pcre library... "
if [ -z "$ocaml_netstring_pcre" ]
then
if [ -n "$ocaml_pkglib" -a -d "$ocaml_pkglib/netstring-pcre" -a -f "$ocaml_pkglib/netstring-pcre/netstring_pcre.cmi" ]
then
ocaml_netstring_pcre="$ocaml_pkglib/netstring-pcre"
elif [ -n "$tool_ocamlfind" ]
then
ocaml_netstring_pcre=`$tool_ocamlfind query netstring-pcre 2>/dev/null`
fi
fi
if [ -n "$ocaml_netstring_pcre" -a -f "$ocaml_netstring_pcre/netstring_pcre.cmi" ]
then
echo "found"
else
echo "ERROR: unable to find netstring_pcre.cmi in $ocaml_netstring_pcre"
exit 1
fi
# equeue is needed by Http_client in netclient
printf "%s" "Checking for OCaml equeue library... "
if [ -z "$ocaml_equeue" ]
then
if [ -n "$ocaml_pkglib" -a -d "$ocaml_pkglib/equeue" -a -f "$ocaml_pkglib/equeue/unixqueue.cmi" ]
then
ocaml_equeue="$ocaml_pkglib/equeue"
elif [ -n "$tool_ocamlfind" ]
then
ocaml_equeue=`$tool_ocamlfind query equeue 2>/dev/null`
fi
fi
if [ -n "$ocaml_equeue" -a -f "$ocaml_equeue/unixqueue.cmi" ]
then
echo "found"
else
echo "ERROR: unable to find unixqueue.cmi in $ocaml_equeue"
exit 1
fi
printf "%s" "Checking for OCaml netclient library... "
if [ -z "$ocaml_netclient" ]
then
if [ -n "$ocaml_pkglib" -a -d "$ocaml_pkglib/netclient" -a -f "$ocaml_pkglib/netclient/http_client.cmi" ]
then
ocaml_netclient="$ocaml_pkglib/netclient"
elif [ -n "$tool_ocamlfind" ]
then
ocaml_netclient=`$tool_ocamlfind query netclient 2>/dev/null`
fi
fi
if [ -n "$ocaml_netclient" -a -f "$ocaml_netclient/http_client.cmi" ]
then
echo "found"
else
echo "ERROR: unable to find http_client.cmi in $ocaml_netclient"
exit 1
fi
printf "%s" "Checking for OCaml netsys library... "
if [ -z "$ocaml_netsys" ]
then
if [ -n "$ocaml_pkglib" -a -d "$ocaml_pkglib/netsys" -a -f "$ocaml_pkglib/netsys/netsys.cmi" ]
then
ocaml_netsys="$ocaml_pkglib/netsys"
elif [ -n "$tool_ocamlfind" ]
then
ocaml_netsys=`$tool_ocamlfind query netsys 2>/dev/null`
fi
fi
if [ -n "$ocaml_netsys" -a -f "$ocaml_netsys/netsys.cmi" ]
then
echo "found"
else
echo "ERROR: unable to find netsys.cmi in $ocaml_netsys"
exit 1
fi
printf "%s" "Checking for PXP..."
if [ -z "$ocaml_pxp" ]
then
if [ -n "$ocaml_pkglib" -a -d "$ocaml_pkglib/pxp-engine" -a -f "$ocaml_pkglib/pxp-engine/pxp_aux.cmi" ]
then
ocaml_pxp="$ocaml_pkglib/pxp-engine"
elif [ -n "$tool_ocamlfind" ]
then
ocaml_pxp=`$tool_ocamlfind query pxp-engine 2>/dev/null`
fi
fi
if [ -n "$ocaml_pxp" -a -f "$ocaml_pxp/pxp_aux.cmi" ]
then
echo "found"
else
echo "ERROR: unable to find pxp_aux.cmi in $ocaml_pxp"
exit 1
fi
# Note: We may only need this check if ISO 88591 has been
# requested.
#
printf "%s" "Checking for PXP-LEX-ISO88591..."
if [ -z "$ocaml_pxp_iso88591" ]
then
if [ -n "$ocaml_pkglib" -a -d "$ocaml_pkglib/pxp-lex-iso88591" -a -f "$ocaml_pkglib/pxp-lex-iso88591/pxp_lex_iso88591.cma" ]
then
ocaml_pxp_iso88591="$ocaml_pkglib/pxp-lex-iso88591"
elif [ -n "$tool_ocamlfind" ]
then
ocaml_pxp_iso88591=`$tool_ocamlfind query pxp-lex-iso88591 2>/dev/null`
fi
fi
if [ -n "$ocaml_pxp_iso88591" -a -f "$ocaml_pxp_iso88591/pxp_lex_iso88591.cma" ]
then
echo "found"
else
echo "ERROR: unable to find pxp_lex_iso88591.cma in $ocaml_pxp_iso88591"
exit 1
fi
# Note: We may only need this check if UTF8 has been
# requested.
#
printf "%s" "Checking for PXP-LEX-UTF8..."
if [ -z "$ocaml_pxp_utf8" ]
then
if [ -n "$ocaml_pkglib" -a -d "$ocaml_pkglib/pxp-lex-utf8" -a -f "$ocaml_pkglib/pxp-lex-utf8/pxp_lex_utf8_01.cmi" ]
then
ocaml_pxp_utf8="$ocaml_pkglib/pxp-lex-utf8"
elif [ -n "$tool_ocamlfind" ]
then
ocaml_pxp_utf8=`$tool_ocamlfind query pxp-lex-utf8 2>/dev/null`
fi
fi
if [ -n "$ocaml_pxp_utf8" -a -f "$ocaml_pxp_utf8/pxp_lex_utf8_01.cmi" ]
then
echo "found"
else
echo "ERROR: unable to find pxp_lex_utf8_01.cmi in $ocaml_pxp_utf8"
exit 1
fi
printf "%s" "Checking for Camomile..."
if [ -z "$ocaml_camomile" ]
then
if [ -n "$ocaml_pkglib" -a -d "$ocaml_pkglib/camomile" -a -f "$ocaml_pkglib/camomile/camomileLibrary.cmi" ]
then
ocaml_camomile="$ocaml_pkglib/camomile"
elif [ -n "$ocaml_pkglib" -a -d "$ocaml_pkglib/camomile" -a -f "$ocaml_pkglib/camomile/camomile.cmi" ]
then
ocaml_camomile="$ocaml_pkglib/camomile"
elif [ -n "$tool_ocamlfind" ]
then
ocaml_camomile=`$tool_ocamlfind query camomile 2>/dev/null`
fi
fi
if [ -n "$ocaml_camomile" -a -f "$ocaml_camomile/camomileLibraryDefault.cmi" ]
then
ocaml_camomile_version="0.8"
echo "found version 0.8"
elif [ -n "$ocaml_camomile" -a -f "$ocaml_camomile/camomileLibrary.cmi" ]
then
ocaml_camomile_version="0.7"
echo "found version 0.7"
elif [ -n "$ocaml_camomile" -a -f "$ocaml_camomile/camomile.cmi" ]
then
ocaml_camomile_version="0.6"
echo "found version 0.6"
else
echo "ERROR: unable to find camomileLibrary.cmi in $ocaml_camomile"
exit 1
fi
if [ "$with_c" -gt 0 -o "$with_java" -gt 0 ]
then
# echo "ERROR: C and JAVA APIs not supported in version $version. Remove -with-{c,java} option."
# exit 1
printf "%s" "Checking for C PCRE library..."
if [ -z "$clib_pcre" ]
then
if [ -f "$local_lib/libpcre.a" ]
then
clib_pcre=$local/lib
elif [ -f "/usr/local/lib/libpcre.a" ]
then
clib_pcre=/usr/local/lib
elif [ -f "/usr/lib/libpcre.a" ]
then
clib_pcre=/usr/lib
fi
fi
if [ -f "$clib_pcre/libpcre.a" ]
then
echo "Found!"
else
if [ -n "$clib_pcre" ]
then
echo "ERROR: unable to find libpcre.a in $clib_pcre"
else
echo "ERROR: unable to find libpcre.a"
fi
exit 1
fi
printf "%s" "Checking for libasmrun.a..."
if [ -f "$ocaml_libasmrun/libasmrun.a" ]
then
echo "Found!"
else
echo "ERROR: unable to find libasmrun.a"
exit 1
fi
fi
if [ "$with_java" -gt 0 ]
then
# echo "ERROR: JAVA API not supported in version $version. Remove -with-java option."
# exit 1
if [ -z "$java_home" ]
then
case "$host" in
*darwin*)
if [ -d "/System/Library/Frameworks/JavaVM.framework" ]
then
java_home="/System/Library/Frameworks/JavaVM.framework"
fi
;;
esac
fi
if [ -z "$java_bin" ]
then
if [ -n "$java_home" ]
then
if [ -x "$java_home/bin/javac" ]
then
java_bin=$java_home/bin
elif [ -x "$java_home/Commands/javac" ]
then
java_bin=$java_home/Commands
fi
fi
if [ -z "$java_bin" ]
then
java_bin=`findpath javac`
if [ -z "$java_bin" ]
then
java_bin=$local_bin
fi
fi
fi
echo "java_bin set to $java_bin"
if [ -z "$java_inc" ]
then
if [ -n "$java_home" ]
then
if [ -f "$java_home/include/jni.h" ]
then
java_inc=$java_home/include
elif [ -f "$java_home/Headers/jni.h" ]
then
java_inc=$java_home/Headers
fi
fi
if [ -z "$java_inc" ]
then
if [ -f "$local/include/jni.h" ]
then
java_inc=$local/include
elif [ -f "/usr/include/jni.h" ]
then
java_inc=/usr/include
fi
fi
fi
if [ -z "$java_sysinc" ]
then
case $host in
*linux*)
if [ -d $java_inc/linux ]
then
java_sysinc=$java_inc/linux
fi
;;
esac
fi
printf "%s" "Checking for Java tools..."
for i in java javac javah javadoc jar
do
if [ -n "$java_bin" -a -x "$java_bin/$i" ]
then
xtool="$java_bin/$i"
eval "tool_$i=$xtool"
elif xtool=`findpath $i`
then
eval "tool_$i=$xtool"
fi
if [ -n "$xtool" ]
then
printf "%s " $i
else
echo "ERROR: Unable to find Java tool $i"
exit 1
fi
done
echo "Found!"
printf "%s" "Checking for Java headers..."
for i in jni.h
do
if [ -n "$java_inc" -a -f "$java_inc/jni.h" ]
then
printf "%s " $i