2 m4_include([../version.m4])
3 AC_INIT(snf-image, devflow_version, synnefo@googlegroups.com)
4 AC_DEFINE_UNQUOTED(VERSION, "$devflow_version")
6 AC_CONFIG_AUX_DIR(autotools)
7 AC_CONFIG_SRCDIR(configure)
9 AM_INIT_AUTOMAKE([1.9 foreign tar-ustar -Wall -Wno-portability])
10 AM_INIT_AUTOMAKE([subdir-objects])
12 # --enable-version-consistency-ckeck
13 AC_ARG_ENABLE([version_consistency_check],
14 AS_HELP_STRING([--enable-version-consistency-check],
15 [Check if the host and the helper packages have the same version]),
16 version_check="$enableval", version_check="no"
18 if test ${version_check} = yes; then
19 AC_SUBST(VERSION_CHECK, yes)
23 AC_ARG_WITH([helper-url],
24 [AS_HELP_STRING([--with-helper-url=URL],
25 [url to download the helper image from [http://cdn.synnefo.org/snf_image_helper_image-PROG_VERSION.tar.xz]])],
26 [helper_url="$withval"],
27 [helper_url="http://cdn.synnefo.org/snf_image_helper_image-$VERSION.tar.xz"]
30 AC_SUBST(HELPER_URL, $helper_url)
32 # --with-progress-monitor
33 AC_ARG_WITH([progress-monitor],
34 [AS_HELP_STRING([--with-progress-monitor=PRGRM],
35 [name of the progress-monitor program []])],
36 [if test "$withval" != "yes" -a "$withval" != "no"; then
37 AC_PATH_PROG(PROGRESS_MONITOR, ["$withval"], [], [$PATH:/usr/sbin:/sbin])
38 if test -z "$PROGRESS_MONITOR" ; then
39 AC_MSG_FAILURE([Could not find progress-monitor: $withval.])
41 elif test "$withval" != "no"; then
42 AC_MSG_ERROR([you must specify a value for progress-monitor if --with-progress-monitor is specified])
46 # --with-unattend-file
47 AC_ARG_WITH([unattend-file],
48 [AS_HELP_STRING([--with-unattend-file=UNATTEND_PATH],
49 [path to unattend.xml windows setup file []])],
50 [if test "$withval" != "yes" -a "$withval" != "no"; then
51 AC_SUBST(UNATTEND, "$withval")
52 AC_MSG_NOTICE(using unattend file: $withval)
53 elif test "$withval" != "no"; then
54 AC_MSG_ERROR([you must specify an Unattend.xml file if --with-unattend-file is specified])
58 # --with-multistrap-config
59 AC_ARG_WITH([multistrap-config],
60 [AS_HELP_STRING([--with-multistrap-config=MULTISTRAP_CONFIG_PATH],
61 [path to a multistrap configuration file
62 [SYSCONFDIR/snf-image/multistrap.conf]]
64 [if test "$withval" != "yes" -a "$withval" != "no"; then
65 multistrap_config="$withval"
66 AC_MSG_NOTICE(using multistrap configuration file: $withval)
67 elif test "$withval" != "no"; then
68 AC_MSG_ERROR([you must specify an configuration file if --with-multistrap-config is specified])
70 [multistrap_config="$sysconfdir/snf-image/multistrap.conf"]
72 AC_SUBST(MULTISTRAP_CONFIG, $multistrap_config)
74 # --with-multistrap-aptprefdir
75 AC_ARG_WITH([multistrap-aptprefdir],
76 [AS_HELP_STRING([--with-multistrap-aptprefdir=MULTISTRAP_APTPREFDIR],
77 [path to a directory where preferences files for apt are hosted. Those files will be used during multistrap
78 [SYSCONFDIR/snf-image/apt.pref.d]]
80 [if test "$withval" != "yes" -a "$withval" != "no"; then
81 multistrap_aptprefdir="$withval"
82 AC_MSG_NOTICE(using apt preferences directory for multistrap: $withval)
83 elif test "$withval" != "no"; then
84 AC_MSG_ERROR([you must specify a directory if --with-multistrap-aptprefdir is specified])
86 [multistrap_aptprefdir="$sysconfdir/snf-image/apt.pref.d"]
88 AC_SUBST(MULTISTRAP_APTPREFDIR, $multistrap_aptprefdir)
91 AC_ARG_WITH([helper-dir],
92 [AS_HELP_STRING([--with-helper-dir=DIR],
93 [top-level directory to host the helper VM
94 [LOCALSTATEDIR/lib/snf-image/helper]]
96 [helper_dir="$withval"],
97 [helper_dir="$localstatedir/lib/snf-image/helper"])
98 AC_SUBST(HELPER_DIR, $helper_dir)
101 AC_ARG_WITH([os-dir],
102 [AS_HELP_STRING([--with-os-dir=DIR],
103 [top-level OS directory under which to install [DATADIR/ganeti/os]]
106 [os_dir="$datadir/ganeti/os"])
107 AC_SUBST(OS_DIR, $os_dir)
109 # --with-default-dir=...
110 AC_ARG_WITH([default-dir],
111 [AS_HELP_STRING([--with-default-dir=DIR],
112 [top-level default config directory under which to install]
113 [ [SYSCONFDIR/default]]
115 [default_dir="$withval"],
116 [default_dir="$sysconfdir/default"])
117 AC_SUBST(DEFAULT_DIR, $default_dir)
119 # Check common programs
125 AC_PATH_PROG(LOSETUP, [losetup], [], [$PATH:/usr/sbin:/sbin])
126 if test -z "$LOSETUP" ; then
127 AC_MSG_ERROR([losetup not found in $PATH:/usr/sbin:/sbin])
130 AC_PATH_PROG(KPARTX, [kpartx], [], [$PATH:/usr/sbin:/sbin])
131 if test -z "$KPARTX" ; then
132 AC_MSG_ERROR([kpartx not found in $PATH:/usr/sbin:/sbin])
135 AC_PATH_PROG(SFDISK, [sfdisk], [], [$PATH:/usr/sbin:/sbin])
136 if test -z "$SFDISK" ; then
137 AC_MSG_ERROR([sfdisk not found in $PATH:/usr/sbin:/sbin])
140 AC_PATH_PROG(QEMU_IMG, [qemu-img], [], [$PATH:/usr/sbin:/sbin])
141 if test -z "$QEMU_IMG" ; then
142 AC_MSG_ERROR([qemu-img not found in $PATH:/usr/sbin:/sbin])
145 AC_PATH_PROG(INSTALL_MBR, [install-mbr], [], [$PATH:/usr/sbin:/sbin])
146 if test -z "$INSTALL_MBR" ; then
147 AC_MSG_ERROR([install-mbr not found in $PATH:/usr/sbin:/sbin])
150 AC_PATH_PROG(TIMEOUT, [timeout], [], [$PATH:/usr/sbin:/sbin])
151 if test -z "$TIMEOUT" ; then
152 AC_MSG_ERROR([timeout not found in $PATH:/usr/sbin:/sbin])
155 AC_PATH_PROG(CURL, [curl], [], [$PATH:/usr/sbin:/sbin])
156 if test -z "$CURL" ; then
157 AC_MSG_ERROR([curl not found in $PATH:/usr/sbin:/sbin])
166 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :