-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
2662 lines (2452 loc) · 72.7 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 Copyright (c) 2012-2014 Red Hat.
dnl Copyright (c) 2008 Aconex. All Rights Reserved.
dnl Copyright (c) 2000-2004,2008 Silicon Graphics, Inc. All Rights Reserved.
dnl
dnl This program is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by the
dnl Free Software Foundation; either version 2 of the License, or (at your
dnl option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
dnl for more details.
dnl
dnl unpacking check - this file must exist
AC_INIT(src/include/pcp/pmapi.h)
AC_PREREQ([2.60])dnl
dnl Irix build issue ... use the tools from the local filesystems
unset ROOT TOOLROOT
AC_ARG_WITH(
[64bit],
[AS_HELP_STRING([--with-64bit],
[turn on 64 bit compilation mode (default is platform dependent)])],
[use_64bit=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-64bit=$withval"])
AC_ARG_WITH(
[threads],
[AC_HELP_STRING([--with-threads],
[enable support for multiple threads (default is on)])],
[do_threads=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-threads=$withval"],
[do_threads=check])
AC_ARG_WITH(
[secure-sockets],
[AC_HELP_STRING([--with-secure-sockets],
[enable support for secure sockets (default is on)])],
[do_secure=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-secure-sockets=$withval"],
[do_secure=check])
AC_ARG_WITH(
[static-probes],
[AC_HELP_STRING([--with-static-probes],
[enable support for static probes (default is on)])],
[do_probes=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-static-probes=$withval"],
[do_probes=check])
AC_ARG_WITH(
[infiniband],
[AC_HELP_STRING([--with-infiniband],
[enable support for Infiniband metrics (default is on)])],
[do_infiniband=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-infiniband=$withval"],
[do_infiniband=check])
AC_ARG_WITH(
[user],
[AS_HELP_STRING([--with-user],
[user account under which daemons run (default is pcp)])],
[pcp_user=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-user-account=$withval"],
[pcp_user=pcp])
AC_SUBST(pcp_user)
AC_ARG_WITH(
[group],
[AS_HELP_STRING([--with-group],
[user group under which daemons run (default is pcp)])],
[pcp_group=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-group-account=$withval"],
[pcp_group=pcp])
AC_SUBST(pcp_group)
AC_ARG_WITH([discovery],
[AC_HELP_STRING([--with-discovery],
[enable support for service discovery (default is on)])],
[do_discovery=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-discovery=$withval"],
[do_discovery=check])
AC_ARG_WITH([systemd],
[AC_HELP_STRING([--with-systemd],
[enable support for systemd services (default is on)])],
[do_systemd=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-systemd=$withval"],
[do_systemd=check])
AC_ARG_WITH([qt],
[AC_HELP_STRING([--with-qt],
[enable support for tools requiring Qt (default is on)])],
[do_qt=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-qt=$withval"],
[do_qt=check])
AC_ARG_WITH([python],
[AC_HELP_STRING([--with-python],
[enable support for tools requiring Python (default is on)])],
[do_python=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-python=$withval"],
[do_python=check])
AC_ARG_WITH([python3],
[AC_HELP_STRING([--with-python3],
[enable support for tools requiring Python3 (default is on)])],
[do_python3=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-python3=$withval"],
[do_python3=check])
AC_ARG_WITH([books],
[AC_HELP_STRING([--with-books],
[enable building of the PCP books (default is off)])],
[do_books=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-books=$withval"],
[do_books=no])
AC_ARG_WITH([papi],
[AC_HELP_STRING([--with-papi],
[enable performance api counter pmda (default is on)])],
[do_papi=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-papi=$withval"],
[do_papi=check])
AC_ARG_WITH([perfevent],
[AC_HELP_STRING([--with-perfevent],
[enable perfevent pmda (default is on)])],
[do_perfevent=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-perfevent=$withval"],
[do_perfevent=check])
AC_ARG_WITH([manager],
[AC_HELP_STRING([--with-manager],
[enable daemon manager (default is on)])],
[do_manager=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-manager=$withval"],
[do_manager=check])
AC_ARG_WITH([webapi],
[AC_HELP_STRING([--with-webapi],
[enable REST API daemon (default is on)])],
[do_webapi=$withval; PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --with-webapi=$withval"],
[do_webapi=check])
#
# Note: the following environment variables may be
# set to override the defaults.
#
# MAKE CC CPP LD LEX YACC INSTALL AWK SED ECHO
#
dnl Guess target platfrom
AC_CANONICAL_SYSTEM
if test -z "$target"
then
echo '
FATAL ERROR: Cannot guess your target, try explicit specification
using --target or ask [email protected]'
rm -rf conftest conftest.*
exit 1
else
dnl Remove 4th name component, if present, from target, target_os,
dnl build and build_os. Squash all x86 cpus into one LCD form - i386
target=`echo $target | sed '[s/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/]'`
target_os=`echo $target_os | sed '[s/solaris2\..*/solaris/]'`
target_os=`echo $target_os | sed '[s/^\([^-][^-]*\)-.*$/\1/]' | sed '[s/[\.0-9]*//g]'`
build=`echo $build | sed '[s/^\([^-][^-]*-[^-][^-]*-[^-][^-]*\)-.*$/\1/]'`
build_os=`echo $build_os | sed '[s/solaris2\..*/solaris/]'`
build_os=`echo $build_os | sed '[s/^\([^-][^-]*\)-.*$/\1/]'`
fi
echo Building on $build for $target
echo "Build: os=$build_os cpu=$build_cpu"
echo "Target: os=$target_os cpu=$target_cpu"
if test "$cross_compiling" = "yes"; then
if test -f ./config.$target_os; then
. ./config.$target_os
else
echo
echo "
FATAL ERROR: Cannot perform cross-compilation without a file to source
configuration information from (config.$target_os is missing)"
rm -rf conftest conftest.*
exit 1
fi
fi
dnl CFLAGS setting is a co-dependency between here and PCFLAGS in
dnl src/include/builddefs.in ... need to be the same in both places
target_distro=$target_os
if test $target_os = linux
then
AC_DEFINE(IS_LINUX)
test -f /etc/SuSE-release && target_distro=suse
test -f /etc/fedora-release && target_distro=fedora
test -f /etc/redhat-release && target_distro=redhat
test -f /etc/debian_version && target_distro=debian
test -f /etc/slackware-version && target_distro=slackware
test -f /etc/gentoo-release && target_distro=gentoo
test -f /etc/mandriva-release && target_distro=mandriva
export CFLAGS="-fPIC -fno-strict-aliasing -D_GNU_SOURCE"
elif test $target_os = darwin
then
AC_DEFINE(IS_DARWIN)
target_distro=macosx
version=`sw_vers -productVersion | sed -e 's/\.//' -e 's/\..*//g'`
CFLAGS="-fPIC -no-cpp-precomp -fno-strict-aliasing -arch i386"
if test $version -ge 106
then
target_distro=cocoa
CFLAGS="$CFLAGS -arch x86_64"
fi
export CFLAGS
elif test $target_os = mingw
then
AC_DEFINE(IS_MINGW)
CFLAGS="-fno-strict-aliasing"
elif test $target_os = solaris
then
AC_DEFINE(IS_SOLARIS)
export PATH="$PATH:/opt/SunStudioExpress/bin"
export CFLAGS_IF_GCC="-fPIC -fno-strict-aliasing"
export CFLAGS_IF_SUNCC="-fPIC -xalias_level=any"
elif test $target_os = aix
then
AC_DEFINE(IS_AIX)
export CFLAGS="-qcpluscmt"
elif test $target_os = freebsd || test $target_os = kfreebsd
then
AC_DEFINE(IS_FREEBSD)
test -f /etc/debian_version && target_distro=debian
export CFLAGS="-fPIC -fno-strict-aliasing -D_GNU_SOURCE"
elif test $target_os = gnu
then
AC_DEFINE(IS_GNU)
test -f /etc/debian_version && target_distro=debian
export CFLAGS="-fPIC -fno-strict-aliasing -D_GNU_SOURCE"
elif test $target_os = netbsdelf
then
target_os=netbsd
AC_DEFINE(IS_NETBSD)
export CFLAGS="-fPIC -fno-strict-aliasing -D_GNU_SOURCE -D_NETBSD_SOURCE"
else
echo
echo "FATAL ERROR: need platform-specific customization for \"$target_os\""
rm -rf conftest conftest.*
exit 1
fi
# Add some security-related gcc flags
AC_ARG_ENABLE([ssp],
[AS_HELP_STRING([--disable-ssp], [disable gcc stack-protector])])
AS_IF([test "x$enable_ssp" != xno],[
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int something ();])], [
AC_MSG_NOTICE([Compiling with gcc -fstack-protector-all et al.])
CFLAGS="$save_CFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"],[
AC_MSG_NOTICE([Compiler does not support -fstack-protector-all et al.])
CFLAGS="$save_CFLAGS"])])
# Check for even more security-related gcc/linker flags, useful for daemons
AC_ARG_ENABLE([pie],
[AS_HELP_STRING([--disable-pie], [disable position-independent-executable])])
AS_IF([test "x$enable_pie" != xno],[
PIECFLAGS='-fPIE'
PIELDFLAGS='-pie -Wl,-z,relro -Wl,-z,now'
save_CFLAGS="$CFLAGS"
save_LDFLAGS="$LDFLAGS"
CFLAGS="$CFLAGS $PIECFLAGS"
LDFLAGS="$LDFLAGS $PIELDFLAGS"
AC_LINK_IFELSE([AC_LANG_SOURCE([void main () {}])], [
AC_MSG_NOTICE([Compiling with gcc pie et al.])
], [
AC_MSG_NOTICE([Compiler does not support -pie et al.])
PIECFLAGS=""
PIELDFLAGS=""
])
CFLAGS="$save_CFLAGS"
LDFLAGS="$save_LDFLAGS"
])
AC_SUBST(PIELDFLAGS)
AC_SUBST(PIECFLAGS)
# Check for support for symbol hiding via gcc flags
AC_ARG_ENABLE([visibility],
[AS_HELP_STRING([--disable-visibility], [disable gcc symbol visibility])])
AS_IF([test "x$enable_visibility" != xno],[
INVISIBILITY="-fvisibility=hidden"
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -c $INVISIBILITY"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([int visible () { return 0; }])], [
AC_MSG_NOTICE([Compiling DSO PMDAs with gcc -fvisibility=hidden])
], [
AC_MSG_NOTICE([Compiler does not support -fvisibility.])
INVISIBILITY=""
])
CFLAGS="$save_CFLAGS"
])
AC_SUBST(INVISIBILITY)
# Prevent shared libaries from being built for libpcp and other core libraries
AC_ARG_ENABLE([shared],
[AS_HELP_STRING([--disable-shared], [disable core shared libary generation])],
[PACKAGE_CONFIGURE="$PACKAGE_CONFIGURE --disable-shared=$withval"])
AC_SUBST(enable_shared)
dnl Check for static probes (dtrace, systemtap)
if test "$do_probes" = "check" -o "$do_probes" = "yes"
then
enable_probes=true
AC_CHECK_PROGS(DTRACE, dtrace, [])
if test -z "$DTRACE"
then
if test "$do_probes" = "yes"
then
AC_MSG_ERROR(cannot enable static probes - no dtrace executable)
fi
enable_probes=false
fi
AC_CHECK_HEADERS([sys/sdt.h], [
if $enable_probes = true
then
if test $target_os = kfreebsd
then
enable_probes=false
elif test $target_os = freebsd
then
dnl dtrace support in FreeBSD depends on configuration of kernel
rm -f conftest.d conftest.h
cat <<End-of-File >conftest.d
provider eek {
probe urk(int);
};
End-of-File
if dtrace -s conftest.d -h >/dev/null 2>&1
then
if test ! -f conftest.h
then
enable_probes=false
if test "$do_probes" = "yes"
then
AC_MSG_ERROR(cannot enable static probes - no .h from dtrace -h)
fi
fi
else
enable_probes=false
if test "$do_probes" = "yes"
then
AC_MSG_ERROR(cannot enable static probes - dtrace failed)
fi
fi
fi
fi
], [
enable_probes=false
if test "$do_probes" = "yes"
then
AC_MSG_ERROR(cannot enable static probes - no SDT header)
fi
])
if test "$enable_probes" = "true"
then
AC_DEFINE(HAVE_STATIC_PROBES)
fi
AC_SUBST(enable_probes)
AC_SUBST(DTRACE)
fi
dnl Check for service discovery mechanisms (DNS-SD, Avahi)
AS_IF([test "x$do_discovery" != "xno"], [
# on Mac OS X, dns_sd.h
# on Linux, aloha Avahi
enable_avahi=true
PKG_CHECK_MODULES([avahi], [avahi-client],
[AC_CHECK_LIB(avahi-client, avahi_client_new,
[lib_for_avahi="-lavahi-common -lavahi-client"],
[enable_avahi=false])
],[enable_avahi=false])
AC_CHECK_HEADERS([avahi-client/publish.h],, [enable_avahi=false])
AC_CHECK_HEADERS([avahi-common/alternative.h],, [enable_avahi=false])
if test "$enable_avahi" = "true"
then
AC_SUBST(lib_for_avahi)
AC_SUBST(avahi_CFLAGS)
AC_DEFINE(HAVE_AVAHI)
enable_discovery=true
fi
if test "$do_discovery" != "check" -a "$enable_discovery" != "true"
then
AC_MSG_ERROR(cannot enable service discovery - no supported mechanisms)
fi
if test "$enable_discovery" = "true"
then
AC_DEFINE(HAVE_SERVICE_DISCOVERY)
fi
])
AC_SUBST(enable_discovery)
AC_SUBST(enable_avahi)
dnl Check for systemd services
enable_systemd=false
AS_IF([test "x$do_systemd" != "xno"], [
enable_systemd=true
PKG_CHECK_VAR([SYSTEMD_SYSTEMUNITDIR], [systemd], [systemdsystemunitdir],
[pcp_systemdunit_dir=$SYSTEMD_SYSTEMUNITDIR], [enable_systemd=false])
AC_SUBST(pcp_systemdunit_dir)
if test -z "$pcp_systemdunit_dir"
then
if test "$do_systemd" = "yes"
then
AC_MSG_ERROR(cannot enable systemd support - no systemunitdir path)
fi
enable_systemd=false
fi
])
AC_SUBST(enable_systemd)
# setup additional platform-specific binary search PATH components
pcp_platform_paths=""
case $target_os
in
aix) pcp_platform_paths='/usr/bin/X11:/usr/local/bin';;
linux|kfreebsd)
pcp_platform_paths='/usr/bin/X11:/usr/local/bin';;
mingw) pcp_platform_paths='';;
darwin) pcp_platform_paths='/usr/local/bin';;
solaris) pcp_platform_paths='/usr/bin/X11:/usr/local/bin:/opt/sfw/bin:/usr/sfw/bin';;
freebsd) pcp_platform_paths='/usr/bin/X11:/usr/bsd';;
netbsd) pcp_platform_paths='/usr/pkg/bin';;
esac
AC_SUBST(pcp_platform_paths)
# NB: No AC_PREFIX_DEFAULT is needed, as the default configure invocation
# targets a build for non-system directories such as /usr/local.
# AC_PREFIX_DEFAULT([])
. ./VERSION.pcp
PACKAGE_VERSION=${PACKAGE_MAJOR}.${PACKAGE_MINOR}.${PACKAGE_REVISION}
AC_SUBST(PACKAGE_VERSION)
AC_SUBST(PACKAGE_MAJOR)
AC_SUBST(PACKAGE_MINOR)
AC_SUBST(PACKAGE_REVISION)
AC_SUBST(PACKAGE_BUILD)
if test -z "$PACKAGE_BUILD_DATE" ; then
PACKAGE_BUILD_DATE=`date +%Y-%m-%d`
fi
AC_SUBST(PACKAGE_BUILD_DATE)
if test -z "$PACKAGE_DISTRIBUTION" ; then
PACKAGE_DISTRIBUTION=$target_distro
fi
AC_SUBST(PACKAGE_DISTRIBUTION)
dnl output header files with cpp defs HAVE_*, etc
AC_CONFIG_HEADERS(src/include/pcp/config.h src/include/pcp/configsz.h)
AC_OUTPUT(src/include/pcp/platform_defs.h)
AC_CHECK_PROGS(GIT, git)
AC_SUBST(GIT)
dnl check if python available for the build
AC_CHECK_PROGS(PYTHON, python)
AC_SUBST(PYTHON)
dnl check if python3 available for the build
AC_CHECK_PROGS(PYTHON3, python3)
AC_SUBST(PYTHON3)
dnl check if python tools/packages wanted (need python >= 2.6)
enable_python=false
AS_IF([test "x$do_python" != "xno"], [
enable_python=true
if test -z "$PYTHON"
then
enable_python=false
else
AC_MSG_CHECKING([Python version])
eval `$PYTHON -V 2>&1 | awk '/^Python/ { ver=2; print $ver }' | awk -F. '{ major=1; minor=2; point=3; printf "export PY_MAJOR=%d PY_MINOR=%d PY_POINT=%d\n",$major,$minor,$point }'`
AC_MSG_RESULT([$PY_MAJOR.$PY_MINOR.$PY_POINT])
if test "$PY_MAJOR" -lt 2; then
echo WARNING: Python version 2.6 or later does not seem to be installed.
echo Cannot proceed with the Python $PY_MAJOR installation found.
enable_python=false
fi
if test "$PY_MAJOR" -eq 2 -a "$PY_MINOR" -lt 6 ; then
echo WARNING: Python version 2.$PY_MINOR is too old.
echo Python version 2.6 or later is required for Python builds.
enable_python=false
fi
AC_CHECK_HEADERS([python${PY_MAJOR}.${PY_MINOR}/Python.h], [], [
echo WARNING: Python version $PY_MAJOR.$PY_MINOR header file missing.
echo Cannot proceed with the Python $PY_MAJOR installation found.
enable_python=false
])
fi
if test "$do_python" != "check" -a "$enable_python" != "true"
then
AC_MSG_ERROR(cannot enable Python - no supported version found)
fi
])
AC_SUBST(enable_python)
dnl check if python3 tools/packages wanted (need python >= 3.3)
enable_python3=false
AS_IF([test "x$do_python3" != "xno"], [
enable_python3=true
if test -z "$PYTHON3"
then
enable_python3=false
else
AC_MSG_CHECKING([Python3 version])
eval `$PYTHON3 -V 2>&1 | awk '/^Python/ { ver=2; print $ver }' | awk -F. '{ major=1; minor=2; point=3; printf "export PY_MAJOR=%d PY_MINOR=%d PY_POINT=%d\n",$major,$minor,$point }'`
AC_MSG_RESULT([$PY_MAJOR.$PY_MINOR.$PY_POINT])
if test "$PY_MAJOR" -lt 3; then
echo WARNING: Python version 3.3 or later does not seem to be installed.
echo Cannot proceed with the Python $PY_MAJOR installation found.
enable_python3=false
fi
if test "$PY_MAJOR" -eq 3 -a "$PY_MINOR" -lt 3 ; then
echo WARNING: Python version 3.$PY_MINOR is too old.
echo Python version 3.3 or later is required for Python builds.
enable_python3=false
fi
AC_CHECK_HEADERS([python${PY_MAJOR}.${PY_MINOR}m/Python.h], [], [
echo WARNING: Python version $PY_MAJOR.$PY_MINOR header file missing.
echo Cannot proceed with the Python $PY_MAJOR installation found.
enable_python3=false
])
fi
if test "$do_python3" != "check" -a "$enable_python3" != "true"
then
AC_MSG_ERROR(cannot enable Python3 - no supported version found)
fi
])
AC_SUBST(enable_python3)
qmake=$QMAKE
enable_qt=false
qt_release=release
AS_IF([test "x$do_qt" != "xno"], [
enable_qt=true
if test -z "$QMAKE"
then
AC_PATH_PROGS(QMAKE, [qmake-qt4 qmake],, [$QTDIR/bin:/usr/bin:/usr/lib64/qt4/bin:/usr/lib/qt4/bin])
fi
qmake=$QMAKE
if test -z "$QMAKE"
then
enable_qt=false
else
AC_MSG_CHECKING([Qt version])
eval `$qmake --version | awk '/Using Qt version/ { ver=4; print $ver }' | awk -F. '{ major=1; minor=2; point=3; printf "export QT_MAJOR=%d QT_MINOR=%d QT_POINT=%d\n",$major,$minor,$point }'`
AC_MSG_RESULT([$QT_MAJOR.$QT_MINOR.$QT_POINT])
if test "$QT_MAJOR" -lt 4; then
echo WARNING: Qt version 4.4 or later does not seem to be installed.
echo Cannot proceed with the Qt $QT_MAJOR installation found.
enable_qt=false
fi
if test "$QT_MAJOR" -eq 4 -a "$QT_MINOR" -lt 4 ; then
echo WARNING: Qt version 4.$QT_MINOR is too old.
echo Qt version 4.4 or later is required for Qt builds.
enable_qt=false
fi
fi
if test "$do_qt" != "check" -a "$enable_qt" != "true"
then
AC_MSG_ERROR(cannot enable Qt - no supported Qt installation found)
elif test "$do_qt" = "debug"
then
dnl Debug/release style build? (non-debug by default)
qt_release=debug
enable_qt=true
fi
])
AC_SUBST(qt_release)
AC_SUBST(enable_qt)
AC_SUBST(qmake)
dnl check if user wants their own C compiler
cflags_abi=
AC_PROG_CC(suncc gcc cc)
if test $target_os = solaris
then
AC_PATH_PROG(CCPATH,$CC,$CC)
cc=$CCPATH
if test "$GCC" = "yes"
then
CFLAGS="$CFLAGS $CFLAGS_IF_GCC"
else
CFLAGS="$CFLAGS $CFLAGS_IF_SUNCC"
fi
if test "$use_64bit" = "no"
then
:
else
AC_MSG_CHECKING([for 64 bit Solaris host])
case `isainfo -k`
in
amd64|sparcv9)
cflags_abi=-m64
CFLAGS="$CFLAGS -m64"
LDFLAGS="$LDFLAGS -m64"
AC_MSG_RESULT(yes)
;;
*)
AC_MSG_RESULT(no)
;;
esac
fi
else
cc=$CC
fi
AC_SUBST(cc)
cc_is_gcc=$GCC
AC_SUBST(cc_is_gcc)
AC_SUBST(cflags_abi)
PCFLAGS=$CFLAGS
AC_SUBST(PCFLAGS)
AC_PROG_CXX
cxx=$CXX
AC_SUBST(cxx)
PLDFLAGS=$LDFLAGS
AC_SUBST(PLDFLAGS)
dnl for cc use locally in configure (not exported via $PCFLAGS),
dnl add -O in case -D_FORTIFY_SOURCE has been added to CFLAGS above,
dnl as -D_FORTIFY_SOURCE requires -O but we've separated optimization
dnl flags out into $CFLAGS_OPT for our build infrastructure
CFLAGS="-O $CFLAGS"
dnl check if user wants their own make program
dnl note: all makefiles in this package use the gmake syntax
if test -z "$MAKE"
then
AC_PATH_PROG(MAKE, gmake)
if test -z "$MAKE"
then
# look elsewhere ...
AC_MSG_CHECKING([for GNU make elsewhere])
for f in /usr/local/bin/gmake /usr/freeware/bin/gmake /usr/local/bin/make /opt/sfw/bin/gmake nowhere
do
if test -x $f
then
MAKE=$f
break
fi
done
if test $f = nowhere
then
# Check if /usr/bin/make is any good
mver=`/usr/bin/make --version 2>/dev/null | sed -n -e1p | cut -c1-8`
if test "$mver" != "GNU Make"
then
echo
echo "FATAL ERROR: could not find GNU make anywhere"
echo "You need to set \$MAKE as the full path to GNU make "
echo "in the environment."
rm -rf conftest conftest.*
exit 1
else
MAKE=/usr/bin/make
fi
fi
AC_MSG_RESULT($MAKE)
fi
fi
make=$MAKE
AC_SUBST(make)
dnl check if users wants their own CPP
if test -z "$CPP"; then
AC_PROG_CPP
fi
cpp=$CPP
AC_SUBST(cpp)
dnl check if users wants their own linker
if test -z "$LD"; then
AC_PATH_PROG(LD, ld, /usr/bin/ld)
fi
ld=$LD
AC_SUBST(ld)
dnl Provide ways to override owner and group for installed files
if test -z "$PCP_USER_INSTALL" ; then
pcp_user_install=root
else
pcp_user_install="$PCP_USER_INSTALL"
fi
AC_SUBST(pcp_user_install)
if test -z "$PCP_GROUP_INSTALL" ; then
case "$target_os"
in
darwin|freebsd|netbsd)
pcp_group_install=wheel
;;
*)
pcp_group_install=root
;;
esac
else
pcp_group_install="$PCP_GROUP_INSTALL"
fi
AC_SUBST(pcp_group_install)
dnl check if the tar program is available
if test -z "$TAR"; then
AC_PATH_PROGS(TAR, gtar tar, tar)
fi
if test $target_os = darwin -a -x /usr/bin/gnutar
then
TAR=/usr/bin/gnutar
fi
tar=$TAR
AC_SUBST(tar)
dnl check if the gzip program is available
dnl (needed to gzip man pages on some platforms)
if test -z "$ZIP"; then
AC_PATH_PROG(ZIP, gzip, /bin/gzip)
fi
test ! -x "$ZIP" && ZIP=/usr/local/bin/gzip
test ! -x "$ZIP" && ZIP=/usr/freeware/bin/gzip
test ! -x "$ZIP" && ZIP=/usr/bin/gzip
gzip=$ZIP
test -z "$gzip" && gzip=no-gzip
AC_SUBST(gzip)
dnl check if the bzip2 program is available
dnl (needed to bzip2 man pages on some platforms)
if test -z "$BZIP2"; then
AC_PATH_PROG(BZIP2, bzip2, /bin/bzip2)
fi
test ! -x "$BZIP2" && BZIP2=/usr/bin/bzip2
test ! -x "$BZIP2" && BZIP2=/usr/local/bin/bzip2
test ! -x "$BZIP2" && BZIP2=/usr/freeware/bin/bzip2
bzip2=$BZIP2
test -z "$bzip2" && bzip2=no-bzip2
AC_SUBST(bzip2)
dnl check if the lzma program is available
dnl (needed to lzma man pages on some platforms)
if test -z "$LZMA"; then
AC_PATH_PROG(LZMA, lzma, /bin/lzma)
fi
test ! -x "$LZMA" && LZMA=/usr/bin/lzma
test ! -x "$LZMA" && LZMA=/usr/local/bin/lzma
test ! -x "$LZMA" && LZMA=/usr/freeware/bin/lzma
lzma=$LZMA
test -z "$lzma" && lzma=no-lzma
AC_SUBST(lzma)
dnl check if the xz program is available
dnl (needed to xz man pages on some platforms)
if test -z "$XZ"; then
AC_PATH_PROG(XZ, xz, /bin/xz)
fi
test ! -x "$XZ" && XZ=/usr/bin/xz
test ! -x "$XZ" && XZ=/usr/local/bin/xz
test ! -x "$XZ" && XZ=/usr/freeware/bin/xz
xz=$XZ
test -z "$xz" && xz=no-xz
AC_SUBST(xz)
dnl Check for mac PackageMaker
AC_MSG_CHECKING([for PackageMaker])
if test -z "$PACKAGE_MAKER"
then
if test $target_os = darwin
then
if test -x /Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker
then # Darwin 6.x
package_maker=/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker
AC_MSG_RESULT([ yes (darwin 6.x)])
elif test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
then # Darwin 7.x
AC_MSG_RESULT([ yes (darwin 7.x)])
package_maker=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
else
AC_MSG_RESULT([ not found!])
AC_MSG_WARN([PackageMaker not found, mac packages will not be made])
fi
else
AC_MSG_RESULT([ no])
fi
else
package_maker="$PACKAGE_MAKER"
fi
AC_SUBST(package_maker)
dnl check if the hdiutil program is available
if test -z "$HDIUTIL"; then
AC_PATH_PROG(HDIUTIL, hdiutil)
fi
hdiutil=$HDIUTIL
AC_SUBST(hdiutil)
dnl check if the mkinstallp program is available (AIX)
if test -z "$MKINSTALLP"; then
AC_PATH_PROG(MKINSTALLP, mkinstallp)
fi
mkinstallp=$MKINSTALLP
AC_SUBST(mkinstallp)
dnl check for the Solaris pmgmk package maker
if test -z "$PKGMK"; then
AC_PATH_PROG(PKGMK, pkgmk)
fi
pkgmk=$PKGMK
AC_SUBST(pkgmk)
dnl check if the dlltool program is available
if test -z "$DLLTOOL"; then
AC_PATH_PROG(DLLTOOL, dlltool)
fi
dlltool=$DLLTOOL
AC_SUBST(dlltool)
dnl check if the rpmbuild program is available
if test -z "$RPMBUILD"; then
AC_PATH_PROG(RPMBUILD, rpmbuild)
fi
test $target_distro = slackware && RPMBUILD=''
rpmbuild=$RPMBUILD
AC_SUBST(rpmbuild)
dnl check if the rpm program is available
if test -z "$RPM"; then
AC_PATH_PROG(RPM, rpm)
fi
test $target_distro = slackware && RPM=''
rpm=$RPM
AC_SUBST(rpm)
dnl if rpmbuild exists, use it, otherwise use rpm
if test -n "$RPMBUILD" -a -x "$RPMBUILD"
then
rpmprog=$RPMBUILD
else
rpmprog=$RPM
fi
AC_SUBST(rpmprog)
dnl check if the pod2man program is available (perl man page builder)
if test -z "$POD2MAN"; then
AC_PATH_PROG(POD2MAN, pod2man)
fi
pod2man=$POD2MAN
AC_SUBST(pod2man)
dnl extra check for the Perl MakeMaker package
AC_MSG_CHECKING([if ExtUtils::MakeMaker is installed])
perl -e "use ExtUtils::MakeMaker" 2>/dev/null
if test $? -eq 0
then
AC_MSG_RESULT([ yes])
else
AC_MSG_RESULT([ no])
echo
echo "FATAL ERROR: Perl ExtUtils::MakeMaker module missing."
echo "You can either install this from your distribution, or"
echo "download from CPAN (Comprehensive Perl Archive Network)."
rm -rf conftest conftest.*
exit 1
fi
AC_PATH_PROG(TRUEPROG, true)
dnl check if the makedepend program is available
if test -z "$MAKEDEPEND"; then
AC_PATH_PROG(MAKEDEPEND, makedepend, $TRUEPROG)
fi
makedepend=$MAKEDEPEND
AC_SUBST(makedepend)
dnl check if the md5sum program is available
if test -z "$MD5SUM"; then
AC_PATH_PROG(MD5SUM, md5sum, $TRUEPROG)
fi
md5sum=$MD5SUM
AC_SUBST(md5sum)
dnl check if the Debian dpkg program is available
if test -z "$DPKG"; then
AC_PATH_PROG(DPKG, dpkg)
fi
dpkg=$DKPG
AC_SUBST(dpkg)
dnl check for the Slackware makepkg packaging tool
if test -z "$MAKEPKG"; then
AC_PATH_PROG(MAKEPKG, makepkg)
fi
makepkg=$MAKEPKG
AC_SUBST(makepkg)
dnl check if a toolchain is available for the books
test -z "$PUBLICAN" && AC_PATH_PROG(PUBLICAN, publican)
publican=$PUBLICAN
AC_SUBST(publican)
test -z "$DBLATEX" && AC_PATH_PROG(DBLATEX, dblatex)
dblatex=$DBLATEX
AC_SUBST(dblatex)
test -z "$XMLTO" && AC_PATH_PROG(XMLTO, xmlto)
xmlto=$XMLTO
AC_SUBST(xmlto)
book_toolchain=""
if test "$do_books" = "check" -o "$do_books" = "yes"
then
if test "$BOOK_TOOLCHAIN" != ""
then
book_toolchain=$BOOK_TOOLCHAIN
elif test "$DBLATEX" != ""
then
book_toolchain=dblatex
elif test "$PUBLICAN" != ""
then
book_toolchain=publican
elif test "$XMLTO" != ""
then
book_toolchain=xmlto
elif test "$do_books" = "yes"
then
AC_MSG_ERROR(cannot enable books build - no toolchain found)
fi
fi
AC_SUBST(book_toolchain)
dnl check if symbolic links are supported
AC_PROG_LN_S
if test $target_os = mingw; then
as_ln_s=/bin/true
fi
dnl check if user wants their own lex, yacc
AC_PROG_LEX
lex=$LEX
AC_SUBST(lex)
AC_PROG_YACC
yacc=$YACC
AC_SUBST(yacc)
dnl extra check for lex and yacc as these are often not installed
AC_MSG_CHECKING([if yacc is executable])
binary=`echo $yacc | awk '{print $1}'`
binary=`which "$binary"`
if test -x "$binary"
then
AC_MSG_RESULT([ yes])
else
AC_MSG_RESULT([ no])
echo
echo "FATAL ERROR: did not find a valid yacc executable."
echo "You can either set \$YACC as the full path to yacc"
echo "in the environment, or install a yacc/bison package."
rm -rf conftest conftest.*
exit 1
fi
AC_MSG_CHECKING([if lex is executable])
binary=`echo $lex | awk '{print $1}'`
binary=`which "$binary"`
if test -x "$binary"
then
AC_MSG_RESULT([ yes])
else
AC_MSG_RESULT([ no])
echo
echo "FATAL ERROR: did not find a valid lex executable."
echo "You can either set \$LEX as the full path to lex"
echo "in the environment, or install a lex/flex package."
rm -rf conftest conftest.*
exit 1
fi
dnl check if user wants their own awk, sed and echo
if test -z "$AWK"; then
AC_PATH_PROGS(AWK, gawk awk, /usr/bin/awk)
fi
case "$AWK"
in
gawk|*/gawk)
awk="$AWK --posix"
;;
*)
awk=$AWK
;;
esac
AC_SUBST(awk)
if test -z "$SED"; then
AC_PATH_PROG(SED, sed, /bin/sed)
fi
sed=$SED
AC_SUBST(sed)
if test -z "$ECHO"; then
AC_PATH_PROG(ECHO, echo, /bin/echo)
fi
echo=$ECHO