1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461
|
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT([libextractor], [0.5.16], [bug-libextractor@gnu.org])
AC_REVISION($Revision: 1.67 $)
AM_INIT_AUTOMAKE([libextractor], [0.5.16])
AM_CONFIG_HEADER(src/include/config.h)
AH_TOP([#define _GNU_SOURCE 1])
# Checks for programs.
AC_CANONICAL_HOST
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_DISABLE_STATIC
case "$host_os" in
linux*)
AC_DEFINE(LINUX,1,[This is a Linux system])
AC_DEFINE_UNQUOTED(LINUX,1,[This is a LINUX system])
AM_CONDITIONAL(HAVE_GNU_LD, true)
AM_CONDITIONAL(SOMEBSD, false)
XTRA_CPPLIBS=-lstdc++
LIBEXT=.so
;;
freebsd*)
AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
AC_CHECK_LIB(c_r, pthread_create)
AM_CONDITIONAL(HAVE_GNU_LD, true)
AM_CONDITIONAL(SOMEBSD, true)
LIBEXT=.so
;;
openbsd*)
AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
AC_CHECK_LIB(c_r, pthread_create)
AM_CONDITIONAL(HAVE_GNU_LD, true)
AM_CONDITIONAL(SOMEBSD, true)
LIBEXT=.so
;;
netbsd*)
AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
AC_CHECK_LIB(c_r, pthread_create)
AM_CONDITIONAL(HAVE_GNU_LD, true)
AM_CONDITIONAL(SOMEBSD, true)
LIBEXT=.so
;;
*solaris*)
AC_DEFINE_UNQUOTED(SOLARIS,1,[This is a Solaris system])
AC_CHECK_LIB(resolv, res_init)
XTRA_CPPLIBS=-lstdc++
AM_CONDITIONAL(HAVE_GNU_LD, false)
AM_CONDITIONAL(SOMEBSD, false)
CFLAGS="-D_POSIX_PTHREAD_SEMANTICS $CFLAGS"
LIBEXT=.so
;;
darwin*)
AC_DEFINE_UNQUOTED(DARWIN,1,[This is a Darwin system])
AM_CONDITIONAL(HAVE_GNU_LD, false)
AM_CONDITIONAL(SOMEBSD, false)
LIBEXT=.dylib
;;
cygwin*)
AC_DEFINE_UNQUOTED(CYGWIN,1,[This is a CYGWIN system])
LDFLAGS="$LDFLAGS -no-undefined"
AM_CONDITIONAL(SOMEBSD, false)
AM_CONDITIONAL(HAVE_GNU_LD, false)
LIBEXT=.dll
;;
mingw*)
AC_DEFINE_UNQUOTED(MINGW,1,[This is a MinGW system])
AC_DEFINE_UNQUOTED(WINDOWS,1,[This is a Windows system])
AC_CHECK_LIB(intl, gettext)
AC_CHECK_LIB(ws2_32, _head_libws2_32_a,,[AC_MSG_ERROR([libextractor requires Winsock2])])
AC_CHECK_LIB(plibc, plibc_init,,[AC_MSG_ERROR([libextractor requires PlibC])])
LDFLAGS="$LDFLAGS -no-undefined -Wl,--export-all-symbols"
AM_CONDITIONAL(HAVE_GNU_LD, true)
AM_CONDITIONAL(SOMEBSD, false)
LIBEXT=.dll
;;
*)
AC_MSG_RESULT(Unrecognised OS $host_os)
AC_DEFINE_UNQUOTED(OTHEROS,1,[Some strange OS])
AC_MSG_RESULT(otheros)
AM_CONDITIONAL(HAVE_GNU_LD, false)
AM_CONDITIONAL(SOMEBSD, false)
LIBEXT=.so
;;
esac
AC_LIBTOOL_DLOPEN
AC_LIBLTDL_INSTALLABLE
AC_SUBST(LTDLINCL)
AC_SUBST(LIBLTDL)
AM_PROG_LIBTOOL
AC_LIB_LTDL
AC_CONFIG_SUBDIRS(libltdl)
AM_ICONV
# We define the paths here, because MinGW/GCC expands paths
# passed through the command line ("-DLOCALEDIR=..."). This would
# lead to hard-coded paths ("C:\mingw\mingw\bin...") that do
# not contain the actual installation.
AC_DEFINE_DIR([LOCALEDIR], [datadir/locale], [gettext catalogs])
ISOPFX=`pkg-config --variable=prefix iso-codes`
pkg-config --variable=prefix iso-codes 2> /dev/null || ISOPFX=/usr
AC_DEFINE_DIR([ISOLOCALEDIR], [$ISOPFX/share/locale], [iso-639 catalog])
# large file support
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
AM_CONDITIONAL(CYGWIN, test "$build_os" = "cygwin")
AM_CONDITIONAL(MINGW, test "$build_os" = "mingw32")
# use '-fno-strict-aliasing', but only if the compiler can take it
if gcc -fno-strict-aliasing -S -o /dev/null -xc /dev/null >/dev/null 2>&1;
then
CFLAGS="-fno-strict-aliasing $CFLAGS"
fi
# Checks for libraries.
# the library tests that follow should not result in every plugin linking to them,
# thus we need to backup LIBS and restore
LIBSOLD=$LIBS
# Redhat 9, gcc 3.2, libextractor_pdf barfs if we don't check for this
AC_CHECK_LIB(stdc++, fclose)
AC_CHECK_HEADERS(langinfo.h)
AC_CHECK_LIB(dl, dlopen)
LIBS=$LIBSOLD
# FIXME: allow --with-oggvorbis=PFX
# test if we have vorbisfile
# prior versions had ov_open_callbacks in libvorbis, test that, too.
AC_CHECK_LIB(vorbisfile, ov_open_callbacks,
[AM_CONDITIONAL(HAVE_VORBISFILE, true)
AC_DEFINE(HAVE_VORBISFILE,1,[Have vorbisfile])],
[AM_CONDITIONAL(HAVE_VORBISFILE, false)])
AC_CHECK_LIB(vorbisfile, vorbis_comment_query,
[AM_CONDITIONAL(NEED_VORBIS, false)],
[AM_CONDITIONAL(NEED_VORBIS, true)])
AC_CHECK_LIB(z, inflate,
[AM_CONDITIONAL(HAVE_ZLIB, true)
AC_DEFINE(HAVE_ZLIB,1,[Have zlib])],
[AM_CONDITIONAL(HAVE_ZLIB, false)])
AC_CHECK_LIB(bz2, BZ2_decompress,
[AM_CONDITIONAL(HAVE_BZ2, true)
AC_DEFINE(HAVE_LIBBZ2,1,[Have libbz2])],
[AM_CONDITIONAL(HAVE_BZ2, false)])
AC_CHECK_LIB(mpeg2, mpeg2_init,
[AM_CONDITIONAL(HAVE_MPEG2, true)
AC_DEFINE(HAVE_MPEG2,1,[Have libmpeg2])],
[AM_CONDITIONAL(HAVE_MPEG2, false)])
# restore LIBS
LIBS=$LIBSOLD
# Special check for broken Operating Systems (OS X)
AC_CACHE_CHECK(whether ${CC-cc} accepts -no-cpp-precomp,
cv_prog_cc_darwin_cpp_precomp,
[echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -no-cpp-precomp -c conftest.c 2>&1`"; then
cv_prog_cc_darwin_cpp_precomp=yes
else
cv_prog_cc_darwin_cpp_precomp=no
fi
rm -f conftest*
])
if test $cv_prog_cc_darwin_cpp_precomp = yes; then
CFLAGS="$CFLAGS -no-cpp-precomp"
fi
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_DIRENT
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([fcntl.h netinet/in.h stdlib.h string.h unistd.h libintl.h limits.h stddef.h zlib.h])
AC_CHECK_HEADERS([ltdl.h iconv.h bzlib.h mpeg2dec/mpeg2.h])
# fixme, we need to die here if a header is not found!
AC_CHECK_HEADERS([vorbis/vorbisfile.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_TYPE_PID_T
GNUPG_CHECK_ENDIAN
# Checks for library functions.
AC_FUNC_MEMCMP
AC_FUNC_VPRINTF
AC_FUNC_MMAP
AC_FUNC_STAT
AC_FUNC_ERROR_AT_LINE
AC_CHECK_FUNCS([mkstemp strndup munmap strcasecmp strdup strncasecmp memmove memset strtoul floor getcwd pow setenv sqrt strchr strcspn strrchr strnlen strndup ftruncate])
AM_GNU_GETTEXT_VERSION(0.13)
AM_GNU_GETTEXT([external])
# check for GNU LD
AC_LIB_PROG_LD_GNU
# check for glib >= 2.0.0
AC_MSG_CHECKING(for glib)
AM_PATH_GLIB_2_0(2.0.0,
without_glib=false,
without_glib=true)
AC_MSG_CHECKING([whether glib is disabled])
AC_ARG_ENABLE(glib,
[AC_HELP_STRING([--disable-glib],[disable glib support])],
[case "$enableval" in
no) AC_MSG_RESULT(disabled)
without_glib=true
;;
*) AC_MSG_RESULT(allowed)
;;
esac])
if test x$without_glib != xtrue
then
if test $with_gnu_ld == yes
then
# We need both GNU LD and GLIB here!
AM_CONDITIONAL(HAVE_GLIB,true)
AC_DEFINE(HAVE_GLIB, 1, [Have glib])
else
# We may have GLIB, but without GNU LD we must not use it!
AM_CONDITIONAL(HAVE_GLIB,false)
AC_DEFINE(HAVE_GLIB, 0, [Have glib, but not GNU LD])
fi
else
AM_CONDITIONAL(HAVE_GLIB,false)
AC_DEFINE(HAVE_GLIB, 0, [Have glib])
fi
# check for gtk >= 2.6.0
AC_MSG_CHECKING(for gtk)
AM_PATH_GTK_2_0(2.6.0,without_gtk=false,without_gtk=true)
AM_CONDITIONAL(HAVE_GTK, test x$without_gtk != xtrue)
if test $without_gtk != true
then
AC_DEFINE_UNQUOTED([HAVE_GTK], 1, [We have GTK])
else
AM_CONDITIONAL(HAVE_GTK,false)
fi
# check for Qt 4
qt=0
AC_LANG_PUSH([C++])
AC_MSG_CHECKING(for Qt)
AC_ARG_WITH(qt,
[ --with-qt=PFX Base of Qt installation],
[AC_MSG_RESULT([$with_qt])
case $with_qt in
no)
;;
yes)
AC_CHECK_HEADERS(qpixmap.h,
AC_CHECK_LIB([QtGui4], [_ZN7QPixmap12defaultDepthEv],
qt=1))
;;
*)
LDFLAGS="-L$with_qt/lib $LDFLAGS"
CPPFLAGS="-I$with_qt/include -I$with_qt/include/Qt $CPPFLAGS"
AC_CHECK_HEADERS(qpixmap.h,
AC_CHECK_LIB([QtGui4], [_ZN7QPixmap12defaultDepthEv],
EXT_LIB_PATH="-L$with_qt/lib $EXT_LIB_PATH"
qt=1))
;;
esac
],
[AC_MSG_RESULT([--with-qt not specified])
AC_CHECK_HEADERS(qpixmap.h,
AC_CHECK_LIB([QtGui4], [_ZN7QPixmap12defaultDepthEv],
qt=1))])
if test x$qt != x0
then
AC_DEFINE(HAVE_QT, 1, [We have Qt])
fi
AM_CONDITIONAL(HAVE_QT, test x$qt != x0)
# check for Qt SVG module
AC_MSG_CHECKING(for Qt SVG)
AC_ARG_WITH(qt,
[ --with-qt=PFX Base of Qt installation],
[AC_MSG_RESULT([$with_qt])
case $with_qt in
no)
;;
yes)
AC_CHECK_HEADERS(qsvgrenderer.h,
AC_CHECK_LIB([QtSvg4], [_ZN10QSvgWidgetD0Ev],
qt_svg=1))
;;
*)
LDFLAGS="-L$with_qt/lib $LDFLAGS"
CPPFLAGS="-I$with_qt/include -I$with_qt/include/Qt $CPPFLAGS"
AC_CHECK_HEADERS(qsvgrenderer.h,
AC_CHECK_LIB([QtSvg4], [_ZN10QSvgWidgetD0Ev],
EXT_LIB_PATH="-L$with_qt/lib $EXT_LIB_PATH"
qt_svg=1))
;;
esac
],
[AC_MSG_RESULT([--with-qt not specified])
AC_CHECK_HEADERS(qsvgrenderer.h,
AC_CHECK_LIB([QtSvg4], [_ZN10QSvgWidgetD0Ev],
qt_svg=1))])
if test x$qt_svg != x0
then
AC_DEFINE(HAVE_QT_SVG, 1, [We have Qt SVG])
fi
AM_CONDITIONAL(HAVE_QT_SVG, test x$qt_svg != x0)
AC_LANG_POP([C++])
printable=1
AC_MSG_CHECKING([whether to enable printable extractors])
AC_ARG_ENABLE(printable,
[AC_HELP_STRING([--enable-printable],[Enable printable support])
AC_HELP_STRING([--disable-printable],[Disable printable support])],
[case "$enableval" in
no) AC_MSG_RESULT(no)
printable=0
;;
*) AC_MSG_RESULT(yes)
printable=1
;;
esac],
[ AC_MSG_RESULT(yes)
printable=1])
AM_CONDITIONAL(HAVE_PRINTABLE, test x$printable != x0)
xpdf=0
AC_MSG_CHECKING([whether to enable xpdf-based extractor])
AC_ARG_ENABLE(xpdf,
[AC_HELP_STRING([--enable-xpdf],[Enable xpdf-based extractor])
AC_HELP_STRING([--disable-xpdf],[Disable xpdf-based extractor])],
[case "$enableval" in
no) AC_MSG_RESULT(no)
xpdf=0
;;
*) AC_MSG_RESULT(yes)
xpdf=1
;;
esac],
[ AC_MSG_RESULT(no)
xpdf=0])
AM_CONDITIONAL(HAVE_XPDF, test x$xpdf != x0)
exiv2=1
AC_MSG_CHECKING([whether to enable exiv2 extractor])
AC_ARG_ENABLE(exiv2,
[AC_HELP_STRING([--enable-exiv2],[Enable exiv2 support])
AC_HELP_STRING([--disable-exiv2],[Disable exiv2 support])],
[case "$enableval" in
no) AC_MSG_RESULT(no)
exiv2=0
;;
*) AC_MSG_RESULT(yes)
exiv2=1
;;
esac],
[ AC_MSG_RESULT(yes)
exiv2=1])
AM_CONDITIONAL(HAVE_EXIV2, test x$exiv2 != x0)
AC_DEFINE_UNQUOTED([HAVE_EXIV2], $exiv2, [We use EXIV2])
ABI_GSF
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(XTRA_CPPLIBS)
AC_SUBST(LIBEXT)
AC_CONFIG_FILES([Makefile po/Makefile.in m4/Makefile
doc/Makefile
src/Makefile
src/include/Makefile
src/main/Makefile
src/plugins/Makefile
src/plugins/ole2/Makefile
src/plugins/oo/Makefile
src/plugins/pdf/Makefile
src/plugins/rpm/Makefile
src/plugins/printable/Makefile
src/plugins/hash/Makefile
src/plugins/thumbnail/Makefile
src/plugins/exiv2/Makefile
src/test/Makefile
])
AC_OUTPUT
if test "x$xpdf" = "x1"
then
AC_MSG_NOTICE([NOTICE: xpdf enabled (xpdf has a bad security record)])
else
AC_MSG_NOTICE([NOTICE: xpdf disabled (result: limited PDF support)])
fi
if test "x$exiv2" = "x0"
then
AC_MSG_NOTICE([NOTICE: exiv2 disabled])
fi
if test "x$printable" = "x0"
then
AC_MSG_NOTICE([NOTICE: printable plugins disabled])
else
AC_MSG_NOTICE([NOTICE: printable plugins enabled])
fi
if test "x$have_gsf" != "xtrue"
then
AC_MSG_NOTICE([NOTICE: libgsf not found, no OLE2 (MS Office) support])
fi
if test "x$without_gtk" = "xtrue" -a "x$qt" = "x0"
then
AC_MSG_NOTICE([NOTICE: neither gtk nor Qt not found, no thumbnail support])
fi
if test "x$HAVE_VORBISFILE_TRUE" = "x#"
then
AC_MSG_NOTICE([NOTICE: vorbis support disabled])
fi
if test "x$HAVE_ZLIB_TRUE" = "x#"
then
AC_MSG_ERROR([FATAL: zlib not found (headers not installed?)])
fi
if test "x$HAVE_MPEG2_TRUE" = "x#"
then
AC_MSG_NOTICE([NOTICE: libmpeg2 not found])
fi
|