mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-20 15:10:08 +01:00
Fix for bug #3951:
Add new _CHECK_FUNCS_WITH_FLAGS to abstract out the pain of temporarily setting flags for AC_CHECK_FUNCS. Use this to check for the existence of FcFini. Make call to FcFini conditional on HAVE_FCFINI. Remove stale comment about cleaning up memory which is now handled by cairo-test.c.
This commit is contained in:
parent
ba87f1324f
commit
b45f688765
4 changed files with 39 additions and 21 deletions
14
ChangeLog
14
ChangeLog
|
|
@ -1,3 +1,17 @@
|
|||
2005-08-03 Carl Worth <cworth@cworth.org>
|
||||
|
||||
Fix for bug #3951:
|
||||
|
||||
* configure.in: Add new _CHECK_FUNCS_WITH_FLAGS to abstract out
|
||||
the pain of temporarily setting flags for AC_CHECK_FUNCS. Use this
|
||||
to check for the existence of FcFini.
|
||||
|
||||
* test/cairo-test.c: (cairo_test_expecting): Make call to FcFini
|
||||
conditional on HAVE_FCFINI.
|
||||
|
||||
* test/text-cache-crash.c: (main): Remove stale comment about
|
||||
cleaning up memory which is now handled by cairo-test.c.
|
||||
|
||||
2005-08-01 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
reviewed by: cworth
|
||||
|
|
|
|||
30
configure.in
30
configure.in
|
|
@ -37,6 +37,27 @@ AM_PROG_LIBTOOL
|
|||
AC_STDC_HEADERS
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
dnl ===========================================================================
|
||||
dnl === Local macros
|
||||
dnl ===========================================================================
|
||||
|
||||
# _CHECK_FUNCS_WITH_FLAGS(FUNCTION..., CFLAGS, LIBS
|
||||
# [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
||||
# Like AC_CHECK_FUNCS but with additional CFLAGS and LIBS
|
||||
# --------------------------------------------------------------------
|
||||
AC_DEFUN([_CHECK_FUNCS_WITH_FLAGS],
|
||||
[
|
||||
save_cflags="$CFLAGS"
|
||||
save_libs="$LIBS"
|
||||
CFLAGS="$CFLAGS $2"
|
||||
LIBS="$LIBS $3"
|
||||
AC_CHECK_FUNCS($1, $4, $5)
|
||||
CFLAGS="$save_cflags"
|
||||
LIBS="$save_libs"
|
||||
])
|
||||
|
||||
dnl ===========================================================================
|
||||
|
||||
AC_CHECK_FUNCS(vasnprintf)
|
||||
|
||||
AC_CHECK_LIBM
|
||||
|
|
@ -61,13 +82,7 @@ if test "x$use_xlib" = "xyes"; then
|
|||
XRENDER_LIBS="$X_LIBS -lXrender -lXext -lX11 $X_EXTRA_LIBS"
|
||||
use_xlib=yes], [
|
||||
use_xlib="no (requires Xrender http://freedesktop.org/Software/xlibs)"])])
|
||||
save_cflags="$CFLAGS"
|
||||
save_libs="$LIBS"
|
||||
CFLAGS="$CFLAGS $XRENDER_CFLAGS"
|
||||
LIBS="$LIBS $XRENDER_LIBS"
|
||||
AC_CHECK_FUNCS(XrmFinalize)
|
||||
CFLAGS="$save_cflags"
|
||||
LIBS="$save_libs"
|
||||
_CHECK_FUNCS_WITH_FLAGS(XrmFinalize, $XRENDER_CFLAGS, $XRENDER_LIBS)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(CAIRO_HAS_XLIB_SURFACE, test "x$use_xlib" = "xyes")
|
||||
|
|
@ -232,6 +247,7 @@ AC_ARG_ENABLE(freetype,
|
|||
if test "x$use_freetype" = "xyes"; then
|
||||
PKG_CHECK_MODULES(FONTCONFIG, fontconfig,
|
||||
[use_freetype=yes], [use_freetype=no])
|
||||
_CHECK_FUNCS_WITH_FLAGS(FcFini, $FONTCONFIG_CFLAGS, $FONTCONFIG_LIBS)
|
||||
fi
|
||||
|
||||
CAIRO_CFLAGS="$CAIRO_CFLAGS $FONTCONFIG_CFLAGS"
|
||||
|
|
|
|||
|
|
@ -561,7 +561,9 @@ cairo_test_expecting (cairo_test_t *test, cairo_test_draw_function_t draw,
|
|||
|
||||
fclose (cairo_test_log_file);
|
||||
|
||||
#if HAVE_FCFINI
|
||||
FcFini ();
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,20 +118,6 @@ main (void)
|
|||
|
||||
ret = cairo_test (&test, draw);
|
||||
|
||||
/* It's convenient to be able to free all memory (including
|
||||
* statically allocated memory). This makes it quite easy to use
|
||||
* tools such as valgrind to verify that there are no memory leaks
|
||||
* whatsoever.
|
||||
*
|
||||
* But I'm not sure what would be a sensible cairo API function
|
||||
* for this. The cairo_destroy_caches call below is just something
|
||||
* I made as a local modification to cairo.
|
||||
*/
|
||||
/*
|
||||
cairo_destroy_caches ();
|
||||
FcFini ();
|
||||
*/
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue