root / configure.ac @ c777c5fc
History | View | Annotate | Download (23.2 kB)
1 |
# Configure script for Ganeti |
---|---|
2 |
m4_define([gnt_version_major], [2]) |
3 |
m4_define([gnt_version_minor], [12]) |
4 |
m4_define([gnt_version_revision], [0]) |
5 |
m4_define([gnt_version_suffix], [~alpha1]) |
6 |
m4_define([gnt_version_full], |
7 |
m4_format([%d.%d.%d%s], |
8 |
gnt_version_major, gnt_version_minor, |
9 |
gnt_version_revision, gnt_version_suffix)) |
10 |
|
11 |
AC_PREREQ(2.59) |
12 |
AC_INIT(ganeti, gnt_version_full, ganeti@googlegroups.com) |
13 |
AC_CONFIG_AUX_DIR(autotools) |
14 |
AC_CONFIG_SRCDIR(configure) |
15 |
AM_INIT_AUTOMAKE([1.9 foreign tar-ustar -Wall -Wno-portability]) |
16 |
|
17 |
AC_SUBST([VERSION_MAJOR], gnt_version_major) |
18 |
AC_SUBST([VERSION_MINOR], gnt_version_minor) |
19 |
AC_SUBST([VERSION_REVISION], gnt_version_revision) |
20 |
AC_SUBST([VERSION_SUFFIX], gnt_version_suffix) |
21 |
AC_SUBST([VERSION_FULL], gnt_version_full) |
22 |
|
23 |
# --enable-versionfull |
24 |
AC_ARG_ENABLE([versionfull], |
25 |
[AS_HELP_STRING([--enable-versionfull], |
26 |
m4_normalize([use the full version string rather |
27 |
than major.minor for version directories]))], |
28 |
[[if test "$enableval" != no; then |
29 |
USE_VERSION_FULL=yes |
30 |
else |
31 |
USER_VERSION_FULL=no |
32 |
fi |
33 |
]], |
34 |
[USE_VERSION_FULL=no |
35 |
]) |
36 |
AC_SUBST(USE_VERSION_FULL, $USE_VERSION_FULL) |
37 |
AM_CONDITIONAL([USE_VERSION_FULL], [test "$USE_VERSION_FULL" = yes]) |
38 |
|
39 |
# --enable-symlinks |
40 |
AC_ARG_ENABLE([symlinks], |
41 |
[AS_HELP_STRING([--enable-symlinks], |
42 |
m4_normalize([also install version-dependent symlinks under |
43 |
$sysconfdir (default: disabled)]))], |
44 |
[[if test "$enableval" != yes; then |
45 |
INSTALL_SYMLINKS=no |
46 |
else |
47 |
INSTALL_SYMLINKS=yes |
48 |
fi |
49 |
]], |
50 |
[INSTALL_SYMLINKS=no |
51 |
]) |
52 |
AC_SUBST(INSTALL_SYMLINKS, $INSTALL_SYMLINKS) |
53 |
AM_CONDITIONAL([INSTALL_SYMLINKS], [test "$INSTALL_SYMLINKS" = yes]) |
54 |
|
55 |
# --with-ssh-initscript=... |
56 |
AC_ARG_WITH([ssh-initscript], |
57 |
[AS_HELP_STRING([--with-ssh-initscript=SCRIPT], |
58 |
[SSH init script to use (default is /etc/init.d/ssh)] |
59 |
)], |
60 |
[ssh_initd_script="$withval"], |
61 |
[ssh_initd_script="/etc/init.d/ssh"]) |
62 |
AC_SUBST(SSH_INITD_SCRIPT, $ssh_initd_script) |
63 |
|
64 |
# --with-export-dir=... |
65 |
AC_ARG_WITH([export-dir], |
66 |
[AS_HELP_STRING([--with-export-dir=DIR], |
67 |
[directory to use by default for instance image] |
68 |
[ exports (default is /srv/ganeti/export)] |
69 |
)], |
70 |
[export_dir="$withval"], |
71 |
[export_dir="/srv/ganeti/export"]) |
72 |
AC_SUBST(EXPORT_DIR, $export_dir) |
73 |
|
74 |
# --with-ssh-config-dir=... |
75 |
AC_ARG_WITH([ssh-config-dir], |
76 |
[AS_HELP_STRING([--with-ssh-config-dir=DIR], |
77 |
[ directory with ssh host keys ] |
78 |
[ (default is /etc/ssh)] |
79 |
)], |
80 |
[ssh_config_dir="$withval"], |
81 |
[ssh_config_dir="/etc/ssh"]) |
82 |
AC_SUBST(SSH_CONFIG_DIR, $ssh_config_dir) |
83 |
|
84 |
# --with-xen-config-dir=... |
85 |
AC_ARG_WITH([xen-config-dir], |
86 |
[AS_HELP_STRING([--with-xen-config-dir=DIR], |
87 |
m4_normalize([Xen configuration directory |
88 |
(default: /etc/xen)]))], |
89 |
[xen_config_dir="$withval"], |
90 |
[xen_config_dir=/etc/xen]) |
91 |
AC_SUBST(XEN_CONFIG_DIR, $xen_config_dir) |
92 |
|
93 |
# --with-os-search-path=... |
94 |
AC_ARG_WITH([os-search-path], |
95 |
[AS_HELP_STRING([--with-os-search-path=LIST], |
96 |
[comma separated list of directories to] |
97 |
[ search for OS images (default is /srv/ganeti/os)] |
98 |
)], |
99 |
[os_search_path="$withval"], |
100 |
[os_search_path="/srv/ganeti/os"]) |
101 |
AC_SUBST(OS_SEARCH_PATH, $os_search_path) |
102 |
|
103 |
# --with-extstorage-search-path=... |
104 |
AC_ARG_WITH([extstorage-search-path], |
105 |
[AS_HELP_STRING([--with-extstorage-search-path=LIST], |
106 |
[comma separated list of directories to] |
107 |
[ search for External Storage Providers] |
108 |
[ (default is /srv/ganeti/extstorage)] |
109 |
)], |
110 |
[es_search_path="$withval"], |
111 |
[es_search_path="/srv/ganeti/extstorage"]) |
112 |
AC_SUBST(ES_SEARCH_PATH, $es_search_path) |
113 |
|
114 |
# --with-iallocator-search-path=... |
115 |
AC_ARG_WITH([iallocator-search-path], |
116 |
[AS_HELP_STRING([--with-iallocator-search-path=LIST], |
117 |
[comma separated list of directories to] |
118 |
[ search for instance allocators (default is $libdir/ganeti/iallocators)] |
119 |
)], |
120 |
[iallocator_search_path="$withval"], |
121 |
[iallocator_search_path="$libdir/$PACKAGE_NAME/iallocators"]) |
122 |
AC_SUBST(IALLOCATOR_SEARCH_PATH, $iallocator_search_path) |
123 |
|
124 |
# --with-xen-bootloader=... |
125 |
AC_ARG_WITH([xen-bootloader], |
126 |
[AS_HELP_STRING([--with-xen-bootloader=PATH], |
127 |
[bootloader for Xen hypervisor (default is empty)] |
128 |
)], |
129 |
[xen_bootloader="$withval"], |
130 |
[xen_bootloader=]) |
131 |
AC_SUBST(XEN_BOOTLOADER, $xen_bootloader) |
132 |
|
133 |
# --with-xen-kernel=... |
134 |
AC_ARG_WITH([xen-kernel], |
135 |
[AS_HELP_STRING([--with-xen-kernel=PATH], |
136 |
[DomU kernel image for Xen hypervisor (default is /boot/vmlinuz-3-xenU)] |
137 |
)], |
138 |
[xen_kernel="$withval"], |
139 |
[xen_kernel="/boot/vmlinuz-3-xenU"]) |
140 |
AC_SUBST(XEN_KERNEL, $xen_kernel) |
141 |
|
142 |
# --with-xen-initrd=... |
143 |
AC_ARG_WITH([xen-initrd], |
144 |
[AS_HELP_STRING([--with-xen-initrd=PATH], |
145 |
[DomU initrd image for Xen hypervisor (default is /boot/initrd-3-xenU)] |
146 |
)], |
147 |
[xen_initrd="$withval"], |
148 |
[xen_initrd="/boot/initrd-3-xenU"]) |
149 |
AC_SUBST(XEN_INITRD, $xen_initrd) |
150 |
|
151 |
# --with-kvm-kernel=... |
152 |
AC_ARG_WITH([kvm-kernel], |
153 |
[AS_HELP_STRING([--with-kvm-kernel=PATH], |
154 |
[Guest kernel image for KVM hypervisor (default is /boot/vmlinuz-3-kvmU)] |
155 |
)], |
156 |
[kvm_kernel="$withval"], |
157 |
[kvm_kernel="/boot/vmlinuz-3-kvmU"]) |
158 |
AC_SUBST(KVM_KERNEL, $kvm_kernel) |
159 |
|
160 |
# --with-kvm-path=... |
161 |
AC_ARG_WITH([kvm-path], |
162 |
[AS_HELP_STRING([--with-kvm-path=PATH], |
163 |
[absolute path to the kvm binary] |
164 |
[ (default is /usr/bin/kvm)] |
165 |
)], |
166 |
[kvm_path="$withval"], |
167 |
[kvm_path="/usr/bin/kvm"]) |
168 |
AC_SUBST(KVM_PATH, $kvm_path) |
169 |
|
170 |
# --with-lvm-stripecount=... |
171 |
AC_ARG_WITH([lvm-stripecount], |
172 |
[AS_HELP_STRING([--with-lvm-stripecount=NUM], |
173 |
[the default number of stripes to use for LVM volumes] |
174 |
[ (default is 1)] |
175 |
)], |
176 |
[lvm_stripecount="$withval"], |
177 |
[lvm_stripecount=1]) |
178 |
AC_SUBST(LVM_STRIPECOUNT, $lvm_stripecount) |
179 |
|
180 |
# --with-ssh-login-user=... |
181 |
AC_ARG_WITH([ssh-login-user], |
182 |
[AS_HELP_STRING([--with-ssh-login-user=USERNAME], |
183 |
[user to use for SSH logins within the cluster (default is root)] |
184 |
)], |
185 |
[ssh_login_user="$withval"], |
186 |
[ssh_login_user=root]) |
187 |
AC_SUBST(SSH_LOGIN_USER, $ssh_login_user) |
188 |
|
189 |
# --with-ssh-console-user=... |
190 |
AC_ARG_WITH([ssh-console-user], |
191 |
[AS_HELP_STRING([--with-ssh-console-user=USERNAME], |
192 |
[user to use for SSH logins to access instance consoles (default is root)] |
193 |
)], |
194 |
[ssh_console_user="$withval"], |
195 |
[ssh_console_user=root]) |
196 |
AC_SUBST(SSH_CONSOLE_USER, $ssh_console_user) |
197 |
|
198 |
# --with-default-user=... |
199 |
AC_ARG_WITH([default-user], |
200 |
[AS_HELP_STRING([--with-default-user=USERNAME], |
201 |
[default user for daemons] |
202 |
[ (default is to run all daemons as root)] |
203 |
)], |
204 |
[user_default="$withval"], |
205 |
[user_default=root]) |
206 |
|
207 |
# --with-default-group=... |
208 |
AC_ARG_WITH([default-group], |
209 |
[AS_HELP_STRING([--with-default-group=GROUPNAME], |
210 |
[default group for daemons] |
211 |
[ (default is to run all daemons under group root)] |
212 |
)], |
213 |
[group_default="$withval"], |
214 |
[group_default=root]) |
215 |
|
216 |
# --with-user-prefix=... |
217 |
AC_ARG_WITH([user-prefix], |
218 |
[AS_HELP_STRING([--with-user-prefix=PREFIX], |
219 |
[prefix for daemon users] |
220 |
[ (default is to run all daemons as root; use --with-default-user] |
221 |
[ to change the default)] |
222 |
)], |
223 |
[user_masterd="${withval}masterd"; |
224 |
user_rapi="${withval}rapi"; |
225 |
user_confd="${withval}confd"; |
226 |
user_kvmd="$user_default"; |
227 |
user_luxid="${withval}luxid"; |
228 |
user_noded="$user_default"; |
229 |
user_mond="$user_default"], |
230 |
[user_masterd="$user_default"; |
231 |
user_rapi="$user_default"; |
232 |
user_confd="$user_default"; |
233 |
user_kvmd="$user_default"; |
234 |
user_luxid="$user_default"; |
235 |
user_noded="$user_default"; |
236 |
user_mond="$user_default"]) |
237 |
AC_SUBST(MASTERD_USER, $user_masterd) |
238 |
AC_SUBST(RAPI_USER, $user_rapi) |
239 |
AC_SUBST(CONFD_USER, $user_confd) |
240 |
AC_SUBST(KVMD_USER, $user_kvmd) |
241 |
AC_SUBST(LUXID_USER, $user_luxid) |
242 |
AC_SUBST(NODED_USER, $user_noded) |
243 |
AC_SUBST(MOND_USER, $user_mond) |
244 |
|
245 |
# --with-group-prefix=... |
246 |
AC_ARG_WITH([group-prefix], |
247 |
[AS_HELP_STRING([--with-group-prefix=PREFIX], |
248 |
[prefix for daemon POSIX groups] |
249 |
[ (default is to run all daemons under group root; use] |
250 |
[ --with-default-group to change the default)] |
251 |
)], |
252 |
[group_rapi="${withval}rapi"; |
253 |
group_admin="${withval}admin"; |
254 |
group_confd="${withval}confd"; |
255 |
group_kvmd="$group_default"; |
256 |
group_luxid="${withval}luxid"; |
257 |
group_masterd="${withval}masterd"; |
258 |
group_noded="$group_default"; |
259 |
group_daemons="${withval}daemons"; |
260 |
group_mond="$group_default"], |
261 |
[group_rapi="$group_default"; |
262 |
group_admin="$group_default"; |
263 |
group_confd="$group_default"; |
264 |
group_kvmd="$group_default"; |
265 |
group_luxid="$group_default"; |
266 |
group_masterd="$group_default"; |
267 |
group_noded="$group_default"; |
268 |
group_daemons="$group_default"; |
269 |
group_mond="$group_default"]) |
270 |
AC_SUBST(RAPI_GROUP, $group_rapi) |
271 |
AC_SUBST(ADMIN_GROUP, $group_admin) |
272 |
AC_SUBST(CONFD_GROUP, $group_confd) |
273 |
AC_SUBST(KVMD_GROUP, $group_kvmd) |
274 |
AC_SUBST(LUXID_GROUP, $group_luxid) |
275 |
AC_SUBST(MASTERD_GROUP, $group_masterd) |
276 |
AC_SUBST(NODED_GROUP, $group_noded) |
277 |
AC_SUBST(DAEMONS_GROUP, $group_daemons) |
278 |
AC_SUBST(MOND_GROUP, $group_mond) |
279 |
|
280 |
# Print the config to the user |
281 |
AC_MSG_NOTICE([Running ganeti-masterd as $group_masterd:$group_masterd]) |
282 |
AC_MSG_NOTICE([Running ganeti-rapi as $user_rapi:$group_rapi]) |
283 |
AC_MSG_NOTICE([Running ganeti-confd as $user_confd:$group_confd]) |
284 |
AC_MSG_NOTICE([Running ganeti-luxid as $user_luxid:$group_luxid]) |
285 |
AC_MSG_NOTICE([Group for daemons is $group_daemons]) |
286 |
AC_MSG_NOTICE([Group for clients is $group_admin]) |
287 |
|
288 |
# --enable-drbd-barriers |
289 |
AC_ARG_ENABLE([drbd-barriers], |
290 |
[AS_HELP_STRING([--enable-drbd-barriers], |
291 |
m4_normalize([enable the DRBD barriers functionality by |
292 |
default (>= 8.0.12) (default: enabled)]))], |
293 |
[[if test "$enableval" != no; then |
294 |
DRBD_BARRIERS=n |
295 |
DRBD_NO_META_FLUSH=False |
296 |
else |
297 |
DRBD_BARRIERS=bf |
298 |
DRBD_NO_META_FLUSH=True |
299 |
fi |
300 |
]], |
301 |
[DRBD_BARRIERS=n |
302 |
DRBD_NO_META_FLUSH=False |
303 |
]) |
304 |
AC_SUBST(DRBD_BARRIERS, $DRBD_BARRIERS) |
305 |
AC_SUBST(DRBD_NO_META_FLUSH, $DRBD_NO_META_FLUSH) |
306 |
|
307 |
# --enable-syslog[=no/yes/only] |
308 |
AC_ARG_ENABLE([syslog], |
309 |
[AS_HELP_STRING([--enable-syslog], |
310 |
[enable use of syslog (default: disabled), one of no/yes/only])], |
311 |
[[case "$enableval" in |
312 |
no) |
313 |
SYSLOG=no |
314 |
;; |
315 |
yes) |
316 |
SYSLOG=yes |
317 |
;; |
318 |
only) |
319 |
SYSLOG=only |
320 |
;; |
321 |
*) |
322 |
SYSLOG= |
323 |
;; |
324 |
esac |
325 |
]], |
326 |
[SYSLOG=no]) |
327 |
|
328 |
if test -z "$SYSLOG" |
329 |
then |
330 |
AC_MSG_ERROR([invalid value for syslog, choose one of no/yes/only]) |
331 |
fi |
332 |
AC_SUBST(SYSLOG_USAGE, $SYSLOG) |
333 |
|
334 |
# --enable-restricted-commands[=no/yes] |
335 |
AC_ARG_ENABLE([restricted-commands], |
336 |
[AS_HELP_STRING([--enable-restricted-commands], |
337 |
m4_normalize([enable restricted commands in the node daemon |
338 |
(default: disabled)]))], |
339 |
[[if test "$enableval" = no; then |
340 |
enable_restricted_commands=False |
341 |
else |
342 |
enable_restricted_commands=True |
343 |
fi |
344 |
]], |
345 |
[enable_restricted_commands=False]) |
346 |
AC_SUBST(ENABLE_RESTRICTED_COMMANDS, $enable_restricted_commands) |
347 |
|
348 |
# --with-disk-separator=... |
349 |
AC_ARG_WITH([disk-separator], |
350 |
[AS_HELP_STRING([--with-disk-separator=STRING], |
351 |
[Disk index separator, useful if the default of ':' is handled] |
352 |
[ specially by the hypervisor] |
353 |
)], |
354 |
[disk_separator="$withval"], |
355 |
[disk_separator=":"]) |
356 |
AC_SUBST(DISK_SEPARATOR, $disk_separator) |
357 |
|
358 |
# Check common programs |
359 |
AC_PROG_INSTALL |
360 |
AC_PROG_LN_S |
361 |
|
362 |
# check if ln is the GNU version of ln (and hence supports -T) |
363 |
if ln --version 2> /dev/null | head -1 | grep -q GNU |
364 |
then |
365 |
AC_SUBST(HAS_GNU_LN, True) |
366 |
else |
367 |
AC_SUBST(HAS_GNU_LN, False) |
368 |
fi |
369 |
|
370 |
# Check for the ip command |
371 |
AC_ARG_VAR(IP_PATH, [ip path]) |
372 |
AC_PATH_PROG(IP_PATH, [ip], []) |
373 |
if test -z "$IP_PATH" |
374 |
then |
375 |
AC_MSG_ERROR([ip command not found]) |
376 |
fi |
377 |
|
378 |
# Check for pandoc |
379 |
AC_ARG_VAR(PANDOC, [pandoc path]) |
380 |
AC_PATH_PROG(PANDOC, [pandoc], []) |
381 |
if test -z "$PANDOC" |
382 |
then |
383 |
AC_MSG_WARN([pandoc not found, man pages rebuild will not be possible]) |
384 |
fi |
385 |
|
386 |
# Check for python-sphinx |
387 |
AC_ARG_VAR(SPHINX, [sphinx-build path]) |
388 |
AC_PATH_PROG(SPHINX, [sphinx-build], []) |
389 |
if test -z "$SPHINX" |
390 |
then |
391 |
AC_MSG_WARN(m4_normalize([sphinx-build not found, documentation rebuild will |
392 |
not be possible])) |
393 |
else |
394 |
# Sphinx exits with code 1 when it prints its usage |
395 |
sphinxver=`{ $SPHINX --version 2>&1 || :; } | head -n 3` |
396 |
|
397 |
if ! echo "$sphinxver" | grep -q -w -e '^Sphinx' -e '^Usage:'; then |
398 |
AC_MSG_ERROR([Unable to determine Sphinx version]) |
399 |
|
400 |
# Note: Character classes ([...]) need to be double quoted due to autoconf |
401 |
# using m4 |
402 |
elif ! echo "$sphinxver" | grep -q -E '^Sphinx[[[:space:]]]+v[[1-9]]\>'; then |
403 |
AC_MSG_ERROR([Sphinx 1.0 or higher is required]) |
404 |
fi |
405 |
fi |
406 |
AM_CONDITIONAL([HAS_SPHINX], [test -n "$SPHINX"]) |
407 |
|
408 |
AC_ARG_ENABLE([manpages-in-doc], |
409 |
[AS_HELP_STRING([--enable-manpages-in-doc], |
410 |
m4_normalize([include man pages in HTML documentation |
411 |
(requires sphinx; default disabled)]))], |
412 |
[case "$enableval" in |
413 |
yes) manpages_in_doc=yes ;; |
414 |
no) manpages_in_doc= ;; |
415 |
*) |
416 |
AC_MSG_ERROR([Bad value $enableval for --enable-manpages-in-doc]) |
417 |
;; |
418 |
esac |
419 |
], |
420 |
[manpages_in_doc=]) |
421 |
AM_CONDITIONAL([MANPAGES_IN_DOC], [test -n "$manpages_in_doc"]) |
422 |
AC_SUBST(MANPAGES_IN_DOC, $manpages_in_doc) |
423 |
|
424 |
if test -z "$SPHINX" -a -n "$manpages_in_doc"; then |
425 |
AC_MSG_ERROR([Including man pages in HTML documentation requires sphinx]) |
426 |
fi |
427 |
|
428 |
# Check for graphviz (dot) |
429 |
AC_ARG_VAR(DOT, [dot path]) |
430 |
AC_PATH_PROG(DOT, [dot], []) |
431 |
if test -z "$DOT" |
432 |
then |
433 |
AC_MSG_WARN(m4_normalize([dot (from the graphviz suite) not found, |
434 |
documentation rebuild not possible])) |
435 |
fi |
436 |
|
437 |
# Check for pylint |
438 |
AC_ARG_VAR(PYLINT, [pylint path]) |
439 |
AC_PATH_PROG(PYLINT, [pylint], []) |
440 |
if test -z "$PYLINT" |
441 |
then |
442 |
AC_MSG_WARN([pylint not found, checking code will not be possible]) |
443 |
fi |
444 |
|
445 |
# Check for pep8 |
446 |
AC_ARG_VAR(PEP8, [pep8 path]) |
447 |
AC_PATH_PROG(PEP8, [pep8], []) |
448 |
if test -z "$PEP8" |
449 |
then |
450 |
AC_MSG_WARN([pep8 not found, checking code will not be complete]) |
451 |
fi |
452 |
AM_CONDITIONAL([HAS_PEP8], [test -n "$PEP8"]) |
453 |
|
454 |
# Check for python-coverage |
455 |
AC_ARG_VAR(PYCOVERAGE, [python-coverage path]) |
456 |
AC_PATH_PROGS(PYCOVERAGE, [python-coverage coverage], []) |
457 |
if test -z "$PYCOVERAGE" |
458 |
then |
459 |
AC_MSG_WARN(m4_normalize([python-coverage or coverage not found, evaluating |
460 |
Python test coverage will not be possible])) |
461 |
fi |
462 |
|
463 |
# Check for socat |
464 |
AC_ARG_VAR(SOCAT, [socat path]) |
465 |
AC_PATH_PROG(SOCAT, [socat], []) |
466 |
if test -z "$SOCAT" |
467 |
then |
468 |
AC_MSG_ERROR([socat not found]) |
469 |
fi |
470 |
|
471 |
# Check for qemu-img |
472 |
AC_ARG_VAR(QEMUIMG_PATH, [qemu-img path]) |
473 |
AC_PATH_PROG(QEMUIMG_PATH, [qemu-img], []) |
474 |
if test -z "$QEMUIMG_PATH" |
475 |
then |
476 |
AC_MSG_WARN([qemu-img not found, using ovfconverter will not be possible]) |
477 |
fi |
478 |
|
479 |
# --enable-confd |
480 |
ENABLE_CONFD= |
481 |
AC_ARG_ENABLE([confd], |
482 |
[AS_HELP_STRING([--enable-confd], |
483 |
[enable the ganeti-confd daemon (default: check)])], |
484 |
[], |
485 |
[enable_confd=check]) |
486 |
|
487 |
ENABLE_MOND= |
488 |
AC_ARG_ENABLE([monitoring], |
489 |
[AS_HELP_STRING([--enable-monitoring], |
490 |
[enable the ganeti monitoring daemon (default: check)])], |
491 |
[], |
492 |
[enable_monitoring=check]) |
493 |
|
494 |
# Check for ghc |
495 |
AC_ARG_VAR(GHC, [ghc path]) |
496 |
AC_PATH_PROG(GHC, [ghc], []) |
497 |
if test -z "$GHC"; then |
498 |
AC_MSG_FAILURE([ghc not found, compilation will not possible]) |
499 |
fi |
500 |
|
501 |
AC_MSG_CHECKING([checking for extra GHC flags]) |
502 |
GHC_BYVERSION_FLAGS= |
503 |
# check for GHC supported flags that vary accross versions |
504 |
for flag in -fwarn-incomplete-uni-patterns; do |
505 |
if $GHC -e '0' $flag >/dev/null 2>/dev/null; then |
506 |
GHC_BYVERSION_FLAGS="$GHC_BYVERSION_FLAGS $flag" |
507 |
fi |
508 |
done |
509 |
AC_MSG_RESULT($GHC_BYVERSION_FLAGS) |
510 |
AC_SUBST(GHC_BYVERSION_FLAGS) |
511 |
|
512 |
# Check for ghc-pkg |
513 |
AC_ARG_VAR(GHC_PKG, [ghc-pkg path]) |
514 |
AC_PATH_PROG(GHC_PKG, [ghc-pkg], []) |
515 |
if test -z "$GHC_PKG"; then |
516 |
AC_MSG_FAILURE([ghc-pkg not found, compilation will not be possible]) |
517 |
fi |
518 |
|
519 |
# check for modules, first custom/special checks |
520 |
AC_MSG_NOTICE([checking for required haskell modules]) |
521 |
HS_PARALLEL3= |
522 |
AC_GHC_PKG_CHECK([parallel-3.*], [HS_PARALLEL3=-DPARALLEL3], |
523 |
[AC_GHC_PKG_REQUIRE(parallel)], t) |
524 |
AC_SUBST(HS_PARALLEL3) |
525 |
|
526 |
# and now standard modules |
527 |
AC_GHC_PKG_REQUIRE(curl) |
528 |
AC_GHC_PKG_REQUIRE(json) |
529 |
AC_GHC_PKG_REQUIRE(network) |
530 |
AC_GHC_PKG_REQUIRE(mtl) |
531 |
AC_GHC_PKG_REQUIRE(bytestring) |
532 |
AC_GHC_PKG_REQUIRE(base64-bytestring-1.*, t) |
533 |
AC_GHC_PKG_REQUIRE(utf8-string) |
534 |
AC_GHC_PKG_REQUIRE(zlib) |
535 |
AC_GHC_PKG_REQUIRE(hslogger) |
536 |
|
537 |
# extra modules for confd functionality; also needed for tests |
538 |
HS_NODEV= |
539 |
CONFD_PKG= |
540 |
AC_GHC_PKG_CHECK([vector], [], [HS_NODEV=1; CONFD_PKG="$CONFD_PKG vector"]) |
541 |
|
542 |
HS_REGEX_PCRE=-DNO_REGEX_PCRE |
543 |
AC_GHC_PKG_CHECK([regex-pcre], [HS_REGEX_PCRE=], |
544 |
[HS_NODEV=1; CONFD_PKG="$CONFD_PKG regex-pcre"]) |
545 |
AC_GHC_PKG_CHECK([text], [], [HS_NODEV=1; CONFD_PKG="$CONFD_PKG text"]) |
546 |
AC_GHC_PKG_CHECK([hinotify], [], [HS_NODEV=1; CONFD_PKG="$CONFD_PKG hinotify"]) |
547 |
AC_GHC_PKG_CHECK([Crypto], [], [HS_NODEV=1; CONFD_PKG="$CONFD_PKG Crypto"]) |
548 |
|
549 |
has_confd=False |
550 |
if test "$enable_confd" != no; then |
551 |
if test -z "$CONFD_PKG"; then |
552 |
has_confd=True |
553 |
elif test "$enable_confd" = check; then |
554 |
AC_MSG_WARN(m4_normalize([The required extra libraries for confd were |
555 |
not found ($CONFD_PKG), confd disabled])) |
556 |
else |
557 |
AC_MSG_FAILURE(m4_normalize([The confd functionality was requested, but |
558 |
required libraries were not found: |
559 |
$CONFD_PKG])) |
560 |
fi |
561 |
fi |
562 |
AC_SUBST(HS_REGEX_PCRE) |
563 |
if test "$has_confd" = True; then |
564 |
AC_MSG_NOTICE([Enabling confd usage]) |
565 |
fi |
566 |
AC_SUBST(ENABLE_CONFD, $has_confd) |
567 |
AM_CONDITIONAL([ENABLE_CONFD], [test x$has_confd = xTrue]) |
568 |
|
569 |
#extra modules for monitoring daemon functionality; also needed for tests |
570 |
MONITORING_PKG= |
571 |
AC_GHC_PKG_CHECK([attoparsec], [], |
572 |
[HS_NODEV=1; MONITORING_PKG="$MONITORING_PKG attoparsec"]) |
573 |
AC_GHC_PKG_CHECK([snap-server], [], |
574 |
[NS_NODEV=1; MONITORING_PKG="$MONITORING_PKG snap-server"]) |
575 |
AC_GHC_PKG_CHECK([process], [], |
576 |
[HS_NODEV=1; MONITORING_PKG="$MONITORING_PKG process"]) |
577 |
|
578 |
has_monitoring=False |
579 |
if test "$enable_monitoring" != no; then |
580 |
MONITORING_DEP= |
581 |
if test "$has_confd" = False; then |
582 |
MONITORING_DEP="$MONITORING_DEP confd" |
583 |
fi |
584 |
has_monitoring_pkg=False |
585 |
if test -z "$MONITORING_PKG"; then |
586 |
has_monitoring_pkg=True |
587 |
elif test "$enable_monitoring" = check; then |
588 |
AC_MSG_WARN(m4_normalize([The required extra libraries for the monitoring |
589 |
daemon were not found ($MONITORING_PKG), |
590 |
monitoring disabled])) |
591 |
else |
592 |
AC_MSG_FAILURE(m4_normalize([The monitoring functionality was requested, but |
593 |
required libraries were not found: |
594 |
$MONITORING_PKG])) |
595 |
fi |
596 |
has_monitoring_dep=False |
597 |
if test -z "$MONITORING_DEP"; then |
598 |
has_monitoring_dep=True |
599 |
elif test "$enable_monitoring" = check; then |
600 |
AC_MSG_WARN(m4_normalize([The optional Ganeti components required for the |
601 |
monitoring agent were not enabled |
602 |
($MONITORING_DEP), monitoring disabled])) |
603 |
else |
604 |
AC_MSG_FAILURE(m4_normalize([The monitoring functionality was requested, but |
605 |
required optional Ganeti components were not |
606 |
found: $MONITORING_DEP])) |
607 |
fi |
608 |
|
609 |
fi |
610 |
if test "$has_monitoring_pkg" = True -a "$has_monitoring_dep" = True; then |
611 |
has_monitoring=True |
612 |
AC_MSG_NOTICE([Enabling the monitoring agent usage]) |
613 |
fi |
614 |
AC_SUBST(ENABLE_MOND, $has_monitoring) |
615 |
AM_CONDITIONAL([ENABLE_MOND], [test "$has_monitoring" = True]) |
616 |
|
617 |
# development modules |
618 |
AC_GHC_PKG_CHECK([QuickCheck-2.*], [], [HS_NODEV=1], t) |
619 |
AC_GHC_PKG_CHECK([test-framework-0.6*], [], [HS_NODEV=1], t) |
620 |
AC_GHC_PKG_CHECK([test-framework-hunit], [], [HS_NODEV=1]) |
621 |
AC_GHC_PKG_CHECK([test-framework-quickcheck2], [], [HS_NODEV=1]) |
622 |
AC_GHC_PKG_CHECK([temporary], [], [HS_NODEV=1]) |
623 |
if test -n "$HS_NODEV"; then |
624 |
AC_MSG_WARN(m4_normalize([Required development modules were not found, |
625 |
you won't be able to run Haskell unittests])) |
626 |
else |
627 |
AC_MSG_NOTICE([Haskell development modules found, unittests enabled]) |
628 |
fi |
629 |
AC_SUBST(HS_NODEV) |
630 |
|
631 |
HTOOLS=yes |
632 |
AC_SUBST(HTOOLS) |
633 |
|
634 |
# Check for HsColour |
635 |
HS_APIDOC=no |
636 |
AC_ARG_VAR(HSCOLOUR, [HsColour path]) |
637 |
AC_PATH_PROG(HSCOLOUR, [HsColour], []) |
638 |
if test -z "$HSCOLOUR"; then |
639 |
AC_MSG_WARN(m4_normalize([HsColour not found, htools API documentation will |
640 |
not be generated])) |
641 |
fi |
642 |
|
643 |
# Check for haddock |
644 |
AC_ARG_VAR(HADDOCK, [haddock path]) |
645 |
AC_PATH_PROG(HADDOCK, [haddock], []) |
646 |
if test -z "$HADDOCK"; then |
647 |
AC_MSG_WARN(m4_normalize([haddock not found, htools API documentation will |
648 |
not be generated])) |
649 |
fi |
650 |
if test -n "$HADDOCK" && test -n "$HSCOLOUR"; then |
651 |
HS_APIDOC=yes |
652 |
fi |
653 |
AC_SUBST(HS_APIDOC) |
654 |
|
655 |
# Check for hlint |
656 |
AC_ARG_VAR(HLINT, [hlint path]) |
657 |
AC_PATH_PROG(HLINT, [hlint], []) |
658 |
if test -z "$HLINT"; then |
659 |
AC_MSG_WARN([hlint not found, checking code will not be possible]) |
660 |
fi |
661 |
|
662 |
if test "$HTOOLS" != yes && test "$ENABLE_CONFD" = True; then |
663 |
AC_MSG_ERROR(m4_normalize([cannot enable ganeti-confd if |
664 |
htools support is not enabled])) |
665 |
fi |
666 |
|
667 |
AM_CONDITIONAL([WANT_HTOOLS], [test "$HTOOLS" = yes]) |
668 |
AM_CONDITIONAL([WANT_HSTESTS], [test "x$HS_NODEV" = x]) |
669 |
AM_CONDITIONAL([WANT_HSAPIDOC], [test "$HS_APIDOC" = yes]) |
670 |
AM_CONDITIONAL([HAS_HLINT], [test "$HLINT"]) |
671 |
|
672 |
# Check for fakeroot |
673 |
AC_ARG_VAR(FAKEROOT_PATH, [fakeroot path]) |
674 |
AC_PATH_PROG(FAKEROOT_PATH, [fakeroot], []) |
675 |
if test -z "$FAKEROOT_PATH"; then |
676 |
AC_MSG_WARN(m4_normalize([fakeroot not found, tests that must run as root |
677 |
will not be executed])) |
678 |
fi |
679 |
AM_CONDITIONAL([HAS_FAKEROOT], [test "x$FAKEROOT_PATH" != x]) |
680 |
|
681 |
SOCAT_USE_ESCAPE= |
682 |
AC_ARG_ENABLE([socat-escape], |
683 |
[AS_HELP_STRING([--enable-socat-escape], |
684 |
[use escape functionality available in socat >= 1.7 (default: detect |
685 |
automatically)])], |
686 |
[[if test "$enableval" = yes; then |
687 |
SOCAT_USE_ESCAPE=True |
688 |
else |
689 |
SOCAT_USE_ESCAPE=False |
690 |
fi |
691 |
]]) |
692 |
|
693 |
if test -z "$SOCAT_USE_ESCAPE" |
694 |
then |
695 |
if $SOCAT -hh | grep -w -q escape; then |
696 |
SOCAT_USE_ESCAPE=True |
697 |
else |
698 |
SOCAT_USE_ESCAPE=False |
699 |
fi |
700 |
fi |
701 |
|
702 |
AC_SUBST(SOCAT_USE_ESCAPE) |
703 |
|
704 |
SOCAT_USE_COMPRESS= |
705 |
AC_ARG_ENABLE([socat-compress], |
706 |
[AS_HELP_STRING([--enable-socat-compress], |
707 |
[use OpenSSL compression option available in patched socat builds |
708 |
(see INSTALL for details; default: detect automatically)])], |
709 |
[[if test "$enableval" = yes; then |
710 |
SOCAT_USE_COMPRESS=True |
711 |
else |
712 |
SOCAT_USE_COMPRESS=False |
713 |
fi |
714 |
]]) |
715 |
|
716 |
if test -z "$SOCAT_USE_COMPRESS" |
717 |
then |
718 |
if $SOCAT -hhh | grep -w -q openssl-compress; then |
719 |
SOCAT_USE_COMPRESS=True |
720 |
else |
721 |
SOCAT_USE_COMPRESS=False |
722 |
fi |
723 |
fi |
724 |
|
725 |
AC_SUBST(SOCAT_USE_COMPRESS) |
726 |
|
727 |
if man --help | grep -q -e --warnings |
728 |
then |
729 |
MAN_HAS_WARNINGS=1 |
730 |
else |
731 |
MAN_HAS_WARNINGS= |
732 |
AC_MSG_WARN(m4_normalize([man does not support --warnings, man page checks |
733 |
will not be possible])) |
734 |
fi |
735 |
|
736 |
AC_SUBST(MAN_HAS_WARNINGS) |
737 |
|
738 |
# Check for Python |
739 |
AM_PATH_PYTHON(2.6) |
740 |
|
741 |
AC_PYTHON_MODULE(OpenSSL, t) |
742 |
AC_PYTHON_MODULE(simplejson, t) |
743 |
AC_PYTHON_MODULE(pyparsing, t) |
744 |
AC_PYTHON_MODULE(pyinotify, t) |
745 |
AC_PYTHON_MODULE(pycurl, t) |
746 |
AC_PYTHON_MODULE(bitarray, t) |
747 |
AC_PYTHON_MODULE(ipaddr, t) |
748 |
AC_PYTHON_MODULE(mock) |
749 |
AC_PYTHON_MODULE(affinity) |
750 |
AC_PYTHON_MODULE(paramiko) |
751 |
|
752 |
# Development-only Python modules |
753 |
PY_NODEV= |
754 |
AC_PYTHON_MODULE(yaml) |
755 |
if test $HAVE_PYMOD_YAML == "no"; then |
756 |
PY_NODEV="$PY_NODEV yaml" |
757 |
fi |
758 |
|
759 |
if test -n "$PY_NODEV"; then |
760 |
AC_MSG_WARN(m4_normalize([Required development modules ($PY_NODEV) were not |
761 |
found, you won't be able to run Python unittests])) |
762 |
else |
763 |
AC_MSG_NOTICE([Python development modules found, unittests enabled]) |
764 |
fi |
765 |
AC_SUBST(PY_NODEV) |
766 |
AM_CONDITIONAL([PY_UNIT], [test -n $PY_NODEV]) |
767 |
|
768 |
AC_CONFIG_FILES([ Makefile ]) |
769 |
|
770 |
AC_OUTPUT |