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