Update ChangeLog and configure.ac for ver. 0.7
[snf-image] / snf-image-host / configure.ac
1 AC_PREREQ(2.59)
2 AC_INIT(snf-image, 0.7, 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
16
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"
21 )
22 if test ${version_check} = yes; then
23     AC_SUBST(VERSION_CHECK, yes)
24 fi
25
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.])
34          fi
35      elif test "$withval" != "no"; then
36          AC_MSG_ERROR([you must specify a value for progress-monitor if --with-progress-monitor is specified])
37     fi]
38 )
39
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])
49     fi]
50 )
51
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]]
57     )],
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])
63     fi],
64     [multistrap_config="$sysconfdir/snf-image/multistrap.conf"]
65 )
66 AC_SUBST(MULTISTRAP_CONFIG, $multistrap_config)
67
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]]
73     )],
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])
79     fi],
80     [multistrap_aptprefdir="$sysconfdir/snf-image/apt.pref.d"]
81 )
82 AC_SUBST(MULTISTRAP_APTPREFDIR, $multistrap_aptprefdir)
83
84 # --with-helper-dir
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]]
89     )],
90     [helper_dir="$withval"],
91     [helper_dir="$localstatedir/lib/snf-image/helper"])
92 AC_SUBST(HELPER_DIR, $helper_dir)
93
94 # --with-helper-img
95 AC_ARG_WITH([helper-img],
96     [AS_HELP_STRING([--with-helper-img=IMG_PATH],
97         [Path to helper VM image [HELPERDIR/image]]
98     )],
99     [helper_img="$withval"],
100     [helper_img="$helper_dir/image"])
101 AC_SUBST(HELPER_IMG, $helper_img)
102
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]]
107     )],
108     [helper_ernel="$withval"],
109     [helper_kernel="$helper_dir/kernel"])
110 AC_SUBST(HELPER_KERNEL, ${helper_kernel})
111
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]]
116     )],
117     [helper_initrd="$withval"],
118     [helper_initrd="$helper_dir/initrd"])
119 AC_SUBST(HELPER_INITRD, ${helper_initrd})
120
121 # --with-os-dir=...
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]]
125     )],
126     [os_dir="$withval"],
127     [os_dir="$datadir/ganeti/os"])
128 AC_SUBST(OS_DIR, $os_dir)
129
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]]
135     )],
136     [default_dir="$withval"],
137     [default_dir="$sysconfdir/default"])
138 AC_SUBST(DEFAULT_DIR, $default_dir)
139
140 # Check common programs
141 AC_PROG_INSTALL
142 AC_PROG_LN_S
143 AC_PROG_AWK
144 AC_PROG_MKDIR_P
145
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])
149 fi
150
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])
154 fi
155
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])
159 fi
160
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])
164 fi
165
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])
169 fi
170
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])
174 fi
175
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])
179 fi
180
181 AC_CONFIG_FILES([
182     Makefile
183 ])
184
185 AC_OUTPUT
186
187 # vim: set sta sts=4 shiftwidth=4 sw=4 et ai :
188