~ubuntu-branches/ubuntu/trusty/cctools/trusty-proposed

« back to all changes in this revision

Viewing changes to .pc/multiarch-globus.patch/configure

  • Committer: Package Import Robot
  • Author(s): Dimitri John Ledkov
  • Date: 2013-12-21 14:23:02 UTC
  • Revision ID: package-import@ubuntu.com-20131221142302-jl9ak34dt2ek7s2c
Tags: 4.0-1ubuntu1
* Patch configure to include multiarch globus directory.
* Rebuild against openmpi1.6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
uname -a
 
4
 
 
5
if [ -z "$USER" ]; then
 
6
  USER=`whoami`
 
7
  export USER
 
8
fi
 
9
 
 
10
. ./configure.tools
 
11
 
 
12
save_arguments $0 $@
 
13
 
 
14
major=4
 
15
minor=0
 
16
micro=0
 
17
 
 
18
# On a release, type would be changed from TRUNK to RELEASE.  TRUNK is a useful
 
19
# signal that the user is not using a blessed (tagged) release.
 
20
type="RELEASE"
 
21
 
 
22
version="$major.$minor.$micro-$type"
 
23
 
 
24
# The release date is set automatically at configure time (the default).
 
25
# For a tagged release, this should be the hard-coded date of the release.
 
26
release_date=`date +%m/%d/%Y`
 
27
 
 
28
# Bourne shell is tricky when you use backtick command substitution backslash
 
29
# has special meaning even when surrounded by single-quotes. It is necessary to
 
30
# escape the backslash.
 
31
# Here's what we want to exec literally:
 
32
#   echo "$*" | sed s/#/\\#/ | sed s/\$/$$/
 
33
# The above sed commands are to escape the output for the Makefile.
 
34
# Arguments to configure which can be printed for version/debug information.
 
35
configure_arguments=`echo "$*" | sed 's/#/\\\\#/' | sed 's/\\$/$$/'`
 
36
 
 
37
# Bourne shell is tricky when you use backtick command substitution backslash
 
38
# has special meaning even when surrounded by single-quotes. It is necessary to
 
39
# escape the backslash.
 
40
# Here's what we want to exec literally:
 
41
#   uname -a | sed s/#/\\#/ | sed s/\$/$$/
 
42
# The above sed commands are to escape the output for the Makefile.
 
43
system_information=`uname -a | sed 's/#/\\\\#/' | sed 's/\\$/$$/'`
 
44
 
 
45
build_user="$USER"
 
46
build_host=`uname -n`
 
47
# this setting is actually used to identify GNU libc platforms
 
48
# and Debian is all GNU libc, so force "Linux" even on non-Linux systems
 
49
build_sys=LINUX
 
50
build_cpu=`dpkg-architecture -qDEB_BUILD_ARCH | tr \[a-z-\] \[A-Z_\]`
 
51
 
 
52
if [ "${build_cpu}" = UNKNOWN ]
 
53
then
 
54
        build_cpu=`uname -p | tr \[a-z\] \[A-Z\]`
 
55
fi
 
56
 
 
57
case "$build_cpu" in
 
58
        I[0-9]86)
 
59
        build_cpu=I386
 
60
        ;;
 
61
        POWER\ MACINTOSH)
 
62
        build_cpu=POWERPC
 
63
        ;;
 
64
        SUN4V)
 
65
        build_cpu=SPARC
 
66
        ;;
 
67
esac
 
68
 
 
69
include_package_sand="sand"
 
70
include_package_allpairs="allpairs"
 
71
include_package_wavefront="wavefront"
 
72
include_package_makeflow="makeflow"
 
73
include_package_ftplite="ftp_lite"
 
74
include_package_s3tools="s3tools"
 
75
include_package_chirp="chirp"
 
76
include_package_resource_monitor="resource_monitor"
 
77
include_package_resource_monitor_visualizer="resource_monitor_visualizer"
 
78
include_package_doc="doc"
 
79
 
 
80
work_queue_bindings=""
 
81
 
 
82
echo "checking for package compatibility..."
 
83
 
 
84
if [ -d parrot -a $build_sys = LINUX ]
 
85
then
 
86
        if [ $build_cpu = I386 -o $build_cpu = AMD64 ]
 
87
        then
 
88
                echo "parrot IS supported on ${build_sys} ${build_cpu}"
 
89
                include_package_parrot="parrot"
 
90
        else
 
91
                echo "parrot is NOT supported on ${build_sys} ${build_cpu}"
 
92
                include_package_parrot=""
 
93
        fi
 
94
else
 
95
        echo "parrot is NOT supported on ${build_sys} for any cpu type"
 
96
        include_package_parrot=""
 
97
fi
 
98
 
 
99
if [ -d resource_monitor ]
 
100
then
 
101
        if [ $build_sys = LINUX -o $build_sys = DARWIN ]
 
102
        then
 
103
                echo "resource_monitor IS supported on ${build_sys}"
 
104
                include_package_resource_monitor="resource_monitor"
 
105
        else
 
106
                echo "resource_monitor is NOT (yet) supported on ${build_sys}"
 
107
                include_package_resource_monitor=""
 
108
        fi
 
109
fi
 
110
 
 
111
install_path="$HOME/cctools"
 
112
 
 
113
krb5_path="/usr"
 
114
readline_path="/usr"
 
115
globus_path="/usr"
 
116
fuse_path="/usr"
 
117
rfio_path="/usr"
 
118
dcap_path="/usr"
 
119
irods_path="/usr"
 
120
mysql_path="/usr"
 
121
perl_path="/usr"
 
122
python_path="/usr"
 
123
xrootd_path="/usr"
 
124
cvmfs_path="/usr"
 
125
mpi_path="/usr/local"
 
126
zlib_path="/usr"
 
127
swig_path="/usr"
 
128
 
 
129
xrootd_arch=auto
 
130
globus_flavor=auto
 
131
 
 
132
ccompiler=gcc
 
133
cxxcompiler=g++
 
134
mpicompiler=mpicc
 
135
 
 
136
ccflags="-D__EXTENSIONS__ -D_LARGEFILE64_SOURCE -D__LARGE64_FILES -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-deprecated-declarations -fno-exceptions"
 
137
# accepted CCFLAGS from outside
 
138
ccflags="$ccflags $CFLAGS"
 
139
 
 
140
if [ ${build_sys} != CYGWIN ]
 
141
then
 
142
        ccflags="${ccflags} -fPIC"
 
143
fi
 
144
 
 
145
 
 
146
config_readline_path=auto
 
147
config_globus_path=auto
 
148
config_fuse_path=auto
 
149
config_mysql_path=auto
 
150
config_perl_path=auto
 
151
config_python_path=auto
 
152
config_zlib_path=yes
 
153
 
 
154
config_krb5_path=no
 
155
config_rfio_path=no
 
156
config_dcap_path=no
 
157
config_irods_path=no
 
158
config_xrootd_path=no
 
159
config_cvmfs_path=no
 
160
config_mpi_path=no
 
161
config_swig_path=auto
 
162
 
 
163
if [ "X${GLOBUS_LOCATION}" != "X" ]
 
164
then
 
165
        globus_path=${GLOBUS_LOCATION}
 
166
fi
 
167
 
 
168
IFS=" ="
 
169
export IFS
 
170
 
 
171
while [ $# -gt 0 ]
 
172
do
 
173
        case $1 in
 
174
                --prefix)
 
175
                        shift
 
176
                        install_path=$1
 
177
                        ;;
 
178
                --strict)
 
179
                        ccflags="${ccflags} -Werror"
 
180
                        ;;
 
181
                --with-globus-path)
 
182
                        shift
 
183
                        globus_path=$1
 
184
                        config_globus_path=yes
 
185
                        ;;
 
186
                --globus-flavor)
 
187
                        shift
 
188
                        globus_flavor=$1
 
189
                        ;;
 
190
                --with-krb5-path)
 
191
                        shift
 
192
                        krb5_path=$1
 
193
                        config_krb5_path=yes
 
194
                        ;;
 
195
                --with-readline-path)
 
196
                        shift
 
197
                        readline_path=$1
 
198
                        config_readline_path=yes
 
199
                        ;;
 
200
                --with-fuse-path)
 
201
                        shift
 
202
                        fuse_path=$1
 
203
                        config_fuse_path=yes
 
204
                        ;;
 
205
                --with-rfio-path)
 
206
                        shift
 
207
                        rfio_path=$1
 
208
                        config_rfio_path=yes
 
209
                        ;;
 
210
                --with-dcap-path)
 
211
                        shift
 
212
                        dcap_path=$1
 
213
                        config_dcap_path=yes
 
214
                        ;;
 
215
                --with-irods-path)
 
216
                        shift
 
217
                        irods_path=$1
 
218
                        config_irods_path=yes
 
219
                        ;;
 
220
                --with-mysql-path)
 
221
                        shift
 
222
                        mysql_path=$1
 
223
                        config_mysql_path=yes
 
224
                        ;;
 
225
                --with-perl-path)
 
226
                        shift
 
227
                        perl_path=$1
 
228
                        config_perl_path=yes
 
229
                        ;;
 
230
                --with-python-path)
 
231
                        shift
 
232
                        python_path=$1
 
233
                        config_python_path=yes
 
234
                        ;;
 
235
                --with-xrootd-path)
 
236
                        shift
 
237
                        xrootd_path=$1
 
238
                        config_xrootd_path=yes
 
239
                        ;;
 
240
                --with-cvmfs-path)
 
241
                        shift
 
242
                        cvmfs_path=$1
 
243
                        config_cvmfs_path=yes
 
244
                        ;;
 
245
                --with-zlib-path)
 
246
                        shift
 
247
                        zlib_path=$1
 
248
                        config_zlib_path=yes
 
249
                        ;;
 
250
                --with-mpi-path)
 
251
                        shift
 
252
                        mpi_path=$1
 
253
                        config_mpi_path=yes
 
254
                        ;;
 
255
                --with-swig-path)
 
256
                        shift
 
257
                        swig_path=$1
 
258
                        config_swig_path=yes
 
259
                        ;;
 
260
                --without-system-sand)
 
261
                        include_package_sand=""
 
262
                        if [ $include_package_allpairs != "" ]
 
263
                        then
 
264
                                echo "*** skipping system 'allpairs' because of dependencies"
 
265
                                include_package_allpairs=""
 
266
                        fi
 
267
                        ;;
 
268
                --without-system-allpairs)
 
269
                        include_package_allpairs=""
 
270
                        ;;
 
271
                --without-system-wavefront)
 
272
                        include_package_wavefront=""
 
273
                        ;;
 
274
                --without-system-makeflow)
 
275
                        include_package_makeflow=""
 
276
                        ;;
 
277
                --without-system-ftp-lite)
 
278
                        include_package_ftplite=""
 
279
                        ;;
 
280
                --without-system-s3tools)
 
281
                        include_package_s3tools=""
 
282
                        ;;
 
283
                --without-system-chirp)
 
284
                        include_package_chirp=""
 
285
                        ;;
 
286
                --without-system-parrot)
 
287
                        include_package_parrot=""
 
288
                        ;;
 
289
                --without-system-resource_monitor)
 
290
                        include_package_resource_monitor=""
 
291
                        ;;
 
292
                --without-system-resource_monitor_visualizer)
 
293
                        include_package_resource_monitor_visualizer=""
 
294
                        ;;
 
295
                --without-system-doc)
 
296
                        include_package_doc=""
 
297
                        ;;
 
298
                --xrootd-arch)
 
299
                        shift
 
300
                        xrootd_arch=$1
 
301
                        ;;
 
302
                --with-*-path)
 
303
                        echo "ignoring unknown package $1"
 
304
                        shift
 
305
                        ;;
 
306
                --tcp-low-port)
 
307
                        shift
 
308
                        ccflags="${ccflags} -DTCP_LOW_PORT_DEFAULT=$1"
 
309
                        ;;
 
310
                --tcp-high-port)
 
311
                        shift
 
312
                        ccflags="${ccflags} -DTCP_HIGH_PORT_DEFAULT=$1"
 
313
                        ;;
 
314
                -h | -help | --h | --help)
 
315
                        cat <<EOF
 
316
Use: configure [options]
 
317
Where options are:
 
318
  --help
 
319
  --prefix             <path>
 
320
  --strict
 
321
  --globus-flavor      <flavor>
 
322
  --xrootd-arch        <arch>
 
323
  --tcp-low-port       <port>
 
324
  --tcp-high-port      <port>
 
325
  --with-PACKAGE-path  <path>
 
326
  --without-system-SYSTEM
 
327
 
 
328
Where PACKAGE may be:
 
329
    readline
 
330
    krb5
 
331
    fuse
 
332
    rfio
 
333
    dcap
 
334
    globus
 
335
    irods
 
336
    mysql
 
337
    perl
 
338
    python
 
339
    xrootd
 
340
    zlib
 
341
    cvmfs
 
342
    swig
 
343
 
 
344
And SYSTEM may be:
 
345
    sand
 
346
    allpairs
 
347
    wavefront
 
348
    makeflow
 
349
    ftp-lite
 
350
    s3tools
 
351
    chirp
 
352
    parrot
 
353
    resource_monitor
 
354
    resource_monitor_visualizer
 
355
    doc
 
356
EOF
 
357
                        exit 1
 
358
                        ;;
 
359
                *)
 
360
                        echo "Unknown argument $1"
 
361
                        exit 1
 
362
                        ;;
 
363
        esac
 
364
        shift
 
365
done
 
366
 
 
367
IFS=" "
 
368
export IFS
 
369
 
 
370
potential_packages="dttools work_queue ${include_package_sand} ${include_package_allpairs} ${include_package_wavefront} ${include_package_makeflow} ${include_package_ftplite} ${include_package_s3tools} ${include_package_chirp} ${include_package_parrot} ${include_package_resource_monitor} ${include_package_resource_monitor_visualizer} ${include_package_doc}"
 
371
 
 
372
check_multiarch
 
373
 
 
374
rm -f Makefile.config
 
375
echo "checking for all the things I know how to build..."
 
376
for p in $potential_packages
 
377
do
 
378
        if [ -d $p ]
 
379
        then
 
380
                echo "package $p found"
 
381
                packages="${packages} $p"
 
382
                if [ -d `pwd`/$p/src ]
 
383
                then
 
384
                        internal_ccflags="${internal_ccflags} -I`pwd`/$p/src"
 
385
                        internal_ldflags="${internal_ldflags} -L`pwd`/$p/src"
 
386
                fi
 
387
        else
 
388
                echo "package $p not found (that's ok)"
 
389
        fi
 
390
done
 
391
 
 
392
require_path ${ccompiler}
 
393
require_path ${cxxcompiler}
 
394
require_gnu_make
 
395
 
 
396
#
 
397
# Currently, we rely on the linker --as-needed flag to sort out
 
398
# which dynamic libraries each executable actually needs.
 
399
# This is apparently a recent addition to gnu ld.
 
400
# A better solution would be to explicitly specify which libraries
 
401
# are needed by which executable, but this will come in a later version.
 
402
#
 
403
 
 
404
echo -n "checking if ld supports the --as-needed flag..."
 
405
if ld --help 2>&1 | grep -- --as-needed 2>&1 >/dev/null 
 
406
then
 
407
        echo "yes"
 
408
        link_as_needed="-Xlinker --as-needed"
 
409
        link_no_as_needed="-Xlinker --no-as-needed"
 
410
else
 
411
        echo "no"
 
412
fi
 
413
 
 
414
if [ $build_sys = LINUX ]
 
415
then
 
416
        ldflags="${link_as_needed}"
 
417
else
 
418
        ldflags="-static-libgcc"
 
419
fi
 
420
 
 
421
# accept ldflags from outside
 
422
ldflags="$ldflags $LDFLAGS"
 
423
 
 
424
##########################################################################
 
425
# SWITCH TO STATIC LINKING FOR UNCOMMON THIRD-PARTY PACKAGES
 
426
##########################################################################
 
427
library_search_mode=prefer_dynamic
 
428
##########################################################################
 
429
 
 
430
if [ $config_rfio_path != no ] && library_search shift ${rfio_path}
 
431
then
 
432
        ccflags="${ccflags} -I${rfio_path}/include -DHAS_RFIO"
 
433
else
 
434
        if [ $config_rfio_path = yes ]
 
435
        then
 
436
                  echo "*** Sorry, I couldn't find RFIO in $rfio_path"
 
437
                  echo "*** Check --with-rfio-path and try again."
 
438
                  exit 1
 
439
        else
 
440
                  echo "*** skipping rfio support"
 
441
        fi
 
442
fi
 
443
 
 
444
if [ $config_dcap_path != no ] && library_search dcap ${dcap_path}
 
445
then
 
446
        ccflags="${ccflags} -I${dcap_path}/dcap -DHAS_DCAP"
 
447
else
 
448
        if [ $config_dcap_path = yes ]
 
449
        then
 
450
                echo "*** Sorry, I couldn't find dcap in ${dcap_path}"
 
451
                echo "*** Check --with-dcap-path and try again."
 
452
                exit 1
 
453
        else
 
454
                echo "*** skipping dcap support"
 
455
        fi
 
456
fi
 
457
 
 
458
if [ x$globus_flavor = xauto ]
 
459
then
 
460
        if [ $build_cpu = X86_64 ] 
 
461
        then
 
462
                globus_flavor=gcc64
 
463
        else
 
464
                globus_flavor=gcc32
 
465
        fi
 
466
fi
 
467
 
 
468
echo "using a globus flavor of '$globus_flavor' (if this is wrong, use the --globus-flavor argument)"
 
469
 
 
470
if [ $config_globus_path != no ]
 
471
then
 
472
        if check_file ${globus_path}/include/${globus_flavor}/globus_common.h
 
473
        then
 
474
                ccflags="${ccflags} -I${globus_path}/include/${globus_flavor} -DHAS_GLOBUS_GSS"
 
475
                ldflags="${ldflags} -L${globus_path}/lib"
 
476
                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
 
477
                do
 
478
                        library_search ${library}_${globus_flavor} ${globus_path}
 
479
                done
 
480
 
 
481
                cctools_dynamic_auth_libs="${cctools_dynamic_auth_libs} -L${globus_path}/lib -lglobus_gss_assist_${globus_flavor}"
 
482
 
 
483
        elif check_file ${globus_path}/include/globus/globus_common.h
 
484
        then
 
485
                ccflags="${ccflags} -I${globus_path}/lib/globus/include -I${globus_path}/include/globus -DHAS_GLOBUS_GSS"
 
486
                ldflags="${ldflags} -L${globus_path}/lib"
 
487
                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
 
488
                do
 
489
                        library_search $library ${globus_path}
 
490
                done
 
491
 
 
492
                cctools_dynamic_auth_libs="${cctools_dynamic_auth_libs} -L${globus_path}/lib -lglobus_gss_assist"
 
493
 
 
494
        else
 
495
                if [ $config_globus_path = yes ]
 
496
                then
 
497
                        echo "*** Sorry, I couldn't find Globus in $globus_path"
 
498
                        echo "*** Check --with-globus-path and try again."
 
499
                        exit 1
 
500
                else
 
501
                        echo "*** skipping globus support"
 
502
                fi
 
503
        fi
 
504
else
 
505
        echo "*** skipping globus support"
 
506
fi
 
507
 
 
508
if [ $config_irods_path != no ] && library_search RodsAPIs "${irods_path}" core/obj
 
509
then
 
510
        ccflags="${ccflags} -I${irods_path}/lib/core/include -I${irods_path}/lib/api/include -I${irods_path}/lib/md5/include -I${irods_path}/server/core/include -I${irods_path}/server/api/include -I${irods_path}/server/icat/include -I${irods_path}/server/drivers/include -I${irods_path}/server/re/include -DHAS_IRODS"
 
511
else
 
512
        if [ $config_irods_path = yes ]
 
513
        then
 
514
                echo "*** Sorry, I couldn't find IRODS in $irods_path"
 
515
                echo "*** Check --with-irods-path and try again."
 
516
                exit 1
 
517
        else
 
518
                echo "*** skipping irods support"
 
519
        fi
 
520
fi
 
521
 
 
522
if [ $config_mysql_path != no ] && library_search mysqlclient ${mysql_path}
 
523
then
 
524
        if [ ${mysql_path} != /usr ]
 
525
        then
 
526
                ccflags="${ccflags} -I${mysql_path}/include"
 
527
        fi
 
528
 
 
529
        ccflags="${ccflags} -DHAS_MYSQL -DHAS_BXGRID"
 
530
 
 
531
        # MySQL requires zlib
 
532
        if library_search z ${zlib_path}
 
533
        then
 
534
                if [ X${zlib_path} != X/usr ]
 
535
                then
 
536
                    
 
537
                        ccflags="${ccflags} -I${zlib_path}/include"
 
538
                        ldflags="${ldflags} -L${zlib_path}/lib"
 
539
                fi
 
540
        else
 
541
                echo "*** Sorry, I couldn't find zlib in $zlib_path"
 
542
                echo "*** Check --with-zlib-path and try again."
 
543
                exit 1
 
544
        fi
 
545
else
 
546
        if [ $config_mysql_path = yes ]
 
547
        then
 
548
                echo "*** Sorry, I couldn't find MySQL in $mysql_path"
 
549
                echo "*** Check --with-mysql-path and try again."
 
550
                exit 1
 
551
        else
 
552
                echo "*** skipping mysql support"
 
553
        fi
 
554
fi
 
555
 
 
556
if [ $config_mpi_path != no ] && check_file ${mpi_path}/bin/mpicc && check_file ${mpi_path}/include/mpi/mpi.h
 
557
then
 
558
        mpilinker=${mpi_path}/bin/mpicc
 
559
        usempi="true"
 
560
        ccflags="${ccflags} -I${mpi_path}/include/mpi -DHAS_MPI"
 
561
else
 
562
        usempi="false"
 
563
        if [ $config_mpi_path = yes ]
 
564
        then
 
565
                echo "*** Sorry, I couldn't find mpicc or mpi.h in $mpi_path"
 
566
                echo "*** Check --with-mpi-path and try again."
 
567
                exit 1
 
568
        else
 
569
                echo "*** skipping mpi support"
 
570
        fi
 
571
fi
 
572
 
 
573
if [ $config_xrootd_path != no ] && check_file ${xrootd_path}/include/xrootd/XrdVersion.hh
 
574
then
 
575
        if [ x$xrootd_arch = xauto ]
 
576
        then
 
577
                if [ $build_cpu = X86_64 ] 
 
578
                then
 
579
                        xrootd_arch=x86_64_linux_26
 
580
                else
 
581
                        xrootd_arch=i386_linux26
 
582
                fi
 
583
        fi
 
584
 
 
585
        echo "using an xrootd arch of '$xrootd_arch' (if this is wrong, use the --xrootd-arch argument)"
 
586
 
 
587
        ccflags="${ccflags} -I${xrootd_path}/include/xrootd -DHAS_XROOTD"
 
588
 
 
589
        for library in XrdPosix XrdClient XrdSys XrdNet XrdNetUtil XrdOuc
 
590
        do
 
591
                if ! library_search $library ${xrootd_path} ${xrootd_arch}
 
592
                then
 
593
                        echo "*** Couldn't find $library in ${xrootd_path}"
 
594
                        exit 1
 
595
                fi
 
596
                        
 
597
        done
 
598
else
 
599
        if [ $config_xrootd_path = yes ]
 
600
        then
 
601
                echo "*** Sorry, I couldn't find xrootd in ${xrootd_path}"
 
602
                echo "*** Check --with-xrootd-path and try again."
 
603
                exit 1
 
604
        else
 
605
                echo "*** skipping xrootd support"
 
606
        fi
 
607
fi
 
608
 
 
609
if [ $config_cvmfs_path != no ] && check_file ${cvmfs_path}/include/libcvmfs.h
 
610
then
 
611
        ccflags="${ccflags} -I${cvmfs_path}/include -DHAS_CVMFS"
 
612
 
 
613
        for library in cvmfs 
 
614
        do
 
615
                if ! library_search $library ${cvmfs_path}
 
616
                then
 
617
                        echo "*** Couldn't find $library in ${lib_path}"
 
618
                        exit 1
 
619
                fi
 
620
        done
 
621
else
 
622
        if [ $config_cvmfs_path = yes ]
 
623
        then
 
624
                echo "*** Sorry, I couldn't find cvmfs in ${cvmfs_path}"
 
625
                echo "*** Check --with-cvmfs-path and try again."
 
626
                exit 1
 
627
        else
 
628
                echo "*** skipping cvmfs support"
 
629
        fi
 
630
fi
 
631
 
 
632
##########################################################################
 
633
# SWITCH BACK TO DYNAMIC LINKING FOR COMMON SYSTEM LIBRARIES
 
634
##########################################################################
 
635
library_search_mode=prefer_dynamic
 
636
##########################################################################
 
637
 
 
638
if [ $config_readline_path != no ] && library_search readline ${readline_path}
 
639
then
 
640
        if [ ${readline_path} != /usr ]
 
641
        then
 
642
                ccflags="${ccflags} -I${readline_path}/include"
 
643
        fi
 
644
        
 
645
        ccflags="${ccflags} -DHAS_LIBREADLINE"
 
646
 
 
647
        # We rely on the --as-needed flag to figure out what dynamic
 
648
        # libraries are actually used by each executable.
 
649
        # However, libreadline doesn't properly specify a dependency
 
650
        # on ncurses, termcap, and history, so we must force them to link.
 
651
 
 
652
        if [ $build_sys = LINUX ]
 
653
        then
 
654
                # Remove the -lreadline that was added by "library_search readline" above
 
655
                ldflags=`echo $ldflags | sed "s/-lreadline//"`
 
656
 
 
657
                # Put the readline flags in a separate variable to be used only where needed.
 
658
                cctools_readline_ldflags="-lreadline ${link_no_as_needed} -lncurses -lhistory ${link_as_needed}"
 
659
        else 
 
660
                library_search ncurses ${readline_path}
 
661
                library_search termcap ${readline_path}
 
662
                library_search history ${readline_path}
 
663
        fi
 
664
else    
 
665
        echo "*** skipping readline..."
 
666
fi
 
667
 
 
668
if [ $config_fuse_path != no ]
 
669
then
 
670
        if library_search fuse ${fuse_path} || library_search fuse /
 
671
        then
 
672
                if [ x${fuse_path} != x/ -a x${fuse_path} != x/usr ]
 
673
                then
 
674
                        ccflags="${ccflags} -I${fuse_path}/include"
 
675
                fi
 
676
                ccflags="${ccflags} -DHAS_FUSE"
 
677
        else
 
678
                if [ $config_fuse_path = yes ]
 
679
                then
 
680
 
 
681
                        echo "*** Sorry, I couldn't find Fuse in $fuse_path"
 
682
                        echo "*** Check --with-fuse-path and try again."
 
683
                        exit 1
 
684
                else
 
685
                        echo "*** skipping fuse support"
 
686
                fi
 
687
        fi
 
688
else
 
689
        echo "*** skipping fuse support"
 
690
fi
 
691
 
 
692
# Solaris places kerberos includes in a strange place.
 
693
 
 
694
if [ -d ${krb5_path}/include/kerberosv5 ]
 
695
then
 
696
        krb5_include_path=${krb5_path}/include/kerberosv5
 
697
else
 
698
        krb5_include_path=${krb5_path}/include
 
699
fi
 
700
 
 
701
if [ $config_krb5_path != no ] && check_file ${krb5_include_path}/krb5.h && library_search krb5 "${krb5_path}"
 
702
then
 
703
        if [ ${krb5_include_path} != /usr/include ]
 
704
        then
 
705
                ccflags="${ccflags} -I${krb5_include_path}"
 
706
        fi
 
707
 
 
708
        cctools_dynamic_auth_libs="${cctools_dynamic_auth_libs} -L${krb5_path}/lib -lkrb5"
 
709
 
 
710
        ccflags="${ccflags} -DHAS_KRB5"
 
711
else
 
712
        if [ $config_krb5_path = yes ]
 
713
        then
 
714
                echo "*** Sorry, I couldn't find Kerberos in $krb5_path"
 
715
                echo "*** Check --with-krb5-path and try again."
 
716
                exit 1
 
717
        else
 
718
                echo "*** skipping krb5 support"
 
719
        fi
 
720
fi
 
721
 
 
722
if [ $config_perl_path != no ]
 
723
then
 
724
        if check_file ${perl_path}/bin/perl
 
725
        then
 
726
                perl=${perl_path}/bin/perl
 
727
        else
 
728
                perl=0
 
729
        fi
 
730
 
 
731
        if [ $perl != 0 ]
 
732
        then
 
733
                perl_version=`${perl} -e 'printf "%vd\n",$^V;'`
 
734
                if [ $? = 0 ]
 
735
                then
 
736
                        echo "perl version is ${perl_version}"
 
737
                else
 
738
                        perl=0
 
739
                fi
 
740
        fi
 
741
 
 
742
        if [ $perl != 0 ]
 
743
        then
 
744
                perl_ccflags=`${perl} -MExtUtils::Embed -e ccopts`
 
745
                perl_ldflags=`${perl} -MExtUtils::Embed -e ldopts`
 
746
 
 
747
                if [ $? = 0 ]
 
748
                then
 
749
                        # On OSX, the ExtUtils::Embed options contain options
 
750
                        # to generate triple-fat binaries, which fails when
 
751
                        # we attempt to bring in our thin binaries.
 
752
 
 
753
                        # To avoid this problem, remove all of the -arch XXX
 
754
                        # arguments, so that the compiler produces the default,
 
755
                        # which will be compatible with the other objects we compile.
 
756
 
 
757
                        if [ ${build_sys} = DARWIN ]
 
758
                        then
 
759
                                perl_ccflags=`echo ${perl_ccflags} | sed 's/-arch [^ ]* *//g'`
 
760
                                perl_ldflags=`echo ${perl_ldflags} | sed 's/-arch [^ ]* *//g'`
 
761
                        fi
 
762
 
 
763
                        work_queue_bindings="$work_queue_bindings perl"
 
764
                else
 
765
                        perl=0
 
766
                fi
 
767
        fi
 
768
 
 
769
        if [ $perl = 0 ]
 
770
        then
 
771
                if [ $config_perl_path = yes ]
 
772
                then
 
773
                        echo "*** Sorry, I couldn't find the perl libraries in $perl_path"
 
774
                        echo "*** Check --with-perl-path and try again."
 
775
                        exit 1
 
776
                else
 
777
                        echo "*** skipping perl support"
 
778
                fi
 
779
        fi
 
780
fi
 
781
 
 
782
if [ $config_python_path != no ]
 
783
then
 
784
        if [ -n "$PYTHON" ] && check_file ${PYTHON}
 
785
        then    
 
786
                python=${PYTHON}
 
787
        elif check_file ${python_path}/bin/python2
 
788
        then    
 
789
                python=${python_path}/bin/python2
 
790
        elif check_file ${python_path}/bin/python
 
791
        then
 
792
                python=${python_path}/bin/python
 
793
        else
 
794
                python=0
 
795
        fi
 
796
 
 
797
        if [ $python != 0 ]
 
798
        then
 
799
                python_version=`${python} -V 2>&1 | cut -d " " -f 2`
 
800
                echo "python version is ${python_version}"
 
801
                python_major_version=`echo ${python_version} | cut -d . -f 1`
 
802
                python_minor_version=`echo ${python_version} | cut -d . -f 2 | cut -d . -f 1,2`
 
803
                if [ "$python_major_version" -eq 2 -a "$python_minor_version" -ge 4 ]
 
804
                then
 
805
                        if check_file ${python_path}/include/python2.$python_minor_version/Python.h
 
806
                        then
 
807
                                echo "found python development libraries"
 
808
                                python_ccflags_file=`mktemp tmp.XXXXXX`
 
809
                                python_ldflags_file=`mktemp tmp.XXXXXX`
 
810
 
 
811
                                env HOME=/var/empty ${python} > $python_ccflags_file <<EOF
 
812
from distutils import sysconfig
 
813
flags = ['-I' + sysconfig.get_python_inc(),
 
814
         '-I' + sysconfig.get_python_inc(plat_specific=True)]
 
815
syscfgflags = sysconfig.get_config_var('CFLAGS')
 
816
if not syscfgflags is None:
 
817
    flags.extend(syscfgflags.split())
 
818
print ' '.join(flags)
 
819
EOF
 
820
                                env HOME=/var/empty ${python} > $python_ldflags_file <<EOF
 
821
from distutils import sysconfig
 
822
libs = sysconfig.get_config_var('LIBS').split() + sysconfig.get_config_var('SYSLIBS').split()
 
823
if not sysconfig.get_config_var('Py_ENABLE_SHARED'):
 
824
    libs.insert(0, '-L' + sysconfig.get_config_var('LIBPL'))
 
825
libs.extend(sysconfig.get_config_var('LINKFORSHARED').split())
 
826
print ' '.join(libs)
 
827
EOF
 
828
                                python_ccflags=`cat $python_ccflags_file`
 
829
                                python_ldflags=`cat $python_ldflags_file`
 
830
                                rm $python_ccflags_file
 
831
                                rm $python_ldflags_file
 
832
 
 
833
                                # On OSX, the ExtUtils::Embed options contain options
 
834
                                # to generate triple-fat binaries, which fails when
 
835
                                # we attempt to bring in our thin binaries.
 
836
 
 
837
                                # To avoid this problem, remove all of the -arch XXX
 
838
                                # arguments, so that the compiler produces the default,
 
839
                                # which will be compatible with the other objects we compile.
 
840
 
 
841
                                if [ ${build_sys} = DARWIN ]
 
842
                                then
 
843
                                        python_ccflags=`echo ${python_ccflags} | sed 's/-arch [^ ]* *//g'`
 
844
                                        python_ldflags=`echo ${python_ldflags} | sed 's/-arch [^ ]* *//g'`
 
845
                                fi
 
846
 
 
847
                                if [ $build_sys = DARWIN ]
 
848
                                then
 
849
                                    python_ldflags="$python_ldflags -undefined dynamic_lookup"
 
850
                                fi
 
851
 
 
852
                                work_queue_bindings="$work_queue_bindings python"
 
853
                        else
 
854
                                python=0
 
855
                        fi
 
856
                else
 
857
                        echo "*** Sorry, we require Python >= 2.4"
 
858
                        python=0
 
859
                fi
 
860
        fi
 
861
 
 
862
        if [ $python = 0 ]
 
863
        then
 
864
                if [ $config_python_path = yes ]
 
865
                then
 
866
                        echo "*** Sorry, I couldn't find the Python >= 2.4 libraries in $python_path"
 
867
                        echo "*** Check --with-python-path and try again."
 
868
                        exit 1
 
869
                else
 
870
                        echo "*** skipping python support"
 
871
                fi
 
872
        fi
 
873
fi
 
874
 
 
875
found_swig=no
 
876
if [ $config_swig_path != no ]
 
877
then
 
878
        swig=""
 
879
        if check_file ${swig_path}/bin/swig
 
880
        then
 
881
                swig=${swig_path}/bin/swig
 
882
        else
 
883
                if check_path swig
 
884
                then
 
885
                        swig=`which swig`
 
886
                else
 
887
                        echo "*** skipping swig bindings for work queue"
 
888
                fi
 
889
        fi
 
890
 
 
891
        if [ -n "$swig" ]
 
892
        then
 
893
                swig_version=`${swig} -version | grep -i version | awk '{print $3}'`
 
894
                if [ "$python" != 1 -a ! \( "$python_major_version" -eq 2 -a "$python_minor_version" -eq 4 \) -a `format_version $swig_version` -eq `format_version 1.3.29` ]
 
895
                then
 
896
                        echo "*** Sorry, Swig 1.3.29 does not work with Python $python_version."
 
897
                        echo "*** skipping swig bindings for work queue"
 
898
                elif [ `format_version $swig_version` -ge `format_version 1.3.29` ]
 
899
                then
 
900
                        found_swig=yes
 
901
                else
 
902
                        echo "*** Sorry, I need swig >= 1.3.29"
 
903
                        echo "*** skipping swig bindings for work queue"
 
904
                fi
 
905
        fi
 
906
else
 
907
        if [ $config_swig_path = yes ]
 
908
        then
 
909
                echo "*** Sorry, I couldn't find swig in $swig_path"
 
910
                echo "*** Check --with=swig-path and try again."
 
911
                exit 1
 
912
        else
 
913
                echo "*** skipping swig bindings for work queue"
 
914
        fi
 
915
fi
 
916
 
 
917
if [ $found_swig != yes ]
 
918
then
 
919
        work_queue_bindings=""
 
920
fi
 
921
 
 
922
linker="gcc"
 
923
 
 
924
library_search ssl      /usr
 
925
library_search crypto   /usr
 
926
library_search resolv   /usr
 
927
library_search socket   /usr
 
928
library_search nsl      /usr
 
929
 
 
930
# Finally, add in standard system libraries found everywhere
 
931
 
 
932
if [ $build_sys != DARWIN ]
 
933
then
 
934
        ldflags="${ldflags} -lrt"
 
935
fi
 
936
 
 
937
if [ $build_sys != FREEBSD ]
 
938
then
 
939
        ldflags="${ldflags} -ldl"
 
940
fi
 
941
 
 
942
#Hack to get chirp to compile on cygwin.
 
943
if [ ${build_sys} != CYGWIN ]
 
944
then
 
945
        ldflags="${ldflags} -lstdc++ -lpthread -lz -lc -lm"
 
946
else
 
947
        ldflags="${ldflags} -lstdc++ -lpthread -lz -lm"
 
948
fi
 
949
 
 
950
 
 
951
if [ $build_sys = DARWIN ]
 
952
then
 
953
        cctools_dynamic_suffix=dylib
 
954
        cctools_dynamic_flag=-dynamiclib
 
955
else
 
956
        cctools_dynamic_suffix=so
 
957
        cctools_dynamic_flag=-shared
 
958
fi
 
959
 
 
960
optional_function strsignal /usr/include/string.h HAS_STRSIGNAL
 
961
optional_function pread /usr/include/unistd.h HAS_PREAD
 
962
optional_function pwrite /usr/include/unistd.h HAS_PWRITE
 
963
 
 
964
optional_include sys/statfs.h HAS_SYS_STATFS_H
 
965
optional_include sys/statvfs.h HAS_SYS_STATVFS_H
 
966
optional_include sys/xattr.h HAS_SYS_XATTR_H
 
967
optional_include attr/xattr.h HAS_ATTR_XATTR_H
 
968
optional_include fts.h HAS_FTS_H
 
969
 
 
970
cctools_doctargets=
 
971
 
 
972
if check_path doxygen
 
973
then
 
974
        cctools_doctargets="${cctools_doctargets} apipages"
 
975
else
 
976
        echo "*** not building API documentation"
 
977
fi
 
978
 
 
979
if check_path m4
 
980
then
 
981
        cctools_doctargets="${cctools_doctargets} htmlpages"
 
982
        if check_path nroff
 
983
        then
 
984
                cctools_doctargets="${cctools_doctargets} manpages"
 
985
        else
 
986
                echo "*** not building man pages"
 
987
        fi
 
988
else
 
989
        echo "*** not building html or man pages"
 
990
fi
 
991
 
 
992
# We always compile with debugging enabled,
 
993
# however on Solaris, the -g option results in a different
 
994
# debugging format that causes linking errors in getopt code.
 
995
 
 
996
if [ $build_sys = SUNOS ]
 
997
then
 
998
        debug_flag="-gstabs+"
 
999
else
 
1000
        debug_flag="-g"
 
1001
fi
 
1002
 
 
1003
ccflags="${ccflags} -DINSTALL_PATH='\"${install_path}\"' $debug_flag -D_REENTRANT -D_GNU_SOURCE -DBUILD_USER='\"$build_user\"' -DBUILD_HOST='\"$build_host\"' -DCCTOOLS_VERSION_MAJOR=$major -DCCTOOLS_VERSION_MINOR=$minor -DCCTOOLS_VERSION_MICRO='\"$micro\"' -DCCTOOLS_VERSION='\"$version\"' -DCCTOOLS_RELEASE_DATE='\"$release_date\"' -DCCTOOLS_CONFIGURE_ARGUMENTS='\"$configure_arguments\"' -DCCTOOLS_SYSTEM_INFORMATION='\"$system_information\"' -DCCTOOLS_OPSYS_${build_sys} -DCCTOOLS_CPU_${build_cpu}"
 
1004
ldflags="${ldflags} ${debug_flag}"
 
1005
 
 
1006
if [ X$include_package_parrot = "Xparrot" ]
 
1007
then
 
1008
 
 
1009
        cat <<EOF > libparrot.test.c
 
1010
int main() { return 0; }
 
1011
EOF
 
1012
        echo -n "testing creation of 64-bit libparrot_helper.so..."
 
1013
        $ccompiler $internal_ccflags -m64 libparrot.test.c -o libparrot.test > /dev/null 2>&1 
 
1014
        if [ $? = 0 ]
 
1015
        then
 
1016
                build_lib64parrot_helper="yes"
 
1017
        else
 
1018
                build_lib64parrot_helper="no"
 
1019
        fi
 
1020
        echo $build_lib64parrot_helper
 
1021
 
 
1022
        echo -n "testing creation of 32-bit libparrot_helper.so..."
 
1023
        $ccompiler $internal_ccflags -m32 libparrot.test.c -o libparrot.test > /dev/null 2>&1 
 
1024
        if [ $? = 0 ]
 
1025
        then
 
1026
                build_lib32parrot_helper="yes"
 
1027
        else
 
1028
                build_lib32parrot_helper="no"
 
1029
        fi
 
1030
        echo $build_lib32parrot_helper
 
1031
 
 
1032
        rm -f libparrot.test.c libparrot.test
 
1033
fi
 
1034
 
 
1035
 
 
1036
echo "Creating Makefile.config..."
 
1037
 
 
1038
cat <<EOF >>Makefile.config
 
1039
# Generated at `date` by $USER@`uname -n`
 
1040
 
 
1041
CCTOOLS_INSTALL_DIR=${install_path}
 
1042
CCTOOLS_PACKAGES=${packages}
 
1043
 
 
1044
CCTOOLS_CC=${ccompiler}
 
1045
CCTOOLS_BASE_CCFLAGS=${ccflags}
 
1046
CCTOOLS_INTERNAL_CCFLAGS=${internal_ccflags} \${CCTOOLS_BASE_CCFLAGS}
 
1047
CCTOOLS_CCFLAGS=-I\${CCTOOLS_INSTALL_DIR}/include/cctools \${CCTOOLS_BASE_CCFLAGS}
 
1048
 
 
1049
CCTOOLS_CXX=${cxxcompiler}
 
1050
CCTOOLS_BASE_CXXFLAGS=${ccflags}
 
1051
CCTOOLS_INTERNAL_CXXFLAGS=${internal_ccflags} \${CCTOOLS_BASE_CXXFLAGS}
 
1052
CCTOOLS_CXXFLAGS=-I\${CCTOOLS_INSTALL_DIR}/include/cctools \${CCTOOLS_BASE_CXXFLAGS}
 
1053
 
 
1054
CCTOOLS_LD=${linker}
 
1055
CCTOOLS_BASE_LDFLAGS=${ldflags}
 
1056
CCTOOLS_INTERNAL_LDFLAGS= ${internal_ldflags} \${CCTOOLS_BASE_LDFLAGS}
 
1057
CCTOOLS_LDFLAGS=-L\${CCTOOLS_INSTALL_DIR}/lib \${CCTOOLS_BASE_LDFLAGS}
 
1058
 
 
1059
CCTOOLS_MPI_LD=@echo MPI_LINK \$@; ${mpilinker}
 
1060
CCTOOLS_USE_MPI=$usempi
 
1061
 
 
1062
CCTOOLS_READLINE_LDFLAGS=${cctools_readline_ldflags}
 
1063
 
 
1064
CCTOOLS_DYNAMIC_SUFFIX=${cctools_dynamic_suffix}
 
1065
CCTOOLS_DYNAMIC_FLAG=${cctools_dynamic_flag}
 
1066
CCTOOLS_DYNAMIC_AUTH_LIBS=${cctools_dynamic_auth_libs}
 
1067
 
 
1068
CC=\$(CCTOOLS_CC)
 
1069
CCFLAGS=\$(CCTOOLS_CCFLAGS)
 
1070
LD=\$(CCTOOLS_LD)
 
1071
LDFLAGS=\$(CCTOOLS_LDFLAGS)
 
1072
CXX=\$(CCTOOLS_CXX)
 
1073
CXXFLAGS=\$(CCTOOLS_CXXFLAGS)
 
1074
MPILD=\$(CCTOOLS_MPI_LD)
 
1075
 
 
1076
CCTOOLS_AR=ar
 
1077
 
 
1078
CCTOOLS_SWIG=${swig}
 
1079
 
 
1080
CCTOOLS_PERL=${perl}
 
1081
CCTOOLS_PERL_CCFLAGS=${perl_ccflags}
 
1082
CCTOOLS_PERL_LDFLAGS=${perl_ldflags}
 
1083
CCTOOLS_PERL_VERSION=${perl_version}
 
1084
 
 
1085
CCTOOLS_PYTHON=${python}
 
1086
CCTOOLS_PYTHON_CCFLAGS=${python_ccflags}
 
1087
CCTOOLS_PYTHON_LDFLAGS=${python_ldflags}
 
1088
CCTOOLS_PYTHON_VERSION=${python_major_version}.${python_minor_version}
 
1089
 
 
1090
CCTOOLS_WORK_QUEUE_BINDINGS=${work_queue_bindings}
 
1091
 
 
1092
CCTOOLS_DOCTARGETS=${cctools_doctargets}
 
1093
 
 
1094
CCTOOLS_M4_ARGS=-DCCTOOLS_VERSION=${major}.${minor}.${micro} -DCCTOOLS_RELEASE_DATE=${release_date}
 
1095
 
 
1096
CCTOOLS_BUILD_LIB64PARROT_HELPER=${build_lib64parrot_helper}
 
1097
CCTOOLS_BUILD_LIB32PARROT_HELPER=${build_lib32parrot_helper}
 
1098
 
 
1099
EOF
 
1100
 
 
1101
echo ""
 
1102
echo "To re-configure, type './configure.rerun'"
 
1103
echo "To build, type '${MAKE}'"
 
1104
echo "To build and install, type '${MAKE} install'"
 
1105
echo ""
 
1106
 
 
1107
exit 0