1 m4_define([poppler_version_major],[0])
2 m4_define([poppler_version_minor],[41])
3 m4_define([poppler_version_micro],[0])
4 m4_define([poppler_version],[poppler_version_major.poppler_version_minor.poppler_version_micro])
7 AC_INIT([poppler],[poppler_version],[https://bugs.freedesktop.org/enter_bug.cgi?product=poppler])
8 AC_CONFIG_MACRO_DIR([m4])
9 AM_INIT_AUTOMAKE([1.7 foreign])
10 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
11 AC_CONFIG_HEADERS([config.h poppler/poppler-config.h])
14 dnl ##### Initialize libtool.
16 define([AC_LIBTOOL_LANG_F77_CONFIG], [:])
19 dnl ##### Checks for programs.
24 #if test -z "$CXX" -a "$CC" = "gcc"; then
30 dnl ##### Check for pkgconfig
33 dnl ##### Export the version
34 AC_DEFINE_UNQUOTED([POPPLER_VERSION], ["poppler_version"], [Defines the poppler version])
36 dnl Enable these unconditionally.
37 AC_DEFINE([OPI_SUPPORT], [1], [Generate OPI comments in PS output.])
38 AC_DEFINE([MULTITHREADED], [1], [Enable multithreading support.])
39 AC_DEFINE([TEXTOUT_WORD_LIST], [1], [Enable word list support.])
41 dnl Check for OS specific flags
47 create_shared_lib="-no-undefined"
51 win32_libs="-lgdi32 -lwinspool -lcomdlg32"
52 create_shared_lib="-no-undefined"
53 auto_import_flags="-Wl,--enable-auto-import"
55 # Use mingw's ansi stdio extensions
56 CXXFLAGS="$CXXFLAGS -D__USE_MINGW_ANSI_STDIO=1"
61 AC_SUBST(create_shared_lib)
62 AC_SUBST(auto_import_flags)
66 dnl Install xpdf headers
67 AC_ARG_ENABLE(xpdf-headers,
68 AC_HELP_STRING([--enable-xpdf-headers],
69 [Install unsupported xpdf headers.]),
70 enable_xpdf_headers=$enableval,
71 enable_xpdf_headers="no")
72 AM_CONDITIONAL(ENABLE_XPDF_HEADERS, test x$enable_xpdf_headers = xyes)
74 dnl ##### Emulate cmake -DCMAKE_BUILD_TYPE=Release using options from cmake/modules/PopplerMacros.cmake
76 AC_ARG_ENABLE(build-type,
77 AC_HELP_STRING([--enable-build-type=@<:@relwithdebinfo/release/debug/debugfull/profile@:>@],
78 [Build with options similar to 'cmake -DCMAKE_BUILD_TYPE=' values.]),
79 [enable_build_type=no;
81 relwithdebinfo|release|debug|debugfull|profile) enable_build_type="$enableval" ;;
82 *) AC_MSG_ERROR([bad value $enableval for --enable-build-type option.
83 Options are relwithdebinfo, release, debug, debugfull, and profile.]) ;;
87 if test "x$GCC" = "xyes"; then
88 case "$enable_build_type" in
90 CFLAGS="-O2 -g $CFLAGS"
91 CXXFLAGS="-O2 -g $CXXFLAGS"
94 CFLAGS="-O2 $CFLAGS -g0 -DNDEBUG"
95 CXXFLAGS="-O2 $CXXFLAGS -g0 -DNDEBUG"
98 CFLAGS="-O2 -g $CFLAGS -fno-reorder-blocks -fno-schedule-insns -fno-inline"
99 CXXFLAGS="-O2 -g $CXXFLAGS -fno-reorder-blocks -fno-schedule-insns -fno-inline"
102 CFLAGS="$CFLAGS -g3 -fno-inline"
103 CXXFLAGS="$CXXFLAGS -g3 -fno-inline"
106 CFLAGS="$CFLAGS -g3 -fno-inline -ftest-coverage -fprofile-arcs"
107 CXXFLAGS="$CXXFLAGS -g3 -fno-inline -ftest-coverage -fprofile-arcs"
108 LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage -lgcov"
115 case "$enable_build_type" in
116 relwithdebinfo|release|debug|debugfull|profile)
117 echo " Warning: --enable-build-type ignored for non-gcc compiler."
123 AC_ARG_ENABLE(single-precision,
124 [ --enable-single-precision use single precision arithmetic (instead of double precision) in the Splash backend],
125 AC_DEFINE(USE_FLOAT, [1], [Use single precision arithmetic in the Splash backend]))
127 AC_ARG_ENABLE(fixedpoint,
128 [ --enable-fixedpoint use fixed point (instead of double precision) arithmetic in the Splash backend],
129 AC_DEFINE(USE_FIXEDPOINT, [1], [Use fixed point arithmetic in the Splash backend]))
132 [ --enable-cmyk Include support for CMYK rasterization],
133 AC_DEFINE(SPLASH_CMYK, [1], [Include support for CMYK rasterization]))
135 dnl Relocation support
136 AC_ARG_ENABLE(relocatable,
137 AC_HELP_STRING([--disable-relocatable],
138 [Hardcode the poppler library location (on Windows).]),
139 enable_relocatable=$enableval,
140 [if test x$os_win32 = xyes; then
141 # default to yes on native Windows.
142 enable_relocatable="yes"
144 # default to no everywhere else.
145 enable_relocatable="no"
150 if test x$enable_relocatable = xyes; then
151 if test x$os_win32 = xyes; then
152 AC_DEFINE([ENABLE_RELOCATABLE],
153 [1],[Do not hardcode the library location])
156 [Invalid setting for relocatable, only supported on windows])
161 dnl ##### Check for installed poppler-data. Use the same datarootdir as default otherwise.
162 PKG_CHECK_EXISTS(poppler-data,
163 [POPPLER_DATADIR=`$PKG_CONFIG --variable=poppler_datadir poppler-data`
164 AC_DEFINE_DIR(POPPLER_DATADIR, "{POPPLER_DATADIR}", [Poppler data dir])],
165 [AC_DEFINE_DIR(POPPLER_DATADIR, "{datarootdir}/poppler", [Poppler data dir])]
168 dnl ##### Checks for header files.
171 AC_CHECK_HEADERS([stdint.h])
173 dnl ##### Switch over to C++. This will make the checks below a little
174 dnl ##### bit stricter (requiring function prototypes in include files).
175 dnl ##### (99% of xpdf is written in C++.)
178 AC_CHECK_DECL(gettimeofday, [AC_CHECK_FUNC(gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Defines if gettimeofday is available on your system]))],[],[#include <sys/time.h>])
179 AC_CHECK_FUNC(localtime_r, AC_DEFINE(HAVE_LOCALTIME_R, 1, [Defines if localtime_r is available on your system]))
180 AC_CHECK_FUNC(gmtime_r, AC_DEFINE(HAVE_GMTIME_R, 1, [Defines if gmtime_r is available on your system]))
181 AC_CHECK_FUNC(rand_r, AC_DEFINE(HAVE_RAND_R, 1, [Defines if rand_r is available on your system]))
183 dnl ##### Check for extra libraries needed by X. (LynxOS needs this.)
184 AC_CHECK_FUNC(gethostbyname)
185 if test $ac_cv_func_gethostbyname = no; then
186 AC_CHECK_LIB(bsd, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd")
189 AC_CHECK_FUNC(nanosleep,,)
190 dnl try in librt if not found in current LIBS
191 if test x$ac_cv_func_nanosleep = xno
193 AC_CHECK_LIB(rt,nanosleep, X_EXTRA_LIBS="$X_EXTRA_LIBS -lrt")
196 dnl try in libposix4, if not found so far
197 if test x$ac_cv_func_nanosleep = xno && test x$ac_cv_lib_rt_nanosleep = xno
199 AC_CHECK_LIB(posix4,nanosleep, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix4")
203 dnl ##### Test for libopenjpeg. Versions prior to 1.4 do not provide a pkgconfig file.
206 AC_ARG_ENABLE(libopenjpeg,
207 AC_HELP_STRING([--enable-libopenjpeg=@<:@auto/openjpeg1/openjpeg2/none@:>@],
208 [Use openjpeg for JPEG2000 images. 'auto' prefers openjpeg1 over openjpeg2 if both are available due to regressions in openjpeg2 [[default=auto]]]),
209 [enable_libopenjpeg=$enableval],
210 [enable_libopenjpeg="auto"])
214 dnl test for libopenjpeg1
215 if test x$enable_libopenjpeg = xopenjpeg1 || test x$enable_libopenjpeg = xauto; then
216 PKG_CHECK_MODULES(LIBOPENJPEG, libopenjpeg,
218 [AC_CHECK_LIB([openjpeg], [opj_cio_open],
220 LIBOPENJPEG_LIBS="-lopenjpeg"],[openjpeg_header=no])
221 AC_CHECK_HEADERS([openjpeg.h],,
222 [openjpeg_header="no"])])
225 dnl test for libopenjpeg2
226 if test x$openjpeg1 = xno; then
227 if test x$enable_libopenjpeg = xopenjpeg2 || test x$enable_libopenjpeg = xauto; then
228 PKG_CHECK_MODULES(LIBOPENJPEG, libopenjp2,
229 [openjpeg2=yes],[openjpeg2=no])
233 if test x$enable_libopenjpeg = xopenjpeg1 && test x$openjpeg1 = xno; then
234 if test x$openjpeg_header = xno; then
235 AC_MSG_ERROR("*** libopenjpeg headers not found ***")
237 AC_MSG_ERROR("*** libopenjpeg library not found ***")
241 if test x$enable_libopenjpeg = xopenjpeg2 && test x$openjpeg2 = xno; then
242 AC_MSG_ERROR("*** libopenjp2 library not found ***")
245 if test x$openjpeg1 = xyes || test x$openjpeg2 = xyes; then
246 enable_libopenjpeg=yes
247 if test x$openjpeg1 = xyes; then
248 AC_DEFINE(USE_OPENJPEG1, 1, [Defined if using openjpeg1])
250 if test x$openjpeg2 = xyes; then
251 AC_DEFINE(USE_OPENJPEG2, 1, [Defined if using openjpeg2])
254 AC_SUBST(LIBOPENJPEG_CFLAGS)
255 AC_SUBST(LIBOPENJPEG_LIBS)
256 AC_DEFINE(ENABLE_LIBOPENJPEG)
257 PKG_CHECK_EXISTS(libopenjpeg >= 1.5,
258 [AC_DEFINE(WITH_OPENJPEG_IGNORE_PCLR_CMAP_CDEF_FLAG, 1, [OpenJPEG with the OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG flag.])],
259 [PKG_CHECK_EXISTS(libopenjpeg1 >= 1.5,
260 [AC_DEFINE(WITH_OPENJPEG_IGNORE_PCLR_CMAP_CDEF_FLAG, 1, [OpenJPEG with the OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG flag.])],
264 enable_libopenjpeg=no
267 AM_CONDITIONAL(BUILD_LIBOPENJPEG, test x$openjpeg1 = xyes || test x$openjpeg2 = xyes)
268 AH_TEMPLATE([ENABLE_LIBOPENJPEG],
269 [Use libopenjpeg instead of builtin jpeg2000 decoder.])
271 dnl ##### Test for libtiff
272 AC_ARG_ENABLE(libtiff,
273 AC_HELP_STRING([--disable-libtiff],
274 [Don't build against libtiff.]),
275 enable_libtiff=$enableval,
276 enable_libtiff="try")
278 AC_ARG_VAR([LIBTIFF_CFLAGS], [C compiler flags for LIBTIFF])
279 AC_ARG_VAR([LIBTIFF_LIBS], [linker flags to link LIBTIFF (default is -ltiff)])
280 ac_save_CPPFLAGS="$CPPFLAGS"
281 ac_save_CXXFLAGS="$CXXFLAGS"
282 ac_save_LIBS="$LDFLAGS"
283 CPPFLAGS="$CPPFLAGS $LIBTIFF_CFLAGS"
284 CXXFLAGS="$CXXFLAGS $LIBTIFF_CFLAGS"
285 LIBS="$LIBS $LIBTIFF_LIBS"
286 if test x$enable_libtiff = xyes; then
287 if test x"$LIBTIFF_LIBS" != x; then
288 AC_CHECK_FUNC([TIFFOpen],,
289 AC_MSG_ERROR("*** libtiff library not found ***"))
291 AC_CHECK_LIB([tiff], [TIFFOpen],,
292 AC_MSG_ERROR("*** libtiff library not found ***"))
294 AC_CHECK_HEADERS([tiffio.h],,
295 AC_MSG_ERROR("*** libtiff headers not found ***"))
296 elif test x$enable_libtiff = xtry; then
297 if test x"$LIBTIFF_LIBS" != x; then
298 AC_CHECK_FUNC([TIFFOpen],
299 [enable_libtiff="yes"],
300 [enable_libtiff="no"])
302 AC_CHECK_LIB([tiff], [TIFFOpen],
303 [enable_libtiff="yes"],
304 [enable_libtiff="no"])
306 AC_CHECK_HEADERS([tiffio.h],,
307 [enable_libtiff="no"])
309 CPPFLAGS="$ac_save_CPPFLAGS"
310 CXXFLAGS="$ac_save_CXXFLAGS"
313 if test x$enable_libtiff = xyes; then
314 if test x"$LIBTIFF_LIBS" = x; then
315 LIBTIFF_LIBS="-ltiff"
317 AC_SUBST(LIBTIFF_CFLAGS)
318 AC_SUBST(LIBTIFF_LIBS)
319 AC_DEFINE(ENABLE_LIBTIFF)
322 AM_CONDITIONAL(BUILD_LIBTIFF, test x$enable_libtiff = xyes)
323 AH_TEMPLATE([ENABLE_LIBTIFF], [Build against libtiff.])
324 if test x$enable_libtiff = xyes; then
325 AC_DEFINE(ENABLE_LIBTIFF, 1, [Build against libtiff.])
328 dnl ##### Checks for library functions.
329 AC_CHECK_FUNCS(popen mkstemp mkstemps)
330 AC_CHECK_FUNCS(strcpy_s strcat_s)
332 dnl ##### Back to C for the library tests.
335 dnl ##### Check for fseeko/ftello or fseek64/ftell64
336 dnl The LARGEFILE and FSEEKO macros have to be called in C, not C++, mode.
339 AC_CHECK_FUNCS(fseek64, xpdf_cv_func_fseek64=yes, xpdf_cv_func_fseek64=no)
340 AC_CHECK_FUNCS(ftell64, xpdf_cv_func_ftell64=yes, xpdf_cv_func_ftell64=no)
341 if test "$xpdf_cv_func_fseek64" = yes -a "$xpdf_cv_func_ftell64" = yes; then
342 AC_DEFINE(HAVE_FSEEK64)
344 AC_CHECK_FUNCS(pread64 lseek64)
347 AC_ARG_ENABLE([zlib],
348 [AS_HELP_STRING([--enable-zlib],[Build with zlib])],
349 [],[enable_zlib="no"])
350 if test x$enable_zlib = xyes; then
351 AC_CHECK_LIB([z], [inflate],,
352 AC_MSG_ERROR("*** zlib library not found ***"))
353 AC_CHECK_HEADERS([zlib.h],,
354 AC_MSG_ERROR("*** zlib headers not found ***"))
355 elif test x$enable_zlib = xtry; then
356 AC_CHECK_LIB([z], [inflate],
359 AC_CHECK_HEADERS([zlib.h],,
363 if test x$enable_zlib = xyes; then
366 AC_DEFINE(ENABLE_ZLIB)
369 AM_CONDITIONAL(BUILD_ZLIB, test x$enable_zlib = xyes)
370 AH_TEMPLATE([ENABLE_ZLIB],
371 [Use zlib instead of builtin zlib decoder.])
374 AC_ARG_ENABLE(libcurl,
375 AC_HELP_STRING([--enable-libcurl],
376 [Build with libcurl based HTTP support.]),
377 enable_libcurl=$enableval,
380 if test x$enable_libcurl = xyes; then
381 PKG_CHECK_MODULES(LIBCURL, libcurl)
382 AC_DEFINE(ENABLE_LIBCURL, 1, [Build against libcurl.])
383 AC_DEFINE(POPPLER_HAS_CURL_SUPPORT, 1,
384 [Support for curl based doc builder is compiled in.])
387 AM_CONDITIONAL(BUILD_LIBCURL, test x$enable_libcurl = xyes)
390 AC_ARG_ENABLE(libjpeg,
391 AC_HELP_STRING([--disable-libjpeg],
392 [Don't build against libjpeg.]),
393 enable_libjpeg=$enableval,
394 enable_libjpeg="try")
395 AC_ARG_VAR([LIBJPEG_CFLAGS], [C compiler flags for LIBJPEG])
396 if test x$enable_libjpeg != xno; then
399 dnl POPPLER_FIND_JPEG uses "USER_INCLUDES" and "USER_LIBS"
400 dnl to receive the flags for header and library directories.
402 ac_save_USER_INCLUDES="$USER_INCLUDES"
403 ac_save_USER_LDFLAGS="$USER_LDFLAGS"
404 USER_INCLUDES="$USER_INCLUDES $LIBJPEG_CFLAGS"
405 USER_LDFLAGS="$USER_LDFLAGS $LIBJPEG_CFLAGS"
408 dnl check INT16, INT32 typedef conflict in jmorecfg.h
409 ac_save_CPPFLAGS="$CPPFLAGS"
410 ac_save_CFLAGS="$CFLAGS"
411 CPPFLAGS="$CPPFLAGS $LIBJPEG_CFLAGS"
412 CFLAGS="$CFLAGS $LIBJPEG_CFLAGS"
413 AC_MSG_CHECKING([libjpeg.h works correctly])
419 #include <sys/types.h>
426 AC_MSG_CHECKING([libjpeg.h problem can be fixed by XMD_H macro])
427 CPPFLAGS="$CPPFLAGS -DXMD_H"
428 CFLAGS="$CFLAGS -DXMD_H"
434 #include <sys/types.h>
438 AC_MSG_RESULT([ok, -DXMD_H is added to LIBJPEG_CFLAGS])
439 LIBJPEG_CFLAGS="$LIBJPEG_CFLAGS -DXMD_H"
441 AC_MSG_RESULT([no, disable libjpeg])
445 CPPFLAGS="$ac_save_CPPFLAGS"
446 CFLAGS="$ac_save_CFLAGS"
448 dnl POPPLER_FIND_JPEG sets LIBJPEG_LIBS
449 AC_SUBST(LIBJPEG_CFLAGS)
450 USER_INCLUDES="$ac_save_USER_INCLUDES"
451 USER_LDFLAGS="$ac_save_USER_LDFLAGS"
454 AM_CONDITIONAL(BUILD_LIBJPEG, test x$enable_libjpeg = xyes)
455 AH_TEMPLATE([ENABLE_LIBJPEG],
456 [Use libjpeg instead of builtin jpeg decoder.])
459 AC_ARG_ENABLE(libpng,
460 AC_HELP_STRING([--disable-libpng],
461 [Do not build against libpng.]),
462 enable_libpng=$enableval,
465 if test x$enable_libpng != xno; then
466 PKG_CHECK_MODULES(LIBPNG, libpng, [enable_libpng="yes"],
467 [enable_libpng="no"])
470 if test x$enable_libpng = xyes; then
471 AC_DEFINE(ENABLE_LIBPNG, 1, [Build against libpng.])
474 AM_CONDITIONAL(BUILD_LIBPNG, test x$enable_libpng = xyes)
476 dnl Check for freetype headers
478 PKG_CHECK_MODULES(FREETYPE, freetype2,
479 [freetype_pkgconfig=yes], [freetype_pkgconfig=no])
481 if test "x$freetype_pkgconfig" = "xyes"; then
483 AC_DEFINE(HAVE_FREETYPE_H, 1, [Have FreeType2 include files])
490 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
491 if test "x$FREETYPE_CONFIG" != "xno" ; then
493 FREETYPE_CFLAGS=`$FREETYPE_CONFIG --cflags`
494 FREETYPE_LIBS=`$FREETYPE_CONFIG --libs`
495 AC_DEFINE(HAVE_FREETYPE_H, 1, [Have FreeType2 include files])
501 AC_SUBST(FREETYPE_CFLAGS)
502 AC_SUBST(FREETYPE_LIBS)
504 AC_MSG_CHECKING([which font configuration to use])
505 AC_ARG_WITH([font_configuration],
506 [AS_HELP_STRING([--with-font-configuration=fontconfig|win32],
507 [Select font configuration backend])],
509 [if test x$os_win32 = xyes; then
510 # default to win32 on native Windows.
511 with_font_configuration=win32
513 # default to fontconig everywhere else.
514 with_font_configuration=fontconfig
518 AC_MSG_RESULT([$with_font_configuration])
520 case $with_font_configuration in
522 AC_DEFINE([WITH_FONTCONFIGURATION_WIN32],
523 [1],[Use win32 font configuration backend])
524 # Set the minimum required Internet Explorer version to 5.0
525 CPPFLAGS="$CPPFLAGS -D_WIN32_IE=0x0500"
528 AC_DEFINE([WITH_FONTCONFIGURATION_FONTCONFIG],
529 [1],[Use fontconfig font configuration backend])
530 PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.0.0)
534 [Invalid font configuration setting: $with_font_configuration])
538 AM_CONDITIONAL(BUILD_WITH_WIN32_FONTCONFIGURATION,
539 test x$with_font_configuration = xwin32)
541 AC_ARG_ENABLE(splash-output,
542 AC_HELP_STRING([--disable-splash-output],
543 [Don't build the Splash graphics backend.]),,
544 enable_splash_output="yes")
545 AM_CONDITIONAL(BUILD_SPLASH_OUTPUT, test x$enable_splash_output = xyes)
546 AH_TEMPLATE([HAVE_SPLASH], [Use splash for rendering.])
547 if test x$enable_splash_output = xyes; then
548 AC_DEFINE(HAVE_SPLASH)
551 CAIRO_VERSION="1.10.0"
552 AC_SUBST(CAIRO_VERSION)
553 CAIRO_DEPS="cairo >= $CAIRO_VERSION cairo-ft >= $CAIRO_VERSION"
554 AC_ARG_ENABLE(cairo-output,
555 AC_HELP_STRING([--disable-cairo-output],
556 [Don't build the cairo graphics backend.]),
557 enable_cairo_output=$enableval,
558 enable_cairo_output="try")
560 if test x$enable_cairo_output = xyes; then
561 PKG_CHECK_MODULES(CAIRO, $CAIRO_DEPS)
562 elif test x$enable_cairo_output = xtry; then
563 PKG_CHECK_MODULES(CAIRO, $CAIRO_DEPS,
564 [enable_cairo_output="yes"],
565 [enable_cairo_output="no"
566 use_cairo="no (requires cairo >= $CAIRO_VERSION)"])
568 if test "x$use_cairo" = "x"; then
569 use_cairo=$enable_cairo_output
572 AC_SUBST(CAIRO_CFLAGS)
575 AM_CONDITIONAL(BUILD_CAIRO_OUTPUT, test x$enable_cairo_output = xyes)
576 AH_TEMPLATE([HAVE_CAIRO], [Use cairo for rendering.])
577 if test x$enable_cairo_output = xyes; then
578 PDFTOCAIRO_DEPS="cairo cairo-ft"
579 dnl Check for optional cairo backends used by pdftocairo
580 PKG_CHECK_EXISTS(cairo-pdf, [PDFTOCAIRO_DEPS="$PDFTOCAIRO_DEPS cairo-pdf"], [])
581 PKG_CHECK_EXISTS(cairo-ps, [PDFTOCAIRO_DEPS="$PDFTOCAIRO_DEPS cairo-ps"], [])
582 PKG_CHECK_EXISTS(cairo-svg, [PDFTOCAIRO_DEPS="$PDFTOCAIRO_DEPS cairo-svg"], [])
584 PKG_CHECK_MODULES(PDFTOCAIRO, $PDFTOCAIRO_DEPS)
585 AC_SUBST(PDFTOCAIRO_CFLAGS)
586 AC_SUBST(PDFTOCAIRO_LIBS)
588 AC_DEFINE(HAVE_CAIRO)
589 CAIRO_FEATURE="#define POPPLER_HAS_CAIRO 1"
591 AC_CHECK_HEADERS(fcntl.h sys/mman.h sys/stat.h)
593 CAIRO_FEATURE="#undef POPPLER_HAS_CAIRO"
596 AC_SUBST(CAIRO_FEATURE)
600 found_introspection=no
601 if test x$enable_cairo_output = xyes; then
602 POPPLER_GLIB_DISABLE_DEPRECATED=""
603 POPPLER_GLIB_DISABLE_SINGLE_INCLUDES=""
606 AC_SUBST(GLIB_REQUIRED)
607 AC_ARG_ENABLE(poppler-glib,
608 AC_HELP_STRING([--disable-poppler-glib],
609 [Don't compile poppler glib wrapper.]),
610 enable_poppler_glib=$enableval,
611 enable_poppler_glib="try")
612 if test x$enable_poppler_glib = xyes; then
613 PKG_CHECK_MODULES(POPPLER_GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED cairo >= $CAIRO_VERSION)
614 elif test x$enable_poppler_glib = xtry; then
615 PKG_CHECK_MODULES(POPPLER_GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED cairo >= $CAIRO_VERSION,
616 [enable_poppler_glib="yes"],
617 [enable_poppler_glib="no"
618 use_glib="no (requires glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED cairo >= $CAIRO_VERSION)"])
620 if test x$enable_poppler_glib = xyes; then
621 # Check for introspection
622 GOBJECT_INTROSPECTION_CHECK([0.6.7])
624 AC_PATH_PROG([GLIB_MKENUMS],[glib-mkenums])
625 POPPLER_GLIB_DISABLE_DEPRECATED="$POPPLER_GLIB_DISABLE_DEPRECATED -DG_DISABLE_DEPRECATED"
626 POPPLER_GLIB_DISABLE_SINGLE_INCLUDES="$POPPLER_GLIB_DISABLE_SINGLE_INCLUDES -DG_DISABLE_SINGLE_INCLUDES"
629 if test x$enable_poppler_glib = xyes; then
630 AC_MSG_ERROR("Cairo output is required to build glib frontend")
632 use_glib="no (requires cairo output)"
633 enable_poppler_glib="no"
635 if test x"$use_glib" = x; then
636 use_glib="$enable_poppler_glib"
638 AM_CONDITIONAL(BUILD_POPPLER_GLIB, test x$enable_poppler_glib = xyes)
639 AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
641 AC_SUBST(POPPLER_GLIB_DISABLE_DEPRECATED)
642 AC_SUBST(POPPLER_GLIB_DISABLE_SINGLE_INCLUDES)
644 GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
650 AC_ARG_ENABLE(poppler-qt4,
651 AC_HELP_STRING([--disable-poppler-qt4],
652 [Don't compile poppler Qt4 wrapper.]),
653 enable_poppler_qt4=$enableval,
654 enable_poppler_qt4="try")
655 if test x$enable_poppler_qt4 = xyes; then
656 PKG_CHECK_MODULES(POPPLER_QT4,
657 QtCore >= 4.7.0 QtGui >= 4.7.0 QtXml >= 4.7.0)
658 PKG_CHECK_MODULES(POPPLER_QT4_TEST,
660 elif test x$enable_poppler_qt4 = xtry; then
661 PKG_CHECK_MODULES(POPPLER_QT4,
662 QtCore >= 4.7.0 QtGui >= 4.7.0 QtXml >= 4.7.0,
663 [enable_poppler_qt4="yes"],
664 [enable_poppler_qt4="no"])
665 if test x$enable_poppler_qt4 = xyes; then
666 PKG_CHECK_MODULES(POPPLER_QT4_TEST,
668 [enable_poppler_qt4="yes"],
669 [enable_poppler_qt4="no"])
673 AC_SUBST(POPPLER_QT4_CXXFLAGS)
674 AC_SUBST(POPPLER_QT4_LIBS)
675 AC_SUBST(POPPLER_QT4_TEST_LIBS)
677 if test x$enable_poppler_qt4 = xyes; then
678 AC_CHECK_TOOL(MOCQT4, moc)
679 AC_MSG_CHECKING([for Qt4 moc])
680 mocversion=`$MOCQT4 -v 2>&1`
681 mocversiongrep=`echo $mocversion | grep "Qt 4"`
682 if test x"$mocversiongrep" != x"$mocversion"; then
684 # moc was not the qt4 one, try with moc-qt4
685 AC_CHECK_TOOL(MOCQT42, moc-qt4)
686 AC_MSG_CHECKING([for Qt4 moc-qt4])
687 mocversion=`$MOCQT42 -v 2>&1`
688 mocversiongrep=`echo $mocversion | grep "Qt 4"`
689 if test x"$mocversiongrep" != x"$mocversion"; then
691 enable_poppler_qt4=no;
698 AC_MSG_RESULT([$MOCQT4])
701 AM_CONDITIONAL(BUILD_POPPLER_QT4, test "x$enable_poppler_qt4" = "xyes")
707 AC_ARG_ENABLE(poppler-qt5,
708 AC_HELP_STRING([--disable-poppler-qt5],
709 [Don't compile poppler Qt5 wrapper.]),
710 enable_poppler_qt5=$enableval,
711 enable_poppler_qt5="try")
712 if test x$enable_poppler_qt5 = xyes; then
713 PKG_CHECK_MODULES(POPPLER_QT5,
714 Qt5Core >= 5.0.0 Qt5Gui >= 5.0.0 Qt5Xml >= 5.0.0 Qt5Widgets >= 5.0.0)
715 PKG_CHECK_MODULES(POPPLER_QT5_TEST,
717 elif test x$enable_poppler_qt5 = xtry; then
718 PKG_CHECK_MODULES(POPPLER_QT5,
719 Qt5Core >= 5.0.0 Qt5Gui >= 5.0.0 Qt5Xml >= 5.0.0 Qt5Widgets >= 5.0.0,
720 [enable_poppler_qt5="yes"],
721 [enable_poppler_qt5="no"])
722 if test x$enable_poppler_qt5 = xyes; then
723 PKG_CHECK_MODULES(POPPLER_QT5_TEST,
725 [enable_poppler_qt5="yes"],
726 [enable_poppler_qt5="no"])
730 AC_SUBST(POPPLER_QT5_CXXFLAGS)
731 AC_SUBST(POPPLER_QT5_LIBS)
732 AC_SUBST(POPPLER_QT5_TEST_LIBS)
734 if test x$enable_poppler_qt5 = xyes; then
735 AC_CHECK_TOOL(MOCQT5, moc)
736 AC_MSG_CHECKING([for Qt5 moc])
737 mocversion=`$MOCQT5 -v 2>&1`
738 mocversiongrep=`echo $mocversion | grep "Qt 5\|moc 5"`
739 if test x"$mocversiongrep" != x"$mocversion"; then
741 # moc was not the qt5 one, try with moc-qt5
742 AC_CHECK_TOOL(MOCQT52, moc-qt5)
743 AC_MSG_CHECKING([for Qt5 moc-qt5])
744 mocversion=`$MOCQT52 -v 2>&1`
745 mocversiongrep=`echo $mocversion | grep "Qt 5\|moc-qt5 5\|moc 5"`
746 if test x"$mocversiongrep" != x"$mocversion"; then
747 AC_CHECK_TOOL(QTCHOOSER, qtchooser)
748 AC_MSG_CHECKING([for qtchooser])
749 qt5tooldir=`QT_SELECT=qt5 qtchooser -print-env | grep QTTOOLDIR | cut -d '=' -f 2 | cut -d \" -f 2`
750 mocversion=`$qt5tooldir/moc -v 2>&1`
751 mocversiongrep=`echo $mocversion | grep "Qt 5\|moc 5"`
752 if test x"$mocversiongrep" != x"$mocversion"; then
754 enable_poppler_qt5=no;
757 MOCQT5=$qt5tooldir/moc
764 AC_MSG_RESULT([$MOCQT5])
767 AM_CONDITIONAL(BUILD_POPPLER_QT5, test "x$enable_poppler_qt5" = "xyes")
773 AC_ARG_ENABLE(poppler-cpp,
774 AC_HELP_STRING([--disable-poppler-cpp],
775 [Don't compile poppler cpp wrapper.]),
776 enable_poppler_cpp=$enableval,
777 enable_poppler_cpp="yes")
778 if test x$enable_poppler_cpp = xyes; then
780 if test x$am_func_iconv != xyes; then
781 enable_poppler_cpp=no
785 AM_CONDITIONAL(BUILD_POPPLER_CPP, test "x$enable_poppler_cpp" = "xyes")
788 GTK_TEST_DEPS='gtk+-3.0 >= 3.8 gdk-pixbuf-2.0'
789 if test x$enable_cairo_output = xyes; then
790 GTK_TEST_DEPS="$GTK_TEST_DEPS $CAIRO_DEPS"
792 AC_ARG_ENABLE(gtk-test,
793 AC_HELP_STRING([--disable-gtk-test],
794 [Don't compile GTK+ test program.]),
795 enable_gtk_test=$enableval,
796 enable_gtk_test="try")
797 if test x$enable_gtk_test = xyes; then
798 PKG_CHECK_MODULES(GTK_TEST, $GTK_TEST_DEPS)
799 elif test x$enable_gtk_test = xtry; then
800 PKG_CHECK_MODULES(GTK_TEST, $GTK_TEST_DEPS,
801 [enable_gtk_test="yes"],
802 [enable_gtk_test="no"])
804 AM_CONDITIONAL(BUILD_GTK_TEST, test x$enable_gtk_test = xyes -a x$enable_poppler_glib = xyes)
807 AC_HELP_STRING([--disable-utils],
808 [Don't compile poppler command line utils.]),
809 enable_utils=$enableval,
811 AM_CONDITIONAL(BUILD_UTILS, test x$enable_utils = xyes)
813 AC_ARG_ENABLE(compile-warnings,
814 AC_HELP_STRING([--enable-compile-warnings=@<:@no/yes/kde@:>@],
815 [Turn on compiler warnings.]),,
816 [enable_compile_warnings="yes"])
823 AC_HELP_STRING([--enable-cms=@<:@auto/lcms1/lcms2/none@:>@],
824 [Use color management system. 'auto' prefers lcms2 over lcms1 if both are available [[default=auto]]]),
825 [enable_cms=$enableval],
827 if test x$enable_cms = xauto; then
828 PKG_CHECK_MODULES(LCMS, lcms2, [lcms2=yes], [lcms2=no])
829 if test x$lcms2 = xno; then
830 PKG_CHECK_MODULES(LCMS, lcms, [lcms1=yes], [lcms1=no])
832 elif test x$enable_cms = xlcms1; then
833 PKG_CHECK_MODULES(LCMS, lcms, [lcms1=yes], [lcms1=no])
834 elif test x$enable_cms = xlcms2; then
835 PKG_CHECK_MODULES(LCMS, lcms2, [lcms2=yes], [lcms2=no])
838 if test x$lcms1 = xyes || test x$lcms2 = xyes; then
840 AC_DEFINE(USE_CMS, 1, [Defines if use cms])
841 if test x$lcms1 = xyes; then
843 AC_DEFINE(USE_LCMS1, 1, [Defines if use lcms1])
849 AM_CONDITIONAL(USE_CMS, test x$enable_cms = xyes)
850 AM_CONDITIONAL(USE_LCMS1, test x$lcms1 = xyes)
852 AC_ARG_WITH([testdatadir],
853 [AS_HELP_STRING([--with-testdatadir=/path/to/testdatadir],
854 [Specify test data dir])],
856 [[\\/]]* | ?:[[\\/]]* ) # Absolute name.
857 TESTDATADIR=$withval ;;
859 TESTDATADIR=$ac_pwd/$withval ;;
863 [[\\/]]* | ?:[[\\/]]* ) # Absolute name.
864 TESTDATADIR=$srcdir/../test ;;
866 TESTDATADIR=$ac_pwd/$srcdir/../test ;;
870 AC_MSG_CHECKING([for test data in $TESTDATADIR])
871 if test -d $TESTDATADIR && test -f $TESTDATADIR/test-poppler.c; then
876 No test data found in $TESTDATADIR.
877 You will not be able to run 'make check' successfully.
879 The test data is not included in the source packages
880 and is also not part of the main git repository. Instead,
881 you can checkout the test data from its own git
884 git clone git://git.freedesktop.org/git/poppler/test
886 You should checkout the test data as a sibling of your
887 poppler source folder or specify the location of your
888 checkout with --with-testdatadir=/path/to/checkoutdir/test.
891 AC_SUBST(TESTDATADIR)
893 # some compilers do not support this flag (see bug #76963)
895 AC_MSG_CHECKING([for -fno-check-new compiler flag])
897 saved_CXXFLAGS=$CXXFLAGS
898 CXXFLAGS="-fno-check-new $CXXFLAGS"
899 AC_TRY_COMPILE([], [],
900 [AC_MSG_RESULT([yes])
901 fno_check_new="-fno-check-new"],
904 CXXFLAGS=$saved_CXXFLAGS
907 if test "x$GCC" != xyes; then
908 enable_compile_warnings=no
910 case "$enable_compile_warnings" in
912 yes) CXXFLAGS="-Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wcast-align -fno-exceptions $fno_check_new -fno-common $CXXFLAGS";
913 CFLAGS="-Wall $CFLAGS" ;;
914 kde) CXXFLAGS="-Wnon-virtual-dtor -Wno-long-long -Wundef \
915 -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -Wcast-align \
916 -Wconversion -Wall -W -Wpointer-arith \
917 -Wwrite-strings -O2 -Wformat-security \
918 -Wmissing-format-attribute -fno-exceptions $fno_check_new \
919 -fno-common $CXXFLAGS" ;;
924 # mingw prints "warning: -fPIC ignored for target (all code is position independent)"
928 CXXFLAGS="-fPIC $CXXFLAGS";
933 case `$PKG_CONFIG --version` in
935 PC_REQUIRES_PRIVATE="";
936 PC_REQUIRES="poppler = $VERSION";;
938 PC_REQUIRES_PRIVATE="Requires.private: poppler = $VERSION";
942 AC_SUBST(PC_REQUIRES)
943 AC_SUBST(PC_REQUIRES_PRIVATE)
945 AC_SUBST([POPPLER_MAJOR_VERSION],[poppler_version_major])
946 AC_SUBST([POPPLER_MINOR_VERSION],[poppler_version_minor])
947 AC_SUBST([POPPLER_MICRO_VERSION],[poppler_version_micro])
948 AC_SUBST([POPPLER_VERSION],[poppler_version])
958 glib/poppler-features.h
959 glib/reference/Makefile
960 glib/reference/version.xml
972 cpp/poppler-version.h
975 poppler-uninstalled.pc
977 poppler-cairo-uninstalled.pc
979 poppler-splash-uninstalled.pc
981 poppler-glib-uninstalled.pc
983 poppler-qt4-uninstalled.pc
985 poppler-qt5-uninstalled.pc
987 poppler-cpp-uninstalled.pc])
991 echo "Building poppler with support for:"
992 echo " font configuration: $with_font_configuration"
993 echo " splash output: $enable_splash_output"
994 if test x$enable_cmyk = xyes;then
995 echo " with CMYK support"
997 echo " cairo output: $use_cairo"
998 echo " qt4 wrapper: $enable_poppler_qt4"
999 echo " qt5 wrapper: $enable_poppler_qt5"
1000 echo " glib wrapper: $use_glib"
1001 echo " introspection: $found_introspection"
1002 echo " cpp wrapper: $enable_poppler_cpp"
1003 echo " use gtk-doc: $enable_gtk_doc"
1004 echo " use libjpeg: $enable_libjpeg"
1005 echo " use libpng: $enable_libpng"
1006 echo " use libtiff: $enable_libtiff"
1007 echo " use zlib: $enable_zlib"
1008 echo " use libcurl: $enable_libcurl"
1009 echo " use libopenjpeg: $enable_libopenjpeg"
1010 if test x$enable_libopenjpeg = xyes;then
1011 if test x$openjpeg1 = xyes;then
1012 echo " with openjpeg1"
1014 echo " with openjpeg2"
1017 echo " use cms: $enable_cms"
1018 if test x$enable_cms = xyes;then
1019 if test x$lcms1 = xyes;then
1025 if test x$enable_build_type != xno;then
1026 echo " build type: $enable_build_type"
1028 echo " command line utils: $enable_utils"
1029 echo " test data dir: $TESTDATADIR"
1032 if test x$enable_splash_output = xno -a x$enable_cairo_output = xno; then
1033 echo " Warning: There is no rendering backend enabled"
1036 if test x$enable_single_precision = xyes -a x$enable_fixedpoint = xyes; then
1037 echo " Warning: Single precision and fixed point options should not be enabled at the same time"
1040 if test x$enable_libjpeg != xyes; then
1041 echo " Warning: Using libjpeg is recommended. The internal DCT decoder is unmaintained."
1044 if test x$enable_zlib != xno; then
1045 echo " Warning: Using zlib is not totally safe"
1048 if test x$enable_libopenjpeg != xyes; then
1049 echo " Warning: Using libopenjpeg is recommended. The internal JPX decoder is unmaintained."