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