Add apt preferences dir for multistrap
[snf-image] / snf-image-host / configure.ac
1 AC_PREREQ(2.59)
2 AC_INIT(snf-image, 0.6.5, 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 # --with-progress-monitor
17 AC_ARG_WITH([progress-monitor],
18   [AS_HELP_STRING([--with-progress-monitor=PRGRM],
19     [name of the progress-monitor program []])],
20     [if test "$withval" != "yes" -a "$withval" != "no"; then
21          AC_PATH_PROG(PROGRESS_MONITOR, ["$withval"], [], [$PATH:/usr/sbin:/sbin])
22          if test -z "$PROGRESS_MONITOR" ; then
23              AC_MSG_FAILURE([Could not find progress-monitor: $withval.])
24          fi
25      elif test "$withval" != "no"; then
26          AC_MSG_ERROR([you must specify a value for progress-monitor if --with-progress-monitor is specified])
27     fi]
28 )
29
30 # --with-unattend-file
31 AC_ARG_WITH([unattend-file],
32   [AS_HELP_STRING([--with-unattend-file=UNATTEND_PATH],
33     [path to unattend.xml windows setup file []])],
34     [if test "$withval" != "yes" -a "$withval" != "no"; then
35         AC_SUBST(UNATTEND, "$withval")
36         AC_MSG_NOTICE(using unattend file: $withval)
37      elif test "$withval" != "no"; then
38          AC_MSG_ERROR([you must specify an Unattend.xml file if --with-unattend-file is specified])
39     fi]
40 )
41
42 # --with-multistrap-config
43 AC_ARG_WITH([multistrap-config],
44   [AS_HELP_STRING([--with-multistrap-config=MULTISTRAP_CONFIG_PATH],
45       [path to a multistrap configuration file
46       [SYSCONFDIR/snf-image/multistrap.conf]]
47     )],
48     [if test "$withval" != "yes" -a "$withval" != "no"; then
49         multistrap_config="$withval"
50         AC_MSG_NOTICE(using multistrap configuration file: $withval)
51      elif test "$withval" != "no"; then
52          AC_MSG_ERROR([you must specify an configuration file if --with-multistrap-config is specified])
53     fi],
54     [multistrap_config="$sysconfdir/snf-image/multistrap.conf"]
55 )
56 AC_SUBST(MULTISTRAP_CONFIG, $multistrap_config)
57
58 # --with-multistrap-aptprefdir
59 AC_ARG_WITH([multistrap-aptprefdir],
60   [AS_HELP_STRING([--with-multistrap-aptprefdir=MULTISTRAP_APTPREFDIR],
61       [path to a directory where preferences files for apt are hosted. Those files will be used during multistrap
62       [SYSCONFDIR/snf-image/apt.pref.d]]
63     )],
64     [if test "$withval" != "yes" -a "$withval" != "no"; then
65         multistrap_aptprefdir="$withval"
66         AC_MSG_NOTICE(using apt preferences directory for multistrap: $withval)
67      elif test "$withval" != "no"; then
68          AC_MSG_ERROR([you must specify a directory if --with-multistrap-aptprefdir is specified])
69     fi],
70     [multistrap_aptprefdir="$sysconfdir/snf-image/apt.pref.d"]
71 )
72 AC_SUBST(MULTISTRAP_APTPREFDIR, $multistrap_aptprefdir)
73
74 # --with-helper-dir
75 AC_ARG_WITH([helper-dir],
76     [AS_HELP_STRING([--with-helper-dir=DIR],
77         [top-level directory to host the helper VM
78         [LOCALSTATEDIR/lib/snf-image/helper]]
79     )],
80     [helper_dir="$withval"],
81     [helper_dir="$localstatedir/lib/snf-image/helper"])
82 AC_SUBST(HELPER_DIR, $helper_dir)
83
84 # --with-helper-cache-dir
85 AC_ARG_WITH([helper-cache-dir],
86     [AS_HELP_STRING([--with-helper-cache-dir=DIR],
87         [top-level directory to host the helper VM cache files
88         [LOCALSTATEDIR/cache/snf-image/helper]]
89     )],
90     [helper_cache_dir="$withval"],
91     [helper_cache_dir="$localstatedir/cache/snf-image/helper"])
92 AC_SUBST(HELPER_CACHE_DIR, $helper_cache_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