4 [cairo_version_major.cairo_version_minor.cairo_version_micro],
5 [http://bugs.freedesktop.org/enter_bug.cgi?product=cairo],
7 [http://cairographics.org/])
8 AC_CONFIG_AUX_DIR(build)
9 AC_CONFIG_MACRO_DIR(build)
10 AC_USE_SYSTEM_EXTENSIONS
11 AC_CONFIG_SRCDIR(src/cairo.h)
12 AC_CONFIG_HEADERS(config.h)
14 AM_INIT_AUTOMAKE([1.11 foreign -Wall no-define no-dist-gzip dist-xz])
15 AM_SILENT_RULES([yes])
22 GTK_DOC_CHECK([1.15],[--flavour no-tmpl])
26 dnl ===========================================================================
28 dnl The order of the includes here is rather important
30 m4_include(build/configure.ac.version) dnl macros setting up various version declares
31 m4_include(build/configure.ac.tools) dnl checks for tools we use
32 m4_include(build/configure.ac.features) dnl macros for backend/feature handling
33 m4_include(build/configure.ac.warnings) dnl checks for compiler warning
34 m4_include(build/configure.ac.system) dnl checks for system functions, headers, libs
35 m4_include(build/configure.ac.analysis) dnl checks for analysis tools (lcov, etc)
36 m4_include(build/configure.ac.noversion) dnl disable builtin libtool versioning
37 m4_include(build/configure.ac.pthread) dnl checks for pthreads
40 dnl ===========================================================================
42 AC_CHECK_LIB(z, compress,
43 [AC_CHECK_HEADER(zlib.h, [
45 AC_DEFINE(HAVE_ZLIB, 1, [Define to 1 if you have zlib available])
47 [have_libz="no (requires zlib http://www.gzip.org/zlib/)"])],
48 [have_libz="no (requires zlib http://www.gzip.org/zlib/)"])
50 AC_CHECK_LIB(dl, dlsym,
51 [have_dlsym=yes; have_dl=yes],
52 [have_dlsym=no; have_dl=no])
53 if test "x$have_dlsym" = "xno"; then
54 AC_CHECK_FUNC(dlsym, [have_dlsym=yes], [have_dlsym=no])
56 AC_CHECK_HEADERS(dlfcn.h, [have_dlsym=yes], [have_dlsym=no])
57 AM_CONDITIONAL(CAIRO_HAS_DL, test "x$have_dl" = "xyes")
58 if test "x$have_dlsym" = "xyes"; then
59 AC_DEFINE([CAIRO_HAS_DLSYM], 1, [Define to 1 if dlsym is available])
61 AM_CONDITIONAL(CAIRO_HAS_DLSYM, test "x$have_dlsym" = "xyes")
63 dnl ===========================================================================
65 CAIRO_ENABLE_SURFACE_BACKEND(xlib, Xlib, auto, [
66 xlib_REQUIRES="x11 xext"
67 PKG_CHECK_MODULES(xlib, $xlib_REQUIRES, ,
71 if test "x$no_x" = xyes; then
72 use_xlib="no (requires X development libraries)"
74 xlib_NONPKGCONFIG_LIBS="$X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS"
75 xlib_NONPKGCONFIG_CFLAGS=$X_CFLAGS
79 CAIRO_ENABLE_SURFACE_BACKEND(xlib_xrender, Xlib Xrender, auto, [
80 if test "x$use_xlib" != "xyes"; then
81 use_xlib_xrender="no (requires --enable-xlib)"
83 dnl Check for Xrender header files if the Xrender package is not installed:
84 xlib_xrender_BASE=cairo-xlib
85 xlib_xrender_REQUIRES="xrender >= 0.6"
86 PKG_CHECK_MODULES(xlib_xrender, $xlib_xrender_REQUIRES, ,
88 xlib_xrender_REQUIRES=""
89 old_CPPFLAGS=$CPPFLAGS
90 CPPFLAGS="$CPPFLAGS $xlib_CFLAGS $xlib_NONPKGCONFIG_CFLAGS"
91 AC_CHECK_HEADER(X11/extensions/Xrender.h,
92 [xlib_xrender_NONPKGCONFIG_LIBS="-lXrender"],
93 [use_xlib_xrender="no (requires $xlib_xrender_REQUIRES http://freedesktop.org/Software/xlibs)"])
94 CPPFLAGS=$old_CPPFLAGS
99 CFLAGS="$CFLAGS $xlib_CFLAGS $xlib_NONPKGCONFIG_CFLAGS $xlib_xrender_CFLAGS $xlib_xrender_NONPKGCONFIG_CFLAGS"
100 LIBS="$LIBS $xlib_LIBS $xlib_NONPKGCONFIG_LIBS $xlib_xrender_LIBS $xlib_xrender_NONPKGCONFIG_LIBS"
101 AC_CHECK_FUNCS([XRenderCreateLinearGradient XRenderCreateRadialGradient XRenderCreateConicalGradient])
108 dnl ===========================================================================
110 CAIRO_ENABLE_SURFACE_BACKEND(xcb, XCB, auto, [
111 xcb_REQUIRES="xcb >= 1.6 xcb-render >= 1.6"
112 PKG_CHECK_MODULES(xcb, $xcb_REQUIRES, ,
114 use_xcb="no (requires $xcb_REQUIRES http://xcb.freedesktop.org)"])
117 CAIRO_ENABLE_FUNCTIONS(xlib_xcb, Xlib/XCB, no, [
118 if test "x$use_xcb" = "xyes" -a "x$use_xlib" = "xyes"; then
119 xlib_xcb_REQUIRES="x11-xcb"
120 PKG_CHECK_MODULES(xlib_xcb, $xlib_xcb_REQUIRES, ,
122 use_xlib_xcb="no (requires $xlib_xcb_REQUIRES http://xcb.freedesktop.org)"])
124 use_xlib_xcb="no (requires both --enable-xlib and --enable-xcb)"
128 CAIRO_ENABLE_FUNCTIONS(xcb_shm, XCB/SHM, auto, [
129 if test "x$use_xcb" = "xyes"; then
130 xcb_shm_REQUIRES="xcb-shm"
131 PKG_CHECK_MODULES(xcb_shm, $xcb_shm_REQUIRES, ,
133 use_xcb_shm="no (requires $xcb_shm http://xcb.freedesktop.org)"])
135 use_xcb_shm="no (requires --enable-xcb)"
139 dnl ===========================================================================
141 CAIRO_ENABLE_SURFACE_BACKEND(qt, Qt, no, [
142 qt_REQUIRES="QtGui >= 4.4.0"
143 PKG_CHECK_MODULES(qt, $qt_REQUIRES, ,
146 use_qt="no (requires Qt4 development libraries)"
150 dnl ===========================================================================
152 CAIRO_ENABLE_SURFACE_BACKEND(quartz, Quartz, auto, [
153 dnl There is no pkgconfig for quartz; lets do a header check
154 AC_CHECK_HEADER(ApplicationServices/ApplicationServices.h, , [use_quartz="no (requires ApplicationServices framework)"])
155 if test "x$use_quartz" != "xyes" ; then
156 dnl check for CoreGraphics as a separate framework
157 AC_CHECK_HEADER(CoreGraphics/CoreGraphics.h, , [use_quartz="no (requires CoreGraphics framework)"])
158 quartz_LIBS="-Xlinker -framework -Xlinker CoreGraphics"
160 quartz_LIBS="-Xlinker -framework -Xlinker ApplicationServices"
164 CAIRO_ENABLE_FONT_BACKEND(quartz_font, Quartz, auto, [
165 use_quartz_font=$use_quartz
168 CAIRO_ENABLE_SURFACE_BACKEND(quartz_image, Quartz Image, no, [
169 use_quartz_image=$use_quartz
172 dnl ===========================================================================
174 CAIRO_ENABLE_SURFACE_BACKEND(win32, Microsoft Windows, auto, [
175 if test "x$have_windows" != xyes; then
176 use_win32="no (requires a Win32 platform)"
178 win32_LIBS="-lgdi32 -lmsimg32"
181 CAIRO_ENABLE_FONT_BACKEND(win32_font, Microsoft Windows, auto, [
182 use_win32_font=$use_win32
185 test_win32_printing=no
186 if test "x$use_win32" = "xyes"; then
187 AC_CHECK_PROG(GS, gs, gs)
189 AC_DEFINE([CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE], 1, [Define to 1 if the Win32 Printing backend can be tested (needs ghostscript)])
190 test_win32_printing="yes"
192 AC_MSG_WARN([Win32 Printing backend will not be tested since ghostscript is not available])
193 test_win32_printing="no (requires ghostscript)"
197 AM_CONDITIONAL(CAIRO_CAN_TEST_WIN32_PRINTING_SURFACE, test "x$test_win32_printing" = "xyes")
199 dnl ===========================================================================
201 CAIRO_ENABLE_SURFACE_BACKEND(skia, Skia, no, [
203 [AS_HELP_STRING([--with-skia=/path/to/skia],
204 [directory to find compiled skia sources])],
205 [skia_DIR="$withval"],
206 [skia_DIR="`pwd`/../skia"])
207 AC_ARG_WITH([skia-bulid],
208 [AS_HELP_STRING([--with-skia-build=(Release|Debug)]
209 [build of skia to link with, default is Release])],
210 [skia_BUILD="$withval"],
211 [skia_BUILD="Release"])
212 skia_NONPKGCONFIG_CFLAGS="-I$skia_DIR/include/config -I$skia_DIR/include/core -I$skia_DIR/include/effects"
213 if test "x$skia_BUILD" = x"Release"; then
214 skia_NONPKGCONFIG_CFLAGS="-DSK_RELEASE -DSK_CAN_USE_FLOAT $skia_NONPKGCONFIG_CFLAGS"
216 skia_NONPKGCONFIG_LIBS="--start-group $skia_DIR/out/$skia_BUILD/obj.target/gyp/libeffects.a $skia_DIR/out/$skia_BUILD/obj.target/gyp/libimages.a $skia_DIR/out/$skia_BUILD/obj.target/gyp/libutils.a $skia_DIR/out/$skia_BUILD/obj.target/gyp/libopts.a $skia_DIR/out/$skia_BUILD/obj.target/gyp/libcore.a -end-group"
220 dnl ===========================================================================
222 CAIRO_ENABLE_SURFACE_BACKEND(os2, OS/2, no, [
228 use_os2="no (requires an OS/2 platform)"
233 dnl ===========================================================================
235 CAIRO_ENABLE_SURFACE_BACKEND(beos, BeOS/Zeta, no, [
239 dnl Add libbe and libzeta if available
240 AC_CHECK_LIB(be,main,beos_LIBS="$beos_LIBS -lbe")
241 AC_CHECK_LIB(zeta,main,beos_LIBS="$beos_LIBS -lzeta")
244 use_beos="no (requires a BeOS platform)"
249 dnl ===========================================================================
251 CAIRO_ENABLE_SURFACE_BACKEND(drm, DRM, no, [
252 drm_REQUIRES="libudev >= 136"
253 PKG_CHECK_MODULES(drm, $drm_REQUIRES, , [AC_MSG_RESULT(no)
254 use_drm="no (requires $drm_REQUIRES, udev is available from git://git.kernel.org/pub/scm/linux/hotplug/udev.git)"])
257 CAIRO_ENABLE_SURFACE_BACKEND(gallium, Gallium3D, no, [
258 if test "x$use_drm" = "xyes"; then
259 AC_ARG_WITH([gallium],
260 [AS_HELP_STRING([--with-gallium=/path/to/mesa],
261 [directory to find gallium enabled mesa])],
262 [mesa_DIR="$withval"],
263 [mesa_DIR="`pwd`/../mesa"])
264 gallium_DIR="$mesa_DIR/src/gallium"
265 gallium_NONPKGCONFIG_CFLAGS="-I$mesa_DIR/include -I$mesa_DIR/src/mesa -I$gallium_DIR/include -I$gallium_DIR/auxiliary"
266 gallium_NONPKGCONFIG_LIBS="-lGL"
268 AC_SUBST(gallium_DIR)
270 use_gallium="no (requires --enable-drm)"
274 dnl ===========================================================================
276 CAIRO_ENABLE_FUNCTIONS(png, PNG, yes, [
278 AC_ARG_VAR([png_REQUIRES], [module name for libpng to search for using pkg-config])
279 if test "x$png_REQUIRES" = x; then
280 # libpng13 is GnuWin32's libpng-1.2.8 :-(
281 for l in libpng libpng14 libpng12 libpng13 libpng10; do
282 if $PKG_CONFIG --exists $l ; then
292 if test "x$use_png" = "xyes" ; then
293 PKG_CHECK_MODULES(png, $png_REQUIRES, , AC_MSG_RESULT(no))
295 AC_MSG_WARN([Could not find libpng in the pkg-config search path])
299 dnl ===========================================================================
300 CAIRO_ENABLE_SURFACE_BACKEND(gl, OpenGL, no, [
302 PKG_CHECK_MODULES(gl, $gl_REQUIRES,, [
303 dnl Fallback to searching for headers
304 AC_CHECK_HEADER(GL/gl.h,, [use_gl="no (gl.pc nor OpenGL headers not found)"])
305 if test "x$use_gl" = "xyes"; then
306 gl_NONPKGCONFIG_CFLAGS=
307 gl_NONPKGCONFIG_LIBS="-lGL"
310 if test "x$have_dl" = "xyes" -a "x$have_dlsym" = "xyes"; then
311 gl_LIBS="$gl_LIBS -ldl"
314 need_glx_functions=yes
315 need_wgl_functions=yes
316 need_egl_functions=yes
319 dnl ===========================================================================
320 CAIRO_ENABLE_SURFACE_BACKEND(glesv2, OpenGLESv2, no, [
321 glesv2_REQUIRES="glesv2"
322 PKG_CHECK_MODULES(glesv2, $glesv2_REQUIRES,, [
323 dnl Fallback to searching for headers
324 AC_CHECK_HEADER(GLES2/gl2.h,, [use_glesv2="no (glesv2.pc nor OpenGL ES 2.0 headers not found)"])
325 if test "x$use_glesv2" = "xyes"; then
326 glesv2_NONPKGCONFIG_CFLAGS=
327 glesv2_NONPKGCONFIG_LIBS="-lGLESv2"
330 if test "x$have_dl" = "xyes" -a "x$have_dlsym" = "xyes"; then
331 glesv2_LIBS="$glesv2_LIBS -ldl"
334 need_egl_functions=yes
337 dnl ===========================================================================
338 CAIRO_ENABLE_SURFACE_BACKEND(cogl, Cogl, no, [
339 cogl_REQUIRES="cogl-2.0-experimental"
340 PKG_CHECK_MODULES(cogl, $cogl_REQUIRES,, [use_cogl="no"])
343 dnl ===========================================================================
345 CAIRO_ENABLE_SURFACE_BACKEND(directfb, directfb, no, [
346 directfb_REQUIRES=directfb
347 PKG_CHECK_MODULES(directfb, $directfb_REQUIRES, , AC_MSG_RESULT(no)
348 [use_directfb="no (requires $directfb_REQUIRES http://www.directfb.org)"])
351 dnl ===========================================================================
353 CAIRO_ENABLE_SURFACE_BACKEND(vg, OpenVG, no, [
354 dnl There is no pkgconfig for OpenVG; lets do a header check
355 AC_CHECK_HEADER(VG/openvg.h,, [use_vg="no (OpenVG headers not found)"])
356 if test "x$use_vg" = "xyes"; then
357 vg_NONPKGCONFIG_CFLAGS=
358 vg_NONPKGCONFIG_LIBS="-lOpenVG"
359 need_egl_functions=yes
360 need_glx_functions=yes
364 CAIRO_ENABLE_FUNCTIONS(egl, EGL, auto, [
365 if test "x$need_egl_functions" = "xyes"; then
367 PKG_CHECK_MODULES(egl, $egl_REQUIRES, ,
369 AC_CHECK_HEADER(EGL/egl.h,, [use_egl="no (EGL headers not found)"])
370 if test "x$use_egl" = "xyes"; then
371 egl_NONPKGCONFIG_CFLAGS=
372 egl_NONPKGCONFIG_LIBS=
375 # Temporary workaround for missing link from egl13
376 AC_CHECK_LIB(csi, csi_stream_attachresource, other_egl_LIBS="-lcsi")
377 LIBS="$other_egl_LIBS $LIBS"
378 for egl_lib in EGL egl13 egl12 egl11; do
379 if test -z "$egl_NONPKGCONFIG_LIBS"; then
380 AC_CHECK_LIB($egl_lib, eglGetError, egl_NONPKGCONFIG_LIBS="-l$egl_lib")
383 if test -z "$egl_NONPKGCONFIG_LIBS"; then
384 use_egl="no (EGL library not found)"
386 egl_NONPKGCONFIG_LIBS="$egl_NONPKGCONFIG_LIBS $other_egl_LIBS"
392 use_egl="no (not required by any backend)"
396 CAIRO_ENABLE_FUNCTIONS(glx, GLX, auto, [
397 if test "x$need_glx_functions" = "xyes"; then
398 save_CFLAGS="$CFLAGS"
399 CFLAGS="$CFLAGS $gl_CFLAGS $gl_NONPKGCONFIG_CFLAGS"
400 AC_CHECK_HEADER(GL/glx.h,, [use_glx="no (GLX headers not found)"])
401 glx_NONPKGCONFIG_CFLAGS=
402 glx_NONPKGCONFIG_LIBS="-lGL"
403 CFLAGS="$save_CFLAGS"
405 use_glx="no (not required by any backend)"
409 CAIRO_ENABLE_FUNCTIONS(wgl, WGL, auto, [
410 if test "x$need_wgl_functions" = "xyes"; then
411 AC_CHECK_HEADER(windows.h,, [use_wgl="no (WGL headers not found)"])
413 use_wgl="no (not required by any backend)"
417 dnl ===========================================================================
420 CAIRO_ENABLE_SURFACE_BACKEND(script, script, yes, [
424 dnl ===========================================================================
426 # We use pkg-config to look for freetype2, but fall back to
427 # freetype-config if it fails. We prefer pkg-config, since we can
428 # then just put freetype2 >= $FREETYPE_MIN_VERSION in
429 # Requires.private, but at least up to 2003-06-07, there was no
430 # freetype2.pc in the release.
432 # FreeType versions come in three forms:
433 # release (such as 2.1.9)
434 # libtool (such as 9.7.3) (returned by freetype-config and pkg-config)
435 # platform-specific/soname (such as 6.3.4)
436 # and they recommend you never use the platform-specific version
437 # (see docs/VERSION.DLL in freetype2 sources)
439 # Set these as appropriate:
441 # release number - for information only
442 FREETYPE_MIN_RELEASE=2.1.9
443 # libtool-specific version - this is what is checked
444 FREETYPE_MIN_VERSION=9.7.3
446 CAIRO_ENABLE_FONT_BACKEND(ft, FreeType, auto, [
448 PKG_CHECK_MODULES(FREETYPE, freetype2 >= $FREETYPE_MIN_VERSION,
449 [freetype_pkgconfig=yes],
451 freetype_pkgconfig=no])
453 if test "x$freetype_pkgconfig" = "xyes"; then
454 ft_REQUIRES="freetype2 >= $FREETYPE_MIN_VERSION $ft_REQUIRES"
457 if test -z "$FREETYPE_CONFIG"; then
458 AC_PATH_PROG(FREETYPE_CONFIG, freetype-config, no)
460 if test "x$FREETYPE_CONFIG" = "xno" ; then
461 use_ft='no (freetype-config not found in path or $FREETYPE_CONFIG)'
463 AC_MSG_CHECKING(freetype2 libtool version)
465 FREETYPE_VERSION=`$FREETYPE_CONFIG --version`
466 AX_COMPARE_VERSION([$FREETYPE_VERSION], [gt], [$FREETYPE_MIN_VERSION],
467 [AC_MSG_RESULT($FREETYPE_VERSION - OK)
468 ft_NONPKGCONFIG_CFLAGS=`$FREETYPE_CONFIG --cflags`
469 ft_NONPKGCONFIG_LIBS=`$FREETYPE_CONFIG --libs`],
470 [AC_MSG_RESULT($FREETYPE_VERSION - Too old)
471 use_ft="no ($FREETYPE_VERSION found; version $FREETYPE_MIN_VERSION from release $FREETYPE_MIN_RELEASE required)"])
475 ft_CFLAGS="$FREETYPE_CFLAGS"
476 ft_LIBS="$FREETYPE_LIBS"
479 FONTCONFIG_MIN_VERSION=2.2.95
480 CAIRO_ENABLE_FONT_BACKEND(fc, Fontconfig, auto, [
482 if test "x$use_fc" = "xyes"; then
483 fc_REQUIRES="fontconfig >= $FONTCONFIG_MIN_VERSION"
484 PKG_CHECK_MODULES(FONTCONFIG, $fc_REQUIRES,,
485 [AC_MSG_RESULT(no); use_fc="no (requires $fc_REQUIRES)"])
487 fc_CFLAGS="$FONTCONFIG_CFLAGS"
488 fc_LIBS="$FONTCONFIG_LIBS"
491 if test "x$use_ft" = "xyes"; then
493 _save_cflags="$CFLAGS"
494 LIBS="$LIBS $ft_LIBS"
495 CFLAGS="$CFLAGS $ft_CFLAGS"
496 AC_CHECK_MEMBER(FT_Bitmap_Size.y_ppem,
497 HAVE_FT_BITMAP_SIZE_Y_PPEM=1,
498 HAVE_FT_BITMAP_SIZE_Y_PPEM=0,
499 [#include <ft2build.h>
500 #include FT_FREETYPE_H])
501 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,$HAVE_FT_BITMAP_SIZE_Y_PPEM,
502 [FT_Bitmap_Size structure includes y_ppem field])
504 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_GlyphSlot_Oblique FT_Load_Sfnt_Table FT_Library_SetLcdFilter)
507 CFLAGS="$_save_cflags"
510 if test "x$use_fc" = "xyes"; then
511 CAIRO_CHECK_FUNCS_WITH_FLAGS(FcInit FcFini, [$FONTCONFIG_CFLAGS], [$FONTCONFIG_LIBS])
514 dnl ===========================================================================
516 CAIRO_ENABLE_SURFACE_BACKEND(ps, PostScript, yes, [
517 # The ps backend requires zlib.
519 ps_NONPKGCONFIG_LIBS=-lz
522 dnl ===========================================================================
524 SPECTRE_VERSION_REQUIRED=0.2.0
527 if test "x$use_ps" = "xyes"; then
528 AC_CHECK_PROG(GS, gs, gs)
530 AC_DEFINE([CAIRO_CAN_TEST_PS_SURFACE], 1, [Define to 1 if the PS backend can be tested (needs ghostscript)])
533 AC_MSG_WARN([PS backend will not be tested since ghostscript is not available])
534 test_ps="no (requires ghostscript)"
537 libspectre_DEPENDENCY="libspectre >= $SPECTRE_VERSION_REQUIRED"
538 PKG_CHECK_MODULES(LIBSPECTRE, $libspectre_DEPENDENCY,
540 [test_ps="no (requires libspectre)"])
543 AM_CONDITIONAL(CAIRO_CAN_TEST_PS_SURFACE, test "x$test_ps" = "xyes")
544 AM_CONDITIONAL(CAIRO_HAS_SPECTRE, test "x$any2ppm_ps" = "xyes")
545 if test "x$any2ppm_ps" = "xyes"; then
546 AC_DEFINE([CAIRO_HAS_SPECTRE], 1, [Define to 1 if libspectre is available])
548 AC_SUBST(LIBSPECTRE_CFLAGS)
549 AC_SUBST(LIBSPECTRE_LIBS)
551 dnl ===========================================================================
553 CAIRO_ENABLE_SURFACE_BACKEND(pdf, PDF, yes, [
554 # The pdf backend requires zlib.
556 pdf_NONPKGCONFIG_LIBS=-lz
559 dnl ===========================================================================
561 # poppler-0.17.4 fixes text-pattern and text-transform
562 POPPLER_VERSION_REQUIRED=0.17.4
565 if test "x$use_pdf" = "xyes"; then
566 poppler_DEPENDENCY="poppler-glib >= $POPPLER_VERSION_REQUIRED"
567 PKG_CHECK_MODULES(POPPLER, $poppler_DEPENDENCY,
568 [CAIRO_CHECK_FUNCS_WITH_FLAGS(poppler_page_render, [$POPPLER_CFLAGS], [$POPPLER_LIBS],
569 [test_pdf=yes; any2ppm_pdf=yes],
570 [test_pdf="no (requires $poppler_DEPENDENCY)"])],
571 [test_pdf="no (requires $poppler_DEPENDENCY)"])
572 if test "x$test_pdf" = "xyes"; then
573 AC_DEFINE([CAIRO_CAN_TEST_PDF_SURFACE], 1, [Define to 1 if the PDF backend can be tested (need poppler and other dependencies for pdf2png)])
575 AC_MSG_WARN([PDF backend will not be tested since poppler >= $POPPLER_VERSION_REQUIRED is not available])
579 AM_CONDITIONAL(CAIRO_CAN_TEST_PDF_SURFACE, test "x$test_pdf" = "xyes")
580 AC_SUBST(POPPLER_CFLAGS)
581 AC_SUBST(POPPLER_LIBS)
583 AM_CONDITIONAL(CAIRO_HAS_MULTI_PAGE_SURFACES, test "x$use_ps" = "xyes" -o "x$use_pdf" = "xyes")
585 dnl ===========================================================================
587 CAIRO_ENABLE_SURFACE_BACKEND(svg, SVG, yes, [
588 if test "x$use_png" != "xyes"; then
589 use_svg="no (requires --enable-png)"
593 LIBRSVG_VERSION_REQUIRED=2.15.0
596 if test "x$use_svg" = "xyes"; then
597 librsvg_DEPENDENCY="librsvg-2.0 >= $LIBRSVG_VERSION_REQUIRED"
598 PKG_CHECK_MODULES(LIBRSVG, $librsvg_DEPENDENCY gdk-2.0,
599 [CAIRO_CHECK_FUNCS_WITH_FLAGS(rsvg_pixbuf_from_file, [$LIBRSVG_CFLAGS], [$LIBRSVG_LIBS],
600 [test_svg=yes; any2ppm_svg=yes],
601 [test_svg="no (requires $librsvg_DEPENDENCY)"])],
602 [test_svg="no (requires $librsvg_DEPENDENCY)"])
603 if test "x$test_svg" = "xyes"; then
604 AC_DEFINE([CAIRO_CAN_TEST_SVG_SURFACE], 1, [Define to 1 if the SVG backend can be tested])
606 AC_MSG_WARN([SVG backend will not be tested since librsvg >= $LIBRSVG_VERSION_REQUIRED is not available])
610 AM_CONDITIONAL(CAIRO_CAN_TEST_SVG_SURFACE, test "x$test_svg" = "xyes")
611 AC_SUBST(LIBRSVG_CFLAGS)
612 AC_SUBST(LIBRSVG_LIBS)
614 dnl ===========================================================================
616 dnl XXX make this a private feature?
617 CAIRO_ENABLE(test_surfaces, test surfaces, no)
619 dnl ===========================================================================
621 CAIRO_ENABLE_SURFACE_BACKEND(image, image, always, [
622 pixman_REQUIRES="pixman-1 >= 0.22.0"
623 PKG_CHECK_MODULES(pixman, $pixman_REQUIRES, , [AC_MSG_RESULT(no)
624 use_image="no (requires $pixman_REQUIRES http://cairographics.org/releases/)"])
625 image_REQUIRES=$pixman_REQUIRES
626 image_CFLAGS=$pixman_CFLAGS
627 image_LIBS=$pixman_LIBS
630 if pkg-config --exists 'pixman-1 >= 0.27.1'; then
631 AC_DEFINE([HAS_PIXMAN_GLYPHS], 1, [Enable pixman glyph cache])
635 dnl ===========================================================================
637 CAIRO_ENABLE_SURFACE_BACKEND(mime, mime, always)
638 CAIRO_ENABLE_SURFACE_BACKEND(recording, recording, always)
639 CAIRO_ENABLE_SURFACE_BACKEND(observer, observer, always)
640 CAIRO_ENABLE_SURFACE_BACKEND(tee, tee, no)
641 CAIRO_ENABLE_SURFACE_BACKEND(xml, xml, no, [
643 xml_NONPKGCONFIG_LIBS=-lz
646 dnl ===========================================================================
648 CAIRO_ENABLE_FONT_BACKEND(user, user, always)
650 dnl ===========================================================================
652 dnl This needs to be last on our list of features so that the pthread libs and flags
653 dnl gets prefixed in front of everything else in CAIRO_{CFLAGS,LIBS}.
657 CAIRO_ENABLE(pthread, pthread, auto, [CAIRO_CONFIGURE_PTHREAD])
658 AM_CONDITIONAL(HAVE_REAL_PTHREAD, test "x$use_pthread" = "xyes" -a "x$have_real_pthread" = "xyes")
659 AM_CONDITIONAL(HAVE_PTHREAD, test "x$use_pthread" = "xyes")
660 AC_SUBST(pthread_CFLAGS)
661 AC_SUBST(pthread_LIBS)
662 AC_SUBST(real_pthread_CFLAGS)
663 AC_SUBST(real_pthread_LIBS)
666 dnl ===========================================================================
667 dnl Build gobject integration library
669 CAIRO_ENABLE_FUNCTIONS(gobject, gobject, auto, [
670 gobject_REQUIRES="gobject-2.0 glib-2.0"
671 PKG_CHECK_MODULES(GOBJECT, $gobject_REQUIRES, , [AC_MSG_RESULT(no)
672 use_gobject="no (requires $gobject_REQUIRES http://download.gnome.org/pub/GNOME/sources/glib/)"])
673 gobject_NONPKGCONFIG_EXTRA_LIBS="-L\${libdir} -lcairo-gobject"
675 dnl I'm too lazy to fix the caching properly
676 if test "x$use_gobject" = "xyes"; then
677 PKG_CHECK_MODULES(GOBJECT, $gobject_REQUIRES)
680 dnl ===========================================================================
681 dnl Default to quick testing during development, but force a full test before
684 AC_ARG_ENABLE(full-testing,
685 AS_HELP_STRING([--enable-full-testing],
686 [Sets the test suite to perform full testing by default, which
687 will dramatically slow down make check, but is a
688 *requirement* before release.]), [
689 if test "x$enableval" = "xyes"; then
691 AC_SUBST(CAIRO_TEST_MODE)
695 dnl ===========================================================================
696 dnl Build the external converter if we have any of the test backends
697 AM_CONDITIONAL(BUILD_ANY2PPM,
698 test "x$any2ppm_svg" = "xyes" \
699 -o "x$any2ppm_pdf" = "xyes" \
700 -o "x$any2ppm_ps" = "xyes" \
701 -o "x$any2ppm_cs" = "xyes")
703 dnl ===========================================================================
704 dnl Some utilities need to dlopen the shared libraries, so they need to
705 dnl know how libtools will name them
715 AC_DEFINE_UNQUOTED(SHARED_LIB_EXT, "${SHLIB_EXT}", [Shared library file extension])
718 dnl ===========================================================================
719 dnl The tracing utility requires LD_PRELOAD, so only build it for systems
720 dnl that are known to work.
723 *-linux*|*-*bsd*|*-solaris*|*-*-darwin*|*-dragonfly*|*-*-gnu*)
724 have_ld_preload="yes"
731 CAIRO_ENABLE(trace, cairo-trace, auto, [
732 if test "x$have_ld_preload" != "xyes" -o \
733 "x$have_libz" != "xyes" -o \
734 "x$have_real_pthread" != "xyes" -o \
735 "x$have_dlsym" != "xyes"; then
736 use_trace="no (requires dynamic linker and zlib and real pthreads)"
740 CAIRO_ENABLE(interpreter, cairo-script-interpreter, yes, [
741 if test "x$have_libz" != "xyes"; then
742 use_interpreter="no (requires zlib)"
746 AC_CHECK_LIB(bfd, bfd_openr,
747 [AC_CHECK_HEADER(bfd.h, [have_bfd=yes],
748 [have_bfd=no])], [have_bfd=no])
749 AC_CHECK_HEADER(libiberty.h,, [have_bfd=no])
750 if test "x$have_bfd" = "xyes"; then
751 AC_DEFINE([HAVE_BFD], [1], [Define to 1 if you have the binutils development files installed])
756 CAIRO_ENABLE(symbol_lookup, symbol-lookup, auto, [
757 if test "x$have_bfd" != "xyes"; then
758 use_symbol_lookup="no (requires bfd)"
762 PKG_CHECK_MODULES(glib, glib-2.0, have_glib=yes, have_glib=no)
763 AC_SUBST(glib_CFLAGS)
765 AM_CONDITIONAL(BUILD_SPHINX, test "x$have_glib" = "xyes")
768 AC_CHECK_LIB(rt, shm_open, shm_LIBS="-lrt")
772 dnl ===========================================================================
774 AC_ARG_ENABLE(some-floating-point,
775 AS_HELP_STRING([--disable-some-floating-point],
776 [Disable certain code paths that rely heavily on double precision
777 floating-point calculation. This option can improve
778 performance on systems without a double precision floating-point
779 unit, but might degrade performance on those that do.]), [
780 if test "x$enableval" = "xno"; then
781 # A value of 'no' for $enableval means that they want to disable, which
782 # means 'yes' for $disable_some_floating_point.
783 disable_some_floating_point=yes
785 ], [disable_some_floating_point=no])
787 AM_CONDITIONAL(DISABLE_SOME_FLOATING_POINT,
788 test "x$disable_some_floating_point" = "xyes")
789 if test "x$disable_some_floating_point" = "xyes"; then
790 AC_DEFINE(DISABLE_SOME_FLOATING_POINT, 1,
791 [Define to 1 to disable certain code paths that rely heavily on
792 double precision floating-point calculation])
795 dnl ===========================================================================
797 dnl Extra stuff we need to do when building C++ code
799 AS_IF([test "x$use_skia" = "xyes"], [need_cxx="yes"])
800 AS_IF([test "x$use_qt" = "xyes"], [need_cxx="yes"])
801 AS_IF([test "x$use_beos" = "xyes"], [need_cxx="yes"])
803 AM_CONDITIONAL(BUILD_CXX, test "x$need_cxx" = "xyes")
805 dnl ===========================================================================
807 # We use GTK+ for some utility/debugging tools
808 PKG_CHECK_MODULES(gtk, "gtk+-2.0",have_gtk=yes, have_gtk=no)
809 AM_CONDITIONAL(HAVE_GTK, test "x$have_gtk" = "xyes")
820 util/cairo-fdr/Makefile
821 util/cairo-gobject/Makefile
822 util/cairo-missing/Makefile
823 util/cairo-script/Makefile
824 util/cairo-script/examples/Makefile
825 util/cairo-sphinx/Makefile
826 util/cairo-trace/Makefile
827 util/cairo-trace/cairo-trace