forked from HPCToolkit/hpctoolkit-externals
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.ac
1845 lines (1548 loc) · 48.2 KB
/
configure.ac
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
dnl
dnl Externals configure.
dnl
dnl Copyright (c) 2008-2019, Rice University.
dnl All rights reserved.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions are
dnl met:
dnl
dnl * Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the following disclaimer.
dnl
dnl * Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the following disclaimer in the
dnl documentation and/or other materials provided with the distribution.
dnl
dnl * Neither the name of Rice University (RICE) nor the names of its
dnl contributors may be used to endorse or promote products derived from
dnl this software without specific prior written permission.
dnl
dnl This software is provided by RICE and contributors "as is" and any
dnl express or implied warranties, including, but not limited to, the
dnl implied warranties of merchantability and fitness for a particular
dnl purpose are disclaimed. In no event shall RICE or contributors be
dnl liable for any direct, indirect, incidental, special, exemplary, or
dnl consequential damages (including, but not limited to, procurement of
dnl substitute goods or services; loss of use, data, or profits; or
dnl business interruption) however caused and on any theory of liability,
dnl whether in contract, strict liability, or tort (including negligence
dnl or otherwise) arising in any way out of the use of this software, even
dnl if advised of the possibility of such damage.
dnl
dnl $Id$
dnl
AC_INIT([hpctoolkit-externals], [2018.11],
[hpctoolkit-externals],
[http://hpctoolkit.org/])
AC_COPYRIGHT([Copyright (c) 2008-2019, Rice University.
See the file LICENSE for details.])
AC_CONFIG_AUX_DIR([config])
AC_PREREQ(2.69)
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([Makefile.conf])
AC_CONFIG_FILES([externs.conf])
AC_CONFIG_FILES([options.conf])
AC_SUBST([CC])
AC_SUBST([CFLAGS])
AC_SUBST([CXX])
AC_SUBST([CXXFLAGS])
AC_SUBST([AR])
AC_SUBST([build])
AC_SUBST([build_cpu])
AC_SUBST([build_os])
AC_SUBST([host])
AC_SUBST([host_cpu])
AC_SUBST([host_os])
AC_SUBST([is_cross_compile])
AC_SUBST([prefix])
AC_PROG_CC
AC_PROG_CXX
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
failure_file=BUILD-FAILURE
externs_file=externs.conf
nobuild_cookie=.dont-build
version_file="${srcdir}/.svn-revision"
#------------------------------------------------------------
# Prefix
#------------------------------------------------------------
# Allow the user to set the prefix, but change the default to a subdir
# of the build directory. Autoconf requires this to be an absolute
# path. Normalize the path and mkdir the directory so we can write
# externs.conf into it.
if test "x$prefix" = xNONE ; then
prefix="`pwd`/${host}"
fi
if mkdir -p "$prefix" ; then : ; else
AC_MSG_ERROR([unable to mkdir $prefix])
fi
prefix=`( cd "$prefix" && pwd )`
#------------------------------------------------------------
# CONFIG_SITE
#------------------------------------------------------------
# If CONFIG_SITE contains the path to a file, then autoconf sources
# that file to reset default values for libdir, etc. This may break
# our config scripts by producing an install layout that they don't
# expect. Unfortunately, autoconf sources the file before running
# this script, so we can't unset it here.
warn_config_site=no
if test -f "$CONFIG_SITE" ; then
AC_MSG_WARN([CONFIG_SITE is set in the environment])
warn_config_site=yes
fi
#------------------------------------------------------------
# Git revision
#------------------------------------------------------------
# If this is a git repo, then try to identify the branch name and the
# date and hash of the last commit.
AC_MSG_CHECKING([for git version])
git_version='unknown (not a git repo)'
mesg=`cd "$srcdir" && git log -n 1 --date=short 2>/dev/null`
if echo "$mesg" | grep -i commit >/dev/null ; then
git_hash=`echo "$mesg" | grep -i commit | head -1 | awk '{print $2}'`
git_hash=`expr "$git_hash" : '\(........\)'`
git_date=`echo "$mesg" | grep -i date | head -1 | awk '{print $2}'`
mesg=`cd "$srcdir" && git status 2>/dev/null | head -1`
if echo "$mesg" | grep -i branch >/dev/null ; then
git_branch=`echo "$mesg" | sed -e 's/^.*branch//i' | awk '{print $1}'`
elif echo "$mesg" | grep -i detach >/dev/null ; then
# detached commits don't have a branch name
git_branch=detached
else
git_branch=unknown
fi
git_version="$git_branch at $git_date ($git_hash)"
fi
AC_MSG_RESULT([$git_version])
AC_SUBST([git_version])
#------------------------------------------------------------
# Cross compile
#------------------------------------------------------------
# is_cross_compile: non-empty string if cross-compiling
is_cross_compile=""
if test "x$build" != "x$host" ; then
is_cross_compile="${host}"
fi
#------------------------------------------------------------
# Compiler path and version
#------------------------------------------------------------
# Find the location and version of the C and C++ compilers. Warn if
# not using GNU gcc/g++. Some packages don't build cleanly without
# GNU. For example, binutils fails with icc.
#
# It's a pain to robustly identify GNU gcc/g++. Intel icc defines
# __GNUC__ and SuSE and Ubuntu 'g++ --version' don't display "GCC".
#
# FIXME: the --version option works with GNU and Intel. We could
# extend this to PGI, IBM, etc, but we probably don't build cleanly
# with those compilers.
CC_VERSION='unknown non-gnu'
version=`$CC --version 2>/dev/null`
if echo "$version" | grep -i copyright >/dev/null ; then
CC_VERSION=`echo "$version" | head -1`
fi
CC_PATH=
base=`echo $CC | awk '{ print $1 }'`
case "$base" in
/* ) CC_PATH="$base" ;;
* ) AC_PATH_PROG([CC_PATH], [$base]) ;;
esac
if test "x$CC_PATH" = x ; then
CC_PATH="$base"
fi
warn_non_gcc=no
echo $version | grep -E -i -e 'copy.*free.*soft.*found' >/dev/null
if test $? -ne 0 ; then
warn_non_gcc=yes
AC_MSG_WARN([Not using the GNU C compiler.])
fi
CXX_VERSION='unknown non-gnu'
version=`$CXX --version 2>/dev/null`
if echo "$version" | grep -i copyright >/dev/null ; then
CXX_VERSION=`echo "$version" | head -1`
fi
CXX_PATH=
base=`echo $CXX | awk '{ print $1 }'`
case "$base" in
/* ) CXX_PATH="$base" ;;
* ) AC_PATH_PROG([CXX_PATH], [$base]) ;;
esac
if test "x$CXX_PATH" = x ; then
CXX_PATH="$base"
fi
echo $version | grep -E -i -e 'copy.*free.*soft.*found' >/dev/null
if test $? -ne 0 ; then
warn_non_gcc=yes
AC_MSG_WARN([Not using the GNU C++ compiler.])
fi
AC_MSG_NOTICE([C compiler: $CC_VERSION])
AC_MSG_NOTICE([C++ compiler: $CXX_VERSION])
AC_SUBST([CC_PATH])
AC_SUBST([CXX_PATH])
# Warn if using GNU gcc/g++ older than 4.8. The new symtab pre-10.x
# has trouble with versions earlier than 4.8.
warn_old_gcc=no
if test "$warn_non_gcc" = no ; then
ans=`$CC -v 2>&1 | grep -i version`
version=`echo $ans | sed -e 's/^.*version//i' | awk '{ print $1 }'`
major=`echo $version | awk -F. '{ print $1 }'`
minor=`echo $version | awk -F. '{ print $2 }'`
expr 1 + "$major" >/dev/null 2>&1 && expr 1 + "$minor" >/dev/null 2>&1
if test $? -ne 0 ; then
AC_MSG_WARN([unable to parse gcc version])
elif test "$major" -le 3 ; then
warn_old_gcc=yes
elif test "$major" -eq 4 && test "$minor" -lt 8 ; then
warn_old_gcc=yes
fi
fi
if test "$warn_old_gcc" = yes ; then
AC_MSG_WARN([Using an old version of GNU gcc/g++.])
fi
#------------------------------------------------------------
# CXXFLAGS for std C++11
#------------------------------------------------------------
# New symtab 8.2 wants a flag for std C++11. The native symtab test
# is broken for back-end MIC (g++ 4.7.0 but doesn't know -std=c++11),
# so we test here.
AC_ARG_VAR([CXX11_FLAG],
[CXX flag for symtabAPI for standard C++11, only needed for
non-GNU CXX])
AC_MSG_CHECKING([for CXXFLAGS for std C++11])
c11_list='argvar none -std=c++11 -std=c++0x -std=gnu++0x'
cxx_c11_avail=no
cxx_c11_flag=
ORIG_CXXFLAGS="$CXXFLAGS"
AC_LANG_PUSH([C++])
for opt in $c11_list
do
case "$opt" in
argvar ) flag="$CXX11_FLAG" ;;
none ) flag= ;;
* ) flag="$opt" ;;
esac
CXXFLAGS="$ORIG_CXXFLAGS $flag"
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([[
#include <list>
int mylen(std::list <int> lst)
{
int ans = 0;
for (auto it = lst.begin(); it != lst.end(); it++) {
ans++;
}
return ans;
}
]])], [ans=yes], [ans=no])
if test "$ans" = yes ; then
cxx_c11_avail=yes
cxx_c11_flag="$flag"
break
fi
done
AC_LANG_POP
CXXFLAGS="$ORIG_CXXFLAGS"
AC_MSG_RESULT([$cxx_c11_flag])
if test "$cxx_c11_avail" = no ; then
AC_MSG_WARN([unable to find CXXFLAGS for std C++11])
AC_MSG_WARN([try setting the CXX11_FLAG variable])
fi
AC_SUBST([cxx_c11_flag])
#------------------------------------------------------------
# CFLAGS for -fPIC
#------------------------------------------------------------
# Try C flags for PIC. GNU and Intel use -fPIC, PGI uses -fpic.
# We use this in binutils to build an fPIC version of libiberty for
# symtabAPI.
AC_MSG_CHECKING([for option for PIC])
cflags_fpic=
ORIG_CFLAGS="$CFLAGS"
AC_LANG_PUSH([C])
for flag in -fPIC -fpic
do
CFLAGS="$ORIG_CFLAGS $flag"
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([[
int foo(int x)
{
return x + 2;
}
]])], [ans=yes], [ans=no])
if test "$ans" = yes ; then
cflags_fpic="$flag"
break
fi
done
AC_LANG_POP
CFLAGS="$ORIG_CFLAGS"
AC_MSG_RESULT([$cflags_fpic])
if test "x$cflags_fpic" = x ; then
AC_MSG_WARN([unable to find CFLAGS to support PIC])
fi
AC_SUBST([cflags_fpic])
#------------------------------------------------------------
# GNU make
#------------------------------------------------------------
# Try to find GNU make. Amazingly, AC doesn't have a macro for this.
# We only use this value when running configure scripts directly.
# When starting from a make target, MAKE is exported to the scripts.
# Thus, it's not fatal if we can't find gnu make here, as long as you
# later run a gnu-compatible make.
AC_MSG_CHECKING([for gnu make])
if gmake --version 2>&1 | grep -i gnu >/dev/null 2>&1 ; then
gnu_make=gmake
elif make --version 2>&1 | grep -i gnu >/dev/null 2>&1 ; then
gnu_make=make
else
gnu_make=no
fi
AC_MSG_RESULT([$gnu_make])
if test "$gnu_make" = no ; then
AC_MSG_WARN([unable to find gnu make])
gnu_make=make
fi
AC_SUBST([gnu_make])
#------------------------------------------------------------
# CMAKE
#------------------------------------------------------------
# Dyninst 9.0 now requires cmake 2.8 or later, maybe 2.8.10 or so.
# Issue a fatal error if can't find cmake and a loud warning if not
# 2.8 or later.
AC_CHECK_PROG([cmake_found], [cmake], [yes], [no])
if test "$cmake_found" != yes ; then
AC_MSG_WARN([Dyninst requires cmake version 2.8.10 or later.])
AC_MSG_WARN([Put cmake on your PATH and rerun configure.])
AC_MSG_ERROR([Unable to find cmake.])
fi
cmake_version=`cmake --version 2>&1 | grep -i version`
AC_MSG_NOTICE([$cmake_version])
version=`echo $cmake_version | sed -e 's/^[[^0-9.]]*//'`
version=`echo $version | sed -e 's/^\([[0-9.]]*\).*/\1/'`
major=`echo $version | awk -F. '{ print $1 }'`
minor=`echo $version | awk -F. '{ print $2 }'`
warn_old_cmake=no
if expr 1 + "$major" + "$minor" >/dev/null 2>&1
then
if test "$major" -lt 2 \
|| test \( "$major" -eq 2 \) -a \( "$minor" -lt 8 \)
then
AC_MSG_WARN([this version of cmake is too old])
warn_old_cmake=yes
fi
else
AC_MSG_WARN([unable to determine cmake version])
warn_old_cmake=yes
fi
#------------------------------------------------------------
# OBJCOPY for cross-compile
#------------------------------------------------------------
# Search for an objcopy program that works with output produced by CC
# or else specify one with OBJCOPY. This is mostly for the cross-
# compile case with names like x86_64-k1om-linux-objcopy. Our
# libunwind install script uses this to change some symbol names.
AC_CHECK_TOOL([objcopy_prog], [objcopy], [objcopy])
AC_ARG_VAR([OBJCOPY],
[objcopy program for binaries produced by CC, only needed
if autoconf fails to find a suitable program])
if test -n "$OBJCOPY" ; then
AC_MSG_NOTICE([setting objcopy to: $OBJCOPY])
objcopy_prog="$OBJCOPY"
fi
AC_MSG_CHECKING([if $objcopy_prog works])
srcfile="conftest.$$.c"
objfile="conftest.$$.o"
newobj="conftest-new.$$.o"
rm -f "$srcfile" "$objfile" "$newobj"
cat >"$srcfile" <<EOF
int foo(void)
{ return 2; }
EOF
objcopy_avail=no
echo $CC $CFLAGS -c "$srcfile" -o "$objfile" >&AS_MESSAGE_LOG_FD
$CC $CFLAGS -c "$srcfile" -o "$objfile" >&AS_MESSAGE_LOG_FD 2>&1
if test $? -eq 0 ; then
echo $objcopy_prog --redefine-sym foo=baz "$objfile" "$newobj" >&AS_MESSAGE_LOG_FD
$objcopy_prog --redefine-sym foo=baz "$objfile" "$newobj" >&AS_MESSAGE_LOG_FD 2>&1
if test $? -eq 0 && test -f "$newobj" ; then
objcopy_avail=yes
fi
fi
rm -f "$srcfile" "$objfile" "$newobj"
AC_MSG_RESULT([$objcopy_avail])
if test "$objcopy_avail" != yes ; then
AC_MSG_WARN([$objcopy_prog does not work with $CC])
fi
AC_SUBST([objcopy_prog])
#------------------------------------------------------------
# Wordsize: --enable-wordsize=NUM
#------------------------------------------------------------
# Use sizeof(void *) to determine if CC produces 32- or 64-bit code.
# This option is rarely needed, it exists just in case AC computes the
# wrong value.
AC_CHECK_SIZEOF([void *])
default=`expr $ac_cv_sizeof_void_p '*' 8`
AC_ARG_ENABLE([wordsize],
[AS_HELP_STRING([--enable-wordsize=NUM],
[host wordsize in bits, 32 or 64, only needed if autoconf
computes the wrong value])],
[wordsize="$enable_wordsize"],
[wordsize="$default"])
AC_MSG_CHECKING([host wordsize])
AC_MSG_RESULT([$wordsize bits])
# The host wordsize also sets the multilib search path. This only
# applies to outside packages via --with-pkg (ie, not built here).
case "$wordsize" in
64 ) multilib_path='lib64 lib' ;;
32 ) multilib_path='lib32 lib' ;;
* ) AC_MSG_ERROR([wordsize must be 32 or 64: $wordsize bits]) ;;
esac
AC_SUBST([wordsize])
# Check that CC and CXX produce the same wordsize. Also check that
# CFLAGS doesn't change the wordsize. This shouldn't be necessary,
# but some packages can't handle -m64 in CFLAGS, they require
# something like CC='gcc -m64'.
srcfile="conftest.$$.c"
objfile="conftest.$$.o"
rm -f "$srcfile"
cat >"$srcfile" <<EOF
int foo(void)
{ return 2; }
EOF
get_wordsize()
{
output=`file $objfile`
case "$output" in
*64-bit* ) ans=64 ;;
*32-bit* ) ans=32 ;;
* ) ans=0 ;;
esac
echo $ans
}
AC_MSG_CHECKING([host wordsize from CC])
rm -f "$objfile"
$CC -c -o "$objfile" "$srcfile" >/dev/null
wordsize_cc=`get_wordsize`
AC_MSG_RESULT([$wordsize_cc bits])
AC_MSG_CHECKING([host wordsize from CXX])
rm -f "$objfile"
$CXX -c -o "$objfile" "$srcfile" >/dev/null
wordsize_cxx=`get_wordsize`
AC_MSG_RESULT([$wordsize_cxx bits])
rm -f "$objfile"
$CC $CFLAGS -c -o "$objfile" "$srcfile" >/dev/null
wordsize_cflags=`get_wordsize`
rm -f "$objfile"
$CXX $CXXFLAGS -c -o "$objfile" "$srcfile" >/dev/null
wordsize_cxxflags=`get_wordsize`
rm -f "$srcfile" "$objfile"
if test "$wordsize" != "$wordsize_cc" \
|| test "$wordsize" != "$wordsize_cxx" \
|| test "$wordsize" != "$wordsize_cflags" \
|| test "$wordsize" != "$wordsize_cxxflags"
then
AC_MSG_WARN([CC or CXX generate inconsistent wordsizes.])
AC_MSG_WARN([Either CC ($wordsize_cc) and CXX ($wordsize_cxx) generate different wordsizes,])
AC_MSG_WARN([or they do not match the host wordsize ($wordsize), or they generate])
AC_MSG_WARN([different wordsizes with and without CFLAGS. If you are])
AC_MSG_WARN([using a CFLAGS option to reset the wordsize, then put this])
AC_MSG_WARN([option in CC with something like CC='gcc -m${wordsize}'.])
AC_MSG_ERROR([CC or CXX generate inconsistent wordsizes.])
fi
#------------------------------------------------------------
# Platform-specific options
#------------------------------------------------------------
# Libmonitor on BGQ needs the back-end compiler. For now, use this
# only for libmonitor, only on Blue Gene/Q and only if not already
# cross compiling.
AC_ARG_ENABLE([bgq],
[AS_HELP_STRING([--enable-bgq],
[enable BGQ-specific options: build libmonitor with
back-end powerpc64-bgq-linux-gcc (autodetect)])],
[],
[enable_bgq=check])
# Search for the back-end BGQ compiler on PATH and test for Blue
# Gene/P (suppress the warning on P).
blue_gene_p=no
ppc64_bgq_avail=
if test -d /bgsys ; then
AC_CHECK_PROG([ppc64_bgq_avail], [powerpc64-bgq-linux-gcc], [yes], [no])
if test "$ppc64_bgq_avail" = no && test "$wordsize" = 32 ; then
blue_gene_p=yes
fi
else
ppc64_bgq_avail=no
fi
libmonitor_use_bgq_backend=no
warn_bgq_backend=no
case "$enable_bgq" in
yes )
if test "$ppc64_bgq_avail" != yes ; then
AC_MSG_ERROR([unable to find powerpc64-bgq-linux-gcc for enable-bgq])
fi
libmonitor_use_bgq_backend=yes
;;
no ) ;;
* )
if test -d /bgsys && test "$blue_gene_p" = no && test -z "$is_cross_compile"
then
if test "$ppc64_bgq_avail" = yes ; then
AC_MSG_WARN([using back-end compiler for libmonitor])
libmonitor_use_bgq_backend=yes
else
AC_MSG_WARN([unable to find powerpc64-bgq-linux-gcc])
fi
warn_bgq_backend=yes
fi
;;
esac
AC_SUBST([libmonitor_use_bgq_backend])
#------------------------------------------------------------
# Copy skeleton directories
#------------------------------------------------------------
# Support a separate build directory by copying the package skeleton
# directories. Just copy regular files and the patches subdir, don't
# copy other subdirs.
packages='binutils boost libdwarf libelf libmonitor libunwind libxml2
lzma old-monitor open-analysis oprofile perfmon symtabAPI xed2 xerces zlib'
if test "x$srcdir" != x.
then
AC_MSG_CHECKING([copying package directories])
for pkg in $packages build-utils config
do
if mkdir -p "$pkg" ; then : ; else
AC_MSG_ERROR([unable to mkdir $pkg])
fi
for file in "${srcdir}/${pkg}"/*
do
if test -f "$file" ; then
if cp -f "$file" "$pkg" ; then : ; else
AC_MSG_ERROR([unable to copy $file])
fi
fi
done
for dir in "${srcdir}/${pkg}"/patch*
do
if test -d "$dir" ; then
base=`basename "$dir"`
if mkdir -p "${pkg}/${base}" ; then : ; else
AC_MSG_ERROR([unable to mkdir $pkg/$base])
fi
for file in "$dir"/*
do
if test -f "$file" ; then
if cp -f "$file" "${pkg}/${base}" ; then : ; else
AC_MSG_ERROR([unable to copy $file])
fi
fi
done
fi
done
done
# Symlink the distfiles directory.
if test ! -d distfiles ; then
if ln -s "${srcdir}/distfiles" distfiles ; then : ; else
AC_MSG_ERROR([unable to symlink distfiles])
fi
fi
AC_MSG_RESULT([done])
fi
#------------------------------------------------------------
# Install prefixes
#------------------------------------------------------------
# Install each package into a separate subdirectory of the global
# prefix. This is only for packages that we build here. Packages
# given by --with-pkg=PATH are left in place.
binutils_local_prefix="${prefix}/binutils"
boost_local_prefix="${prefix}/boost"
libdwarf_local_prefix="${prefix}/libdwarf"
libelf_local_prefix="${prefix}/libelf"
libmonitor_local_prefix="${prefix}/libmonitor"
libunwind_local_prefix="${prefix}/libunwind"
libxml2_local_prefix="${prefix}/libxml2"
lzma_local_prefix="${prefix}/lzma"
old_monitor_local_prefix="${prefix}/old-monitor"
open_analysis_local_prefix="${prefix}/open-analysis"
oprofile_local_prefix="${prefix}/oprofile"
perfmon_local_prefix="${prefix}/perfmon"
symtabAPI_local_prefix="${prefix}/symtabAPI"
xed2_local_prefix="${prefix}/xed2"
xerces_local_prefix="${prefix}/xerces"
zlib_local_prefix="${prefix}/zlib"
#------------------------------------------------------------
# Default packages: --enable-back-end
#------------------------------------------------------------
# Default set of packages to build or not to build. These are just
# defaults. You can always override the choices with --with-pkg or
# --without-pkg and the specific overrides the general.
AC_ARG_ENABLE([back-end],
[AS_HELP_STRING([--enable-back-end],
[build only those packages needed to run hpcrun on the
back-end compute nodes (default no)])],
[],
[enable_back_end=no])
# Oprofile is still experimental, so its default is no (for now).
binutils_default=build
boost_default=build
libdwarf_default=build
libelf_default=build
libmonitor_default=build
libunwind_default=build
libxml2_default=no
lzma_default=build
old_monitor_default=no
open_analysis_default=no
oprofile_default=no
perfmon_default=build
symtabAPI_default=build
xed2_default=build
xerces_default=build
zlib_default=build
if test "$enable_back_end" != no ; then
binutils_default=no
old_monitor_default=no
open_analysis_default=no
oprofile_default=no
xerces_default=no
fi
#------------------------------------------------------------
# Binutils: --with-binutils=PATH
#------------------------------------------------------------
AC_ARG_WITH([dummy-blank-line], [AS_HELP_STRING([ ], [ ])])
AC_ARG_WITH([binutils],
[AS_HELP_STRING([--with-binutils=PATH],
[path to binutils install directory (default build)])],
[],
[with_binutils="$binutils_default"])
AC_MSG_CHECKING([binutils])
binutils_avail=no
binutils_prefix=no
binutils_version=
cookie="binutils/${nobuild_cookie}"
rm -f "$cookie"
case "$with_binutils" in
build | yes )
binutils_avail=build
binutils_prefix="$binutils_local_prefix"
binutils_version=' (new)'
;;
/* )
if test -f "${with_binutils}/include/bfd.h" ; then
binutils_avail="$with_binutils"
binutils_prefix="$with_binutils"
else
AC_MSG_ERROR([invalid binutils directory: $with_binutils])
fi
echo "installed in: $with_binutils" > "$cookie"
;;
no )
echo "not available" > "$cookie"
;;
* )
AC_MSG_ERROR([binutils directory must be absolute path: $with_binutils])
;;
esac
AC_MSG_RESULT([$binutils_avail$binutils_version])
AC_SUBST([binutils_prefix])
#------------------------------------------------------------
# Boost: --with-boost=PATH
#------------------------------------------------------------
AC_ARG_WITH([boost],
[AS_HELP_STRING([--with-boost=PATH],
[path to boost install directory (default build)])],
[],
[with_boost="$boost_default"])
AC_MSG_CHECKING([boost])
boost_avail=no
boost_prefix=no
cookie="boost/${nobuild_cookie}"
rm -f "$cookie"
case "$with_boost" in
build | yes )
boost_avail=build
boost_prefix="$boost_local_prefix"
;;
/* )
if test -f "${with_boost}/include/boost/multi_index_container.hpp" \
&& test -f "${with_boost}/include/boost/graph/depth_first_search.hpp"
then
boost_avail="$with_boost"
boost_prefix="$with_boost"
else
AC_MSG_ERROR([invalid boost directory: $with_boost])
fi
echo "installed in: $with_boost" > "$cookie"
;;
no )
echo "not available" > "$cookie"
;;
* )
AC_MSG_ERROR([boost directory must be absolute path: $with_boost])
;;
esac
AC_MSG_RESULT([$boost_avail])
AC_SUBST([boost_prefix])
#------------------------------------------------------------
# Libdwarf: --with-libdwarf=PATH
#------------------------------------------------------------
AC_ARG_WITH([libdwarf],
[AS_HELP_STRING([--with-libdwarf=PATH],
[path to libdwarf install directory (default build)])],
[],
[with_libdwarf="$libdwarf_default"])
AC_MSG_CHECKING([libdwarf])
libdwarf_avail=no
libdwarf_prefix=no
libdwarf_inc=no
libdwarf_lib=no
cookie="libdwarf/${nobuild_cookie}"
rm -f "$cookie"
case "$with_libdwarf" in
build | yes )
libdwarf_avail=build
libdwarf_prefix="$libdwarf_local_prefix"
libdwarf_inc="${libdwarf_prefix}/include"
libdwarf_lib="${libdwarf_prefix}/lib"
;;
/* )
libdwarf_avail="$with_libdwarf"
libdwarf_prefix="$with_libdwarf"
if test -f "${libdwarf_prefix}/include/libdwarf.h" ; then
libdwarf_inc="${libdwarf_prefix}/include"
else
AC_MSG_ERROR([invalid libdwarf directory: $with_libdwarf])
fi
for lib in $multilib_path fail ; do
if test -f "${libdwarf_prefix}/${lib}/libdwarf.so" ; then
libdwarf_lib="${libdwarf_prefix}/${lib}"
break
fi
if test "$lib" = fail ; then
AC_MSG_ERROR([invalid libdwarf directory: $with_libdwarf])
fi
done
echo "installed in: $libdwarf_avail" > "$cookie"
;;
no )
echo "not available" > "$cookie"
;;
* )
AC_MSG_ERROR([libdwarf directory must be absolute path: $with_libdwarf])
;;
esac
AC_MSG_RESULT([$libdwarf_avail])
AC_SUBST([libdwarf_prefix])
AC_SUBST([libdwarf_inc])
AC_SUBST([libdwarf_lib])
#------------------------------------------------------------
# Libelf: --with-libelf=PATH
#------------------------------------------------------------
# Test for libelf.h in include and include/libelf, and test for
# multilib lib directory.
AC_ARG_WITH([libelf],
[AS_HELP_STRING([--with-libelf=PATH],
[path to libelf install directory (default build)])],
[],
[with_libelf="$libelf_default"])
AC_MSG_CHECKING([libelf])
libelf_avail=no
libelf_prefix=no
libelf_inc=no
libelf_lib=no
libelf_build=no
cookie="libelf/${nobuild_cookie}"
rm -f "$cookie"
case "$with_libelf" in
build | yes )
libelf_avail=build
libelf_prefix="$libelf_local_prefix"
libelf_inc="${libelf_prefix}/include"
libelf_lib="${libelf_prefix}/lib"
libelf_build=yes
;;
/* )
libelf_avail="$with_libelf"
libelf_prefix="$with_libelf"
if test ! -f "${libelf_prefix}/include/libelf.h" \
&& test ! -f "${libelf_prefix}/include/libelf/libelf.h"
then
AC_MSG_ERROR([unable to find libelf.h in: $libelf_prefix])
fi
libelf_inc="${libelf_prefix}/include"
for lib in $multilib_path ; do
if test -f "${libelf_prefix}/${lib}/libelf.so" ; then
libelf_lib="${libelf_prefix}/${lib}"
break
fi
done
if test "$libelf_lib" = no ; then
AC_MSG_ERROR([unable to find libelf.so in: $libelf_prefix])
fi
echo "installed in: $libelf_avail" > "$cookie"
;;
no )
echo "not available" > "$cookie"
;;
* )
AC_MSG_ERROR([libelf directory must be absolute path: $with_libelf])
;;
esac
AC_MSG_RESULT([$libelf_avail])
AC_SUBST([libelf_prefix])
AC_SUBST([libelf_inc])
AC_SUBST([libelf_lib])
#------------------------------------------------------------
# Libmonitor: --with-libmonitor=PATH
#------------------------------------------------------------
AC_ARG_WITH([libmonitor],
[AS_HELP_STRING([--with-libmonitor=PATH],
[path to libmonitor install directory (default build)])],
[],
[with_libmonitor="$libmonitor_default"])
AC_MSG_CHECKING([libmonitor])
libmonitor_avail=no
libmonitor_prefix=no
cookie="libmonitor/${nobuild_cookie}"
rm -f "$cookie"
case "$with_libmonitor" in
build | yes )
libmonitor_avail=build
libmonitor_prefix="$libmonitor_local_prefix"
;;
/* )
if test -f "${with_libmonitor}/include/monitor.h" ; then
libmonitor_avail="$with_libmonitor"
libmonitor_prefix="$with_libmonitor"
else
AC_MSG_ERROR([invalid libmonitor directory: $with_libmonitor])
fi
echo "installed in: $with_libmonitor" > "$cookie"
;;
no )
echo "not available" > "$cookie"
;;
* )
AC_MSG_ERROR([libmonitor directory must be absolute path: $with_libmonitor])
;;
esac
AC_MSG_RESULT([$libmonitor_avail])
AC_SUBST([libmonitor_prefix])
#------------------------------------------------------------