Statistics
| Branch: | Tag: | Revision:

root / configure.ac @ 8e4aacdc

History | View | Annotate | Download (24.7 kB)

1 a5d17f9f Michael Hanselmann
# Configure script for Ganeti
2 5e29d733 Michael Hanselmann
m4_define([gnt_version_major], [2])
3 71f35985 Klaus Aehlig
m4_define([gnt_version_minor], [10])
4 805f86d9 Thomas Thrainer
m4_define([gnt_version_revision], [4])
5 c25bd091 Thomas Thrainer
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 9f60216e Petr Pudlak
AM_INIT_AUTOMAKE([1.9 foreign tar-ustar -Wall -Wno-portability]
16 9f60216e Petr Pudlak
                 m4_esyscmd([case `automake --version | head -n 1` in
17 9f60216e Petr Pudlak
                             *1.11*);;
18 9f60216e Petr Pudlak
                             *) echo serial-tests;;
19 9f60216e Petr Pudlak
                             esac]))
20 a8083063 Iustin Pop
21 d5fd92ed Michael Hanselmann
AC_SUBST([VERSION_MAJOR], gnt_version_major)
22 d5fd92ed Michael Hanselmann
AC_SUBST([VERSION_MINOR], gnt_version_minor)
23 d5fd92ed Michael Hanselmann
AC_SUBST([VERSION_REVISION], gnt_version_revision)
24 d5fd92ed Michael Hanselmann
AC_SUBST([VERSION_SUFFIX], gnt_version_suffix)
25 d5fd92ed Michael Hanselmann
AC_SUBST([VERSION_FULL], gnt_version_full)
26 d5fd92ed Michael Hanselmann
27 ae6a0a7c Jose A. Lopes
AC_SUBST([BINDIR], $bindir)
28 ae6a0a7c Jose A. Lopes
AC_SUBST([SBINDIR], $sbindir)
29 ae6a0a7c Jose A. Lopes
AC_SUBST([MANDIR], $mandir)
30 ae6a0a7c Jose A. Lopes
31 838d26ef Klaus Aehlig
# --enable-versionfull
32 838d26ef Klaus Aehlig
AC_ARG_ENABLE([versionfull],
33 838d26ef Klaus Aehlig
  [AS_HELP_STRING([--enable-versionfull],
34 838d26ef Klaus Aehlig
                  m4_normalize([use the full version string rather
35 838d26ef Klaus Aehlig
                  than major.minor for version directories]))],
36 fd653cbd Klaus Aehlig
  [[if test "$enableval" != no; then
37 838d26ef Klaus Aehlig
      USE_VERSION_FULL=yes
38 838d26ef Klaus Aehlig
    else
39 838d26ef Klaus Aehlig
      USER_VERSION_FULL=no
40 838d26ef Klaus Aehlig
    fi
41 838d26ef Klaus Aehlig
  ]],
42 838d26ef Klaus Aehlig
  [USE_VERSION_FULL=no
43 838d26ef Klaus Aehlig
  ])
44 838d26ef Klaus Aehlig
AC_SUBST(USE_VERSION_FULL, $USE_VERSION_FULL)
45 838d26ef Klaus Aehlig
AM_CONDITIONAL([USE_VERSION_FULL], [test "$USE_VERSION_FULL" = yes])
46 838d26ef Klaus Aehlig
47 9cf292af Klaus Aehlig
# --enable-symlinks
48 9cf292af Klaus Aehlig
AC_ARG_ENABLE([symlinks],
49 9cf292af Klaus Aehlig
  [AS_HELP_STRING([--enable-symlinks],
50 c32dc51f Klaus Aehlig
                  m4_normalize([also install version-dependent symlinks under
51 c32dc51f Klaus Aehlig
                  $sysconfdir (default: enabled)]))],
52 9cf292af Klaus Aehlig
  [[if test "$enableval" != no; then
53 9cf292af Klaus Aehlig
      INSTALL_SYMLINKS=yes
54 9cf292af Klaus Aehlig
    else
55 9cf292af Klaus Aehlig
      INSTALL_SYMLINKS=no
56 9cf292af Klaus Aehlig
    fi
57 9cf292af Klaus Aehlig
  ]],
58 9cf292af Klaus Aehlig
  [INSTALL_SYMLINKS=yes
59 9cf292af Klaus Aehlig
  ])
60 9cf292af Klaus Aehlig
AC_SUBST(INSTALL_SYMLINKS, $INSTALL_SYMLINKS)
61 9cf292af Klaus Aehlig
AM_CONDITIONAL([INSTALL_SYMLINKS], [test "$INSTALL_SYMLINKS" = yes])
62 9cf292af Klaus Aehlig
63 762a28c6 Hrvoje Ribicic
# --with-haskell-flags=
64 762a28c6 Hrvoje Ribicic
AC_ARG_WITH([haskell-flags],
65 762a28c6 Hrvoje Ribicic
  [AS_HELP_STRING([--with-haskell-flags=FLAGS],
66 762a28c6 Hrvoje Ribicic
    [Extra flags to pass to GHC]
67 762a28c6 Hrvoje Ribicic
  )],
68 762a28c6 Hrvoje Ribicic
  [hextra_configure="$withval"],
69 762a28c6 Hrvoje Ribicic
  [hextra_configure=""])
70 762a28c6 Hrvoje Ribicic
AC_SUBST(HEXTRA_CONFIGURE, $hextra_configure)
71 762a28c6 Hrvoje Ribicic
72 c6b8baba Michael Hanselmann
# --with-ssh-initscript=...
73 c6b8baba Michael Hanselmann
AC_ARG_WITH([ssh-initscript],
74 8f106515 Guido Trotter
  [AS_HELP_STRING([--with-ssh-initscript=SCRIPT],
75 c6b8baba Michael Hanselmann
    [SSH init script to use (default is /etc/init.d/ssh)]
76 c6b8baba Michael Hanselmann
  )],
77 f491c3a8 Michael Hanselmann
  [ssh_initd_script="$withval"],
78 f491c3a8 Michael Hanselmann
  [ssh_initd_script="/etc/init.d/ssh"])
79 f491c3a8 Michael Hanselmann
AC_SUBST(SSH_INITD_SCRIPT, $ssh_initd_script)
80 c6b8baba Michael Hanselmann
81 68dccc07 Guido Trotter
# --with-export-dir=...
82 68dccc07 Guido Trotter
AC_ARG_WITH([export-dir],
83 68dccc07 Guido Trotter
  [AS_HELP_STRING([--with-export-dir=DIR],
84 f00b46bc Michael Hanselmann
    [directory to use by default for instance image]
85 f00b46bc Michael Hanselmann
    [ exports (default is /srv/ganeti/export)]
86 68dccc07 Guido Trotter
  )],
87 68dccc07 Guido Trotter
  [export_dir="$withval"],
88 68dccc07 Guido Trotter
  [export_dir="/srv/ganeti/export"])
89 68dccc07 Guido Trotter
AC_SUBST(EXPORT_DIR, $export_dir)
90 68dccc07 Guido Trotter
91 553bd93f Vitaly Kuznetsov
# --with-ssh-config-dir=...
92 553bd93f Vitaly Kuznetsov
AC_ARG_WITH([ssh-config-dir],
93 553bd93f Vitaly Kuznetsov
  [AS_HELP_STRING([--with-ssh-config-dir=DIR],
94 553bd93f Vitaly Kuznetsov
    [ directory with ssh host keys ]
95 553bd93f Vitaly Kuznetsov
    [ (default is /etc/ssh)]
96 553bd93f Vitaly Kuznetsov
  )],
97 553bd93f Vitaly Kuznetsov
  [ssh_config_dir="$withval"],
98 553bd93f Vitaly Kuznetsov
  [ssh_config_dir="/etc/ssh"])
99 553bd93f Vitaly Kuznetsov
AC_SUBST(SSH_CONFIG_DIR, $ssh_config_dir)
100 553bd93f Vitaly Kuznetsov
101 a8e8c0c6 Michael Hanselmann
# --with-xen-config-dir=...
102 a8e8c0c6 Michael Hanselmann
AC_ARG_WITH([xen-config-dir],
103 a8e8c0c6 Michael Hanselmann
  [AS_HELP_STRING([--with-xen-config-dir=DIR],
104 a8e8c0c6 Michael Hanselmann
                  m4_normalize([Xen configuration directory
105 a8e8c0c6 Michael Hanselmann
                                (default: /etc/xen)]))],
106 a8e8c0c6 Michael Hanselmann
  [xen_config_dir="$withval"],
107 a8e8c0c6 Michael Hanselmann
  [xen_config_dir=/etc/xen])
108 a8e8c0c6 Michael Hanselmann
AC_SUBST(XEN_CONFIG_DIR, $xen_config_dir)
109 a8e8c0c6 Michael Hanselmann
110 7c3d51d4 Guido Trotter
# --with-os-search-path=...
111 7c3d51d4 Guido Trotter
AC_ARG_WITH([os-search-path],
112 7c3d51d4 Guido Trotter
  [AS_HELP_STRING([--with-os-search-path=LIST],
113 f00b46bc Michael Hanselmann
    [comma separated list of directories to]
114 f00b46bc Michael Hanselmann
    [ search for OS images (default is /srv/ganeti/os)]
115 7c3d51d4 Guido Trotter
  )],
116 f1b816b7 Jose A. Lopes
  [os_search_path="$withval"],
117 3311e336 Jose A. Lopes
  [os_search_path="/srv/ganeti/os"])
118 7c3d51d4 Guido Trotter
AC_SUBST(OS_SEARCH_PATH, $os_search_path)
119 7c3d51d4 Guido Trotter
120 376631d1 Constantinos Venetsanopoulos
# --with-extstorage-search-path=...
121 376631d1 Constantinos Venetsanopoulos
AC_ARG_WITH([extstorage-search-path],
122 376631d1 Constantinos Venetsanopoulos
  [AS_HELP_STRING([--with-extstorage-search-path=LIST],
123 376631d1 Constantinos Venetsanopoulos
    [comma separated list of directories to]
124 376631d1 Constantinos Venetsanopoulos
    [ search for External Storage Providers]
125 376631d1 Constantinos Venetsanopoulos
    [ (default is /srv/ganeti/extstorage)]
126 376631d1 Constantinos Venetsanopoulos
  )],
127 f1b816b7 Jose A. Lopes
  [es_search_path="$withval"],
128 3311e336 Jose A. Lopes
  [es_search_path="/srv/ganeti/extstorage"])
129 376631d1 Constantinos Venetsanopoulos
AC_SUBST(ES_SEARCH_PATH, $es_search_path)
130 376631d1 Constantinos Venetsanopoulos
131 298fe380 Iustin Pop
# --with-iallocator-search-path=...
132 298fe380 Iustin Pop
AC_ARG_WITH([iallocator-search-path],
133 298fe380 Iustin Pop
  [AS_HELP_STRING([--with-iallocator-search-path=LIST],
134 298fe380 Iustin Pop
    [comma separated list of directories to]
135 298fe380 Iustin Pop
    [ search for instance allocators (default is $libdir/ganeti/iallocators)]
136 298fe380 Iustin Pop
  )],
137 f1b816b7 Jose A. Lopes
  [iallocator_search_path="$withval"],
138 3311e336 Jose A. Lopes
  [iallocator_search_path="$libdir/$PACKAGE_NAME/iallocators"])
139 298fe380 Iustin Pop
AC_SUBST(IALLOCATOR_SEARCH_PATH, $iallocator_search_path)
140 298fe380 Iustin Pop
141 2f2dbb4b Jun Futagawa
# --with-xen-bootloader=...
142 2f2dbb4b Jun Futagawa
AC_ARG_WITH([xen-bootloader],
143 2f2dbb4b Jun Futagawa
  [AS_HELP_STRING([--with-xen-bootloader=PATH],
144 2f2dbb4b Jun Futagawa
    [bootloader for Xen hypervisor (default is empty)]
145 2f2dbb4b Jun Futagawa
  )],
146 2f2dbb4b Jun Futagawa
  [xen_bootloader="$withval"],
147 2f2dbb4b Jun Futagawa
  [xen_bootloader=])
148 2f2dbb4b Jun Futagawa
AC_SUBST(XEN_BOOTLOADER, $xen_bootloader)
149 2f2dbb4b Jun Futagawa
150 f00b46bc Michael Hanselmann
# --with-xen-kernel=...
151 f00b46bc Michael Hanselmann
AC_ARG_WITH([xen-kernel],
152 f00b46bc Michael Hanselmann
  [AS_HELP_STRING([--with-xen-kernel=PATH],
153 b8203e1e Iustin Pop
    [DomU kernel image for Xen hypervisor (default is /boot/vmlinuz-3-xenU)]
154 f00b46bc Michael Hanselmann
  )],
155 f00b46bc Michael Hanselmann
  [xen_kernel="$withval"],
156 b8203e1e Iustin Pop
  [xen_kernel="/boot/vmlinuz-3-xenU"])
157 f00b46bc Michael Hanselmann
AC_SUBST(XEN_KERNEL, $xen_kernel)
158 f00b46bc Michael Hanselmann
159 f00b46bc Michael Hanselmann
# --with-xen-initrd=...
160 f00b46bc Michael Hanselmann
AC_ARG_WITH([xen-initrd],
161 f00b46bc Michael Hanselmann
  [AS_HELP_STRING([--with-xen-initrd=PATH],
162 b8203e1e Iustin Pop
    [DomU initrd image for Xen hypervisor (default is /boot/initrd-3-xenU)]
163 f00b46bc Michael Hanselmann
  )],
164 f00b46bc Michael Hanselmann
  [xen_initrd="$withval"],
165 b8203e1e Iustin Pop
  [xen_initrd="/boot/initrd-3-xenU"])
166 f00b46bc Michael Hanselmann
AC_SUBST(XEN_INITRD, $xen_initrd)
167 f00b46bc Michael Hanselmann
168 b8203e1e Iustin Pop
# --with-kvm-kernel=...
169 b8203e1e Iustin Pop
AC_ARG_WITH([kvm-kernel],
170 b8203e1e Iustin Pop
  [AS_HELP_STRING([--with-kvm-kernel=PATH],
171 b8203e1e Iustin Pop
    [Guest kernel image for KVM hypervisor (default is /boot/vmlinuz-3-kvmU)]
172 b8203e1e Iustin Pop
  )],
173 b8203e1e Iustin Pop
  [kvm_kernel="$withval"],
174 b8203e1e Iustin Pop
  [kvm_kernel="/boot/vmlinuz-3-kvmU"])
175 b8203e1e Iustin Pop
AC_SUBST(KVM_KERNEL, $kvm_kernel)
176 b8203e1e Iustin Pop
177 7e2c5b9e Guido Trotter
# --with-kvm-path=...
178 7e2c5b9e Guido Trotter
AC_ARG_WITH([kvm-path],
179 7e2c5b9e Guido Trotter
  [AS_HELP_STRING([--with-kvm-path=PATH],
180 7e2c5b9e Guido Trotter
    [absolute path to the kvm binary]
181 7e2c5b9e Guido Trotter
    [ (default is /usr/bin/kvm)]
182 7e2c5b9e Guido Trotter
  )],
183 7e2c5b9e Guido Trotter
  [kvm_path="$withval"],
184 7e2c5b9e Guido Trotter
  [kvm_path="/usr/bin/kvm"])
185 7e2c5b9e Guido Trotter
AC_SUBST(KVM_PATH, $kvm_path)
186 7e2c5b9e Guido Trotter
187 89b70f39 Iustin Pop
# --with-lvm-stripecount=...
188 3736cb6b Iustin Pop
AC_ARG_WITH([lvm-stripecount],
189 3736cb6b Iustin Pop
  [AS_HELP_STRING([--with-lvm-stripecount=NUM],
190 43e11798 Andrea Spadaccini
    [the default number of stripes to use for LVM volumes]
191 7b3ac94d Iustin Pop
    [ (default is 1)]
192 3736cb6b Iustin Pop
  )],
193 3736cb6b Iustin Pop
  [lvm_stripecount="$withval"],
194 52fca4ba Michael Hanselmann
  [lvm_stripecount=1])
195 3736cb6b Iustin Pop
AC_SUBST(LVM_STRIPECOUNT, $lvm_stripecount)
196 3736cb6b Iustin Pop
197 052783ff Michael Hanselmann
# --with-ssh-login-user=...
198 052783ff Michael Hanselmann
AC_ARG_WITH([ssh-login-user],
199 052783ff Michael Hanselmann
  [AS_HELP_STRING([--with-ssh-login-user=USERNAME],
200 052783ff Michael Hanselmann
    [user to use for SSH logins within the cluster (default is root)]
201 052783ff Michael Hanselmann
  )],
202 052783ff Michael Hanselmann
  [ssh_login_user="$withval"],
203 052783ff Michael Hanselmann
  [ssh_login_user=root])
204 052783ff Michael Hanselmann
AC_SUBST(SSH_LOGIN_USER, $ssh_login_user)
205 052783ff Michael Hanselmann
206 052783ff Michael Hanselmann
# --with-ssh-console-user=...
207 052783ff Michael Hanselmann
AC_ARG_WITH([ssh-console-user],
208 052783ff Michael Hanselmann
  [AS_HELP_STRING([--with-ssh-console-user=USERNAME],
209 052783ff Michael Hanselmann
    [user to use for SSH logins to access instance consoles (default is root)]
210 052783ff Michael Hanselmann
  )],
211 052783ff Michael Hanselmann
  [ssh_console_user="$withval"],
212 052783ff Michael Hanselmann
  [ssh_console_user=root])
213 052783ff Michael Hanselmann
AC_SUBST(SSH_CONSOLE_USER, $ssh_console_user)
214 052783ff Michael Hanselmann
215 a6798ce1 Michael Hanselmann
# --with-default-user=...
216 a6798ce1 Michael Hanselmann
AC_ARG_WITH([default-user],
217 a6798ce1 Michael Hanselmann
  [AS_HELP_STRING([--with-default-user=USERNAME],
218 a6798ce1 Michael Hanselmann
    [default user for daemons]
219 a6798ce1 Michael Hanselmann
    [ (default is to run all daemons as root)]
220 a6798ce1 Michael Hanselmann
  )],
221 a6798ce1 Michael Hanselmann
  [user_default="$withval"],
222 a6798ce1 Michael Hanselmann
  [user_default=root])
223 a6798ce1 Michael Hanselmann
224 a6798ce1 Michael Hanselmann
# --with-default-group=...
225 a6798ce1 Michael Hanselmann
AC_ARG_WITH([default-group],
226 a6798ce1 Michael Hanselmann
  [AS_HELP_STRING([--with-default-group=GROUPNAME],
227 a6798ce1 Michael Hanselmann
    [default group for daemons]
228 a6798ce1 Michael Hanselmann
    [ (default is to run all daemons under group root)]
229 a6798ce1 Michael Hanselmann
  )],
230 a6798ce1 Michael Hanselmann
  [group_default="$withval"],
231 a6798ce1 Michael Hanselmann
  [group_default=root])
232 a6798ce1 Michael Hanselmann
233 0d150c50 René Nussbaumer
# --with-user-prefix=...
234 0d150c50 René Nussbaumer
AC_ARG_WITH([user-prefix],
235 0d150c50 René Nussbaumer
  [AS_HELP_STRING([--with-user-prefix=PREFIX],
236 0d150c50 René Nussbaumer
    [prefix for daemon users]
237 a6798ce1 Michael Hanselmann
    [ (default is to run all daemons as root; use --with-default-user]
238 a6798ce1 Michael Hanselmann
    [ to change the default)]
239 0d150c50 René Nussbaumer
  )],
240 3794937c René Nussbaumer
  [user_masterd="${withval}masterd";
241 0d150c50 René Nussbaumer
   user_rapi="${withval}rapi";
242 3794937c René Nussbaumer
   user_confd="${withval}confd";
243 3695a4e0 Thomas Thrainer
   user_luxid="${withval}luxid";
244 14013e5d Michele Tartara
   user_noded="$user_default";
245 ebcbcfee Michele Tartara
   user_mond="$user_default"],
246 a6798ce1 Michael Hanselmann
  [user_masterd="$user_default";
247 a6798ce1 Michael Hanselmann
   user_rapi="$user_default";
248 a6798ce1 Michael Hanselmann
   user_confd="$user_default";
249 3695a4e0 Thomas Thrainer
   user_luxid="$user_default";
250 14013e5d Michele Tartara
   user_noded="$user_default";
251 14013e5d Michele Tartara
   user_mond="$user_default"])
252 0d150c50 René Nussbaumer
AC_SUBST(MASTERD_USER, $user_masterd)
253 0d150c50 René Nussbaumer
AC_SUBST(RAPI_USER, $user_rapi)
254 0d150c50 René Nussbaumer
AC_SUBST(CONFD_USER, $user_confd)
255 3695a4e0 Thomas Thrainer
AC_SUBST(LUXID_USER, $user_luxid)
256 0d150c50 René Nussbaumer
AC_SUBST(NODED_USER, $user_noded)
257 14013e5d Michele Tartara
AC_SUBST(MOND_USER, $user_mond)
258 0d150c50 René Nussbaumer
259 0d150c50 René Nussbaumer
# --with-group-prefix=...
260 0d150c50 René Nussbaumer
AC_ARG_WITH([group-prefix],
261 0d150c50 René Nussbaumer
  [AS_HELP_STRING([--with-group-prefix=PREFIX],
262 0d150c50 René Nussbaumer
    [prefix for daemon POSIX groups]
263 a6798ce1 Michael Hanselmann
    [ (default is to run all daemons under group root; use]
264 a6798ce1 Michael Hanselmann
    [ --with-default-group to change the default)]
265 0d150c50 René Nussbaumer
  )],
266 3794937c René Nussbaumer
  [group_rapi="${withval}rapi";
267 3794937c René Nussbaumer
   group_admin="${withval}admin";
268 3794937c René Nussbaumer
   group_confd="${withval}confd";
269 3695a4e0 Thomas Thrainer
   group_luxid="${withval}luxid";
270 3794937c René Nussbaumer
   group_masterd="${withval}masterd";
271 a6798ce1 Michael Hanselmann
   group_noded="$group_default";
272 14013e5d Michele Tartara
   group_daemons="${withval}daemons";
273 ebcbcfee Michele Tartara
   group_mond="$group_default"],
274 a6798ce1 Michael Hanselmann
  [group_rapi="$group_default";
275 a6798ce1 Michael Hanselmann
   group_admin="$group_default";
276 a6798ce1 Michael Hanselmann
   group_confd="$group_default";
277 3695a4e0 Thomas Thrainer
   group_luxid="$group_default";
278 a6798ce1 Michael Hanselmann
   group_masterd="$group_default";
279 a6798ce1 Michael Hanselmann
   group_noded="$group_default";
280 14013e5d Michele Tartara
   group_daemons="$group_default";
281 14013e5d Michele Tartara
   group_mond="$group_default"])
282 0d150c50 René Nussbaumer
AC_SUBST(RAPI_GROUP, $group_rapi)
283 0d150c50 René Nussbaumer
AC_SUBST(ADMIN_GROUP, $group_admin)
284 0d150c50 René Nussbaumer
AC_SUBST(CONFD_GROUP, $group_confd)
285 3695a4e0 Thomas Thrainer
AC_SUBST(LUXID_GROUP, $group_luxid)
286 0d150c50 René Nussbaumer
AC_SUBST(MASTERD_GROUP, $group_masterd)
287 03881cb0 René Nussbaumer
AC_SUBST(NODED_GROUP, $group_noded)
288 0d150c50 René Nussbaumer
AC_SUBST(DAEMONS_GROUP, $group_daemons)
289 14013e5d Michele Tartara
AC_SUBST(MOND_GROUP, $group_mond)
290 0d150c50 René Nussbaumer
291 0d150c50 René Nussbaumer
# Print the config to the user
292 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Running ganeti-masterd as $group_masterd:$group_masterd])
293 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Running ganeti-rapi as $user_rapi:$group_rapi])
294 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Running ganeti-confd as $user_confd:$group_confd])
295 3695a4e0 Thomas Thrainer
AC_MSG_NOTICE([Running ganeti-luxid as $user_luxid:$group_luxid])
296 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Group for daemons is $group_daemons])
297 0d150c50 René Nussbaumer
AC_MSG_NOTICE([Group for clients is $group_admin])
298 0d150c50 René Nussbaumer
299 89b70f39 Iustin Pop
# --enable-drbd-barriers
300 89b70f39 Iustin Pop
AC_ARG_ENABLE([drbd-barriers],
301 89b70f39 Iustin Pop
  [AS_HELP_STRING([--enable-drbd-barriers],
302 52fca4ba Michael Hanselmann
                  m4_normalize([enable the DRBD barriers functionality by
303 52fca4ba Michael Hanselmann
                                default (>= 8.0.12) (default: enabled)]))],
304 89b70f39 Iustin Pop
  [[if test "$enableval" != no; then
305 8a69b3a8 Andrea Spadaccini
      DRBD_BARRIERS=n
306 8a69b3a8 Andrea Spadaccini
      DRBD_NO_META_FLUSH=False
307 89b70f39 Iustin Pop
    else
308 15618b63 Michael Hanselmann
      DRBD_BARRIERS=bf
309 8a69b3a8 Andrea Spadaccini
      DRBD_NO_META_FLUSH=True
310 89b70f39 Iustin Pop
    fi
311 89b70f39 Iustin Pop
  ]],
312 8a69b3a8 Andrea Spadaccini
  [DRBD_BARRIERS=n
313 8a69b3a8 Andrea Spadaccini
   DRBD_NO_META_FLUSH=False
314 8a69b3a8 Andrea Spadaccini
  ])
315 89b70f39 Iustin Pop
AC_SUBST(DRBD_BARRIERS, $DRBD_BARRIERS)
316 8a69b3a8 Andrea Spadaccini
AC_SUBST(DRBD_NO_META_FLUSH, $DRBD_NO_META_FLUSH)
317 89b70f39 Iustin Pop
318 551b6283 Iustin Pop
# --enable-syslog[=no/yes/only]
319 551b6283 Iustin Pop
AC_ARG_ENABLE([syslog],
320 551b6283 Iustin Pop
  [AS_HELP_STRING([--enable-syslog],
321 551b6283 Iustin Pop
    [enable use of syslog (default: disabled), one of no/yes/only])],
322 551b6283 Iustin Pop
  [[case "$enableval" in
323 551b6283 Iustin Pop
      no)
324 551b6283 Iustin Pop
        SYSLOG=no
325 551b6283 Iustin Pop
        ;;
326 551b6283 Iustin Pop
      yes)
327 551b6283 Iustin Pop
        SYSLOG=yes
328 551b6283 Iustin Pop
        ;;
329 551b6283 Iustin Pop
      only)
330 551b6283 Iustin Pop
        SYSLOG=only
331 551b6283 Iustin Pop
        ;;
332 551b6283 Iustin Pop
      *)
333 551b6283 Iustin Pop
        SYSLOG=
334 551b6283 Iustin Pop
        ;;
335 551b6283 Iustin Pop
    esac
336 551b6283 Iustin Pop
  ]],
337 551b6283 Iustin Pop
  [SYSLOG=no])
338 551b6283 Iustin Pop
339 551b6283 Iustin Pop
if test -z "$SYSLOG"
340 551b6283 Iustin Pop
then
341 551b6283 Iustin Pop
  AC_MSG_ERROR([invalid value for syslog, choose one of no/yes/only])
342 551b6283 Iustin Pop
fi
343 551b6283 Iustin Pop
AC_SUBST(SYSLOG_USAGE, $SYSLOG)
344 551b6283 Iustin Pop
345 ba0d1044 Jose A. Lopes
# --enable-restricted-commands[=no/yes]
346 1fdeb284 Michael Hanselmann
AC_ARG_ENABLE([restricted-commands],
347 1fdeb284 Michael Hanselmann
  [AS_HELP_STRING([--enable-restricted-commands],
348 1fdeb284 Michael Hanselmann
                  m4_normalize([enable restricted commands in the node daemon
349 9108958f Michael Hanselmann
                                (default: disabled)]))],
350 9108958f Michael Hanselmann
  [[if test "$enableval" = no; then
351 1fdeb284 Michael Hanselmann
      enable_restricted_commands=False
352 9108958f Michael Hanselmann
    else
353 1fdeb284 Michael Hanselmann
      enable_restricted_commands=True
354 9108958f Michael Hanselmann
    fi
355 9108958f Michael Hanselmann
  ]],
356 1fdeb284 Michael Hanselmann
  [enable_restricted_commands=False])
357 1fdeb284 Michael Hanselmann
AC_SUBST(ENABLE_RESTRICTED_COMMANDS, $enable_restricted_commands)
358 9108958f Michael Hanselmann
359 3536c792 Iustin Pop
# --with-disk-separator=...
360 3536c792 Iustin Pop
AC_ARG_WITH([disk-separator],
361 3536c792 Iustin Pop
  [AS_HELP_STRING([--with-disk-separator=STRING],
362 30841576 Michael Hanselmann
    [Disk index separator, useful if the default of ':' is handled]
363 30841576 Michael Hanselmann
    [ specially by the hypervisor]
364 3536c792 Iustin Pop
  )],
365 3536c792 Iustin Pop
  [disk_separator="$withval"],
366 3536c792 Iustin Pop
  [disk_separator=":"])
367 3536c792 Iustin Pop
AC_SUBST(DISK_SEPARATOR, $disk_separator)
368 3536c792 Iustin Pop
369 a5d17f9f Michael Hanselmann
# Check common programs
370 a8083063 Iustin Pop
AC_PROG_INSTALL
371 9ff7e35c Michael Hanselmann
AC_PROG_LN_S
372 a8083063 Iustin Pop
373 a849f598 Klaus Aehlig
# check if ln is the GNU version of ln (and hence supports -T)
374 a849f598 Klaus Aehlig
if ln --version 2> /dev/null | head -1 | grep -q GNU
375 a849f598 Klaus Aehlig
then
376 a849f598 Klaus Aehlig
  AC_SUBST(HAS_GNU_LN, True)
377 a849f598 Klaus Aehlig
else
378 a849f598 Klaus Aehlig
  AC_SUBST(HAS_GNU_LN, False)
379 a849f598 Klaus Aehlig
fi
380 a849f598 Klaus Aehlig
381 c4dfb0b6 Andrea Spadaccini
# Check for the ip command
382 c4dfb0b6 Andrea Spadaccini
AC_ARG_VAR(IP_PATH, [ip path])
383 c4dfb0b6 Andrea Spadaccini
AC_PATH_PROG(IP_PATH, [ip], [])
384 c4dfb0b6 Andrea Spadaccini
if test -z "$IP_PATH"
385 c4dfb0b6 Andrea Spadaccini
then
386 c4dfb0b6 Andrea Spadaccini
  AC_MSG_ERROR([ip command not found])
387 c4dfb0b6 Andrea Spadaccini
fi
388 c4dfb0b6 Andrea Spadaccini
389 18e2b6e4 Iustin Pop
# Check for pandoc
390 5208e732 Iustin Pop
AC_ARG_VAR(PANDOC, [pandoc path])
391 5208e732 Iustin Pop
AC_PATH_PROG(PANDOC, [pandoc], [])
392 5208e732 Iustin Pop
if test -z "$PANDOC"
393 5208e732 Iustin Pop
then
394 5208e732 Iustin Pop
  AC_MSG_WARN([pandoc not found, man pages rebuild will not be possible])
395 5208e732 Iustin Pop
fi
396 5208e732 Iustin Pop
397 d17e74b4 Iustin Pop
# Check for python-sphinx
398 d17e74b4 Iustin Pop
AC_ARG_VAR(SPHINX, [sphinx-build path])
399 d17e74b4 Iustin Pop
AC_PATH_PROG(SPHINX, [sphinx-build], [])
400 d17e74b4 Iustin Pop
if test -z "$SPHINX"
401 f05c99f3 Michael Hanselmann
then
402 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([sphinx-build not found, documentation rebuild will
403 30841576 Michael Hanselmann
                            not be possible]))
404 96b28307 Michael Hanselmann
else
405 96b28307 Michael Hanselmann
  # Sphinx exits with code 1 when it prints its usage
406 96b28307 Michael Hanselmann
  sphinxver=`{ $SPHINX --version 2>&1 || :; } | head -n 3`
407 96b28307 Michael Hanselmann
408 96b28307 Michael Hanselmann
  if ! echo "$sphinxver" | grep -q -w -e '^Sphinx' -e '^Usage:'; then
409 96b28307 Michael Hanselmann
    AC_MSG_ERROR([Unable to determine Sphinx version])
410 96b28307 Michael Hanselmann
411 96b28307 Michael Hanselmann
  # Note: Character classes ([...]) need to be double quoted due to autoconf
412 96b28307 Michael Hanselmann
  # using m4
413 47387ccb Klaus Aehlig
  elif ! echo "$sphinxver" | grep -q -E \
414 47387ccb Klaus Aehlig
       '^Sphinx[[[:space:]]]+(\(sphinx-build\)[[[:space:]]]+|v)[[1-9]]\>'; then
415 96b28307 Michael Hanselmann
    AC_MSG_ERROR([Sphinx 1.0 or higher is required])
416 96b28307 Michael Hanselmann
  fi
417 f05c99f3 Michael Hanselmann
fi
418 d99dd9c7 Michele Tartara
AM_CONDITIONAL([HAS_SPHINX], [test -n "$SPHINX"])
419 f05c99f3 Michael Hanselmann
420 41806ef4 Michael Hanselmann
AC_ARG_ENABLE([manpages-in-doc],
421 41806ef4 Michael Hanselmann
  [AS_HELP_STRING([--enable-manpages-in-doc],
422 41806ef4 Michael Hanselmann
                  m4_normalize([include man pages in HTML documentation
423 41806ef4 Michael Hanselmann
                                (requires sphinx; default disabled)]))],
424 41806ef4 Michael Hanselmann
  [case "$enableval" in
425 41806ef4 Michael Hanselmann
      yes) manpages_in_doc=yes ;;
426 41806ef4 Michael Hanselmann
      no) manpages_in_doc= ;;
427 41806ef4 Michael Hanselmann
      *)
428 41806ef4 Michael Hanselmann
        AC_MSG_ERROR([Bad value $enableval for --enable-manpages-in-doc])
429 41806ef4 Michael Hanselmann
        ;;
430 41806ef4 Michael Hanselmann
    esac
431 41806ef4 Michael Hanselmann
  ],
432 41806ef4 Michael Hanselmann
  [manpages_in_doc=])
433 41806ef4 Michael Hanselmann
AM_CONDITIONAL([MANPAGES_IN_DOC], [test -n "$manpages_in_doc"])
434 41806ef4 Michael Hanselmann
AC_SUBST(MANPAGES_IN_DOC, $manpages_in_doc)
435 41806ef4 Michael Hanselmann
436 41806ef4 Michael Hanselmann
if test -z "$SPHINX" -a -n "$manpages_in_doc"; then
437 41806ef4 Michael Hanselmann
  AC_MSG_ERROR([Including man pages in HTML documentation requires sphinx])
438 41806ef4 Michael Hanselmann
fi
439 41806ef4 Michael Hanselmann
440 f86e82ef Iustin Pop
# Check for graphviz (dot)
441 f86e82ef Iustin Pop
AC_ARG_VAR(DOT, [dot path])
442 f86e82ef Iustin Pop
AC_PATH_PROG(DOT, [dot], [])
443 f86e82ef Iustin Pop
if test -z "$DOT"
444 f86e82ef Iustin Pop
then
445 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([dot (from the graphviz suite) not found,
446 30841576 Michael Hanselmann
                            documentation rebuild not possible]))
447 f86e82ef Iustin Pop
fi
448 f86e82ef Iustin Pop
449 6d7cc5ff Michael Hanselmann
# Check for pylint
450 6d7cc5ff Michael Hanselmann
AC_ARG_VAR(PYLINT, [pylint path])
451 6d7cc5ff Michael Hanselmann
AC_PATH_PROG(PYLINT, [pylint], [])
452 6d7cc5ff Michael Hanselmann
if test -z "$PYLINT"
453 6d7cc5ff Michael Hanselmann
then
454 6d7cc5ff Michael Hanselmann
  AC_MSG_WARN([pylint not found, checking code will not be possible])
455 6d7cc5ff Michael Hanselmann
fi
456 6d7cc5ff Michael Hanselmann
457 08366664 Michael Hanselmann
# Check for pep8
458 08366664 Michael Hanselmann
AC_ARG_VAR(PEP8, [pep8 path])
459 08366664 Michael Hanselmann
AC_PATH_PROG(PEP8, [pep8], [])
460 08366664 Michael Hanselmann
if test -z "$PEP8"
461 08366664 Michael Hanselmann
then
462 08366664 Michael Hanselmann
  AC_MSG_WARN([pep8 not found, checking code will not be complete])
463 08366664 Michael Hanselmann
fi
464 141c8421 Michael Hanselmann
AM_CONDITIONAL([HAS_PEP8], [test -n "$PEP8"])
465 141c8421 Michael Hanselmann
466 141c8421 Michael Hanselmann
# Check for python-coverage
467 141c8421 Michael Hanselmann
AC_ARG_VAR(PYCOVERAGE, [python-coverage path])
468 141c8421 Michael Hanselmann
AC_PATH_PROGS(PYCOVERAGE, [python-coverage coverage], [])
469 141c8421 Michael Hanselmann
if test -z "$PYCOVERAGE"
470 141c8421 Michael Hanselmann
then
471 141c8421 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([python-coverage or coverage not found, evaluating
472 141c8421 Michael Hanselmann
                            Python test coverage will not be possible]))
473 141c8421 Michael Hanselmann
fi
474 08366664 Michael Hanselmann
475 fe5b0c42 Michael Hanselmann
# Check for socat
476 fe5b0c42 Michael Hanselmann
AC_ARG_VAR(SOCAT, [socat path])
477 fe5b0c42 Michael Hanselmann
AC_PATH_PROG(SOCAT, [socat], [])
478 87c1d0c7 Guido Trotter
if test -z "$SOCAT"
479 87c1d0c7 Guido Trotter
then
480 fe5b0c42 Michael Hanselmann
  AC_MSG_ERROR([socat not found])
481 87c1d0c7 Guido Trotter
fi
482 87c1d0c7 Guido Trotter
483 a002ed79 Agata Murawska
# Check for qemu-img
484 a002ed79 Agata Murawska
AC_ARG_VAR(QEMUIMG_PATH, [qemu-img path])
485 a002ed79 Agata Murawska
AC_PATH_PROG(QEMUIMG_PATH, [qemu-img], [])
486 a002ed79 Agata Murawska
if test -z "$QEMUIMG_PATH"
487 a002ed79 Agata Murawska
then
488 a002ed79 Agata Murawska
  AC_MSG_WARN([qemu-img not found, using ovfconverter will not be possible])
489 a002ed79 Agata Murawska
fi
490 a002ed79 Agata Murawska
491 21a5e56c Iustin Pop
# --enable-confd
492 21a5e56c Iustin Pop
ENABLE_CONFD=
493 21a5e56c Iustin Pop
AC_ARG_ENABLE([confd],
494 21a5e56c Iustin Pop
  [AS_HELP_STRING([--enable-confd],
495 21a5e56c Iustin Pop
  [enable the ganeti-confd daemon (default: check)])],
496 21a5e56c Iustin Pop
  [],
497 21a5e56c Iustin Pop
  [enable_confd=check])
498 acf70442 Iustin Pop
499 14013e5d Michele Tartara
ENABLE_MOND=
500 35c6e63d Michele Tartara
AC_ARG_ENABLE([monitoring],
501 35c6e63d Michele Tartara
  [AS_HELP_STRING([--enable-monitoring],
502 13cc7b84 Michele Tartara
  [enable the ganeti monitoring daemon (default: check)])],
503 35c6e63d Michele Tartara
  [],
504 35c6e63d Michele Tartara
  [enable_monitoring=check])
505 35c6e63d Michele Tartara
506 e5bd9de5 Iustin Pop
# Check for ghc
507 e5bd9de5 Iustin Pop
AC_ARG_VAR(GHC, [ghc path])
508 e5bd9de5 Iustin Pop
AC_PATH_PROG(GHC, [ghc], [])
509 e5bd9de5 Iustin Pop
if test -z "$GHC"; then
510 21a5e56c Iustin Pop
  AC_MSG_FAILURE([ghc not found, compilation will not possible])
511 e5bd9de5 Iustin Pop
fi
512 e5bd9de5 Iustin Pop
513 39f0eea5 Iustin Pop
AC_MSG_CHECKING([checking for extra GHC flags])
514 52fca4ba Michael Hanselmann
GHC_BYVERSION_FLAGS=
515 39f0eea5 Iustin Pop
# check for GHC supported flags that vary accross versions
516 39f0eea5 Iustin Pop
for flag in -fwarn-incomplete-uni-patterns; do
517 52fca4ba Michael Hanselmann
  if $GHC -e '0' $flag >/dev/null 2>/dev/null; then
518 39f0eea5 Iustin Pop
   GHC_BYVERSION_FLAGS="$GHC_BYVERSION_FLAGS $flag"
519 39f0eea5 Iustin Pop
  fi
520 39f0eea5 Iustin Pop
done
521 39f0eea5 Iustin Pop
AC_MSG_RESULT($GHC_BYVERSION_FLAGS)
522 39f0eea5 Iustin Pop
AC_SUBST(GHC_BYVERSION_FLAGS)
523 39f0eea5 Iustin Pop
524 e5bd9de5 Iustin Pop
# Check for ghc-pkg
525 e5bd9de5 Iustin Pop
AC_ARG_VAR(GHC_PKG, [ghc-pkg path])
526 e5bd9de5 Iustin Pop
AC_PATH_PROG(GHC_PKG, [ghc-pkg], [])
527 e5bd9de5 Iustin Pop
if test -z "$GHC_PKG"; then
528 21a5e56c Iustin Pop
  AC_MSG_FAILURE([ghc-pkg not found, compilation will not be possible])
529 21a5e56c Iustin Pop
fi
530 21a5e56c Iustin Pop
531 21a5e56c Iustin Pop
# check for modules, first custom/special checks
532 21a5e56c Iustin Pop
AC_MSG_NOTICE([checking for required haskell modules])
533 d9a900dc Iustin Pop
HS_PARALLEL3=
534 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([parallel-3.*], [HS_PARALLEL3=-DPARALLEL3],
535 21a5e56c Iustin Pop
                 [AC_GHC_PKG_REQUIRE(parallel)], t)
536 d9a900dc Iustin Pop
AC_SUBST(HS_PARALLEL3)
537 21a5e56c Iustin Pop
538 21a5e56c Iustin Pop
# and now standard modules
539 1ca709c1 Iustin Pop
AC_GHC_PKG_REQUIRE(curl)
540 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(json)
541 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(network)
542 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(mtl)
543 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(bytestring)
544 21a5e56c Iustin Pop
AC_GHC_PKG_REQUIRE(utf8-string)
545 6c60b266 Klaus Aehlig
AC_GHC_PKG_REQUIRE(hslogger)
546 21a5e56c Iustin Pop
547 21a5e56c Iustin Pop
# extra modules for confd functionality
548 d9a900dc Iustin Pop
HS_REGEX_PCRE=-DNO_REGEX_PCRE
549 21a5e56c Iustin Pop
has_confd=False
550 52fca4ba Michael Hanselmann
if test "$enable_confd" != no; then
551 21a5e56c Iustin Pop
  CONFD_PKG=
552 d9a900dc Iustin Pop
  AC_GHC_PKG_CHECK([regex-pcre], [HS_REGEX_PCRE=],
553 21a5e56c Iustin Pop
                   [CONFD_PKG="$CONFD_PKG regex-pcre"])
554 21a5e56c Iustin Pop
  AC_GHC_PKG_CHECK([Crypto], [], [CONFD_PKG="$CONFD_PKG Crypto"])
555 21a5e56c Iustin Pop
  AC_GHC_PKG_CHECK([text], [], [CONFD_PKG="$CONFD_PKG text"])
556 21a5e56c Iustin Pop
  AC_GHC_PKG_CHECK([hinotify], [], [CONFD_PKG="$CONFD_PKG hinotify"])
557 432d62a8 Helga Velroyen
  AC_GHC_PKG_CHECK([vector], [], [CONFD_PKG="$CONFD_PKG vector"])
558 21a5e56c Iustin Pop
  if test -z "$CONFD_PKG"; then
559 21a5e56c Iustin Pop
    has_confd=True
560 52fca4ba Michael Hanselmann
  elif test "$enable_confd" = check; then
561 52fca4ba Michael Hanselmann
    AC_MSG_WARN(m4_normalize([The required extra libraries for confd were
562 52fca4ba Michael Hanselmann
                              not found ($CONFD_PKG), confd disabled]))
563 e5bd9de5 Iustin Pop
  else
564 52fca4ba Michael Hanselmann
    AC_MSG_FAILURE(m4_normalize([The confd functionality was requested, but
565 52fca4ba Michael Hanselmann
                                 required libraries were not found:
566 52fca4ba Michael Hanselmann
                                 $CONFD_PKG]))
567 e5bd9de5 Iustin Pop
  fi
568 e5bd9de5 Iustin Pop
fi
569 d9a900dc Iustin Pop
AC_SUBST(HS_REGEX_PCRE)
570 52fca4ba Michael Hanselmann
if test "$has_confd" = True; then
571 21a5e56c Iustin Pop
  AC_MSG_NOTICE([Enabling confd usage])
572 21a5e56c Iustin Pop
fi
573 21a5e56c Iustin Pop
AC_SUBST(ENABLE_CONFD, $has_confd)
574 21a5e56c Iustin Pop
AM_CONDITIONAL([ENABLE_CONFD], [test x$has_confd = xTrue])
575 21a5e56c Iustin Pop
576 13cc7b84 Michele Tartara
#extra modules for monitoring daemon functionality
577 35c6e63d Michele Tartara
has_monitoring=False
578 52fca4ba Michael Hanselmann
if test "$enable_monitoring" != no; then
579 35c6e63d Michele Tartara
  MONITORING_PKG=
580 52fca4ba Michael Hanselmann
  AC_GHC_PKG_CHECK([attoparsec], [],
581 52fca4ba Michael Hanselmann
                   [MONITORING_PKG="$MONITORING_PKG attoparsec"])
582 13cc7b84 Michele Tartara
  AC_GHC_PKG_CHECK([snap-server], [],
583 13cc7b84 Michele Tartara
                   [MONITORING_PKG="$MONITORING_PKG snap-server"])
584 74685117 Michele Tartara
  AC_GHC_PKG_CHECK([process], [],
585 74685117 Michele Tartara
                   [MONITORING_PKG="$MONITORING_PKG process"])
586 5d453688 Michele Tartara
  MONITORING_DEP=
587 5d453688 Michele Tartara
  if test "$has_confd" = False; then
588 5d453688 Michele Tartara
    MONITORING_DEP="$MONITORING_DEP confd"
589 5d453688 Michele Tartara
  fi
590 5d453688 Michele Tartara
  has_monitoring_pkg=False
591 35c6e63d Michele Tartara
  if test -z "$MONITORING_PKG"; then
592 5d453688 Michele Tartara
    has_monitoring_pkg=True
593 52fca4ba Michael Hanselmann
  elif test "$enable_monitoring" = check; then
594 52fca4ba Michael Hanselmann
    AC_MSG_WARN(m4_normalize([The required extra libraries for the monitoring
595 13cc7b84 Michele Tartara
                              daemon were not found ($MONITORING_PKG),
596 52fca4ba Michael Hanselmann
                              monitoring disabled]))
597 35c6e63d Michele Tartara
  else
598 52fca4ba Michael Hanselmann
    AC_MSG_FAILURE(m4_normalize([The monitoring functionality was requested, but
599 52fca4ba Michael Hanselmann
                                 required libraries were not found:
600 52fca4ba Michael Hanselmann
                                 $MONITORING_PKG]))
601 35c6e63d Michele Tartara
  fi
602 5d453688 Michele Tartara
  has_monitoring_dep=False
603 5d453688 Michele Tartara
  if test -z "$MONITORING_DEP"; then
604 5d453688 Michele Tartara
    has_monitoring_dep=True
605 5d453688 Michele Tartara
  elif test "$enable_monitoring" = check; then
606 5d453688 Michele Tartara
    AC_MSG_WARN(m4_normalize([The optional Ganeti components required for the
607 5d453688 Michele Tartara
                              monitoring agent were not enabled
608 5d453688 Michele Tartara
                              ($MONITORING_DEP), monitoring disabled]))
609 5d453688 Michele Tartara
  else
610 5d453688 Michele Tartara
    AC_MSG_FAILURE(m4_normalize([The monitoring functionality was requested, but
611 5d453688 Michele Tartara
                                 required optional Ganeti components were not
612 5d453688 Michele Tartara
                                 found: $MONITORING_DEP]))
613 5d453688 Michele Tartara
  fi
614 5d453688 Michele Tartara
615 35c6e63d Michele Tartara
fi
616 5d453688 Michele Tartara
if test "$has_monitoring_pkg" = True -a "$has_monitoring_dep" = True; then
617 5d453688 Michele Tartara
  has_monitoring=True
618 35c6e63d Michele Tartara
  AC_MSG_NOTICE([Enabling the monitoring agent usage])
619 35c6e63d Michele Tartara
fi
620 14013e5d Michele Tartara
AC_SUBST(ENABLE_MOND, $has_monitoring)
621 14013e5d Michele Tartara
AM_CONDITIONAL([ENABLE_MOND], [test "$has_monitoring" = True])
622 35c6e63d Michele Tartara
623 21a5e56c Iustin Pop
# development modules
624 d9a900dc Iustin Pop
HS_NODEV=
625 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([QuickCheck-2.*], [], [HS_NODEV=1], t)
626 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([test-framework-0.6*], [], [HS_NODEV=1], t)
627 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([test-framework-hunit], [], [HS_NODEV=1])
628 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([test-framework-quickcheck2], [], [HS_NODEV=1])
629 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([temporary], [], [HS_NODEV=1])
630 35c6e63d Michele Tartara
# FIXME: unify checks for non-test libraries (attoparsec, hinotify, ...)
631 35c6e63d Michele Tartara
#        that are needed to execute the tests, avoiding the duplication
632 35c6e63d Michele Tartara
#        of the checks.
633 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([attoparsec], [], [HS_NODEV=1])
634 d9a900dc Iustin Pop
AC_GHC_PKG_CHECK([vector], [], [HS_NODEV=1])
635 a50b49b8 Klaus Aehlig
AC_GHC_PKG_CHECK([process], [], [HS_NODEV=1])
636 cf2cda79 Klaus Aehlig
AC_GHC_PKG_CHECK([snap-server], [], [HS_NODEV=1])
637 7e360262 Klaus Aehlig
AC_GHC_PKG_CHECK([regex-pcre], [], [HS_NODEV=1])
638 7e360262 Klaus Aehlig
AC_GHC_PKG_CHECK([Crypto], [], [HS_NODEV=1])
639 7e360262 Klaus Aehlig
AC_GHC_PKG_CHECK([text], [], [HS_NODEV=1])
640 7e360262 Klaus Aehlig
AC_GHC_PKG_CHECK([hinotify], [], [HS_NODEV=1])
641 d9a900dc Iustin Pop
if test -n "$HS_NODEV"; then
642 21a5e56c Iustin Pop
   AC_MSG_WARN(m4_normalize([Required development modules were not found,
643 21a5e56c Iustin Pop
                             you won't be able to run Haskell unittests]))
644 21a5e56c Iustin Pop
else
645 21a5e56c Iustin Pop
   AC_MSG_NOTICE([Haskell development modules found, unittests enabled])
646 21a5e56c Iustin Pop
fi
647 d9a900dc Iustin Pop
AC_SUBST(HS_NODEV)
648 21a5e56c Iustin Pop
649 21a5e56c Iustin Pop
HTOOLS=yes
650 e5bd9de5 Iustin Pop
AC_SUBST(HTOOLS)
651 e5bd9de5 Iustin Pop
652 55837756 Iustin Pop
# --enable-split-query
653 55837756 Iustin Pop
ENABLE_SPLIT_QUERY=
654 55837756 Iustin Pop
AC_ARG_ENABLE([split-query],
655 55837756 Iustin Pop
  [AS_HELP_STRING([--enable-split-query],
656 55837756 Iustin Pop
  [enable use of custom query daemon via confd])],
657 55837756 Iustin Pop
  [[case "$enableval" in
658 55837756 Iustin Pop
      no)
659 55837756 Iustin Pop
        enable_split_query=False
660 55837756 Iustin Pop
        ;;
661 55837756 Iustin Pop
      yes)
662 55837756 Iustin Pop
        enable_split_query=True
663 55837756 Iustin Pop
        ;;
664 55837756 Iustin Pop
      *)
665 55837756 Iustin Pop
        echo "Invalid value for enable-confd '$enableval'"
666 55837756 Iustin Pop
        exit 1
667 55837756 Iustin Pop
        ;;
668 55837756 Iustin Pop
    esac
669 55837756 Iustin Pop
  ]],
670 1ca709c1 Iustin Pop
  [[case "x${has_confd}x" in
671 1ca709c1 Iustin Pop
     xTruex)
672 55837756 Iustin Pop
       enable_split_query=True
673 55837756 Iustin Pop
       ;;
674 55837756 Iustin Pop
     *)
675 55837756 Iustin Pop
       enable_split_query=False
676 55837756 Iustin Pop
       ;;
677 55837756 Iustin Pop
   esac]])
678 55837756 Iustin Pop
AC_SUBST(ENABLE_SPLIT_QUERY, $enable_split_query)
679 55837756 Iustin Pop
680 21a5e56c Iustin Pop
if test x$enable_split_query = xTrue -a x$has_confd != xTrue; then
681 55837756 Iustin Pop
  AC_MSG_ERROR([Split queries require the confd daemon])
682 55837756 Iustin Pop
fi
683 55837756 Iustin Pop
684 55837756 Iustin Pop
if test x$enable_split_query = xTrue; then
685 55837756 Iustin Pop
  AC_MSG_NOTICE([Split query functionality enabled])
686 55837756 Iustin Pop
fi
687 55837756 Iustin Pop
688 e5bd9de5 Iustin Pop
# Check for HsColour
689 d9a900dc Iustin Pop
HS_APIDOC=no
690 e5bd9de5 Iustin Pop
AC_ARG_VAR(HSCOLOUR, [HsColour path])
691 e5bd9de5 Iustin Pop
AC_PATH_PROG(HSCOLOUR, [HsColour], [])
692 e5bd9de5 Iustin Pop
if test -z "$HSCOLOUR"; then
693 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([HsColour not found, htools API documentation will
694 30841576 Michael Hanselmann
                            not be generated]))
695 e5bd9de5 Iustin Pop
fi
696 e5bd9de5 Iustin Pop
697 e5bd9de5 Iustin Pop
# Check for haddock
698 e5bd9de5 Iustin Pop
AC_ARG_VAR(HADDOCK, [haddock path])
699 e5bd9de5 Iustin Pop
AC_PATH_PROG(HADDOCK, [haddock], [])
700 e5bd9de5 Iustin Pop
if test -z "$HADDOCK"; then
701 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([haddock not found, htools API documentation will
702 30841576 Michael Hanselmann
                            not be generated]))
703 e5bd9de5 Iustin Pop
fi
704 52fca4ba Michael Hanselmann
if test -n "$HADDOCK" && test -n "$HSCOLOUR"; then
705 d9a900dc Iustin Pop
  HS_APIDOC=yes
706 e5bd9de5 Iustin Pop
fi
707 d9a900dc Iustin Pop
AC_SUBST(HS_APIDOC)
708 e5bd9de5 Iustin Pop
709 6e4c8f68 Iustin Pop
# Check for hlint
710 6e4c8f68 Iustin Pop
AC_ARG_VAR(HLINT, [hlint path])
711 6e4c8f68 Iustin Pop
AC_PATH_PROG(HLINT, [hlint], [])
712 6e4c8f68 Iustin Pop
if test -z "$HLINT"; then
713 6e4c8f68 Iustin Pop
  AC_MSG_WARN([hlint not found, checking code will not be possible])
714 6e4c8f68 Iustin Pop
fi
715 6e4c8f68 Iustin Pop
716 52fca4ba Michael Hanselmann
if test "$HTOOLS" != yes && test "$ENABLE_CONFD" = True; then
717 52fca4ba Michael Hanselmann
  AC_MSG_ERROR(m4_normalize([cannot enable ganeti-confd if
718 52fca4ba Michael Hanselmann
                             htools support is not enabled]))
719 73b0fa69 Iustin Pop
fi
720 73b0fa69 Iustin Pop
721 52fca4ba Michael Hanselmann
AM_CONDITIONAL([WANT_HTOOLS], [test "$HTOOLS" = yes])
722 d9a900dc Iustin Pop
AM_CONDITIONAL([WANT_HSTESTS], [test "x$HS_NODEV" = x])
723 d9a900dc Iustin Pop
AM_CONDITIONAL([WANT_HSAPIDOC], [test "$HS_APIDOC" = yes])
724 6e4c8f68 Iustin Pop
AM_CONDITIONAL([HAS_HLINT], [test "$HLINT"])
725 e5bd9de5 Iustin Pop
726 70041061 Bernardo Dal Seno
# Check for fakeroot
727 70041061 Bernardo Dal Seno
AC_ARG_VAR(FAKEROOT_PATH, [fakeroot path])
728 70041061 Bernardo Dal Seno
AC_PATH_PROG(FAKEROOT_PATH, [fakeroot], [])
729 70041061 Bernardo Dal Seno
if test -z "$FAKEROOT_PATH"; then
730 70041061 Bernardo Dal Seno
  AC_MSG_WARN(m4_normalize([fakeroot not found, tests that must run as root
731 70041061 Bernardo Dal Seno
                            will not be executed]))
732 70041061 Bernardo Dal Seno
fi
733 70041061 Bernardo Dal Seno
AM_CONDITIONAL([HAS_FAKEROOT], [test "x$FAKEROOT_PATH" != x])
734 70041061 Bernardo Dal Seno
735 fe5b0c42 Michael Hanselmann
SOCAT_USE_ESCAPE=
736 fe5b0c42 Michael Hanselmann
AC_ARG_ENABLE([socat-escape],
737 fe5b0c42 Michael Hanselmann
  [AS_HELP_STRING([--enable-socat-escape],
738 fe5b0c42 Michael Hanselmann
    [use escape functionality available in socat >= 1.7 (default: detect
739 fe5b0c42 Michael Hanselmann
     automatically)])],
740 fe5b0c42 Michael Hanselmann
  [[if test "$enableval" = yes; then
741 fe5b0c42 Michael Hanselmann
      SOCAT_USE_ESCAPE=True
742 fe5b0c42 Michael Hanselmann
    else
743 fe5b0c42 Michael Hanselmann
      SOCAT_USE_ESCAPE=False
744 fe5b0c42 Michael Hanselmann
    fi
745 fe5b0c42 Michael Hanselmann
  ]])
746 fe5b0c42 Michael Hanselmann
747 fe5b0c42 Michael Hanselmann
if test -z "$SOCAT_USE_ESCAPE"
748 87c1d0c7 Guido Trotter
then
749 fe5b0c42 Michael Hanselmann
  if $SOCAT -hh | grep -w -q escape; then
750 fe5b0c42 Michael Hanselmann
    SOCAT_USE_ESCAPE=True
751 fe5b0c42 Michael Hanselmann
  else
752 fe5b0c42 Michael Hanselmann
    SOCAT_USE_ESCAPE=False
753 fe5b0c42 Michael Hanselmann
  fi
754 87c1d0c7 Guido Trotter
fi
755 87c1d0c7 Guido Trotter
756 fe5b0c42 Michael Hanselmann
AC_SUBST(SOCAT_USE_ESCAPE)
757 fe5b0c42 Michael Hanselmann
758 e90739d6 Michael Hanselmann
SOCAT_USE_COMPRESS=
759 e90739d6 Michael Hanselmann
AC_ARG_ENABLE([socat-compress],
760 e90739d6 Michael Hanselmann
  [AS_HELP_STRING([--enable-socat-compress],
761 e90739d6 Michael Hanselmann
    [use OpenSSL compression option available in patched socat builds
762 e90739d6 Michael Hanselmann
     (see INSTALL for details; default: detect automatically)])],
763 e90739d6 Michael Hanselmann
  [[if test "$enableval" = yes; then
764 e90739d6 Michael Hanselmann
      SOCAT_USE_COMPRESS=True
765 e90739d6 Michael Hanselmann
    else
766 e90739d6 Michael Hanselmann
      SOCAT_USE_COMPRESS=False
767 e90739d6 Michael Hanselmann
    fi
768 e90739d6 Michael Hanselmann
  ]])
769 e90739d6 Michael Hanselmann
770 e90739d6 Michael Hanselmann
if test -z "$SOCAT_USE_COMPRESS"
771 e90739d6 Michael Hanselmann
then
772 e90739d6 Michael Hanselmann
  if $SOCAT -hhh | grep -w -q openssl-compress; then
773 e90739d6 Michael Hanselmann
    SOCAT_USE_COMPRESS=True
774 e90739d6 Michael Hanselmann
  else
775 e90739d6 Michael Hanselmann
    SOCAT_USE_COMPRESS=False
776 e90739d6 Michael Hanselmann
  fi
777 e90739d6 Michael Hanselmann
fi
778 e90739d6 Michael Hanselmann
779 e90739d6 Michael Hanselmann
AC_SUBST(SOCAT_USE_COMPRESS)
780 e90739d6 Michael Hanselmann
781 5f55173b Iustin Pop
if man --help | grep -q -e --warnings
782 5f55173b Iustin Pop
then
783 5f55173b Iustin Pop
  MAN_HAS_WARNINGS=1
784 5f55173b Iustin Pop
else
785 5f55173b Iustin Pop
  MAN_HAS_WARNINGS=
786 30841576 Michael Hanselmann
  AC_MSG_WARN(m4_normalize([man does not support --warnings, man page checks
787 30841576 Michael Hanselmann
                            will not be possible]))
788 5f55173b Iustin Pop
fi
789 5f55173b Iustin Pop
790 5f55173b Iustin Pop
AC_SUBST(MAN_HAS_WARNINGS)
791 5f55173b Iustin Pop
792 a5d17f9f Michael Hanselmann
# Check for Python
793 777ea2c6 Guido Trotter
AM_PATH_PYTHON(2.6)
794 a8083063 Iustin Pop
795 6e06b36c Iustin Pop
AC_PYTHON_MODULE(OpenSSL, t)
796 6e06b36c Iustin Pop
AC_PYTHON_MODULE(simplejson, t)
797 6e06b36c Iustin Pop
AC_PYTHON_MODULE(pyparsing, t)
798 0f18ee6d Guido Trotter
AC_PYTHON_MODULE(pyinotify, t)
799 28af40c8 Guido Trotter
AC_PYTHON_MODULE(pycurl, t)
800 0a09b080 Michael Hanselmann
AC_PYTHON_MODULE(bitarray, t)
801 0a09b080 Michael Hanselmann
AC_PYTHON_MODULE(ipaddr, t)
802 7a694e30 Thomas Thrainer
AC_PYTHON_MODULE(mock)
803 4f6396fd Iustin Pop
AC_PYTHON_MODULE(affinity)
804 a40b1fc4 René Nussbaumer
AC_PYTHON_MODULE(paramiko)
805 a40b1fc4 René Nussbaumer
806 27df5b73 Michele Tartara
# Development-only Python modules
807 27df5b73 Michele Tartara
PY_NODEV=
808 27df5b73 Michele Tartara
AC_PYTHON_MODULE(yaml)
809 27df5b73 Michele Tartara
if test $HAVE_PYMOD_YAML == "no"; then
810 27df5b73 Michele Tartara
  PY_NODEV="$PY_NODEV yaml"
811 27df5b73 Michele Tartara
fi
812 27df5b73 Michele Tartara
813 27df5b73 Michele Tartara
if test -n "$PY_NODEV"; then
814 27df5b73 Michele Tartara
  AC_MSG_WARN(m4_normalize([Required development modules ($PY_NODEV) were not
815 27df5b73 Michele Tartara
                            found, you won't be able to run Python unittests]))
816 27df5b73 Michele Tartara
else
817 d14d93b0 Helga Velroyen
  AC_MSG_NOTICE([Python development modules found, unittests enabled])
818 27df5b73 Michele Tartara
fi
819 27df5b73 Michele Tartara
AC_SUBST(PY_NODEV)
820 d14d93b0 Helga Velroyen
AM_CONDITIONAL([PY_UNIT], [test -n $PY_NODEV])
821 27df5b73 Michele Tartara
822 e8230860 Michael Hanselmann
AC_CONFIG_FILES([ Makefile ])
823 3571f686 Iustin Pop
824 a8083063 Iustin Pop
AC_OUTPUT