forked from cooperative-computing-lab/cctools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure
executable file
·1607 lines (1359 loc) · 40.6 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
###########################
# *** Set for releases. ***
MAJOR=8
MINOR=0
MICRO=0
# Optionally set the source/tag for this code (e.g. RC1 or FINAL). Setting
# this variable is instead useful for statically naming the source when it will
# not match the branch name (like RC1 or FINAL).
RELEASE=DEVELOPMENT
###########################
# *** You should not need to change anything below this line. ***
###########################
. ./configure.tools.sh
uname -a
if [ -z "$USER" ]; then
USER=`whoami`
export USER
fi
save_arguments "$0" "$@"
# Bourne shell is tricky when you use backtick command substitution backslash
# has special meaning even when surrounded by single-quotes. It is necessary to
# escape the backslash.
# Here's what we want to exec literally:
# echo "$*" | sed s/#/\\#/ | sed s/\$/$$/
# The above sed commands are to escape the output for the Makefile.
# Arguments to configure which can be printed for version/debug information.
configure_arguments=`echo "$*" | sed 's/#/\\\\#/' | sed 's/\\$/$$/'`
# Bourne shell is tricky when you use backtick command substitution backslash
# has special meaning even when surrounded by single-quotes. It is necessary to
# escape the backslash.
# Here's what we want to exec literally:
# uname -a | sed s/#/\\#/ | sed s/\$/$$/
# The above sed commands are to escape the output for the Makefile.
system_information=`uname -a | sed 's/#/\\\\#/' | sed 's/\\$/$$/'`
BUILD_CPU="$(uname -m | tr \[a-z\] \[A-Z\])"
BUILD_DATE="$NOW"
BUILD_HOST="$(uname -n)"
BUILD_SYS="$(uname -s | tr \[a-z\] \[A-Z\] | awk -F_ '{print $1}')"
BUILD_USER="$USER"
if [ "$BUILD_CPU" = UNKNOWN ]
then
BUILD_CPU=`uname -p | tr \[a-z\] \[A-Z\]`
fi
case "$BUILD_CPU" in
I[0-9]86)
BUILD_CPU=I386
;;
POWER\ MACINTOSH)
BUILD_CPU=POWERPC
;;
esac
include_package_chirp="chirp"
include_package_deltadb="deltadb"
include_package_doc="doc"
include_package_ftplite="ftp_lite"
include_package_grow="grow"
include_package_makeflow="makeflow"
include_package_parrot="parrot"
include_package_poncho="poncho"
include_package_resource_monitor="resource_monitor"
include_package_taskvine="taskvine"
include_package_work_queue="work_queue"
swig_bindings=""
install_path="$HOME/cctools"
build_label=
build_date=
base_root="/usr"
globus_flavor=auto
ccompiler=${CC:-gcc}
cxxcompiler=${CXX:-g++}
linker="${ccompiler}"
ccflags="${CFLAGS} -D__EXTENSIONS__ -D_LARGEFILE64_SOURCE -D__LARGE64_FILES -Wall -Wextra -Wno-unused-result -fPIC"
c_only_flags="-std=c99"
config_zlib_path=yes
# config_PACKAGE_path possible values:
# no -> exclude from configuration
# yes -> include in configuration, and only from PACKAGE_path. If not found, exit with error.
# auto -> include in configuration if found in standard locations. If not found, exclude from configuration.
config_ext2fs_path=auto
config_fuse_path=auto
config_mysql_path=no
config_openssl_path=auto
config_python3_path=auto
config_readline_path=auto
config_swig_path=auto
config_perl_path=no
config_golang_path=no
config_curl_path=no
config_cvmfs_path=auto
config_globus_path=no
config_irods_path=no
config_uuid_path=no
config_xrootd_path=no
config_static_libgcc=yes
config_static_openssl=yes
while [ $# -gt 0 ]
do
opt=$1
arg=''
shift
case $opt in
# handle options of the form --opt=arg
--*=*)
arg=$(eval echo ${opt#*=})
opt=${opt%%=*}
;;
# empty arg only for these options
--debug|--strict|--sanitize|--static|--without-*|--help)
arg=''
;;
--*)
# handle options of the form --opt arg
arg=$1
shift
;;
esac
case $opt in
--debug)
optdebug=1
optstrict=1
;;
--prefix)
install_path=$(abspath "${arg}")
;;
--strict)
optstrict=1
;;
--sanitize)
optsanitize=1
;;
--static)
# example: CFLAGS=-D__MUSL__ CC=musl-gcc ./configure --without-system-doc --with-readline-path=no --static
optstatic=1
;;
--build-label)
build_label=${arg}
;;
--build-date)
build_date=${arg}
;;
--uge-parameter)
if [ -z "$uge_parameters" ]
then
uge_parameters="\#$ ${arg}"
else
uge_parameters="${uge_parameters}\n\#$ ${arg}"
fi
;;
--with-base-dir)
base_root=${arg}
;;
--with-curl-path)
curl_path=${arg}
config_curl_path=$(config_X_path ${arg})
;;
--with-cvmfs-path)
cvmfs_path=${arg}
config_cvmfs_path=$(config_X_path ${arg})
;;
--with-ext2fs-path)
ext2fs_path=${arg}
config_ext2fs_path=$(config_X_path ${arg})
;;
--with-fuse-path)
fuse_path=${arg}
config_fuse_path=$(config_X_path ${arg})
;;
--with-globus-path)
globus_path=${arg}
config_globus_path=$(config_X_path ${arg})
;;
--globus-flavor)
globus_flavor=${arg}
;;
--with-irods-path)
irods_path=${arg}
config_irods_path=$(config_X_path ${arg})
;;
--with-mysql-path)
mysql_path=${arg}
config_mysql_path=$(config_X_path ${arg})
;;
--with-openssl-path)
openssl_path=${arg}
config_openssl_path=$(config_X_path ${arg})
;;
--with-perl-path)
perl_path=${arg}
config_perl_path=$(config_X_path ${arg})
;;
--with-python-path)
python3_path=${arg}
config_python3_path=$(config_X_path ${arg})
;;
--with-python3-path)
python3_path=${arg}
config_python3_path=$(config_X_path ${arg})
;;
--with-readline-path)
readline_path=${arg}
config_readline_path=$(config_X_path ${arg})
;;
--with-swig-path)
swig_path=${arg}
config_swig_path=$(config_X_path ${arg})
;;
--with-uuid-path)
uuid_path=${arg}
config_uuid_path=$(config_X_path ${arg})
;;
--with-xrootd-path)
xrootd_path=${arg}
config_xrootd_path=$(config_X_path ${arg})
;;
--with-zlib-path)
zlib_path=${arg}
if [ "$zlib_path" = no ]
then
echo "*** zlib is not optional"
exit 1
fi
;;
--without-system-makeflow)
include_package_makeflow=""
;;
--without-system-ftp-lite)
include_package_ftplite=""
;;
--without-system-chirp)
include_package_chirp=""
;;
--without-system-grow)
include_package_grow=""
;;
--without-system-parrot)
include_package_parrot=""
;;
--without-system-poncho)
include_package_poncho=""
;;
--without-system-resource_monitor)
include_package_resource_monitor=""
;;
--without-system-doc)
include_package_doc=""
;;
--without-system-taskvine)
include_package_taskvine=""
;;
--without-system-work_queue)
include_package_workqueue=""
;;
--without-system-apps | --without-system-weaver | --without-system-mufasa | --without-system-umbrella | --without-system-prune )
;;
--with-*-path)
echo "ignoring unknown package ${arg}"
;;
--tcp-low-port)
ccflags="${ccflags} -DTCP_LOW_PORT_DEFAULT=${arg}"
;;
--tcp-high-port)
ccflags="${ccflags} -DTCP_HIGH_PORT_DEFAULT=${arg}"
;;
--without-static-libgcc)
config_static_libgcc=no
;;
--without-static-openssl)
config_static_openssl=no
;;
-h | -help | --h | --help)
cat <<EOF
Use: configure [options]
Where options are:
--help
--prefix <path>
--debug
--build-label <label>
--strict
--sanitize
--uge-parameter <parameter>
--globus-flavor <flavor>
--irods-flavor 3 | 4
--tcp-low-port <port>
--tcp-high-port <port>
--with-base-dir <dir> (where to find system libraries, default is /usr)
--with-PACKAGE-path <path>
--without-system-SYSTEM
Where PACKAGE may be:
curl
cvmfs
ext2fs
fuse
globus
irods
mysql
perl
python
python3
readline
swig
uuid
xrootd
zlib
And SYSTEM may be:
chirp
doc
ftp-lite
grow
makeflow
parrot
poncho
resource_monitor
taskvine
work_queue
EOF
exit 0
;;
*)
echo "Unknown option ${opt}"
exit 1
;;
esac
done
if [ x"${CONDA_BUILD}" != x1 -a -n "${CONDA_PREFIX}" ]
then
if [ "${base_root}" = "/usr" ]
then
echo 'Detected conda. Assuming --with-base-dir "${CONDA_PREFIX}"'
base_root="${CONDA_PREFIX}"
fi
fi
SOURCE=$RELEASE
if [ -n "$build_label" ]; then
SOURCE="$SOURCE $build_label"
fi
DATE=$NOW
if [ -n "$build_date" ]; then
DATE=$build_date
fi
VERSION="$MAJOR.$MINOR.$MICRO $SOURCE"
if [ "$optstrict" = 1 ]; then
ccflags="${ccflags} -Werror"
fi
export HOST_MULTIARCH=$(check_multiarch)
rm -f config.mk
require_path ${ccompiler}
require_gnu_make
if ! optional_path ${cxxcompiler}
then
echo "*** could not find a C++ compiler, skipping parrot support"
include_package_parrot=""
fi
# Lots of warnings are enabled by default, but several are too strict
# and crop up in third-party code, so we disable those checks.
# However, not all compilers support these flags, so we check each one.
for flag in no-unused-parameter no-unknown-pragmas no-deprecated-declarations no-unused-const-variable
do
if check_compiler_flag -W$flag
then
ccflags="${ccflags} -W$flag"
fi
done
#
# Currently, we rely on the linker --as-needed flag to sort out
# which dynamic libraries each executable actually needs.
# This is apparently a recent addition to gnu ld.
# A better solution would be to explicitly specify which libraries
# are needed by which executable, but this will come in a later version.
#
echon "checking if ld supports the --as-needed flag..."
if ld --help 2>&1 | grep -- --as-needed 2>&1 >/dev/null
then
echo "yes"
link_as_needed="-Xlinker --as-needed"
link_no_as_needed="-Xlinker --no-as-needed"
else
echo "no"
fi
ldflags="${LDFLAGS}"
if [ $BUILD_SYS = LINUX ]
then
if [ "${config_static_libgcc}" = yes ]
then
ldflags="${ldflags} -Xlinker -Bstatic -static-libgcc"
fi
ldflags="${ldflags} -Xlinker -Bdynamic ${link_as_needed}"
# Building in Conda generates a whole lot of spurious warnings while finding the right library.
# Suppress those warnings.
ldflags="${ldflags} -Wl,--no-warn-search-mismatch"
elif [ $BUILD_SYS != DARWIN ]
then
if [ "${config_static_libgcc}" = yes ]
then
ldflags="${ldflags} -static-libgcc"
fi
fi
if [ "$optsanitize" = 1 ]; then
ccflags="${ccflags} -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined"
ldflags="-fsanitize=address -lasan -lubsan ${ldflags}"
test_ccflags="-lasan -lubsan"
fi
##########################################################################
# SWITCH TO STATIC LINKING FOR UNCOMMON THIRD-PARTY PACKAGES
##########################################################################
library_search_mode=prefer_static
##########################################################################
if [ "$globus_flavor" = auto ]
then
if [ $BUILD_CPU = X86_64 ]
then
globus_flavor=gcc64
else
globus_flavor=gcc32
fi
fi
globus_avail=no
if [ $config_globus_path != no ]
then
globus_path=${globus_path:-${base_root}}
globus_avail=yes # assume yes until not found
if check_file ${globus_path}/include/${globus_flavor}/globus_common.h
then
echo "*** using a globus flavor of '$globus_flavor' (if this is wrong, use the --globus-flavor argument)"
globus_ccflags="-DHAS_GLOBUS_GSS -I${globus_path}/include -I${globus_path}/include/${globus_flavor}"
for library in globus_gss_assist globus_gssapi_gsi globus_gsi_proxy_core globus_gsi_credential globus_gsi_callback globus_oldgaa globus_gsi_sysconfig globus_gsi_cert_utils globus_openssl globus_openssl_error globus_callout globus_proxy_ssl globus_common ltdl
do
if library_search ${library}_${globus_flavor} ${globus_path}
then
globus_ldflags="${globus_ldflags} ${library_search_result}"
fi
done
elif check_file ${globus_path}/include/globus/globus_common.h
then
globus_ccflags="-DHAS_GLOBUS_GSS -I${globus_path}/lib/globus/include -I${globus_path}/include/globus"
for library in globus_gss_assist globus_gssapi_gsi globus_gsi_proxy_core globus_gsi_credential globus_gsi_callback globus_oldgaa globus_gsi_sysconfig globus_gsi_cert_utils globus_openssl globus_openssl_error globus_callout globus_proxy_ssl globus_common ltdl
do
if library_search $library ${globus_path}
then
globus_ldflags="${globus_ldflags} ${library_search_result}"
fi
done
else
# not found
globus_avail=no
fi
if [ "${globus_avail}" = yes ]
then
# globus needs openssl
config_openssl_path=yes
fi
fi
report_detection globus "${globus_avail}" "${config_globus_path}" "${globus_path}"
# irods >= 4.0 uses .so plugins which are found in /var/lib/irods.
# These require the parrot is linked with -rdynamic so that
# the plugins can refer to symbols in libRodsAPI.a in parrot.
# irods 4.x changed the API from C to C++, so we must look
# for .hpp files instead of .h files.
irods_avail=no
if [ $config_irods_path != no ]
then
irods_avail=yes # assume yes until a component not found
irods_path=${irods_path:-${base_root}}
if library_search RodsAPIs "${irods_path}/lib"
then
ldflags="${ldflags} -rdynamic"
irods_ldflags="${library_search_result}"
else
irods_avail=no
fi
if library_search irods_client_api "${irods_path}/lib"
then
irods_ldflags="${irods_ldflags} ${library_search_result}"
else
irods_avail=no
fi
for d in ${irods_path}/include/irods
do
irods_ccflags="${irods_ccflags} -DHAS_IRODS -DIRODS_USES_PLUGINS -DIRODS_USES_HPP -DIRODS_USES_ERROR_HPP -I$d"
done
boost_path=`ls -d ${irods_path}/lib/irods/externals`
if [ ! -d ${boost_path} ]
then
echo "*** Could not find irods boost in ${irods_path}/external"
irods_avail=no
fi
for subtype in system thread chrono filesystem regex
do
lib=${boost_path}/libboost_${subtype}.a
if [ -f $lib ]
then
echo "found $lib"
irods_ldflags="${irods_ldflags} $lib"
fi
done
jansson_path=${irods_path}/lib/irods/externals/libjansson.a
if check_file ${jansson_path}
then
irods_ldflags="${irods_ldflags} ${jansson_path}/libjansson.a"
else
echo "*** Could not find irods jansson in ${irods_path}/external"
irods_avail=no
fi
if [ "${irods_avail}" = yes ]
then
# irods needs openssl
config_openssl_path=yes
echo "*** warning: irods 4.x requires plugins installed in /var/lib, or for the irods_plugins_home variable to be set."
fi
fi
report_detection irods "${irods_avail}" "${config_irods_path}" "${irods_path}"
mysql_avail=no
if [ $config_mysql_path != no ]
then
mysql_avail=yes
mysql_path=${mysql_path:-${base_root}}
if library_search mysqlclient ${mysql_path} mysql
then
mysql_ldflags="${library_search_result}"
if [ "${mysql_path}" != "${base_root}" ]
then
mysql_ccflags="-I${mysql_path}/include"
fi
mysql_ccflags="${mysql_ccflags} -DHAS_MYSQL -DHAS_BXGRID"
else
mysql_avail=no
fi
# It seems that the various versions move around the key include file,
# so we check for it in several places here.
if [ -f ${mysql_path}/include/mysql.h ]
then
mysql_ccflags="${mysql_ccflags} -DHAS_MYSQL_H"
elif [ -f ${mysql_path}/include/mysql/mysql.h ]
then
mysql_ccflags="${mysql_ccflags} -DHAS_MYSQL_MYSQL_H"
else
mysql_avail=no
fi
if [ "${mysql_avail}" = yes ]
then
# mysql needs openssl
config_openssl_path=yes
fi
fi
report_detection mysql "${mysql_avail}" "${config_mysql_path}" "${mysql_path}"
xrootd_avail=no
if [ $config_xrootd_path != no ]
then
xrootd_avail=yes
xrootd_path=${xrootd_path:-${base_root}}
if check_file ${xrootd_path}/include/xrootd/XrdVersion.hh
then
xrootd_ccflags="-DHAS_XROOTD -I${xrootd_path}/include/xrootd"
for library in XrdPosix XrdClient XrdSys XrdNet XrdNetUtil XrdOuc
do
if library_search $library ${xrootd_path} ${xrootd_arch}
then
xrootd_ldflags="${xrootd_ldflags} ${library_search_result}"
else
echo "*** Couldn't find $library in ${xrootd_path}"
xrootd_avail=no
fi
done
else
xrootd_avail=no
fi
fi
if [ "${xrootd_avail}" = yes ]
then
# xrootd needs openssl
config_openssl_path=yes
fi
report_detection xrootd "${xrootd_avail}" "${config_xrootd_path}" "${xrootd_path}"
cvmfs_avail=no
if [ $config_cvmfs_path != no ]
then
cvmfs_avail=yes
cvmfs_path=${cvmfs_path:-${base_root}}
if check_file ${cvmfs_path}/include/libcvmfs.h && library_search cvmfs ${cvmfs_path}
then
cvmfs_ccflags="-DHAS_CVMFS -I${cvmfs_path}/include"
cvmfs_ldflags="${library_search_result}"
else
cvmfs_avail=no
fi
fi
if [ "${cvmfs_avail}" = yes ]
then
# cvmfs needs openssl and uuid
config_openssl_path=yes
config_uuid_path=yes
fi
report_detection cvmfs "${cvmfs_avail}" "${config_cvmfs_path}" "${cvmfs_path}"
# uuid only needed for cvmfs, thus we never use 'auto', only 'yes'
uuid_avail=no
if [ "${config_uuid_path}" = yes ]
then
uuid_avail=yes
uuid_path=${uuid_path:-${base_root}}
if library_search uuid $uuid_path
then
cvmfs_ldflags="${cvmfs_ldflags} ${library_search_result}"
else
uuid_avail=no
fi
fi
report_detection uuid "${uuid_avail}" "${config_uuid_path}" "${uuid_path}"
fuse_avail=no
if [ $config_fuse_path != no ]
then
fuse_avail=yes
fuse_path=${fuse_path:-${base_root}}
if library_search fuse3 ${fuse_path} || library_search fuse /
then
fuse_ccflags="-DHAS_FUSE"
if [ "${fuse_path}" != / -a "${fuse_path}" != ${base_root} ]
then
fuse_ccflags="${fuse_ccflags} -I${fuse_path}/include"
fi
fuse_ldflags="${library_search_result}"
else
fuse_avail=no
fi
fi
report_detection fuse "${fuse_avail}" "${config_fuse_path}" "${fuse_path}"
ext2fs_avail=no
if [ $config_ext2fs_path != no ]
then
ext2fs_avail=yes
ext2fs_path=${ext2fs_path:-${base_root}}
if [ "${fuse_avail}" = no ]
then
echo "*** ext2fs support requires fuse"
ext2fs_avail=no
elif library_search ext2fs ${ext2fs_path} || library_search ext2fs /
then
if [ "${ext2fs_path}" != / -a "${ext2fs_path}" != /usr ]
then
ext2fs_ccflags="-I${ext2fs_path}/include"
fi
ext2fs_ldflags="-DHAS_EXT2FS ${library_search_result} -lcom_err"
fi
fi
report_detection ext2fs "${ext2fs_avail}" "${config_ext2fs_path}" "${ext2fs_path}"
##########################################################################
# SWITCH BACK TO DYNAMIC LINKING FOR COMMON SYSTEM LIBRARIES
##########################################################################
library_search_mode=prefer_dynamic
##########################################################################
readline_avail=no
if [ $config_readline_path != no ]
then
readline_avail=yes
readline_path=${readline_path:-${base_root}}
if library_search readline ${readline_path}
then
external_libraries="${external_libraries} ${library_search_result}"
if [ "${readline_path}" != "${base_root}" ]
then
ccflags="${ccflags} -I${readline_path}/include"
fi
ccflags="${ccflags} -DHAS_LIBREADLINE"
# We rely on the --as-needed flag to figure out what dynamic
# libraries are actually used by each executable.
# However, libreadline doesn't properly specify a dependency
# on ncurses, termcap, and history, so we must force them to link.
if [ $BUILD_SYS = LINUX ]
then
# Remove the -lreadline that was added by "library_search readline" above
external_libraries=`echo $external_libraries | sed "s/-lreadline//"`
# Put the readline flags in a separate variable to be used only where needed.
readline_ldflags="-lreadline ${link_no_as_needed} -lncurses -lhistory ${link_as_needed}"
else
if library_search ncurses ${readline_path}
then
external_libraries="${external_libraries} ${library_search_result}"
fi
if library_search termcap ${readline_path}
then
external_libraries="${external_libraries} ${library_search_result}"
fi
if library_search history ${readline_path}
then
external_libraries="${external_libraries} ${library_search_result}"
fi
fi
else
readline_avail=no
fi
fi
report_detection readline "${readline_avail}" "${config_readline_path}" "${readline_path}"
curl_avail=no
if [ $config_curl_path != no ]
then
curl_avail=yes
curl_path=${curl_path:-${base_root}}
if library_search curl ${curl_path} || library_search curl /
then
if [ "${curl_path}" != / -a "${curl_path}" != /usr ]
then
curl_ccflags="-I${curl_path}/include"
fi
ccflags="${ccflags} -DHAS_CURL"
curl_ldflags="${library_search_result} -lcrypto"
else
curl_avail=no
fi
fi
report_detection curl "${curl_avail}" "${config_curl_path}" "${curl_path}"
if [ $BUILD_SYS = DARWIN ]
then
if [ -d "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include" ]
then
ccflags_append_define CCTOOLS_OSX_GETOPT_FROM_SDK
else
# The version of getopt.h packaged in cctools appears to cause a SIGBUS on Darwin.
# Mac OS X Command Line Tools need to be installed to obtain a getopt.h that works.
echo "*** Sorry, I can't proceed without Mac OS X Command Line Tools."
echo "*** Please refer to the installation instructions."
exit 1
fi
fi
### version requirements for swig:
# at least version 1.3.29 for python 2.4--2.7
# at least version 2.0.4 for python 3.0--
swig_avail=no
swig_exe=""
swig_version=""
if [ $config_swig_path != no ]
then
swig_avail=yes
swig_path=${swig_path:-${base_root}}
if [ "$optstatic" = 1 ]
then
echo "*** buildin statically, skipping swig support"
swig_avail=no
elif [ "${config_swig_path}" = auto ] && search_file_executable ${SWIG} swig
then
swig_exe="${executable_search_result}"
elif search_file_executable ${swig_path} ${swig_path}/bin/swig ${swig_path}/swig
then
swig_exe="${executable_search_result}"
else
swig_avail=no
fi
if [ "${swig_avail}" = yes ]
then
swig_version=$(${swig_exe} -version | grep -i version | awk '{print $3}')
fi
fi
report_detection swig "${swig_avail}" "${config_swig_path}" "${swig_path}"
perl_avail=no
perl_exe=""
perl_version=""
if [ $config_perl_path != no ]
then
perl_avail=yes
perl_path=${perl_path:-${base_root}}
if [ "${BUILD_SYS}" = DARWIN ]
then
echo "*** perl bindings not available in OSX"
perl_avail=no
elif [ "${swig_avail}" = no ]
then
echo "*** swig is needed for perl support"
perl_avail=no
elif [ "${config_perl_path}" = auto ] && search_file_executable perl
then
perl_exe=${executable_search_result}
elif search_file_executable ${perl_path} ${perl_path}/bin/perl
then
perl_exe=${executable_search_result}
else
perl_avail=no
fi
if [ "${perl_avail}" = yes ]
then
perl_version=$(${perl_exe} -e 'printf "%vd\n",$^V;' 2> /dev/null)
if [ $? = 0 ]
then
echo "perl version is ${perl_version}"
else
perl_avail=no
fi
fi
# check that the perl core module to ask for correct compilation flags is
# available
if "${perl_exe}" -e 'eval { require ExtUtils::Embed }; $@ ? exit(1) : exit(0)'
then
perl_ccflags=$(${perl_exe} -MExtUtils::Embed -e ccopts)
perl_ldflags=$(${perl_exe} -MExtUtils::Embed -e ldopts)
else
echo "*** perl core module ExtUtils::Embed is not available"
perl_avail=no
fi
if [ "${perl_avail}" = yes ]
then
# Remove -lperl, as it is not needed for swig, and it causes trouble if libperl is not compiled with -fPIC, as in conda.
perl_ldflags=`echo ${perl_ldflags} | sed 's/-lperl//g'`
if [ "${CONDA_BUILD}" = 1 ]
then
perl_install_dir="site_perl"
perl_ccflags="${perl_ccflags} -I${BUILD_PREFIX}/${BUILD}/sysroot/usr/include"
else
perl_install_dir="perl5/site_perl"
fi
swig_bindings="$swig_bindings perl"
fi
fi
report_detection perl "${perl_avail}" "${config_perl_path}" "${perl_path}"
### configure python3
python3_avail=no
python3_exe=""
python3_version=""
if [ $config_python3_path != no ]
then
python3_avail=yes
python3_path=${python3_path:-${base_root}}
if [ "${swig_avail}" = no ]
then
echo "*** swig is needed for python3 support"
python3_avail=no
elif [ $(format_version ${swig_version}) -lt $(format_version 2.0.4) ]
then
echo "*** swig version ${swig_version} is older than 2.0.4, disabling python3 support"
python3_avail=no
elif [ "${CONDA_BUILD}" = 1 -a -x "${PYTHON}" ]
then
python3_exe="${PYTHON}"
elif [ "${config_python3_path}" = auto ] && search_file_executable python3 python
then
python3_exe=${executable_search_result}
elif search_file_executable ${python3_path} ${python3_path}/bin/python3 ${python3_path}/bin/python ${python3_path}/python3 ${python3_path}/python
then
python3_exe=${executable_search_result}
else
python3_avail=no
fi
if [ "${python3_avail}" = yes ]
then
if [ "${CONDA_BUILD}" = 1 ]
then
python3_version="${PY_VER}"
else
python3_version=$(${python3_exe} -c 'import sys; print("{}.{}".format(sys.version_info[0],sys.version_info[1]))' 2> /dev/null)
fi
if [ -z "${python3_version}" ]
then
echo "*** could not find version of python from ${python3_exe}"
python3_avail=no
elif [ $(format_version ${python3_version}) -lt $(format_version 3.0) ]
then
echo "*** ${python3_exe} version ${python3_version} is not a python3"
python3_avail=no
else
echo "python version ${python3_version}"
fi
fi
if [ "${python3_avail}" = yes ]
then
python3_ccflags=$(${python3_exe} -c "import sysconfig as s; print('-I{} {}'.format(s.get_config_var('CONFINCLUDEPY'), s.get_config_var('CPPFLAGS')))")
python3_ldflags=$(${python3_exe} -c "import sysconfig as s; print(s.get_config_var('LDFLAGS'))")
if [ $BUILD_SYS = DARWIN ]
then
if [ "${CONDA_BUILD}" = 1 ]
then
python3_ldflags="-undefined dynamic_lookup"
else
python3_ldflags="$python3_ldflags -undefined dynamic_lookup"