Statistics
| Branch: | Tag: | Revision:

root / configure.ac @ d67e0a94

History | View | Annotate | Download (17.4 kB)

1 a5d17f9f Michael Hanselmann
# Configure script for Ganeti
2 5e29d733 Michael Hanselmann
m4_define([gnt_version_major], [2])
3 9f604ab8 Michael Hanselmann
m4_define([gnt_version_minor], [5])
4 ef2d1c57 Iustin Pop
m4_define([gnt_version_revision], [1])
5 c434401a Michael Hanselmann
m4_define([gnt_version_suffix], [])
6 d5fd92ed Michael Hanselmann
m4_define([gnt_version_full],
7 d5fd92ed Michael Hanselmann
          m4_format([%d.%d.%d%s],
8 d5fd92ed Michael Hanselmann
                    gnt_version_major, gnt_version_minor,
9 d5fd92ed Michael Hanselmann
                    gnt_version_revision, gnt_version_suffix))
10 d5fd92ed Michael Hanselmann
11 a8083063 Iustin Pop
AC_PREREQ(2.59)
12 d5fd92ed Michael Hanselmann
AC_INIT(ganeti, gnt_version_full, ganeti@googlegroups.com)
13 16ebf761 Iustin Pop
AC_CONFIG_AUX_DIR(autotools)
14 9ff7e35c Michael Hanselmann
AC_CONFIG_SRCDIR(configure)
15 e70f1b7c Michael Hanselmann
AM_INIT_AUTOMAKE([1.9 foreign tar-ustar -Wall -Wno-portability])
16 a8083063 Iustin Pop
17 d5fd92ed Michael Hanselmann
AC_SUBST([VERSION_MAJOR], gnt_version_major)
18 d5fd92ed Michael Hanselmann
AC_SUBST([VERSION_MINOR], gnt_version_minor)
19 d5fd92ed Michael Hanselmann
AC_SUBST([VERSION_REVISION], gnt_version_revision)
20 d5fd92ed Michael Hanselmann
AC_SUBST([VERSION_SUFFIX], gnt_version_suffix)
21 d5fd92ed Michael Hanselmann
AC_SUBST([VERSION_FULL], gnt_version_full)
22 d5fd92ed Michael Hanselmann
23 c6b8baba Michael Hanselmann
# --with-ssh-initscript=...
24 c6b8baba Michael Hanselmann
AC_ARG_WITH([ssh-initscript],
25 8f106515 Guido Trotter
  [AS_HELP_STRING([--with-ssh-initscript=SCRIPT],
26 c6b8baba Michael Hanselmann
    [SSH init script to use (default is /etc/init.d/ssh)]
27 c6b8baba Michael Hanselmann
  )],
28 f491c3a8 Michael Hanselmann
  [ssh_initd_script="$withval"],
29 f491c3a8 Michael Hanselmann
  [ssh_initd_script="/etc/init.d/ssh"])
30 f491c3a8 Michael Hanselmann
AC_SUBST(SSH_INITD_SCRIPT, $ssh_initd_script)
31 c6b8baba Michael Hanselmann
32 68dccc07 Guido Trotter
# --with-export-dir=...
33 68dccc07 Guido Trotter
AC_ARG_WITH([export-dir],
34 68dccc07 Guido Trotter
  [AS_HELP_STRING([--with-export-dir=DIR],
35 f00b46bc Michael Hanselmann
    [directory to use by default for instance image]
36 f00b46bc Michael Hanselmann
    [ exports (default is /srv/ganeti/export)]
37 68dccc07 Guido Trotter
  )],
38 68dccc07 Guido Trotter
  [export_dir="$withval"],
39 68dccc07 Guido Trotter
  [export_dir="/srv/ganeti/export"])
40 68dccc07 Guido Trotter
AC_SUBST(EXPORT_DIR, $export_dir)
41 68dccc07 Guido Trotter
42 553bd93f Vitaly Kuznetsov
# --with-ssh-config-dir=...
43 553bd93f Vitaly Kuznetsov
AC_ARG_WITH([ssh-config-dir],
44 553bd93f Vitaly Kuznetsov
  [AS_HELP_STRING([--with-ssh-config-dir=DIR],
45 553bd93f Vitaly Kuznetsov
    [ directory with ssh host keys ]
46 553bd93f Vitaly Kuznetsov
    [ (default is /etc/ssh)]
47 553bd93f Vitaly Kuznetsov
  )],
48 553bd93f Vitaly Kuznetsov
  [ssh_config_dir="$withval"],
49 553bd93f Vitaly Kuznetsov
  [ssh_config_dir="/etc/ssh"])
50 553bd93f Vitaly Kuznetsov
AC_SUBST(SSH_CONFIG_DIR, $ssh_config_dir)
51 553bd93f Vitaly Kuznetsov
52 7c3d51d4 Guido Trotter
# --with-os-search-path=...
53 7c3d51d4 Guido Trotter
# do a bit of black sed magic to for quoting of the strings in the list
54 7c3d51d4 Guido Trotter
AC_ARG_WITH([os-search-path],
55 7c3d51d4 Guido Trotter
  [AS_HELP_STRING([--with-os-search-path=LIST],
56 f00b46bc Michael Hanselmann
    [comma separated list of directories to]
57 f00b46bc Michael Hanselmann
    [ search for OS images (default is /srv/ganeti/os)]
58 7c3d51d4 Guido Trotter
  )],
59 7c3d51d4 Guido Trotter
  [os_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/'\1'/g"`],
60 7c3d51d4 Guido Trotter
  [os_search_path="'/srv/ganeti/os'"])
61 7c3d51d4 Guido Trotter
AC_SUBST(OS_SEARCH_PATH, $os_search_path)
62 7c3d51d4 Guido Trotter
63 298fe380 Iustin Pop
# --with-iallocator-search-path=...
64 298fe380 Iustin Pop
# do a bit of black sed magic to for quoting of the strings in the list
65 298fe380 Iustin Pop
AC_ARG_WITH([iallocator-search-path],
66 298fe380 Iustin Pop
  [AS_HELP_STRING([--with-iallocator-search-path=LIST],
67 298fe380 Iustin Pop
    [comma separated list of directories to]
68 298fe380 Iustin Pop
    [ search for instance allocators (default is $libdir/ganeti/iallocators)]
69 298fe380 Iustin Pop
  )],
70 298fe380 Iustin Pop
  [iallocator_search_path=`echo -n "$withval" | sed -e "s/\([[^,]]*\)/'\1'/g"`],
71 298fe380 Iustin Pop
  [iallocator_search_path="'$libdir/$PACKAGE_NAME/iallocators'"])
72 298fe380 Iustin Pop
AC_SUBST(IALLOCATOR_SEARCH_PATH, $iallocator_search_path)
73 298fe380 Iustin Pop
74 2f2dbb4b Jun Futagawa
# --with-xen-bootloader=...
75 2f2dbb4b Jun Futagawa
AC_ARG_WITH([xen-bootloader],
76 2f2dbb4b Jun Futagawa
  [AS_HELP_STRING([--with-xen-bootloader=PATH],
77 2f2dbb4b Jun Futagawa
    [bootloader for Xen hypervisor (default is empty)]
78 2f2dbb4b Jun Futagawa
  )],
79 2f2dbb4b Jun Futagawa
  [xen_bootloader="$withval"],
80 2f2dbb4b Jun Futagawa
  [xen_bootloader=])
81 2f2dbb4b Jun Futagawa
AC_SUBST(XEN_BOOTLOADER, $xen_bootloader)
82 2f2dbb4b Jun Futagawa
83 f00b46bc Michael Hanselmann
# --with-xen-kernel=...
84 f00b46bc Michael Hanselmann
AC_ARG_WITH([xen-kernel],
85 f00b46bc Michael Hanselmann
  [AS_HELP_STRING([--with-xen-kernel=PATH],
86 b8203e1e Iustin Pop
    [DomU kernel image for Xen hypervisor (default is /boot/vmlinuz-3-xenU)]
87 f00b46bc Michael Hanselmann
  )],
88 f00b46bc Michael Hanselmann
  [xen_kernel="$withval"],
89 b8203e1e Iustin Pop
  [xen_kernel="/boot/vmlinuz-3-xenU"])
90 f00b46bc Michael Hanselmann
AC_SUBST(XEN_KERNEL, $xen_kernel)
91 f00b46bc Michael Hanselmann
92 f00b46bc Michael Hanselmann
# --with-xen-initrd=...
93 f00b46bc Michael Hanselmann
AC_ARG_WITH([xen-initrd],
94 f00b46bc Michael Hanselmann
  [AS_HELP_STRING([--with-xen-initrd=PATH],
95 b8203e1e Iustin Pop
    [DomU initrd image for Xen hypervisor (default is /boot/initrd-3-xenU)]
96 f00b46bc Michael Hanselmann
  )],
97 f00b46bc Michael Hanselmann
  [xen_initrd="$withval"],
98 b8203e1e Iustin Pop
  [xen_initrd="/boot/initrd-3-xenU"])
99 f00b46bc Michael Hanselmann
AC_SUBST(XEN_INITRD, $xen_initrd)
100 f00b46bc Michael Hanselmann
101 b8203e1e Iustin Pop
# --with-kvm-kernel=...
102 b8203e1e Iustin Pop
AC_ARG_WITH([kvm-kernel],
103 b8203e1e Iustin Pop
  [AS_HELP_STRING([--with-kvm-kernel=PATH],
104 b8203e1e Iustin Pop
    [Guest kernel image for KVM hypervisor (default is /boot/vmlinuz-3-kvmU)]
105 b8203e1e Iustin Pop
  )],
106 b8203e1e Iustin Pop
  [kvm_kernel="$withval"],
107 b8203e1e Iustin Pop
  [kvm_kernel="/boot/vmlinuz-3-kvmU"])
108 b8203e1e Iustin Pop
AC_SUBST(KVM_KERNEL, $kvm_kernel)
109 b8203e1e Iustin Pop
110 22c734bc Manuel Franceschini
# --with-file-storage-dir=...
111 22c734bc Manuel Franceschini
AC_ARG_WITH([file-storage-dir],
112 22c734bc Manuel Franceschini
  [AS_HELP_STRING([--with-file-storage-dir=PATH],
113 22c734bc Manuel Franceschini
    [directory to store files for file-based backend]
114 22c734bc Manuel Franceschini
    [ (default is /srv/ganeti/file-storage)]
115 22c734bc Manuel Franceschini
  )],
116 cb7c0198 Iustin Pop
  [[file_storage_dir="$withval";
117 cb7c0198 Iustin Pop
    if test "$withval" != no; then
118 cb7c0198 Iustin Pop
      enable_file_storage=True
119 cb7c0198 Iustin Pop
    else
120 cb7c0198 Iustin Pop
      enable_file_storage=False
121 cb7c0198 Iustin Pop
    fi
122 cb7c0198 Iustin Pop
  ]],
123 30841576 Michael Hanselmann
  [[file_storage_dir="/srv/ganeti/file-storage";
124 30841576 Michael Hanselmann
    enable_file_storage="True"]])
125 22c734bc Manuel Franceschini
AC_SUBST(FILE_STORAGE_DIR, $file_storage_dir)
126 cb7c0198 Iustin Pop
AC_SUBST(ENABLE_FILE_STORAGE, $enable_file_storage)
127 22c734bc Manuel Franceschini
128 4b97f902 Apollon Oikonomopoulos
# --with-shared-file-storage-dir=...
129 4b97f902 Apollon Oikonomopoulos
AC_ARG_WITH([shared-file-storage-dir],
130 4b97f902 Apollon Oikonomopoulos
  [AS_HELP_STRING([--with-shared-file-storage-dir=PATH],
131 4b97f902 Apollon Oikonomopoulos
    [directory to store files for shared file-based backend]
132 4b97f902 Apollon Oikonomopoulos
    [ (default is /srv/ganeti/shared-file-storage)]
133 4b97f902 Apollon Oikonomopoulos
  )],
134 4b97f902 Apollon Oikonomopoulos
  [[shared_file_storage_dir="$withval";
135 4b97f902 Apollon Oikonomopoulos
    if test "$withval" != no; then
136 4b97f902 Apollon Oikonomopoulos
      enable_shared_file_storage=True
137 4b97f902 Apollon Oikonomopoulos
    else
138 4b97f902 Apollon Oikonomopoulos
      enable_shared_file_storage=False
139 4b97f902 Apollon Oikonomopoulos
    fi
140 4b97f902 Apollon Oikonomopoulos
  ]],
141 30841576 Michael Hanselmann
  [[shared_file_storage_dir="/srv/ganeti/shared-file-storage";
142 30841576 Michael Hanselmann
    enable_shared_file_storage="True"]])
143 4b97f902 Apollon Oikonomopoulos
AC_SUBST(SHARED_FILE_STORAGE_DIR, $shared_file_storage_dir)
144 4b97f902 Apollon Oikonomopoulos
AC_SUBST(ENABLE_SHARED_FILE_STORAGE, $enable_shared_file_storage)
145 4b97f902 Apollon Oikonomopoulos
146 7e2c5b9e Guido Trotter
# --with-kvm-path=...
147 7e2c5b9e Guido Trotter
AC_ARG_WITH([kvm-path],
148 7e2c5b9e Guido Trotter
  [AS_HELP_STRING([--with-kvm-path=PATH],
149 7e2c5b9e Guido Trotter
    [absolute path to the kvm binary]
150 7e2c5b9e Guido Trotter
    [ (default is /usr/bin/kvm)]
151 7e2c5b9e Guido Trotter
  )],
152 7e2c5b9e Guido Trotter
  [kvm_path="$withval"],
153 7e2c5b9e Guido Trotter
  [kvm_path="/usr/bin/kvm"])
154 7e2c5b9e Guido Trotter
AC_SUBST(KVM_PATH, $kvm_path)
155 7e2c5b9e Guido Trotter
156 89b70f39 Iustin Pop
# --with-lvm-stripecount=...
157 3736cb6b Iustin Pop
AC_ARG_WITH([lvm-stripecount],
158 3736cb6b Iustin Pop
  [AS_HELP_STRING([--with-lvm-stripecount=NUM],
159 43e11798 Andrea Spadaccini
    [the default number of stripes to use for LVM volumes]
160 7b3ac94d Iustin Pop
    [ (default is 1)]
161 3736cb6b Iustin Pop
  )],
162 3736cb6b Iustin Pop
  [lvm_stripecount="$withval"],
163 7b3ac94d Iustin Pop
  [lvm_stripecount="1"])
164 3736cb6b Iustin Pop
AC_SUBST(LVM_STRIPECOUNT, $lvm_stripecount)
165 3736cb6b Iustin Pop
166 0d150c50 René Nussbaumer
# --with-user-prefix=...
167 0d150c50 René Nussbaumer
AC_ARG_WITH([user-prefix],
168 0d150c50 René Nussbaumer
  [AS_HELP_STRING([--with-user-prefix=PREFIX],
169 0d150c50 René Nussbaumer
    [prefix for daemon users]
170 0d150c50 René Nussbaumer
    [ (default is to run all daemons as root)]
171 0d150c50 René Nussbaumer
  )],
172 3794937c René Nussbaumer
  [user_masterd="${withval}masterd";
173 0d150c50 René Nussbaumer
   user_rapi="${withval}rapi";
174 3794937c René Nussbaumer
   user_confd="${withval}confd";
175 0d150c50 René Nussbaumer
   user_noded="root"],
176 0d150c50 René Nussbaumer
  [user_masterd="root";
177 0d150c50 René Nussbaumer
   user_rapi="root";
178 0d150c50 René Nussbaumer
   user_confd="root";
179 0d150c50 René Nussbaumer
   user_noded="root"])
180 0d150c50 René Nussbaumer
AC_SUBST(MASTERD_USER, $user_masterd)
181 0d150c50 René Nussbaumer
AC_SUBST(RAPI_USER, $user_rapi)
182 0d150c50 René Nussbaumer
AC_SUBST(CONFD_USER, $user_confd)
183 0d150c50 René Nussbaumer
AC_SUBST(NODED_USER, $user_noded)
184 0d150c50 René Nussbaumer
185 0d150c50 René Nussbaumer
# --with-group-prefix=...
186 0d150c50 René Nussbaumer
AC_ARG_WITH([group-prefix],
187 0d150c50 René Nussbaumer
  [AS_HELP_STRING([--with-group-prefix=PREFIX],
188 0d150c50 René Nussbaumer
    [prefix for daemon POSIX groups]
189 0d150c50 René Nussbaumer
    [ (default is to run all daemons under group root)]
190 0d150c50 René Nussbaumer
  )],
191 3794937c René Nussbaumer
  [group_rapi="${withval}rapi";
192 3794937c René Nussbaumer
   group_admin="${withval}admin";
193 3794937c René Nussbaumer
   group_confd="${withval}confd";
194 3794937c René Nussbaumer
   group_masterd="${withval}masterd";
195 03881cb0 René Nussbaumer
   group_noded="root";
196 0d150c50 René Nussbaumer
   group_daemons="${withval}daemons";],
197 0d150c50 René Nussbaumer
  [group_rapi="root";
198 0d150c50 René Nussbaumer
   group_admin="root";
199 0d150c50 René Nussbaumer
   group_confd="root";
200 0d150c50 René Nussbaumer
   group_masterd="root";
201 03881cb0 René Nussbaumer
   group_noded="root";
202 0d150c50 René Nussbaumer
   group_daemons="root"])
203 0d150c50 René Nussbaumer
AC_SUBST(RAPI_GROUP, $group_rapi)
204 0d150c50 René Nussbaumer
AC_SUBST(ADMIN_GROUP, $group_admin)
205 0d150c50 René Nussbaumer
AC_SUBST(CONFD_GROUP, $group_confd)
206 0d150c50 René Nussbaumer
AC_SUBST(MASTERD_GROUP, $group_masterd)
207 03881cb0 René Nussbaumer
AC_SUBST(NODED_GROUP, $group_noded)
208 0d150c50 René Nussbaumer
AC_SUBST(DAEMONS_GROUP, $group_daemons)
209 0d150c50 René Nussbaumer
210 0d150c50 René Nussbaumer
# Print the config to the user
211 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Running ganeti-masterd as $group_masterd:$group_masterd])
212 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Running ganeti-rapi as $user_rapi:$group_rapi])
213 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Running ganeti-confd as $user_confd:$group_confd])
214 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Group for daemons is $group_daemons])
215 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Group for clients is $group_admin])
216 0d150c50 René Nussbaumer
217 89b70f39 Iustin Pop
# --enable-drbd-barriers
218 89b70f39 Iustin Pop
AC_ARG_ENABLE([drbd-barriers],
219 89b70f39 Iustin Pop
  [AS_HELP_STRING([--enable-drbd-barriers],
220 8a69b3a8 Andrea Spadaccini
    [enable by default the DRBD barriers functionality (>= 8.0.12) (default: enabled)])],
221 89b70f39 Iustin Pop
  [[if test "$enableval" != no; then
222 8a69b3a8 Andrea Spadaccini
      DRBD_BARRIERS=n
223 8a69b3a8 Andrea Spadaccini
      DRBD_NO_META_FLUSH=False
224 89b70f39 Iustin Pop
    else
225 8a69b3a8 Andrea Spadaccini
      DRBD_BARRIERS=bfd
226 8a69b3a8 Andrea Spadaccini
      DRBD_NO_META_FLUSH=True
227 89b70f39 Iustin Pop
    fi
228 89b70f39 Iustin Pop
  ]],
229 8a69b3a8 Andrea Spadaccini
  [DRBD_BARRIERS=n
230 8a69b3a8 Andrea Spadaccini
   DRBD_NO_META_FLUSH=False
231 8a69b3a8 Andrea Spadaccini
  ])
232 89b70f39 Iustin Pop
AC_SUBST(DRBD_BARRIERS, $DRBD_BARRIERS)
233 8a69b3a8 Andrea Spadaccini
AC_SUBST(DRBD_NO_META_FLUSH, $DRBD_NO_META_FLUSH)
234 89b70f39 Iustin Pop
235 551b6283 Iustin Pop
# --enable-syslog[=no/yes/only]
236 551b6283 Iustin Pop
AC_ARG_ENABLE([syslog],
237 551b6283 Iustin Pop
  [AS_HELP_STRING([--enable-syslog],
238 551b6283 Iustin Pop
    [enable use of syslog (default: disabled), one of no/yes/only])],
239 551b6283 Iustin Pop
  [[case "$enableval" in
240 551b6283 Iustin Pop
      no)
241 551b6283 Iustin Pop
        SYSLOG=no
242 551b6283 Iustin Pop
        ;;
243 551b6283 Iustin Pop
      yes)
244 551b6283 Iustin Pop
        SYSLOG=yes
245 551b6283 Iustin Pop
        ;;
246 551b6283 Iustin Pop
      only)
247 551b6283 Iustin Pop
        SYSLOG=only
248 551b6283 Iustin Pop
        ;;
249 551b6283 Iustin Pop
      *)
250 551b6283 Iustin Pop
        SYSLOG=
251 551b6283 Iustin Pop
        ;;
252 551b6283 Iustin Pop
    esac
253 551b6283 Iustin Pop
  ]],
254 551b6283 Iustin Pop
  [SYSLOG=no])
255 551b6283 Iustin Pop
256 551b6283 Iustin Pop
if test -z "$SYSLOG"
257 551b6283 Iustin Pop
then
258 551b6283 Iustin Pop
  AC_MSG_ERROR([invalid value for syslog, choose one of no/yes/only])
259 551b6283 Iustin Pop
fi
260 551b6283 Iustin Pop
AC_SUBST(SYSLOG_USAGE, $SYSLOG)
261 551b6283 Iustin Pop
262 e5bd9de5 Iustin Pop
# --enable-htools
263 e5bd9de5 Iustin Pop
HTOOLS=
264 e5bd9de5 Iustin Pop
AC_ARG_ENABLE([htools],
265 e5bd9de5 Iustin Pop
        [AS_HELP_STRING([--enable-htools],
266 e5bd9de5 Iustin Pop
        [enable use of htools (needs GHC and libraries, default: check)])],
267 e5bd9de5 Iustin Pop
        [],
268 e5bd9de5 Iustin Pop
        [enable_htools=check])
269 e5bd9de5 Iustin Pop
270 50ed57c1 Iustin Pop
# --enable-htools-rapi
271 50ed57c1 Iustin Pop
HTOOLS_RAPI=
272 50ed57c1 Iustin Pop
AC_ARG_ENABLE([htools-rapi],
273 50ed57c1 Iustin Pop
        [AS_HELP_STRING([--enable-htools-rapi],
274 50ed57c1 Iustin Pop
        [enable use of RAPI in htools (needs curl, default: no)])],
275 50ed57c1 Iustin Pop
        [],
276 50ed57c1 Iustin Pop
        [enable_htools_rapi=no])
277 50ed57c1 Iustin Pop
278 cd8b0072 Iustin Pop
# --enable-htools
279 cd8b0072 Iustin Pop
ENABLE_CONFD=
280 cd8b0072 Iustin Pop
AC_ARG_ENABLE([confd],
281 cd8b0072 Iustin Pop
  [AS_HELP_STRING([--enable-confd],
282 73b0fa69 Iustin Pop
  [enable the ganeti-confd daemon (default: python, options haskell/python/no)])],
283 cd8b0072 Iustin Pop
  [[case "$enableval" in
284 cd8b0072 Iustin Pop
      no)
285 cd8b0072 Iustin Pop
        enable_confd=False
286 73b0fa69 Iustin Pop
        py_confd=False
287 73b0fa69 Iustin Pop
        hs_confd=False
288 cd8b0072 Iustin Pop
        ;;
289 73b0fa69 Iustin Pop
      yes|python)
290 73b0fa69 Iustin Pop
        enable_confd=True
291 73b0fa69 Iustin Pop
        py_confd=True
292 73b0fa69 Iustin Pop
        hs_confd=False
293 73b0fa69 Iustin Pop
        ;;
294 73b0fa69 Iustin Pop
      haskell)
295 cd8b0072 Iustin Pop
        enable_confd=True
296 73b0fa69 Iustin Pop
        py_confd=False
297 73b0fa69 Iustin Pop
        hs_confd=True
298 cd8b0072 Iustin Pop
        ;;
299 cd8b0072 Iustin Pop
      *)
300 cd8b0072 Iustin Pop
        echo "Invalid value for enable-confd '$enableval'"
301 cd8b0072 Iustin Pop
        exit 1
302 cd8b0072 Iustin Pop
        ;;
303 cd8b0072 Iustin Pop
    esac
304 cd8b0072 Iustin Pop
  ]],
305 73b0fa69 Iustin Pop
  [enable_confd=True;py_confd=True;hs_confd=False])
306 cd8b0072 Iustin Pop
AC_SUBST(ENABLE_CONFD, $enable_confd)
307 73b0fa69 Iustin Pop
AC_SUBST(PY_CONFD, $py_confd)
308 73b0fa69 Iustin Pop
AC_SUBST(HS_CONFD, $hs_confd)
309 cd8b0072 Iustin Pop
310 0985325d Iustin Pop
AM_CONDITIONAL([WANT_CONFD], [test x$enable_confd = xTrue])
311 73b0fa69 Iustin Pop
AM_CONDITIONAL([PY_CONFD], [test x$py_confd = xTrue])
312 73b0fa69 Iustin Pop
AM_CONDITIONAL([HS_CONFD], [test x$hs_confd = xTrue])
313 0985325d Iustin Pop
314 3536c792 Iustin Pop
# --with-disk-separator=...
315 3536c792 Iustin Pop
AC_ARG_WITH([disk-separator],
316 3536c792 Iustin Pop
  [AS_HELP_STRING([--with-disk-separator=STRING],
317 30841576 Michael Hanselmann
    [Disk index separator, useful if the default of ':' is handled]
318 30841576 Michael Hanselmann
    [ specially by the hypervisor]
319 3536c792 Iustin Pop
  )],
320 3536c792 Iustin Pop
  [disk_separator="$withval"],
321 3536c792 Iustin Pop
  [disk_separator=":"])
322 3536c792 Iustin Pop
AC_SUBST(DISK_SEPARATOR, $disk_separator)
323 3536c792 Iustin Pop
324 a5d17f9f Michael Hanselmann
# Check common programs
325 a8083063 Iustin Pop
AC_PROG_INSTALL
326 9ff7e35c Michael Hanselmann
AC_PROG_LN_S
327 a8083063 Iustin Pop
328 c4dfb0b6 Andrea Spadaccini
# Check for the ip command
329 c4dfb0b6 Andrea Spadaccini
AC_ARG_VAR(IP_PATH, [ip path])
330 c4dfb0b6 Andrea Spadaccini
AC_PATH_PROG(IP_PATH, [ip], [])
331 c4dfb0b6 Andrea Spadaccini
if test -z "$IP_PATH"
332 c4dfb0b6 Andrea Spadaccini
then
333 c4dfb0b6 Andrea Spadaccini
  AC_MSG_ERROR([ip command not found])
334 c4dfb0b6 Andrea Spadaccini
fi
335 c4dfb0b6 Andrea Spadaccini
336 18e2b6e4 Iustin Pop
# Check for pandoc
337 5208e732 Iustin Pop
AC_ARG_VAR(PANDOC, [pandoc path])
338 5208e732 Iustin Pop
AC_PATH_PROG(PANDOC, [pandoc], [])
339 5208e732 Iustin Pop
if test -z "$PANDOC"
340 5208e732 Iustin Pop
then
341 5208e732 Iustin Pop
  AC_MSG_WARN([pandoc not found, man pages rebuild will not be possible])
342 5208e732 Iustin Pop
fi
343 5208e732 Iustin Pop
344 d17e74b4 Iustin Pop
# Check for python-sphinx
345 d17e74b4 Iustin Pop
AC_ARG_VAR(SPHINX, [sphinx-build path])
346 d17e74b4 Iustin Pop
AC_PATH_PROG(SPHINX, [sphinx-build], [])
347 d17e74b4 Iustin Pop
if test -z "$SPHINX"
348 f05c99f3 Michael Hanselmann
then
349 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([sphinx-build not found, documentation rebuild will
350 30841576 Michael Hanselmann
                            not be possible]))
351 f05c99f3 Michael Hanselmann
fi
352 f05c99f3 Michael Hanselmann
353 f86e82ef Iustin Pop
# Check for graphviz (dot)
354 f86e82ef Iustin Pop
AC_ARG_VAR(DOT, [dot path])
355 f86e82ef Iustin Pop
AC_PATH_PROG(DOT, [dot], [])
356 f86e82ef Iustin Pop
if test -z "$DOT"
357 f86e82ef Iustin Pop
then
358 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([dot (from the graphviz suite) not found,
359 30841576 Michael Hanselmann
                            documentation rebuild not possible]))
360 f86e82ef Iustin Pop
fi
361 f86e82ef Iustin Pop
362 6d7cc5ff Michael Hanselmann
# Check for pylint
363 6d7cc5ff Michael Hanselmann
AC_ARG_VAR(PYLINT, [pylint path])
364 6d7cc5ff Michael Hanselmann
AC_PATH_PROG(PYLINT, [pylint], [])
365 6d7cc5ff Michael Hanselmann
if test -z "$PYLINT"
366 6d7cc5ff Michael Hanselmann
then
367 6d7cc5ff Michael Hanselmann
  AC_MSG_WARN([pylint not found, checking code will not be possible])
368 6d7cc5ff Michael Hanselmann
fi
369 6d7cc5ff Michael Hanselmann
370 08366664 Michael Hanselmann
# Check for pep8
371 08366664 Michael Hanselmann
AC_ARG_VAR(PEP8, [pep8 path])
372 08366664 Michael Hanselmann
AC_PATH_PROG(PEP8, [pep8], [])
373 08366664 Michael Hanselmann
if test -z "$PEP8"
374 08366664 Michael Hanselmann
then
375 08366664 Michael Hanselmann
  AC_MSG_WARN([pep8 not found, checking code will not be complete])
376 08366664 Michael Hanselmann
fi
377 08366664 Michael Hanselmann
378 fe5b0c42 Michael Hanselmann
# Check for socat
379 fe5b0c42 Michael Hanselmann
AC_ARG_VAR(SOCAT, [socat path])
380 fe5b0c42 Michael Hanselmann
AC_PATH_PROG(SOCAT, [socat], [])
381 87c1d0c7 Guido Trotter
if test -z "$SOCAT"
382 87c1d0c7 Guido Trotter
then
383 fe5b0c42 Michael Hanselmann
  AC_MSG_ERROR([socat not found])
384 87c1d0c7 Guido Trotter
fi
385 87c1d0c7 Guido Trotter
386 a002ed79 Agata Murawska
# Check for qemu-img
387 a002ed79 Agata Murawska
AC_ARG_VAR(QEMUIMG_PATH, [qemu-img path])
388 a002ed79 Agata Murawska
AC_PATH_PROG(QEMUIMG_PATH, [qemu-img], [])
389 a002ed79 Agata Murawska
if test -z "$QEMUIMG_PATH"
390 a002ed79 Agata Murawska
then
391 a002ed79 Agata Murawska
  AC_MSG_WARN([qemu-img not found, using ovfconverter will not be possible])
392 a002ed79 Agata Murawska
fi
393 a002ed79 Agata Murawska
394 acf70442 Iustin Pop
if test "$enable_htools" != "no"; then
395 acf70442 Iustin Pop
396 e5bd9de5 Iustin Pop
# Check for ghc
397 e5bd9de5 Iustin Pop
AC_ARG_VAR(GHC, [ghc path])
398 e5bd9de5 Iustin Pop
AC_PATH_PROG(GHC, [ghc], [])
399 e5bd9de5 Iustin Pop
if test -z "$GHC"; then
400 e5bd9de5 Iustin Pop
  if test "$enable_htools" != "check"; then
401 e5bd9de5 Iustin Pop
    AC_MSG_FAILURE([ghc not found, htools compilation will not possible])
402 e5bd9de5 Iustin Pop
  fi
403 e5bd9de5 Iustin Pop
fi
404 e5bd9de5 Iustin Pop
405 e5bd9de5 Iustin Pop
# Check for ghc-pkg
406 e5bd9de5 Iustin Pop
HTOOLS_MODULES=
407 e5bd9de5 Iustin Pop
AC_ARG_VAR(GHC_PKG, [ghc-pkg path])
408 e5bd9de5 Iustin Pop
AC_PATH_PROG(GHC_PKG, [ghc-pkg], [])
409 e5bd9de5 Iustin Pop
if test -z "$GHC_PKG"; then
410 e5bd9de5 Iustin Pop
  if test "$enable_htools" != "check"; then
411 e5bd9de5 Iustin Pop
    AC_MSG_FAILURE([ghc-pkg not found, htools compilation will not be possible])
412 e5bd9de5 Iustin Pop
  fi
413 e5bd9de5 Iustin Pop
else
414 e5bd9de5 Iustin Pop
  # check for modules
415 e5bd9de5 Iustin Pop
  AC_MSG_NOTICE([checking for required haskell modules])
416 50ed57c1 Iustin Pop
  HTOOLS_NOCURL=-DNO_CURL
417 50ed57c1 Iustin Pop
  if test "$enable_htools_rapi" != "no"; then
418 50ed57c1 Iustin Pop
    AC_MSG_CHECKING([curl])
419 50ed57c1 Iustin Pop
    GHC_PKG_CURL=$($GHC_PKG latest curl)
420 50ed57c1 Iustin Pop
    if test -z "$GHC_PKG_CURL"; then
421 50ed57c1 Iustin Pop
      if test "$enable_htools_rapi" = "check"; then
422 30841576 Michael Hanselmann
        AC_MSG_WARN(m4_normalize([The curl library not found, htools will be
423 30841576 Michael Hanselmann
                                  compiled without RAPI support]))
424 50ed57c1 Iustin Pop
      else
425 30841576 Michael Hanselmann
        AC_MSG_FAILURE(m4_normalize([The curl library was not found, but it has
426 30841576 Michael Hanselmann
                                     been requested]))
427 50ed57c1 Iustin Pop
      fi
428 50ed57c1 Iustin Pop
    else
429 50ed57c1 Iustin Pop
      HTOOLS_NOCURL=
430 50ed57c1 Iustin Pop
    fi
431 50ed57c1 Iustin Pop
    AC_MSG_RESULT($GHC_PKG_CURL)
432 e5bd9de5 Iustin Pop
  fi
433 e5bd9de5 Iustin Pop
  AC_SUBST(GHC_PKG_CURL)
434 50ed57c1 Iustin Pop
  AC_SUBST(HTOOLS_NOCURL)
435 e5bd9de5 Iustin Pop
  AC_MSG_CHECKING([parallel])
436 1d66efbe Guido Trotter
  GHC_PKG_PARALLEL=$($GHC_PKG --simple-output list 'parallel-3.*')
437 1adec4be Iustin Pop
  if test -n "$GHC_PKG_PARALLEL"
438 1d66efbe Guido Trotter
  then
439 1adec4be Iustin Pop
    HTOOLS_PARALLEL3=-DPARALLEL3
440 1adec4be Iustin Pop
  else
441 1d66efbe Guido Trotter
    GHC_PKG_PARALLEL=$($GHC_PKG --simple-output list 'parallel-2.*')
442 1d66efbe Guido Trotter
  fi
443 e5bd9de5 Iustin Pop
  if test -z "$GHC_PKG_PARALLEL"
444 e5bd9de5 Iustin Pop
  then
445 e5bd9de5 Iustin Pop
    GHC_PKG_PARALLEL=$($GHC_PKG --simple-output list 'parallel-1.*')
446 e5bd9de5 Iustin Pop
  fi
447 e5bd9de5 Iustin Pop
  AC_SUBST(GHC_PKG_PARALLEL)
448 1adec4be Iustin Pop
  AC_SUBST(HTOOLS_PARALLEL3)
449 e5bd9de5 Iustin Pop
  AC_MSG_RESULT($GHC_PKG_PARALLEL)
450 e5bd9de5 Iustin Pop
  AC_MSG_CHECKING([json])
451 e5bd9de5 Iustin Pop
  GHC_PKG_JSON=$($GHC_PKG latest json)
452 e5bd9de5 Iustin Pop
  AC_MSG_RESULT($GHC_PKG_JSON)
453 e5bd9de5 Iustin Pop
  AC_MSG_CHECKING([network])
454 e5bd9de5 Iustin Pop
  GHC_PKG_NETWORK=$($GHC_PKG latest network)
455 e5bd9de5 Iustin Pop
  AC_MSG_RESULT($GHC_PKG_NETWORK)
456 8e4f6d56 Iustin Pop
  AC_MSG_CHECKING([QuickCheck 2.x])
457 8e4f6d56 Iustin Pop
  GHC_PKG_QUICKCHECK=$($GHC_PKG --simple-output list 'QuickCheck-2.*')
458 fd0bc853 Iustin Pop
  AC_MSG_RESULT($GHC_PKG_QUICKCHECK)
459 e5bd9de5 Iustin Pop
  if test -z "$GHC_PKG_PARALLEL" || test -z "$GHC_PKG_JSON" || \
460 e5bd9de5 Iustin Pop
     test -z "$GHC_PKG_NETWORK"; then
461 e5bd9de5 Iustin Pop
    if test "$enable_htools" != "check"; then
462 30841576 Michael Hanselmann
      AC_MSG_FAILURE(m4_normalize([Required Haskell modules not found, htools
463 30841576 Michael Hanselmann
                                   compilation disabled]))
464 e5bd9de5 Iustin Pop
    fi
465 e5bd9de5 Iustin Pop
  else
466 e5bd9de5 Iustin Pop
    # we leave the other modules to be auto-selected
467 e5bd9de5 Iustin Pop
    HTOOLS_MODULES="-package $GHC_PKG_PARALLEL"
468 e5bd9de5 Iustin Pop
  fi
469 fd0bc853 Iustin Pop
  if test -z "$GHC_PKG_QUICKCHECK"; then
470 8e4f6d56 Iustin Pop
     AC_MSG_WARN(m4_normalize([The QuickCheck 2.x module was not found,
471 fd0bc853 Iustin Pop
                               you won't be able to run Haskell unittests]))
472 fd0bc853 Iustin Pop
  fi
473 e5bd9de5 Iustin Pop
fi
474 e5bd9de5 Iustin Pop
AC_SUBST(HTOOLS_MODULES)
475 fd0bc853 Iustin Pop
AC_SUBST(GHC_PKG_QUICKCHECK)
476 e5bd9de5 Iustin Pop
477 e5bd9de5 Iustin Pop
if test "$enable_htools" != "no"; then
478 e5bd9de5 Iustin Pop
  if test -z "$GHC" || test -z "$HTOOLS_MODULES"; then
479 30841576 Michael Hanselmann
    AC_MSG_WARN(m4_normalize([Haskell compiler/required libraries not found,
480 30841576 Michael Hanselmann
                              htools compilation disabled]))
481 e5bd9de5 Iustin Pop
  else
482 e5bd9de5 Iustin Pop
    HTOOLS=yes
483 e5bd9de5 Iustin Pop
  fi
484 e5bd9de5 Iustin Pop
fi
485 e5bd9de5 Iustin Pop
AC_SUBST(HTOOLS)
486 e5bd9de5 Iustin Pop
487 e5bd9de5 Iustin Pop
# Check for HsColour
488 e5bd9de5 Iustin Pop
HTOOLS_APIDOC=no
489 e5bd9de5 Iustin Pop
AC_ARG_VAR(HSCOLOUR, [HsColour path])
490 e5bd9de5 Iustin Pop
AC_PATH_PROG(HSCOLOUR, [HsColour], [])
491 e5bd9de5 Iustin Pop
if test -z "$HSCOLOUR"; then
492 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([HsColour not found, htools API documentation will
493 30841576 Michael Hanselmann
                            not be generated]))
494 e5bd9de5 Iustin Pop
fi
495 e5bd9de5 Iustin Pop
496 e5bd9de5 Iustin Pop
# Check for haddock
497 e5bd9de5 Iustin Pop
AC_ARG_VAR(HADDOCK, [haddock path])
498 e5bd9de5 Iustin Pop
AC_PATH_PROG(HADDOCK, [haddock], [])
499 e5bd9de5 Iustin Pop
if test -z "$HADDOCK"; then
500 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([haddock not found, htools API documentation will
501 30841576 Michael Hanselmann
                            not be generated]))
502 e5bd9de5 Iustin Pop
fi
503 e5bd9de5 Iustin Pop
if test "$HADDOCK" && test "$HSCOLOUR"; then
504 e5bd9de5 Iustin Pop
  HTOOLS_APIDOC=yes
505 e5bd9de5 Iustin Pop
fi
506 e5bd9de5 Iustin Pop
AC_SUBST(HTOOLS_APIDOC)
507 e5bd9de5 Iustin Pop
508 e5bd9de5 Iustin Pop
fi # end if enable_htools, define automake conditions
509 e5bd9de5 Iustin Pop
510 73b0fa69 Iustin Pop
if test "$HTOOLS" != "yes" && test "$HS_CONFD" = "True"; then
511 73b0fa69 Iustin Pop
   AC_MSG_ERROR(m4_normalize([cannot enable Haskell version of ganeti-confd if
512 73b0fa69 Iustin Pop
                              htools support is not enabled]))
513 73b0fa69 Iustin Pop
fi
514 73b0fa69 Iustin Pop
515 e5bd9de5 Iustin Pop
AM_CONDITIONAL([WANT_HTOOLS], [test x$HTOOLS = xyes])
516 b3ed0d9a Agata Murawska
AM_CONDITIONAL([WANT_HTOOLSTESTS], [test "x$GHC_PKG_QUICKCHECK" != x])
517 e5bd9de5 Iustin Pop
AM_CONDITIONAL([WANT_HTOOLSAPIDOC], [test x$HTOOLS_APIDOC = xyes])
518 e5bd9de5 Iustin Pop
519 70041061 Bernardo Dal Seno
# Check for fakeroot
520 70041061 Bernardo Dal Seno
AC_ARG_VAR(FAKEROOT_PATH, [fakeroot path])
521 70041061 Bernardo Dal Seno
AC_PATH_PROG(FAKEROOT_PATH, [fakeroot], [])
522 70041061 Bernardo Dal Seno
if test -z "$FAKEROOT_PATH"; then
523 70041061 Bernardo Dal Seno
  AC_MSG_WARN(m4_normalize([fakeroot not found, tests that must run as root
524 70041061 Bernardo Dal Seno
                            will not be executed]))
525 70041061 Bernardo Dal Seno
fi
526 70041061 Bernardo Dal Seno
AM_CONDITIONAL([HAS_FAKEROOT], [test "x$FAKEROOT_PATH" != x])
527 70041061 Bernardo Dal Seno
528 fe5b0c42 Michael Hanselmann
SOCAT_USE_ESCAPE=
529 fe5b0c42 Michael Hanselmann
AC_ARG_ENABLE([socat-escape],
530 fe5b0c42 Michael Hanselmann
  [AS_HELP_STRING([--enable-socat-escape],
531 fe5b0c42 Michael Hanselmann
    [use escape functionality available in socat >= 1.7 (default: detect
532 fe5b0c42 Michael Hanselmann
     automatically)])],
533 fe5b0c42 Michael Hanselmann
  [[if test "$enableval" = yes; then
534 fe5b0c42 Michael Hanselmann
      SOCAT_USE_ESCAPE=True
535 fe5b0c42 Michael Hanselmann
    else
536 fe5b0c42 Michael Hanselmann
      SOCAT_USE_ESCAPE=False
537 fe5b0c42 Michael Hanselmann
    fi
538 fe5b0c42 Michael Hanselmann
  ]])
539 fe5b0c42 Michael Hanselmann
540 fe5b0c42 Michael Hanselmann
if test -z "$SOCAT_USE_ESCAPE"
541 87c1d0c7 Guido Trotter
then
542 fe5b0c42 Michael Hanselmann
  if $SOCAT -hh | grep -w -q escape; then
543 fe5b0c42 Michael Hanselmann
    SOCAT_USE_ESCAPE=True
544 fe5b0c42 Michael Hanselmann
  else
545 fe5b0c42 Michael Hanselmann
    SOCAT_USE_ESCAPE=False
546 fe5b0c42 Michael Hanselmann
  fi
547 87c1d0c7 Guido Trotter
fi
548 87c1d0c7 Guido Trotter
549 fe5b0c42 Michael Hanselmann
AC_SUBST(SOCAT_USE_ESCAPE)
550 fe5b0c42 Michael Hanselmann
551 e90739d6 Michael Hanselmann
SOCAT_USE_COMPRESS=
552 e90739d6 Michael Hanselmann
AC_ARG_ENABLE([socat-compress],
553 e90739d6 Michael Hanselmann
  [AS_HELP_STRING([--enable-socat-compress],
554 e90739d6 Michael Hanselmann
    [use OpenSSL compression option available in patched socat builds
555 e90739d6 Michael Hanselmann
     (see INSTALL for details; default: detect automatically)])],
556 e90739d6 Michael Hanselmann
  [[if test "$enableval" = yes; then
557 e90739d6 Michael Hanselmann
      SOCAT_USE_COMPRESS=True
558 e90739d6 Michael Hanselmann
    else
559 e90739d6 Michael Hanselmann
      SOCAT_USE_COMPRESS=False
560 e90739d6 Michael Hanselmann
    fi
561 e90739d6 Michael Hanselmann
  ]])
562 e90739d6 Michael Hanselmann
563 e90739d6 Michael Hanselmann
if test -z "$SOCAT_USE_COMPRESS"
564 e90739d6 Michael Hanselmann
then
565 e90739d6 Michael Hanselmann
  if $SOCAT -hhh | grep -w -q openssl-compress; then
566 e90739d6 Michael Hanselmann
    SOCAT_USE_COMPRESS=True
567 e90739d6 Michael Hanselmann
  else
568 e90739d6 Michael Hanselmann
    SOCAT_USE_COMPRESS=False
569 e90739d6 Michael Hanselmann
  fi
570 e90739d6 Michael Hanselmann
fi
571 e90739d6 Michael Hanselmann
572 e90739d6 Michael Hanselmann
AC_SUBST(SOCAT_USE_COMPRESS)
573 e90739d6 Michael Hanselmann
574 5f55173b Iustin Pop
if man --help | grep -q -e --warnings
575 5f55173b Iustin Pop
then
576 5f55173b Iustin Pop
  MAN_HAS_WARNINGS=1
577 5f55173b Iustin Pop
else
578 5f55173b Iustin Pop
  MAN_HAS_WARNINGS=
579 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([man does not support --warnings, man page checks
580 30841576 Michael Hanselmann
                            will not be possible]))
581 5f55173b Iustin Pop
fi
582 5f55173b Iustin Pop
583 5f55173b Iustin Pop
AC_SUBST(MAN_HAS_WARNINGS)
584 5f55173b Iustin Pop
585 a5d17f9f Michael Hanselmann
# Check for Python
586 a8083063 Iustin Pop
AM_PATH_PYTHON(2.4)
587 a8083063 Iustin Pop
588 6e06b36c Iustin Pop
AC_PYTHON_MODULE(OpenSSL, t)
589 6e06b36c Iustin Pop
AC_PYTHON_MODULE(simplejson, t)
590 6e06b36c Iustin Pop
AC_PYTHON_MODULE(pyparsing, t)
591 0f18ee6d Guido Trotter
AC_PYTHON_MODULE(pyinotify, t)
592 28af40c8 Guido Trotter
AC_PYTHON_MODULE(pycurl, t)
593 4f6396fd Iustin Pop
AC_PYTHON_MODULE(affinity)
594 6e06b36c Iustin Pop
595 a40b1fc4 René Nussbaumer
# This is optional but then we've limited functionality
596 a40b1fc4 René Nussbaumer
AC_PYTHON_MODULE(paramiko)
597 a40b1fc4 René Nussbaumer
if test "$HAVE_PYMOD_PARAMIKO" = "no"; then
598 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([You do not have Paramiko installed. While this is
599 30841576 Michael Hanselmann
                            optional you have to configure SSH and the node
600 30841576 Michael Hanselmann
                            daemon on the joining nodes yourself.]))
601 a40b1fc4 René Nussbaumer
fi
602 a40b1fc4 René Nussbaumer
603 e8230860 Michael Hanselmann
AC_CONFIG_FILES([ Makefile ])
604 3571f686 Iustin Pop
605 a8083063 Iustin Pop
AC_OUTPUT