-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
197 lines (162 loc) · 6.21 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
# (C) Copyright IBM Corp. 2005
m4_define([libvirtcim_maj], [0])
m4_define([libvirtcim_min], [6])
m4_define([libvirtcim_mic], [3])
m4_define([libvirtcim_version], [libvirtcim_maj.libvirtcim_min.libvirtcim_mic])
AC_INIT([libvirt CMPI provider], [libvirtcim_version], [cvincent us ibm com],
[libvirt-cim])
AC_CONFIG_SRCDIR([src/Virt_ComputerSystem.c])
# Autogenerate the autoconf header file to store build settings
AC_CONFIG_HEADER([config.h])
# Use silent rules if possible
AM_INIT_AUTOMAKE([tar-pax no-dist-gzip dist-xz])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
m4_define([lt_cur], m4_eval(libvirtcim_maj + libvirtcim_min))
m4_define([lt_rev], libvirtcim_mic)
m4_define([lt_age], libvirtcim_min)
VERSION_INFO="lt_cur:lt_rev:lt_age"
AC_SUBST(VERSION_INFO)
AC_PROG_CC
AC_C_CONST
AC_PROG_LIBTOOL
AC_PROG_INSTALL
AC_CHECK_HEADERS([stdlib.h string.h unistd.h])
AC_CHECK_HEADERS([stdarg.h errno.h])
AC_HEADER_STDC
AC_CHECK_FUNCS([popen pclose fgets asprintf vfprintf fprintf snprintf sscanf])
CPPFLAGS="$CPPFLAGS -DCMPI_VERSION=100"
#CPPFLAGS="$CPPFLAGS -DSBLIM_DEBUG"
CC_WARNINGS="\
-Wall \
-Wmissing-prototypes \
-Wmissing-declarations \
-Wstrict-prototypes \
-Wpointer-arith \
-Wformat=2 \
-Wformat-security \
-Wformat-nonliteral \
-Wno-format-y2k \
-Wcast-align \
-Wno-unused-value"
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE"
# Configure command line options
AC_ARG_VAR([CIMSERVER],[the target CIM server (pegasus|sfcb|openwbem|sniacimom).
])
AC_ARG_VAR([PROVIDERDIR],[the directory where the CMPI providers will be install
ed.])
AC_ARG_WITH([kvm-max-nics],
AC_HELP_STRING([--with-kvm-max-nics=X],
[Maximum NICs to advertise for KVM]),
[test "x$withval" != "x" && KVM_MAX_NICS=$withval],
[KVM_MAX_NICS=8])
AC_SUBST(KVM_MAX_NICS)
AC_DEFINE_UNQUOTED(KVM_MAX_NICS, $KVM_MAX_NICS, [Maximum NIC limit for KVM])
AC_ARG_WITH([xen-max-nics],
AC_HELP_STRING([--with-xen-max-nics=X],
[Maximum NIC limit to advertise for Xen (unless known by the provider)]),
[test "x$withval" != "x" && XEN_MAX_NICS=$withval],
[XEN_MAX_NICS=8])
AC_SUBST(XEN_MAX_NICS)
AC_DEFINE_UNQUOTED(XEN_MAX_NICS, $XEN_MAX_NICS, [Maximum NIC limit for Xen])
AC_ARG_WITH([namespace],
AC_HELP_STRING([--with-namespace=ns],
[CIM namespace to use, default root/virt]),
[test "x$withval" != "x" && CIM_VIRT_NS="$withval"],
[CIM_VIRT_NS="root/virt"])
AC_SUBST(CIM_VIRT_NS)
AC_DEFINE_UNQUOTED(CIM_VIRT_NS, "$CIM_VIRT_NS", [Namespace for provider source])
AC_ARG_WITH([diskconfig],
[ --with-diskconfig=PATH Set config file for disk pool. (default=/etc/libvirt/diskpool.conf)],
[DEFINE_DISK_CONFIG($with_diskconfig)],
[DEFINE_DISK_CONFIG(/etc/libvirt/diskpool.conf)]
)
AC_ARG_WITH([info_store],
[ --with-info-store=PATH Set information store location (default=/etc/libvirt/cim)],
[DEFINE_INFO_STORE($withval)],
[DEFINE_INFO_STORE(/etc/libvirt/cim)]
)
AC_ARG_WITH([maxmem],
[ --with-maxmem=FOO Set max memory (KB) for a guest.],
[DEFINE_MAXMEM($with_maxmem)],
[DEFINE_MAXMEM(4194304)]
)
AC_ARG_WITH(html-dir,
AC_HELP_STRING([--with-html-dir=path],
[path to html directory, default $datadir/doc/$PACKAGE-$VERSION/html]),
[test "x$withval" != "x" && HTML_DIR="$withval"],
[HTML_DIR='$(datadir)/doc/$(PACKAGE)-$(VERSION)/html'])
AC_SUBST(HTML_DIR)
AC_ARG_WITH([migrate_check_timeout],
[ --with-migrate_check_timeout=SECS Max runtime allowed for external migration checks],
[test "x$withval" != "x" && MIG_CHECKS_TIMEOUT="$withval"],
[MIG_CHECKS_TIMEOUT=10])
AC_SUBST(MIG_CHECKS_TIMEOUT)
AC_DEFINE_UNQUOTED(MIG_CHECKS_TIMEOUT, $MIG_CHECKS_TIMEOUT, [External migration check timeout])
AC_ARG_WITH([migrate_check_dir],
[ --with-migrate_check_dir=dir Location of external migration checks],
[test "x$withval" != "x" && MIG_CHECKS_DIR="$withval"],
[MIG_CHECKS_DIR=/usr/libexec/libvirt-cim/extchecks])
AC_SUBST(MIG_CHECKS_DIR)
AC_DEFINE_UNQUOTED(MIG_CHECKS_DIR, "$MIG_CHECKS_DIR", [External migration check timeout])
if test -x /usr/lib64/xen/bin/qemu-dm; then
default_xen_emulator=/usr/lib64/xen/bin/qemu-dm
elif test -x /usr/lib/xen/bin/qemu-dm; then
default_xen_emulator=/usr/lib/xen/bin/qemu-dm
else
default_xen_emulator=/bin/false
fi
AC_ARG_WITH([xen_emulator],
[ --with-xen_emulator=emu Location of Xen FullVirt emulator],
[test "x$withval" != "x" && XEN_EMULATOR="$withval"],
[XEN_EMULATOR=$default_xen_emulator])
AC_SUBST(XEN_EMULATOR)
AC_DEFINE_UNQUOTED(XEN_EMULATOR, "$XEN_EMULATOR", [Location of Xen FullVirt emulator])
AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
# Autogenerate the Makefile
AC_CONFIG_FILES([
base_schema/install_base_schema.sh
base_schema/Makefile
libxkutil/Makefile
src/Makefile
doc/Makefile
Makefile
])
# Check for the required CMPI header files (this macro is defined in acinclude.m4)
CHECK_CMPI
CHECK_IND_VOID
# Check for where to install CMPI libraries (this macro is defined in acinclude.m4)
CHECK_PROVIDERDIR
# Check for presense of a CIM server (this macro is defined in acinclude.m4)
CHECK_CIMSERVER
# Check pkg-config program
PKG_PROG_PKG_CONFIG
# Check for presence of libraries
CHECK_LIBVIRT
CHECK_LIBXML2
CHECK_LIBCU
CHECK_LIBUUID
CHECK_LIBCONFIG
CFLAGS_STRICT="-Werror"
AC_ARG_ENABLE([werror],
[ --enable-werror enable werror on builds [[default=yes]]],
[if test "x$enableval" = "xno"; then
CFLAGS_STRICT=""
fi])
AC_SUBST(CFLAGS_STRICT)
CFLAGS="$CFLAGS $CC_WARNINGS"
SET_CSET
# Display configuration options
echo "----------------------------------------------------------"
echo "Configuration for $PACKAGE complete."
echo ""
echo "The following configuration options have been selected:"
echo " CIMSERVER: " $CIMSERVER
echo " PROVIDERDIR: " $PROVIDERDIR
echo " CPPFLAGS:" $CPPFLAGS
echo
echo "You can override these values by setting the corresponding"
echo "configure command-line option(s); e.g."
echo " ./configure PROVIDERDIR=/home/me/lib/sblim/"
echo "----------------------------------------------------------"
# Generate configure scripts for the Makefile
AC_OUTPUT(libvirt-cim.spec)