jstore: Nicer error message on non-numeric file content
[ganeti-local] / configure.ac
index 75d5513..2d0cb92 100644 (file)
@@ -1,7 +1,7 @@
 # Configure script for Ganeti
 m4_define([gnt_version_major], [2])
-m4_define([gnt_version_minor], [4])
-m4_define([gnt_version_revision], [2])
+m4_define([gnt_version_minor], [6])
+m4_define([gnt_version_revision], [0])
 m4_define([gnt_version_suffix], [])
 m4_define([gnt_version_full],
           m4_format([%d.%d.%d%s],
@@ -83,21 +83,43 @@ AC_SUBST(XEN_BOOTLOADER, $xen_bootloader)
 # --with-xen-kernel=...
 AC_ARG_WITH([xen-kernel],
   [AS_HELP_STRING([--with-xen-kernel=PATH],
-    [DomU kernel image for Xen hypervisor (default is /boot/vmlinuz-2.6-xenU)]
+    [DomU kernel image for Xen hypervisor (default is /boot/vmlinuz-3-xenU)]
   )],
   [xen_kernel="$withval"],
-  [xen_kernel="/boot/vmlinuz-2.6-xenU"])
+  [xen_kernel="/boot/vmlinuz-3-xenU"])
 AC_SUBST(XEN_KERNEL, $xen_kernel)
 
 # --with-xen-initrd=...
 AC_ARG_WITH([xen-initrd],
   [AS_HELP_STRING([--with-xen-initrd=PATH],
-    [DomU initrd image for Xen hypervisor (default is /boot/initrd-2.6-xenU)]
+    [DomU initrd image for Xen hypervisor (default is /boot/initrd-3-xenU)]
   )],
   [xen_initrd="$withval"],
-  [xen_initrd="/boot/initrd-2.6-xenU"])
+  [xen_initrd="/boot/initrd-3-xenU"])
 AC_SUBST(XEN_INITRD, $xen_initrd)
 
+# --with-xen-cmd=...
+AC_ARG_WITH([xen-cmd],
+  [AS_HELP_STRING([--with-xen-cmd=CMD],
+    [Sets the xen cli interface command (default is xm)]
+  )],
+  [xen_cmd="$withval"],
+  [xen_cmd="xm"])
+AC_SUBST(XEN_CMD, $xen_cmd)
+
+if ! test "$XEN_CMD" = xl -o "$XEN_CMD" = xm; then
+  AC_MSG_ERROR([Unsupported xen command specified])
+fi
+
+# --with-kvm-kernel=...
+AC_ARG_WITH([kvm-kernel],
+  [AS_HELP_STRING([--with-kvm-kernel=PATH],
+    [Guest kernel image for KVM hypervisor (default is /boot/vmlinuz-3-kvmU)]
+  )],
+  [kvm_kernel="$withval"],
+  [kvm_kernel="/boot/vmlinuz-3-kvmU"])
+AC_SUBST(KVM_KERNEL, $kvm_kernel)
+
 # --with-file-storage-dir=...
 AC_ARG_WITH([file-storage-dir],
   [AS_HELP_STRING([--with-file-storage-dir=PATH],
@@ -147,27 +169,64 @@ AC_SUBST(KVM_PATH, $kvm_path)
 # --with-lvm-stripecount=...
 AC_ARG_WITH([lvm-stripecount],
   [AS_HELP_STRING([--with-lvm-stripecount=NUM],
-    [the number of stripes to use for LVM volumes]
+    [the default number of stripes to use for LVM volumes]
     [ (default is 1)]
   )],
   [lvm_stripecount="$withval"],
   [lvm_stripecount="1"])
 AC_SUBST(LVM_STRIPECOUNT, $lvm_stripecount)
 
+# --with-ssh-login-user=...
+AC_ARG_WITH([ssh-login-user],
+  [AS_HELP_STRING([--with-ssh-login-user=USERNAME],
+    [user to use for SSH logins within the cluster (default is root)]
+  )],
+  [ssh_login_user="$withval"],
+  [ssh_login_user=root])
+AC_SUBST(SSH_LOGIN_USER, $ssh_login_user)
+
+# --with-ssh-console-user=...
+AC_ARG_WITH([ssh-console-user],
+  [AS_HELP_STRING([--with-ssh-console-user=USERNAME],
+    [user to use for SSH logins to access instance consoles (default is root)]
+  )],
+  [ssh_console_user="$withval"],
+  [ssh_console_user=root])
+AC_SUBST(SSH_CONSOLE_USER, $ssh_console_user)
+
+# --with-default-user=...
+AC_ARG_WITH([default-user],
+  [AS_HELP_STRING([--with-default-user=USERNAME],
+    [default user for daemons]
+    [ (default is to run all daemons as root)]
+  )],
+  [user_default="$withval"],
+  [user_default=root])
+
+# --with-default-group=...
+AC_ARG_WITH([default-group],
+  [AS_HELP_STRING([--with-default-group=GROUPNAME],
+    [default group for daemons]
+    [ (default is to run all daemons under group root)]
+  )],
+  [group_default="$withval"],
+  [group_default=root])
+
 # --with-user-prefix=...
 AC_ARG_WITH([user-prefix],
   [AS_HELP_STRING([--with-user-prefix=PREFIX],
     [prefix for daemon users]
-    [ (default is to run all daemons as root)]
+    [ (default is to run all daemons as root; use --with-default-user]
+    [ to change the default)]
   )],
   [user_masterd="${withval}masterd";
    user_rapi="${withval}rapi";
    user_confd="${withval}confd";
-   user_noded="root"],
-  [user_masterd="root";
-   user_rapi="root";
-   user_confd="root";
-   user_noded="root"])
+   user_noded="$user_default"],
+  [user_masterd="$user_default";
+   user_rapi="$user_default";
+   user_confd="$user_default";
+   user_noded="$user_default"])
 AC_SUBST(MASTERD_USER, $user_masterd)
 AC_SUBST(RAPI_USER, $user_rapi)
 AC_SUBST(CONFD_USER, $user_confd)
@@ -177,20 +236,21 @@ AC_SUBST(NODED_USER, $user_noded)
 AC_ARG_WITH([group-prefix],
   [AS_HELP_STRING([--with-group-prefix=PREFIX],
     [prefix for daemon POSIX groups]
-    [ (default is to run all daemons under group root)]
+    [ (default is to run all daemons under group root; use]
+    [ --with-default-group to change the default)]
   )],
   [group_rapi="${withval}rapi";
    group_admin="${withval}admin";
    group_confd="${withval}confd";
    group_masterd="${withval}masterd";
-   group_noded="root";
+   group_noded="$group_default";
    group_daemons="${withval}daemons";],
-  [group_rapi="root";
-   group_admin="root";
-   group_confd="root";
-   group_masterd="root";
-   group_noded="root";
-   group_daemons="root"])
+  [group_rapi="$group_default";
+   group_admin="$group_default";
+   group_confd="$group_default";
+   group_masterd="$group_default";
+   group_noded="$group_default";
+   group_daemons="$group_default"])
 AC_SUBST(RAPI_GROUP, $group_rapi)
 AC_SUBST(ADMIN_GROUP, $group_admin)
 AC_SUBST(CONFD_GROUP, $group_confd)
@@ -208,15 +268,20 @@ AC_MSG_NOTICE([Group for clients is $group_admin])
 # --enable-drbd-barriers
 AC_ARG_ENABLE([drbd-barriers],
   [AS_HELP_STRING([--enable-drbd-barriers],
-    [enable the DRBD barrier functionality (>= 8.0.12) (default: enabled)])],
+    [enable by default the DRBD barriers functionality (>= 8.0.12) (default: enabled)])],
   [[if test "$enableval" != no; then
-      DRBD_BARRIERS=True
+      DRBD_BARRIERS=n
+      DRBD_NO_META_FLUSH=False
     else
-      DRBD_BARRIERS=False
+      DRBD_BARRIERS=bf
+      DRBD_NO_META_FLUSH=True
     fi
   ]],
-  [DRBD_BARRIERS=True])
+  [DRBD_BARRIERS=n
+   DRBD_NO_META_FLUSH=False
+  ])
 AC_SUBST(DRBD_BARRIERS, $DRBD_BARRIERS)
+AC_SUBST(DRBD_NO_META_FLUSH, $DRBD_NO_META_FLUSH)
 
 # --enable-syslog[=no/yes/only]
 AC_ARG_ENABLE([syslog],
@@ -261,6 +326,54 @@ AC_ARG_ENABLE([htools-rapi],
         [],
         [enable_htools_rapi=no])
 
+# --enable-confd
+ENABLE_CONFD=
+AC_ARG_ENABLE([confd],
+  [AS_HELP_STRING([--enable-confd],
+  [enable the ganeti-confd daemon (default: yes)])],
+  [[case "$enableval" in
+      no)
+        enable_confd=False
+        ;;
+      yes|haskell)
+        enable_confd=True
+        ;;
+      *)
+        echo "Invalid value for enable-confd '$enableval'"
+        exit 1
+        ;;
+    esac
+  ]],
+  [enable_confd=True])
+AC_SUBST(ENABLE_CONFD, $enable_confd)
+
+AM_CONDITIONAL([ENABLE_CONFD], [test x$enable_confd = xTrue])
+
+# --enable-split-query
+ENABLE_SPLIT_QUERY=
+AC_ARG_ENABLE([split-query],
+  [AS_HELP_STRING([--enable-split-query],
+  [enable use of custom query daemon via confd])],
+  [[case "$enableval" in
+      no)
+        enable_split_query=False
+        ;;
+      yes)
+        enable_split_query=True
+        ;;
+      *)
+        echo "Invalid value for enable-confd '$enableval'"
+        exit 1
+        ;;
+    esac
+  ]],
+  [enable_split_query=False])
+AC_SUBST(ENABLE_SPLIT_QUERY, $enable_split_query)
+
+if test x$enable_split_query = xTrue -a x$enable_confd != xTrue; then
+  AC_MSG_ERROR([Split queries require the confd daemon])
+fi
+
 # --with-disk-separator=...
 AC_ARG_WITH([disk-separator],
   [AS_HELP_STRING([--with-disk-separator=STRING],
@@ -275,6 +388,14 @@ AC_SUBST(DISK_SEPARATOR, $disk_separator)
 AC_PROG_INSTALL
 AC_PROG_LN_S
 
+# Check for the ip command
+AC_ARG_VAR(IP_PATH, [ip path])
+AC_PATH_PROG(IP_PATH, [ip], [])
+if test -z "$IP_PATH"
+then
+  AC_MSG_ERROR([ip command not found])
+fi
+
 # Check for pandoc
 AC_ARG_VAR(PANDOC, [pandoc path])
 AC_PATH_PROG(PANDOC, [pandoc], [])
@@ -309,6 +430,15 @@ then
   AC_MSG_WARN([pylint not found, checking code will not be possible])
 fi
 
+# Check for pep8
+AC_ARG_VAR(PEP8, [pep8 path])
+AC_PATH_PROG(PEP8, [pep8], [])
+if test -z "$PEP8"
+then
+  AC_MSG_WARN([pep8 not found, checking code will not be complete])
+fi
+AM_CONDITIONAL([HAS_PEP8], [test "$PEP8"])
+
 # Check for socat
 AC_ARG_VAR(SOCAT, [socat path])
 AC_PATH_PROG(SOCAT, [socat], [])
@@ -317,6 +447,14 @@ then
   AC_MSG_ERROR([socat not found])
 fi
 
+# Check for qemu-img
+AC_ARG_VAR(QEMUIMG_PATH, [qemu-img path])
+AC_PATH_PROG(QEMUIMG_PATH, [qemu-img], [])
+if test -z "$QEMUIMG_PATH"
+then
+  AC_MSG_WARN([qemu-img not found, using ovfconverter will not be possible])
+fi
+
 if test "$enable_htools" != "no"; then
 
 # Check for ghc
@@ -431,11 +569,34 @@ if test "$HADDOCK" && test "$HSCOLOUR"; then
 fi
 AC_SUBST(HTOOLS_APIDOC)
 
+# Check for hlint
+HLINT=no
+AC_ARG_VAR(HLINT, [hlint path])
+AC_PATH_PROG(HLINT, [hlint], [])
+if test -z "$HLINT"; then
+  AC_MSG_WARN([hlint not found, checking code will not be possible])
+fi
+
 fi # end if enable_htools, define automake conditions
 
+if test "$HTOOLS" != "yes" && test "$ENABLE_CONFD" = "True"; then
+   AC_MSG_ERROR(m4_normalize([cannot enable ganeti-confd if
+                              htools support is not enabled]))
+fi
+
 AM_CONDITIONAL([WANT_HTOOLS], [test x$HTOOLS = xyes])
-AM_CONDITIONAL([WANT_HTOOLSTESTS], [test x$GHC_PKG_QUICKCHECK != x])
+AM_CONDITIONAL([WANT_HTOOLSTESTS], [test "x$GHC_PKG_QUICKCHECK" != x])
 AM_CONDITIONAL([WANT_HTOOLSAPIDOC], [test x$HTOOLS_APIDOC = xyes])
+AM_CONDITIONAL([HAS_HLINT], [test "$HLINT"])
+
+# Check for fakeroot
+AC_ARG_VAR(FAKEROOT_PATH, [fakeroot path])
+AC_PATH_PROG(FAKEROOT_PATH, [fakeroot], [])
+if test -z "$FAKEROOT_PATH"; then
+  AC_MSG_WARN(m4_normalize([fakeroot not found, tests that must run as root
+                            will not be executed]))
+fi
+AM_CONDITIONAL([HAS_FAKEROOT], [test "x$FAKEROOT_PATH" != x])
 
 SOCAT_USE_ESCAPE=
 AC_ARG_ENABLE([socat-escape],
@@ -502,6 +663,7 @@ AC_PYTHON_MODULE(simplejson, t)
 AC_PYTHON_MODULE(pyparsing, t)
 AC_PYTHON_MODULE(pyinotify, t)
 AC_PYTHON_MODULE(pycurl, t)
+AC_PYTHON_MODULE(affinity)
 
 # This is optional but then we've limited functionality
 AC_PYTHON_MODULE(paramiko)