Statistics
| Branch: | Tag: | Revision:

root / configure.ac @ 4a96f1d1

History | View | Annotate | Download (7.2 kB)

1 a5d17f9f Michael Hanselmann
# Configure script for Ganeti
2 5e29d733 Michael Hanselmann
m4_define([gnt_version_major], [2])
3 b03ee906 Michael Hanselmann
m4_define([gnt_version_minor], [1])
4 ace6cbe8 Iustin Pop
m4_define([gnt_version_revision], [2])
5 462c9bcf Guido Trotter
m4_define([gnt_version_suffix], [.1])
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 cb7c0198 Iustin Pop
  [[file_storage_dir="/srv/ganeti/file-storage"; enable_file_storage="True"]])
115 22c734bc Manuel Franceschini
AC_SUBST(FILE_STORAGE_DIR, $file_storage_dir)
116 cb7c0198 Iustin Pop
AC_SUBST(ENABLE_FILE_STORAGE, $enable_file_storage)
117 22c734bc Manuel Franceschini
118 7e2c5b9e Guido Trotter
# --with-kvm-path=...
119 7e2c5b9e Guido Trotter
AC_ARG_WITH([kvm-path],
120 7e2c5b9e Guido Trotter
  [AS_HELP_STRING([--with-kvm-path=PATH],
121 7e2c5b9e Guido Trotter
    [absolute path to the kvm binary]
122 7e2c5b9e Guido Trotter
    [ (default is /usr/bin/kvm)]
123 7e2c5b9e Guido Trotter
  )],
124 7e2c5b9e Guido Trotter
  [kvm_path="$withval"],
125 7e2c5b9e Guido Trotter
  [kvm_path="/usr/bin/kvm"])
126 7e2c5b9e Guido Trotter
AC_SUBST(KVM_PATH, $kvm_path)
127 7e2c5b9e Guido Trotter
128 89b70f39 Iustin Pop
# --with-lvm-stripecount=...
129 3736cb6b Iustin Pop
AC_ARG_WITH([lvm-stripecount],
130 3736cb6b Iustin Pop
  [AS_HELP_STRING([--with-lvm-stripecount=NUM],
131 3736cb6b Iustin Pop
    [the number of stripes to use for LVM volumes]
132 7b3ac94d Iustin Pop
    [ (default is 1)]
133 3736cb6b Iustin Pop
  )],
134 3736cb6b Iustin Pop
  [lvm_stripecount="$withval"],
135 7b3ac94d Iustin Pop
  [lvm_stripecount="1"])
136 3736cb6b Iustin Pop
AC_SUBST(LVM_STRIPECOUNT, $lvm_stripecount)
137 3736cb6b Iustin Pop
138 89b70f39 Iustin Pop
# --enable-drbd-barriers
139 89b70f39 Iustin Pop
AC_ARG_ENABLE([drbd-barriers],
140 89b70f39 Iustin Pop
  [AS_HELP_STRING([--enable-drbd-barriers],
141 89b70f39 Iustin Pop
    [enable the DRBD barrier functionality (>= 8.0.12) (default: enabled)])],
142 89b70f39 Iustin Pop
  [[if test "$enableval" != no; then
143 89b70f39 Iustin Pop
      DRBD_BARRIERS=True
144 89b70f39 Iustin Pop
    else
145 89b70f39 Iustin Pop
      DRBD_BARRIERS=False
146 89b70f39 Iustin Pop
    fi
147 89b70f39 Iustin Pop
  ]],
148 89b70f39 Iustin Pop
  [DRBD_BARRIERS=True])
149 89b70f39 Iustin Pop
AC_SUBST(DRBD_BARRIERS, $DRBD_BARRIERS)
150 89b70f39 Iustin Pop
151 551b6283 Iustin Pop
# --enable-syslog[=no/yes/only]
152 551b6283 Iustin Pop
AC_ARG_ENABLE([syslog],
153 551b6283 Iustin Pop
  [AS_HELP_STRING([--enable-syslog],
154 551b6283 Iustin Pop
    [enable use of syslog (default: disabled), one of no/yes/only])],
155 551b6283 Iustin Pop
  [[case "$enableval" in
156 551b6283 Iustin Pop
      no)
157 551b6283 Iustin Pop
        SYSLOG=no
158 551b6283 Iustin Pop
        ;;
159 551b6283 Iustin Pop
      yes)
160 551b6283 Iustin Pop
        SYSLOG=yes
161 551b6283 Iustin Pop
        ;;
162 551b6283 Iustin Pop
      only)
163 551b6283 Iustin Pop
        SYSLOG=only
164 551b6283 Iustin Pop
        ;;
165 551b6283 Iustin Pop
      *)
166 551b6283 Iustin Pop
        SYSLOG=
167 551b6283 Iustin Pop
        ;;
168 551b6283 Iustin Pop
    esac
169 551b6283 Iustin Pop
  ]],
170 551b6283 Iustin Pop
  [SYSLOG=no])
171 551b6283 Iustin Pop
172 551b6283 Iustin Pop
if test -z "$SYSLOG"
173 551b6283 Iustin Pop
then
174 551b6283 Iustin Pop
  AC_MSG_ERROR([invalid value for syslog, choose one of no/yes/only])
175 551b6283 Iustin Pop
fi
176 551b6283 Iustin Pop
AC_SUBST(SYSLOG_USAGE, $SYSLOG)
177 551b6283 Iustin Pop
178 a5d17f9f Michael Hanselmann
# Check common programs
179 a8083063 Iustin Pop
AC_PROG_INSTALL
180 9ff7e35c Michael Hanselmann
AC_PROG_LN_S
181 a8083063 Iustin Pop
182 1efbe18e Michael Hanselmann
# Check for docbook programs
183 1efbe18e Michael Hanselmann
AC_ARG_VAR(DOCBOOK2MAN, [docbook2man path])
184 1efbe18e Michael Hanselmann
AC_PATH_PROG(DOCBOOK2MAN, [docbook2man], [])
185 1efbe18e Michael Hanselmann
if test -z "$DOCBOOK2MAN"
186 1efbe18e Michael Hanselmann
then
187 2ab2b9f5 Iustin Pop
  AC_MSG_WARN([docbook2man not found, man pages rebuild will not be possible])
188 1efbe18e Michael Hanselmann
fi
189 1efbe18e Michael Hanselmann
190 1efbe18e Michael Hanselmann
AC_ARG_VAR(DOCBOOK2HTML, [docbook2html path])
191 1efbe18e Michael Hanselmann
AC_PATH_PROG(DOCBOOK2HTML, [docbook2html], [])
192 1efbe18e Michael Hanselmann
if test -z "$DOCBOOK2HTML"
193 1efbe18e Michael Hanselmann
then
194 2ab2b9f5 Iustin Pop
  AC_MSG_WARN([docbook2html not found, man pages rebuild will not be possible])
195 1efbe18e Michael Hanselmann
fi
196 1efbe18e Michael Hanselmann
197 d17e74b4 Iustin Pop
# Check for python-sphinx
198 d17e74b4 Iustin Pop
AC_ARG_VAR(SPHINX, [sphinx-build path])
199 d17e74b4 Iustin Pop
AC_PATH_PROG(SPHINX, [sphinx-build], [])
200 d17e74b4 Iustin Pop
if test -z "$SPHINX"
201 f05c99f3 Michael Hanselmann
then
202 d17e74b4 Iustin Pop
  AC_MSG_WARN([sphinx-build not found, documentation rebuild will not be possible])
203 f05c99f3 Michael Hanselmann
fi
204 f05c99f3 Michael Hanselmann
205 f86e82ef Iustin Pop
# Check for graphviz (dot)
206 f86e82ef Iustin Pop
AC_ARG_VAR(DOT, [dot path])
207 f86e82ef Iustin Pop
AC_PATH_PROG(DOT, [dot], [])
208 f86e82ef Iustin Pop
if test -z "$DOT"
209 f86e82ef Iustin Pop
then
210 2ab2b9f5 Iustin Pop
  AC_MSG_WARN([dot (from the graphviz suite) not found, documentation rebuild not possible])
211 f86e82ef Iustin Pop
fi
212 f86e82ef Iustin Pop
213 6d7cc5ff Michael Hanselmann
# Check for pylint
214 6d7cc5ff Michael Hanselmann
AC_ARG_VAR(PYLINT, [pylint path])
215 6d7cc5ff Michael Hanselmann
AC_PATH_PROG(PYLINT, [pylint], [])
216 6d7cc5ff Michael Hanselmann
if test -z "$PYLINT"
217 6d7cc5ff Michael Hanselmann
then
218 6d7cc5ff Michael Hanselmann
  AC_MSG_WARN([pylint not found, checking code will not be possible])
219 6d7cc5ff Michael Hanselmann
fi
220 6d7cc5ff Michael Hanselmann
221 fe5b0c42 Michael Hanselmann
# Check for socat
222 fe5b0c42 Michael Hanselmann
AC_ARG_VAR(SOCAT, [socat path])
223 fe5b0c42 Michael Hanselmann
AC_PATH_PROG(SOCAT, [socat], [])
224 87c1d0c7 Guido Trotter
if test -z "$SOCAT"
225 87c1d0c7 Guido Trotter
then
226 fe5b0c42 Michael Hanselmann
  AC_MSG_ERROR([socat not found])
227 87c1d0c7 Guido Trotter
fi
228 87c1d0c7 Guido Trotter
229 fe5b0c42 Michael Hanselmann
SOCAT_USE_ESCAPE=
230 fe5b0c42 Michael Hanselmann
AC_ARG_ENABLE([socat-escape],
231 fe5b0c42 Michael Hanselmann
  [AS_HELP_STRING([--enable-socat-escape],
232 fe5b0c42 Michael Hanselmann
    [use escape functionality available in socat >= 1.7 (default: detect
233 fe5b0c42 Michael Hanselmann
     automatically)])],
234 fe5b0c42 Michael Hanselmann
  [[if test "$enableval" = yes; then
235 fe5b0c42 Michael Hanselmann
      SOCAT_USE_ESCAPE=True
236 fe5b0c42 Michael Hanselmann
    else
237 fe5b0c42 Michael Hanselmann
      SOCAT_USE_ESCAPE=False
238 fe5b0c42 Michael Hanselmann
    fi
239 fe5b0c42 Michael Hanselmann
  ]])
240 fe5b0c42 Michael Hanselmann
241 fe5b0c42 Michael Hanselmann
if test -z "$SOCAT_USE_ESCAPE"
242 87c1d0c7 Guido Trotter
then
243 fe5b0c42 Michael Hanselmann
  if $SOCAT -hh | grep -w -q escape; then
244 fe5b0c42 Michael Hanselmann
    SOCAT_USE_ESCAPE=True
245 fe5b0c42 Michael Hanselmann
  else
246 fe5b0c42 Michael Hanselmann
    SOCAT_USE_ESCAPE=False
247 fe5b0c42 Michael Hanselmann
  fi
248 87c1d0c7 Guido Trotter
fi
249 87c1d0c7 Guido Trotter
250 fe5b0c42 Michael Hanselmann
AC_SUBST(SOCAT_USE_ESCAPE)
251 fe5b0c42 Michael Hanselmann
252 a5d17f9f Michael Hanselmann
# Check for Python
253 a8083063 Iustin Pop
AM_PATH_PYTHON(2.4)
254 a8083063 Iustin Pop
255 6e06b36c Iustin Pop
AC_PYTHON_MODULE(OpenSSL, t)
256 6e06b36c Iustin Pop
AC_PYTHON_MODULE(simplejson, t)
257 6e06b36c Iustin Pop
AC_PYTHON_MODULE(pyparsing, t)
258 0f18ee6d Guido Trotter
AC_PYTHON_MODULE(pyinotify, t)
259 6e06b36c Iustin Pop
260 e8230860 Michael Hanselmann
AC_CONFIG_FILES([ Makefile ])
261 3571f686 Iustin Pop
262 a8083063 Iustin Pop
AC_OUTPUT