Statistics
| Branch: | Tag: | Revision:

root / configure.ac @ d14d93b0

History | View | Annotate | Download (24.4 kB)

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