"Fossies" - the Fresh Open Source Software Archive

Member "libextractor-1.11/configure.ac" (30 Jan 2021, 26900 Bytes) of package /linux/privat/libextractor-1.11.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 1.10_vs_1.11.

    1 # Process this file with autoconf to produce a configure script.
    2 #
    3 #  This file is part of GNU libextractor
    4 #  Copyright (C) 2003-2020 Christian Grothoff
    5 #
    6 #  GNU libextractor is free software; you can redistribute it and/or modify it under the
    7 #  terms of the GNU General Public License as published by the Free Software
    8 #  Foundation; either version 3, or (at your option) any later version.
    9 #
   10 #  GNU libextractor is distributed in the hope that it will be useful, but WITHOUT ANY
   11 #  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
   12 #  A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
   13 #
   14 #  You should have received a copy of the GNU General Public License along with
   15 #  GNU libextractor; see the file COPYING.  If not, If not, see <http://www.gnu.org/license>
   16 #
   17 #
   18 AC_PREREQ(2.61)
   19 AC_INIT([libextractor], [1.11], [bug-libextractor@gnu.org])
   20 AC_CONFIG_AUX_DIR([build-aux])
   21 AC_CONFIG_HEADERS([config.h])
   22 AC_CONFIG_MACRO_DIR([m4])
   23 AH_TOP([#define _GNU_SOURCE  1])
   24 AC_CANONICAL_TARGET
   25 AC_CANONICAL_HOST
   26 AC_CANONICAL_SYSTEM
   27 
   28 LIB_VERSION_CURRENT=4
   29 LIB_VERSION_REVISION=8
   30 LIB_VERSION_AGE=1
   31 AC_SUBST(LIB_VERSION_CURRENT)
   32 AC_SUBST(LIB_VERSION_REVISION)
   33 AC_SUBST(LIB_VERSION_AGE)
   34 
   35 AM_INIT_AUTOMAKE([silent-rules])
   36 
   37 # Checks for programs.
   38 AC_USE_SYSTEM_EXTENSIONS
   39 AC_PROG_AWK
   40 AC_PROG_CC
   41 AM_PROG_CC_C_O
   42 AC_PROG_CPP
   43 AC_PROG_CXX
   44 AC_CHECK_PROG(HAVE_CXX, $CXX, yes, no)
   45 AC_PROG_INSTALL
   46 AC_PROG_LN_S
   47 AC_PROG_MAKE_SET
   48 AC_CANONICAL_HOST
   49 AC_PROG_LIBTOOL
   50 # save LIBS, libtool does a AC_SEARCH_LIBS(dlopen, dl), but plugins
   51 # need not have -ldl added
   52 LT_INIT([disable-static dlopen win32-dll])
   53 AC_SUBST(MKDIR_P)
   54 
   55 AC_CHECK_DECLS([_stati64])
   56 
   57 AS_CASE(["$target_os"],
   58   [*linux-gnu],[
   59      AC_DEFINE(GNU_LINUX,1,[This is a GNU/Linux system])
   60      AC_DEFINE_UNQUOTED(GNU_LINUX,1,[This is a GNU/Linux system])
   61      AM_CONDITIONAL(HAVE_GNU_LD, true)
   62      AM_CONDITIONAL(SOMEBSD, false)
   63      AM_CONDITIONAL(WINDOWS, false)
   64      XTRA_CPPLIBS=-lstdc++
   65      LIBEXT=.so
   66   ],
   67   [freebsd*],[
   68      AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
   69      AC_CHECK_LIB(c_r, pthread_create)
   70      AM_CONDITIONAL(HAVE_GNU_LD, true)
   71      AM_CONDITIONAL(SOMEBSD, true)
   72      AM_CONDITIONAL(WINDOWS, false)
   73      XTRA_CPPLIBS=-lstdc++
   74      LIBEXT=.so
   75   ],
   76   [openbsd*],[
   77      AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
   78      AC_CHECK_LIB(c_r, pthread_create)
   79      AM_CONDITIONAL(HAVE_GNU_LD, true)
   80      AM_CONDITIONAL(SOMEBSD, true)
   81      AM_CONDITIONAL(WINDOWS, false)
   82      XTRA_CPPLIBS=-lstdc++
   83      LIBEXT=.so
   84    ],
   85   [netbsd*],[
   86      AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
   87      AC_CHECK_LIB(c_r, pthread_create)
   88      AM_CONDITIONAL(HAVE_GNU_LD, true)
   89      AM_CONDITIONAL(SOMEBSD, true)
   90      AM_CONDITIONAL(WINDOWS, false)
   91      XTRA_CPPLIBS=-lstdc++
   92      LIBEXT=.so
   93   ],
   94   [*solaris*],[
   95      AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
   96      AC_CHECK_LIB(resolv, res_init)
   97      XTRA_CPPLIBS=-lstdc++
   98      AM_CONDITIONAL(HAVE_GNU_LD, false)
   99      AM_CONDITIONAL(SOMEBSD, false)
  100      AM_CONDITIONAL(WINDOWS, false)
  101      AM_CFLAGS="-D_POSIX_PTHREAD_SEMANTICS $AM_CFLAGS"
  102      LIBEXT=.so
  103    ],
  104   [darwin*],[
  105      AC_DEFINE_UNQUOTED(DARWIN,1,[This is a Darwin system])
  106      AM_CONDITIONAL(HAVE_GNU_LD, false)
  107      AM_CONDITIONAL(SOMEBSD, false)
  108      AM_CONDITIONAL(WINDOWS, false)
  109      AM_CFLAGS="-fno-common $AM_CFLAGS"
  110      LIBEXT=.so
  111   ],
  112   [cygwin*],[
  113      AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a CYGWIN system])
  114      AM_CONDITIONAL(SOMEBSD, false)
  115      AM_CONDITIONAL(HAVE_GNU_LD, false)
  116      AM_CONDITIONAL(WINDOWS, false)
  117      LIBEXT=.dll
  118   ],
  119   [mingw*],[
  120      AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
  121      AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
  122      AC_CHECK_LIB(intl, gettext)
  123      # Sufficiently new Windows XP
  124      AM_CFLAGS="-D__MSVCRT_VERSION__=0x0601 $AM_CFLAGS"
  125      AM_CPPFLAGS="-DFTRUNCATE_DEFINED=1 $AM_CPPFLAGS"
  126 
  127     AC_MSG_CHECKING(for PlibC)
  128     plibc=0
  129     AC_ARG_WITH(plibc,
  130        [  --with-plibc=PFX    Base of PliBC installation],
  131        [AC_MSG_RESULT([$with_plibc])
  132         AS_CASE([$with_plibc],
  133           [no],[],
  134           [yes],[
  135             AC_CHECK_HEADERS([plibc.h],
  136               AC_CHECK_LIB([plibc], [plibc_init],
  137                 plibc=1))
  138           ],[
  139             AM_LDFLAGS="-L$with_plibc/lib $AM_LDFLAGS"
  140             AM_CPPFLAGS="-I$with_plibc/include $AM_CPPFLAGS"
  141             AC_CHECK_HEADERS([plibc.h],
  142               AC_CHECK_LIB([plibc], [plibc_init],
  143                 EXT_LIB_PATH="-L$with_plibc/lib $EXT_LIB_PATH"
  144                 plibc=1))
  145           ])
  146        ],
  147        [AC_MSG_RESULT([--with-plibc not specified])
  148         AM_LDFLAGS="-L/usr/lib $AM_LDFLAGS"
  149         AM_CPPFLAGS="-I/usr/include $AM_CPPFLAGS"
  150         AC_CHECK_HEADERS([plibc.h],
  151               AC_CHECK_LIB([plibc], [plibc_init],
  152                 EXT_LIB_PATH="-L$with_plibc/lib $EXT_LIB_PATH"
  153                 plibc=1))])
  154 
  155      AS_IF([test $plibc -ne 1],
  156            [AC_MSG_ERROR([libextractor requires PlibC])],
  157            [LIBS="$LIBS -lplibc"])
  158 
  159      AM_LDFLAGS="$AM_LDFLAGS -Wl,--export-all-symbols"
  160      AM_CONDITIONAL(HAVE_GNU_LD, true)
  161      AM_CONDITIONAL(SOMEBSD, false)
  162      AM_CONDITIONAL(WINDOWS, true)
  163      LIBEXT=.dll
  164    ],[
  165      AC_MSG_RESULT(Unrecognised OS $host_os)
  166      AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
  167      AC_MSG_RESULT(otheros)
  168      AC_DEFINE(GNU_LINUX,1,[We hope this is a GNU/Linux-compatible system])
  169      AC_DEFINE_UNQUOTED(GNU_LINUX,1,[We hope this is a GNU/Linux-compatible system])
  170      AM_CONDITIONAL(HAVE_GNU_LD, false)
  171      AM_CONDITIONAL(SOMEBSD, false)
  172      AM_CONDITIONAL(WINDOWS, false)
  173      LIBEXT=.so
  174   ]
  175 )
  176 
  177 AM_ICONV
  178 
  179 # We define the paths here, because MinGW/GCC expands paths
  180 # passed through the command line ("-DLOCALEDIR=..."). This would
  181 # lead to hard-coded paths ("C:\mingw\mingw\bin...") that do
  182 # not contain the actual installation.
  183 AC_DEFINE_DIR([LOCALEDIR], [datarootdir/locale], [gettext catalogs])
  184 
  185 ISOPFX=`pkg-config --variable=prefix iso-codes`
  186 pkg-config --variable=prefix iso-codes 2> /dev/null || ISOPFX=/usr
  187 AC_DEFINE_DIR([ISOLOCALEDIR], [ISOPFX/share/locale], [iso-639 catalog])
  188 
  189 # relative plugin directory
  190 rplugindir="libextractor"
  191 AC_ARG_WITH(plugindirname,
  192 	AC_HELP_STRING(
  193 		[--with-plugindirname],
  194 		[install directory for plugins (always relative to libdir)]),
  195 	[rplugindir=$withval])
  196 AC_SUBST(RPLUGINDIR, $rplugindir)
  197 
  198 # large file support
  199 AC_SYS_LARGEFILE
  200 AC_FUNC_FSEEKO
  201 
  202 AM_CONDITIONAL(CYGWIN, test "$build_os" = "cygwin")
  203 AM_CONDITIONAL(MINGW, test "$build_os" = "mingw32")
  204 
  205 
  206 # use '-fno-strict-aliasing', but only if the compiler can take it
  207 AS_IF([gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1],
  208       [AM_CFLAGS="-fno-strict-aliasing $AM_CFLAGS"])
  209 
  210 AM_CONDITIONAL(HAVE_CXX, test "x$HAVE_CXX" = "xyes")
  211 
  212 
  213 # Adam shostack suggests the following for Windows:
  214 # -D_FORTIFY_SOURCE=2 -fstack-protector-all
  215 AC_ARG_ENABLE(gcc-hardening,
  216   [AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks)],
  217   [AS_IF([test x$enableval = xyes],
  218          [AM_CFLAGS="$AM_CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all"
  219           AM_CFLAGS="$AM_CFLAGS -fwrapv -fPIE -Wstack-protector"
  220           AM_CFLAGS="$AM_CFLAGS --param ssp-buffer-size=1"
  221           AM_LDFLAGS="$AM_LDFLAGS -pie"])])
  222 
  223 
  224 # Linker hardening options
  225 # Currently these options are ELF specific - you can't use this with MacOSX
  226 AC_ARG_ENABLE(linker-hardening,
  227   [AS_HELP_STRING(--enable-linker-hardening, enable linker security fixups)],
  228   [AS_IF([x$enableval = xyes],
  229          [AM_LDFLAGS="$AM_LDFLAGS -z relro -z now"])])
  230 
  231 
  232 # Support for hiding non-public symbols
  233 HIDDEN_VISIBILITY_CFLAGS=""
  234 AS_CASE(["$host"],
  235  [*-*-mingw*],[
  236     # mingw32 we do -fvisibility=hidden and __declspec(dllexport)
  237     AC_DEFINE([_EXTRACTOR_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern],
  238               [defines how to decorate public symbols while building])
  239     HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
  240  ],[
  241     # other compilers, check if we can do -fvisibility=hidden
  242     AX_CHECK_LINK_FLAG([-fvisibility=hidden],
  243       [AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],
  244                            [AC_DEFINE([_EXTRACTOR_EXTERN], [__attribute__((visibility("default"))) extern],
  245                                        [defines how to decorate public symbols while building])
  246                             HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"])])
  247  ])
  248 AC_SUBST(HIDDEN_VISIBILITY_CFLAGS)
  249 
  250 
  251 
  252 # Checks for libraries.
  253 
  254 AC_CHECK_HEADERS([langinfo.h])
  255 
  256 # Check for libltdl header (#2999)
  257 ltdl=0
  258 AC_MSG_CHECKING(for libltdl)
  259 AC_ARG_WITH(ltdl,
  260    [  --with-ltdl=PFX    base of libltdl installation],
  261    [AC_MSG_RESULT([$with_ltdl])
  262     AS_CASE([$with_ltdl],
  263       [no],[],
  264       [yes],[
  265         AC_CHECK_HEADERS(ltdl.h,
  266           AC_CHECK_LIB([ltdl], [lt_dlopenext],
  267             ltdl=1))
  268       ],[
  269         OLD_LIBS="$LIBS"
  270         LIBS="-L$with_ltdl/lib $LIBS"
  271         AM_CPPFLAGS="-I$with_ltdl/include $AM_CPPFLAGS"
  272         AC_CHECK_HEADERS(ltdl.h,
  273           AC_CHECK_LIB([ltdl], [lt_dlopenext],
  274             EXT_LIB_PATH="-L$with_ltdl/lib $EXT_LIB_PATH"
  275             ltdl=1))
  276         LIBS="$OLD_LIBS"
  277       ])
  278    ],
  279    [AC_MSG_RESULT([--with-ltdl not specified])
  280     AC_CHECK_HEADERS(ltdl.h,
  281      AC_CHECK_LIB([ltdl], [lt_dlopenext],
  282       ltdl=1))])
  283 AS_IF([test x$ltdl = x1],
  284       [AC_MSG_RESULT([libltdl found])],
  285       [AC_MSG_ERROR([libextractor requires libltdl (from GNU libtool), try installing libltdl-dev])])
  286 
  287 # check for apparmor
  288 AC_CHECK_LIB(apparmor, aa_change_profile,
  289         [AC_CHECK_HEADERS([sys/apparmor.h],
  290           AM_CONDITIONAL(HAVE_APPARMOR, true)
  291           AC_DEFINE(HAVE_APPARMOR,1,[Have apparmor]),
  292           AM_CONDITIONAL(HAVE_APPARMOR, false)
  293           AC_DEFINE(HAVE_APPARMOR,0,[lacking apparmor]))],
  294         AM_CONDITIONAL(HAVE_APPARMOR, false),
  295         -lapparmor)
  296 
  297 # FIXME: allow --with-oggvorbis=PFX
  298 
  299 # test if we have vorbisfile
  300 # prior versions had ov_open_callbacks in libvorbis, test that, too.
  301 AC_CHECK_LIB(vorbisfile, ov_open_callbacks,
  302         [AC_CHECK_HEADERS([vorbis/vorbisfile.h],
  303           AM_CONDITIONAL(HAVE_VORBISFILE, true)
  304           AC_DEFINE(HAVE_VORBISFILE,1,[Have vorbisfile]),
  305           AM_CONDITIONAL(HAVE_VORBISFILE, false)
  306           AC_DEFINE(HAVE_VORBISFILE,0,[lacking vorbisfile]))],
  307         AM_CONDITIONAL(HAVE_VORBISFILE, false),
  308         -lvorbis -logg)
  309 AC_CHECK_LIB(FLAC, FLAC__stream_decoder_init_stream,
  310         [AC_CHECK_HEADERS([FLAC/all.h],
  311          AM_CONDITIONAL(HAVE_FLAC, true)
  312           AC_DEFINE(HAVE_FLAC,1,[Have flac]),
  313          AM_CONDITIONAL(HAVE_FLAC, false))],
  314         AM_CONDITIONAL(HAVE_FLAC, false),
  315         -logg)
  316 # test without -logg to see whether we really need it (libflac can be without)
  317 AC_CHECK_LIB(FLAC, FLAC__stream_decoder_init_ogg_stream,
  318          AM_CONDITIONAL(HAVE_FLAC, true)
  319          AC_DEFINE(HAVE_FLAC,1,[Have flac])
  320          AM_CONDITIONAL(NEED_OGG, false),
  321         [AM_CONDITIONAL(NEED_OGG, true)])
  322 AC_CHECK_LIB(vorbisfile, vorbis_comment_query,
  323         AM_CONDITIONAL(NEED_VORBIS, false),
  324         AM_CONDITIONAL(NEED_VORBIS, true),
  325         -logg)
  326 
  327 AC_CHECK_LIB(z, inflate,
  328         [AC_CHECK_HEADERS([zlib.h],
  329          AM_CONDITIONAL(HAVE_ZLIB, true)
  330          AC_DEFINE(HAVE_ZLIB,1,[Have zlib]),
  331          AM_CONDITIONAL(HAVE_ZLIB, false))],
  332          AM_CONDITIONAL(HAVE_ZLIB, false))
  333 
  334 AC_CHECK_LIB(bz2, BZ2_bzDecompress,
  335         [AC_CHECK_HEADERS([bzlib.h],
  336           AM_CONDITIONAL(HAVE_BZ2, true)
  337           AC_DEFINE(HAVE_LIBBZ2,1,[Have libbz2]),
  338          AM_CONDITIONAL(HAVE_BZ2, false))],
  339          AM_CONDITIONAL(HAVE_BZ2, false))
  340 
  341 AC_CHECK_LIB(rpm, rpmReadPackageFile,
  342         [AC_CHECK_HEADERS([rpm/rpmlib.h],
  343           AM_CONDITIONAL(HAVE_LIBRPM, true)
  344           AC_DEFINE(HAVE_LIBRPM,1,[Have librpm]),
  345          AM_CONDITIONAL(HAVE_LIBRPM, false))],
  346          AM_CONDITIONAL(HAVE_LIBRPM, false))
  347 
  348 AC_CHECK_LIB(mpeg2, mpeg2_init,
  349         [AC_CHECK_HEADERS([mpeg2dec/mpeg2.h],
  350            AM_CONDITIONAL(HAVE_MPEG2, true)
  351            AC_DEFINE(HAVE_MPEG2,1,[Have libmpeg2]),
  352          AM_CONDITIONAL(HAVE_MPEG2, false))],
  353          AM_CONDITIONAL(HAVE_MPEG2, false))
  354 
  355 AC_CHECK_LIB(mp4v2, MP4ReadProvider,
  356         [AC_CHECK_HEADERS([mp4v2/mp4v2.h],
  357            AM_CONDITIONAL(HAVE_MP4, true)
  358            AC_DEFINE(HAVE_MP4,1,[Have libmp4v2]),
  359          AM_CONDITIONAL(HAVE_MP4, false))],
  360          AM_CONDITIONAL(HAVE_MP4, false))
  361 
  362 AC_CHECK_LIB(jpeg, jpeg_mem_src,
  363         [AC_CHECK_HEADERS([jpeglib.h],
  364            AM_CONDITIONAL(HAVE_JPEG, true)
  365            AC_DEFINE(HAVE_JPEG,1,[Have libjpeg]),
  366          AM_CONDITIONAL(HAVE_JPEG, false))],
  367          AM_CONDITIONAL(HAVE_JPEG, false))
  368 
  369 AC_CHECK_LIB(tiff, TIFFClientOpen,
  370         [AC_CHECK_HEADERS([tiffio.h],
  371            AM_CONDITIONAL(HAVE_TIFF, true)
  372            AC_DEFINE(HAVE_TIFF,1,[Have libtiff]),
  373          AM_CONDITIONAL(HAVE_TIFF, false))],
  374          AM_CONDITIONAL(HAVE_TIFF, false))
  375 
  376 AC_CHECK_LIB(archive, archive_read_open,
  377         [AC_CHECK_HEADERS([archive.h],
  378            AM_CONDITIONAL(HAVE_ARCHIVE, true)
  379            AC_DEFINE(HAVE_ARCHIVE,1,[Have libarchive]),
  380          AM_CONDITIONAL(HAVE_ARCHIVE, false))],
  381          AM_CONDITIONAL(HAVE_ARCHIVE, false))
  382 
  383 # should experimental code be compiled (code that may not yet compile)?
  384 AC_MSG_CHECKING(whether to compile experimental code)
  385 AC_ARG_ENABLE([experimental],
  386    [AS_HELP_STRING([--enable-experimental], [enable compiling experimental code])],
  387    [enable_experimental=${enableval}],
  388    [enable_experimental=no])
  389 AC_MSG_RESULT($enable_experimental)
  390 AM_CONDITIONAL([HAVE_EXPERIMENTAL], [test "x$enable_experimental" = "xyes"])
  391 
  392 
  393 AC_MSG_CHECKING(for ImageFactory::iptcData in -lexiv2)
  394 AC_LANG_PUSH(C++)
  395 SAVED_AM_LDFLAGS=$AM_LDFLAGS
  396 AM_LDFLAGS="$AM_LDFLAGS -lexiv2"
  397 AC_LINK_IFELSE(
  398   [AC_LANG_PROGRAM([[#include <iostream>
  399 #include <exiv2/exif.hpp>
  400 #include <exiv2/image.hpp>
  401 #include <exiv2/futils.hpp>]],
  402     [[Exiv2::Image *foo = NULL; foo->iptcData(); ]])],
  403   [AC_MSG_RESULT(yes)
  404    AM_CONDITIONAL(HAVE_EXIV2, true)
  405    AC_DEFINE(HAVE_EXIV2,1,[Have exifData in libexiv2])],
  406   [AC_MSG_RESULT(no)
  407    AM_CONDITIONAL(HAVE_EXIV2, false)])
  408 AM_LDFLAGS=$SAVED_AM_LDFLAGS
  409 AC_LANG_POP(C++)
  410 
  411 
  412 AC_MSG_CHECKING(for DGifOpen -lgif)
  413 SAVED_AM_LDFLAGS=$AM_LDFLAGS
  414 AC_CHECK_LIB(gif, DGifOpen,
  415   [AC_CHECK_HEADERS([gif_lib.h],
  416    AM_CONDITIONAL(HAVE_GIF, true)
  417    AC_DEFINE(HAVE_GIF,1,[Have libgif]),
  418    AM_CONDITIONAL(HAVE_GIF, false))],
  419   AM_CONDITIONAL(HAVE_GIF, false))
  420 
  421 AC_MSG_CHECKING(for magic_open -lmagic)
  422 SAVED_AM_LDFLAGS=$AM_LDFLAGS
  423 AC_CHECK_LIB(magic, magic_open,
  424   [AC_CHECK_HEADERS([magic.h],
  425    AM_CONDITIONAL(HAVE_MAGIC, true),
  426    AM_CONDITIONAL(HAVE_MAGIC, false))],
  427   AM_CONDITIONAL(HAVE_MAGIC, false))
  428 
  429 AC_MSG_CHECKING(for tidyNodeGetValue -ltidy)
  430 AC_LANG_PUSH(C++)
  431 SAVED_LIBS=$LIBS
  432 LIBS="$LIBS -ltidy"
  433 AC_LINK_IFELSE(
  434   [AC_LANG_PROGRAM([[#include <tidy/tidy.h>]],
  435     [[ Bool b = tidyNodeGetValue (NULL, NULL, NULL); ]])],
  436   [AC_MSG_RESULT(yes)
  437    AM_CONDITIONAL(HAVE_TIDY, true)
  438    AC_DEFINE(HAVE_TIDY,1,[Have tidyNodeGetValue in libtidy])],
  439   [AC_MSG_RESULT(no)
  440    AM_CONDITIONAL(HAVE_TIDY, false)])
  441 LIBS=$SAVED_LIBS
  442 AC_LANG_POP(C++)
  443 
  444 # restore LIBS
  445 LIBS=$LIBSOLD
  446 
  447 
  448 
  449 # should 'make check' run tests?
  450 AC_MSG_CHECKING(whether to run tests)
  451 AC_ARG_ENABLE([testruns],
  452    [AS_HELP_STRING([--disable-testruns], [disable running tests on make check (default is YES)])],
  453    [enable_tests_run=${enableval}],
  454    [enable_tests_run=yes])
  455 AC_MSG_RESULT($enable_test_run)
  456 AM_CONDITIONAL([ENABLE_TEST_RUN], [test "x$enable_tests_run" = "xyes"])
  457 
  458 
  459 
  460 # Checks for header files.
  461 AC_HEADER_STDC
  462 AC_HEADER_DIRENT
  463 AC_HEADER_STDBOOL
  464 AC_CHECK_HEADERS([iconv.h fcntl.h netinet/in.h stdlib.h string.h unistd.h libintl.h limits.h stddef.h zlib.h])
  465 
  466 # Checks for typedefs, structures, and compiler characteristics.
  467 AC_C_INLINE
  468 AC_TYPE_SIZE_T
  469 AC_TYPE_PID_T
  470 GNUPG_CHECK_ENDIAN
  471 
  472 # Checks for library functions.
  473 AC_FUNC_MEMCMP
  474 AC_FUNC_VPRINTF
  475 AC_FUNC_MMAP
  476 AC_FUNC_STAT
  477 AC_FUNC_ERROR_AT_LINE
  478 AC_SEARCH_LIBS(dlopen, dl)
  479 AC_SEARCH_LIBS(shm_open, rt)
  480 AC_CHECK_FUNCS([mkstemp strndup munmap strcasecmp strdup strncasecmp memmove memset strtoul floor getcwd pow setenv sqrt strchr strcspn strrchr strnlen strndup ftruncate shm_open shm_unlink lseek64])
  481 
  482 
  483 # is kind of tedious, but simple and straightforward
  484 sockets=no
  485 AC_MSG_CHECKING(for sockets)
  486 AC_LANG_PUSH(C)
  487 SAVED_LIBS="$LIBS"
  488 SOCKET_LIBS=
  489 AC_LINK_IFELSE(
  490   [
  491     AC_LANG_PROGRAM(
  492       [[#include <sys/socket.h>]],
  493       [[int s = socket (AF_INET, SOCK_STREAM, 6);]]
  494     )
  495   ],
  496   [
  497     sockets=yes
  498   ],
  499   [
  500     LIBS="$SAVED_LIBS -lsocket"
  501     AC_LINK_IFELSE(
  502       [
  503         AC_LANG_PROGRAM(
  504           [[#include <sys/socket.h>]],
  505           [[int s = socket (AF_INET, SOCK_STREAM, 6);]]
  506         )
  507       ],
  508       [
  509         sockets=yes
  510         SOCKET_LIBS="-lsocket"
  511       ],
  512       [
  513         AC_LINK_IFELSE(
  514           [
  515             AC_LANG_PROGRAM(
  516               [[#include <winsock2.h>]],
  517               [[int s = socket (AF_INET, SOCK_STREAM, 6);]]
  518             )
  519           ],
  520           [
  521             sockets=yes
  522           ],
  523           [
  524             LIBS="$SAVED_LIBS -lws2_32"
  525             AC_LINK_IFELSE(
  526               [
  527                 AC_LANG_PROGRAM(
  528                   [[#include <winsock2.h>]],
  529                   [[int s = socket (AF_INET, SOCK_STREAM, 6);]]
  530                 )
  531               ],
  532               [
  533                 sockets=yes
  534                 SOCKET_LIBS="-lws2_32"
  535               ],
  536               [
  537                 sockets=no
  538               ]
  539             )
  540           ]
  541         )
  542       ]
  543     )
  544   ]
  545 )
  546 LIBS="$SAVED_LIBS $SOCKET_LIBS"
  547 AC_LANG_POP(C)
  548 AC_MSG_RESULT([$sockets])
  549 AS_IF([test "x$sockets" = "xno"],
  550       [AC_MSG_ERROR([libextractor requires some kind of socket library])])
  551 AC_SUBST([SOCKET_LIBS],[$SOCKET_LIBS])
  552 
  553 LE_LIB_LIBS=$LIBS
  554 LIBS=$LIBSOLD
  555 
  556 AM_GNU_GETTEXT_VERSION([0.16.1])
  557 AM_GNU_GETTEXT([external])
  558 
  559 # check for GNU LD
  560 AC_LIB_PROG_LD_GNU
  561 
  562 # check for glib >= 2.0.0
  563 AC_MSG_CHECKING(for glib)
  564 AM_PATH_GLIB_2_0(2.0.0,
  565 	         without_glib=false,
  566                  without_glib=true)
  567 AC_MSG_CHECKING([whether glib is disabled])
  568 AC_ARG_ENABLE(glib,
  569   [AC_HELP_STRING([--disable-glib],[disable glib support])],
  570   [case "$enableval" in
  571    no)  AC_MSG_RESULT(disabled)
  572         without_glib=true
  573         ;;
  574    *)   AC_MSG_RESULT(allowed)
  575         ;;
  576    esac],
  577   AC_MSG_RESULT(allowed))
  578 
  579 AS_IF([test x$without_glib != xtrue],
  580       [AS_IF([test $with_gnu_ld = yes],
  581              [# We need both GNU LD and GLIB here!
  582               AM_CONDITIONAL(HAVE_GLIB,true)
  583               AC_DEFINE(HAVE_GLIB, 1, [Have glib])],
  584              [# We may have GLIB, but without GNU LD we must not use it!
  585               AM_CONDITIONAL(HAVE_GLIB,false)
  586               AC_DEFINE(HAVE_GLIB, 0, [Have glib, but not GNU LD])])],
  587      [AM_CONDITIONAL(HAVE_GLIB,false)
  588       AC_DEFINE(HAVE_GLIB, 0, [Have glib])])
  589 
  590 # smf requires glib.h
  591 CFLAGS_OLD="$CFLAGS"
  592 CPPFLAGS_OLD="$CPPFLAGS"
  593 CFLAGS="$AM_CFLAGS $GLIB_CFLAGS"
  594 CPPFLAGS="$AM_CPPFLAGS $GLIB_CFLAGS"
  595 
  596 AC_CHECK_LIB(smf, smf_load_from_memory,
  597         [AC_CHECK_HEADERS([smf.h],
  598            AM_CONDITIONAL(HAVE_SMF, true)
  599            AC_DEFINE(HAVE_MPEG2,1,[Have libsmf]),
  600          AM_CONDITIONAL(HAVE_SMF, false))],
  601          AM_CONDITIONAL(HAVE_SMF, false))
  602 
  603 # check for gdk-pixbuf >= 2.4
  604 AC_MSG_CHECKING(for gdk-pixbuf)
  605 PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0 >= 2.4], [have_gdk_pixbuf=yes], [have_gdk_pixbuf=no])
  606 
  607 AM_CONDITIONAL(HAVE_GDK_PIXBUF, test x$have_gdk_pixbuf != xno)
  608 AS_IF([test $have_gdk_pixbuf != no],
  609       [have_gdk_pixbuf=1],
  610       [have_gdk_pixbuf=0
  611       AC_MSG_NOTICE([Cannot find Gdk-pixbuf: Is pkg-config in path?])])
  612 AC_DEFINE_UNQUOTED([HAVE_GDK_PIXBUF], [$have_gdk_pixbuf], [We have Gdk-pixbuf])
  613 
  614 CFLAGS="$CFLAGS $GDK_PIXBUF_CFLAGS"
  615 CPPFLAGS="$CPPFLAGS $GDK_PIXBUF_CFLAGS"
  616 LIBS="$LIBS $GDK_PIXBUF_LIBS"
  617 
  618 
  619 AC_ARG_WITH([gstreamer], AS_HELP_STRING([--with-gstreamer], [Build with the GStreamer plugin]), [], [with_gstreamer=yes])
  620 
  621 have_gstreamer=no
  622 have_gstreamer_pbutils=no
  623 have_gstreamer_tag=no
  624 have_gstreamer_app=no
  625 AS_IF([test "x$with_gstreamer" = "xyes"], [
  626    PKG_CHECK_MODULES([GSTREAMER], [gstreamer-1.0 >= 0.11.93], [have_gstreamer=yes], [have_gstreamer=no])
  627    PKG_CHECK_MODULES([GSTREAMER_PBUTILS], [gstreamer-pbutils-1.0 >= 0.11.93], [have_gstreamer_pbutils=yes], [have_gstreamer_pbutils=no])
  628    PKG_CHECK_MODULES([GSTREAMER_TAG], [gstreamer-tag-1.0 >= 0.11.93], [have_gstreamer_tag=yes], [have_gstreamer_tag=no])
  629    PKG_CHECK_MODULES([GSTREAMER_APP], [gstreamer-app-1.0 >= 0.11.93], [have_gstreamer_app=yes], [have_gstreamer_app=no])
  630 ])
  631 
  632 AM_CONDITIONAL(HAVE_GSTREAMER, test x$have_gstreamer = xyes -a x$have_gstreamer_pbutils = xyes -a x$have_gstreamer_tag = xyes -a x$have_gstreamer_app = xyes -a ! x$without_glib = xtrue)
  633 
  634 ABI_GSF
  635 
  636 AM_CONDITIONAL(HAVE_GSF, test "x$have_gsf" = "xtrue")
  637 
  638 # produce new line
  639 echo ""
  640 AC_CHECK_LIB(gsf-1, gsf_init, AC_DEFINE(HAVE_GSF_INIT,1,[gsf_init supported]))
  641 AC_CHECK_LIB(gsf-1, gsf_doc_meta_data_read_from_msole, AC_DEFINE(HAVE_GSF_DOC_META_DATA_READ_FROM_MSOLE,1,[gsf_doc_meta_data_read_from_msole supported]))
  642 
  643 
  644 CFLAGS="$CFLAGS_OLD"
  645 CPPFLAGS="$CPPFLAGS_OLD"
  646 
  647 
  648 AC_CHECK_PROG([HAVE_ZZUF],[zzuf], 1, 0)
  649 AM_CONDITIONAL(HAVE_ZZUF, test 0 != $HAVE_ZZUF)
  650 
  651 AC_MSG_CHECKING([whether to enable the FFmpeg thumbnail extractor])
  652 new_ffmpeg=0
  653 AC_ARG_ENABLE(ffmpeg,
  654  [AC_HELP_STRING([--enable-ffmpeg],[Enable FFmpeg support])
  655   AC_HELP_STRING([--disable-ffmpeg],[Disable FFmpeg support])],
  656  [AS_CASE(["$enableval"],
  657    [no],[
  658       AC_MSG_RESULT(no)
  659       ffmpeg_enabled=0
  660    ],[
  661       AC_MSG_RESULT(yes)
  662       ffmpeg_enabled=1
  663    ])],
  664   [     AC_MSG_RESULT(yes)
  665         ffmpeg_enabled=1])
  666 AS_IF([test x$ffmpeg_enabled = x1],
  667  [ffmpeg_enabled=0
  668   new_ffmpeg=0
  669   AC_CHECK_HEADERS([libavutil/avutil.h libavformat/avformat.h libavcodec/avcodec.h libavutil/frame.h],
  670     AC_CHECK_HEADERS([libavresample/avresample.h],
  671       AC_CHECK_LIB(avutil, av_audio_fifo_alloc,
  672         new_ffmpeg=1)))
  673 
  674   AC_CHECK_LIB(swscale, sws_getContext,
  675     AC_CHECK_LIB(avcodec, avcodec_alloc_context3,
  676       ffmpeg_enabled=1))
  677   AC_CHECK_HEADERS([libavutil/avutil.h ffmpeg/avutil.h libavformat/avformat.h ffmpeg/avformat.h libavcodec/avcodec.h ffmpeg/avcodec.h libswscale/swscale.h ffmpeg/swscale.h])
  678  ])
  679 AM_CONDITIONAL(HAVE_FFMPEG, test x$ffmpeg_enabled != x0)
  680 AM_CONDITIONAL(HAVE_FFMPEG_NEW, test x$new_ffmpeg != x0)
  681 
  682 
  683 LE_INTLINCL=""
  684 LE_LIBINTL="$LTLIBINTL"
  685 AC_ARG_ENABLE(framework, [  --enable-framework      enable Mac OS X framework build helpers],enable_framework_build=$enableval)
  686 AM_CONDITIONAL(WANT_FRAMEWORK, test x$enable_framework_build = xyes)
  687 AS_IF([test x$enable_framework_build = xyes],
  688  [AC_DEFINE([FRAMEWORK_BUILD], 1, [Build a Mac OS X Framework])
  689   LE_INTLINCL='-I$(top_srcdir)/src/intlemu'
  690   LE_LIBINTL='$(top_builddir)/src/intlemu/libintlemu.la -framework CoreFoundation'
  691   AC_LIB_APPENDTOVAR([AM_CPPFLAGS], [$LE_INTLINCL])
  692  ])
  693 
  694 LE_LIB_LDFLAGS="-export-dynamic -no-undefined"
  695 LE_PLUGIN_LDFLAGS="-export-dynamic -avoid-version -module -no-undefined"
  696 
  697 
  698 # TODO insert a proper check here
  699 AC_CACHE_CHECK([whether -export-symbols-regex works],
  700  gn_cv_export_symbols_regex_works,
  701  [AS_CASE(["$host_os"],
  702    [mingw*],[gn_cv_export_symbols_regex_works=no],
  703    [gn_cv_export_symbols_regex_works=yes])
  704  ])
  705 AS_IF([test "x$gn_cv_export_symbols_regex_works" = "xyes"],
  706  [LE_LIB_LDFLAGS="$LE_LIB_LDFLAGS -export-symbols-regex \"(EXTRACTOR|pl)_@<:@a-zA-Z0-9_@:>@*\""
  707  LE_PLUGIN_LDFLAGS="$LE_PLUGIN_LDFLAGS -export-symbols-regex \"(EXTRACTOR|pl)_@<:@a-zA-Z0-9_@:>@*_.......\""
  708  ])
  709 
  710 # restore LIBS
  711 LIBS=$LIBSOLD
  712 
  713 AC_SUBST(LE_LIB_LDFLAGS)
  714 AC_SUBST(LE_PLUGIN_LDFLAGS)
  715 AC_SUBST(LE_INTLINCL)
  716 AC_SUBST(LE_LIBINTL)
  717 AC_SUBST(LE_LIB_LIBS)
  718 
  719 AC_SUBST(QT_CPPFLAGS)
  720 AC_SUBST(QT_LDFLAGS)
  721 AC_SUBST(XTRA_CPPLIBS)
  722 AC_SUBST(LIBEXT)
  723 
  724 PACKAGE_VERSION_NOALPHA=`echo $PACKAGE_VERSION | sed "s/@<:@A-Za-z@:>@*//g;"`
  725 AC_SUBST(PACKAGE_VERSION_NOALPHA)
  726 
  727 # gcov compilation
  728 AC_MSG_CHECKING(whether to compile with support for code coverage analysis)
  729 AC_ARG_ENABLE([coverage],
  730               AS_HELP_STRING([--enable-coverage],
  731                              [compile the library with code coverage support]),
  732               [use_gcov=${enableval}],
  733               [use_gcov=no])
  734 AC_MSG_RESULT($use_gcov)
  735 AM_CONDITIONAL([USE_COVERAGE], [test "x$use_gcov" = "xyes"])
  736 
  737 
  738 
  739 AC_CONFIG_FILES([Makefile
  740 po/Makefile.in
  741 m4/Makefile
  742 contrib/macosx/Info.plist
  743 contrib/macosx/Pkg-Info.plist
  744 doc/Makefile
  745 src/Makefile
  746 src/include/Makefile
  747 src/intlemu/Makefile
  748 src/common/Makefile
  749 src/main/Makefile
  750 src/plugins/Makefile
  751 ])
  752 
  753 AX_CREATE_PKGCONFIG_INFO([libextractor.pc],,[-lextractor],[Metadata extraction library],,)
  754 
  755 AC_OUTPUT
  756 
  757 AS_IF([test "x$HAVE_ZLIB_TRUE" = "x#"],
  758   [AC_MSG_NOTICE([NOTICE: zlib not found, zlib support disabled])])
  759 
  760 AS_IF([test "x$HAVE_BZ2_TRUE" = "x#"],
  761   [AC_MSG_NOTICE([NOTICE: libbz2 not found, bz2 support disabled])])
  762 
  763 AS_IF([test "x$HAVE_EXIV2_TRUE" = "x#"],
  764   [AC_MSG_NOTICE([NOTICE: libexiv2 not found, exiv2 disabled])])
  765 
  766 AS_IF([test "x$HAVE_TIFF_TRUE" = "x#"],
  767   [AC_MSG_NOTICE([NOTICE: libtiff not found, tiff disabled])])
  768 
  769 AS_IF([test "x$HAVE_JPEG_TRUE" = "x#"],
  770   [AC_MSG_NOTICE([NOTICE: libjpeg not found, jpeg disabled])])
  771 
  772 AS_IF([test "x$HAVE_GIF_TRUE" = "x#"],
  773   [AC_MSG_NOTICE([NOTICE: libgif not found, gif disabled])])
  774 
  775 AS_IF([test "x$have_gsf" != "xtrue"],
  776   [AC_MSG_NOTICE([NOTICE: libgsf not found, no OLE2 (MS Office) support])])
  777 
  778 AS_IF([test "x$ffmpeg_enabled" = "x0"],
  779   [AC_MSG_NOTICE([NOTICE: FFmpeg thumbnailer plugin disabled])])
  780 
  781 AS_IF([test "x$new_ffmpeg" = "x0"],
  782   [AC_MSG_NOTICE([NOTICE: FFmpeg/opus audio preview plugin disabled, It needs libav >= 10, or a FFmpeg with --enable-libavresample])])
  783 
  784 AS_IF([test "x$have_gdk_pixbuf" = "x0"],
  785   [AC_MSG_NOTICE([NOTICE: libgdk-pixbuf not found, gtk thumbnail support disabled])])
  786 
  787 AS_IF([test "x$HAVE_VORBISFILE_TRUE" = "x#"],
  788   [AC_MSG_NOTICE([NOTICE: libvorbis not found, vorbis support disabled])])
  789 
  790 AS_IF([test "x$HAVE_FLAC_TRUE" = "x#"],
  791   [AC_MSG_NOTICE([NOTICE: libflac not found, flac support disabled])])
  792 
  793 AS_IF([test "x$HAVE_SMF_TRUE" = "x#"],
  794   [AC_MSG_NOTICE([NOTICE: libsmf not found, midi support disabled])])
  795 
  796 AS_IF([test "x$HAVE_MPEG2_TRUE" = "x#"],
  797   [AC_MSG_NOTICE([NOTICE: libmpeg2 not found, mpeg2 support disabled])])
  798 
  799 AS_IF([test "x$HAVE_MP4V2_TRUE" = "x#"],
  800   [AC_MSG_NOTICE([NOTICE: libmp4v2 not found, mp4 support disabled])])
  801 
  802 AS_IF([test "x$HAVE_CXX" != "xyes"],
  803   [AC_MSG_NOTICE([NOTICE: no C++ compiler found (not compiling plugins that require C++)])])
  804 
  805 AS_IF([test x$have_gstreamer = xyes -a x$have_gstreamer_pbutils = xyes -a x$have_gstreamer_tag = xyes -a x$have_gstreamer_app = xyes -a ! x$without_glib = xtrue],
  806   [AS_IF([test x$enable_experimental = xyes],
  807     [AC_MSG_NOTICE([NOTICE: gstreamer enabled])])],
  808   [AC_MSG_NOTICE([NOTICE: gstreamer not found, gstreamer support disabled])])
  809 
  810 AS_IF([test "x$HAVE_APPARMOR_TRUE" = "x#"],
  811  [AC_MSG_NOTICE([NOTICE: libapparmor not found, apparmor support disabled])])