Statistics
| Branch: | Tag: | Revision:

root / configure.ac @ 88b58ed6

History | View | Annotate | Download (23.9 kB)

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