Statistics
| Branch: | Tag: | Revision:

root / configure.ac @ 61899e64

History | View | Annotate | Download (21.1 kB)

1 a5d17f9f Michael Hanselmann
# Configure script for Ganeti
2 5e29d733 Michael Hanselmann
m4_define([gnt_version_major], [2])
3 aff49a15 Iustin Pop
m4_define([gnt_version_minor], [6])
4 27e15be0 Bernardo Dal Seno
m4_define([gnt_version_revision], [1])
5 d60d189a Iustin Pop
m4_define([gnt_version_suffix], [])
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 7c3d51d4 Guido Trotter
# --with-os-search-path=...
53 7c3d51d4 Guido Trotter
# do a bit of black sed magic to for quoting of the strings in the list
54 7c3d51d4 Guido Trotter
AC_ARG_WITH([os-search-path],
55 7c3d51d4 Guido Trotter
  [AS_HELP_STRING([--with-os-search-path=LIST],
56 f00b46bc Michael Hanselmann
    [comma separated list of directories to]
57 f00b46bc Michael Hanselmann
    [ search for OS images (default is /srv/ganeti/os)]
58 7c3d51d4 Guido Trotter
  )],
59 7c3d51d4 Guido Trotter
  [os_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/'\1'/g"`],
60 7c3d51d4 Guido Trotter
  [os_search_path="'/srv/ganeti/os'"])
61 7c3d51d4 Guido Trotter
AC_SUBST(OS_SEARCH_PATH, $os_search_path)
62 7c3d51d4 Guido Trotter
63 298fe380 Iustin Pop
# --with-iallocator-search-path=...
64 298fe380 Iustin Pop
# do a bit of black sed magic to for quoting of the strings in the list
65 298fe380 Iustin Pop
AC_ARG_WITH([iallocator-search-path],
66 298fe380 Iustin Pop
  [AS_HELP_STRING([--with-iallocator-search-path=LIST],
67 298fe380 Iustin Pop
    [comma separated list of directories to]
68 298fe380 Iustin Pop
    [ search for instance allocators (default is $libdir/ganeti/iallocators)]
69 298fe380 Iustin Pop
  )],
70 298fe380 Iustin Pop
  [iallocator_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/'\1'/g"`],
71 298fe380 Iustin Pop
  [iallocator_search_path="'$libdir/$PACKAGE_NAME/iallocators'"])
72 298fe380 Iustin Pop
AC_SUBST(IALLOCATOR_SEARCH_PATH, $iallocator_search_path)
73 298fe380 Iustin Pop
74 2f2dbb4b Jun Futagawa
# --with-xen-bootloader=...
75 2f2dbb4b Jun Futagawa
AC_ARG_WITH([xen-bootloader],
76 2f2dbb4b Jun Futagawa
  [AS_HELP_STRING([--with-xen-bootloader=PATH],
77 2f2dbb4b Jun Futagawa
    [bootloader for Xen hypervisor (default is empty)]
78 2f2dbb4b Jun Futagawa
  )],
79 2f2dbb4b Jun Futagawa
  [xen_bootloader="$withval"],
80 2f2dbb4b Jun Futagawa
  [xen_bootloader=])
81 2f2dbb4b Jun Futagawa
AC_SUBST(XEN_BOOTLOADER, $xen_bootloader)
82 2f2dbb4b Jun Futagawa
83 f00b46bc Michael Hanselmann
# --with-xen-kernel=...
84 f00b46bc Michael Hanselmann
AC_ARG_WITH([xen-kernel],
85 f00b46bc Michael Hanselmann
  [AS_HELP_STRING([--with-xen-kernel=PATH],
86 b8203e1e Iustin Pop
    [DomU kernel image for Xen hypervisor (default is /boot/vmlinuz-3-xenU)]
87 f00b46bc Michael Hanselmann
  )],
88 f00b46bc Michael Hanselmann
  [xen_kernel="$withval"],
89 b8203e1e Iustin Pop
  [xen_kernel="/boot/vmlinuz-3-xenU"])
90 f00b46bc Michael Hanselmann
AC_SUBST(XEN_KERNEL, $xen_kernel)
91 f00b46bc Michael Hanselmann
92 f00b46bc Michael Hanselmann
# --with-xen-initrd=...
93 f00b46bc Michael Hanselmann
AC_ARG_WITH([xen-initrd],
94 f00b46bc Michael Hanselmann
  [AS_HELP_STRING([--with-xen-initrd=PATH],
95 b8203e1e Iustin Pop
    [DomU initrd image for Xen hypervisor (default is /boot/initrd-3-xenU)]
96 f00b46bc Michael Hanselmann
  )],
97 f00b46bc Michael Hanselmann
  [xen_initrd="$withval"],
98 b8203e1e Iustin Pop
  [xen_initrd="/boot/initrd-3-xenU"])
99 f00b46bc Michael Hanselmann
AC_SUBST(XEN_INITRD, $xen_initrd)
100 f00b46bc Michael Hanselmann
101 1eb37421 René Nussbaumer
# --with-xen-cmd=...
102 1eb37421 René Nussbaumer
AC_ARG_WITH([xen-cmd],
103 1eb37421 René Nussbaumer
  [AS_HELP_STRING([--with-xen-cmd=CMD],
104 1eb37421 René Nussbaumer
    [Sets the xen cli interface command (default is xm)]
105 1eb37421 René Nussbaumer
  )],
106 1eb37421 René Nussbaumer
  [xen_cmd="$withval"],
107 1eb37421 René Nussbaumer
  [xen_cmd="xm"])
108 1eb37421 René Nussbaumer
AC_SUBST(XEN_CMD, $xen_cmd)
109 1eb37421 René Nussbaumer
110 4b5a9365 René Nussbaumer
if ! test "$XEN_CMD" = xl -o "$XEN_CMD" = xm; then
111 1eb37421 René Nussbaumer
  AC_MSG_ERROR([Unsupported xen command specified])
112 1eb37421 René Nussbaumer
fi
113 1eb37421 René Nussbaumer
114 b8203e1e Iustin Pop
# --with-kvm-kernel=...
115 b8203e1e Iustin Pop
AC_ARG_WITH([kvm-kernel],
116 b8203e1e Iustin Pop
  [AS_HELP_STRING([--with-kvm-kernel=PATH],
117 b8203e1e Iustin Pop
    [Guest kernel image for KVM hypervisor (default is /boot/vmlinuz-3-kvmU)]
118 b8203e1e Iustin Pop
  )],
119 b8203e1e Iustin Pop
  [kvm_kernel="$withval"],
120 b8203e1e Iustin Pop
  [kvm_kernel="/boot/vmlinuz-3-kvmU"])
121 b8203e1e Iustin Pop
AC_SUBST(KVM_KERNEL, $kvm_kernel)
122 b8203e1e Iustin Pop
123 22c734bc Manuel Franceschini
# --with-file-storage-dir=...
124 22c734bc Manuel Franceschini
AC_ARG_WITH([file-storage-dir],
125 22c734bc Manuel Franceschini
  [AS_HELP_STRING([--with-file-storage-dir=PATH],
126 22c734bc Manuel Franceschini
    [directory to store files for file-based backend]
127 22c734bc Manuel Franceschini
    [ (default is /srv/ganeti/file-storage)]
128 22c734bc Manuel Franceschini
  )],
129 cb7c0198 Iustin Pop
  [[file_storage_dir="$withval";
130 cb7c0198 Iustin Pop
    if test "$withval" != no; then
131 cb7c0198 Iustin Pop
      enable_file_storage=True
132 cb7c0198 Iustin Pop
    else
133 cb7c0198 Iustin Pop
      enable_file_storage=False
134 cb7c0198 Iustin Pop
    fi
135 cb7c0198 Iustin Pop
  ]],
136 30841576 Michael Hanselmann
  [[file_storage_dir="/srv/ganeti/file-storage";
137 30841576 Michael Hanselmann
    enable_file_storage="True"]])
138 22c734bc Manuel Franceschini
AC_SUBST(FILE_STORAGE_DIR, $file_storage_dir)
139 cb7c0198 Iustin Pop
AC_SUBST(ENABLE_FILE_STORAGE, $enable_file_storage)
140 22c734bc Manuel Franceschini
141 4b97f902 Apollon Oikonomopoulos
# --with-shared-file-storage-dir=...
142 4b97f902 Apollon Oikonomopoulos
AC_ARG_WITH([shared-file-storage-dir],
143 4b97f902 Apollon Oikonomopoulos
  [AS_HELP_STRING([--with-shared-file-storage-dir=PATH],
144 4b97f902 Apollon Oikonomopoulos
    [directory to store files for shared file-based backend]
145 4b97f902 Apollon Oikonomopoulos
    [ (default is /srv/ganeti/shared-file-storage)]
146 4b97f902 Apollon Oikonomopoulos
  )],
147 4b97f902 Apollon Oikonomopoulos
  [[shared_file_storage_dir="$withval";
148 4b97f902 Apollon Oikonomopoulos
    if test "$withval" != no; then
149 4b97f902 Apollon Oikonomopoulos
      enable_shared_file_storage=True
150 4b97f902 Apollon Oikonomopoulos
    else
151 4b97f902 Apollon Oikonomopoulos
      enable_shared_file_storage=False
152 4b97f902 Apollon Oikonomopoulos
    fi
153 4b97f902 Apollon Oikonomopoulos
  ]],
154 30841576 Michael Hanselmann
  [[shared_file_storage_dir="/srv/ganeti/shared-file-storage";
155 30841576 Michael Hanselmann
    enable_shared_file_storage="True"]])
156 4b97f902 Apollon Oikonomopoulos
AC_SUBST(SHARED_FILE_STORAGE_DIR, $shared_file_storage_dir)
157 4b97f902 Apollon Oikonomopoulos
AC_SUBST(ENABLE_SHARED_FILE_STORAGE, $enable_shared_file_storage)
158 4b97f902 Apollon Oikonomopoulos
159 7e2c5b9e Guido Trotter
# --with-kvm-path=...
160 7e2c5b9e Guido Trotter
AC_ARG_WITH([kvm-path],
161 7e2c5b9e Guido Trotter
  [AS_HELP_STRING([--with-kvm-path=PATH],
162 7e2c5b9e Guido Trotter
    [absolute path to the kvm binary]
163 7e2c5b9e Guido Trotter
    [ (default is /usr/bin/kvm)]
164 7e2c5b9e Guido Trotter
  )],
165 7e2c5b9e Guido Trotter
  [kvm_path="$withval"],
166 7e2c5b9e Guido Trotter
  [kvm_path="/usr/bin/kvm"])
167 7e2c5b9e Guido Trotter
AC_SUBST(KVM_PATH, $kvm_path)
168 7e2c5b9e Guido Trotter
169 89b70f39 Iustin Pop
# --with-lvm-stripecount=...
170 3736cb6b Iustin Pop
AC_ARG_WITH([lvm-stripecount],
171 3736cb6b Iustin Pop
  [AS_HELP_STRING([--with-lvm-stripecount=NUM],
172 43e11798 Andrea Spadaccini
    [the default number of stripes to use for LVM volumes]
173 7b3ac94d Iustin Pop
    [ (default is 1)]
174 3736cb6b Iustin Pop
  )],
175 3736cb6b Iustin Pop
  [lvm_stripecount="$withval"],
176 7b3ac94d Iustin Pop
  [lvm_stripecount="1"])
177 3736cb6b Iustin Pop
AC_SUBST(LVM_STRIPECOUNT, $lvm_stripecount)
178 3736cb6b Iustin Pop
179 052783ff Michael Hanselmann
# --with-ssh-login-user=...
180 052783ff Michael Hanselmann
AC_ARG_WITH([ssh-login-user],
181 052783ff Michael Hanselmann
  [AS_HELP_STRING([--with-ssh-login-user=USERNAME],
182 052783ff Michael Hanselmann
    [user to use for SSH logins within the cluster (default is root)]
183 052783ff Michael Hanselmann
  )],
184 052783ff Michael Hanselmann
  [ssh_login_user="$withval"],
185 052783ff Michael Hanselmann
  [ssh_login_user=root])
186 052783ff Michael Hanselmann
AC_SUBST(SSH_LOGIN_USER, $ssh_login_user)
187 052783ff Michael Hanselmann
188 052783ff Michael Hanselmann
# --with-ssh-console-user=...
189 052783ff Michael Hanselmann
AC_ARG_WITH([ssh-console-user],
190 052783ff Michael Hanselmann
  [AS_HELP_STRING([--with-ssh-console-user=USERNAME],
191 052783ff Michael Hanselmann
    [user to use for SSH logins to access instance consoles (default is root)]
192 052783ff Michael Hanselmann
  )],
193 052783ff Michael Hanselmann
  [ssh_console_user="$withval"],
194 052783ff Michael Hanselmann
  [ssh_console_user=root])
195 052783ff Michael Hanselmann
AC_SUBST(SSH_CONSOLE_USER, $ssh_console_user)
196 052783ff Michael Hanselmann
197 a6798ce1 Michael Hanselmann
# --with-default-user=...
198 a6798ce1 Michael Hanselmann
AC_ARG_WITH([default-user],
199 a6798ce1 Michael Hanselmann
  [AS_HELP_STRING([--with-default-user=USERNAME],
200 a6798ce1 Michael Hanselmann
    [default user for daemons]
201 a6798ce1 Michael Hanselmann
    [ (default is to run all daemons as root)]
202 a6798ce1 Michael Hanselmann
  )],
203 a6798ce1 Michael Hanselmann
  [user_default="$withval"],
204 a6798ce1 Michael Hanselmann
  [user_default=root])
205 a6798ce1 Michael Hanselmann
206 a6798ce1 Michael Hanselmann
# --with-default-group=...
207 a6798ce1 Michael Hanselmann
AC_ARG_WITH([default-group],
208 a6798ce1 Michael Hanselmann
  [AS_HELP_STRING([--with-default-group=GROUPNAME],
209 a6798ce1 Michael Hanselmann
    [default group for daemons]
210 a6798ce1 Michael Hanselmann
    [ (default is to run all daemons under group root)]
211 a6798ce1 Michael Hanselmann
  )],
212 a6798ce1 Michael Hanselmann
  [group_default="$withval"],
213 a6798ce1 Michael Hanselmann
  [group_default=root])
214 a6798ce1 Michael Hanselmann
215 0d150c50 René Nussbaumer
# --with-user-prefix=...
216 0d150c50 René Nussbaumer
AC_ARG_WITH([user-prefix],
217 0d150c50 René Nussbaumer
  [AS_HELP_STRING([--with-user-prefix=PREFIX],
218 0d150c50 René Nussbaumer
    [prefix for daemon users]
219 a6798ce1 Michael Hanselmann
    [ (default is to run all daemons as root; use --with-default-user]
220 a6798ce1 Michael Hanselmann
    [ to change the default)]
221 0d150c50 René Nussbaumer
  )],
222 3794937c René Nussbaumer
  [user_masterd="${withval}masterd";
223 0d150c50 René Nussbaumer
   user_rapi="${withval}rapi";
224 3794937c René Nussbaumer
   user_confd="${withval}confd";
225 a6798ce1 Michael Hanselmann
   user_noded="$user_default"],
226 a6798ce1 Michael Hanselmann
  [user_masterd="$user_default";
227 a6798ce1 Michael Hanselmann
   user_rapi="$user_default";
228 a6798ce1 Michael Hanselmann
   user_confd="$user_default";
229 a6798ce1 Michael Hanselmann
   user_noded="$user_default"])
230 0d150c50 René Nussbaumer
AC_SUBST(MASTERD_USER, $user_masterd)
231 0d150c50 René Nussbaumer
AC_SUBST(RAPI_USER, $user_rapi)
232 0d150c50 René Nussbaumer
AC_SUBST(CONFD_USER, $user_confd)
233 0d150c50 René Nussbaumer
AC_SUBST(NODED_USER, $user_noded)
234 0d150c50 René Nussbaumer
235 0d150c50 René Nussbaumer
# --with-group-prefix=...
236 0d150c50 René Nussbaumer
AC_ARG_WITH([group-prefix],
237 0d150c50 René Nussbaumer
  [AS_HELP_STRING([--with-group-prefix=PREFIX],
238 0d150c50 René Nussbaumer
    [prefix for daemon POSIX groups]
239 a6798ce1 Michael Hanselmann
    [ (default is to run all daemons under group root; use]
240 a6798ce1 Michael Hanselmann
    [ --with-default-group to change the default)]
241 0d150c50 René Nussbaumer
  )],
242 3794937c René Nussbaumer
  [group_rapi="${withval}rapi";
243 3794937c René Nussbaumer
   group_admin="${withval}admin";
244 3794937c René Nussbaumer
   group_confd="${withval}confd";
245 3794937c René Nussbaumer
   group_masterd="${withval}masterd";
246 a6798ce1 Michael Hanselmann
   group_noded="$group_default";
247 0d150c50 René Nussbaumer
   group_daemons="${withval}daemons";],
248 a6798ce1 Michael Hanselmann
  [group_rapi="$group_default";
249 a6798ce1 Michael Hanselmann
   group_admin="$group_default";
250 a6798ce1 Michael Hanselmann
   group_confd="$group_default";
251 a6798ce1 Michael Hanselmann
   group_masterd="$group_default";
252 a6798ce1 Michael Hanselmann
   group_noded="$group_default";
253 a6798ce1 Michael Hanselmann
   group_daemons="$group_default"])
254 0d150c50 René Nussbaumer
AC_SUBST(RAPI_GROUP, $group_rapi)
255 0d150c50 René Nussbaumer
AC_SUBST(ADMIN_GROUP, $group_admin)
256 0d150c50 René Nussbaumer
AC_SUBST(CONFD_GROUP, $group_confd)
257 0d150c50 René Nussbaumer
AC_SUBST(MASTERD_GROUP, $group_masterd)
258 03881cb0 René Nussbaumer
AC_SUBST(NODED_GROUP, $group_noded)
259 0d150c50 René Nussbaumer
AC_SUBST(DAEMONS_GROUP, $group_daemons)
260 0d150c50 René Nussbaumer
261 0d150c50 René Nussbaumer
# Print the config to the user
262 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Running ganeti-masterd as $group_masterd:$group_masterd])
263 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Running ganeti-rapi as $user_rapi:$group_rapi])
264 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Running ganeti-confd as $user_confd:$group_confd])
265 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Group for daemons is $group_daemons])
266 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Group for clients is $group_admin])
267 0d150c50 René Nussbaumer
268 89b70f39 Iustin Pop
# --enable-drbd-barriers
269 89b70f39 Iustin Pop
AC_ARG_ENABLE([drbd-barriers],
270 89b70f39 Iustin Pop
  [AS_HELP_STRING([--enable-drbd-barriers],
271 8a69b3a8 Andrea Spadaccini
    [enable by default the DRBD barriers functionality (>= 8.0.12) (default: enabled)])],
272 89b70f39 Iustin Pop
  [[if test "$enableval" != no; then
273 8a69b3a8 Andrea Spadaccini
      DRBD_BARRIERS=n
274 8a69b3a8 Andrea Spadaccini
      DRBD_NO_META_FLUSH=False
275 89b70f39 Iustin Pop
    else
276 15618b63 Michael Hanselmann
      DRBD_BARRIERS=bf
277 8a69b3a8 Andrea Spadaccini
      DRBD_NO_META_FLUSH=True
278 89b70f39 Iustin Pop
    fi
279 89b70f39 Iustin Pop
  ]],
280 8a69b3a8 Andrea Spadaccini
  [DRBD_BARRIERS=n
281 8a69b3a8 Andrea Spadaccini
   DRBD_NO_META_FLUSH=False
282 8a69b3a8 Andrea Spadaccini
  ])
283 89b70f39 Iustin Pop
AC_SUBST(DRBD_BARRIERS, $DRBD_BARRIERS)
284 8a69b3a8 Andrea Spadaccini
AC_SUBST(DRBD_NO_META_FLUSH, $DRBD_NO_META_FLUSH)
285 89b70f39 Iustin Pop
286 551b6283 Iustin Pop
# --enable-syslog[=no/yes/only]
287 551b6283 Iustin Pop
AC_ARG_ENABLE([syslog],
288 551b6283 Iustin Pop
  [AS_HELP_STRING([--enable-syslog],
289 551b6283 Iustin Pop
    [enable use of syslog (default: disabled), one of no/yes/only])],
290 551b6283 Iustin Pop
  [[case "$enableval" in
291 551b6283 Iustin Pop
      no)
292 551b6283 Iustin Pop
        SYSLOG=no
293 551b6283 Iustin Pop
        ;;
294 551b6283 Iustin Pop
      yes)
295 551b6283 Iustin Pop
        SYSLOG=yes
296 551b6283 Iustin Pop
        ;;
297 551b6283 Iustin Pop
      only)
298 551b6283 Iustin Pop
        SYSLOG=only
299 551b6283 Iustin Pop
        ;;
300 551b6283 Iustin Pop
      *)
301 551b6283 Iustin Pop
        SYSLOG=
302 551b6283 Iustin Pop
        ;;
303 551b6283 Iustin Pop
    esac
304 551b6283 Iustin Pop
  ]],
305 551b6283 Iustin Pop
  [SYSLOG=no])
306 551b6283 Iustin Pop
307 551b6283 Iustin Pop
if test -z "$SYSLOG"
308 551b6283 Iustin Pop
then
309 551b6283 Iustin Pop
  AC_MSG_ERROR([invalid value for syslog, choose one of no/yes/only])
310 551b6283 Iustin Pop
fi
311 551b6283 Iustin Pop
AC_SUBST(SYSLOG_USAGE, $SYSLOG)
312 551b6283 Iustin Pop
313 3536c792 Iustin Pop
# --with-disk-separator=...
314 3536c792 Iustin Pop
AC_ARG_WITH([disk-separator],
315 3536c792 Iustin Pop
  [AS_HELP_STRING([--with-disk-separator=STRING],
316 30841576 Michael Hanselmann
    [Disk index separator, useful if the default of ':' is handled]
317 30841576 Michael Hanselmann
    [ specially by the hypervisor]
318 3536c792 Iustin Pop
  )],
319 3536c792 Iustin Pop
  [disk_separator="$withval"],
320 3536c792 Iustin Pop
  [disk_separator=":"])
321 3536c792 Iustin Pop
AC_SUBST(DISK_SEPARATOR, $disk_separator)
322 3536c792 Iustin Pop
323 a5d17f9f Michael Hanselmann
# Check common programs
324 a8083063 Iustin Pop
AC_PROG_INSTALL
325 9ff7e35c Michael Hanselmann
AC_PROG_LN_S
326 a8083063 Iustin Pop
327 c4dfb0b6 Andrea Spadaccini
# Check for the ip command
328 c4dfb0b6 Andrea Spadaccini
AC_ARG_VAR(IP_PATH, [ip path])
329 c4dfb0b6 Andrea Spadaccini
AC_PATH_PROG(IP_PATH, [ip], [])
330 c4dfb0b6 Andrea Spadaccini
if test -z "$IP_PATH"
331 c4dfb0b6 Andrea Spadaccini
then
332 c4dfb0b6 Andrea Spadaccini
  AC_MSG_ERROR([ip command not found])
333 c4dfb0b6 Andrea Spadaccini
fi
334 c4dfb0b6 Andrea Spadaccini
335 18e2b6e4 Iustin Pop
# Check for pandoc
336 5208e732 Iustin Pop
AC_ARG_VAR(PANDOC, [pandoc path])
337 5208e732 Iustin Pop
AC_PATH_PROG(PANDOC, [pandoc], [])
338 5208e732 Iustin Pop
if test -z "$PANDOC"
339 5208e732 Iustin Pop
then
340 5208e732 Iustin Pop
  AC_MSG_WARN([pandoc not found, man pages rebuild will not be possible])
341 5208e732 Iustin Pop
fi
342 5208e732 Iustin Pop
343 d17e74b4 Iustin Pop
# Check for python-sphinx
344 d17e74b4 Iustin Pop
AC_ARG_VAR(SPHINX, [sphinx-build path])
345 d17e74b4 Iustin Pop
AC_PATH_PROG(SPHINX, [sphinx-build], [])
346 d17e74b4 Iustin Pop
if test -z "$SPHINX"
347 f05c99f3 Michael Hanselmann
then
348 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([sphinx-build not found, documentation rebuild will
349 30841576 Michael Hanselmann
                            not be possible]))
350 f05c99f3 Michael Hanselmann
fi
351 f05c99f3 Michael Hanselmann
352 f86e82ef Iustin Pop
# Check for graphviz (dot)
353 f86e82ef Iustin Pop
AC_ARG_VAR(DOT, [dot path])
354 f86e82ef Iustin Pop
AC_PATH_PROG(DOT, [dot], [])
355 f86e82ef Iustin Pop
if test -z "$DOT"
356 f86e82ef Iustin Pop
then
357 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([dot (from the graphviz suite) not found,
358 30841576 Michael Hanselmann
                            documentation rebuild not possible]))
359 f86e82ef Iustin Pop
fi
360 f86e82ef Iustin Pop
361 6d7cc5ff Michael Hanselmann
# Check for pylint
362 6d7cc5ff Michael Hanselmann
AC_ARG_VAR(PYLINT, [pylint path])
363 6d7cc5ff Michael Hanselmann
AC_PATH_PROG(PYLINT, [pylint], [])
364 6d7cc5ff Michael Hanselmann
if test -z "$PYLINT"
365 6d7cc5ff Michael Hanselmann
then
366 6d7cc5ff Michael Hanselmann
  AC_MSG_WARN([pylint not found, checking code will not be possible])
367 6d7cc5ff Michael Hanselmann
fi
368 6d7cc5ff Michael Hanselmann
369 08366664 Michael Hanselmann
# Check for pep8
370 08366664 Michael Hanselmann
AC_ARG_VAR(PEP8, [pep8 path])
371 08366664 Michael Hanselmann
AC_PATH_PROG(PEP8, [pep8], [])
372 08366664 Michael Hanselmann
if test -z "$PEP8"
373 08366664 Michael Hanselmann
then
374 08366664 Michael Hanselmann
  AC_MSG_WARN([pep8 not found, checking code will not be complete])
375 08366664 Michael Hanselmann
fi
376 141c8421 Michael Hanselmann
AM_CONDITIONAL([HAS_PEP8], [test -n "$PEP8"])
377 141c8421 Michael Hanselmann
378 141c8421 Michael Hanselmann
# Check for python-coverage
379 141c8421 Michael Hanselmann
AC_ARG_VAR(PYCOVERAGE, [python-coverage path])
380 141c8421 Michael Hanselmann
AC_PATH_PROGS(PYCOVERAGE, [python-coverage coverage], [])
381 141c8421 Michael Hanselmann
if test -z "$PYCOVERAGE"
382 141c8421 Michael Hanselmann
then
383 141c8421 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([python-coverage or coverage not found, evaluating
384 141c8421 Michael Hanselmann
                            Python test coverage will not be possible]))
385 141c8421 Michael Hanselmann
fi
386 08366664 Michael Hanselmann
387 fe5b0c42 Michael Hanselmann
# Check for socat
388 fe5b0c42 Michael Hanselmann
AC_ARG_VAR(SOCAT, [socat path])
389 fe5b0c42 Michael Hanselmann
AC_PATH_PROG(SOCAT, [socat], [])
390 87c1d0c7 Guido Trotter
if test -z "$SOCAT"
391 87c1d0c7 Guido Trotter
then
392 fe5b0c42 Michael Hanselmann
  AC_MSG_ERROR([socat not found])
393 87c1d0c7 Guido Trotter
fi
394 87c1d0c7 Guido Trotter
395 a002ed79 Agata Murawska
# Check for qemu-img
396 a002ed79 Agata Murawska
AC_ARG_VAR(QEMUIMG_PATH, [qemu-img path])
397 a002ed79 Agata Murawska
AC_PATH_PROG(QEMUIMG_PATH, [qemu-img], [])
398 a002ed79 Agata Murawska
if test -z "$QEMUIMG_PATH"
399 a002ed79 Agata Murawska
then
400 a002ed79 Agata Murawska
  AC_MSG_WARN([qemu-img not found, using ovfconverter will not be possible])
401 a002ed79 Agata Murawska
fi
402 a002ed79 Agata Murawska
403 21a5e56c Iustin Pop
# --enable-htools-rapi
404 21a5e56c Iustin Pop
HTOOLS_RAPI=
405 21a5e56c Iustin Pop
AC_ARG_ENABLE([htools-rapi],
406 21a5e56c Iustin Pop
        [AS_HELP_STRING([--enable-htools-rapi],
407 21a5e56c Iustin Pop
        [enable use of curl in the Haskell code (default: check)])],
408 21a5e56c Iustin Pop
        [],
409 21a5e56c Iustin Pop
        [enable_htools_rapi=check])
410 21a5e56c Iustin Pop
411 21a5e56c Iustin Pop
# --enable-confd
412 21a5e56c Iustin Pop
ENABLE_CONFD=
413 21a5e56c Iustin Pop
AC_ARG_ENABLE([confd],
414 21a5e56c Iustin Pop
  [AS_HELP_STRING([--enable-confd],
415 21a5e56c Iustin Pop
  [enable the ganeti-confd daemon (default: check)])],
416 21a5e56c Iustin Pop
  [],
417 21a5e56c Iustin Pop
  [enable_confd=check])
418 acf70442 Iustin Pop
419 35c6e63d Michele Tartara
ENABLE_MONITORING=
420 35c6e63d Michele Tartara
AC_ARG_ENABLE([monitoring],
421 35c6e63d Michele Tartara
  [AS_HELP_STRING([--enable-monitoring],
422 35c6e63d Michele Tartara
  [enable the ganeti monitoring agent (default: check)])],
423 35c6e63d Michele Tartara
  [],
424 35c6e63d Michele Tartara
  [enable_monitoring=check])
425 35c6e63d Michele Tartara
426 e5bd9de5 Iustin Pop
# Check for ghc
427 e5bd9de5 Iustin Pop
AC_ARG_VAR(GHC, [ghc path])
428 e5bd9de5 Iustin Pop
AC_PATH_PROG(GHC, [ghc], [])
429 e5bd9de5 Iustin Pop
if test -z "$GHC"; then
430 21a5e56c Iustin Pop
  AC_MSG_FAILURE([ghc not found, compilation will not possible])
431 e5bd9de5 Iustin Pop
fi
432 e5bd9de5 Iustin Pop
433 39f0eea5 Iustin Pop
AC_MSG_CHECKING([checking for extra GHC flags])
434 39f0eea5 Iustin Pop
GHC_BYVERSION_FLAGS=""
435 39f0eea5 Iustin Pop
# check for GHC supported flags that vary accross versions
436 39f0eea5 Iustin Pop
for flag in -fwarn-incomplete-uni-patterns; do
437 39f0eea5 Iustin Pop
  if $GHC -e "0" $flag >/dev/null 2>/dev/null; then
438 39f0eea5 Iustin Pop
   GHC_BYVERSION_FLAGS="$GHC_BYVERSION_FLAGS $flag"
439 39f0eea5 Iustin Pop
  fi
440 39f0eea5 Iustin Pop
done
441 39f0eea5 Iustin Pop
AC_MSG_RESULT($GHC_BYVERSION_FLAGS)
442 39f0eea5 Iustin Pop
AC_SUBST(GHC_BYVERSION_FLAGS)
443 39f0eea5 Iustin Pop
444 e5bd9de5 Iustin Pop
# Check for ghc-pkg
445 e5bd9de5 Iustin Pop
AC_ARG_VAR(GHC_PKG, [ghc-pkg path])
446 e5bd9de5 Iustin Pop
AC_PATH_PROG(GHC_PKG, [ghc-pkg], [])
447 e5bd9de5 Iustin Pop
if test -z "$GHC_PKG"; then
448 21a5e56c Iustin Pop
  AC_MSG_FAILURE([ghc-pkg not found, compilation will not be possible])
449 21a5e56c Iustin Pop
fi
450 21a5e56c Iustin Pop
451 21a5e56c Iustin Pop
# check for modules, first custom/special checks
452 21a5e56c Iustin Pop
AC_MSG_NOTICE([checking for required haskell modules])
453 21a5e56c Iustin Pop
HTOOLS_NOCURL=-DNO_CURL
454 21a5e56c Iustin Pop
if test "$enable_htools_rapi" != "no"; then
455 21a5e56c Iustin Pop
  AC_GHC_PKG_CHECK([curl], [HTOOLS_NOCURL=], [])
456 21a5e56c Iustin Pop
  if test -n "$HTOOLS_NOCURL"; then
457 21a5e56c Iustin Pop
    if test "$enable_htools_rapi" = "check"; then
458 21a5e56c Iustin Pop
      AC_MSG_WARN(m4_normalize([The curl library was not found, Haskell
459 21a5e56c Iustin Pop
                                code will be compiled without RAPI support]))
460 50ed57c1 Iustin Pop
    else
461 21a5e56c Iustin Pop
      AC_MSG_FAILURE(m4_normalize([The curl library was not found, but it has
462 21a5e56c Iustin Pop
                                   been requested]))
463 50ed57c1 Iustin Pop
    fi
464 1adec4be Iustin Pop
  else
465 21a5e56c Iustin Pop
    AC_MSG_NOTICE([Enabling curl/RAPI/RPC usage in Haskell code])
466 fd0bc853 Iustin Pop
  fi
467 e5bd9de5 Iustin Pop
fi
468 21a5e56c Iustin Pop
AC_SUBST(HTOOLS_NOCURL)
469 21a5e56c Iustin Pop
470 21a5e56c Iustin Pop
HTOOLS_PARALLEL3=
471 21a5e56c Iustin Pop
AC_GHC_PKG_CHECK([parallel-3.*], [HTOOLS_PARALLEL3=-DPARALLEL3],
472 21a5e56c Iustin Pop
                 [AC_GHC_PKG_REQUIRE(parallel)], t)
473 21a5e56c Iustin Pop
AC_SUBST(HTOOLS_PARALLEL3)
474 21a5e56c Iustin Pop
475 21a5e56c Iustin Pop
# and now standard modules
476 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(json)
477 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(network)
478 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(mtl)
479 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(bytestring)
480 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(utf8-string)
481 21a5e56c Iustin Pop
482 21a5e56c Iustin Pop
# extra modules for confd functionality
483 21a5e56c Iustin Pop
HTOOLS_REGEX_PCRE=-DNO_REGEX_PCRE
484 21a5e56c Iustin Pop
has_confd=False
485 21a5e56c Iustin Pop
if test "$enable_confd" != "no"; then
486 21a5e56c Iustin Pop
  CONFD_PKG=
487 21a5e56c Iustin Pop
  AC_GHC_PKG_CHECK([regex-pcre], [HTOOLS_REGEX_PCRE=],
488 21a5e56c Iustin Pop
                   [CONFD_PKG="$CONFD_PKG regex-pcre"])
489 21a5e56c Iustin Pop
  AC_GHC_PKG_CHECK([hslogger], [], [CONFD_PKG="$CONFD_PKG hslogger"])
490 21a5e56c Iustin Pop
  AC_GHC_PKG_CHECK([Crypto], [], [CONFD_PKG="$CONFD_PKG Crypto"])
491 21a5e56c Iustin Pop
  AC_GHC_PKG_CHECK([text], [], [CONFD_PKG="$CONFD_PKG text"])
492 21a5e56c Iustin Pop
  AC_GHC_PKG_CHECK([hinotify], [], [CONFD_PKG="$CONFD_PKG hinotify"])
493 21a5e56c Iustin Pop
  if test -z "$CONFD_PKG"; then
494 21a5e56c Iustin Pop
    has_confd=True
495 e5bd9de5 Iustin Pop
  else
496 21a5e56c Iustin Pop
    if test "$enable_confd" = "check"; then
497 21a5e56c Iustin Pop
      AC_MSG_WARN(m4_normalize([The required extra libraries for confd were
498 21a5e56c Iustin Pop
                                not found ($CONFD_PKG), confd disabled]))
499 21a5e56c Iustin Pop
    else
500 21a5e56c Iustin Pop
      AC_MSG_FAILURE(m4_normalize([The confd functionality was requested, but
501 21a5e56c Iustin Pop
                                   required libraries were not found:
502 21a5e56c Iustin Pop
                                   $CONFD_PKG]))
503 21a5e56c Iustin Pop
    fi
504 e5bd9de5 Iustin Pop
  fi
505 e5bd9de5 Iustin Pop
fi
506 21a5e56c Iustin Pop
AC_SUBST(HTOOLS_REGEX_PCRE)
507 21a5e56c Iustin Pop
if test "$has_confd" = "True"; then
508 21a5e56c Iustin Pop
  AC_MSG_NOTICE([Enabling confd usage])
509 21a5e56c Iustin Pop
fi
510 21a5e56c Iustin Pop
AC_SUBST(ENABLE_CONFD, $has_confd)
511 21a5e56c Iustin Pop
AM_CONDITIONAL([ENABLE_CONFD], [test x$has_confd = xTrue])
512 21a5e56c Iustin Pop
513 35c6e63d Michele Tartara
#extra modules for monitoring agent functionality
514 35c6e63d Michele Tartara
has_monitoring=False
515 35c6e63d Michele Tartara
if test "$enable_monitoring" != "no"; then
516 35c6e63d Michele Tartara
  MONITORING_PKG=
517 35c6e63d Michele Tartara
  AC_GHC_PKG_CHECK([attoparsec], [], [MONITORING_PKG="$MONITORING_PKG attoparsec"])
518 35c6e63d Michele Tartara
  if test -z "$MONITORING_PKG"; then
519 35c6e63d Michele Tartara
    has_monitoring=True
520 35c6e63d Michele Tartara
  else
521 35c6e63d Michele Tartara
    if test "$enable_monitoring" = "check"; then
522 35c6e63d Michele Tartara
      AC_MSG_WARN(m4_normalize([The required extra libraries for the monitoring
523 35c6e63d Michele Tartara
                                agent were not found ($MONITORING_PKG),
524 35c6e63d Michele Tartara
                                monitoring disabled]))
525 35c6e63d Michele Tartara
    else
526 35c6e63d Michele Tartara
      AC_MSG_FAILURE(m4_normalize([The monitoring functionality was requested, but
527 35c6e63d Michele Tartara
                                   required libraries were not found:
528 35c6e63d Michele Tartara
                                   $MONITORING_PKG]))
529 35c6e63d Michele Tartara
    fi
530 35c6e63d Michele Tartara
  fi
531 35c6e63d Michele Tartara
fi
532 35c6e63d Michele Tartara
if test "$has_monitoring" = "True"; then
533 35c6e63d Michele Tartara
  AC_MSG_NOTICE([Enabling the monitoring agent usage])
534 35c6e63d Michele Tartara
fi
535 35c6e63d Michele Tartara
AC_SUBST(ENABLE_MONITORING, $has_monitoring)
536 35c6e63d Michele Tartara
AM_CONDITIONAL([ENABLE_MONITORING], [test x$has_monitoring = xTrue])
537 35c6e63d Michele Tartara
538 21a5e56c Iustin Pop
# development modules
539 21a5e56c Iustin Pop
HTOOLS_NODEV=
540 21a5e56c Iustin Pop
AC_GHC_PKG_CHECK([QuickCheck-2.*], [], [HTOOLS_NODEV=1], t)
541 21a5e56c Iustin Pop
AC_GHC_PKG_CHECK([test-framework-0.6*], [], [HTOOLS_NODEV=1], t)
542 21a5e56c Iustin Pop
AC_GHC_PKG_CHECK([test-framework-hunit], [], [HTOOLS_NODEV=1])
543 21a5e56c Iustin Pop
AC_GHC_PKG_CHECK([test-framework-quickcheck2], [], [HTOOLS_NODEV=1])
544 35c6e63d Michele Tartara
# FIXME: unify checks for non-test libraries (attoparsec, hinotify, ...)
545 35c6e63d Michele Tartara
#        that are needed to execute the tests, avoiding the duplication
546 35c6e63d Michele Tartara
#        of the checks.
547 35c6e63d Michele Tartara
AC_GHC_PKG_CHECK([attoparsec], [], [HTOOLS_NODEV=1])
548 21a5e56c Iustin Pop
if test -n "$HTOOLS_NODEV"; then
549 21a5e56c Iustin Pop
   AC_MSG_WARN(m4_normalize([Required development modules were not found,
550 21a5e56c Iustin Pop
                             you won't be able to run Haskell unittests]))
551 21a5e56c Iustin Pop
else
552 21a5e56c Iustin Pop
   AC_MSG_NOTICE([Haskell development modules found, unittests enabled])
553 21a5e56c Iustin Pop
fi
554 21a5e56c Iustin Pop
AC_SUBST(HTOOLS_NODEV)
555 21a5e56c Iustin Pop
556 21a5e56c Iustin Pop
HTOOLS=yes
557 e5bd9de5 Iustin Pop
AC_SUBST(HTOOLS)
558 e5bd9de5 Iustin Pop
559 55837756 Iustin Pop
# --enable-split-query
560 55837756 Iustin Pop
ENABLE_SPLIT_QUERY=
561 55837756 Iustin Pop
AC_ARG_ENABLE([split-query],
562 55837756 Iustin Pop
  [AS_HELP_STRING([--enable-split-query],
563 55837756 Iustin Pop
  [enable use of custom query daemon via confd])],
564 55837756 Iustin Pop
  [[case "$enableval" in
565 55837756 Iustin Pop
      no)
566 55837756 Iustin Pop
        enable_split_query=False
567 55837756 Iustin Pop
        ;;
568 55837756 Iustin Pop
      yes)
569 55837756 Iustin Pop
        enable_split_query=True
570 55837756 Iustin Pop
        ;;
571 55837756 Iustin Pop
      *)
572 55837756 Iustin Pop
        echo "Invalid value for enable-confd '$enableval'"
573 55837756 Iustin Pop
        exit 1
574 55837756 Iustin Pop
        ;;
575 55837756 Iustin Pop
    esac
576 55837756 Iustin Pop
  ]],
577 21a5e56c Iustin Pop
  [[case "x${has_confd}x${HTOOLS_NOCURL}x" in
578 55837756 Iustin Pop
     xTruexx)
579 55837756 Iustin Pop
       enable_split_query=True
580 55837756 Iustin Pop
       ;;
581 55837756 Iustin Pop
     *)
582 55837756 Iustin Pop
       enable_split_query=False
583 55837756 Iustin Pop
       ;;
584 55837756 Iustin Pop
   esac]])
585 55837756 Iustin Pop
AC_SUBST(ENABLE_SPLIT_QUERY, $enable_split_query)
586 55837756 Iustin Pop
587 21a5e56c Iustin Pop
if test x$enable_split_query = xTrue -a x$has_confd != xTrue; then
588 55837756 Iustin Pop
  AC_MSG_ERROR([Split queries require the confd daemon])
589 55837756 Iustin Pop
fi
590 55837756 Iustin Pop
591 55837756 Iustin Pop
if test x$enable_split_query = xTrue -a x$HTOOLS_NOCURL != x; then
592 55837756 Iustin Pop
  AC_MSG_ERROR([Split queries require the htools-rapi feature (curl library)])
593 55837756 Iustin Pop
fi
594 55837756 Iustin Pop
595 55837756 Iustin Pop
if test x$enable_split_query = xTrue; then
596 55837756 Iustin Pop
  AC_MSG_NOTICE([Split query functionality enabled])
597 55837756 Iustin Pop
fi
598 55837756 Iustin Pop
599 e5bd9de5 Iustin Pop
# Check for HsColour
600 e5bd9de5 Iustin Pop
HTOOLS_APIDOC=no
601 e5bd9de5 Iustin Pop
AC_ARG_VAR(HSCOLOUR, [HsColour path])
602 e5bd9de5 Iustin Pop
AC_PATH_PROG(HSCOLOUR, [HsColour], [])
603 e5bd9de5 Iustin Pop
if test -z "$HSCOLOUR"; then
604 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([HsColour not found, htools API documentation will
605 30841576 Michael Hanselmann
                            not be generated]))
606 e5bd9de5 Iustin Pop
fi
607 e5bd9de5 Iustin Pop
608 e5bd9de5 Iustin Pop
# Check for haddock
609 e5bd9de5 Iustin Pop
AC_ARG_VAR(HADDOCK, [haddock path])
610 e5bd9de5 Iustin Pop
AC_PATH_PROG(HADDOCK, [haddock], [])
611 e5bd9de5 Iustin Pop
if test -z "$HADDOCK"; then
612 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([haddock not found, htools API documentation will
613 30841576 Michael Hanselmann
                            not be generated]))
614 e5bd9de5 Iustin Pop
fi
615 e5bd9de5 Iustin Pop
if test "$HADDOCK" && test "$HSCOLOUR"; then
616 e5bd9de5 Iustin Pop
  HTOOLS_APIDOC=yes
617 e5bd9de5 Iustin Pop
fi
618 e5bd9de5 Iustin Pop
AC_SUBST(HTOOLS_APIDOC)
619 e5bd9de5 Iustin Pop
620 6e4c8f68 Iustin Pop
# Check for hlint
621 6e4c8f68 Iustin Pop
HLINT=no
622 6e4c8f68 Iustin Pop
AC_ARG_VAR(HLINT, [hlint path])
623 6e4c8f68 Iustin Pop
AC_PATH_PROG(HLINT, [hlint], [])
624 6e4c8f68 Iustin Pop
if test -z "$HLINT"; then
625 6e4c8f68 Iustin Pop
  AC_MSG_WARN([hlint not found, checking code will not be possible])
626 6e4c8f68 Iustin Pop
fi
627 6e4c8f68 Iustin Pop
628 04520998 Iustin Pop
if test "$HTOOLS" != "yes" && test "$ENABLE_CONFD" = "True"; then
629 04520998 Iustin Pop
   AC_MSG_ERROR(m4_normalize([cannot enable ganeti-confd if
630 73b0fa69 Iustin Pop
                              htools support is not enabled]))
631 73b0fa69 Iustin Pop
fi
632 73b0fa69 Iustin Pop
633 e5bd9de5 Iustin Pop
AM_CONDITIONAL([WANT_HTOOLS], [test x$HTOOLS = xyes])
634 f9a51a21 Iustin Pop
AM_CONDITIONAL([WANT_HTOOLSTESTS], [test "x$HTOOLS_NODEV" = x])
635 e5bd9de5 Iustin Pop
AM_CONDITIONAL([WANT_HTOOLSAPIDOC], [test x$HTOOLS_APIDOC = xyes])
636 6e4c8f68 Iustin Pop
AM_CONDITIONAL([HAS_HLINT], [test "$HLINT"])
637 e5bd9de5 Iustin Pop
638 70041061 Bernardo Dal Seno
# Check for fakeroot
639 70041061 Bernardo Dal Seno
AC_ARG_VAR(FAKEROOT_PATH, [fakeroot path])
640 70041061 Bernardo Dal Seno
AC_PATH_PROG(FAKEROOT_PATH, [fakeroot], [])
641 70041061 Bernardo Dal Seno
if test -z "$FAKEROOT_PATH"; then
642 70041061 Bernardo Dal Seno
  AC_MSG_WARN(m4_normalize([fakeroot not found, tests that must run as root
643 70041061 Bernardo Dal Seno
                            will not be executed]))
644 70041061 Bernardo Dal Seno
fi
645 70041061 Bernardo Dal Seno
AM_CONDITIONAL([HAS_FAKEROOT], [test "x$FAKEROOT_PATH" != x])
646 70041061 Bernardo Dal Seno
647 fe5b0c42 Michael Hanselmann
SOCAT_USE_ESCAPE=
648 fe5b0c42 Michael Hanselmann
AC_ARG_ENABLE([socat-escape],
649 fe5b0c42 Michael Hanselmann
  [AS_HELP_STRING([--enable-socat-escape],
650 fe5b0c42 Michael Hanselmann
    [use escape functionality available in socat >= 1.7 (default: detect
651 fe5b0c42 Michael Hanselmann
     automatically)])],
652 fe5b0c42 Michael Hanselmann
  [[if test "$enableval" = yes; then
653 fe5b0c42 Michael Hanselmann
      SOCAT_USE_ESCAPE=True
654 fe5b0c42 Michael Hanselmann
    else
655 fe5b0c42 Michael Hanselmann
      SOCAT_USE_ESCAPE=False
656 fe5b0c42 Michael Hanselmann
    fi
657 fe5b0c42 Michael Hanselmann
  ]])
658 fe5b0c42 Michael Hanselmann
659 fe5b0c42 Michael Hanselmann
if test -z "$SOCAT_USE_ESCAPE"
660 87c1d0c7 Guido Trotter
then
661 fe5b0c42 Michael Hanselmann
  if $SOCAT -hh | grep -w -q escape; then
662 fe5b0c42 Michael Hanselmann
    SOCAT_USE_ESCAPE=True
663 fe5b0c42 Michael Hanselmann
  else
664 fe5b0c42 Michael Hanselmann
    SOCAT_USE_ESCAPE=False
665 fe5b0c42 Michael Hanselmann
  fi
666 87c1d0c7 Guido Trotter
fi
667 87c1d0c7 Guido Trotter
668 fe5b0c42 Michael Hanselmann
AC_SUBST(SOCAT_USE_ESCAPE)
669 fe5b0c42 Michael Hanselmann
670 e90739d6 Michael Hanselmann
SOCAT_USE_COMPRESS=
671 e90739d6 Michael Hanselmann
AC_ARG_ENABLE([socat-compress],
672 e90739d6 Michael Hanselmann
  [AS_HELP_STRING([--enable-socat-compress],
673 e90739d6 Michael Hanselmann
    [use OpenSSL compression option available in patched socat builds
674 e90739d6 Michael Hanselmann
     (see INSTALL for details; default: detect automatically)])],
675 e90739d6 Michael Hanselmann
  [[if test "$enableval" = yes; then
676 e90739d6 Michael Hanselmann
      SOCAT_USE_COMPRESS=True
677 e90739d6 Michael Hanselmann
    else
678 e90739d6 Michael Hanselmann
      SOCAT_USE_COMPRESS=False
679 e90739d6 Michael Hanselmann
    fi
680 e90739d6 Michael Hanselmann
  ]])
681 e90739d6 Michael Hanselmann
682 e90739d6 Michael Hanselmann
if test -z "$SOCAT_USE_COMPRESS"
683 e90739d6 Michael Hanselmann
then
684 e90739d6 Michael Hanselmann
  if $SOCAT -hhh | grep -w -q openssl-compress; then
685 e90739d6 Michael Hanselmann
    SOCAT_USE_COMPRESS=True
686 e90739d6 Michael Hanselmann
  else
687 e90739d6 Michael Hanselmann
    SOCAT_USE_COMPRESS=False
688 e90739d6 Michael Hanselmann
  fi
689 e90739d6 Michael Hanselmann
fi
690 e90739d6 Michael Hanselmann
691 e90739d6 Michael Hanselmann
AC_SUBST(SOCAT_USE_COMPRESS)
692 e90739d6 Michael Hanselmann
693 5f55173b Iustin Pop
if man --help | grep -q -e --warnings
694 5f55173b Iustin Pop
then
695 5f55173b Iustin Pop
  MAN_HAS_WARNINGS=1
696 5f55173b Iustin Pop
else
697 5f55173b Iustin Pop
  MAN_HAS_WARNINGS=
698 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([man does not support --warnings, man page checks
699 30841576 Michael Hanselmann
                            will not be possible]))
700 5f55173b Iustin Pop
fi
701 5f55173b Iustin Pop
702 5f55173b Iustin Pop
AC_SUBST(MAN_HAS_WARNINGS)
703 5f55173b Iustin Pop
704 a5d17f9f Michael Hanselmann
# Check for Python
705 a8083063 Iustin Pop
AM_PATH_PYTHON(2.4)
706 a8083063 Iustin Pop
707 6e06b36c Iustin Pop
AC_PYTHON_MODULE(OpenSSL, t)
708 6e06b36c Iustin Pop
AC_PYTHON_MODULE(simplejson, t)
709 6e06b36c Iustin Pop
AC_PYTHON_MODULE(pyparsing, t)
710 0f18ee6d Guido Trotter
AC_PYTHON_MODULE(pyinotify, t)
711 28af40c8 Guido Trotter
AC_PYTHON_MODULE(pycurl, t)
712 4f6396fd Iustin Pop
AC_PYTHON_MODULE(affinity)
713 a40b1fc4 René Nussbaumer
AC_PYTHON_MODULE(paramiko)
714 a40b1fc4 René Nussbaumer
715 e8230860 Michael Hanselmann
AC_CONFIG_FILES([ Makefile ])
716 3571f686 Iustin Pop
717 a8083063 Iustin Pop
AC_OUTPUT