2 AC_INIT(snf-image, 0.7, synnefo@lists.grnet.gr)
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 AC_ARG_ENABLE([network_backend],
11 AS_HELP_STRING([--enable-network-backend],
12 [enable support for network-hosted images
13 (this depends on cURL)])
17 AC_ARG_ENABLE([version_consistency_check],
18 AS_HELP_STRING([--enable-version-consistency-check],
19 [Check if the host and the helper packages have the same version]),
20 version_check="$enableval", version_check="no"
22 if test ${version_check} = yes; then
23 AC_SUBST(VERSION_CHECK, yes)
26 # --with-progress-monitor
27 AC_ARG_WITH([progress-monitor],
28 [AS_HELP_STRING([--with-progress-monitor=PRGRM],
29 [name of the progress-monitor program []])],
30 [if test "$withval" != "yes" -a "$withval" != "no"; then
31 AC_PATH_PROG(PROGRESS_MONITOR, ["$withval"], [], [$PATH:/usr/sbin:/sbin])
32 if test -z "$PROGRESS_MONITOR" ; then
33 AC_MSG_FAILURE([Could not find progress-monitor: $withval.])
35 elif test "$withval" != "no"; then
36 AC_MSG_ERROR([you must specify a value for progress-monitor if --with-progress-monitor is specified])
40 # --with-unattend-file
41 AC_ARG_WITH([unattend-file],
42 [AS_HELP_STRING([--with-unattend-file=UNATTEND_PATH],
43 [path to unattend.xml windows setup file []])],
44 [if test "$withval" != "yes" -a "$withval" != "no"; then
45 AC_SUBST(UNATTEND, "$withval")
46 AC_MSG_NOTICE(using unattend file: $withval)
47 elif test "$withval" != "no"; then
48 AC_MSG_ERROR([you must specify an Unattend.xml file if --with-unattend-file is specified])
52 # --with-multistrap-config
53 AC_ARG_WITH([multistrap-config],
54 [AS_HELP_STRING([--with-multistrap-config=MULTISTRAP_CONFIG_PATH],
55 [path to a multistrap configuration file
56 [SYSCONFDIR/snf-image/multistrap.conf]]
58 [if test "$withval" != "yes" -a "$withval" != "no"; then
59 multistrap_config="$withval"
60 AC_MSG_NOTICE(using multistrap configuration file: $withval)
61 elif test "$withval" != "no"; then
62 AC_MSG_ERROR([you must specify an configuration file if --with-multistrap-config is specified])
64 [multistrap_config="$sysconfdir/snf-image/multistrap.conf"]
66 AC_SUBST(MULTISTRAP_CONFIG, $multistrap_config)
68 # --with-multistrap-aptprefdir
69 AC_ARG_WITH([multistrap-aptprefdir],
70 [AS_HELP_STRING([--with-multistrap-aptprefdir=MULTISTRAP_APTPREFDIR],
71 [path to a directory where preferences files for apt are hosted. Those files will be used during multistrap
72 [SYSCONFDIR/snf-image/apt.pref.d]]
74 [if test "$withval" != "yes" -a "$withval" != "no"; then
75 multistrap_aptprefdir="$withval"
76 AC_MSG_NOTICE(using apt preferences directory for multistrap: $withval)
77 elif test "$withval" != "no"; then
78 AC_MSG_ERROR([you must specify a directory if --with-multistrap-aptprefdir is specified])
80 [multistrap_aptprefdir="$sysconfdir/snf-image/apt.pref.d"]
82 AC_SUBST(MULTISTRAP_APTPREFDIR, $multistrap_aptprefdir)
85 AC_ARG_WITH([helper-dir],
86 [AS_HELP_STRING([--with-helper-dir=DIR],
87 [top-level directory to host the helper VM
88 [LOCALSTATEDIR/lib/snf-image/helper]]
90 [helper_dir="$withval"],
91 [helper_dir="$localstatedir/lib/snf-image/helper"])
92 AC_SUBST(HELPER_DIR, $helper_dir)
95 AC_ARG_WITH([helper-img],
96 [AS_HELP_STRING([--with-helper-img=IMG_PATH],
97 [Path to helper VM image [HELPERDIR/image]]
99 [helper_img="$withval"],
100 [helper_img="$helper_dir/image"])
101 AC_SUBST(HELPER_IMG, $helper_img)
103 # --with-helper-kernel
104 AC_ARG_WITH([helper-kernel],
105 [AS_HELP_STRING([--with-helper-kernel=KERNEL_PATH],
106 [Path to the helper VM kernel [HELPERDIR/kernel]]
108 [helper_ernel="$withval"],
109 [helper_kernel="$helper_dir/kernel"])
110 AC_SUBST(HELPER_KERNEL, ${helper_kernel})
112 # --with-helper-initrd..
113 AC_ARG_WITH([helper-initrd],
114 [AS_HELP_STRING([--with-helper-initrd=INITRD_PATH],
115 [Path to the helper VM initial ramdist [HELPERDIR/initrd]]
117 [helper_initrd="$withval"],
118 [helper_initrd="$helper_dir/initrd"])
119 AC_SUBST(HELPER_INITRD, ${helper_initrd})
122 AC_ARG_WITH([os-dir],
123 [AS_HELP_STRING([--with-os-dir=DIR],
124 [top-level OS directory under which to install [DATADIR/ganeti/os]]
127 [os_dir="$datadir/ganeti/os"])
128 AC_SUBST(OS_DIR, $os_dir)
130 # --with-default-dir=...
131 AC_ARG_WITH([default-dir],
132 [AS_HELP_STRING([--with-default-dir=DIR],
133 [top-level default config directory under which to install]
134 [ [SYSCONFDIR/default]]
136 [default_dir="$withval"],
137 [default_dir="$sysconfdir/default"])
138 AC_SUBST(DEFAULT_DIR, $default_dir)
140 # Check common programs
146 AC_PATH_PROG(LOSETUP, [losetup], [], [$PATH:/usr/sbin:/sbin])
147 if test -z "$LOSETUP" ; then
148 AC_MSG_ERROR([losetup not found in $PATH:/usr/sbin:/sbin])
151 AC_PATH_PROG(KPARTX, [kpartx], [], [$PATH:/usr/sbin:/sbin])
152 if test -z "$KPARTX" ; then
153 AC_MSG_ERROR([kpartx not found in $PATH:/usr/sbin:/sbin])
156 AC_PATH_PROG(SFDISK, [sfdisk], [], [$PATH:/usr/sbin:/sbin])
157 if test -z "$SFDISK" ; then
158 AC_MSG_ERROR([sfdisk not found in $PATH:/usr/sbin:/sbin])
161 AC_PATH_PROG(QEMU_IMG, [qemu-img], [], [$PATH:/usr/sbin:/sbin])
162 if test -z "$QEMU_IMG" ; then
163 AC_MSG_ERROR([qemu-img not found in $PATH:/usr/sbin:/sbin])
166 AC_PATH_PROG(INSTALL_MBR, [install-mbr], [], [$PATH:/usr/sbin:/sbin])
167 if test -z "$INSTALL_MBR" ; then
168 AC_MSG_ERROR([install-mbr not found in $PATH:/usr/sbin:/sbin])
171 AC_PATH_PROG(TIMEOUT, [timeout], [], [$PATH:/usr/sbin:/sbin])
172 if test -z "$TIMEOUT" ; then
173 AC_MSG_ERROR([timeout not found in $PATH:/usr/sbin:/sbin])
176 AC_PATH_PROG(CURL, [curl], [], [$PATH:/usr/sbin:/sbin])
177 if test -z "$CURL" ; then
178 AC_MSG_ERROR([curl not found in $PATH:/usr/sbin:/sbin])
187 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :