Statistics
| Branch: | Tag: | Revision:

root / configure.ac @ 69809ae3

History | View | Annotate | Download (24.9 kB)

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