-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.in
More file actions
executable file
·953 lines (879 loc) · 28.1 KB
/
Copy pathconfigure.in
File metadata and controls
executable file
·953 lines (879 loc) · 28.1 KB
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
## -*- mode: Autoconf -*-
##
## Copyright (c) 2011, 2012, 2013, 2014, 2015, 2017 The University of Utah
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of
## the License, or (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
###############################################################################
AC_PREREQ(2.13)
AC_INIT(Makeconf.in)
AC_CONFIG_AUX_DIR(${srcdir}/autoconf)
AC_PREFIX_DEFAULT(/usr/local)
AC_CONFIG_HEADER(config.h)
ABS_BUILDDIR=`pwd`
AC_DEFINE([ABS_BUILDDIR],"$ABS_BUILDDIR",[Absolute build dir])
#AC_SUBST(ABS_BUILDDIR)
##
## XXX we don't care about separate src/obj builddirs for now... just comment.
##
# We use separate source and obj trees. Configuring in a source
# tree messes it up, so throw an error.
#
# Check that $srcdir, (which defaults to the argv[0] path to the configure
# script,) is different from the current directory.
#
#if test `(cd $srcdir; pwd)` = `pwd`; then
# if test "$ac_srcdir_defaulted" = yes; then
# AC_MSG_ERROR(
# [You are running the configure script in the current directory.
#Output from configure must go into an obj tree, not a source tree!
#cd to the top of an obj tree, and run the configure in your source tree.])
# else
# AC_MSG_ERROR(
# [You specified --srcdir= to be the current directory.
#Output from configure should go into an obj tree, not a source tree!
#cd to the top of an obj tree, and run the configure in your source tree.
#Then --srcdir= will be unnecessary.])
# fi
#fi
#
# Double-check that there isn't a Makeconf.in (the UNIQUE-FILE-IN-SOURCE-DIR)
# in the current directory.
#
#if test -f $ac_unique_file; then
# AC_MSG_ERROR([The current directory is a source tree containing $ac_unique_file .
#Output from configure should go into an obj tree, not a source tree!
#cd to the top of an obj tree, and run the configure in your source tree.])
#fi
# BEGIN Python detection.
AC_PATH_PROGS(PYTHON, python python2.7 python2.6 python2.5 python2.4 python2.3 python2.2)
if test x"$PYTHON" = x""; then
AC_MSG_ERROR([python not detected])
fi
PYTHON_VERSION=`${PYTHON} -V 2>&1 | cut -d ' ' -f 2 | cut -d '.' -f 1,2`
PYTHON_PATH=`dirname ${PYTHON}`
if test ! -d "$PYTHON_PATH/include"; then
PYTHON_PATH=`dirname ${PYTHON_PATH}`
fi
PYTHON_INCLUDE="${PYTHON_PATH}/include/python${PYTHON_VERSION}"
PYTHON_LIB="${PYTHON_PATH}/lib/python${PYTHON_VERSION}"
OLD_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} -I${PYTHON_INCLUDE}"
AC_CHECK_HEADERS([Python.h],
[ENABLE_PYTHON=1],
[AC_MSG_WARN("Cannot find Python.h in ${PYTHON_INCLUDE}");
ENABLE_PYTHON=0])
CPPFLAGS="${OLD_CPPFLAGS}"
AC_SUBST(PYTHON_INCLUDE)
AC_SUBST(PYTHON_LIB)
AC_SUBST(ENABLE_PYTHON)
# END Python detection.
#
# Programs we (might) need.
#
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_LN_S
AC_PROG_RANLIB
AC_PROG_MKDIR_P
AC_PROG_INSTALL
AC_PROG_YACC
AC_PROG_LEX
AC_PATH_PROG(AR, ar)
if test -z "$AR" ; then
AC_MSG_ERROR([no acceptable ar found in \$PATH])
fi
AC_PATH_PROG(LD, ld)
if test -z "$LD" ; then
AC_MSG_ERROR([no acceptable ld found in \$PATH])
fi
AC_PATH_PROG(RM, rm)
if test -z "$RM" ; then
AC_MSG_ERROR([no acceptable rm found in \$PATH])
fi
AC_PATH_PROG(CP, cp)
if test -z "$CP" ; then
AC_MSG_ERROR([no acceptable cp found in \$PATH])
fi
AC_PATH_PROG(TAR, tar)
if test -z "$TAR" ; then
AC_MSG_ERROR([no tar found in \$PATH])
fi
AC_PATH_PROG(LIBTOOL, libtool)
if test -z "$LIBTOOL" ; then
AC_MSG_ERROR([no libtool found in \$PATH])
fi
AC_PATH_PROG(SWIG, swig)
if test -z "$SWIG" ; then
AC_MSG_ERROR([no swig found in \$PATH])
fi
AC_EXEEXT
AC_SUBST(optional_subdirs)
# Make sure $INSTALL is valid at any depth in our tree, i.e. make it absoulte.
# This can be needed when no valid install is found and autoconf falls back on
# the supplied install.sh, but we called 'configure' with a relative path.
AC_PROG_INSTALL
[case "$INSTALL" in
..*)
INSTALL=`pwd`/$INSTALL
;;
esac]
#
# Check glib.
#
GLIB=/usr
AC_ARG_WITH([glib],
AS_HELP_STRING([--with-glib=DIRECTORY],
[find glib install in DIRECTORY]),
[GLIB="$with_glib"])
if test ! "$GLIB" = "/usr" ; then
old_PKG_CONFIG_PATH="$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH="$GLIB/lib/pkgconfig"
fi
old_CFLAGS=$CFLAGS
CFLAGS=`pkg-config --cflags glib-2.0`" $CFLAGS"
AC_CHECK_TYPE(GHashTableIter,
[],
[AC_MSG_ERROR([Your glib does not have hash table iterators; upgrade to >= 2.16!])],
[[#include <glib.h>]])
if test ! "$GLIB" = "/usr" ; then
export PKG_CONFIG_PATH="$old_PKG_CONFIG_PATH"
fi
CFLAGS="$old_CFLAGS"
AC_SUBST(GLIB)
#
# Check distorm.
#
DISTORM=
ENABLE_DISTORM=0
AC_ARG_WITH(distorm,
AS_HELP_STRING([--with-distorm=<DIRECTORY>],
[Support x86 disassembly with distorm]),
[],[with_distorm=check])
if test "x$with_distorm" = "xno"; then
ENABLE_DISTORM=0; DISTORM="";
else
old_CPPFLAGS="${CPPFLAGS}"
old_LDLP=$LD_LIBRARY_PATH
old_LDFLAGS=$LDFLAGS
if test "x$with_distorm" = "xyes" -o "x$with_distorm" = "xcheck"; then
mydir=""
else
mydir=$with_distorm
CPPFLAGS="-I${mydir}/include ${old_CPPFLAGS}"
LD_LIBRARY_PATH="$mydir/lib:$old_LDLP"
LDFLAGS="-L$mydir/lib $old_LDFLAGS"
fi
if test "x$with_distorm" = "xcheck"; then myfatal=0; else myfatal=1; fi
#AC_MSG_NOTICE([checking for distorm in $mydir...])
foundit=1
AC_CHECK_HEADERS([distorm.h],[foundit=`expr $foundit \* 1`],
[if test $myfatal -eq 1; then \
AC_MSG_ERROR("Cannot find distorm.h!"); \
else \
foundit=0; \
fi])
AC_CHECK_HEADERS([mnemonics.h],[foundit=`expr $foundit \* 1`],
[if test $myfatal -eq 1; then \
AC_MSG_ERROR("Cannot find mnemonics.h!"); \
else \
foundit=0; \
fi])
AC_CHECK_LIB(distorm3,distorm_decompose64,[foundit=`expr $foundit \* 1`],
[if test $myfatal -eq 1; then \
AC_MSG_ERROR("Cannot find mnemonics.h!"); \
else \
foundit=0; \
fi],[-ldistorm3])
if test $foundit -eq 1; then
# Success!
DISTORM=$mydir
ENABLE_DISTORM=1
fi
CPPFLAGS="${old_CPPFLAGS}"
LD_LIBRARY_PATH="$old_LDLP"
LDFLAGS="$old_LDFLAGS"
fi
AC_SUBST(DISTORM)
AC_SUBST(ENABLE_DISTORM)
#
# Check elfutils.
#
ELFUTILS=/usr/local
AC_ARG_WITH([elfutils],
AS_HELP_STRING([--with-elfutils=DIRECTORY],
[find elfutils install in DIRECTORY]),
[ELFUTILS="$with_elfutils"])
if test "$ELFUTILS" != "/usr/local"; then
if test ! -e "$ELFUTILS/include/elfutils/libdw.h" ; then
AC_MSG_ERROR([cannot find elfutils in "$ELFUTILS"])
fi
else
if test ! -e "$ELFUTILS/include/elfutils/libdw.h" ; then
ELFUTILS=/usr
if test ! -e "$ELFUTILS/include/elfutils/libdw.h" ; then
AC_MSG_ERROR([cannot find elfutils])
fi
fi
fi
if test ! -z "$with_elfutils" ; then
old_LDLP=$LD_LIBRARY_PATH
LD_LIBRARY_PATH="$ELFUTILS/lib:$ELFUTILS/lib/elfutils/lib:$LD_LIBRARY_PATH"
old_LDFL=$LDFLAGS
LDFLAGS="-L$ELFUTILS/lib -L$ELFUTILS/lib/elfutils/lib $LDFLAGS"
fi
AC_CHECK_LIB(dw,dwarf_next_unit,
[AC_DEFINE([LIBDW_HAVE_NEXT_UNIT],[1],
[Define to 1 to mark libdw has dwarf_next_unit])],
[AC_MSG_WARN([Your elfutils does not have dwarf_next_unit; cannot use DWARF version info])],
[-lelf -lebl])
if test ! -z "$with_elfutils" ; then
LD_LIBRARY_PATH="$old_LDLP"
LDFLAGS="$old_LDFL"
fi
AC_SUBST(ELFUTILS)
#
# Now, if this version of elfutils doesn't install version.h, try to figure out
# its version.
#
if test ! -e "$ELFUTILS/include/elfutils/version.h" ; then
AC_DEFINE([ELFUTILS_NO_VERSION_H],[1],[Define to mark elfutils has no version.h])
if test -x "$ELFUTILS/bin/eu-objdump" ; then
EV=`"$ELFUTILS/bin/eu-objdump" -V | sed -r -n -e 's/objdump.*[[0-9]]\.([[0-9]]+)/\1/p'`
elif test -x "$ELFUTILS/bin/vmi-eu-objdump" ; then
EV=`"$ELFUTILS/bin/vmi-eu-objdump" -V | sed -r -n -e 's/objdump.*[[0-9]]\.([[0-9]]+)/\1/p'`
elif test -x "$ELFUTILS/bin/objdump" ; then
EV=`"$ELFUTILS/bin/objdump" -V | sed -r -n -e 's/objdump.*[[0-9]]\.([[0-9]]+)/\1/p'`
fi
if test "$?" != 0 ; then
AC_MSG_WARN([Could not detect elfutils version; build will probably break])
AC_DEFINE_UNQUOTED([ELFUTILS_BIN_VERSION],[0],[Define this with version obtained from elfutils objdump])
else
AC_DEFINE_UNQUOTED([ELFUTILS_BIN_VERSION],$EV,[Define this with version obtained from elfutils objdump])
fi
fi
#
# Check Judy.
#
AC_ARG_WITH([judy],
AS_HELP_STRING([--with-judy=DIRECTORY],
[find judy install in DIRECTORY]),
[JUDY="$with_judy"])
if test -z "$JUDY" ; then
# look in usual places
JUDY=/usr/local
if test ! -e "$JUDY/include/Judy.h" ; then
JUDY=/usr
if test ! -e "$JUDY/include/Judy.h" ; then
AC_MSG_ERROR([cannot find judy])
fi
fi
else
if test ! -e "$JUDY/include/Judy.h" ; then
AC_MSG_ERROR([cannot find judy])
fi
fi
AC_SUBST(JUDY)
#
# VMI support, via either xenaccess or libvmi or builtin.
#
# You can now build with all of them; and choose which to use at runtime.
#
# Right now the default is VMI enabled with builtin
# --enable-libvmi will enable VMI via libvmi
# --enable-xenaccess will enable VMI via xenaccess
#
ENABLE_XENSUPPORT=1
ENABLE_XENACCESS=0
ENABLE_LIBVMI=0
ENABLE_XENACCESS_DEBUG=0
AC_ARG_ENABLE(xenaccess,
AS_HELP_STRING([--enable-xenaccess],
[Enable xenaccess support]),
[if test "x$enableval" = "xno"; then \
ENABLE_XENACCESS=0; \
else \
ENABLE_XENACCESS=1; \
fi])
if test "$ENABLE_XENACCESS" = "1"; then
AC_CHECK_HEADERS([xenaccess/xenaccess.h],
[],
[AC_MSG_ERROR("Cannot find xenaccess/xenaccess.h; install xenaccess!")])
AC_DEFINE([ENABLE_XENACCESS],[1])
fi
AC_SUBST(ENABLE_XENACCESS)
AC_ARG_ENABLE(xenaccess-debug,
AS_HELP_STRING([--disable-xenaccess-debug],
[Disable xenaccess debug output]),
[if test "x$enableval" = "xno"; then \
ENABLE_XENACCESS_DEBUG=0; \
else \
ENABLE_XENACCESS_DEBUG=1; \
fi])
AC_SUBST(ENABLE_XENACCESS_DEBUG)
LIBVMI=/usr/local
AC_ARG_ENABLE(libvmi,
AS_HELP_STRING([--disable-libvmi],
[Disable libvmi support]),
[if test "x$enableval" = "xno"; then \
ENABLE_LIBVMI=0; \
else \
ENABLE_LIBVMI=1; ENABLE_XENACCESS=0; ENABLE_XENACCESS_DEBUG=0; \
fi])
if test "$ENABLE_LIBVMI" = "1"; then
AC_ARG_WITH([libvmi],
AS_HELP_STRING([--with-libvmi=DIRECTORY],
[find libvmi install in DIRECTORY]),
[LIBVMI="$with_libvmi"])
AC_CHECK_HEADERS([libvmi/libvmi.h],
[],
[AC_MSG_ERROR("Cannot find libvmi/libvmi.h; install libvmi!")])
AC_DEFINE([ENABLE_LIBVMI],[1])
fi
AC_SUBST(LIBVMI)
AC_SUBST(ENABLE_LIBVMI)
#
# Check for the needed Xen, libxc, and libxenstore headers.
#
AC_ARG_ENABLE(xen,
AS_HELP_STRING([--disable-xen],
[Disable xen support]),
[if test "x$enableval" = "xno"; then \
ENABLE_XENSUPPORT=0; \
else \
ENABLE_XENSUPPORT=1; MAYBE_XENSUPPORT=0; \
fi],[MAYBE_XENSUPPORT=1; ENABLE_XENSUPPORT=1])
if test "$ENABLE_XENSUPPORT" = "1"; then
foundit=1
AC_CHECK_HEADERS([xenctrl.h],[foundit=`expr $foundit \* 1`],
[if test $MAYBE_XENSUPPORT -eq 0; then \
AC_MSG_ERROR("Cannot find xenctrl.h!"); \
else \
foundit=0; \
fi])
AC_CHECK_HEADERS([xs.h],[foundit=`expr $foundit \* 1`],
[if test $MAYBE_XENSUPPORT -eq 0; then \
AC_MSG_ERROR("Cannot find xenctrl.h!"); \
else \
foundit=0; \
fi])
AC_CHECK_HEADERS([xen/xen.h],[foundit=`expr $foundit \* 1`],
[if test $MAYBE_XENSUPPORT -eq 0; then \
AC_MSG_ERROR("Cannot find xenctrl.h!"); \
else \
foundit=0; \
fi])
if test $foundit -eq 1; then
AC_DEFINE([ENABLE_XENSUPPORT],[1])
else
ENABLE_XENSUPPORT=0
#AC_DEFINE([ENABLE_XENSUPPORT],[0])
fi
fi
AC_SUBST(XENSUPPORT)
AC_SUBST(ENABLE_XENSUPPORT)
#
# Support newer versions of xenctrl that have xc_domain_debug_control for
# HVM domains.
#
AC_CHECK_LIB(xenctrl,xc_domain_debug_control,
[XC_HAVE_DOMAIN_DEBUG_CONTROL=1],
[XC_HAVE_DOMAIN_DEBUG_CONTROL=0],
[])
if test "${XC_HAVE_DOMAIN_DEBUG_CONTROL}" = "1"; then
AC_DEFINE([XC_HAVE_DOMAIN_DEBUG_CONTROL],[1])
fi
AC_SUBST(XC_HAVE_DOMAIN_DEBUG_CONTROL)
#
# Support older versions of xenctrl that don't have xc_map_foreign_pages.
#
AC_CHECK_LIB(xenctrl,xc_map_foreign_pages,
[XC_HAVE_MAP_FOREIGN=1],
[XC_HAVE_MAP_FOREIGN=0],
[])
AC_SUBST(XC_HAVE_MAP_FOREIGN)
#
# Support time travel.
#
AC_CHECK_LIB(xenctrl,xc_ttd_vmi_add_probe,
[CONFIG_DETERMINISTIC_TIMETRAVEL=1],
[CONFIG_DETERMINISTIC_TIMETRAVEL=0],
[])
# Allow it to be disabled even if autodetected.
AC_ARG_ENABLE(time-travel,
AS_HELP_STRING([--disable-time-travel],
[Disable time-travel support]),
[if test "x$enableval" = "xno"; then \
CONFIG_DETERMINISTIC_TIMETRAVEL=0; \
else \
CONFIG_DETERMINISTIC_TIMETRAVEL=1; \
fi],
[])
AC_SUBST(CONFIG_DETERMINISTIC_TIMETRAVEL)
ENABLE_XENTTSUPPORT=0
if test "$CONFIG_DETERMINISTIC_TIMETRAVEL" = "1" ; then
AC_DEFINE([ENABLE_XENTTSUPPORT],[1])
ENABLE_XENTTSUPPORT=1
fi
AC_SUBST(ENABLE_XENTTSUPPORT)
#
# Support older versions of xenctrl that don't have evtchn_port_or_error_t.
#
AC_CHECK_TYPE(vcpu_guest_context_any_t,
[AC_DEFINE(XC_HAVE_CONTEXT_ANY)],
[],
[#include <xenctrl.h>])
AC_SUBST(XC_HAVE_CONTEXT_ANY)
AC_CHECK_TYPE(evtchn_port_or_error_t,
[AC_DEFINE(XC_EVTCHN_PORT_T,evtchn_port_or_error_t)],
[AC_DEFINE(XC_EVTCHN_PORT_T,evtchn_port_t)],
[#include <xenctrl.h>])
AC_SUBST(XC_EVTCHN_PORT_T)
#
# Check for libvirt.
#
ENABLE_LIBVIRT=0
AC_CHECK_LIB(virt-qemu,virDomainQemuMonitorCommand,
[ENABLE_LIBVIRT=1],
[ENABLE_LIBVIRT=0],
[])
# Allow it to be disabled even if autodetected.
AC_ARG_ENABLE(libvirt,
AS_HELP_STRING([--disable-libvirt],
[Disable libvirt support]),
[if test "x$enableval" = "xno"; then \
ENABLE_LIBVIRT=0; \
else \
ENABLE_LIBVIRT=1; \
fi],
[])
if test "$ENABLE_LIBVIRT" = "1" ; then
AC_DEFINE([ENABLE_LIBVIRT],[1])
fi
AC_SUBST(ENABLE_LIBVIRT)
#
# Check for gsoap
#
GSOAP=
SOAPCPP2=
WSDL2H=
ENABLE_SOAP=0
AC_ARG_WITH([gsoap],
AS_HELP_STRING([--with-gsoap=DIRECTORY],
[Enable SOAP XML services (using gsoap in DIRECTORY)]),
[],[with_gsoap=check])
if test "x$with_gsoap" = "xno"; then
ENABLE_SOAP=0; GSOAP=
else
if test "x$with_gsoap" = "xyes" -o "x$with_gsoap" = "xcheck"; then
mydir=""
else
mydir="$with_gsoap"
old_CPPFLAGS="${CPPFLAGS}"
old_LDLP=$LD_LIBRARY_PATH
old_LDFLAGS=$LDFLAGS
old_PATH="$PATH"
export PATH="${mydir}/bin:$PATH"
GSOAPDIR="$mydir"
fi
foundit=1
if test "x$with_gsoap" = "xcheck"; then myfatal=0; else myfatal=1; fi
AC_PATH_PROG(SOAPCPP2, soapcpp2)
if test -z "$SOAPCPP2" ; then
foundit=0
if test $myfatal -eq 1; then
AC_MSG_ERROR([no acceptable soapcpp2 found in \$PATH])
fi
else
foundit=`expr $foundit \* 1`
fi
# infer the gsoap dir if it wasn't set, for includes, etc. It might not be
# /usr, like we assumed, if it was elsewhere in the $PATH.
if test -z "$GSOAPDIR" ; then
GSOAPDIR=`echo $SOAPCPP2 | sed -e 's/\/bin\/soapcpp2//'`
fi
AC_PATH_PROG(WSDL2H, wsdl2h)
if test -z "$WSDL2H" ; then
foundit=0
if test $myfatal -eq 1; then
AC_MSG_ERROR([no acceptable wsdl2h found in \$PATH])
fi
else
foundit=`expr $foundit \* 1`
fi
#
# Check for our patched version of gsoap; error if not!
#
$WSDL2H -h 2>&1 | grep -q '^\-M.*'
if test "$?" != "0"; then
foundit=0
if test $myfatal -eq 1; then
AC_MSG_ERROR([you must install our patched GSOAP; see README!])
fi
else
foundit=`expr $foundit \* 1`
fi
if test -n "$mydir"; then
CPPFLAGS="${old_CPPFLAGS}"
LD_LIBRARY_PATH="$old_LDLP"
LDFLAGS="$old_LDFLAGS"
PATH="$old_PATH"
export PATH="${old_PATH}"
fi
if test $foundit -eq 1; then
GSOAP="$GSOAPDIR"
ENABLE_SOAP=1
#
# Tell everybody.
#
AC_DEFINE([ENABLE_SOAP],[1])
#
# Grab gsoap version number -- I suck
#
V_GSOAP_VERSION=`${SOAPCPP2} -v 2>&1 | grep 'soapcpp2 release' | sed -e 's/\(.* release \)\(.*\)/\2/'`
AC_DEFINE_UNQUOTED(V_GSOAP_VERSION,${V_GSOAP_VERSION})
AC_SUBST(V_GSOAP_VERSION)
V_GSOAP_VERSION_MAJOR=`echo "${V_GSOAP_VERSION}" | cut -d . -f 1`
AC_DEFINE_UNQUOTED(V_GSOAP_VERSION_MAJOR,${V_GSOAP_VERSION_MAJOR})
AC_SUBST(V_GSOAP_VERSION_MAJOR)
V_GSOAP_VERSION_MINOR=`echo "${V_GSOAP_VERSION}" | cut -d . -f 2`
AC_DEFINE_UNQUOTED(V_GSOAP_VERSION_MINOR,${V_GSOAP_VERSION_MINOR})
AC_SUBST(V_GSOAP_VERSION_MINOR)
V_GSOAP_VERSION_PATCH=`echo "${V_GSOAP_VERSION}" | cut -d . -f 3`
AC_DEFINE_UNQUOTED(V_GSOAP_VERSION_PATCH,${V_GSOAP_VERSION_PATCH})
AC_SUBST(V_GSOAP_VERSION_PATCH)
else
GSOAP=
ENABLE_SOAP=0
fi
AC_SUBST(GSOAP)
AC_SUBST(SOAPCPP2)
AC_SUBST(WSDL2H)
AC_SUBST(ENABLE_SOAP)
fi
#
# Check for asm and CLIPS and asm A3 host controller reporting
#
AC_ARG_ENABLE(asm,
AS_HELP_STRING([--disable-asm],
[Disable kernel-focused ASM module/tools build]),
[if test "x$enableval" = "xno"; then \
ENABLE_ASM=0; \
else \
ENABLE_ASM=1; \
fi],
[ENABLE_ASM=1])
AC_SUBST(ENABLE_ASM)
AC_ARG_ENABLE(asm-a3,
AS_HELP_STRING([--enable-asm-a3],
[Enable ASM A3 host controller reporting]),
[if test "x$enableval" = "xno"; then \
ENABLE_ASM_A3=0; \
else \
ENABLE_ASM_A3=1; \
fi],
[ENABLE_ASM_A3=1])
AC_SUBST(ENABLE_ASM_A3)
CLIPS=
AC_ARG_WITH(clips,
AS_HELP_STRING([--with-clips=<DIRECTORY>],
[Build the ASM components with clips]),
[],[with_clips=check])
if test "x$with_clips" = "xno"; then
ENABLE_CLIPS=0; CLIPS="";
else
old_CPPFLAGS="${CPPFLAGS}"
old_LDLP=$LD_LIBRARY_PATH
old_LDFLAGS=$LDFLAGS
if test "x$with_clips" = "xyes" -o "x$with_clips" = "xcheck"; then
mydir=""
else
mydir=$with_clips
CPPFLAGS="-I${mydir}/include ${old_CPPFLAGS}"
LD_LIBRARY_PATH="$mydir/lib:$old_LDLP"
LDFLAGS="-L$mydir/lib $old_LDFLAGS"
fi
if test "x$with_clips" = "xcheck"; then myfatal=0; else myfatal=1; fi
#AC_MSG_NOTICE([checking for clips in $mydir...])
foundit=1
AC_CHECK_HEADERS([clips/clips.h],[foundit=`expr $foundit \* 1`],
[if test $myfatal -eq 1; then \
AC_MSG_ERROR("Cannot find clips/clips.h!"); \
else \
foundit=0; \
fi])
# AC_CHECK_LIB(clips3,LoadFacts,[foundit=`expr $foundit \* 1`],
# [if test $myfatal -eq 1; then \
# AC_MSG_ERROR("Cannot find mnemonics.h!"); \
# else \
# foundit=0; \
# fi],[-lclips3])
if test $foundit -eq 1; then
# Success!
CLIPS=$mydir
ENABLE_CLIPS=1
fi
CPPFLAGS="${old_CPPFLAGS}"
LD_LIBRARY_PATH="$old_LDLP"
LDFLAGS="$old_LDFLAGS"
fi
AC_SUBST(CLIPS)
CLIPSSRC=
AC_ARG_WITH([clipssrc],
AS_HELP_STRING([--with-clipssrc=DIRECTORY],
[find clipssrc build in DIRECTORY]),
[CLIPSSRC="$with_clipssrc"])
if test "$ENABLE_ASM" = "1"; then
old_CFLAGS="$CFLAGS"
if test -n "$CLIPSSRC"; then
CFLAGS="-I${CLIPSSRC} ${CFLAGS}"
CLIPSPREFIX=""
elif test -n "$CLIPS"; then
CFLAGS="-I${CLIPS}/include ${CFLAGS}"
CLIPSPREFIX="clips/"
else
CLIPSPREFIX="clips/"
fi
AC_CHECK_HEADERS([${CLIPSPREFIX}clips.h],
[],
[AC_MSG_ERROR("Cannot find ${CLIPSPREFIX}clips.h for ASM build; check your --with-clips or --with-clipssrc path argument!")])
CFLAGS="${old_CFLAGS}"
if test -n "$CLIPSSRC"; then
AC_DEFINE([HAVE_CLIPSSRC],[1])
elif test -n "$CLIPS"; then
AC_DEFINE([HAVE_CLIPS],[1])
fi
fi
AC_SUBST(CLIPSSRC)
#
# Control CFLAGS setting in Makeconf.
#
AC_ARG_ENABLE(debuginfo,
AS_HELP_STRING([--disable-debuginfo],
[Disable debuginfo symbol generation for this package]),
[if test "x$enableval" = "xno"; then \
ENABLE_DEBUGINFO=0; \
else \
ENABLE_DEBUGINFO=1; \
fi],
[ENABLE_DEBUGINFO=1])
AC_SUBST(ENABLE_DEBUGINFO)
AC_ARG_ENABLE(profiling,
AS_HELP_STRING([--enable-profiling],
[Enable profiling info generation for this package]),
[if test "x$enableval" = "xyes"; then \
ENABLE_PROFILING=1; \
else \
ENABLE_PROFILING=0; \
fi],
[ENABLE_PROFILING=0])
AC_SUBST(ENABLE_PROFILING)
AC_ARG_ENABLE(vmi-debug,
AS_HELP_STRING([--disable-vmi-debug],
[Disable debug output for (non-xenaccess parts of) this package]),
[if "x$enableval" = "xno"; then \
ENABLE_VMI_DEBUG=0; \
else \
ENABLE_VMI_DEBUG=1; \
fi],
[ENABLE_VMI_DEBUG=1])
AC_SUBST(ENABLE_VMI_DEBUG)
#
# Check for disabled java support
#
ENABLE_JAVA=1
AC_ARG_ENABLE(java,
AS_HELP_STRING([--disable-java],
[Disable java XML SOAP client support]),
[if test "x$enableval" = "xno"; then \
ENABLE_JAVA=0; \
else \
ENABLE_JAVA=1; \
fi],
[ENABLE_JAVA=1])
AC_SUBST(ENABLE_JAVA)
#
# If enabled, we need javac, java, jar, and ant; JAVA_HOME, AXIS2_HOME, and
# $AXIS2_HOME/bin/wsdl2java.sh .
#
if test "${ENABLE_JAVA}" = "1"; then
#
# --with-java
#
AC_ARG_WITH([java],
AS_HELP_STRING([--with-java=DIRECTORY],
[find java install in DIRECTORY]),
[JAVA_HOME="$with_java"])
#
# JAVA_HOME, java, javac
#
if test -z "${JAVA_HOME}" ; then
AC_PATH_PROG(JAVA,java)
if test -z "$JAVA" ; then
AC_MSG_ERROR([no java found in \$PATH])
fi
AC_PATH_PROG(JAVAC,javac)
if test -z "${JAVAC}" ; then
AC_MSG_ERROR([no javac found in \$PATH])
fi
AC_PATH_PROG(JAR,jar)
if test -z "${JAR}" ; then
AC_MSG_ERROR([no jar found in \$PATH])
fi
AC_PATH_PROG(JDB,jdb)
if test -z "${JDB}" ; then
AC_MSG_ERROR([no jdb found in \$PATH])
fi
# assuming we don't error out, extract JAVA_HOME, we need it set
JAVA_HOME=`echo "${JAVA}" | sed -e 's/\(\/bin\/java\)//'`
else
#
# Check for bin/java and bin/javac
#
if ! test -x "${JAVA_HOME}/bin/java"; then
AC_MSG_ERROR("No java in ${JAVA_HOME}/bin!")
fi
JAVA="${JAVA_HOME}/bin/java"
if ! test -x "${JAVA_HOME}/bin/javac"; then
AC_MSG_ERROR("No javac in ${JAVA_HOME}/bin!")
fi
JAVAC="${JAVA_HOME}/bin/javac"
if ! test -x "${JAVA_HOME}/bin/jar"; then
AC_MSG_ERROR("No jar in ${JAVA_HOME}/bin!")
fi
JAR="${JAVA_HOME}/bin/jar"
if ! test -x "${JAVA_HOME}/bin/jdb"; then
AC_MSG_ERROR("No jdb in ${JAVA_HOME}/bin!")
fi
JDB="${JAVA_HOME}/bin/jdb"
fi
AC_SUBST(JAVA_HOME)
AC_SUBST(JAVA)
AC_SUBST(JAVAC)
AC_SUBST(JAR)
AC_SUBST(JDB)
#
# ant
#
AC_ARG_WITH([ant],
AS_HELP_STRING([--with-ant=DIRECTORY],
[find ant install in DIRECTORY]),
[ANT_HOME="$with_ant"])
if test ! -d "${ANT_HOME}" \
-o ! -x "${ANT_HOME}/bin/ant" ; then
#
# Check /usr/local/apache-ant* and /opt/apache-ant* and /usr
#
for ant in /usr/local/apache-ant* /opt/apache-ant* /usr; do
if test -x "$ant/bin/ant"; then
ANT_HOME="$ant"
break
fi
done
fi
if test -n "$with_ant" -a -z "${ANT_HOME}"; then
AC_MSG_ERROR("Cannot find ant install!")
fi
if test -n "$ANT_HOME"; then
ANT="${ANT_HOME}/bin/ant"
AC_MSG_NOTICE("found ant as $ANT")
else
ANT=""
fi
AC_SUBST(ANT)
#
# axis2
#
AC_ARG_WITH([axis2],
AS_HELP_STRING([--with-axis2=DIRECTORY],
[find axis2 install in DIRECTORY]),
[AXIS2_HOME="$with_axis2"])
if test -d "${AXIS2_HOME}" ; then
if ! test -x "${AXIS2_HOME}/bin/wsdl2java.sh" ; then
AC_MSG_ERROR([no wsdl2java.sh found in ${AXIS2_HOME}/bin])
fi
else
#
# Check /usr/local/axis* and /opt/axis*
#
for axis in /usr/local/axis* /opt/axis*; do
if test -x "$axis/bin/wsdl2java.sh"; then
AXIS2_HOME="$axis"
break
fi
done
if test -z "${AXIS2_HOME}"; then
AC_MSG_ERROR("Cannot find axis2 install in /usr/local or /opt!")
fi
fi
AC_SUBST(AXIS2_HOME)
fi
#
# Check for JAVA_HOME/AXIS2_HOME, and $AXIS2_HOME/bin/wsdl2java.sh .
#
#
# Are we going to build the main testsuite?
#
ENABLE_TESTS=0
AC_ARG_ENABLE(tests,
AS_HELP_STRING([--enable-tests],
[Enable test case generation]),
[if test "x$enableval" = "xyes"; then \
ENABLE_TESTS=1; \
else \
ENABLE_TESTS=0; \
fi],
[ENABLE_TESTS=0])
outfiles="$outfiles Makeconf Makefile include/Makefile lib/Makefile \
dwdebug/Makefile target/Makefile tests/Makefile analysis/Makefile \
xml/Makefile xml/schema/Makefile xml/service/Makefile \
xml/client/Makefile xml/client/python/Makefile \
xml/client/java/Makefile \
tools/Makefile tools/rop/Makefile tools/cfi/Makefile tools/nullpage/Makefile \
tools/bts/Makefile tools/syscall/Makefile tools/spf/Makefile \
tools/pingpongmonitor/Makefile \
asm/moti/Makefile \
xenaccess/Makefile vmprobes/Makefile vmprobes/examples/Makefile \
vmfs/Makefile vmps/Makefile vmtap/Makefile xentt/Makefile \
examples/Makefile examples/Makefile.example \
examples/nfs-perf-analysis/Makefile \
examples/perf-model-test/Makefile \
examples/context-aware-probes/Makefile \
examples/context-tracker/Makefile \
examples/context-tracker/examples/Makefile \
examples/context-tracker/examples/dumpcontext/Makefile \
examples/context-tracker/examples/null-deref-analysis/Makefile \
examples/null-deref-analysis/Makefile \
examples/local-dos-analysis/Makefile \
examples/multi-base/Makefile.example \
examples/multi-overlay/Makefile.example \
examples/multi-watch/Makefile.example"
if test "${ENABLE_TESTS}" = "1"; then
outfiles+=" tests/dwdebug/Makefile"
outfiles+=" tests/dwdebug/c/Makefile tests/dwdebug/c/Makeconf"
for ctestdir in ${srcdir}/tests/dwdebug/c/@<:@0-9@:>@* ; do
outfiles+=" tests/dwdebug/c/`basename ${ctestdir}`/Makefile"
done
outfiles+=" tests/dwdebug/cpp/Makefile tests/dwdebug/cpp/Makeconf"
for ctestdir in ${srcdir}/tests/dwdebug/cpp/@<:@0-9@:>@* ; do
outfiles+=" tests/dwdebug/cpp/`basename ${ctestdir}`/Makefile"
done
fi
#
# Do this for easy distclean.
#
DISTCLEAN_FILES="$outfiles"
AC_SUBST(DISTCLEAN_FILES)
AC_OUTPUT($outfiles)