Statistics
| Branch: | Tag: | Revision:

root / configure.ac @ 56c934da

History | View | Annotate | Download (23 kB)

1
# Configure script for Ganeti
2
m4_define([gnt_version_major], [2])
3
m4_define([gnt_version_minor], [11])
4
m4_define([gnt_version_revision], [0])
5
m4_define([gnt_version_suffix], [~alpha1])
6
m4_define([gnt_version_full],
7
          m4_format([%d.%d.%d%s],
8
                    gnt_version_major, gnt_version_minor,
9
                    gnt_version_revision, gnt_version_suffix))
10

    
11
AC_PREREQ(2.59)
12
AC_INIT(ganeti, gnt_version_full, ganeti@googlegroups.com)
13
AC_CONFIG_AUX_DIR(autotools)
14
AC_CONFIG_SRCDIR(configure)
15
AM_INIT_AUTOMAKE([1.9 foreign tar-ustar -Wall -Wno-portability])
16

    
17
AC_SUBST([VERSION_MAJOR], gnt_version_major)
18
AC_SUBST([VERSION_MINOR], gnt_version_minor)
19
AC_SUBST([VERSION_REVISION], gnt_version_revision)
20
AC_SUBST([VERSION_SUFFIX], gnt_version_suffix)
21
AC_SUBST([VERSION_FULL], gnt_version_full)
22

    
23
# --enable-versionfull
24
AC_ARG_ENABLE([versionfull],
25
  [AS_HELP_STRING([--enable-versionfull],
26
                  m4_normalize([use the full version string rather
27
                  than major.minor for version directories]))],
28
  [[if test "$enableval" != no; then
29
      USE_VERSION_FULL=yes
30
    else
31
      USER_VERSION_FULL=no
32
    fi
33
  ]],
34
  [USE_VERSION_FULL=no
35
  ])
36
AC_SUBST(USE_VERSION_FULL, $USE_VERSION_FULL)
37
AM_CONDITIONAL([USE_VERSION_FULL], [test "$USE_VERSION_FULL" = yes])
38

    
39
# --enable-symlinks
40
AC_ARG_ENABLE([symlinks],
41
  [AS_HELP_STRING([--enable-symlinks],
42
                  m4_normalize([also install version-dependent symlinks under
43
                  $sysconfdir (default: disabled)]))],
44
  [[if test "$enableval" != yes; then
45
      INSTALL_SYMLINKS=no
46
    else
47
      INSTALL_SYMLINKS=yes
48
    fi
49
  ]],
50
  [INSTALL_SYMLINKS=no
51
  ])
52
AC_SUBST(INSTALL_SYMLINKS, $INSTALL_SYMLINKS)
53
AM_CONDITIONAL([INSTALL_SYMLINKS], [test "$INSTALL_SYMLINKS" = yes])
54

    
55
# --with-ssh-initscript=...
56
AC_ARG_WITH([ssh-initscript],
57
  [AS_HELP_STRING([--with-ssh-initscript=SCRIPT],
58
    [SSH init script to use (default is /etc/init.d/ssh)]
59
  )],
60
  [ssh_initd_script="$withval"],
61
  [ssh_initd_script="/etc/init.d/ssh"])
62
AC_SUBST(SSH_INITD_SCRIPT, $ssh_initd_script)
63

    
64
# --with-export-dir=...
65
AC_ARG_WITH([export-dir],
66
  [AS_HELP_STRING([--with-export-dir=DIR],
67
    [directory to use by default for instance image]
68
    [ exports (default is /srv/ganeti/export)]
69
  )],
70
  [export_dir="$withval"],
71
  [export_dir="/srv/ganeti/export"])
72
AC_SUBST(EXPORT_DIR, $export_dir)
73

    
74
# --with-ssh-config-dir=...
75
AC_ARG_WITH([ssh-config-dir],
76
  [AS_HELP_STRING([--with-ssh-config-dir=DIR],
77
    [ directory with ssh host keys ]
78
    [ (default is /etc/ssh)]
79
  )],
80
  [ssh_config_dir="$withval"],
81
  [ssh_config_dir="/etc/ssh"])
82
AC_SUBST(SSH_CONFIG_DIR, $ssh_config_dir)
83

    
84
# --with-xen-config-dir=...
85
AC_ARG_WITH([xen-config-dir],
86
  [AS_HELP_STRING([--with-xen-config-dir=DIR],
87
                  m4_normalize([Xen configuration directory
88
                                (default: /etc/xen)]))],
89
  [xen_config_dir="$withval"],
90
  [xen_config_dir=/etc/xen])
91
AC_SUBST(XEN_CONFIG_DIR, $xen_config_dir)
92

    
93
# --with-os-search-path=...
94
AC_ARG_WITH([os-search-path],
95
  [AS_HELP_STRING([--with-os-search-path=LIST],
96
    [comma separated list of directories to]
97
    [ search for OS images (default is /srv/ganeti/os)]
98
  )],
99
  [os_search_path="$withval"],
100
  [os_search_path="/srv/ganeti/os"])
101
AC_SUBST(OS_SEARCH_PATH, $os_search_path)
102

    
103
# --with-extstorage-search-path=...
104
AC_ARG_WITH([extstorage-search-path],
105
  [AS_HELP_STRING([--with-extstorage-search-path=LIST],
106
    [comma separated list of directories to]
107
    [ search for External Storage Providers]
108
    [ (default is /srv/ganeti/extstorage)]
109
  )],
110
  [es_search_path="$withval"],
111
  [es_search_path="/srv/ganeti/extstorage"])
112
AC_SUBST(ES_SEARCH_PATH, $es_search_path)
113

    
114
# --with-iallocator-search-path=...
115
AC_ARG_WITH([iallocator-search-path],
116
  [AS_HELP_STRING([--with-iallocator-search-path=LIST],
117
    [comma separated list of directories to]
118
    [ search for instance allocators (default is $libdir/ganeti/iallocators)]
119
  )],
120
  [iallocator_search_path="$withval"],
121
  [iallocator_search_path="$libdir/$PACKAGE_NAME/iallocators"])
122
AC_SUBST(IALLOCATOR_SEARCH_PATH, $iallocator_search_path)
123

    
124
# --with-xen-bootloader=...
125
AC_ARG_WITH([xen-bootloader],
126
  [AS_HELP_STRING([--with-xen-bootloader=PATH],
127
    [bootloader for Xen hypervisor (default is empty)]
128
  )],
129
  [xen_bootloader="$withval"],
130
  [xen_bootloader=])
131
AC_SUBST(XEN_BOOTLOADER, $xen_bootloader)
132

    
133
# --with-xen-kernel=...
134
AC_ARG_WITH([xen-kernel],
135
  [AS_HELP_STRING([--with-xen-kernel=PATH],
136
    [DomU kernel image for Xen hypervisor (default is /boot/vmlinuz-3-xenU)]
137
  )],
138
  [xen_kernel="$withval"],
139
  [xen_kernel="/boot/vmlinuz-3-xenU"])
140
AC_SUBST(XEN_KERNEL, $xen_kernel)
141

    
142
# --with-xen-initrd=...
143
AC_ARG_WITH([xen-initrd],
144
  [AS_HELP_STRING([--with-xen-initrd=PATH],
145
    [DomU initrd image for Xen hypervisor (default is /boot/initrd-3-xenU)]
146
  )],
147
  [xen_initrd="$withval"],
148
  [xen_initrd="/boot/initrd-3-xenU"])
149
AC_SUBST(XEN_INITRD, $xen_initrd)
150

    
151
# --with-kvm-kernel=...
152
AC_ARG_WITH([kvm-kernel],
153
  [AS_HELP_STRING([--with-kvm-kernel=PATH],
154
    [Guest kernel image for KVM hypervisor (default is /boot/vmlinuz-3-kvmU)]
155
  )],
156
  [kvm_kernel="$withval"],
157
  [kvm_kernel="/boot/vmlinuz-3-kvmU"])
158
AC_SUBST(KVM_KERNEL, $kvm_kernel)
159

    
160
# --with-kvm-path=...
161
AC_ARG_WITH([kvm-path],
162
  [AS_HELP_STRING([--with-kvm-path=PATH],
163
    [absolute path to the kvm binary]
164
    [ (default is /usr/bin/kvm)]
165
  )],
166
  [kvm_path="$withval"],
167
  [kvm_path="/usr/bin/kvm"])
168
AC_SUBST(KVM_PATH, $kvm_path)
169

    
170
# --with-lvm-stripecount=...
171
AC_ARG_WITH([lvm-stripecount],
172
  [AS_HELP_STRING([--with-lvm-stripecount=NUM],
173
    [the default number of stripes to use for LVM volumes]
174
    [ (default is 1)]
175
  )],
176
  [lvm_stripecount="$withval"],
177
  [lvm_stripecount=1])
178
AC_SUBST(LVM_STRIPECOUNT, $lvm_stripecount)
179

    
180
# --with-ssh-login-user=...
181
AC_ARG_WITH([ssh-login-user],
182
  [AS_HELP_STRING([--with-ssh-login-user=USERNAME],
183
    [user to use for SSH logins within the cluster (default is root)]
184
  )],
185
  [ssh_login_user="$withval"],
186
  [ssh_login_user=root])
187
AC_SUBST(SSH_LOGIN_USER, $ssh_login_user)
188

    
189
# --with-ssh-console-user=...
190
AC_ARG_WITH([ssh-console-user],
191
  [AS_HELP_STRING([--with-ssh-console-user=USERNAME],
192
    [user to use for SSH logins to access instance consoles (default is root)]
193
  )],
194
  [ssh_console_user="$withval"],
195
  [ssh_console_user=root])
196
AC_SUBST(SSH_CONSOLE_USER, $ssh_console_user)
197

    
198
# --with-default-user=...
199
AC_ARG_WITH([default-user],
200
  [AS_HELP_STRING([--with-default-user=USERNAME],
201
    [default user for daemons]
202
    [ (default is to run all daemons as root)]
203
  )],
204
  [user_default="$withval"],
205
  [user_default=root])
206

    
207
# --with-default-group=...
208
AC_ARG_WITH([default-group],
209
  [AS_HELP_STRING([--with-default-group=GROUPNAME],
210
    [default group for daemons]
211
    [ (default is to run all daemons under group root)]
212
  )],
213
  [group_default="$withval"],
214
  [group_default=root])
215

    
216
# --with-user-prefix=...
217
AC_ARG_WITH([user-prefix],
218
  [AS_HELP_STRING([--with-user-prefix=PREFIX],
219
    [prefix for daemon users]
220
    [ (default is to run all daemons as root; use --with-default-user]
221
    [ to change the default)]
222
  )],
223
  [user_masterd="${withval}masterd";
224
   user_rapi="${withval}rapi";
225
   user_confd="${withval}confd";
226
   user_luxid="${withval}luxid";
227
   user_noded="$user_default";
228
   user_mond="$user_default"],
229
  [user_masterd="$user_default";
230
   user_rapi="$user_default";
231
   user_confd="$user_default";
232
   user_luxid="$user_default";
233
   user_noded="$user_default";
234
   user_mond="$user_default"])
235
AC_SUBST(MASTERD_USER, $user_masterd)
236
AC_SUBST(RAPI_USER, $user_rapi)
237
AC_SUBST(CONFD_USER, $user_confd)
238
AC_SUBST(LUXID_USER, $user_luxid)
239
AC_SUBST(NODED_USER, $user_noded)
240
AC_SUBST(MOND_USER, $user_mond)
241

    
242
# --with-group-prefix=...
243
AC_ARG_WITH([group-prefix],
244
  [AS_HELP_STRING([--with-group-prefix=PREFIX],
245
    [prefix for daemon POSIX groups]
246
    [ (default is to run all daemons under group root; use]
247
    [ --with-default-group to change the default)]
248
  )],
249
  [group_rapi="${withval}rapi";
250
   group_admin="${withval}admin";
251
   group_confd="${withval}confd";
252
   group_luxid="${withval}luxid";
253
   group_masterd="${withval}masterd";
254
   group_noded="$group_default";
255
   group_daemons="${withval}daemons";
256
   group_mond="$group_default"],
257
  [group_rapi="$group_default";
258
   group_admin="$group_default";
259
   group_confd="$group_default";
260
   group_luxid="$group_default";
261
   group_masterd="$group_default";
262
   group_noded="$group_default";
263
   group_daemons="$group_default";
264
   group_mond="$group_default"])
265
AC_SUBST(RAPI_GROUP, $group_rapi)
266
AC_SUBST(ADMIN_GROUP, $group_admin)
267
AC_SUBST(CONFD_GROUP, $group_confd)
268
AC_SUBST(LUXID_GROUP, $group_luxid)
269
AC_SUBST(MASTERD_GROUP, $group_masterd)
270
AC_SUBST(NODED_GROUP, $group_noded)
271
AC_SUBST(DAEMONS_GROUP, $group_daemons)
272
AC_SUBST(MOND_GROUP, $group_mond)
273

    
274
# Print the config to the user
275
AC_MSG_NOTICE([Running ganeti-masterd as $group_masterd:$group_masterd])
276
AC_MSG_NOTICE([Running ganeti-rapi as $user_rapi:$group_rapi])
277
AC_MSG_NOTICE([Running ganeti-confd as $user_confd:$group_confd])
278
AC_MSG_NOTICE([Running ganeti-luxid as $user_luxid:$group_luxid])
279
AC_MSG_NOTICE([Group for daemons is $group_daemons])
280
AC_MSG_NOTICE([Group for clients is $group_admin])
281

    
282
# --enable-drbd-barriers
283
AC_ARG_ENABLE([drbd-barriers],
284
  [AS_HELP_STRING([--enable-drbd-barriers],
285
                  m4_normalize([enable the DRBD barriers functionality by
286
                                default (>= 8.0.12) (default: enabled)]))],
287
  [[if test "$enableval" != no; then
288
      DRBD_BARRIERS=n
289
      DRBD_NO_META_FLUSH=False
290
    else
291
      DRBD_BARRIERS=bf
292
      DRBD_NO_META_FLUSH=True
293
    fi
294
  ]],
295
  [DRBD_BARRIERS=n
296
   DRBD_NO_META_FLUSH=False
297
  ])
298
AC_SUBST(DRBD_BARRIERS, $DRBD_BARRIERS)
299
AC_SUBST(DRBD_NO_META_FLUSH, $DRBD_NO_META_FLUSH)
300

    
301
# --enable-syslog[=no/yes/only]
302
AC_ARG_ENABLE([syslog],
303
  [AS_HELP_STRING([--enable-syslog],
304
    [enable use of syslog (default: disabled), one of no/yes/only])],
305
  [[case "$enableval" in
306
      no)
307
        SYSLOG=no
308
        ;;
309
      yes)
310
        SYSLOG=yes
311
        ;;
312
      only)
313
        SYSLOG=only
314
        ;;
315
      *)
316
        SYSLOG=
317
        ;;
318
    esac
319
  ]],
320
  [SYSLOG=no])
321

    
322
if test -z "$SYSLOG"
323
then
324
  AC_MSG_ERROR([invalid value for syslog, choose one of no/yes/only])
325
fi
326
AC_SUBST(SYSLOG_USAGE, $SYSLOG)
327

    
328
# --enable-restricted-commands[=no/yes]
329
AC_ARG_ENABLE([restricted-commands],
330
  [AS_HELP_STRING([--enable-restricted-commands],
331
                  m4_normalize([enable restricted commands in the node daemon
332
                                (default: disabled)]))],
333
  [[if test "$enableval" = no; then
334
      enable_restricted_commands=False
335
    else
336
      enable_restricted_commands=True
337
    fi
338
  ]],
339
  [enable_restricted_commands=False])
340
AC_SUBST(ENABLE_RESTRICTED_COMMANDS, $enable_restricted_commands)
341

    
342
# --with-disk-separator=...
343
AC_ARG_WITH([disk-separator],
344
  [AS_HELP_STRING([--with-disk-separator=STRING],
345
    [Disk index separator, useful if the default of ':' is handled]
346
    [ specially by the hypervisor]
347
  )],
348
  [disk_separator="$withval"],
349
  [disk_separator=":"])
350
AC_SUBST(DISK_SEPARATOR, $disk_separator)
351

    
352
# Check common programs
353
AC_PROG_INSTALL
354
AC_PROG_LN_S
355

    
356
# check if ln is the GNU version of ln (and hence supports -T)
357
if ln --version 2> /dev/null | head -1 | grep -q GNU
358
then
359
  AC_SUBST(HAS_GNU_LN, True)
360
else
361
  AC_SUBST(HAS_GNU_LN, False)
362
fi
363

    
364
# Check for the ip command
365
AC_ARG_VAR(IP_PATH, [ip path])
366
AC_PATH_PROG(IP_PATH, [ip], [])
367
if test -z "$IP_PATH"
368
then
369
  AC_MSG_ERROR([ip command not found])
370
fi
371

    
372
# Check for pandoc
373
AC_ARG_VAR(PANDOC, [pandoc path])
374
AC_PATH_PROG(PANDOC, [pandoc], [])
375
if test -z "$PANDOC"
376
then
377
  AC_MSG_WARN([pandoc not found, man pages rebuild will not be possible])
378
fi
379

    
380
# Check for python-sphinx
381
AC_ARG_VAR(SPHINX, [sphinx-build path])
382
AC_PATH_PROG(SPHINX, [sphinx-build], [])
383
if test -z "$SPHINX"
384
then
385
  AC_MSG_WARN(m4_normalize([sphinx-build not found, documentation rebuild will
386
                            not be possible]))
387
else
388
  # Sphinx exits with code 1 when it prints its usage
389
  sphinxver=`{ $SPHINX --version 2>&1 || :; } | head -n 3`
390

    
391
  if ! echo "$sphinxver" | grep -q -w -e '^Sphinx' -e '^Usage:'; then
392
    AC_MSG_ERROR([Unable to determine Sphinx version])
393

    
394
  # Note: Character classes ([...]) need to be double quoted due to autoconf
395
  # using m4
396
  elif ! echo "$sphinxver" | grep -q -E '^Sphinx[[[:space:]]]+v[[1-9]]\>'; then
397
    AC_MSG_ERROR([Sphinx 1.0 or higher is required])
398
  fi
399
fi
400
AM_CONDITIONAL([HAS_SPHINX], [test -n "$SPHINX"])
401

    
402
AC_ARG_ENABLE([manpages-in-doc],
403
  [AS_HELP_STRING([--enable-manpages-in-doc],
404
                  m4_normalize([include man pages in HTML documentation
405
                                (requires sphinx; default disabled)]))],
406
  [case "$enableval" in
407
      yes) manpages_in_doc=yes ;;
408
      no) manpages_in_doc= ;;
409
      *)
410
        AC_MSG_ERROR([Bad value $enableval for --enable-manpages-in-doc])
411
        ;;
412
    esac
413
  ],
414
  [manpages_in_doc=])
415
AM_CONDITIONAL([MANPAGES_IN_DOC], [test -n "$manpages_in_doc"])
416
AC_SUBST(MANPAGES_IN_DOC, $manpages_in_doc)
417

    
418
if test -z "$SPHINX" -a -n "$manpages_in_doc"; then
419
  AC_MSG_ERROR([Including man pages in HTML documentation requires sphinx])
420
fi
421

    
422
# Check for graphviz (dot)
423
AC_ARG_VAR(DOT, [dot path])
424
AC_PATH_PROG(DOT, [dot], [])
425
if test -z "$DOT"
426
then
427
  AC_MSG_WARN(m4_normalize([dot (from the graphviz suite) not found,
428
                            documentation rebuild not possible]))
429
fi
430

    
431
# Check for pylint
432
AC_ARG_VAR(PYLINT, [pylint path])
433
AC_PATH_PROG(PYLINT, [pylint], [])
434
if test -z "$PYLINT"
435
then
436
  AC_MSG_WARN([pylint not found, checking code will not be possible])
437
fi
438

    
439
# Check for pep8
440
AC_ARG_VAR(PEP8, [pep8 path])
441
AC_PATH_PROG(PEP8, [pep8], [])
442
if test -z "$PEP8"
443
then
444
  AC_MSG_WARN([pep8 not found, checking code will not be complete])
445
fi
446
AM_CONDITIONAL([HAS_PEP8], [test -n "$PEP8"])
447

    
448
# Check for python-coverage
449
AC_ARG_VAR(PYCOVERAGE, [python-coverage path])
450
AC_PATH_PROGS(PYCOVERAGE, [python-coverage coverage], [])
451
if test -z "$PYCOVERAGE"
452
then
453
  AC_MSG_WARN(m4_normalize([python-coverage or coverage not found, evaluating
454
                            Python test coverage will not be possible]))
455
fi
456

    
457
# Check for socat
458
AC_ARG_VAR(SOCAT, [socat path])
459
AC_PATH_PROG(SOCAT, [socat], [])
460
if test -z "$SOCAT"
461
then
462
  AC_MSG_ERROR([socat not found])
463
fi
464

    
465
# Check for qemu-img
466
AC_ARG_VAR(QEMUIMG_PATH, [qemu-img path])
467
AC_PATH_PROG(QEMUIMG_PATH, [qemu-img], [])
468
if test -z "$QEMUIMG_PATH"
469
then
470
  AC_MSG_WARN([qemu-img not found, using ovfconverter will not be possible])
471
fi
472

    
473
# --enable-confd
474
ENABLE_CONFD=
475
AC_ARG_ENABLE([confd],
476
  [AS_HELP_STRING([--enable-confd],
477
  [enable the ganeti-confd daemon (default: check)])],
478
  [],
479
  [enable_confd=check])
480

    
481
ENABLE_MOND=
482
AC_ARG_ENABLE([monitoring],
483
  [AS_HELP_STRING([--enable-monitoring],
484
  [enable the ganeti monitoring daemon (default: check)])],
485
  [],
486
  [enable_monitoring=check])
487

    
488
# Check for ghc
489
AC_ARG_VAR(GHC, [ghc path])
490
AC_PATH_PROG(GHC, [ghc], [])
491
if test -z "$GHC"; then
492
  AC_MSG_FAILURE([ghc not found, compilation will not possible])
493
fi
494

    
495
AC_MSG_CHECKING([checking for extra GHC flags])
496
GHC_BYVERSION_FLAGS=
497
# check for GHC supported flags that vary accross versions
498
for flag in -fwarn-incomplete-uni-patterns; do
499
  if $GHC -e '0' $flag >/dev/null 2>/dev/null; then
500
   GHC_BYVERSION_FLAGS="$GHC_BYVERSION_FLAGS $flag"
501
  fi
502
done
503
AC_MSG_RESULT($GHC_BYVERSION_FLAGS)
504
AC_SUBST(GHC_BYVERSION_FLAGS)
505

    
506
# Check for ghc-pkg
507
AC_ARG_VAR(GHC_PKG, [ghc-pkg path])
508
AC_PATH_PROG(GHC_PKG, [ghc-pkg], [])
509
if test -z "$GHC_PKG"; then
510
  AC_MSG_FAILURE([ghc-pkg not found, compilation will not be possible])
511
fi
512

    
513
# check for modules, first custom/special checks
514
AC_MSG_NOTICE([checking for required haskell modules])
515
HS_PARALLEL3=
516
AC_GHC_PKG_CHECK([parallel-3.*], [HS_PARALLEL3=-DPARALLEL3],
517
                 [AC_GHC_PKG_REQUIRE(parallel)], t)
518
AC_SUBST(HS_PARALLEL3)
519

    
520
# and now standard modules
521
AC_GHC_PKG_REQUIRE(curl)
522
AC_GHC_PKG_REQUIRE(json)
523
AC_GHC_PKG_REQUIRE(network)
524
AC_GHC_PKG_REQUIRE(mtl)
525
AC_GHC_PKG_REQUIRE(bytestring)
526
AC_GHC_PKG_REQUIRE(base64-bytestring-1.*, t)
527
AC_GHC_PKG_REQUIRE(utf8-string)
528
AC_GHC_PKG_REQUIRE(zlib)
529
AC_GHC_PKG_REQUIRE(hslogger)
530

    
531
# extra modules for confd functionality; also needed for tests
532
HS_NODEV=
533
CONFD_PKG=
534
AC_GHC_PKG_CHECK([vector], [], [HS_NODEV=1; CONFD_PKG="$CONFD_PKG vector"])
535

    
536
HS_REGEX_PCRE=-DNO_REGEX_PCRE
537
AC_GHC_PKG_CHECK([regex-pcre], [HS_REGEX_PCRE=],
538
                 [HS_NODEV=1; CONFD_PKG="$CONFD_PKG regex-pcre"])
539
AC_GHC_PKG_CHECK([text], [], [HS_NODEV=1; CONFD_PKG="$CONFD_PKG text"])
540
AC_GHC_PKG_CHECK([hinotify], [], [HS_NODEV=1; CONFD_PKG="$CONFD_PKG hinotify"])
541
AC_GHC_PKG_CHECK([Crypto], [], [HS_NODEV=1; CONFD_PKG="$CONFD_PKG Crypto"])
542

    
543
has_confd=False
544
if test "$enable_confd" != no; then
545
  if test -z "$CONFD_PKG"; then
546
    has_confd=True
547
  elif test "$enable_confd" = check; then
548
    AC_MSG_WARN(m4_normalize([The required extra libraries for confd were
549
                              not found ($CONFD_PKG), confd disabled]))
550
  else
551
    AC_MSG_FAILURE(m4_normalize([The confd functionality was requested, but
552
                                 required libraries were not found:
553
                                 $CONFD_PKG]))
554
  fi
555
fi
556
AC_SUBST(HS_REGEX_PCRE)
557
if test "$has_confd" = True; then
558
  AC_MSG_NOTICE([Enabling confd usage])
559
fi
560
AC_SUBST(ENABLE_CONFD, $has_confd)
561
AM_CONDITIONAL([ENABLE_CONFD], [test x$has_confd = xTrue])
562

    
563
#extra modules for monitoring daemon functionality; also needed for tests
564
MONITORING_PKG=
565
AC_GHC_PKG_CHECK([attoparsec], [],
566
                 [HS_NODEV=1; MONITORING_PKG="$MONITORING_PKG attoparsec"])
567
AC_GHC_PKG_CHECK([snap-server], [],
568
                 [NS_NODEV=1; MONITORING_PKG="$MONITORING_PKG snap-server"])
569
AC_GHC_PKG_CHECK([process], [],
570
                 [HS_NODEV=1; MONITORING_PKG="$MONITORING_PKG process"])
571

    
572
has_monitoring=False
573
if test "$enable_monitoring" != no; then
574
  MONITORING_DEP=
575
  if test "$has_confd" = False; then
576
    MONITORING_DEP="$MONITORING_DEP confd"
577
  fi
578
  has_monitoring_pkg=False
579
  if test -z "$MONITORING_PKG"; then
580
    has_monitoring_pkg=True
581
  elif test "$enable_monitoring" = check; then
582
    AC_MSG_WARN(m4_normalize([The required extra libraries for the monitoring
583
                              daemon were not found ($MONITORING_PKG),
584
                              monitoring disabled]))
585
  else
586
    AC_MSG_FAILURE(m4_normalize([The monitoring functionality was requested, but
587
                                 required libraries were not found:
588
                                 $MONITORING_PKG]))
589
  fi
590
  has_monitoring_dep=False
591
  if test -z "$MONITORING_DEP"; then
592
    has_monitoring_dep=True
593
  elif test "$enable_monitoring" = check; then
594
    AC_MSG_WARN(m4_normalize([The optional Ganeti components required for the
595
                              monitoring agent were not enabled
596
                              ($MONITORING_DEP), monitoring disabled]))
597
  else
598
    AC_MSG_FAILURE(m4_normalize([The monitoring functionality was requested, but
599
                                 required optional Ganeti components were not
600
                                 found: $MONITORING_DEP]))
601
  fi
602

    
603
fi
604
if test "$has_monitoring_pkg" = True -a "$has_monitoring_dep" = True; then
605
  has_monitoring=True
606
  AC_MSG_NOTICE([Enabling the monitoring agent usage])
607
fi
608
AC_SUBST(ENABLE_MOND, $has_monitoring)
609
AM_CONDITIONAL([ENABLE_MOND], [test "$has_monitoring" = True])
610

    
611
# development modules
612
AC_GHC_PKG_CHECK([QuickCheck-2.*], [], [HS_NODEV=1], t)
613
AC_GHC_PKG_CHECK([test-framework-0.6*], [], [HS_NODEV=1], t)
614
AC_GHC_PKG_CHECK([test-framework-hunit], [], [HS_NODEV=1])
615
AC_GHC_PKG_CHECK([test-framework-quickcheck2], [], [HS_NODEV=1])
616
AC_GHC_PKG_CHECK([temporary], [], [HS_NODEV=1])
617
if test -n "$HS_NODEV"; then
618
   AC_MSG_WARN(m4_normalize([Required development modules were not found,
619
                             you won't be able to run Haskell unittests]))
620
else
621
   AC_MSG_NOTICE([Haskell development modules found, unittests enabled])
622
fi
623
AC_SUBST(HS_NODEV)
624

    
625
HTOOLS=yes
626
AC_SUBST(HTOOLS)
627

    
628
# Check for HsColour
629
HS_APIDOC=no
630
AC_ARG_VAR(HSCOLOUR, [HsColour path])
631
AC_PATH_PROG(HSCOLOUR, [HsColour], [])
632
if test -z "$HSCOLOUR"; then
633
  AC_MSG_WARN(m4_normalize([HsColour not found, htools API documentation will
634
                            not be generated]))
635
fi
636

    
637
# Check for haddock
638
AC_ARG_VAR(HADDOCK, [haddock path])
639
AC_PATH_PROG(HADDOCK, [haddock], [])
640
if test -z "$HADDOCK"; then
641
  AC_MSG_WARN(m4_normalize([haddock not found, htools API documentation will
642
                            not be generated]))
643
fi
644
if test -n "$HADDOCK" && test -n "$HSCOLOUR"; then
645
  HS_APIDOC=yes
646
fi
647
AC_SUBST(HS_APIDOC)
648

    
649
# Check for hlint
650
AC_ARG_VAR(HLINT, [hlint path])
651
AC_PATH_PROG(HLINT, [hlint], [])
652
if test -z "$HLINT"; then
653
  AC_MSG_WARN([hlint not found, checking code will not be possible])
654
fi
655

    
656
if test "$HTOOLS" != yes && test "$ENABLE_CONFD" = True; then
657
  AC_MSG_ERROR(m4_normalize([cannot enable ganeti-confd if
658
                             htools support is not enabled]))
659
fi
660

    
661
AM_CONDITIONAL([WANT_HTOOLS], [test "$HTOOLS" = yes])
662
AM_CONDITIONAL([WANT_HSTESTS], [test "x$HS_NODEV" = x])
663
AM_CONDITIONAL([WANT_HSAPIDOC], [test "$HS_APIDOC" = yes])
664
AM_CONDITIONAL([HAS_HLINT], [test "$HLINT"])
665

    
666
# Check for fakeroot
667
AC_ARG_VAR(FAKEROOT_PATH, [fakeroot path])
668
AC_PATH_PROG(FAKEROOT_PATH, [fakeroot], [])
669
if test -z "$FAKEROOT_PATH"; then
670
  AC_MSG_WARN(m4_normalize([fakeroot not found, tests that must run as root
671
                            will not be executed]))
672
fi
673
AM_CONDITIONAL([HAS_FAKEROOT], [test "x$FAKEROOT_PATH" != x])
674

    
675
SOCAT_USE_ESCAPE=
676
AC_ARG_ENABLE([socat-escape],
677
  [AS_HELP_STRING([--enable-socat-escape],
678
    [use escape functionality available in socat >= 1.7 (default: detect
679
     automatically)])],
680
  [[if test "$enableval" = yes; then
681
      SOCAT_USE_ESCAPE=True
682
    else
683
      SOCAT_USE_ESCAPE=False
684
    fi
685
  ]])
686

    
687
if test -z "$SOCAT_USE_ESCAPE"
688
then
689
  if $SOCAT -hh | grep -w -q escape; then
690
    SOCAT_USE_ESCAPE=True
691
  else
692
    SOCAT_USE_ESCAPE=False
693
  fi
694
fi
695

    
696
AC_SUBST(SOCAT_USE_ESCAPE)
697

    
698
SOCAT_USE_COMPRESS=
699
AC_ARG_ENABLE([socat-compress],
700
  [AS_HELP_STRING([--enable-socat-compress],
701
    [use OpenSSL compression option available in patched socat builds
702
     (see INSTALL for details; default: detect automatically)])],
703
  [[if test "$enableval" = yes; then
704
      SOCAT_USE_COMPRESS=True
705
    else
706
      SOCAT_USE_COMPRESS=False
707
    fi
708
  ]])
709

    
710
if test -z "$SOCAT_USE_COMPRESS"
711
then
712
  if $SOCAT -hhh | grep -w -q openssl-compress; then
713
    SOCAT_USE_COMPRESS=True
714
  else
715
    SOCAT_USE_COMPRESS=False
716
  fi
717
fi
718

    
719
AC_SUBST(SOCAT_USE_COMPRESS)
720

    
721
if man --help | grep -q -e --warnings
722
then
723
  MAN_HAS_WARNINGS=1
724
else
725
  MAN_HAS_WARNINGS=
726
  AC_MSG_WARN(m4_normalize([man does not support --warnings, man page checks
727
                            will not be possible]))
728
fi
729

    
730
AC_SUBST(MAN_HAS_WARNINGS)
731

    
732
# Check for Python
733
AM_PATH_PYTHON(2.6)
734

    
735
AC_PYTHON_MODULE(OpenSSL, t)
736
AC_PYTHON_MODULE(simplejson, t)
737
AC_PYTHON_MODULE(pyparsing, t)
738
AC_PYTHON_MODULE(pyinotify, t)
739
AC_PYTHON_MODULE(pycurl, t)
740
AC_PYTHON_MODULE(bitarray, t)
741
AC_PYTHON_MODULE(ipaddr, t)
742
AC_PYTHON_MODULE(mock)
743
AC_PYTHON_MODULE(affinity)
744
AC_PYTHON_MODULE(paramiko)
745

    
746
# Development-only Python modules
747
PY_NODEV=
748
AC_PYTHON_MODULE(yaml)
749
if test $HAVE_PYMOD_YAML == "no"; then
750
  PY_NODEV="$PY_NODEV yaml"
751
fi
752

    
753
if test -n "$PY_NODEV"; then
754
  AC_MSG_WARN(m4_normalize([Required development modules ($PY_NODEV) were not
755
                            found, you won't be able to run Python unittests]))
756
else
757
  AC_MSG_NOTICE([Python development modules found, unittests enabled])
758
fi
759
AC_SUBST(PY_NODEV)
760
AM_CONDITIONAL([PY_UNIT], [test -n $PY_NODEV])
761

    
762
AC_CONFIG_FILES([ Makefile ])
763

    
764
AC_OUTPUT