[boilerplate] Runtime library check

For the purposes of benchmarking it is useful to run cairo-perf against a
different library from the one it was compiled against. In order to do so,
we need to check that the runtime library contains the required entry
points for our targets - which we can check by using dlsym.
This commit is contained in:
Chris Wilson 2009-08-23 15:25:42 +01:00
parent 7447915381
commit 8078cd194e
22 changed files with 85 additions and 3 deletions

View file

@ -23,6 +23,9 @@ libcairoboilerplate_la_SOURCES = \
cairo-boilerplate-constructors.c \
$(NULL)
libcairoboilerplate_la_LIBADD = $(top_builddir)/src/libcairo.la
if CAIRO_HAS_DL
libcairoboilerplate_la_LIBADD += -ldl
endif
if CAIRO_HAS_BEOS_SURFACE
# BeOS system headers trigger this warning

View file

@ -211,6 +211,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"directfb", "directfb", NULL, NULL,
CAIRO_SURFACE_TYPE_DIRECTFB, CAIRO_CONTENT_COLOR, 0,
"cairo_directfb_surface_create",
_cairo_boilerplate_directfb_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -220,6 +221,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"directfb-bitmap", "directfb", NULL, NULL,
CAIRO_SURFACE_TYPE_DIRECTFB, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_directfb_surface_create",
_cairo_boilerplate_directfb_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,

View file

@ -70,6 +70,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"drm", "drm", NULL, NULL,
CAIRO_SURFACE_TYPE_DRM, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_drm_surface_create",
_cairo_boilerplate_drm_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -80,6 +81,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"drm", "drm", NULL, NULL,
CAIRO_SURFACE_TYPE_DRM, CAIRO_CONTENT_COLOR, 1,
"cairo_drm_surface_create",
_cairo_boilerplate_drm_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,

View file

@ -141,6 +141,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"gl", "gl", NULL, NULL,
CAIRO_SURFACE_TYPE_GL, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_gl_surface_create",
_cairo_boilerplate_gl_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -151,6 +152,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"gl", "gl", NULL, NULL,
CAIRO_SURFACE_TYPE_GL, CAIRO_CONTENT_COLOR, 1,
"cairo_gl_surface_create",
_cairo_boilerplate_gl_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,

View file

@ -169,6 +169,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"glitz-agl", "glitz", NULL, NULL,
CAIRO_SURFACE_TYPE_GLITZ, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_glitz_surface_create",
_cairo_boilerplate_glitz_agl_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -178,6 +179,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"glitz-agl", "glitz", NULL, NULL,
CAIRO_SURFACE_TYPE_GLITZ, CAIRO_CONTENT_COLOR, 0,
"cairo_glitz_surface_create",
_cairo_boilerplate_glitz_agl_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,

View file

@ -243,6 +243,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"glitz-glx", "glitz", NULL, NULL,
CAIRO_SURFACE_TYPE_GLITZ,CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_glitz_surface_create",
_cairo_boilerplate_glitz_glx_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -252,6 +253,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"glitz-glx", "glitz", NULL, NULL,
CAIRO_SURFACE_TYPE_GLITZ, CAIRO_CONTENT_COLOR, 0,
"cairo_glitz_surface_create",
_cairo_boilerplate_glitz_glx_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,

View file

@ -166,6 +166,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"glitz-wgl", "glitz", NULL, NULL,
CAIRO_SURFACE_TYPE_GLITZ, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_glitz_surface_create",
_cairo_boilerplate_glitz_wgl_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -175,6 +176,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"glitz-wgl", "glitz", NULL, NULL,
CAIRO_SURFACE_TYPE_GLITZ, CAIRO_CONTENT_COLOR, 0,
"cairo_glitz_surface_create",
_cairo_boilerplate_glitz_wgl_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,

View file

@ -229,6 +229,7 @@ static const cairo_boilerplate_target_t targets[] = {
"pdf", "pdf", ".pdf", NULL,
CAIRO_SURFACE_TYPE_PDF,
CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0,
"cairo_pdf_surface_create",
_cairo_boilerplate_pdf_create_surface,
_cairo_boilerplate_pdf_force_fallbacks,
_cairo_boilerplate_pdf_finish_surface,
@ -240,6 +241,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"pdf", "pdf", ".pdf", NULL,
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0,
"cairo_pdf_surface_create",
_cairo_boilerplate_pdf_create_surface,
_cairo_boilerplate_pdf_force_fallbacks,
_cairo_boilerplate_pdf_finish_surface,

View file

@ -294,6 +294,7 @@ static const cairo_boilerplate_target_t targets[] = {
"ps2", "ps", ".ps", NULL,
CAIRO_SURFACE_TYPE_PS,
CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0,
"cairo_ps_surface_create",
_cairo_boilerplate_ps2_create_surface,
_cairo_boilerplate_ps_force_fallbacks,
_cairo_boilerplate_ps_finish_surface,
@ -305,6 +306,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"ps2", "ps", ".ps", NULL,
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0,
"cairo_ps_surface_create",
_cairo_boilerplate_ps2_create_surface,
_cairo_boilerplate_ps_force_fallbacks,
_cairo_boilerplate_ps_finish_surface,
@ -317,6 +319,7 @@ static const cairo_boilerplate_target_t targets[] = {
"ps3", "ps", ".ps", NULL,
CAIRO_SURFACE_TYPE_PS,
CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0,
"cairo_ps_surface_create",
_cairo_boilerplate_ps3_create_surface,
_cairo_boilerplate_ps_force_fallbacks,
_cairo_boilerplate_ps_finish_surface,
@ -328,6 +331,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"ps3", "ps", ".ps", NULL,
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0,
"cairo_ps_surface_create",
_cairo_boilerplate_ps3_create_surface,
_cairo_boilerplate_ps_force_fallbacks,
_cairo_boilerplate_ps_finish_surface,

View file

@ -52,6 +52,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"quartz", "quartz", NULL, NULL,
CAIRO_SURFACE_TYPE_QUARTZ, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_quartz_surface_create",
_cairo_boilerplate_quartz_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -60,6 +61,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"quartz", "quartz", NULL, NULL,
CAIRO_SURFACE_TYPE_QUARTZ, CAIRO_CONTENT_COLOR, 0,
"cairo_quartz_surface_create",
_cairo_boilerplate_quartz_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,

View file

@ -129,6 +129,7 @@ _cairo_boilerplate_script_cleanup (void *closure)
static const cairo_boilerplate_target_t target[] = {{
"script", "script", ".cs", NULL,
CAIRO_SURFACE_TYPE_SCRIPT, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_script_surface_create",
_cairo_boilerplate_script_create_surface,
NULL,
_cairo_boilerplate_script_finish_surface,

View file

@ -33,6 +33,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"skia", "skia", NULL, NULL,
CAIRO_SURFACE_TYPE_SKIA, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_skia_surface_create",
_cairo_boilerplate_skia_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -41,6 +42,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"skia", "skia", NULL, NULL,
CAIRO_SURFACE_TYPE_SKIA, CAIRO_CONTENT_COLOR, 0,
"cairo_skia_surface_create",
_cairo_boilerplate_skia_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,

View file

@ -274,6 +274,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"svg11", "svg", NULL, NULL,
CAIRO_SURFACE_TYPE_SVG, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_svg_surface_create",
_cairo_boilerplate_svg11_create_surface,
_cairo_boilerplate_svg_force_fallbacks,
_cairo_boilerplate_svg_finish_surface,
@ -285,6 +286,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"svg11", "svg", NULL, NULL,
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 1,
"cairo_svg_surface_create",
_cairo_boilerplate_svg11_create_surface,
_cairo_boilerplate_svg_force_fallbacks,
_cairo_boilerplate_svg_finish_surface,
@ -296,6 +298,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"svg12", "svg", NULL, NULL,
CAIRO_SURFACE_TYPE_SVG, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_svg_surface_create",
_cairo_boilerplate_svg12_create_surface,
_cairo_boilerplate_svg_force_fallbacks,
_cairo_boilerplate_svg_finish_surface,
@ -307,6 +310,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"svg12", "svg", NULL, NULL,
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 1,
"cairo_svg_surface_create",
_cairo_boilerplate_svg12_create_surface,
_cairo_boilerplate_svg_force_fallbacks,
_cairo_boilerplate_svg_finish_surface,

View file

@ -233,6 +233,7 @@ static const cairo_boilerplate_target_t targets[] = {
"test-fallback", "image", NULL, NULL,
CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK,
CAIRO_CONTENT_COLOR_ALPHA, 0,
"_cairo_test_fallback_surface_create",
_cairo_boilerplate_test_fallback_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -242,6 +243,7 @@ static const cairo_boilerplate_target_t targets[] = {
"test-fallback", "image", NULL, NULL,
CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK,
CAIRO_CONTENT_COLOR, 0,
"_cairo_test_fallback_surface_create",
_cairo_boilerplate_test_fallback_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -251,6 +253,7 @@ static const cairo_boilerplate_target_t targets[] = {
"test-fallback16", "image", NULL, NULL,
CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK,
CAIRO_CONTENT_COLOR_ALPHA, 0,
"_cairo_test_fallback16_surface_create",
_cairo_boilerplate_test_fallback16_create_surface,
NULL, NULL,
NULL, /* _cairo_boilerplate_get_image_surface, */
@ -260,6 +263,7 @@ static const cairo_boilerplate_target_t targets[] = {
"test-fallback16", "image", NULL, NULL,
CAIRO_INTERNAL_SURFACE_TYPE_TEST_FALLBACK,
CAIRO_CONTENT_COLOR, 0,
"_cairo_test_fallback16_surface_create",
_cairo_boilerplate_test_fallback16_create_surface,
NULL, NULL,
NULL, /* _cairo_boilerplate_get_image_surface, */
@ -270,6 +274,7 @@ static const cairo_boilerplate_target_t targets[] = {
"test-paginated", "image", NULL, NULL,
CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED,
CAIRO_CONTENT_COLOR_ALPHA, 0,
"_cairo_test_paginated_surface_create",
_cairo_boilerplate_test_paginated_create_surface,
NULL, NULL,
_cairo_boilerplate_test_paginated_get_image_surface,
@ -282,6 +287,7 @@ static const cairo_boilerplate_target_t targets[] = {
"test-paginated", "image", NULL, NULL,
CAIRO_INTERNAL_SURFACE_TYPE_TEST_PAGINATED,
CAIRO_CONTENT_COLOR, 0,
"_cairo_test_paginated_surface_create",
_cairo_boilerplate_test_paginated_create_surface,
NULL, NULL,
_cairo_boilerplate_test_paginated_get_image_surface,
@ -296,6 +302,7 @@ static const cairo_boilerplate_target_t targets[] = {
"test-wrapping", "image", NULL, NULL,
CAIRO_INTERNAL_SURFACE_TYPE_TEST_WRAPPING,
CAIRO_CONTENT_COLOR_ALPHA, 0,
"_cairo_test_wrapping_surface_create",
_cairo_boilerplate_test_wrapping_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -307,6 +314,7 @@ static const cairo_boilerplate_target_t targets[] = {
"null", "image", NULL, NULL,
CAIRO_INTERNAL_SURFACE_TYPE_NULL,
CAIRO_CONTENT_COLOR_ALPHA, 0,
"_cairo_test_null_surface_create",
_cairo_boilerplate_test_null_create_surface,
NULL, NULL,
NULL, NULL, NULL,

View file

@ -305,6 +305,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"vg-glx", "vg", NULL, NULL,
CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_vg_context_create_for_glx",
_cairo_boilerplate_vg_create_surface_glx,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -315,6 +316,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"vg-glx", "vg", NULL, NULL,
CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR, 1,
"cairo_vg_context_create_for_glx",
_cairo_boilerplate_vg_create_surface_glx,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -327,6 +329,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"vg-egl", "vg", NULL, NULL,
CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_vg_context_create_for_egl",
_cairo_boilerplate_vg_create_surface_egl,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -337,6 +340,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"vg-egl", "vg", NULL, NULL,
CAIRO_SURFACE_TYPE_VG, CAIRO_CONTENT_COLOR, 1,
"cairo_vg_context_create_for_egl",
_cairo_boilerplate_vg_create_surface_egl,
NULL, NULL,
_cairo_boilerplate_get_image_surface,

View file

@ -347,6 +347,7 @@ static const cairo_boilerplate_target_t targets[] = {
"win32-printing", "win32", ".ps", NULL,
CAIRO_SURFACE_TYPE_WIN32_PRINTING,
CAIRO_TEST_CONTENT_COLOR_ALPHA_FLATTENED, 0,
"cairo_win32_printing_surface_create",
_cairo_boilerplate_win32_printing_create_surface,
NULL, NULL,
_cairo_boilerplate_win32_printing_get_image_surface,
@ -357,6 +358,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"win32-printing", "win32", ".ps", NULL,
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0,
"cairo_win32_printing_surface_create",
_cairo_boilerplate_win32_printing_create_surface,
NULL, NULL,
_cairo_boilerplate_win32_printing_get_image_surface,

View file

@ -52,6 +52,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"win32", "win32", NULL, NULL,
CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR, 0,
"cairo_win32_surface_create_with_dib",
_cairo_boilerplate_win32_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -63,6 +64,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"win32", "win32", NULL, NULL,
CAIRO_SURFACE_TYPE_WIN32, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_win32_surface_create_with_dib",
_cairo_boilerplate_win32_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,

View file

@ -119,6 +119,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"xcb", "xcb", NULL, NULL,
CAIRO_SURFACE_TYPE_XCB, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_xcb_surface_create_with_xrender_format",
_cairo_boilerplate_xcb_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,

View file

@ -439,6 +439,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"xlib", "xlib", NULL, "xlib-reference",
CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR_ALPHA, 1,
"cairo_xlib_surface_create_with_xrender_format",
_cairo_boilerplate_xlib_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -449,6 +450,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"xlib", "xlib", NULL, "xlib-reference",
CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1,
"cairo_xlib_surface_create_with_xrender_format",
_cairo_boilerplate_xlib_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -459,6 +461,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"xlib-reference", "xlib", NULL, NULL,
CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1,
"cairo_xlib_surface_create",
_cairo_boilerplate_xlib_reference_create_surface,
NULL, NULL,
NULL, /* get_image */
@ -473,6 +476,7 @@ static const cairo_boilerplate_target_t targets[] = {
{
"xlib-fallback", "xlib", NULL, NULL,
CAIRO_SURFACE_TYPE_XLIB, CAIRO_CONTENT_COLOR, 1,
"cairo_xlib_surface_create",
_cairo_boilerplate_xlib_fallback_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,

View file

@ -45,6 +45,10 @@
#include <assert.h>
#include <errno.h>
#if HAVE_DL
#include <dlfcn.h>
#endif
#if HAVE_UNISTD_H && HAVE_FCNTL_H && HAVE_SIGNAL_H && HAVE_SYS_STAT_H && HAVE_SYS_SOCKET_H && HAVE_SYS_UN_H
#include <unistd.h>
#include <fcntl.h>
@ -278,7 +282,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
{
"image", "image", NULL, NULL,
CAIRO_SURFACE_TYPE_IMAGE, CAIRO_CONTENT_COLOR_ALPHA, 0,
_cairo_boilerplate_image_create_surface,
NULL, _cairo_boilerplate_image_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png
@ -286,7 +290,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
{
"image", "image", NULL, NULL,
CAIRO_SURFACE_TYPE_IMAGE, CAIRO_CONTENT_COLOR, 0,
_cairo_boilerplate_image_create_surface,
NULL, _cairo_boilerplate_image_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
cairo_surface_write_to_png
@ -295,6 +299,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
{
"meta", "image", NULL, NULL,
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR_ALPHA, 0,
"cairo_meta_surface_create",
_cairo_boilerplate_meta_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -305,6 +310,7 @@ static const cairo_boilerplate_target_t builtin_targets[] = {
{
"meta", "image", NULL, NULL,
CAIRO_SURFACE_TYPE_META, CAIRO_CONTENT_COLOR, 0,
"cairo_meta_surface_create",
_cairo_boilerplate_meta_create_surface,
NULL, NULL,
_cairo_boilerplate_get_image_surface,
@ -321,6 +327,19 @@ static struct cairo_boilerplate_target_list {
const cairo_boilerplate_target_t *target;
} *cairo_boilerplate_targets;
static cairo_bool_t
probe_target (const cairo_boilerplate_target_t *target)
{
if (target->probe == NULL)
return TRUE;
#if HAVE_DL
return dlsym (NULL, target->probe) != NULL;
#else
return TRUE;
#endif
}
void
_cairo_boilerplate_register_backend (const cairo_boilerplate_target_t *targets,
unsigned int count)
@ -329,9 +348,13 @@ _cairo_boilerplate_register_backend (const cairo_boilerplate_target_t *targets,
while (count--) {
struct cairo_boilerplate_target_list *list;
--targets;
if (! probe_target (targets))
continue;
list = xmalloc (sizeof (*list));
list->next = cairo_boilerplate_targets;
list->target = --targets;
list->target = targets;
cairo_boilerplate_targets = list;
}
}

View file

@ -157,6 +157,7 @@ typedef struct _cairo_boilerplate_target {
cairo_surface_type_t expected_type;
cairo_content_t content;
unsigned int error_tolerance;
const char *probe; /* runtime dl check */
cairo_boilerplate_create_surface_t create_surface;
cairo_boilerplate_force_fallbacks_t force_fallbacks;
cairo_boilerplate_finish_surface_t finish_surface;

View file

@ -36,6 +36,13 @@ AC_CHECK_LIB(z, compress,
[have_libz="no (requires zlib http://www.gzip.org/zlib/)"])],
[have_libz="no (requires zlib http://www.gzip.org/zlib/)"])
AC_CHECK_LIB(dl, dlsym,
[AC_CHECK_HEADER(dlfcn.h, [
have_dl=yes
AC_DEFINE(HAVE_DL, 1, [Define to 1 if you have dl available]),
], [have_dl=no])], [have_dl=no])
AM_CONDITIONAL(CAIRO_HAS_DL, test "x$have_dl" = "xyes")
dnl ===========================================================================
CAIRO_ENABLE_SURFACE_BACKEND(xlib, Xlib, auto, [