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