Statistics
| Branch: | Tag: | Revision:

root / configure.ac @ 47387ccb

History | View | Annotate | Download (23.3 kB)

1 a5d17f9f Michael Hanselmann
# Configure script for Ganeti
2 5e29d733 Michael Hanselmann
m4_define([gnt_version_major], [2])
3 ea2ee4b0 Michele Tartara
m4_define([gnt_version_minor], [9])
4 89c63fbe Klaus Aehlig
m4_define([gnt_version_revision], [2])
5 eb9861d3 Klaus Aehlig
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 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 b8203e1e Iustin Pop
# --with-kvm-kernel=...
123 b8203e1e Iustin Pop
AC_ARG_WITH([kvm-kernel],
124 b8203e1e Iustin Pop
  [AS_HELP_STRING([--with-kvm-kernel=PATH],
125 b8203e1e Iustin Pop
    [Guest kernel image for KVM hypervisor (default is /boot/vmlinuz-3-kvmU)]
126 b8203e1e Iustin Pop
  )],
127 b8203e1e Iustin Pop
  [kvm_kernel="$withval"],
128 b8203e1e Iustin Pop
  [kvm_kernel="/boot/vmlinuz-3-kvmU"])
129 b8203e1e Iustin Pop
AC_SUBST(KVM_KERNEL, $kvm_kernel)
130 b8203e1e Iustin Pop
131 7e2c5b9e Guido Trotter
# --with-kvm-path=...
132 7e2c5b9e Guido Trotter
AC_ARG_WITH([kvm-path],
133 7e2c5b9e Guido Trotter
  [AS_HELP_STRING([--with-kvm-path=PATH],
134 7e2c5b9e Guido Trotter
    [absolute path to the kvm binary]
135 7e2c5b9e Guido Trotter
    [ (default is /usr/bin/kvm)]
136 7e2c5b9e Guido Trotter
  )],
137 7e2c5b9e Guido Trotter
  [kvm_path="$withval"],
138 7e2c5b9e Guido Trotter
  [kvm_path="/usr/bin/kvm"])
139 7e2c5b9e Guido Trotter
AC_SUBST(KVM_PATH, $kvm_path)
140 7e2c5b9e Guido Trotter
141 89b70f39 Iustin Pop
# --with-lvm-stripecount=...
142 3736cb6b Iustin Pop
AC_ARG_WITH([lvm-stripecount],
143 3736cb6b Iustin Pop
  [AS_HELP_STRING([--with-lvm-stripecount=NUM],
144 43e11798 Andrea Spadaccini
    [the default number of stripes to use for LVM volumes]
145 7b3ac94d Iustin Pop
    [ (default is 1)]
146 3736cb6b Iustin Pop
  )],
147 3736cb6b Iustin Pop
  [lvm_stripecount="$withval"],
148 52fca4ba Michael Hanselmann
  [lvm_stripecount=1])
149 3736cb6b Iustin Pop
AC_SUBST(LVM_STRIPECOUNT, $lvm_stripecount)
150 3736cb6b Iustin Pop
151 052783ff Michael Hanselmann
# --with-ssh-login-user=...
152 052783ff Michael Hanselmann
AC_ARG_WITH([ssh-login-user],
153 052783ff Michael Hanselmann
  [AS_HELP_STRING([--with-ssh-login-user=USERNAME],
154 052783ff Michael Hanselmann
    [user to use for SSH logins within the cluster (default is root)]
155 052783ff Michael Hanselmann
  )],
156 052783ff Michael Hanselmann
  [ssh_login_user="$withval"],
157 052783ff Michael Hanselmann
  [ssh_login_user=root])
158 052783ff Michael Hanselmann
AC_SUBST(SSH_LOGIN_USER, $ssh_login_user)
159 052783ff Michael Hanselmann
160 052783ff Michael Hanselmann
# --with-ssh-console-user=...
161 052783ff Michael Hanselmann
AC_ARG_WITH([ssh-console-user],
162 052783ff Michael Hanselmann
  [AS_HELP_STRING([--with-ssh-console-user=USERNAME],
163 052783ff Michael Hanselmann
    [user to use for SSH logins to access instance consoles (default is root)]
164 052783ff Michael Hanselmann
  )],
165 052783ff Michael Hanselmann
  [ssh_console_user="$withval"],
166 052783ff Michael Hanselmann
  [ssh_console_user=root])
167 052783ff Michael Hanselmann
AC_SUBST(SSH_CONSOLE_USER, $ssh_console_user)
168 052783ff Michael Hanselmann
169 a6798ce1 Michael Hanselmann
# --with-default-user=...
170 a6798ce1 Michael Hanselmann
AC_ARG_WITH([default-user],
171 a6798ce1 Michael Hanselmann
  [AS_HELP_STRING([--with-default-user=USERNAME],
172 a6798ce1 Michael Hanselmann
    [default user for daemons]
173 a6798ce1 Michael Hanselmann
    [ (default is to run all daemons as root)]
174 a6798ce1 Michael Hanselmann
  )],
175 a6798ce1 Michael Hanselmann
  [user_default="$withval"],
176 a6798ce1 Michael Hanselmann
  [user_default=root])
177 a6798ce1 Michael Hanselmann
178 a6798ce1 Michael Hanselmann
# --with-default-group=...
179 a6798ce1 Michael Hanselmann
AC_ARG_WITH([default-group],
180 a6798ce1 Michael Hanselmann
  [AS_HELP_STRING([--with-default-group=GROUPNAME],
181 a6798ce1 Michael Hanselmann
    [default group for daemons]
182 a6798ce1 Michael Hanselmann
    [ (default is to run all daemons under group root)]
183 a6798ce1 Michael Hanselmann
  )],
184 a6798ce1 Michael Hanselmann
  [group_default="$withval"],
185 a6798ce1 Michael Hanselmann
  [group_default=root])
186 a6798ce1 Michael Hanselmann
187 0d150c50 René Nussbaumer
# --with-user-prefix=...
188 0d150c50 René Nussbaumer
AC_ARG_WITH([user-prefix],
189 0d150c50 René Nussbaumer
  [AS_HELP_STRING([--with-user-prefix=PREFIX],
190 0d150c50 René Nussbaumer
    [prefix for daemon users]
191 a6798ce1 Michael Hanselmann
    [ (default is to run all daemons as root; use --with-default-user]
192 a6798ce1 Michael Hanselmann
    [ to change the default)]
193 0d150c50 René Nussbaumer
  )],
194 3794937c René Nussbaumer
  [user_masterd="${withval}masterd";
195 0d150c50 René Nussbaumer
   user_rapi="${withval}rapi";
196 3794937c René Nussbaumer
   user_confd="${withval}confd";
197 3695a4e0 Thomas Thrainer
   user_luxid="${withval}luxid";
198 14013e5d Michele Tartara
   user_noded="$user_default";
199 ebcbcfee Michele Tartara
   user_mond="$user_default"],
200 a6798ce1 Michael Hanselmann
  [user_masterd="$user_default";
201 a6798ce1 Michael Hanselmann
   user_rapi="$user_default";
202 a6798ce1 Michael Hanselmann
   user_confd="$user_default";
203 3695a4e0 Thomas Thrainer
   user_luxid="$user_default";
204 14013e5d Michele Tartara
   user_noded="$user_default";
205 14013e5d Michele Tartara
   user_mond="$user_default"])
206 0d150c50 René Nussbaumer
AC_SUBST(MASTERD_USER, $user_masterd)
207 0d150c50 René Nussbaumer
AC_SUBST(RAPI_USER, $user_rapi)
208 0d150c50 René Nussbaumer
AC_SUBST(CONFD_USER, $user_confd)
209 3695a4e0 Thomas Thrainer
AC_SUBST(LUXID_USER, $user_luxid)
210 0d150c50 René Nussbaumer
AC_SUBST(NODED_USER, $user_noded)
211 14013e5d Michele Tartara
AC_SUBST(MOND_USER, $user_mond)
212 0d150c50 René Nussbaumer
213 0d150c50 René Nussbaumer
# --with-group-prefix=...
214 0d150c50 René Nussbaumer
AC_ARG_WITH([group-prefix],
215 0d150c50 René Nussbaumer
  [AS_HELP_STRING([--with-group-prefix=PREFIX],
216 0d150c50 René Nussbaumer
    [prefix for daemon POSIX groups]
217 a6798ce1 Michael Hanselmann
    [ (default is to run all daemons under group root; use]
218 a6798ce1 Michael Hanselmann
    [ --with-default-group to change the default)]
219 0d150c50 René Nussbaumer
  )],
220 3794937c René Nussbaumer
  [group_rapi="${withval}rapi";
221 3794937c René Nussbaumer
   group_admin="${withval}admin";
222 3794937c René Nussbaumer
   group_confd="${withval}confd";
223 3695a4e0 Thomas Thrainer
   group_luxid="${withval}luxid";
224 3794937c René Nussbaumer
   group_masterd="${withval}masterd";
225 a6798ce1 Michael Hanselmann
   group_noded="$group_default";
226 14013e5d Michele Tartara
   group_daemons="${withval}daemons";
227 ebcbcfee Michele Tartara
   group_mond="$group_default"],
228 a6798ce1 Michael Hanselmann
  [group_rapi="$group_default";
229 a6798ce1 Michael Hanselmann
   group_admin="$group_default";
230 a6798ce1 Michael Hanselmann
   group_confd="$group_default";
231 3695a4e0 Thomas Thrainer
   group_luxid="$group_default";
232 a6798ce1 Michael Hanselmann
   group_masterd="$group_default";
233 a6798ce1 Michael Hanselmann
   group_noded="$group_default";
234 14013e5d Michele Tartara
   group_daemons="$group_default";
235 14013e5d Michele Tartara
   group_mond="$group_default"])
236 0d150c50 René Nussbaumer
AC_SUBST(RAPI_GROUP, $group_rapi)
237 0d150c50 René Nussbaumer
AC_SUBST(ADMIN_GROUP, $group_admin)
238 0d150c50 René Nussbaumer
AC_SUBST(CONFD_GROUP, $group_confd)
239 3695a4e0 Thomas Thrainer
AC_SUBST(LUXID_GROUP, $group_luxid)
240 0d150c50 René Nussbaumer
AC_SUBST(MASTERD_GROUP, $group_masterd)
241 03881cb0 René Nussbaumer
AC_SUBST(NODED_GROUP, $group_noded)
242 0d150c50 René Nussbaumer
AC_SUBST(DAEMONS_GROUP, $group_daemons)
243 14013e5d Michele Tartara
AC_SUBST(MOND_GROUP, $group_mond)
244 0d150c50 René Nussbaumer
245 0d150c50 René Nussbaumer
# Print the config to the user
246 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Running ganeti-masterd as $group_masterd:$group_masterd])
247 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Running ganeti-rapi as $user_rapi:$group_rapi])
248 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Running ganeti-confd as $user_confd:$group_confd])
249 3695a4e0 Thomas Thrainer
AC_MSG_NOTICE([Running ganeti-luxid as $user_luxid:$group_luxid])
250 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Group for daemons is $group_daemons])
251 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Group for clients is $group_admin])
252 0d150c50 René Nussbaumer
253 89b70f39 Iustin Pop
# --enable-drbd-barriers
254 89b70f39 Iustin Pop
AC_ARG_ENABLE([drbd-barriers],
255 89b70f39 Iustin Pop
  [AS_HELP_STRING([--enable-drbd-barriers],
256 52fca4ba Michael Hanselmann
                  m4_normalize([enable the DRBD barriers functionality by
257 52fca4ba Michael Hanselmann
                                default (>= 8.0.12) (default: enabled)]))],
258 89b70f39 Iustin Pop
  [[if test "$enableval" != no; then
259 8a69b3a8 Andrea Spadaccini
      DRBD_BARRIERS=n
260 8a69b3a8 Andrea Spadaccini
      DRBD_NO_META_FLUSH=False
261 89b70f39 Iustin Pop
    else
262 15618b63 Michael Hanselmann
      DRBD_BARRIERS=bf
263 8a69b3a8 Andrea Spadaccini
      DRBD_NO_META_FLUSH=True
264 89b70f39 Iustin Pop
    fi
265 89b70f39 Iustin Pop
  ]],
266 8a69b3a8 Andrea Spadaccini
  [DRBD_BARRIERS=n
267 8a69b3a8 Andrea Spadaccini
   DRBD_NO_META_FLUSH=False
268 8a69b3a8 Andrea Spadaccini
  ])
269 89b70f39 Iustin Pop
AC_SUBST(DRBD_BARRIERS, $DRBD_BARRIERS)
270 8a69b3a8 Andrea Spadaccini
AC_SUBST(DRBD_NO_META_FLUSH, $DRBD_NO_META_FLUSH)
271 89b70f39 Iustin Pop
272 551b6283 Iustin Pop
# --enable-syslog[=no/yes/only]
273 551b6283 Iustin Pop
AC_ARG_ENABLE([syslog],
274 551b6283 Iustin Pop
  [AS_HELP_STRING([--enable-syslog],
275 551b6283 Iustin Pop
    [enable use of syslog (default: disabled), one of no/yes/only])],
276 551b6283 Iustin Pop
  [[case "$enableval" in
277 551b6283 Iustin Pop
      no)
278 551b6283 Iustin Pop
        SYSLOG=no
279 551b6283 Iustin Pop
        ;;
280 551b6283 Iustin Pop
      yes)
281 551b6283 Iustin Pop
        SYSLOG=yes
282 551b6283 Iustin Pop
        ;;
283 551b6283 Iustin Pop
      only)
284 551b6283 Iustin Pop
        SYSLOG=only
285 551b6283 Iustin Pop
        ;;
286 551b6283 Iustin Pop
      *)
287 551b6283 Iustin Pop
        SYSLOG=
288 551b6283 Iustin Pop
        ;;
289 551b6283 Iustin Pop
    esac
290 551b6283 Iustin Pop
  ]],
291 551b6283 Iustin Pop
  [SYSLOG=no])
292 551b6283 Iustin Pop
293 551b6283 Iustin Pop
if test -z "$SYSLOG"
294 551b6283 Iustin Pop
then
295 551b6283 Iustin Pop
  AC_MSG_ERROR([invalid value for syslog, choose one of no/yes/only])
296 551b6283 Iustin Pop
fi
297 551b6283 Iustin Pop
AC_SUBST(SYSLOG_USAGE, $SYSLOG)
298 551b6283 Iustin Pop
299 1fdeb284 Michael Hanselmann
AC_ARG_ENABLE([restricted-commands],
300 1fdeb284 Michael Hanselmann
  [AS_HELP_STRING([--enable-restricted-commands],
301 1fdeb284 Michael Hanselmann
                  m4_normalize([enable restricted commands in the node daemon
302 9108958f Michael Hanselmann
                                (default: disabled)]))],
303 9108958f Michael Hanselmann
  [[if test "$enableval" = no; then
304 1fdeb284 Michael Hanselmann
      enable_restricted_commands=False
305 9108958f Michael Hanselmann
    else
306 1fdeb284 Michael Hanselmann
      enable_restricted_commands=True
307 9108958f Michael Hanselmann
    fi
308 9108958f Michael Hanselmann
  ]],
309 1fdeb284 Michael Hanselmann
  [enable_restricted_commands=False])
310 1fdeb284 Michael Hanselmann
AC_SUBST(ENABLE_RESTRICTED_COMMANDS, $enable_restricted_commands)
311 9108958f Michael Hanselmann
312 3536c792 Iustin Pop
# --with-disk-separator=...
313 3536c792 Iustin Pop
AC_ARG_WITH([disk-separator],
314 3536c792 Iustin Pop
  [AS_HELP_STRING([--with-disk-separator=STRING],
315 30841576 Michael Hanselmann
    [Disk index separator, useful if the default of ':' is handled]
316 30841576 Michael Hanselmann
    [ specially by the hypervisor]
317 3536c792 Iustin Pop
  )],
318 3536c792 Iustin Pop
  [disk_separator="$withval"],
319 3536c792 Iustin Pop
  [disk_separator=":"])
320 3536c792 Iustin Pop
AC_SUBST(DISK_SEPARATOR, $disk_separator)
321 3536c792 Iustin Pop
322 a5d17f9f Michael Hanselmann
# Check common programs
323 a8083063 Iustin Pop
AC_PROG_INSTALL
324 9ff7e35c Michael Hanselmann
AC_PROG_LN_S
325 a8083063 Iustin Pop
326 c4dfb0b6 Andrea Spadaccini
# Check for the ip command
327 c4dfb0b6 Andrea Spadaccini
AC_ARG_VAR(IP_PATH, [ip path])
328 c4dfb0b6 Andrea Spadaccini
AC_PATH_PROG(IP_PATH, [ip], [])
329 c4dfb0b6 Andrea Spadaccini
if test -z "$IP_PATH"
330 c4dfb0b6 Andrea Spadaccini
then
331 c4dfb0b6 Andrea Spadaccini
  AC_MSG_ERROR([ip command not found])
332 c4dfb0b6 Andrea Spadaccini
fi
333 c4dfb0b6 Andrea Spadaccini
334 18e2b6e4 Iustin Pop
# Check for pandoc
335 5208e732 Iustin Pop
AC_ARG_VAR(PANDOC, [pandoc path])
336 5208e732 Iustin Pop
AC_PATH_PROG(PANDOC, [pandoc], [])
337 5208e732 Iustin Pop
if test -z "$PANDOC"
338 5208e732 Iustin Pop
then
339 5208e732 Iustin Pop
  AC_MSG_WARN([pandoc not found, man pages rebuild will not be possible])
340 5208e732 Iustin Pop
fi
341 5208e732 Iustin Pop
342 d17e74b4 Iustin Pop
# Check for python-sphinx
343 d17e74b4 Iustin Pop
AC_ARG_VAR(SPHINX, [sphinx-build path])
344 d17e74b4 Iustin Pop
AC_PATH_PROG(SPHINX, [sphinx-build], [])
345 d17e74b4 Iustin Pop
if test -z "$SPHINX"
346 f05c99f3 Michael Hanselmann
then
347 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([sphinx-build not found, documentation rebuild will
348 30841576 Michael Hanselmann
                            not be possible]))
349 96b28307 Michael Hanselmann
else
350 96b28307 Michael Hanselmann
  # Sphinx exits with code 1 when it prints its usage
351 96b28307 Michael Hanselmann
  sphinxver=`{ $SPHINX --version 2>&1 || :; } | head -n 3`
352 96b28307 Michael Hanselmann
353 96b28307 Michael Hanselmann
  if ! echo "$sphinxver" | grep -q -w -e '^Sphinx' -e '^Usage:'; then
354 96b28307 Michael Hanselmann
    AC_MSG_ERROR([Unable to determine Sphinx version])
355 96b28307 Michael Hanselmann
356 96b28307 Michael Hanselmann
  # Note: Character classes ([...]) need to be double quoted due to autoconf
357 96b28307 Michael Hanselmann
  # using m4
358 47387ccb Klaus Aehlig
  elif ! echo "$sphinxver" | grep -q -E \
359 47387ccb Klaus Aehlig
       '^Sphinx[[[:space:]]]+(\(sphinx-build\)[[[:space:]]]+|v)[[1-9]]\>'; then
360 96b28307 Michael Hanselmann
    AC_MSG_ERROR([Sphinx 1.0 or higher is required])
361 96b28307 Michael Hanselmann
  fi
362 f05c99f3 Michael Hanselmann
fi
363 d99dd9c7 Michele Tartara
AM_CONDITIONAL([HAS_SPHINX], [test -n "$SPHINX"])
364 f05c99f3 Michael Hanselmann
365 41806ef4 Michael Hanselmann
AC_ARG_ENABLE([manpages-in-doc],
366 41806ef4 Michael Hanselmann
  [AS_HELP_STRING([--enable-manpages-in-doc],
367 41806ef4 Michael Hanselmann
                  m4_normalize([include man pages in HTML documentation
368 41806ef4 Michael Hanselmann
                                (requires sphinx; default disabled)]))],
369 41806ef4 Michael Hanselmann
  [case "$enableval" in
370 41806ef4 Michael Hanselmann
      yes) manpages_in_doc=yes ;;
371 41806ef4 Michael Hanselmann
      no) manpages_in_doc= ;;
372 41806ef4 Michael Hanselmann
      *)
373 41806ef4 Michael Hanselmann
        AC_MSG_ERROR([Bad value $enableval for --enable-manpages-in-doc])
374 41806ef4 Michael Hanselmann
        ;;
375 41806ef4 Michael Hanselmann
    esac
376 41806ef4 Michael Hanselmann
  ],
377 41806ef4 Michael Hanselmann
  [manpages_in_doc=])
378 41806ef4 Michael Hanselmann
AM_CONDITIONAL([MANPAGES_IN_DOC], [test -n "$manpages_in_doc"])
379 41806ef4 Michael Hanselmann
AC_SUBST(MANPAGES_IN_DOC, $manpages_in_doc)
380 41806ef4 Michael Hanselmann
381 41806ef4 Michael Hanselmann
if test -z "$SPHINX" -a -n "$manpages_in_doc"; then
382 41806ef4 Michael Hanselmann
  AC_MSG_ERROR([Including man pages in HTML documentation requires sphinx])
383 41806ef4 Michael Hanselmann
fi
384 41806ef4 Michael Hanselmann
385 f86e82ef Iustin Pop
# Check for graphviz (dot)
386 f86e82ef Iustin Pop
AC_ARG_VAR(DOT, [dot path])
387 f86e82ef Iustin Pop
AC_PATH_PROG(DOT, [dot], [])
388 f86e82ef Iustin Pop
if test -z "$DOT"
389 f86e82ef Iustin Pop
then
390 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([dot (from the graphviz suite) not found,
391 30841576 Michael Hanselmann
                            documentation rebuild not possible]))
392 f86e82ef Iustin Pop
fi
393 f86e82ef Iustin Pop
394 6d7cc5ff Michael Hanselmann
# Check for pylint
395 6d7cc5ff Michael Hanselmann
AC_ARG_VAR(PYLINT, [pylint path])
396 6d7cc5ff Michael Hanselmann
AC_PATH_PROG(PYLINT, [pylint], [])
397 6d7cc5ff Michael Hanselmann
if test -z "$PYLINT"
398 6d7cc5ff Michael Hanselmann
then
399 6d7cc5ff Michael Hanselmann
  AC_MSG_WARN([pylint not found, checking code will not be possible])
400 6d7cc5ff Michael Hanselmann
fi
401 6d7cc5ff Michael Hanselmann
402 08366664 Michael Hanselmann
# Check for pep8
403 08366664 Michael Hanselmann
AC_ARG_VAR(PEP8, [pep8 path])
404 08366664 Michael Hanselmann
AC_PATH_PROG(PEP8, [pep8], [])
405 08366664 Michael Hanselmann
if test -z "$PEP8"
406 08366664 Michael Hanselmann
then
407 08366664 Michael Hanselmann
  AC_MSG_WARN([pep8 not found, checking code will not be complete])
408 08366664 Michael Hanselmann
fi
409 141c8421 Michael Hanselmann
AM_CONDITIONAL([HAS_PEP8], [test -n "$PEP8"])
410 141c8421 Michael Hanselmann
411 141c8421 Michael Hanselmann
# Check for python-coverage
412 141c8421 Michael Hanselmann
AC_ARG_VAR(PYCOVERAGE, [python-coverage path])
413 141c8421 Michael Hanselmann
AC_PATH_PROGS(PYCOVERAGE, [python-coverage coverage], [])
414 141c8421 Michael Hanselmann
if test -z "$PYCOVERAGE"
415 141c8421 Michael Hanselmann
then
416 141c8421 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([python-coverage or coverage not found, evaluating
417 141c8421 Michael Hanselmann
                            Python test coverage will not be possible]))
418 141c8421 Michael Hanselmann
fi
419 08366664 Michael Hanselmann
420 fe5b0c42 Michael Hanselmann
# Check for socat
421 fe5b0c42 Michael Hanselmann
AC_ARG_VAR(SOCAT, [socat path])
422 fe5b0c42 Michael Hanselmann
AC_PATH_PROG(SOCAT, [socat], [])
423 87c1d0c7 Guido Trotter
if test -z "$SOCAT"
424 87c1d0c7 Guido Trotter
then
425 fe5b0c42 Michael Hanselmann
  AC_MSG_ERROR([socat not found])
426 87c1d0c7 Guido Trotter
fi
427 87c1d0c7 Guido Trotter
428 a002ed79 Agata Murawska
# Check for qemu-img
429 a002ed79 Agata Murawska
AC_ARG_VAR(QEMUIMG_PATH, [qemu-img path])
430 a002ed79 Agata Murawska
AC_PATH_PROG(QEMUIMG_PATH, [qemu-img], [])
431 a002ed79 Agata Murawska
if test -z "$QEMUIMG_PATH"
432 a002ed79 Agata Murawska
then
433 a002ed79 Agata Murawska
  AC_MSG_WARN([qemu-img not found, using ovfconverter will not be possible])
434 a002ed79 Agata Murawska
fi
435 a002ed79 Agata Murawska
436 21a5e56c Iustin Pop
# --enable-confd
437 21a5e56c Iustin Pop
ENABLE_CONFD=
438 21a5e56c Iustin Pop
AC_ARG_ENABLE([confd],
439 21a5e56c Iustin Pop
  [AS_HELP_STRING([--enable-confd],
440 21a5e56c Iustin Pop
  [enable the ganeti-confd daemon (default: check)])],
441 21a5e56c Iustin Pop
  [],
442 21a5e56c Iustin Pop
  [enable_confd=check])
443 acf70442 Iustin Pop
444 14013e5d Michele Tartara
ENABLE_MOND=
445 35c6e63d Michele Tartara
AC_ARG_ENABLE([monitoring],
446 35c6e63d Michele Tartara
  [AS_HELP_STRING([--enable-monitoring],
447 13cc7b84 Michele Tartara
  [enable the ganeti monitoring daemon (default: check)])],
448 35c6e63d Michele Tartara
  [],
449 35c6e63d Michele Tartara
  [enable_monitoring=check])
450 35c6e63d Michele Tartara
451 e5bd9de5 Iustin Pop
# Check for ghc
452 e5bd9de5 Iustin Pop
AC_ARG_VAR(GHC, [ghc path])
453 e5bd9de5 Iustin Pop
AC_PATH_PROG(GHC, [ghc], [])
454 e5bd9de5 Iustin Pop
if test -z "$GHC"; then
455 21a5e56c Iustin Pop
  AC_MSG_FAILURE([ghc not found, compilation will not possible])
456 e5bd9de5 Iustin Pop
fi
457 e5bd9de5 Iustin Pop
458 39f0eea5 Iustin Pop
AC_MSG_CHECKING([checking for extra GHC flags])
459 52fca4ba Michael Hanselmann
GHC_BYVERSION_FLAGS=
460 39f0eea5 Iustin Pop
# check for GHC supported flags that vary accross versions
461 39f0eea5 Iustin Pop
for flag in -fwarn-incomplete-uni-patterns; do
462 52fca4ba Michael Hanselmann
  if $GHC -e '0' $flag >/dev/null 2>/dev/null; then
463 39f0eea5 Iustin Pop
   GHC_BYVERSION_FLAGS="$GHC_BYVERSION_FLAGS $flag"
464 39f0eea5 Iustin Pop
  fi
465 39f0eea5 Iustin Pop
done
466 39f0eea5 Iustin Pop
AC_MSG_RESULT($GHC_BYVERSION_FLAGS)
467 39f0eea5 Iustin Pop
AC_SUBST(GHC_BYVERSION_FLAGS)
468 39f0eea5 Iustin Pop
469 e5bd9de5 Iustin Pop
# Check for ghc-pkg
470 e5bd9de5 Iustin Pop
AC_ARG_VAR(GHC_PKG, [ghc-pkg path])
471 e5bd9de5 Iustin Pop
AC_PATH_PROG(GHC_PKG, [ghc-pkg], [])
472 e5bd9de5 Iustin Pop
if test -z "$GHC_PKG"; then
473 21a5e56c Iustin Pop
  AC_MSG_FAILURE([ghc-pkg not found, compilation will not be possible])
474 21a5e56c Iustin Pop
fi
475 21a5e56c Iustin Pop
476 21a5e56c Iustin Pop
# check for modules, first custom/special checks
477 21a5e56c Iustin Pop
AC_MSG_NOTICE([checking for required haskell modules])
478 d9a900dc Iustin Pop
HS_PARALLEL3=
479 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([parallel-3.*], [HS_PARALLEL3=-DPARALLEL3],
480 21a5e56c Iustin Pop
                 [AC_GHC_PKG_REQUIRE(parallel)], t)
481 d9a900dc Iustin Pop
AC_SUBST(HS_PARALLEL3)
482 21a5e56c Iustin Pop
483 21a5e56c Iustin Pop
# and now standard modules
484 1ca709c1 Iustin Pop
AC_GHC_PKG_REQUIRE(curl)
485 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(json)
486 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(network)
487 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(mtl)
488 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(bytestring)
489 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(utf8-string)
490 6c60b266 Klaus Aehlig
AC_GHC_PKG_REQUIRE(hslogger)
491 21a5e56c Iustin Pop
492 21a5e56c Iustin Pop
# extra modules for confd functionality
493 d9a900dc Iustin Pop
HS_REGEX_PCRE=-DNO_REGEX_PCRE
494 21a5e56c Iustin Pop
has_confd=False
495 52fca4ba Michael Hanselmann
if test "$enable_confd" != no; then
496 21a5e56c Iustin Pop
  CONFD_PKG=
497 d9a900dc Iustin Pop
  AC_GHC_PKG_CHECK([regex-pcre], [HS_REGEX_PCRE=],
498 21a5e56c Iustin Pop
                   [CONFD_PKG="$CONFD_PKG regex-pcre"])
499 21a5e56c Iustin Pop
  AC_GHC_PKG_CHECK([Crypto], [], [CONFD_PKG="$CONFD_PKG Crypto"])
500 21a5e56c Iustin Pop
  AC_GHC_PKG_CHECK([text], [], [CONFD_PKG="$CONFD_PKG text"])
501 21a5e56c Iustin Pop
  AC_GHC_PKG_CHECK([hinotify], [], [CONFD_PKG="$CONFD_PKG hinotify"])
502 432d62a8 Helga Velroyen
  AC_GHC_PKG_CHECK([vector], [], [CONFD_PKG="$CONFD_PKG vector"])
503 21a5e56c Iustin Pop
  if test -z "$CONFD_PKG"; then
504 21a5e56c Iustin Pop
    has_confd=True
505 52fca4ba Michael Hanselmann
  elif test "$enable_confd" = check; then
506 52fca4ba Michael Hanselmann
    AC_MSG_WARN(m4_normalize([The required extra libraries for confd were
507 52fca4ba Michael Hanselmann
                              not found ($CONFD_PKG), confd disabled]))
508 e5bd9de5 Iustin Pop
  else
509 52fca4ba Michael Hanselmann
    AC_MSG_FAILURE(m4_normalize([The confd functionality was requested, but
510 52fca4ba Michael Hanselmann
                                 required libraries were not found:
511 52fca4ba Michael Hanselmann
                                 $CONFD_PKG]))
512 e5bd9de5 Iustin Pop
  fi
513 e5bd9de5 Iustin Pop
fi
514 d9a900dc Iustin Pop
AC_SUBST(HS_REGEX_PCRE)
515 52fca4ba Michael Hanselmann
if test "$has_confd" = True; then
516 21a5e56c Iustin Pop
  AC_MSG_NOTICE([Enabling confd usage])
517 21a5e56c Iustin Pop
fi
518 21a5e56c Iustin Pop
AC_SUBST(ENABLE_CONFD, $has_confd)
519 21a5e56c Iustin Pop
AM_CONDITIONAL([ENABLE_CONFD], [test x$has_confd = xTrue])
520 21a5e56c Iustin Pop
521 13cc7b84 Michele Tartara
#extra modules for monitoring daemon functionality
522 35c6e63d Michele Tartara
has_monitoring=False
523 52fca4ba Michael Hanselmann
if test "$enable_monitoring" != no; then
524 35c6e63d Michele Tartara
  MONITORING_PKG=
525 52fca4ba Michael Hanselmann
  AC_GHC_PKG_CHECK([attoparsec], [],
526 52fca4ba Michael Hanselmann
                   [MONITORING_PKG="$MONITORING_PKG attoparsec"])
527 13cc7b84 Michele Tartara
  AC_GHC_PKG_CHECK([snap-server], [],
528 13cc7b84 Michele Tartara
                   [MONITORING_PKG="$MONITORING_PKG snap-server"])
529 74685117 Michele Tartara
  AC_GHC_PKG_CHECK([process], [],
530 74685117 Michele Tartara
                   [MONITORING_PKG="$MONITORING_PKG process"])
531 5d453688 Michele Tartara
  MONITORING_DEP=
532 5d453688 Michele Tartara
  if test "$has_confd" = False; then
533 5d453688 Michele Tartara
    MONITORING_DEP="$MONITORING_DEP confd"
534 5d453688 Michele Tartara
  fi
535 5d453688 Michele Tartara
  has_monitoring_pkg=False
536 35c6e63d Michele Tartara
  if test -z "$MONITORING_PKG"; then
537 5d453688 Michele Tartara
    has_monitoring_pkg=True
538 52fca4ba Michael Hanselmann
  elif test "$enable_monitoring" = check; then
539 52fca4ba Michael Hanselmann
    AC_MSG_WARN(m4_normalize([The required extra libraries for the monitoring
540 13cc7b84 Michele Tartara
                              daemon were not found ($MONITORING_PKG),
541 52fca4ba Michael Hanselmann
                              monitoring disabled]))
542 35c6e63d Michele Tartara
  else
543 52fca4ba Michael Hanselmann
    AC_MSG_FAILURE(m4_normalize([The monitoring functionality was requested, but
544 52fca4ba Michael Hanselmann
                                 required libraries were not found:
545 52fca4ba Michael Hanselmann
                                 $MONITORING_PKG]))
546 35c6e63d Michele Tartara
  fi
547 5d453688 Michele Tartara
  has_monitoring_dep=False
548 5d453688 Michele Tartara
  if test -z "$MONITORING_DEP"; then
549 5d453688 Michele Tartara
    has_monitoring_dep=True
550 5d453688 Michele Tartara
  elif test "$enable_monitoring" = check; then
551 5d453688 Michele Tartara
    AC_MSG_WARN(m4_normalize([The optional Ganeti components required for the
552 5d453688 Michele Tartara
                              monitoring agent were not enabled
553 5d453688 Michele Tartara
                              ($MONITORING_DEP), monitoring disabled]))
554 5d453688 Michele Tartara
  else
555 5d453688 Michele Tartara
    AC_MSG_FAILURE(m4_normalize([The monitoring functionality was requested, but
556 5d453688 Michele Tartara
                                 required optional Ganeti components were not
557 5d453688 Michele Tartara
                                 found: $MONITORING_DEP]))
558 5d453688 Michele Tartara
  fi
559 5d453688 Michele Tartara
560 35c6e63d Michele Tartara
fi
561 5d453688 Michele Tartara
if test "$has_monitoring_pkg" = True -a "$has_monitoring_dep" = True; then
562 5d453688 Michele Tartara
  has_monitoring=True
563 35c6e63d Michele Tartara
  AC_MSG_NOTICE([Enabling the monitoring agent usage])
564 35c6e63d Michele Tartara
fi
565 14013e5d Michele Tartara
AC_SUBST(ENABLE_MOND, $has_monitoring)
566 14013e5d Michele Tartara
AM_CONDITIONAL([ENABLE_MOND], [test "$has_monitoring" = True])
567 35c6e63d Michele Tartara
568 21a5e56c Iustin Pop
# development modules
569 d9a900dc Iustin Pop
HS_NODEV=
570 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([QuickCheck-2.*], [], [HS_NODEV=1], t)
571 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([test-framework-0.6*], [], [HS_NODEV=1], t)
572 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([test-framework-hunit], [], [HS_NODEV=1])
573 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([test-framework-quickcheck2], [], [HS_NODEV=1])
574 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([temporary], [], [HS_NODEV=1])
575 35c6e63d Michele Tartara
# FIXME: unify checks for non-test libraries (attoparsec, hinotify, ...)
576 35c6e63d Michele Tartara
#        that are needed to execute the tests, avoiding the duplication
577 35c6e63d Michele Tartara
#        of the checks.
578 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([attoparsec], [], [HS_NODEV=1])
579 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([vector], [], [HS_NODEV=1])
580 a50b49b8 Klaus Aehlig
AC_GHC_PKG_CHECK([process], [], [HS_NODEV=1])
581 cf2cda79 Klaus Aehlig
AC_GHC_PKG_CHECK([snap-server], [], [HS_NODEV=1])
582 7e360262 Klaus Aehlig
AC_GHC_PKG_CHECK([regex-pcre], [], [HS_NODEV=1])
583 7e360262 Klaus Aehlig
AC_GHC_PKG_CHECK([Crypto], [], [HS_NODEV=1])
584 7e360262 Klaus Aehlig
AC_GHC_PKG_CHECK([text], [], [HS_NODEV=1])
585 7e360262 Klaus Aehlig
AC_GHC_PKG_CHECK([hinotify], [], [HS_NODEV=1])
586 d9a900dc Iustin Pop
if test -n "$HS_NODEV"; then
587 21a5e56c Iustin Pop
   AC_MSG_WARN(m4_normalize([Required development modules were not found,
588 21a5e56c Iustin Pop
                             you won't be able to run Haskell unittests]))
589 21a5e56c Iustin Pop
else
590 21a5e56c Iustin Pop
   AC_MSG_NOTICE([Haskell development modules found, unittests enabled])
591 21a5e56c Iustin Pop
fi
592 d9a900dc Iustin Pop
AC_SUBST(HS_NODEV)
593 21a5e56c Iustin Pop
594 21a5e56c Iustin Pop
HTOOLS=yes
595 e5bd9de5 Iustin Pop
AC_SUBST(HTOOLS)
596 e5bd9de5 Iustin Pop
597 55837756 Iustin Pop
# --enable-split-query
598 55837756 Iustin Pop
ENABLE_SPLIT_QUERY=
599 55837756 Iustin Pop
AC_ARG_ENABLE([split-query],
600 55837756 Iustin Pop
  [AS_HELP_STRING([--enable-split-query],
601 55837756 Iustin Pop
  [enable use of custom query daemon via confd])],
602 55837756 Iustin Pop
  [[case "$enableval" in
603 55837756 Iustin Pop
      no)
604 55837756 Iustin Pop
        enable_split_query=False
605 55837756 Iustin Pop
        ;;
606 55837756 Iustin Pop
      yes)
607 55837756 Iustin Pop
        enable_split_query=True
608 55837756 Iustin Pop
        ;;
609 55837756 Iustin Pop
      *)
610 55837756 Iustin Pop
        echo "Invalid value for enable-confd '$enableval'"
611 55837756 Iustin Pop
        exit 1
612 55837756 Iustin Pop
        ;;
613 55837756 Iustin Pop
    esac
614 55837756 Iustin Pop
  ]],
615 1ca709c1 Iustin Pop
  [[case "x${has_confd}x" in
616 1ca709c1 Iustin Pop
     xTruex)
617 55837756 Iustin Pop
       enable_split_query=True
618 55837756 Iustin Pop
       ;;
619 55837756 Iustin Pop
     *)
620 55837756 Iustin Pop
       enable_split_query=False
621 55837756 Iustin Pop
       ;;
622 55837756 Iustin Pop
   esac]])
623 55837756 Iustin Pop
AC_SUBST(ENABLE_SPLIT_QUERY, $enable_split_query)
624 55837756 Iustin Pop
625 21a5e56c Iustin Pop
if test x$enable_split_query = xTrue -a x$has_confd != xTrue; then
626 55837756 Iustin Pop
  AC_MSG_ERROR([Split queries require the confd daemon])
627 55837756 Iustin Pop
fi
628 55837756 Iustin Pop
629 55837756 Iustin Pop
if test x$enable_split_query = xTrue; then
630 55837756 Iustin Pop
  AC_MSG_NOTICE([Split query functionality enabled])
631 55837756 Iustin Pop
fi
632 55837756 Iustin Pop
633 e5bd9de5 Iustin Pop
# Check for HsColour
634 d9a900dc Iustin Pop
HS_APIDOC=no
635 e5bd9de5 Iustin Pop
AC_ARG_VAR(HSCOLOUR, [HsColour path])
636 e5bd9de5 Iustin Pop
AC_PATH_PROG(HSCOLOUR, [HsColour], [])
637 e5bd9de5 Iustin Pop
if test -z "$HSCOLOUR"; then
638 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([HsColour not found, htools API documentation will
639 30841576 Michael Hanselmann
                            not be generated]))
640 e5bd9de5 Iustin Pop
fi
641 e5bd9de5 Iustin Pop
642 e5bd9de5 Iustin Pop
# Check for haddock
643 e5bd9de5 Iustin Pop
AC_ARG_VAR(HADDOCK, [haddock path])
644 e5bd9de5 Iustin Pop
AC_PATH_PROG(HADDOCK, [haddock], [])
645 e5bd9de5 Iustin Pop
if test -z "$HADDOCK"; then
646 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([haddock not found, htools API documentation will
647 30841576 Michael Hanselmann
                            not be generated]))
648 e5bd9de5 Iustin Pop
fi
649 52fca4ba Michael Hanselmann
if test -n "$HADDOCK" && test -n "$HSCOLOUR"; then
650 d9a900dc Iustin Pop
  HS_APIDOC=yes
651 e5bd9de5 Iustin Pop
fi
652 d9a900dc Iustin Pop
AC_SUBST(HS_APIDOC)
653 e5bd9de5 Iustin Pop
654 6e4c8f68 Iustin Pop
# Check for hlint
655 6e4c8f68 Iustin Pop
AC_ARG_VAR(HLINT, [hlint path])
656 6e4c8f68 Iustin Pop
AC_PATH_PROG(HLINT, [hlint], [])
657 6e4c8f68 Iustin Pop
if test -z "$HLINT"; then
658 6e4c8f68 Iustin Pop
  AC_MSG_WARN([hlint not found, checking code will not be possible])
659 6e4c8f68 Iustin Pop
fi
660 6e4c8f68 Iustin Pop
661 52fca4ba Michael Hanselmann
if test "$HTOOLS" != yes && test "$ENABLE_CONFD" = True; then
662 52fca4ba Michael Hanselmann
  AC_MSG_ERROR(m4_normalize([cannot enable ganeti-confd if
663 52fca4ba Michael Hanselmann
                             htools support is not enabled]))
664 73b0fa69 Iustin Pop
fi
665 73b0fa69 Iustin Pop
666 52fca4ba Michael Hanselmann
AM_CONDITIONAL([WANT_HTOOLS], [test "$HTOOLS" = yes])
667 d9a900dc Iustin Pop
AM_CONDITIONAL([WANT_HSTESTS], [test "x$HS_NODEV" = x])
668 d9a900dc Iustin Pop
AM_CONDITIONAL([WANT_HSAPIDOC], [test "$HS_APIDOC" = yes])
669 6e4c8f68 Iustin Pop
AM_CONDITIONAL([HAS_HLINT], [test "$HLINT"])
670 e5bd9de5 Iustin Pop
671 70041061 Bernardo Dal Seno
# Check for fakeroot
672 70041061 Bernardo Dal Seno
AC_ARG_VAR(FAKEROOT_PATH, [fakeroot path])
673 70041061 Bernardo Dal Seno
AC_PATH_PROG(FAKEROOT_PATH, [fakeroot], [])
674 70041061 Bernardo Dal Seno
if test -z "$FAKEROOT_PATH"; then
675 70041061 Bernardo Dal Seno
  AC_MSG_WARN(m4_normalize([fakeroot not found, tests that must run as root
676 70041061 Bernardo Dal Seno
                            will not be executed]))
677 70041061 Bernardo Dal Seno
fi
678 70041061 Bernardo Dal Seno
AM_CONDITIONAL([HAS_FAKEROOT], [test "x$FAKEROOT_PATH" != x])
679 70041061 Bernardo Dal Seno
680 fe5b0c42 Michael Hanselmann
SOCAT_USE_ESCAPE=
681 fe5b0c42 Michael Hanselmann
AC_ARG_ENABLE([socat-escape],
682 fe5b0c42 Michael Hanselmann
  [AS_HELP_STRING([--enable-socat-escape],
683 fe5b0c42 Michael Hanselmann
    [use escape functionality available in socat >= 1.7 (default: detect
684 fe5b0c42 Michael Hanselmann
     automatically)])],
685 fe5b0c42 Michael Hanselmann
  [[if test "$enableval" = yes; then
686 fe5b0c42 Michael Hanselmann
      SOCAT_USE_ESCAPE=True
687 fe5b0c42 Michael Hanselmann
    else
688 fe5b0c42 Michael Hanselmann
      SOCAT_USE_ESCAPE=False
689 fe5b0c42 Michael Hanselmann
    fi
690 fe5b0c42 Michael Hanselmann
  ]])
691 fe5b0c42 Michael Hanselmann
692 fe5b0c42 Michael Hanselmann
if test -z "$SOCAT_USE_ESCAPE"
693 87c1d0c7 Guido Trotter
then
694 fe5b0c42 Michael Hanselmann
  if $SOCAT -hh | grep -w -q escape; then
695 fe5b0c42 Michael Hanselmann
    SOCAT_USE_ESCAPE=True
696 fe5b0c42 Michael Hanselmann
  else
697 fe5b0c42 Michael Hanselmann
    SOCAT_USE_ESCAPE=False
698 fe5b0c42 Michael Hanselmann
  fi
699 87c1d0c7 Guido Trotter
fi
700 87c1d0c7 Guido Trotter
701 fe5b0c42 Michael Hanselmann
AC_SUBST(SOCAT_USE_ESCAPE)
702 fe5b0c42 Michael Hanselmann
703 e90739d6 Michael Hanselmann
SOCAT_USE_COMPRESS=
704 e90739d6 Michael Hanselmann
AC_ARG_ENABLE([socat-compress],
705 e90739d6 Michael Hanselmann
  [AS_HELP_STRING([--enable-socat-compress],
706 e90739d6 Michael Hanselmann
    [use OpenSSL compression option available in patched socat builds
707 e90739d6 Michael Hanselmann
     (see INSTALL for details; default: detect automatically)])],
708 e90739d6 Michael Hanselmann
  [[if test "$enableval" = yes; then
709 e90739d6 Michael Hanselmann
      SOCAT_USE_COMPRESS=True
710 e90739d6 Michael Hanselmann
    else
711 e90739d6 Michael Hanselmann
      SOCAT_USE_COMPRESS=False
712 e90739d6 Michael Hanselmann
    fi
713 e90739d6 Michael Hanselmann
  ]])
714 e90739d6 Michael Hanselmann
715 e90739d6 Michael Hanselmann
if test -z "$SOCAT_USE_COMPRESS"
716 e90739d6 Michael Hanselmann
then
717 e90739d6 Michael Hanselmann
  if $SOCAT -hhh | grep -w -q openssl-compress; then
718 e90739d6 Michael Hanselmann
    SOCAT_USE_COMPRESS=True
719 e90739d6 Michael Hanselmann
  else
720 e90739d6 Michael Hanselmann
    SOCAT_USE_COMPRESS=False
721 e90739d6 Michael Hanselmann
  fi
722 e90739d6 Michael Hanselmann
fi
723 e90739d6 Michael Hanselmann
724 e90739d6 Michael Hanselmann
AC_SUBST(SOCAT_USE_COMPRESS)
725 e90739d6 Michael Hanselmann
726 5f55173b Iustin Pop
if man --help | grep -q -e --warnings
727 5f55173b Iustin Pop
then
728 5f55173b Iustin Pop
  MAN_HAS_WARNINGS=1
729 5f55173b Iustin Pop
else
730 5f55173b Iustin Pop
  MAN_HAS_WARNINGS=
731 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([man does not support --warnings, man page checks
732 30841576 Michael Hanselmann
                            will not be possible]))
733 5f55173b Iustin Pop
fi
734 5f55173b Iustin Pop
735 5f55173b Iustin Pop
AC_SUBST(MAN_HAS_WARNINGS)
736 5f55173b Iustin Pop
737 a5d17f9f Michael Hanselmann
# Check for Python
738 777ea2c6 Guido Trotter
AM_PATH_PYTHON(2.6)
739 a8083063 Iustin Pop
740 6e06b36c Iustin Pop
AC_PYTHON_MODULE(OpenSSL, t)
741 6e06b36c Iustin Pop
AC_PYTHON_MODULE(simplejson, t)
742 6e06b36c Iustin Pop
AC_PYTHON_MODULE(pyparsing, t)
743 0f18ee6d Guido Trotter
AC_PYTHON_MODULE(pyinotify, t)
744 28af40c8 Guido Trotter
AC_PYTHON_MODULE(pycurl, t)
745 0a09b080 Michael Hanselmann
AC_PYTHON_MODULE(bitarray, t)
746 0a09b080 Michael Hanselmann
AC_PYTHON_MODULE(ipaddr, t)
747 7a694e30 Thomas Thrainer
AC_PYTHON_MODULE(mock)
748 4f6396fd Iustin Pop
AC_PYTHON_MODULE(affinity)
749 a40b1fc4 René Nussbaumer
AC_PYTHON_MODULE(paramiko)
750 a40b1fc4 René Nussbaumer
751 27df5b73 Michele Tartara
# Development-only Python modules
752 27df5b73 Michele Tartara
PY_NODEV=
753 27df5b73 Michele Tartara
AC_PYTHON_MODULE(yaml)
754 27df5b73 Michele Tartara
if test $HAVE_PYMOD_YAML == "no"; then
755 27df5b73 Michele Tartara
  PY_NODEV="$PY_NODEV yaml"
756 27df5b73 Michele Tartara
fi
757 27df5b73 Michele Tartara
758 27df5b73 Michele Tartara
if test -n "$PY_NODEV"; then
759 27df5b73 Michele Tartara
  AC_MSG_WARN(m4_normalize([Required development modules ($PY_NODEV) were not
760 27df5b73 Michele Tartara
                            found, you won't be able to run Python unittests]))
761 27df5b73 Michele Tartara
else
762 d14d93b0 Helga Velroyen
  AC_MSG_NOTICE([Python development modules found, unittests enabled])
763 27df5b73 Michele Tartara
fi
764 27df5b73 Michele Tartara
AC_SUBST(PY_NODEV)
765 d14d93b0 Helga Velroyen
AM_CONDITIONAL([PY_UNIT], [test -n $PY_NODEV])
766 27df5b73 Michele Tartara
767 e8230860 Michael Hanselmann
AC_CONFIG_FILES([ Makefile ])
768 3571f686 Iustin Pop
769 a8083063 Iustin Pop
AC_OUTPUT