Statistics
| Branch: | Tag: | Revision:

root / configure.ac @ 54f834df

History | View | Annotate | Download (15.3 kB)

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