2 # Copyright (C) 2013-2018 Red Hat Inc.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are
9 # * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
12 # * Redistributions in binary form must reproduce the above copyright
13 # notice, this list of conditions and the following disclaimer in the
14 # documentation and/or other materials provided with the distribution.
16 # * Neither the name of Red Hat nor the names of its contributors may be
17 # used to endorse or promote products derived from this software without
18 # specific prior written permission.
20 # THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND
21 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
23 # PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR
24 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
27 # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30 # OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 AC_INIT([nbdkit], [1.9.4])
34 AC_CONFIG_MACRO_DIR([m4])
35 m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],[],
36 [m4_define([AC_USE_SYSTEM_EXTENSIONS],[])])
37 AC_USE_SYSTEM_EXTENSIONS
40 dnl NB: Do not [quote] this parameter.
41 AM_INIT_AUTOMAKE(foreign)
49 dnl OpenBSD doesn't have seq. However if you install coreutils
51 AC_CHECK_PROGS([SEQ], [seq gseq], [no])
52 AS_IF([test "x$SEQ" = "xno" ], [
53 AC_MSG_ERROR([No ‘seq’ or ‘gseq’ program. Install coreutils.])
56 dnl Check for basic C environment.
63 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
67 dnl Check for C++ (optional, we just use this to test the header
68 dnl can be included from C++ code).
71 dnl The C++ compiler test is pretty useless because even if it fails
72 dnl it sets CXX=g++. So test the compiler actually works.
73 AC_MSG_CHECKING([if the C++ compiler really really works])
74 AS_IF([$CXX --version >&AS_MESSAGE_LOG_FD 2>&1],[have_cxx=yes],[have_cxx=no])
75 AC_MSG_RESULT([$have_cxx])
76 AM_CONDITIONAL([HAVE_CXX], [test "$have_cxx" = "yes"])
78 AC_ARG_ENABLE([gcc-warnings],
79 [AS_HELP_STRING([--enable-gcc-warnings],
80 [turn on lots of GCC warnings (for developers)])],
83 *) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
85 gcc_warnings=$enableval],
88 if test "x$gcc_warnings" = "xyes"; then
89 WARNINGS_CFLAGS="-Wall -Werror"
90 AC_SUBST([WARNINGS_CFLAGS])
93 dnl on Haiku we must use BSD-compatibility headers to get the endian macros we use
94 AC_MSG_CHECKING(whether OS-dependent include paths are required)
96 [haiku*], [CFLAGS="$CFLAGS -I`findpaths -p /system B_FIND_PATH_HEADERS_DIRECTORY`/bsd"; AC_MSG_RESULT(yes)],
100 dnl On Linux /tmp is often tmpfs which is not large enough, so use /var/tmp.
101 dnl But Haiku only has /tmp.
102 AC_MSG_CHECKING([for temporary directory for large files])
104 [haiku*], [LARGE_TMPDIR=/tmp],
105 [LARGE_TMPDIR=/var/tmp]
107 AC_MSG_RESULT([$LARGE_TMPDIR])
108 AC_DEFINE_UNQUOTED([LARGE_TMPDIR],["$LARGE_TMPDIR"],
109 [Temporary directory for large files])
111 dnl Check if libc has program_invocation_short_name.
112 AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
116 dnl Check if __attribute__((cleanup(...))) works.
117 dnl Set -Werror, otherwise gcc will only emit a warning for attributes
118 dnl that it doesn't understand.
119 acx_nbdkit_save_CFLAGS="${CFLAGS}"
120 CFLAGS="${CFLAGS} -Werror"
121 AC_MSG_CHECKING([if __attribute__((cleanup(...))) works with this compiler])
136 __attribute__((cleanup(freep))) char *ptr = malloc (100);
140 main (int argc, char *argv[])
151 ['__attribute__((cleanup(...)))' does not work.
153 You may not be using a sufficiently recent version of GCC or CLANG, or
154 you may be using a C compiler which does not support this attribute,
155 or the configure test may be wrong.
157 This code requires the attribute to work for proper locking between threads.])])
159 CFLAGS="${acx_nbdkit_save_CFLAGS}"
161 dnl Check for other headers, all optional.
171 dnl Check for functions in libc, all optional.
174 get_current_dir_name \
177 dnl Check whether printf("%m") works
178 AC_CACHE_CHECK([whether the printf family supports %m],
179 [nbdkit_cv_func_printf_percent_m],
188 snprintf(buf, sizeof buf, "%m");
189 return !!strcmp (buf, strerror (EINVAL));
191 [nbdkit_cv_func_printf_percent_m=yes],
192 [nbdkit_cv_func_printf_percent_m=no],
195 *-gnu* | gnu*) nbdkit_cv_func_printf_percent_m=yes;;
196 *) nbdkit_cv_func_printf_percent_m="guessing no";;
199 AS_IF([test "x$nbdkit_cv_func_printf_percent_m" = xyes],
200 [AC_DEFINE([HAVE_VFPRINTF_PERCENT_M],[1],
201 [Define to 1 if vfprintf supports %m.])])
204 AC_SEARCH_LIBS([dlopen], [dl dld], [
205 AS_IF([test "x$ac_cv_search_dlopen" != "xnone required"],
206 [DL_LIBS="$ac_cv_search_dlopen"], [DL_LIBS=])
208 ], [AC_MSG_ERROR([unable to find the dlopen() function])
212 dnl Test if <iconv.h> header can build working binaries.
214 dnl On FreeBSD: iconv and libiconv both exist, both can be installed
215 dnl simultaneously, <iconv.h> can exist in two separate places, and
216 dnl if you get the wrong header/library mix everything breaks.
218 dnl On Haiku: libiconv is required to link to iconv_* functions.
220 [AS_HELP_STRING([--without-iconv],
221 [don't try to link against iconv @<:@default=check@:>@])],
224 AS_IF([test "x$with_iconv" != "xno"],[
225 AC_CHECK_HEADER([iconv.h],[
226 AC_MSG_CHECKING([if <iconv.h> can be used to link a program])
233 main (int argc, char *argv[])
235 iconv_t ic = iconv_open ("", "");
248 AM_CONDITIONAL([HAVE_ICONV], [test "x$iconv_working" = "xyes"])
250 dnl Check if -rdynamic linker flag works.
251 acx_nbdkit_save_LDFLAGS="${LDFLAGS}"
252 LDFLAGS="${LDFLAGS} -rdynamic"
253 AC_MSG_CHECKING([if linker supports -rdynamic])
258 main (int argc, char *argv[])
270 LDFLAGS="${acx_nbdkit_save_LDFLAGS}"
271 AC_SUBST([DL_LDFLAGS])
273 dnl Check for dladdr in -ldl, optional. This is a glibc extension.
275 LIBS="$DL_LIBS $LIBS"
276 AC_CHECK_FUNCS([dladdr])
279 AC_SEARCH_LIBS([getaddrinfo], [network socket])
281 dnl Check support for setsockcreatecon_raw (part of SELinux).
282 AC_CHECK_LIB([selinux], [setsockcreatecon_raw], [], [:])
284 dnl Check for GnuTLS (optional, for TLS support).
285 PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.3.0], [
286 AC_SUBST([GNUTLS_CFLAGS])
287 AC_SUBST([GNUTLS_LIBS])
288 AC_DEFINE([HAVE_GNUTLS],[1],[gnutls found at compile time.])
290 AC_MSG_WARN([gnutls not found or < 3.3.0, TLS support will be disabled.])
293 AS_IF([test "$GNUTLS_LIBS" != ""],[
294 AC_MSG_CHECKING([for default TLS session priority string])
295 AC_ARG_WITH([tls-priority],
296 [AS_HELP_STRING([--with-tls-priority],
297 [default TLS session priority string @<:@default=NORMAL@:>@])],
298 [tls_priority=$withval],
299 [tls_priority=NORMAL])
300 AC_MSG_RESULT([$tls_priority])
301 AC_DEFINE_UNQUOTED([TLS_PRIORITY],["$tls_priority"],
302 [Default TLS session priority string])
304 # Check for APIs which may not be present.
306 LIBS="$GNUTLS_LIBS $LIBS"
308 gnutls_base64_decode2 \
309 gnutls_certificate_set_known_dh_params \
310 gnutls_session_set_verify_cert])
314 dnl Check for valgrind.
315 AC_CHECK_PROG([VALGRIND],[valgrind],[valgrind],[no])
317 dnl If valgrind headers are available (optional).
318 dnl Since this is only useful for developers, you have to enable
319 dnl it explicitly using --enable-valgrind.
320 AC_ARG_ENABLE([valgrind],
321 [AS_HELP_STRING([--enable-valgrind],
322 [enable Valgrind extensions (for developers)])],
323 [enable_valgrind=yes],
324 [enable_valgrind=no])
325 AS_IF([test "x$enable_valgrind" = "xyes"],[
326 PKG_CHECK_MODULES([VALGRIND], [valgrind], [
327 AC_SUBST([VALGRIND_CFLAGS])
328 AC_SUBST([VALGRIND_LIBS])
329 AC_DEFINE([HAVE_VALGRIND],[1],[Valgrind headers found at compile time])
331 AC_MSG_ERROR([--enable-valgrind given, but Valgrind headers are not available])
336 PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], [
338 AC_MSG_CHECKING([for bash-completions directory])
339 m4_ifdef([PKG_CHECK_VAR],[
340 PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir])
342 AS_IF([test -z "$bashcompdir"], [
343 bashcompdir="${sysconfdir}/bash_completion.d"
345 AC_MSG_RESULT([$bashcompdir])
346 AC_SUBST([bashcompdir])
349 AC_MSG_WARN([bash-completion not installed])
351 AM_CONDITIONAL([HAVE_BASH_COMPLETION],[test "x$bash_completion" = "xyes"])
353 dnl Check we have enough to run podwrapper.
354 AC_CHECK_PROG([PERL],[perl],[perl],[no])
355 AS_IF([test "x$PERL" != "xno"],[
356 AC_MSG_CHECKING([if we have perl Pod::Man and Pod::Simple])
357 AS_IF([$PERL -MPod::Man -MPod::Simple -e 1 >&AS_MESSAGE_LOG_FD 2>&1],[
362 AC_MSG_RESULT([$enable_pod])
364 AM_CONDITIONAL([HAVE_POD],
365 [test "x$PERL" != "xno" && test "x$enable_pod" = "xyes"])
367 dnl Define the path to the podwrapper program.
368 PODWRAPPER="$PERL $(pwd)/podwrapper.pl"
369 AC_SUBST([PODWRAPPER])
371 dnl Allow all plugins and filters to be disabled.
372 AC_ARG_ENABLE([plugins],
373 [AS_HELP_STRING([--disable-plugins],
374 [disable all bundled plugins and filters])])
375 AM_CONDITIONAL([HAVE_PLUGINS], [test "x$enable_plugins" != "xno"])
377 dnl Check for Perl, for embedding in the perl plugin.
378 dnl Note that the perl binary is checked above.
379 AC_ARG_ENABLE([perl],
380 [AS_HELP_STRING([--disable-perl], [disable Perl embed plugin])],
383 AS_IF([test "x$PERL" != "xno" && test "x$enable_perl" != "xno"],[
384 dnl Check for Perl archlib.
385 AC_MSG_CHECKING([for Perl embed archlib])
386 PERL_ARCHLIB="$($PERL -MConfig -e 'print $Config{archlib}')"
387 AS_IF([ test -n "$PERL_ARCHLIB" ],[
388 AC_MSG_RESULT([$PERL_ARCHLIB])
390 AC_MSG_NOTICE([Perl embed module disabled])
394 dnl Check for Perl CFLAGS.
395 AC_MSG_CHECKING([for Perl embed CFLAGS])
396 PERL_CFLAGS="$($PERL -MExtUtils::Embed -e 'ccflags')"
397 AS_IF([ test -n "$PERL_CFLAGS" ],[
398 AC_MSG_RESULT([$PERL_CFLAGS])
400 AC_MSG_NOTICE([Perl embed module disabled])
404 dnl Check for Perl LDOPTS.
405 AC_MSG_CHECKING([for Perl embed LDOPTS])
406 PERL_LDOPTS="$($PERL -MExtUtils::Embed -e 'ldopts')"
407 AC_MSG_RESULT([$PERL_LDOPTS])
409 dnl XXX Could check these actually work.
411 AM_CONDITIONAL([HAVE_PERL],[test "x$enable_perl" != "xno" && test "x$PERL" != "xno"])
412 AC_SUBST([PERL_ARCHLIB])
413 AC_SUBST([PERL_CFLAGS])
414 AC_SUBST([PERL_LDOPTS])
416 dnl Check for Python, for embedding in the python plugin.
417 AC_CHECK_PROG([PYTHON],[python],[python],[no])
418 AC_ARG_ENABLE([python],
419 [AS_HELP_STRING([--disable-python], [disable Python embed plugin])],
422 AS_IF([test "x$PYTHON" != "xno" && test "x$enable_python" != "xno"],[
423 AC_MSG_CHECKING([version of $PYTHON])
424 PYTHON_VERSION_MAJOR=`$PYTHON -c "import sys; print (sys.version_info@<:@0@:>@)"`
425 PYTHON_VERSION_MINOR=`$PYTHON -c "import sys; print (sys.version_info@<:@1@:>@)"`
426 PYTHON_VERSION="$PYTHON_VERSION_MAJOR.$PYTHON_VERSION_MINOR"
427 AS_IF([test -n "$PYTHON_VERSION"],[
428 AC_MSG_RESULT([$PYTHON_VERSION])
430 AC_MSG_NOTICE([Python embed module disabled])
434 dnl Check for Python CFLAGS, libraries.
435 dnl On Debian: python-X.Y.pc
436 PKG_CHECK_MODULES([PYTHON], [python-"$PYTHON_VERSION"], [
437 AC_SUBST([PYTHON_CFLAGS])
438 AC_SUBST([PYTHON_LIBS])
439 AC_SUBST([PYTHON_VERSION])
440 AC_DEFINE([HAVE_PYTHON],[1],[Python library found at compile time])
442 dnl On Fedora: python.pc
443 PKG_CHECK_MODULES([PYTHON], [python], [
444 AC_SUBST([PYTHON_CFLAGS])
445 AC_SUBST([PYTHON_LIBS])
446 AC_SUBST([PYTHON_VERSION])
447 AC_DEFINE([HAVE_PYTHON],[1],[Python library found at compile time])
449 AC_MSG_WARN([python $PYTHON_VERSION not found])
454 dnl Check for various functions needed by the bindings.
457 PYTHON_BLDLIBRARY=`$PYTHON -c "import distutils.sysconfig; \
458 print (distutils.sysconfig.get_config_var('BLDLIBRARY'))"`
459 AC_CHECK_LIB([c],[PyString_FromString],
460 [AC_DEFINE([HAVE_PYSTRING_FROMSTRING],1,
461 [Found PyString_FromString in libpython.])],
462 [],[$PYTHON_BLDLIBRARY])
463 AC_CHECK_LIB([c],[PyString_AsString],
464 [AC_DEFINE([HAVE_PYSTRING_ASSTRING],1,
465 [Found PyString_AsString in libpython.])],
466 [],[$PYTHON_BLDLIBRARY])
467 AC_CHECK_LIB([c],[PyUnicode_AsUTF8],
468 [AC_DEFINE([HAVE_PYUNICODE_ASUTF8],1,
469 [Found PyUnicode_AsUTF8 in libpython.])],
470 [],[$PYTHON_BLDLIBRARY])
475 AM_CONDITIONAL([HAVE_PYTHON],[test "x$enable_python" != "xno" && test "x$PYTHON" != "xno"])
476 AC_SUBST([PYTHON_CFLAGS])
477 AC_SUBST([PYTHON_LIBS])
478 AC_SUBST([PYTHON_LDFLAGS])
480 dnl For the OCaml plugin, you can set OCAMLOPTFLAGS before running
481 dnl ./configure to specify any extra flags you want to pass to
483 AC_SUBST([OCAMLOPTFLAGS])
485 dnl Check for OCaml, for embedding in the ocaml plugin.
487 AC_ARG_ENABLE([ocaml],
488 [AS_HELP_STRING([--disable-ocaml], [disable OCaml embed plugin])],
491 AS_IF([test "x$OCAMLOPT" != "xno" && test "x$enable_ocaml" != "xno"],[
492 dnl Check OCaml can create a shared library (see README for details).
493 AC_MSG_CHECKING([if $OCAMLOPT can create a shared library])
494 echo 'print_endline "test"' > conftest.ml
495 AS_IF([$OCAMLOPT $OCAMLOPTFLAGS -output-obj -runtime-variant _pic -o conftest.so conftest.ml >&AS_MESSAGE_LOG_FD 2>&1],[
497 ocaml_link_shared=yes
501 rm -f conftest.ml conftest.cmi conftest.cmx conftest.so conftest.o
503 AM_CONDITIONAL([HAVE_OCAML],[test "x$OCAMLOPT" != "xno" &&
504 test "x$ocaml_link_shared" = "xyes"])
506 dnl Check for Ruby, for embedding in the Ruby plugin.
507 AC_CHECK_PROG([RUBY],[ruby],[ruby],[no])
508 AC_ARG_ENABLE([ruby],
509 [AS_HELP_STRING([--disable-ruby], [disable Ruby plugin])],
512 AS_IF([test "x$RUBY" != "xno" && test "x$enable_ruby" != "xno"],[
513 PKG_CHECK_MODULES([RUBY], [ruby], [
514 AC_SUBST([RUBY_CFLAGS])
515 AC_SUBST([RUBY_LIBS])
517 AC_MSG_WARN([ruby not found])
521 AM_CONDITIONAL([HAVE_RUBY],[test "x$RUBY" != "xno" &&
522 test "x$enable_ruby" = "xyes"])
524 dnl Check for Tcl, for embedding in the Tcl plugin.
526 [AS_HELP_STRING([--disable-tcl], [disable Tcl plugin])],
529 AS_IF([test "x$enable_tcl" != "xno"],[
530 PKG_CHECK_MODULES([TCL], [tcl], [
531 AC_SUBST([TCL_CFLAGS])
534 AC_MSG_WARN([Tcl not found])
538 AM_CONDITIONAL([HAVE_TCL],[test "x$enable_tcl" = "xyes"])
540 dnl Check for Lua, for embedding in the Lua plugin.
542 [AS_HELP_STRING([--disable-lua], [disable Lua plugin])],
545 AS_IF([test "x$enable_lua" != "xno"],[
546 PKG_CHECK_MODULES([LUA], [lua], [
547 AC_SUBST([LUA_CFLAGS])
550 dnl Lua 5.1 used by RHEL 7 does not have lua_isinteger.
552 LIBS="$LUA_LIBS $LIBS"
553 AC_CHECK_FUNCS([lua_isinteger])
556 AC_MSG_WARN([Lua not found])
560 AM_CONDITIONAL([HAVE_LUA],[test "x$enable_lua" = "xyes"])
562 dnl Check for curl (only if you want to compile the curl plugin).
564 [AS_HELP_STRING([--without-curl],
565 [disable curl plugin @<:@default=check@:>@])],
568 AS_IF([test "$with_curl" != "no"],[
569 PKG_CHECK_MODULES([CURL], [libcurl],[
570 AC_SUBST([CURL_CFLAGS])
571 AC_SUBST([CURL_LIBS])
572 AC_DEFINE([HAVE_CURL],[1],[curl found at compile time.])
573 AC_CHECK_DECL([CURLOPT_UNIX_SOCKET_PATH], [
574 AC_DEFINE([HAVE_CURLOPT_UNIX_SOCKET_PATH],[1],
575 [CURLOPT_UNIX_SOCKET_PATH found at compile time.])
576 ], [], [#include <curl/curl.h>])
578 [AC_MSG_WARN([curl not found, curl plugin will be disabled])])
580 AM_CONDITIONAL([HAVE_CURL],[test "x$CURL_LIBS" != "x"])
582 dnl Check for genisoimage or mkisofs
583 dnl (only if you want to compile the iso plugin).
586 [AS_HELP_STRING([--without-iso],
587 [disable iso plugin @<:@default=check@:>@])],
590 AS_IF([test "$with_iso" != "no"],[
591 AC_CHECK_PROG([GENISOIMAGE],[genisoimage],[genisoimage],[no])
592 AC_CHECK_PROG([MKISOFS],[mkisofs],[mkisofs],[no])
593 AS_IF([test "x$GENISOIMAGE" != "xno"],[
594 ISOPROG="$GENISOIMAGE"
596 AS_IF([test "x$MKISOFS" != "xno"],[
600 AS_IF([test "x$ISOPROG" != "xno"],[
601 AC_DEFINE_UNQUOTED([ISOPROG],["$ISOPROG"],
602 [Program used by iso plugin to make ISOs.])
606 AM_CONDITIONAL([HAVE_ISO],[test "x$ISOPROG" != "xno"])
608 dnl Check for libvirt (only if you want to compile the libvirt plugin).
609 AC_ARG_WITH([libvirt],
610 [AS_HELP_STRING([--without-libvirt],
611 [disable libvirt plugin @<:@default=check@:>@])],
613 [with_libvirt=check])
614 AS_IF([test "$with_libvirt" != "no"],[
615 PKG_CHECK_MODULES([LIBVIRT], [libvirt],[
616 AC_SUBST([LIBVIRT_CFLAGS])
617 AC_SUBST([LIBVIRT_LIBS])
618 AC_DEFINE([HAVE_LIBVIRT],[1],[libvirt found at compile time.])
620 [AC_MSG_WARN([libvirt not found, libvirt plugin will be disabled])])
622 AM_CONDITIONAL([HAVE_LIBVIRT],[test "x$LIBVIRT_LIBS" != "x"])
624 dnl Check for zlib (only if you want to compile the gzip plugin).
626 [AS_HELP_STRING([--without-zlib],
627 [disable gzip plugin @<:@default=check@:>@])],
630 AS_IF([test "$with_zlib" != "no"],[
631 PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3.5],[
632 AC_SUBST([ZLIB_CFLAGS])
633 AC_SUBST([ZLIB_LIBS])
634 AC_DEFINE([HAVE_ZLIB],[1],[zlib found at compile time.])
636 [AC_MSG_WARN([zlib >= 1.2.3.5 not found, gzip plugin will be disabled])])
638 AM_CONDITIONAL([HAVE_ZLIB],[test "x$ZLIB_LIBS" != "x"])
640 dnl Check for liblzma (only if you want to compile the xz filter).
641 AC_ARG_WITH([liblzma],
642 [AS_HELP_STRING([--without-liblzma],
643 [disable xz filter @<:@default=check@:>@])],
645 [with_liblzma=check])
646 AS_IF([test "$with_liblzma" != "no"],[
647 PKG_CHECK_MODULES([LIBLZMA], [liblzma],[
648 AC_SUBST([LIBLZMA_CFLAGS])
649 AC_SUBST([LIBLZMA_LIBS])
650 AC_DEFINE([HAVE_LIBLZMA],[1],[liblzma found at compile time.])
652 [AC_MSG_WARN([liblzma not found, xz filter will be disabled])])
654 AM_CONDITIONAL([HAVE_LIBLZMA],[test "x$LIBLZMA_LIBS" != "x"])
656 dnl Check for libguestfs (only for the guestfs plugin and the test suite).
657 AC_ARG_WITH([libguestfs],
658 [AS_HELP_STRING([--without-libguestfs],
659 [disable guestfs plugin and tests @<:@default=check@:>@])],
661 [with_libguestfs=check])
662 AS_IF([test "$with_libguestfs" != "no"],[
663 PKG_CHECK_MODULES([LIBGUESTFS], [libguestfs],[
664 # Although the library was found, we want to make sure it supports nbd
665 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
668 #ifndef GUESTFS_ADD_DRIVE_OPTS_PROTOCOL
672 AC_SUBST([LIBGUESTFS_CFLAGS])
673 AC_SUBST([LIBGUESTFS_LIBS])
674 AC_DEFINE([HAVE_LIBGUESTFS],[1],[libguestfs found at compile time.])
677 AC_MSG_WARN([libguestfs too old, guestfs plugin and tests will be disabled])])
679 [AC_MSG_WARN([libguestfs not found, guestfs plugin and tests will be disabled])])
681 AM_CONDITIONAL([HAVE_LIBGUESTFS],[test "x$LIBGUESTFS_LIBS" != "x"])
683 dnl Check for guestfish (only needed for some of the tests).
684 AC_CHECK_PROG([GUESTFISH], [guestfish], [guestfish], [no])
685 AM_CONDITIONAL([HAVE_GUESTFISH], [test "x$GUESTFISH" != "xno"])
687 dnl Check for ext2fs and com_err, for the ext2 plugin.
689 [AS_HELP_STRING([--without-ext2],
690 [disable ext2 plugin @<:@default=check@:>@])],
693 AS_IF([test "$with_ext2" != "no"], [
694 PKG_CHECK_MODULES([EXT2FS], [ext2fs], [
695 AC_SUBST([EXT2FS_CFLAGS])
696 AC_SUBST([EXT2FS_LIBS])
697 AC_DEFINE([HAVE_EXT2FS],[1],[ext2fs found at compile time.])
699 [AC_MSG_WARN([ext2fs not found, ext2 plugin will be disabled])])
700 PKG_CHECK_MODULES([COM_ERR], [com_err], [
701 AC_SUBST([COM_ERR_CFLAGS])
702 AC_SUBST([COM_ERR_LIBS])
703 AC_DEFINE([HAVE_COM_ERR],[1],[com_err found at compile time.])
705 [AC_MSG_WARN([com_err not found, ext2 plugin will be disabled])])
707 AM_CONDITIONAL([HAVE_EXT2],
708 [test "x$EXT2FS_LIBS" != "x" && test "x$COM_ERR_LIBS" != "x"])
710 dnl Check if the user wants to disable VDDK support.
711 dnl See plugins/vddk/README.VDDK.
712 AC_ARG_ENABLE([vddk],
713 [AS_HELP_STRING([--disable-vddk],
714 [disable VMware VDDK plugin])],
717 AM_CONDITIONAL([HAVE_VDDK], [test "x$enable_vddk" = "xyes"])
719 dnl List of plugins and filters.
756 plugins="$(echo $(printf %s\\n $lang_plugins $non_lang_plugins | sort -u))"
772 AC_SUBST([lang_plugins])
773 AC_SUBST([non_lang_plugins])
776 dnl Produce output files.
777 AC_CONFIG_HEADERS([config.h])
778 AC_CONFIG_FILES([podwrapper.pl],
779 [chmod +x,-w podwrapper.pl])
780 AC_CONFIG_FILES([Makefile
782 common/bitmap/Makefile
783 common/include/Makefile
784 common/regions/Makefile
785 common/sparse/Makefile
789 plugins/curl/Makefile
790 plugins/data/Makefile
791 plugins/example1/Makefile
792 plugins/example2/Makefile
793 plugins/example3/Makefile
794 plugins/example4/Makefile
795 plugins/ext2/Makefile
796 plugins/file/Makefile
797 plugins/floppy/Makefile
798 plugins/guestfs/Makefile
799 plugins/gzip/Makefile
801 plugins/libvirt/Makefile
803 plugins/memory/Makefile
805 plugins/null/Makefile
806 plugins/ocaml/Makefile
807 plugins/partitioning/Makefile
808 plugins/pattern/Makefile
809 plugins/perl/Makefile
810 plugins/python/Makefile
811 plugins/random/Makefile
812 plugins/ruby/Makefile
814 plugins/split/Makefile
815 plugins/streaming/Makefile
818 plugins/vddk/Makefile
820 plugins/zero/Makefile
822 filters/blocksize/Makefile
823 filters/cache/Makefile
825 filters/delay/Makefile
826 filters/error/Makefile
829 filters/nozero/Makefile
830 filters/offset/Makefile
831 filters/partition/Makefile
832 filters/truncate/Makefile