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])
13 # --enable-version-consistency-ckeck
14 AC_ARG_ENABLE([version_consistency_check],
15 AS_HELP_STRING([--enable-version-consistency-check],
16 [Check if the host and the helper packages have the same version]),
17 version_check="$enableval", version_check="no"
19 if test ${version_check} = yes; then
20 AC_SUBST(VERSION_CHECK, yes)
24 AC_ARG_WITH([helper-url],
25 [AS_HELP_STRING([--with-helper-url=URL],
26 [url to download the helper image from [http://cdn.synnefo.org/snf_image_helper_image-PROG_VERSION.tar.xz]])],
27 [helper_url="$withval"],
28 [helper_url="http://cdn.synnefo.org/snf_image_helper_image-$VERSION.tar.xz"]
31 AC_SUBST(HELPER_URL, $helper_url)
33 # --with-progress-monitor
34 AC_ARG_WITH([progress-monitor],
35 [AS_HELP_STRING([--with-progress-monitor=PRGRM],
36 [name of the progress-monitor program []])],
37 [if test "$withval" != "yes" -a "$withval" != "no"; then
38 AC_PATH_PROG(PROGRESS_MONITOR, ["$withval"], [], [$PATH:/usr/sbin:/sbin])
39 if test -z "$PROGRESS_MONITOR" ; then
40 AC_MSG_FAILURE([Could not find progress-monitor: $withval.])
42 elif test "$withval" != "no"; then
43 AC_MSG_ERROR([you must specify a value for progress-monitor if --with-progress-monitor is specified])
47 # --with-unattend-file
48 AC_ARG_WITH([unattend-file],
49 [AS_HELP_STRING([--with-unattend-file=UNATTEND_PATH],
50 [path to unattend.xml windows setup file []])],
51 [if test "$withval" != "yes" -a "$withval" != "no"; then
52 AC_SUBST(UNATTEND, "$withval")
53 AC_MSG_NOTICE(using unattend file: $withval)
54 elif test "$withval" != "no"; then
55 AC_MSG_ERROR([you must specify an Unattend.xml file if --with-unattend-file is specified])
59 # --with-multistrap-config
60 AC_ARG_WITH([multistrap-config],
61 [AS_HELP_STRING([--with-multistrap-config=MULTISTRAP_CONFIG_PATH],
62 [path to a multistrap configuration file
63 [SYSCONFDIR/snf-image/multistrap.conf]]
65 [if test "$withval" != "yes" -a "$withval" != "no"; then
66 multistrap_config="$withval"
67 AC_MSG_NOTICE(using multistrap configuration file: $withval)
68 elif test "$withval" != "no"; then
69 AC_MSG_ERROR([you must specify an configuration file if --with-multistrap-config is specified])
71 [multistrap_config="$sysconfdir/snf-image/multistrap.conf"]
73 AC_SUBST(MULTISTRAP_CONFIG, $multistrap_config)
75 # --with-multistrap-aptprefdir
76 AC_ARG_WITH([multistrap-aptprefdir],
77 [AS_HELP_STRING([--with-multistrap-aptprefdir=MULTISTRAP_APTPREFDIR],
78 [path to a directory where preferences files for apt are hosted. Those files will be used during multistrap
79 [SYSCONFDIR/snf-image/apt.pref.d]]
81 [if test "$withval" != "yes" -a "$withval" != "no"; then
82 multistrap_aptprefdir="$withval"
83 AC_MSG_NOTICE(using apt preferences directory for multistrap: $withval)
84 elif test "$withval" != "no"; then
85 AC_MSG_ERROR([you must specify a directory if --with-multistrap-aptprefdir is specified])
87 [multistrap_aptprefdir="$sysconfdir/snf-image/apt.pref.d"]
89 AC_SUBST(MULTISTRAP_APTPREFDIR, $multistrap_aptprefdir)
92 AC_ARG_WITH([helper-dir],
93 [AS_HELP_STRING([--with-helper-dir=DIR],
94 [top-level directory to host the helper VM
95 [LOCALSTATEDIR/lib/snf-image/helper]]
97 [helper_dir="$withval"],
98 [helper_dir="$localstatedir/lib/snf-image/helper"])
99 AC_SUBST(HELPER_DIR, $helper_dir)
102 AC_ARG_WITH([os-dir],
103 [AS_HELP_STRING([--with-os-dir=DIR],
104 [top-level OS directory under which to install [DATADIR/ganeti/os]]
107 [os_dir="$datadir/ganeti/os"])
108 AC_SUBST(OS_DIR, $os_dir)
110 # --with-default-dir=...
111 AC_ARG_WITH([default-dir],
112 [AS_HELP_STRING([--with-default-dir=DIR],
113 [top-level default config directory under which to install]
114 [ [SYSCONFDIR/default]]
116 [default_dir="$withval"],
117 [default_dir="$sysconfdir/default"])
118 AC_SUBST(DEFAULT_DIR, $default_dir)
120 # Check common programs
126 AC_PATH_PROG(LOSETUP, [losetup], [], [$PATH:/usr/sbin:/sbin])
127 if test -z "$LOSETUP" ; then
128 AC_MSG_ERROR([losetup not found in $PATH:/usr/sbin:/sbin])
131 AC_PATH_PROG(KPARTX, [kpartx], [], [$PATH:/usr/sbin:/sbin])
132 if test -z "$KPARTX" ; then
133 AC_MSG_ERROR([kpartx not found in $PATH:/usr/sbin:/sbin])
136 AC_PATH_PROG(SFDISK, [sfdisk], [], [$PATH:/usr/sbin:/sbin])
137 if test -z "$SFDISK" ; then
138 AC_MSG_ERROR([sfdisk not found in $PATH:/usr/sbin:/sbin])
141 AC_PATH_PROG(QEMU_IMG, [qemu-img], [], [$PATH:/usr/sbin:/sbin])
142 if test -z "$QEMU_IMG" ; then
143 AC_MSG_ERROR([qemu-img not found in $PATH:/usr/sbin:/sbin])
146 AC_PATH_PROG(INSTALL_MBR, [install-mbr], [], [$PATH:/usr/sbin:/sbin])
147 if test -z "$INSTALL_MBR" ; then
148 AC_MSG_ERROR([install-mbr not found in $PATH:/usr/sbin:/sbin])
151 AC_PATH_PROG(TIMEOUT, [timeout], [], [$PATH:/usr/sbin:/sbin])
152 if test -z "$TIMEOUT" ; then
153 AC_MSG_ERROR([timeout not found in $PATH:/usr/sbin:/sbin])
156 AC_PATH_PROG(CURL, [curl], [], [$PATH:/usr/sbin:/sbin])
157 if test -z "$CURL" ; then
158 AC_MSG_ERROR([curl not found in $PATH:/usr/sbin:/sbin])
164 AC_PYTHON_MODULE(prctl, t)
165 AC_PYTHON_MODULE(scapy, t)
173 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :