Lib.pm: Skip tests if perl-libintl module is not available.
[libguestfs.git] / configure.ac
1 # libguestfs
2 # Copyright (C) 2009 Red Hat Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 # major/minor/release must be numbers
19 m4_define([libguestfs_major],   [1])
20 m4_define([libguestfs_minor],   [0])
21 m4_define([libguestfs_release], [64])
22 # extra can be any string
23 m4_define([libguestfs_extra],   [])
24
25 AC_INIT([libguestfs],libguestfs_major.libguestfs_minor.libguestfs_release[]libguestfs_extra)
26 AM_INIT_AUTOMAKE([foreign])
27
28 AC_CONFIG_MACRO_DIR([m4])
29
30 AC_PROG_LIBTOOL
31
32 dnl Split up the version string.
33 AC_DEFINE([PACKAGE_VERSION_MAJOR],[libguestfs_major],[Major version number])
34 AC_DEFINE([PACKAGE_VERSION_MINOR],[libguestfs_minor],[Minor version number])
35 AC_DEFINE([PACKAGE_VERSION_RELEASE],[libguestfs_release],[Release number])
36 AC_DEFINE([PACKAGE_VERSION_EXTRA],["libguestfs_extra"],[Extra version string])
37
38 dnl Check for basic C environment.
39 AC_PROG_CC_STDC
40 AC_PROG_INSTALL
41 AC_PROG_CPP
42
43 AC_C_PROTOTYPES
44 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
45
46 AM_PROG_CC_C_O
47
48 dnl Check support for 64 bit file offsets.
49 AC_SYS_LARGEFILE
50
51 dnl Check sizeof long.
52 AC_CHECK_SIZEOF([long])
53
54 dnl Headers.
55 AC_CHECK_HEADERS([errno.h sys/types.h sys/un.h sys/wait.h sys/socket.h])
56
57 dnl Check for rpcgen and XDR library.  rpcgen is optional.
58 AC_CHECK_PROG([RPCGEN],[rpcgen],[rpcgen],[no])
59 AM_CONDITIONAL([HAVE_RPCGEN],[test "x$RPCGEN" != "xno"])
60 AC_CHECK_LIB([portablexdr],[xdrmem_create],[],[
61         AC_SEARCH_LIBS([xdrmem_create],[rpc xdr nsl])
62         ])
63
64 dnl Check for pod2man and pod2text.
65 AC_CHECK_PROG([POD2MAN],[pod2man],[pod2man],[no])
66 test "x$POD2MAN" = "xno" &&
67      AC_MSG_ERROR([pod2man must be installed])
68 AC_CHECK_PROG([POD2TEXT],[pod2text],[pod2text],[no])
69 test "x$POD2TEXT" = "xno" &&
70      AC_MSG_ERROR([pod2text must be installed])
71
72 dnl Check for mksquashfs.
73 AC_PATH_PROGS([MKSQUASHFS],[mksquashfs],[no],
74         [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin])
75 test "x$MKSQUASHFS" = "xno" && AC_MSG_ERROR([mksquashfs must be installed])
76
77 dnl Check for QEMU for running binaries on this $host_cpu, fall
78 dnl back to basic 'qemu'.  Allow the user to override it.
79 default_qemu="qemu-kvm qemu-system-$host_cpu qemu"
80 AC_ARG_WITH([qemu],
81         [AS_HELP_STRING([--with-qemu],
82           [set default QEMU binary @<:@default=[qemu-kvm] qemu-system-<host> qemu@:>@])],
83         [],
84         [with_qemu="$default_qemu"])
85 AC_PATH_PROGS([QEMU],[$with_qemu],[no],
86         [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/libexec])
87 test "x$QEMU" = "xno" && AC_MSG_ERROR([qemu must be installed])
88 AC_DEFINE_UNQUOTED([QEMU],["$QEMU"],[Location of qemu binary.])
89
90 dnl Check that the chosen qemu has vmchannel support.
91 dnl http://lists.gnu.org/archive/html/qemu-devel/2009-02/msg01042.html
92 if test "x$vmchannel_test" != "xno"; then
93     AC_MSG_CHECKING([for "guestfwd" support in $QEMU])
94     if $QEMU --help | grep -sq guestfwd; then
95         AC_MSG_RESULT([yes])
96     else
97         AC_MSG_CHECKING([for "-net channel" support in $QEMU])
98         vmchannelout=`$QEMU -net channel /dev/zero 2>&1 ||:`
99         echo "vmchannel test command output: $vmchannelout" >&AS_MESSAGE_LOG_FD
100         if echo $vmchannelout | grep -sq "vmchannel wrong port number" ; then
101             AC_MSG_RESULT([yes])
102         else
103             AC_MSG_RESULT([no])
104             AC_MSG_FAILURE(
105 [I did not find vmchannel support in $QEMU.
106
107 vmchannel support is vital for libguestfs to operate.  You need a version
108 of qemu >= 0.10, or the following patch backported to earlier versions:
109
110 http://lists.gnu.org/archive/html/qemu-devel/2009-02/msg01042.html
111
112 You can override this test by setting the environment variable
113 vmchannel_test=no  However if you don't have vmchannel support
114 in your qemu, then this just delays the pain.
115
116 If I am using the wrong qemu or you want to compile qemu from source
117 and install it in another location, then you should configure with
118 the --with-qemu option.
119 ])
120         fi
121     fi
122 fi
123
124 dnl Set drive interface used by the guestfs_add_drive{,_ro} calls
125 dnl ('-drive ...,if=...' option to qemu).
126 dnl
127 dnl NB. We will change the default in future to virtio, but at the
128 dnl moment this causes a performance problem, RHBZ#509383.
129 AC_ARG_WITH([drive-if],
130         [AS_HELP_STRING([--with-drive-if],
131           [set default driver (ide|scsi|virtio) @<:@default=ide@:>@])],
132         [],
133         [with_drive_if=ide])
134 AC_DEFINE_UNQUOTED([DRIVE_IF],["$with_drive_if"],[Default drive interface.])
135
136 dnl Check for febootstrap etc.
137 AC_CHECK_PROG([FEBOOTSTRAP],
138         [febootstrap],[febootstrap],[no])
139 if test "x$FEBOOTSTRAP" != "xno"; then
140   AC_CHECK_PROG([FEBOOTSTRAP_RUN],
141         [febootstrap-run],[febootstrap-run],[no])
142   test "x$FEBOOTSTRAP_RUN" = "xno" && \
143      AC_MSG_ERROR([febootstrap-run must be installed])
144   AC_CHECK_PROG([FEBOOTSTRAP_INSTALL],
145         [febootstrap-install],[febootstrap-install],[no])
146   test "x$FEBOOTSTRAP_INSTALL" = "xno" && \
147      AC_MSG_ERROR([febootstrap-install must be installed])
148   AC_CHECK_PROG([FEBOOTSTRAP_MINIMIZE],
149         [febootstrap-minimize],[febootstrap-minimize],[no])
150   test "x$FEBOOTSTRAP_MINIMIZE" = "xno" && \
151      AC_MSG_ERROR([febootstrap-minimize must be installed])
152   AC_CHECK_PROG([FEBOOTSTRAP_TO_INITRAMFS],
153         [febootstrap-to-initramfs],[febootstrap-to-initramfs],[no])
154   test "x$FEBOOTSTRAP_TO_INITRAMFS" = "xno" && \
155      AC_MSG_ERROR([febootstrap-to-initramfs must be installed])
156
157   dnl Check we have fakechroot >= 2.9 (it's an indirect requirement
158   dnl of febootstrap, but old versions will fail with yum).
159   AC_CHECK_PROG([FAKECHROOT],
160         [fakechroot],[fakechroot],[no])
161   test "x$FAKECHROOT" = "xno" && \
162     AC_MSG_ERROR([fakechroot must be installed])
163
164   AC_MSG_CHECKING([fakechroot version])
165   fakechroot_version=`$FAKECHROOT --version | awk '{print $3}'`
166   if test -z "$fakechroot_version"; then
167     AC_MSG_RESULT([failed])
168     AC_MSG_WARN([fakechroot --version command failed, proceeding anyway])
169   else
170     AC_MSG_RESULT([$fakechroot_version])
171     fakechroot_major=`echo $fakechroot_version | awk -F. '{print $1}'`
172     fakechroot_minor=`echo $fakechroot_version | awk -F. '{print $2}'`
173     if test "$fakechroot_major" -lt 2 -o \
174             \( "$fakechroot_major" -eq 2 -a "$fakechroot_minor" -lt 9 \); then
175         AC_MSG_ERROR([fakechroot version must be >= 2.9])
176     fi
177   fi
178   DIST="REDHAT"
179 else
180   # check for debootstrap and debirf
181   AC_CHECK_PROG([DEBOOTSTRAP],
182         [debootstrap],[debootstrap],[no])
183   test "x$DEBOOTSTRAP" = "xno" && \
184         AC_MSG_ERROR([Either febootstrap or debootstrap must be installed])
185   AC_CHECK_PROG([DEBIRF],[debirf],[debirf],[no])
186   test "x$DEBIRF" = "xno" &&
187         AC_MSG_ERROR([debirf must be installed])
188   DIST="DEBIAN"
189   case $host_cpu in
190       *86)
191           DEBIAN_KERNEL_ARCH=486
192           ;;
193       x86_64)
194           DEBIAN_KERNEL_ARCH=amd64
195           ;;
196       *)
197          DEBIAN_KERNEL_ARCH=$host_cpu
198          ;;
199    esac
200    AC_SUBST(DEBIAN_KERNEL_ARCH)
201 fi
202 AC_SUBST(DIST)
203
204
205 dnl --with-repo to specify a Fedora repository.
206 AC_ARG_WITH([repo],
207         [AS_HELP_STRING([--with-repo],
208           [set name of Fedora repository @<:@default=fedora-11@:>@])],
209         [],
210         [with_repo=fedora-11])
211 REPO="$with_repo"
212 AC_SUBST(REPO)
213 AC_DEFINE_UNQUOTED([REPO],["$REPO"],[Name of Fedora repository.])
214
215 dnl --with-updates to specify a Fedora updates repository.
216 AC_ARG_WITH([updates],
217         [AS_HELP_STRING([--with-updates],
218           [set name of Fedora updates repository @<:@default=updates-released-f11@:>@])],
219         [],
220         [with_updates=updates-released-f11])
221 UPDATES="$with_updates"
222 AC_SUBST(UPDATES)
223
224 dnl Define a symbol for the host CPU architecture.
225 AC_DEFINE_UNQUOTED([host_cpu],["$host_cpu"],[Host architecture.])
226
227 dnl --with-mirror to specify a local Fedora mirror.
228 AC_ARG_WITH([mirror],
229         [AS_HELP_STRING([--with-mirror],
230           [set URI of a local Fedora mirror])],
231         [],
232         [with_mirror=])
233 MIRROR="$with_mirror"
234 AC_SUBST(MIRROR)
235
236 dnl Build the supermin appliance?  Please see README file before
237 dnl enabling this option.
238 AC_ARG_ENABLE([supermin],
239         [AS_HELP_STRING([--enable-supermin],
240           [enable supermin appliance (see README) @<:@default=no@:>@])],
241         [],
242         [enable_supermin=no])
243 AM_CONDITIONAL([SUPERMIN],[test "x$enable_supermin" = "xyes"])
244
245 if test "x$enable_supermin" = "xyes"; then
246     dnl Check febootstrap-to-initramfs accepts the --files option
247     dnl (febootstrap >= 2.2).
248     AC_MSG_CHECKING([for --files support in $FEBOOTSTRAP_TO_INITRAMFS])
249     out=`$FEBOOTSTRAP_TO_INITRAMFS 2>&1 ||:`
250     echo "febootstrap_to_initramfs test command output: $out" >&AS_MESSAGE_LOG_FD
251     if ! echo $out | grep -sq -- "--files" ; then
252         AC_MSG_RESULT([no])
253         AC_MSG_FAILURE(
254 [febootstrap-to-initramfs does not support the --files option.
255
256 To build the supermin appliance, you need to upgrade to the latest
257 version of febootstrap.
258 ])
259     fi
260     AC_MSG_RESULT([yes])
261
262     dnl Check febootstrap-to-initramfs accepts the --nocompress option
263     dnl (febootstrap >= 2.3).
264     AC_MSG_CHECKING([for --nocompress support in $FEBOOTSTRAP_TO_INITRAMFS])
265     out=`$FEBOOTSTRAP_TO_INITRAMFS 2>&1 ||:`
266     echo "febootstrap_to_initramfs test command output: $out" >&AS_MESSAGE_LOG_FD
267     if ! echo $out | grep -sq -- "--nocompress" ; then
268         AC_MSG_RESULT([no])
269         AC_MSG_FAILURE(
270 [febootstrap-to-initramfs does not support the --nocompress option.
271
272 To build the supermin appliance, you need to upgrade to the latest
273 version of febootstrap.
274 ])
275     fi
276     AC_MSG_RESULT([yes])
277 fi
278
279 dnl Readline.
280 AC_ARG_WITH([readline],
281     [AS_HELP_STRING([--with-readline],
282         [support fancy command line editing @<:@default=check@:>@])],
283     [],
284     [with_readline=check])
285
286 LIBREADLINE=
287 AS_IF([test "x$with_readline" != xno],
288     [AC_CHECK_LIB([readline], [main],
289         [AC_SUBST([LIBREADLINE], ["-lreadline -lncurses"])
290          AC_DEFINE([HAVE_LIBREADLINE], [1],
291                    [Define if you have libreadline])
292         ],
293         [if test "x$with_readline" != xcheck; then
294          AC_MSG_FAILURE(
295              [--with-readline was given, but test for readline failed])
296          fi
297         ], -lncurses)])
298
299 dnl For i18n.
300 AM_GNU_GETTEXT([external])
301 AM_GNU_GETTEXT_VERSION([0.14])
302
303 dnl Check for OCaml (optional, for OCaml bindings).
304 AC_PROG_OCAML
305 AC_PROG_FINDLIB
306 AM_CONDITIONAL([HAVE_OCAML],[test "x$OCAMLC" != "xno" -a "x$OCAMLFIND" != "xno"])
307
308 dnl Check for Perl (optional, for Perl bindings).
309 dnl XXX This isn't quite right, we should check for Perl devel library.
310 AC_CHECK_PROG([PERL],[perl],[perl],[no])
311
312 dnl Check for Perl modules that must be present to compile and
313 dnl test the Perl bindings.
314 missing_perl_modules=no
315 for pm in Test::More Test::Pod Test::Pod::Coverage ExtUtils::MakeMaker; do
316     AC_MSG_CHECKING([for $pm])
317     if ! perl -M$pm -e1 >/dev/null 2>&1; then
318         AC_MSG_RESULT([no])
319         missing_perl_modules=yes
320     else
321         AC_MSG_RESULT([yes])
322     fi
323 done
324 if test "x$missing_perl_modules" = "xyes"; then
325     AC_MSG_WARN([some Perl modules required to compile or test the Perl bindings are missing])
326 fi
327
328 AM_CONDITIONAL([HAVE_PERL],
329     [test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"])
330
331 dnl Check for Python (optional, for Python bindings).
332 AC_CHECK_PROG([PYTHON],[python],[python],[no])
333
334 PYTHON_PREFIX=
335 PYTHON_VERSION=
336 PYTHON_INCLUDEDIR=
337 PYTHON_SITE_PACKAGES=
338
339 if test "x$PYTHON" != "xno"; then
340     PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
341     PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[0:3]]"`
342     for d in \
343         $PYTHON_PREFIX/include/python$PYTHON_VERSION \
344         /usr/include/python$PYTHON_VERSION \
345         /usr/local/include/python$PYTHON_VERSION
346     do
347         AC_MSG_CHECKING([Python.h in $d])
348         if test -r "$d/Python.h"; then
349             AC_MSG_RESULT([found])
350             PYTHON_INCLUDEDIR=$d
351             break
352         fi
353         AC_MSG_RESULT([not found])
354     done
355     for d in \
356         $PYTHON_PREFIX/lib64/python$PYTHON_VERSION/site-packages \
357         $PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages \
358         /usr/lib64/python$PYTHON_VERSION/site-packages \
359         /usr/lib/python$PYTHON_VERSION/site-packages \
360         /usr/local/lib/python$PYTHON_VERSION/site-packages
361     do
362         AC_MSG_CHECKING([for $d])
363         if test -d "$d"; then
364             AC_MSG_RESULT([found])
365             PYTHON_SITE_PACKAGES=$d
366             break
367         fi
368         AC_MSG_RESULT([not found])
369     done
370 fi
371
372 AC_SUBST(PYTHON_PREFIX)
373 AC_SUBST(PYTHON_VERSION)
374 AC_SUBST(PYTHON_INCLUDEDIR)
375 AC_SUBST(PYTHON_SITE_PACKAGES)
376
377 AM_CONDITIONAL([HAVE_PYTHON],
378     [test "x$PYTHON_INCLUDEDIR" != "x" -a "x$PYTHON_SITE_PACKAGES" != "x"])
379
380 dnl Check for Ruby and rake (optional, for Ruby bindings).
381 AC_CHECK_LIB([ruby],[ruby_init],[HAVE_LIBRUBY=1],[HAVE_LIBRUBY=0])
382 AC_CHECK_PROG([RAKE],[rake],[rake],[no])
383
384 AM_CONDITIONAL([HAVE_RUBY],
385     [test "x$RAKE" != "xno" -a -n "$HAVE_LIBRUBY"])
386
387 dnl Check for Java.
388 AC_ARG_WITH(java_home,
389     [AS_HELP_STRING([--with-java-home],
390         [specify path to JDK directory @<:@default=check@:>@])],
391     [],
392     [with_java_home=check])
393
394 if test "x$with_java_home" != "xno"; then
395     if test "x$with_java_home" != "xyes" -a "x$with_java_home" != "xcheck"
396     then
397         if test -d "$with_java_home"; then
398             JAVA_HOME="$with_java_home"
399         else
400             AC_MSG_FAILURE([$with_java_home is not a directory (use --with-java-home=no to disable Java support)])
401         fi
402     fi
403
404     if test "x$JAVA_HOME" = "x"; then
405         # Look for Java in some likely locations.
406         for d in \
407             /usr/lib/jvm/java \
408             /usr/lib/jvm/java-6-openjdk
409         do
410             if test -d $d -a -f $d/bin/java; then
411                 JAVA_HOME=$d
412                 break
413             fi
414         done
415     fi
416
417     if test "x$JAVA_HOME" != "x"; then
418         AC_MSG_CHECKING(for JDK in $JAVA_HOME)
419         if test ! -x "$JAVA_HOME/bin/java"; then
420             AC_MSG_ERROR([missing $JAVA_HOME/bin/java binary (use --with-java-home=no to disable Java support)])
421         else
422             JAVA="$JAVA_HOME/bin/java"
423         fi
424         if test ! -x "$JAVA_HOME/bin/javac"; then
425             AC_MSG_ERROR([missing $JAVA_HOME/bin/javac binary])
426         else
427             JAVAC="$JAVA_HOME/bin/javac"
428         fi
429         if test ! -x "$JAVA_HOME/bin/javah"; then
430             AC_MSG_ERROR([missing $JAVA_HOME/bin/javah binary])
431         else
432             JAVAH="$JAVA_HOME/bin/javah"
433         fi
434         if test ! -x "$JAVA_HOME/bin/javadoc"; then
435             AC_MSG_ERROR([missing $JAVA_HOME/bin/javadoc binary])
436         else
437             JAVADOC="$JAVA_HOME/bin/javadoc"
438         fi
439         if test ! -x "$JAVA_HOME/bin/jar"; then
440             AC_MSG_ERROR([missing $JAVA_HOME/bin/jar binary])
441         else
442             JAR="$JAVA_HOME/bin/jar"
443         fi
444         java_version=`$JAVA -version 2>&1 | grep "java version"`
445         AC_MSG_RESULT(found $java_version in $JAVA_HOME)
446
447         dnl Find jni.h.
448         AC_MSG_CHECKING([for jni.h])
449         if test -f "$JAVA_HOME/include/jni.h"; then
450             JNI_CFLAGS="-I$JAVA_HOME/include"
451         else
452             if test "`find $JAVA_HOME -name jni.h`" != ""; then
453                 head=`find $JAVA_HOME -name jni.h | tail -1`
454                 dir=`dirname $head`
455                 JNI_CFLAGS="-I$dir"
456             else
457                 AC_MSG_FAILURE([missing jni.h header file])
458             fi
459         fi
460         AC_MSG_RESULT([$JNI_CFLAGS])
461
462         dnl Find jni_md.h.
463         AC_MSG_CHECKING([for jni_md.h])
464         case "$build_os" in
465         *linux*) system="linux" ;;
466         *SunOS*) system="solaris" ;;
467         *cygwin*) system="win32" ;;
468         *) system="$build_os" ;;
469         esac
470         if test -f "$JAVA_HOME/include/$system/jni_md.h"; then
471             JNI_CFLAGS="$JNI_CFLAGS -I$JAVA_HOME/include/$system"
472         else
473             if test "`find $JAVA_HOME -name jni_md.h`" != ""; then
474                 head=`find $JAVA_HOME -name jni_md.h | tail -1`
475                 dir=`dirname $head`
476                 JNI_CFLAGS="$JNI_CFLAGS -I$dir"
477             else
478                 AC_MSG_FAILURE([missing jni_md.h header file])
479             fi
480         fi
481         AC_MSG_RESULT([$JNI_CFLAGS])
482
483         dnl Need extra version flag?
484         AC_MSG_CHECKING([extra javac flags])
485         JAVAC_FLAGS=
486         javac_version=`$JAVAC -version 2>&1`
487         case "$javac_version" in
488         *Eclipse*)
489             JAVAC_FLAGS="-source 1.5" ;;
490         esac
491         AC_MSG_RESULT([$JAVAC_FLAGS])
492
493         dnl Where to install jarfiles.
494         dnl XXX How to make it configurable?
495         JAR_INSTALL_DIR=\${prefix}/share/java
496         JNI_INSTALL_DIR=\${libdir}
497
498         dnl JNI version.
499         jni_major_version=`echo $VERSION | awk -F. '{print $1}'`
500         jni_minor_version=`echo $VERSION | awk -F. '{print $2}'`
501         jni_micro_version=`echo $VERSION | awk -F. '{print $3}'`
502         JNI_VERSION_INFO=`expr $jni_major_version + $jni_minor_version`:$jni_micro_version:$jni_minor_version
503     fi
504 fi
505
506 AC_SUBST(JAVA_HOME)
507 AC_SUBST(JAVA)
508 AC_SUBST(JAVAC)
509 AC_SUBST(JAVAH)
510 AC_SUBST(JAVADOC)
511 AC_SUBST(JAR)
512 AC_SUBST(JNI_CFLAGS)
513 AC_SUBST(JAVAC_FLAGS)
514 AC_SUBST(JAR_INSTALL_DIR)
515 AC_SUBST(JNI_INSTALL_DIR)
516 AC_SUBST(JNI_VERSION_INFO)
517
518 AM_CONDITIONAL([HAVE_JAVA],[test -n "$JAVAC"])
519
520 dnl Check for Haskell (GHC).
521 AC_CHECK_PROG([GHC],[ghc],[ghc],[no])
522
523 AM_CONDITIONAL([HAVE_HASKELL],
524     [test "x$GHC" != "xno"])
525
526 dnl Check for Perl modules needed by virt-df, inspector, V2V etc.
527 missing_perl_modules=no
528 for pm in Pod::Usage Getopt::Long Sys::Virt Data::Dumper XML::Writer Locale::TextDomain; do
529     AC_MSG_CHECKING([for $pm])
530     if ! perl -M$pm -e1 >/dev/null 2>&1; then
531         AC_MSG_RESULT([no])
532         missing_perl_modules=yes
533     else
534         AC_MSG_RESULT([yes])
535     fi
536 done
537 if test "x$missing_perl_modules" = "xyes"; then
538     AC_MSG_WARN([some Perl modules required to compile virt-cat, virt-df, virt-inspector and virt-v2v are missing])
539 fi
540
541 AM_CONDITIONAL([HAVE_CAT],
542     [test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"])
543 AM_CONDITIONAL([HAVE_DF],
544     [test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"])
545 AM_CONDITIONAL([HAVE_INSPECTOR],
546     [test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"])
547 AM_CONDITIONAL([HAVE_V2V],
548     [test "x$PERL" != "xno" -a "x$missing_perl_modules" != "xyes"])
549
550 dnl Library versioning.
551 MAX_PROC_NR=`cat $srcdir/src/MAX_PROC_NR`
552 AC_SUBST(MAX_PROC_NR)
553
554 dnl Run in subdirs.
555 AC_CONFIG_SUBDIRS([daemon])
556
557 dnl Produce output files.
558 AC_CONFIG_HEADERS([config.h])
559 dnl http://www.mail-archive.com/automake@gnu.org/msg10204.html
560 AC_CONFIG_FILES([appliance/make.sh],
561                 [chmod +x appliance/make.sh])
562 AC_CONFIG_FILES([appliance/update.sh],
563                 [chmod +x appliance/update.sh])
564 AC_CONFIG_FILES([appliance/supermin-split.sh],
565                 [chmod +x appliance/supermin-split.sh])
566 AC_CONFIG_FILES([appliance/supermin-make.sh],
567                 [chmod +x appliance/supermin-make.sh])
568 AC_CONFIG_FILES([appliance/libguestfs-supermin-helper],
569                 [chmod +x appliance/libguestfs-supermin-helper])
570 AC_CONFIG_FILES([Makefile
571                  src/Makefile fish/Makefile po/Makefile.in examples/Makefile
572                  appliance/Makefile
573                  appliance/debian/debirf.conf
574                  images/Makefile
575                  capitests/Makefile
576                  regressions/Makefile
577                  test-tool/Makefile
578                  ocaml/Makefile ocaml/examples/Makefile
579                  perl/Makefile
580                  python/Makefile
581                  ruby/Makefile ruby/Rakefile
582                  java/Makefile
583                  haskell/Makefile
584                  cat/Makefile
585                  df/Makefile
586                  inspector/Makefile
587                  v2v/Makefile
588                  libguestfs.pc
589                  ocaml/META perl/Makefile.PL])
590 AC_OUTPUT
591
592 dnl Produce summary.
593 echo
594 echo
595 echo "------------------------------------------------------------"
596 echo "Thank you for downloading $PACKAGE_STRING"
597 echo
598 echo "This is how we have configured the optional components for you today:"
599 echo
600 echo    "QEMU ................................ $QEMU"
601 echo -n "OCaml bindings ...................... "
602 if test "x$HAVE_OCAML_TRUE" = "x"; then echo "yes"; else echo "no"; fi
603 echo -n "Perl bindings ....................... "
604 if test "x$HAVE_PERL_TRUE" = "x"; then echo "yes"; else echo "no"; fi
605 echo -n "Python bindings ..................... "
606 if test "x$HAVE_PYTHON_TRUE" = "x"; then echo "yes"; else echo "no"; fi
607 echo -n "Ruby bindings ....................... "
608 if test "x$HAVE_RUBY_TRUE" = "x"; then echo "yes"; else echo "no"; fi
609 echo -n "Java bindings ....................... "
610 if test "x$HAVE_JAVA_TRUE" = "x"; then echo "yes"; else echo "no"; fi
611 echo -n "Haskell bindings .................... "
612 if test "x$HAVE_HASKELL" = "x"; then echo "yes"; else echo "no"; fi
613 echo -n "virt-cat ............................ "
614 if test "x$HAVE_CAT" = "x"; then echo "yes"; else echo "no"; fi
615 echo -n "virt-df ............................. "
616 if test "x$HAVE_DF" = "x"; then echo "yes"; else echo "no"; fi
617 echo -n "virt-inspector ...................... "
618 if test "x$HAVE_INSPECTOR" = "x"; then echo "yes"; else echo "no"; fi
619 echo -n "virt-v2v ............................ "
620 if test "x$HAVE_V2V" = "x"; then echo "yes"; else echo "no"; fi
621 echo "supermin appliance .................. $enable_supermin"
622 echo
623 echo "If any optional component is configured 'no' when you expected 'yes'"
624 echo "then you should check the preceeding messages."
625 echo
626 echo "Please report bugs back to the mailing list:"
627 echo "http://www.redhat.com/mailman/listinfo/libguestfs"
628 echo
629 echo "Next you should type 'make' to build the package,"
630 echo "then 'make check' to run the tests."
631 echo "------------------------------------------------------------"