2 AC_INIT(snf-image, 0.9, synnefo@googlegroups.com)
4 AC_CONFIG_AUX_DIR(autotools)
5 AC_CONFIG_SRCDIR(configure)
7 AM_INIT_AUTOMAKE([1.9 foreign tar-ustar -Wall -Wno-portability])
8 AM_INIT_AUTOMAKE([subdir-objects])
10 # --enable-version-consistency-ckeck
11 AC_ARG_ENABLE([version_consistency_check],
12 AS_HELP_STRING([--enable-version-consistency-check],
13 [Check if the host and the helper packages have the same version]),
14 version_check="$enableval", version_check="no"
16 if test ${version_check} = yes; then
17 AC_SUBST(VERSION_CHECK, yes)
20 # --with-progress-monitor
21 AC_ARG_WITH([progress-monitor],
22 [AS_HELP_STRING([--with-progress-monitor=PRGRM],
23 [name of the progress-monitor program []])],
24 [if test "$withval" != "yes" -a "$withval" != "no"; then
25 AC_PATH_PROG(PROGRESS_MONITOR, ["$withval"], [], [$PATH:/usr/sbin:/sbin])
26 if test -z "$PROGRESS_MONITOR" ; then
27 AC_MSG_FAILURE([Could not find progress-monitor: $withval.])
29 elif test "$withval" != "no"; then
30 AC_MSG_ERROR([you must specify a value for progress-monitor if --with-progress-monitor is specified])
34 # --with-unattend-file
35 AC_ARG_WITH([unattend-file],
36 [AS_HELP_STRING([--with-unattend-file=UNATTEND_PATH],
37 [path to unattend.xml windows setup file []])],
38 [if test "$withval" != "yes" -a "$withval" != "no"; then
39 AC_SUBST(UNATTEND, "$withval")
40 AC_MSG_NOTICE(using unattend file: $withval)
41 elif test "$withval" != "no"; then
42 AC_MSG_ERROR([you must specify an Unattend.xml file if --with-unattend-file is specified])
46 # --with-multistrap-config
47 AC_ARG_WITH([multistrap-config],
48 [AS_HELP_STRING([--with-multistrap-config=MULTISTRAP_CONFIG_PATH],
49 [path to a multistrap configuration file
50 [SYSCONFDIR/snf-image/multistrap.conf]]
52 [if test "$withval" != "yes" -a "$withval" != "no"; then
53 multistrap_config="$withval"
54 AC_MSG_NOTICE(using multistrap configuration file: $withval)
55 elif test "$withval" != "no"; then
56 AC_MSG_ERROR([you must specify an configuration file if --with-multistrap-config is specified])
58 [multistrap_config="$sysconfdir/snf-image/multistrap.conf"]
60 AC_SUBST(MULTISTRAP_CONFIG, $multistrap_config)
62 # --with-multistrap-aptprefdir
63 AC_ARG_WITH([multistrap-aptprefdir],
64 [AS_HELP_STRING([--with-multistrap-aptprefdir=MULTISTRAP_APTPREFDIR],
65 [path to a directory where preferences files for apt are hosted. Those files will be used during multistrap
66 [SYSCONFDIR/snf-image/apt.pref.d]]
68 [if test "$withval" != "yes" -a "$withval" != "no"; then
69 multistrap_aptprefdir="$withval"
70 AC_MSG_NOTICE(using apt preferences directory for multistrap: $withval)
71 elif test "$withval" != "no"; then
72 AC_MSG_ERROR([you must specify a directory if --with-multistrap-aptprefdir is specified])
74 [multistrap_aptprefdir="$sysconfdir/snf-image/apt.pref.d"]
76 AC_SUBST(MULTISTRAP_APTPREFDIR, $multistrap_aptprefdir)
79 AC_ARG_WITH([helper-dir],
80 [AS_HELP_STRING([--with-helper-dir=DIR],
81 [top-level directory to host the helper VM
82 [LOCALSTATEDIR/lib/snf-image/helper]]
84 [helper_dir="$withval"],
85 [helper_dir="$localstatedir/lib/snf-image/helper"])
86 AC_SUBST(HELPER_DIR, $helper_dir)
90 [AS_HELP_STRING([--with-os-dir=DIR],
91 [top-level OS directory under which to install [DATADIR/ganeti/os]]
94 [os_dir="$datadir/ganeti/os"])
95 AC_SUBST(OS_DIR, $os_dir)
97 # --with-default-dir=...
98 AC_ARG_WITH([default-dir],
99 [AS_HELP_STRING([--with-default-dir=DIR],
100 [top-level default config directory under which to install]
101 [ [SYSCONFDIR/default]]
103 [default_dir="$withval"],
104 [default_dir="$sysconfdir/default"])
105 AC_SUBST(DEFAULT_DIR, $default_dir)
107 # Check common programs
113 AC_PATH_PROG(LOSETUP, [losetup], [], [$PATH:/usr/sbin:/sbin])
114 if test -z "$LOSETUP" ; then
115 AC_MSG_ERROR([losetup not found in $PATH:/usr/sbin:/sbin])
118 AC_PATH_PROG(KPARTX, [kpartx], [], [$PATH:/usr/sbin:/sbin])
119 if test -z "$KPARTX" ; then
120 AC_MSG_ERROR([kpartx not found in $PATH:/usr/sbin:/sbin])
123 AC_PATH_PROG(SFDISK, [sfdisk], [], [$PATH:/usr/sbin:/sbin])
124 if test -z "$SFDISK" ; then
125 AC_MSG_ERROR([sfdisk not found in $PATH:/usr/sbin:/sbin])
128 AC_PATH_PROG(QEMU_IMG, [qemu-img], [], [$PATH:/usr/sbin:/sbin])
129 if test -z "$QEMU_IMG" ; then
130 AC_MSG_ERROR([qemu-img not found in $PATH:/usr/sbin:/sbin])
133 AC_PATH_PROG(INSTALL_MBR, [install-mbr], [], [$PATH:/usr/sbin:/sbin])
134 if test -z "$INSTALL_MBR" ; then
135 AC_MSG_ERROR([install-mbr not found in $PATH:/usr/sbin:/sbin])
138 AC_PATH_PROG(TIMEOUT, [timeout], [], [$PATH:/usr/sbin:/sbin])
139 if test -z "$TIMEOUT" ; then
140 AC_MSG_ERROR([timeout not found in $PATH:/usr/sbin:/sbin])
143 AC_PATH_PROG(CURL, [curl], [], [$PATH:/usr/sbin:/sbin])
144 if test -z "$CURL" ; then
145 AC_MSG_ERROR([curl not found in $PATH:/usr/sbin:/sbin])
154 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :