file: Add missing include for FALLOC_FL_*
[nbdkit/ericb.git] / configure.ac
blobb87efb9a9a72578044486c259c540ee504da39f2
1 # nbdkit
2 # Copyright (C) 2013-2018 Red Hat Inc.
3 # All rights reserved.
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are
7 # met:
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
31 # SUCH DAMAGE.
33 AC_INIT([nbdkit], [1.5.1])
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
38 AC_SYS_LARGEFILE
40 dnl NB: Do not [quote] this parameter.
41 AM_INIT_AUTOMAKE(foreign)
42 AC_PROG_LIBTOOL
43 LT_INIT
45 AC_PROG_SED
47 dnl Check for basic C environment.
48 AC_PROG_CC_STDC
49 AC_PROG_INSTALL
50 AC_PROG_CPP
52 AC_C_PROTOTYPES
53 test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])
55 AM_PROG_CC_C_O
57 dnl Check for C++ (optional, we just use this to test the header
58 dnl can be included from C++ code).
59 AC_PROG_CXX
61 dnl The C++ compiler test is pretty useless because even if it fails
62 dnl it sets CXX=g++.  So test the compiler actually works.
63 AC_MSG_CHECKING([if the C++ compiler really really works])
64 AS_IF([$CXX --version >&AS_MESSAGE_LOG_FD 2>&1],[have_cxx=yes],[have_cxx=no])
65 AC_MSG_RESULT([$have_cxx])
66 AM_CONDITIONAL([HAVE_CXX], [test "$have_cxx" = "yes"])
68 AC_ARG_ENABLE([gcc-warnings],
69     [AS_HELP_STRING([--enable-gcc-warnings],
70                     [turn on lots of GCC warnings (for developers)])],
71      [case $enableval in
72       yes|no) ;;
73       *)      AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
74       esac
75       gcc_warnings=$enableval],
76       [gcc_warnings=no]
78 if test "x$gcc_warnings" = "xyes"; then
79     WARNINGS_CFLAGS="-Wall -Werror"
80     AC_SUBST([WARNINGS_CFLAGS])
83 dnl Check if libc has program_invocation_short_name.
84 AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
86 dnl Check if __attribute__((cleanup(...))) works.
87 dnl Set -Werror, otherwise gcc will only emit a warning for attributes
88 dnl that it doesn't understand.
89 acx_nbdkit_save_CFLAGS="${CFLAGS}"
90 CFLAGS="${CFLAGS} -Werror"
91 AC_MSG_CHECKING([if __attribute__((cleanup(...))) works with this compiler])
92 AC_COMPILE_IFELSE([
93 AC_LANG_SOURCE([[
94 #include <stdio.h>
95 #include <stdlib.h>
97 void
98 freep (void *ptr)
100   exit (EXIT_SUCCESS);
103 void
104 test (void)
106   __attribute__((cleanup(freep))) char *ptr = malloc (100);
110 main (int argc, char *argv[])
112   test ();
113   exit (EXIT_FAILURE);
116     ],[
117     AC_MSG_RESULT([yes])
118     ],[
119     AC_MSG_RESULT([no])
120     AC_MSG_ERROR(
121 ['__attribute__((cleanup(...)))' does not work.
123 You may not be using a sufficiently recent version of GCC or CLANG, or
124 you may be using a C compiler which does not support this attribute,
125 or the configure test may be wrong.
127 This code requires the attribute to work for proper locking between threads.])])
128 dnl restore CFLAGS
129 CFLAGS="${acx_nbdkit_save_CFLAGS}"
131 dnl Check for other headers, all optional.
132 AC_CHECK_HEADERS([selinux/selinux.h sys/prctl.h])
134 dnl Check support for setsockcreatecon_raw (part of SELinux).
135 AC_CHECK_LIB([selinux], [setsockcreatecon_raw], [], [:])
137 dnl Check for GnuTLS (optional, for TLS support).
138 PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.3.0], [
139     AC_SUBST([GNUTLS_CFLAGS])
140     AC_SUBST([GNUTLS_LIBS])
141     AC_DEFINE([HAVE_GNUTLS],[1],[gnutls found at compile time.])
142 ], [
143     AC_MSG_WARN([gnutls not found or < 3.3.0, TLS support will be disabled.])
146 AS_IF([test "$GNUTLS_LIBS" != ""],[
147     AC_MSG_CHECKING([for default TLS session priority string])
148     AC_ARG_WITH([tls-priority],[
149         AS_HELP_STRING([--with-tls-priority],
150                        [default TLS session priority string @<:@default=NORMAL@:>@])],
151         [tls_priority=$withval],
152         [tls_priority=NORMAL])
153     AC_MSG_RESULT([$tls_priority])
154     AC_DEFINE_UNQUOTED([TLS_PRIORITY],["$tls_priority"],
155                        [Default TLS session priority string])
157     # Check for APIs which may not be present.
158     old_LIBS="$LIBS"
159     LIBS="$GNUTLS_LIBS $LIBS"
160     AC_CHECK_FUNCS([\
161         gnutls_certificate_set_known_dh_params \
162         gnutls_session_set_verify_cert])
163     LIBS="$old_LIBS"
166 dnl Check for valgrind.
167 AC_CHECK_PROG([VALGRIND],[valgrind],[valgrind],[no])
169 dnl If valgrind headers are available (optional).
170 dnl Since this is only useful for developers, you have to enable
171 dnl it explicitly using --enable-valgrind.
172 AC_ARG_ENABLE([valgrind],
173     AS_HELP_STRING([--enable-valgrind], [enable Valgrind extensions, for developers]),
174     [enable_valgrind=yes],
175     [enable_valgrind=no])
176 AS_IF([test "x$enable_valgrind" = "xyes"],[
177     PKG_CHECK_MODULES([VALGRIND], [valgrind], [
178         AC_SUBST([VALGRIND_CFLAGS])
179         AC_SUBST([VALGRIND_LIBS])
180         AC_DEFINE([HAVE_VALGRIND],[1],[Valgrind headers found at compile time])
181     ],[
182         AC_MSG_ERROR([--enable-valgrind given, but Valgrind headers are not available])
183     ])
186 dnl Bash completion.
187 PKG_CHECK_MODULES([BASH_COMPLETION], [bash-completion >= 2.0], [
188     bash_completion=yes
189     AC_MSG_CHECKING([for bash-completions directory])
190     m4_ifdef([PKG_CHECK_VAR],[
191         PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir])
192     ])
193     AS_IF([test -z "$bashcompdir"], [
194         bashcompdir="${sysconfdir}/bash_completion.d"
195     ])
196     AC_MSG_RESULT([$bashcompdir])
197     AC_SUBST([bashcompdir])
199     bash_completion=no
200     AC_MSG_WARN([bash-completion not installed])
202 AM_CONDITIONAL([HAVE_BASH_COMPLETION],[test "x$bash_completion" = "xyes"])
204 dnl Check we have enough to run podwrapper.
205 AC_CHECK_PROG([PERL],[perl],[perl],[no])
206 AS_IF([test "x$PERL" != "xno"],[
207     AC_MSG_CHECKING([if we have perl Pod::Man and Pod::Simple])
208     AS_IF([$PERL -MPod::Man -MPod::Simple -e 1 >&AS_MESSAGE_LOG_FD 2>&1],[
209         enable_pod=yes
210     ],[
211         enable_pod=no
212     ])
213     AC_MSG_RESULT([$enable_pod])
215 AM_CONDITIONAL([HAVE_POD],
216                [test "x$PERL" != "xno" && test "x$enable_pod" = "xyes"])
218 dnl Define the path to the podwrapper program.
219 PODWRAPPER="$PERL $(pwd)/podwrapper.pl"
220 AC_SUBST([PODWRAPPER])
222 dnl Allow all plugins and filters to be disabled.
223 AC_ARG_ENABLE([plugins],
224     [AS_HELP_STRING([--disable-plugins], [disable all bundled plugins and filters])])
225 AM_CONDITIONAL([HAVE_PLUGINS], [test "x$enable_plugins" != "xno"])
227 dnl Check for Perl, for embedding in the perl plugin.
228 dnl Note that the perl binary is checked above.
229 AC_ARG_ENABLE([perl],
230     AS_HELP_STRING([--disable-perl], [disable Perl embed plugin]),
231     [],
232     [enable_perl=yes])
233 AS_IF([test "x$PERL" != "xno" && test "x$enable_perl" != "xno"],[
234     dnl Check for Perl archlib.
235     AC_MSG_CHECKING([for Perl embed archlib])
236     PERL_ARCHLIB="$($PERL -MConfig -e 'print $Config{archlib}')"
237     AS_IF([ test -n "$PERL_ARCHLIB" ],[
238         AC_MSG_RESULT([$PERL_ARCHLIB])
239     ],[
240         AC_MSG_NOTICE([Perl embed module disabled])
241         enable_perl=no
242     ])
244     dnl Check for Perl CFLAGS.
245     AC_MSG_CHECKING([for Perl embed CFLAGS])
246     PERL_CFLAGS="$($PERL -MExtUtils::Embed -e 'ccflags')"
247     AS_IF([ test -n "$PERL_CFLAGS" ],[
248         AC_MSG_RESULT([$PERL_CFLAGS])
249     ],[
250         AC_MSG_NOTICE([Perl embed module disabled])
251         enable_perl=no
252     ])
254     dnl Check for Perl LDOPTS.
255     AC_MSG_CHECKING([for Perl embed LDOPTS])
256     PERL_LDOPTS="$($PERL -MExtUtils::Embed -e 'ldopts')"
257     AC_MSG_RESULT([$PERL_LDOPTS])
259     dnl XXX Could check these actually work.
261 AM_CONDITIONAL([HAVE_PERL],[test "x$enable_perl" != "xno" && test "x$PERL" != "xno"])
262 AC_SUBST([PERL_ARCHLIB])
263 AC_SUBST([PERL_CFLAGS])
264 AC_SUBST([PERL_LDOPTS])
266 dnl Check for Python, for embedding in the python plugin.
267 AC_CHECK_PROG([PYTHON],[python],[python],[no])
268 AC_ARG_ENABLE([python],
269     AS_HELP_STRING([--disable-python], [disable Python embed plugin]),
270     [],
271     [enable_python=yes])
272 AS_IF([test "x$PYTHON" != "xno" && test "x$enable_python" != "xno"],[
273     AC_MSG_CHECKING([version of $PYTHON])
274     PYTHON_VERSION_MAJOR=`$PYTHON -c "import sys; print (sys.version_info@<:@0@:>@)"`
275     PYTHON_VERSION_MINOR=`$PYTHON -c "import sys; print (sys.version_info@<:@1@:>@)"`
276     PYTHON_VERSION="$PYTHON_VERSION_MAJOR.$PYTHON_VERSION_MINOR"
277     AS_IF([test -n "$PYTHON_VERSION"],[
278         AC_MSG_RESULT([$PYTHON_VERSION])
279     ],[
280         AC_MSG_NOTICE([Python embed module disabled])
281         enable_python=no
282     ])
284     dnl Check for Python CFLAGS, libraries.
285     dnl On Debian: python-X.Y.pc
286     PKG_CHECK_MODULES([PYTHON], [python-"$PYTHON_VERSION"], [
287         AC_SUBST([PYTHON_CFLAGS])
288         AC_SUBST([PYTHON_LIBS])
289         AC_SUBST([PYTHON_VERSION])
290         AC_DEFINE([HAVE_PYTHON],[1],[Python library found at compile time])
291     ],[
292         dnl On Fedora: python.pc
293         PKG_CHECK_MODULES([PYTHON], [python], [
294             AC_SUBST([PYTHON_CFLAGS])
295             AC_SUBST([PYTHON_LIBS])
296             AC_SUBST([PYTHON_VERSION])
297             AC_DEFINE([HAVE_PYTHON],[1],[Python library found at compile time])
298         ],[
299             AC_MSG_WARN([python $PYTHON_VERSION not found])
300             enable_python=no
301         ])
302     ])
304     dnl Check for various functions needed by the bindings.
305     old_LIBS="$LIBS"
307     PYTHON_BLDLIBRARY=`$PYTHON -c "import distutils.sysconfig; \
308         print (distutils.sysconfig.get_config_var('BLDLIBRARY'))"`
309     AC_CHECK_LIB([c],[PyString_FromString],
310                  [AC_DEFINE([HAVE_PYSTRING_FROMSTRING],1,
311                             [Found PyString_FromString in libpython.])],
312                  [],[$PYTHON_BLDLIBRARY])
313     AC_CHECK_LIB([c],[PyString_AsString],
314                  [AC_DEFINE([HAVE_PYSTRING_ASSTRING],1,
315                             [Found PyString_AsString in libpython.])],
316                  [],[$PYTHON_BLDLIBRARY])
317     AC_CHECK_LIB([c],[PyUnicode_AsUTF8],
318                  [AC_DEFINE([HAVE_PYUNICODE_ASUTF8],1,
319                             [Found PyUnicode_AsUTF8 in libpython.])],
320                  [],[$PYTHON_BLDLIBRARY])
322     LIBS="$old_LIBS"
325 AM_CONDITIONAL([HAVE_PYTHON],[test "x$enable_python" != "xno" && test "x$PYTHON" != "xno"])
326 AC_SUBST([PYTHON_CFLAGS])
327 AC_SUBST([PYTHON_LIBS])
328 AC_SUBST([PYTHON_LDFLAGS])
330 dnl For the OCaml plugin, you can set OCAMLOPTFLAGS before running
331 dnl ./configure to specify any extra flags you want to pass to
332 dnl ocamlopt.
333 AC_SUBST([OCAMLOPTFLAGS])
335 dnl Check for OCaml, for embedding in the ocaml plugin.
336 AC_PROG_OCAML
337 AC_ARG_ENABLE([ocaml],
338     AS_HELP_STRING([--disable-ocaml], [disable OCaml embed plugin]),
339     [],
340     [enable_ocaml=yes])
341 AS_IF([test "x$OCAMLOPT" != "xno" && test "x$enable_ocaml" != "xno"],[
342     dnl Check OCaml can create a shared library (see README for details).
343     AC_MSG_CHECKING([if $OCAMLOPT can create a shared library])
344     echo 'print_endline "test"' > conftest.ml
345     AS_IF([$OCAMLOPT $OCAMLOPTFLAGS -output-obj -runtime-variant _pic -o conftest.so conftest.ml >&AS_MESSAGE_LOG_FD 2>&1],[
346         AC_MSG_RESULT([yes])
347         ocaml_link_shared=yes
348     ],[
349         AC_MSG_RESULT([no])
350     ])
351     rm -f conftest.ml conftest.cmi conftest.cmx conftest.so conftest.o
353 AM_CONDITIONAL([HAVE_OCAML],[test "x$OCAMLOPT" != "xno" &&
354                              test "x$ocaml_link_shared" = "xyes"])
356 dnl Check for Ruby, for embedding in the Ruby plugin.
357 AC_CHECK_PROG([RUBY],[ruby],[ruby],[no])
358 AC_ARG_ENABLE([ruby],
359     AS_HELP_STRING([--disable-ruby], [disable Ruby plugin]),
360     [],
361     [enable_ruby=yes])
362 AS_IF([test "x$RUBY" != "xno" && test "x$enable_ruby" != "xno"],[
363     PKG_CHECK_MODULES([RUBY], [ruby], [
364         AC_SUBST([RUBY_CFLAGS])
365         AC_SUBST([RUBY_LIBS])
366     ],[
367         AC_MSG_WARN([ruby not found])
368         enable_ruby=no
369     ])
371 AM_CONDITIONAL([HAVE_RUBY],[test "x$RUBY" != "xno" &&
372                             test "x$enable_ruby" = "xyes"])
374 dnl Check for Tcl, for embedding in the Tcl plugin.
375 AC_ARG_ENABLE([tcl],
376     AS_HELP_STRING([--disable-tcl], [disable Tcl plugin]),
377     [],
378     [enable_tcl=yes])
379 AS_IF([test "x$enable_tcl" != "xno"],[
380     PKG_CHECK_MODULES([TCL], [tcl], [
381         AC_SUBST([TCL_CFLAGS])
382         AC_SUBST([TCL_LIBS])
383     ],[
384         AC_MSG_WARN([Tcl not found])
385         enable_tcl=no
386     ])
388 AM_CONDITIONAL([HAVE_TCL],[test "x$enable_tcl" = "xyes"])
390 dnl Check for Lua, for embedding in the Lua plugin.
391 AC_ARG_ENABLE([lua],
392     AS_HELP_STRING([--disable-lua], [disable Lua plugin]),
393     [],
394     [enable_lua=yes])
395 AS_IF([test "x$enable_lua" != "xno"],[
396     PKG_CHECK_MODULES([LUA], [lua], [
397         AC_SUBST([LUA_CFLAGS])
398         AC_SUBST([LUA_LIBS])
399     ],[
400         AC_MSG_WARN([Lua not found])
401         enable_lua=no
402     ])
404 AM_CONDITIONAL([HAVE_LUA],[test "x$enable_lua" = "xyes"])
406 dnl Check for curl (only if you want to compile the curl plugin).
407 AC_ARG_WITH([curl],[
408     AS_HELP_STRING([--without-curl],
409                    [disable curl plugin @<:@default=check@:>@])],
410     [],
411     [with_curl=check])
412 AS_IF([test "$with_curl" != "no"],[
413     PKG_CHECK_MODULES([CURL], [libcurl],[
414         AC_SUBST([CURL_CFLAGS])
415         AC_SUBST([CURL_LIBS])
416         AC_DEFINE([HAVE_CURL],[1],[curl found at compile time.])
417     ],
418     [AC_MSG_WARN([curl not found, curl plugin will be disabled])])
420 AM_CONDITIONAL([HAVE_CURL],[test "x$CURL_LIBS" != "x"])
422 dnl Check for libvirt (only if you want to compile the libvirt plugin).
423 AC_ARG_WITH([libvirt],[
424     AS_HELP_STRING([--without-libvirt],
425                    [disable libvirt plugin @<:@default=check@:>@])],
426     [],
427     [with_libvirt=check])
428 AS_IF([test "$with_libvirt" != "no"],[
429     PKG_CHECK_MODULES([LIBVIRT], [libvirt],[
430         AC_SUBST([LIBVIRT_CFLAGS])
431         AC_SUBST([LIBVIRT_LIBS])
432         AC_DEFINE([HAVE_LIBVIRT],[1],[libvirt found at compile time.])
433     ],
434     [AC_MSG_WARN([libvirt not found, libvirt plugin will be disabled])])
436 AM_CONDITIONAL([HAVE_LIBVIRT],[test "x$LIBVIRT_LIBS" != "x"])
438 dnl Check for zlib (only if you want to compile the gzip plugin).
439 AC_ARG_WITH([zlib],[
440     AS_HELP_STRING([--without-zlib],
441                    [disable gzip plugin @<:@default=check@:>@])],
442     [],
443     [with_zlib=check])
444 AS_IF([test "$with_zlib" != "no"],[
445     PKG_CHECK_MODULES([ZLIB], [zlib],[
446         AC_SUBST([ZLIB_CFLAGS])
447         AC_SUBST([ZLIB_LIBS])
448         AC_DEFINE([HAVE_ZLIB],[1],[zlib found at compile time.])
449     ],
450     [AC_MSG_WARN([zlib not found, gzip plugin will be disabled])])
452 AM_CONDITIONAL([HAVE_ZLIB],[test "x$ZLIB_LIBS" != "x"])
454 dnl Check for liblzma (only if you want to compile the xz plugin).
455 AC_ARG_WITH([liblzma],[
456     AS_HELP_STRING([--without-liblzma],
457                    [disable xz plugin @<:@default=check@:>@])],
458     [],
459     [with_liblzma=check])
460 AS_IF([test "$with_liblzma" != "no"],[
461     PKG_CHECK_MODULES([LIBLZMA], [liblzma],[
462         AC_SUBST([LIBLZMA_CFLAGS])
463         AC_SUBST([LIBLZMA_LIBS])
464         AC_DEFINE([HAVE_LIBLZMA],[1],[liblzma found at compile time.])
465     ],
466     [AC_MSG_WARN([liblzma not found, xz plugin will be disabled])])
468 AM_CONDITIONAL([HAVE_LIBLZMA],[test "x$LIBLZMA_LIBS" != "x"])
470 dnl Check for libguestfs (only for the guestfs plugin and the test suite).
471 AC_ARG_WITH([libguestfs],[
472     AS_HELP_STRING([--without-libguestfs],
473                    [disable guestfs plugin and tests @<:@default=check@:>@])],
474     [],
475     [with_libguestfs=check])
476 AS_IF([test "$with_libguestfs" != "no"],[
477     PKG_CHECK_MODULES([LIBGUESTFS], [libguestfs],[
478         # Although the library was found, we want to make sure it supports nbd
479         AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
480 #include <guestfs.h>
481         ]], [[
482 #ifndef GUESTFS_ADD_DRIVE_OPTS_PROTOCOL
483 #error unsupported
484 #endif
485         ]])], [
486         AC_SUBST([LIBGUESTFS_CFLAGS])
487         AC_SUBST([LIBGUESTFS_LIBS])
488         AC_DEFINE([HAVE_LIBGUESTFS],[1],[libguestfs found at compile time.])
489         ],[
490         LIBGUESTFS_LIBS=
491         AC_MSG_WARN([libguestfs too old, guestfs plugin and tests will be disabled])])
492     ],
493     [AC_MSG_WARN([libguestfs not found, guestfs plugin and tests will be disabled])])
495 AM_CONDITIONAL([HAVE_LIBGUESTFS],[test "x$LIBGUESTFS_LIBS" != "x"])
497 dnl Check for guestfish (only needed for some of the tests).
498 AC_CHECK_PROG([GUESTFISH], [guestfish], [guestfish], [no])
499 AM_CONDITIONAL([HAVE_GUESTFISH], [test "x$GUESTFISH" != "xno"])
501 dnl Check for ext2fs and com_err, for the ext2 plugin.
502 AC_ARG_WITH([ext2],[
503     AS_HELP_STRING([--without-ext2],
504                    [disable ext2 plugin @<:@default=check@:>@])],
505     [],
506     [with_ext2=check])
507 AS_IF([test "$with_ext2" != "no"], [
508     PKG_CHECK_MODULES([EXT2FS], [ext2fs], [
509         AC_SUBST([EXT2FS_CFLAGS])
510         AC_SUBST([EXT2FS_LIBS])
511         AC_DEFINE([HAVE_EXT2FS],[1],[ext2fs found at compile time.])
512     ],
513     [AC_MSG_WARN([ext2fs not found, ext2 plugin will be disabled])])
514     PKG_CHECK_MODULES([COM_ERR], [com_err], [
515         AC_SUBST([COM_ERR_CFLAGS])
516         AC_SUBST([COM_ERR_LIBS])
517         AC_DEFINE([HAVE_COM_ERR],[1],[com_err found at compile time.])
518     ],
519     [AC_MSG_WARN([com_err not found, ext2 plugin will be disabled])])
521 AM_CONDITIONAL([HAVE_EXT2],
522                [test "x$EXT2FS_LIBS" != "x" && test "x$COM_ERR_LIBS" != "x"])
524 dnl Check if the user wants to disable VDDK support.
525 dnl See plugins/vddk/README.VDDK.
526 AC_ARG_ENABLE([vddk],[
527     AS_HELP_STRING([--disable-vddk],
528                    [disable VMware VDDK plugin])],
529     [],
530     [enable_vddk=yes])
531 AM_CONDITIONAL([HAVE_VDDK], [test "x$enable_vddk" = "xyes"])
533 dnl Produce output files.
534 AC_CONFIG_HEADERS([config.h])
535 AC_CONFIG_FILES([nbdkit],
536                 [chmod +x,-w nbdkit])
537 AC_CONFIG_FILES([podwrapper.pl],
538                 [chmod +x,-w podwrapper.pl])
539 AC_CONFIG_FILES([Makefile
540                  bash/Makefile
541                  docs/Makefile
542                  include/Makefile
543                  plugins/Makefile
544                  plugins/curl/Makefile
545                  plugins/example1/Makefile
546                  plugins/example2/Makefile
547                  plugins/example3/Makefile
548                  plugins/example4/Makefile
549                  plugins/ext2/Makefile
550                  plugins/file/Makefile
551                  plugins/guestfs/Makefile
552                  plugins/gzip/Makefile
553                  plugins/libvirt/Makefile
554                  plugins/lua/Makefile
555                  plugins/memory/Makefile
556                  plugins/nbd/Makefile
557                  plugins/null/Makefile
558                  plugins/ocaml/Makefile
559                  plugins/pattern/Makefile
560                  plugins/perl/Makefile
561                  plugins/python/Makefile
562                  plugins/random/Makefile
563                  plugins/ruby/Makefile
564                  plugins/split/Makefile
565                  plugins/streaming/Makefile
566                  plugins/tar/Makefile
567                  plugins/tcl/Makefile
568                  plugins/vddk/Makefile
569                  plugins/xz/Makefile
570                  plugins/zero/Makefile
571                  filters/Makefile
572                  filters/blocksize/Makefile
573                  filters/cache/Makefile
574                  filters/cow/Makefile
575                  filters/delay/Makefile
576                  filters/fua/Makefile
577                  filters/log/Makefile
578                  filters/nozero/Makefile
579                  filters/offset/Makefile
580                  filters/partition/Makefile
581                  src/Makefile
582                  src/nbdkit.pc
583                  tests/Makefile])
585 AC_OUTPUT