root / snf-image-host / configure.ac @ 5fc02e52
History | View | Annotate | Download (4.7 kB)
1 |
AC_PREREQ(2.59) |
---|---|
2 |
AC_INIT(snf-image, 0.4, synnefo@lists.grnet.gr) |
3 |
|
4 |
AC_CONFIG_AUX_DIR(autotools) |
5 |
AC_CONFIG_SRCDIR(configure) |
6 |
|
7 |
AM_INIT_AUTOMAKE([1.9 foreign tar-ustar -Wall -Wno-portability]) |
8 |
AM_INIT_AUTOMAKE([subdir-objects]) |
9 |
|
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)]) |
14 |
) |
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"]) |
18 |
|
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.]) |
27 |
fi |
28 |
elif test "$withval" != "no"; then |
29 |
AC_MSG_ERROR([you must specify a value for progress-monitor if --with-progress-monitor is specified]) |
30 |
fi] |
31 |
) |
32 |
|
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]) |
42 |
fi] |
43 |
) |
44 |
|
45 |
|
46 |
# --with-helper-dir |
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]] |
51 |
)], |
52 |
[helper_dir="$withval"], |
53 |
[helper_dir="$localstatedir/lib/snf-image/helper"]) |
54 |
AC_SUBST(HELPER_DIR, $helper_dir) |
55 |
|
56 |
# --with-helper-img |
57 |
AC_ARG_WITH([helper-img], |
58 |
[AS_HELP_STRING([--with-helper-img=IMG_PATH], |
59 |
[Path to helper VM image [HELPERDIR/image]] |
60 |
)], |
61 |
[helper_img="$withval"], |
62 |
[helper_img="$helper_dir/image"]) |
63 |
AC_SUBST(HELPER_IMG, $helper_img) |
64 |
|
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]] |
69 |
)], |
70 |
[helper_ernel="$withval"], |
71 |
[helper_kernel="$helper_dir/kernel"]) |
72 |
AC_SUBST(HELPER_KERNEL, ${helper_kernel}) |
73 |
|
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]] |
78 |
)], |
79 |
[helper_initrd="$withval"], |
80 |
[helper_initrd="$helper_dir/initrd"]) |
81 |
AC_SUBST(HELPER_INITRD, ${helper_initrd}) |
82 |
|
83 |
# --with-os-dir=... |
84 |
AC_ARG_WITH([os-dir], |
85 |
[AS_HELP_STRING([--with-os-dir=DIR], |
86 |
[top-level OS directory under which to install [DATADIR/ganeti/os]] |
87 |
)], |
88 |
[os_dir="$withval"], |
89 |
[os_dir="$datadir/ganeti/os"]) |
90 |
AC_SUBST(OS_DIR, $os_dir) |
91 |
|
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]] |
97 |
)], |
98 |
[default_dir="$withval"], |
99 |
[default_dir="$sysconfdir/default"]) |
100 |
AC_SUBST(DEFAULT_DIR, $default_dir) |
101 |
|
102 |
# Check common programs |
103 |
AC_PROG_INSTALL |
104 |
AC_PROG_LN_S |
105 |
AC_PROG_AWK |
106 |
AC_PROG_MKDIR_P |
107 |
|
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]) |
111 |
fi |
112 |
|
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]) |
116 |
fi |
117 |
|
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]) |
121 |
fi |
122 |
|
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]) |
126 |
fi |
127 |
|
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]) |
131 |
fi |
132 |
|
133 |
AC_PATH_PROG(TIMELIMIT, [timelimit], [], [$PATH:/usr/sbin:/sbin]) |
134 |
if test -z "$TIMELIMIT" ; then |
135 |
AC_MSG_ERROR([timelimit not found in $PATH:/usr/sbin:/sbin]) |
136 |
fi |
137 |
|
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]) |
144 |
fi |
145 |
fi |
146 |
|
147 |
AC_CONFIG_FILES([ |
148 |
Makefile |
149 |
]) |
150 |
|
151 |
AC_OUTPUT |
152 |
|
153 |
# vim: set sta sts=4 shiftwidth=4 sw=4 et ai : |
154 |
|