2 AC_INIT(snf-image, 0.4, 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)])
15 AS_IF([test "x$enable_network_backend" = "xyes"],,
16 [AC_MSG_NOTICE(network backend support not enabled)])
17 AM_CONDITIONAL(NETWORKIMGSUPPORT, [test "x$enable_network_backend" = "xyes"])
19 # --with-progress-monitor
20 AC_ARG_WITH([progress-monitor],
21 [AS_HELP_STRING([--with-progress-monitor=PRGRM],
22 [name of the progress-monitor program []])],
23 [if test "$withval" != "yes" -a "$withval" != "no"; then
24 AC_PATH_PROG(PROGRESS_MONITOR, ["$withval"], [], [$PATH:/usr/sbin:/sbin])
25 if test -z "$PROGRESS_MONITOR" ; then
26 AC_MSG_FAILURE([Could not find progress-monitor: $withval.])
28 elif test "$withval" != "no"; then
29 AC_MSG_ERROR([you must specify a value for progress-monitor if --with-progress-monitor is specified])
33 # --with-unattend-file
34 AC_ARG_WITH([unattend-file],
35 [AS_HELP_STRING([--with-unattend-file=UNATTEND_PATH],
36 [path to unattend.xml windows setup file []])],
37 [if test "$withval" != "yes" -a "$withval" != "no"; then
38 AC_SUBST(UNATTEND, "$withval")
39 AC_MSG_NOTICE(using unattend file: $withval)
40 elif test "$withval" != "no"; then
41 AC_MSG_ERROR([you must specify an Unattend.xml file if --with-unattend-file is specified])
47 AC_ARG_WITH([helper-dir],
48 [AS_HELP_STRING([--with-helper-dir=DIR],
49 [top-level directory to host the helper VM
50 [LOCALSTATEDIR/lib/snf-image/helper]]
52 [helper_dir="$withval"],
53 [helper_dir="$localstatedir/lib/snf-image/helper"])
54 AC_SUBST(HELPER_DIR, $helper_dir)
57 AC_ARG_WITH([helper-img],
58 [AS_HELP_STRING([--with-helper-img=IMG_PATH],
59 [Path to helper VM image [HELPERDIR/image]]
61 [helper_img="$withval"],
62 [helper_img="$helper_dir/image"])
63 AC_SUBST(HELPER_IMG, $helper_img)
65 # --with-helper-kernel
66 AC_ARG_WITH([helper-kernel],
67 [AS_HELP_STRING([--with-helper-kernel=KERNEL_PATH],
68 [Path to the helper VM kernel [HELPERDIR/kernel]]
70 [helper_ernel="$withval"],
71 [helper_kernel="$helper_dir/kernel"])
72 AC_SUBST(HELPER_KERNEL, ${helper_kernel})
74 # --with-helper-initrd..
75 AC_ARG_WITH([helper-initrd],
76 [AS_HELP_STRING([--with-helper-initrd=INITRD_PATH],
77 [Path to the helper VM initial ramdist [HELPERDIR/initrd]]
79 [helper_initrd="$withval"],
80 [helper_initrd="$helper_dir/initrd"])
81 AC_SUBST(HELPER_INITRD, ${helper_initrd})
85 [AS_HELP_STRING([--with-os-dir=DIR],
86 [top-level OS directory under which to install [DATADIR/ganeti/os]]
89 [os_dir="$datadir/ganeti/os"])
90 AC_SUBST(OS_DIR, $os_dir)
92 # --with-default-dir=...
93 AC_ARG_WITH([default-dir],
94 [AS_HELP_STRING([--with-default-dir=DIR],
95 [top-level default config directory under which to install]
96 [ [SYSCONFDIR/default]]
98 [default_dir="$withval"],
99 [default_dir="$sysconfdir/default"])
100 AC_SUBST(DEFAULT_DIR, $default_dir)
102 # Check common programs
108 AC_PATH_PROG(LOSETUP, [losetup], [], [$PATH:/usr/sbin:/sbin])
109 if test -z "$LOSETUP" ; then
110 AC_MSG_ERROR([losetup not found in $PATH:/usr/sbin:/sbin])
113 AC_PATH_PROG(KPARTX, [kpartx], [], [$PATH:/usr/sbin:/sbin])
114 if test -z "$KPARTX" ; then
115 AC_MSG_ERROR([kpartx not found in $PATH:/usr/sbin:/sbin])
118 AC_PATH_PROG(SFDISK, [sfdisk], [], [$PATH:/usr/sbin:/sbin])
119 if test -z "$SFDISK" ; then
120 AC_MSG_ERROR([sfdisk not found in $PATH:/usr/sbin:/sbin])
123 AC_PATH_PROG(QEMU_IMG, [qemu-img], [], [$PATH:/usr/sbin:/sbin])
124 if test -z "$QEMU_IMG" ; then
125 AC_MSG_ERROR([qemu-img not found in $PATH:/usr/sbin:/sbin])
128 AC_PATH_PROG(INSTALL_MBR, [install-mbr], [], [$PATH:/usr/sbin:/sbin])
129 if test -z "$INSTALL_MBR" ; then
130 AC_MSG_ERROR([install-mbr not found in $PATH:/usr/sbin:/sbin])
133 AC_PATH_PROG(TIMEOUT, [timeout], [], [$PATH:/usr/sbin:/sbin])
134 if test -z "$TIMEOUT" ; then
135 AC_MSG_ERROR([timeout not found in $PATH:/usr/sbin:/sbin])
138 if test "x$enable_network_backend" = "xyes" ; then
139 AC_PATH_PROG(CURL, [curl], [], [$PATH:/usr/sbin:/sbin])
140 if test -z "$CURL" ; then
141 AC_MSG_ERROR([curl is needed for network backend support but was not \
142 found in $PATH:/usr/sbin:/sbin]
143 [To disable network backend support ommit --enable-network-backend])
153 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :