Ganeti version 1.2.4~rc0
[ganeti-local] / configure.ac
1 # Configure script for Ganeti
2 AC_PREREQ(2.59)
3 AC_INIT(ganeti, 1.2.4~rc0, ganeti@googlegroups.com)
4 AC_CONFIG_AUX_DIR(autotools)
5 AC_CONFIG_SRCDIR(configure)
6 AM_INIT_AUTOMAKE([foreign tar-ustar])
7
8 # --with-ssh-initscript=...
9 AC_ARG_WITH([ssh-initscript],
10   [AS_HELP_STRING([--with-ssh-initscript=SCRIPT],
11     [SSH init script to use (default is /etc/init.d/ssh)]
12   )],
13   [ssh_initd_script="$withval"],
14   [ssh_initd_script="/etc/init.d/ssh"])
15 AC_SUBST(SSH_INITD_SCRIPT, $ssh_initd_script)
16
17 # --with-export-dir=...
18 AC_ARG_WITH([export-dir],
19   [AS_HELP_STRING([--with-export-dir=DIR],
20     [directory to use by default for instance image]
21     [ exports (default is /srv/ganeti/export)]
22   )],
23   [export_dir="$withval"],
24   [export_dir="/srv/ganeti/export"])
25 AC_SUBST(EXPORT_DIR, $export_dir)
26
27 # --with-os-search-path=...
28 # do a bit of black sed magic to for quoting of the strings in the list
29 AC_ARG_WITH([os-search-path],
30   [AS_HELP_STRING([--with-os-search-path=LIST],
31     [comma separated list of directories to]
32     [ search for OS images (default is /srv/ganeti/os)]
33   )],
34   [os_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/'\1'/g"`],
35   [os_search_path="'/srv/ganeti/os'"])
36 AC_SUBST(OS_SEARCH_PATH, $os_search_path)
37
38 # --with-iallocator-search-path=...
39 # do a bit of black sed magic to for quoting of the strings in the list
40 AC_ARG_WITH([iallocator-search-path],
41   [AS_HELP_STRING([--with-iallocator-search-path=LIST],
42     [comma separated list of directories to]
43     [ search for instance allocators (default is $libdir/ganeti/iallocators)]
44   )],
45   [iallocator_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/'\1'/g"`],
46   [iallocator_search_path="'$libdir/$PACKAGE_NAME/iallocators'"])
47 AC_SUBST(IALLOCATOR_SEARCH_PATH, $iallocator_search_path)
48
49 # --with-xen-kernel=...
50 AC_ARG_WITH([xen-kernel],
51   [AS_HELP_STRING([--with-xen-kernel=PATH],
52     [DomU kernel image for Xen hypervisor (default is /boot/vmlinuz-2.6-xenU)]
53   )],
54   [xen_kernel="$withval"],
55   [xen_kernel="/boot/vmlinuz-2.6-xenU"])
56 AC_SUBST(XEN_KERNEL, $xen_kernel)
57
58 # --with-xen-initrd=...
59 AC_ARG_WITH([xen-initrd],
60   [AS_HELP_STRING([--with-xen-initrd=PATH],
61     [DomU initrd image for Xen hypervisor (default is /boot/initrd-2.6-xenU)]
62   )],
63   [xen_initrd="$withval"],
64   [xen_initrd="/boot/initrd-2.6-xenU"])
65 AC_SUBST(XEN_INITRD, $xen_initrd)
66
67 # --enable-rapi
68 AC_ARG_ENABLE([rapi],
69   [AS_HELP_STRING([--enable-rapi],
70     [Whether to enable remote API daemon]
71   )])
72 if test "$enable_rapi" = "yes"
73 then
74   enable_rapi_py=True
75 else
76   enable_rapi=no
77   enable_rapi_py=False
78 fi
79 AC_SUBST(PY_ENABLE_RAPI, $enable_rapi_py)
80
81
82 # Check common programs
83 AC_PROG_INSTALL
84 AC_PROG_LN_S
85
86 # Check for Python
87 AM_PATH_PYTHON(2.4)
88
89 AC_PYTHON_MODULE(twisted.internet, t)
90 AC_PYTHON_MODULE(twisted.cred, t)
91 AC_PYTHON_MODULE(twisted.spread, t)
92 AC_PYTHON_MODULE(OpenSSL, t)
93 AC_PYTHON_MODULE(simplejson, t)
94 AC_PYTHON_MODULE(pyparsing, t)
95
96 # Check for docbook2man
97 found_docbook2man=
98 AC_CHECK_PROG(found_docbook2man, [docbook2man], [yes])
99 if test "$found_docbook2man" != "yes"
100 then
101   AC_MSG_WARN([docbook2man not found.])
102 fi
103
104 AC_CONFIG_FILES([
105   Makefile
106   daemons/Makefile
107   devel/Makefile
108   doc/Makefile
109   doc/examples/Makefile
110   lib/Makefile
111   lib/rapi/Makefile
112   man/Makefile
113   qa/Makefile
114   qa/hooks/Makefile
115   scripts/Makefile
116   test/Makefile
117   tools/Makefile
118 ])
119
120 AC_OUTPUT