diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2006-06-13 22:37:34 -0400 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2006-06-14 05:06:09 -0700 |
commit | b9cfe941c8e1ae427780117fedfd47d458e29f02 (patch) | |
tree | fb9032e175ad5c55705485d978f27e3fb3cb5289 | |
parent | 2249fb89ae36859d1d3f6c9d0b72e95e45726170 (diff) | |
download | cairo-b9cfe941c8e1ae427780117fedfd47d458e29f02.tar.gz |
Add backend-specific pkg-config files.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | configure.in | 56 | ||||
-rw-r--r-- | src/.gitignore | 1 | ||||
-rw-r--r-- | src/Makefile.am | 35 | ||||
-rw-r--r-- | src/cairo-backend.pc.in | 12 |
5 files changed, 78 insertions, 27 deletions
diff --git a/.gitignore b/.gitignore index f8e50fe9e..0b1b43aba 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ Makefile Makefile.in aclocal.m4 autom4te.cache -cairo.pc compile config.cache config.guess diff --git a/configure.in b/configure.in index 5f923058e..9340f65b8 100644 --- a/configure.in +++ b/configure.in @@ -88,11 +88,14 @@ PKG_PROG_PKG_CONFIG dnl =========================================================================== dnl dnl Define a macro to enable backends. -dnl - Macro: CAIRO_BACKEND_ENABLE (BACKEND-ID, BACKEND-NAME, DEFAULT, COMMANDS-TO-CHECK-IT) +dnl - Macro: CAIRO_BACKEND_ENABLE (ID, NAME, DEFAULT, NAMESPACE, REQUIRES, COMMANDS-TO-CHECK-IT) dnl -dnl Where COMMANDS should set use_BACKEND-ID to something other than yes if the +dnl Where COMMANDS should set $use_ID to something other than yes if the dnl backend cannot be built. dnl +dnl Check the CAIRO_BACKEND_ENABLE line for fontconfig to understand each +dnl parameter. +dnl AC_DEFUN([CAIRO_BACKEND_ENABLE], [AC_ARG_ENABLE([$1], AS_HELP_STRING([--enable-$1=@<:@no/auto/yes@:>@], @@ -105,7 +108,7 @@ AC_DEFUN([CAIRO_BACKEND_ENABLE], [echo saved_use_$1=$use_$1 use_$1=yes - $4 + $6 cairo_cv_use_$1=$use_$1 use_$1=$saved_use_$1 AC_MSG_CHECKING([whether cairo's $1 backend could be enabled])]) @@ -114,21 +117,38 @@ AC_DEFUN([CAIRO_BACKEND_ENABLE], if test "x$cairo_cv_use_$1" = xyes; then use_$1=yes else - AC_MSG_ERROR(requested $2 backend could not be enabled) + AC_MSG_ERROR([requested $2 backend could not be enabled]) fi ;; auto) use_$1=$cairo_cv_use_$1 ;; *) - AC_MSG_ERROR(invalid argument passed to --enable-$1: $use_$1, should be one of @<:@no/auto/yes@:>@) + AC_MSG_ERROR([invalid argument passed to --enable-$1: $use_$1, should be one of @<:@no/auto/yes@:>@]) ;; esac + if test "x$use_$1" = xyes; then + AC_MSG_NOTICE([creating src/cairo-$4.pc]) + mkdir src + AS_IF([sed \ + -e "s/@backend_name@/$4/g" \ + -e "s/@Backend_Name@/$2/g" \ + -e "s/@BACKEND_REQUIRES@/$5/g" \ + -e "s,@prefix@,$prefix,g" \ + -e "s,@exec_prefix@,$exec_prefix,g" \ + -e "s,@libdir@,$libdir,g" \ + -e "s,@includedir@,$includedir,g" \ + -e "s,@VERSION@,$VERSION,g" \ + $srcdir/src/cairo-backend.pc.in > src/cairo-$4.pc],,[ + rm -f "src/cairo-$4.pc" + AC_MSG_ERROR([failed creating src/cairo-$4.pc]) + ]) + fi fi]) dnl =========================================================================== -CAIRO_BACKEND_ENABLE(xlib, Xlib, auto, [ +CAIRO_BACKEND_ENABLE(xlib, Xlib, auto, xlib, [xrender], [ dnl Check for Xrender header files if the Xrender package is not installed: PKG_CHECK_MODULES(XRENDER, xrender >= 0.6, [ XRENDER_REQUIRES=xrender], [ @@ -150,7 +170,7 @@ AC_SUBST(XRENDER_REQUIRES) CAIRO_CFLAGS="$CAIRO_CFLAGS $XRENDER_CFLAGS" CAIRO_LIBS="$CAIRO_LIBS $XRENDER_LIBS" -CAIRO_BACKEND_ENABLE(quartz, Quartz, no, [ +CAIRO_BACKEND_ENABLE(quartz, Quartz, no, quartz, [], [ dnl There is no pkgconfig for quartz; lets do a header check AC_CHECK_HEADER(Carbon/Carbon.h, [use_quartz=yes], [use_quartz="no (Carbon headers not found)"]) ]) @@ -165,7 +185,7 @@ CAIRO_LIBS="$CAIRO_LIBS $QUARTZ_LIBS" dnl =========================================================================== -CAIRO_BACKEND_ENABLE(xcb, XCB, no, [ +CAIRO_BACKEND_ENABLE(xcb, XCB, no, xcb, [xcb xcb-render], [ PKG_CHECK_MODULES(XCB, xcb xcb-render, [use_xcb=yes], [ use_xcb="no (requires XCB http://xcb.freedesktop.org)"]) ]) @@ -191,7 +211,7 @@ case "$host" in ;; esac -CAIRO_BACKEND_ENABLE(win32, Microsoft Windows, auto, [ +CAIRO_BACKEND_ENABLE(win32, Microsoft Windows, auto, win32, [], [ case "$host" in *-*-mingw*|*-*-cygwin*) use_win32=yes @@ -223,7 +243,7 @@ AC_SUBST(WIN32_FONT_FEATURE) dnl =========================================================================== -CAIRO_BACKEND_ENABLE(beos, BeOS/Zeta, no, [ +CAIRO_BACKEND_ENABLE(beos, BeOS/Zeta, no, beos, [], [ case "$host" in *-*-beos) use_beos=yes @@ -250,7 +270,7 @@ AC_SUBST(BEOS_SURFACE_FEATURE) dnl =========================================================================== -CAIRO_BACKEND_ENABLE(png, PNG, yes, [ +CAIRO_BACKEND_ENABLE(png, PNG, yes, png, [], [ use_png=no # libpng13 is GnuWin32's libpng-1.2.8 :-( for l in libpng12 libpng13 libpng10 ; do @@ -284,7 +304,7 @@ AC_SUBST(PNG_REQUIRES) dnl =========================================================================== -CAIRO_BACKEND_ENABLE(glitz, glitz, no, [ +CAIRO_BACKEND_ENABLE(glitz, glitz, no, glitz, [glitz], [ PKG_CHECK_MODULES(GLITZ, glitz >= 0.5.1, [ GLITZ_REQUIRES=glitz use_glitz=yes], [use_glitz="no (requires glitz http://freedesktop.org/Software/glitz)"]) @@ -332,7 +352,7 @@ AC_SUBST(GLITZ_REQUIRES) dnl =========================================================================== -CAIRO_BACKEND_ENABLE(directfb, directfb, no, [ +CAIRO_BACKEND_ENABLE(directfb, directfb, no, directfb, [directfb], [ PKG_CHECK_MODULES(DIRECTFB, directfb, [use_directfb=yes], [ use_directfb="no (requires directfb http://www.directfb.org)"]) ]) @@ -348,7 +368,7 @@ CAIRO_LIBS="$CAIRO_LIBS $DIRECTFB_LIBS" dnl =========================================================================== -CAIRO_BACKEND_ENABLE(freetype, freetype font, auto, [ +CAIRO_BACKEND_ENABLE(freetype, freetype font, auto, ft, [freetype2 fontconfig], [ PKG_CHECK_MODULES(FONTCONFIG, fontconfig, [use_freetype=yes], [use_freetype=no]) _CHECK_FUNCS_WITH_FLAGS(FcFini, $FONTCONFIG_CFLAGS, $FONTCONFIG_LIBS) @@ -462,7 +482,7 @@ AM_CONDITIONAL(HAVE_PTHREAD, test "x$have_pthread" = "xyes") dnl =========================================================================== -CAIRO_BACKEND_ENABLE(ps, PostScript, auto, [ +CAIRO_BACKEND_ENABLE(ps, PostScript, auto, ps, [], [ if test x"$have_ft_load_sfnt_table" != "xyes" ; then use_ps="no (PS backend requires FreeType 2.1.4 or newer)" fi @@ -487,7 +507,7 @@ AC_SUBST(PS_LIBS) dnl =========================================================================== -CAIRO_BACKEND_ENABLE(pdf, PDF, auto, [ +CAIRO_BACKEND_ENABLE(pdf, PDF, auto, pdf, [], [ if test x"$have_ft_load_sfnt_table" != "xyes" ; then use_pdf="no (PDF backend requires FreeType 2.1.4 or newer)" fi @@ -519,7 +539,7 @@ AC_SUBST(PDF_LIBS) dnl =========================================================================== -CAIRO_BACKEND_ENABLE(svg, SVG, auto, [ +CAIRO_BACKEND_ENABLE(svg, SVG, auto, svg, [], [ if test x"$have_ft_load_sfnt_table" != "xyes" ; then use_svg="no (SVG backend requires FreeType 2.1.4 or newer)" fi @@ -560,7 +580,7 @@ dnl =========================================================================== dnl This check should default to 'yes' once we have code to actually dnl check for the atsui font backend. -CAIRO_BACKEND_ENABLE(atsui, atsui font, no, [ +CAIRO_BACKEND_ENABLE(atsui, atsui font, no, atsui, [], [ dnl There is no pkgconfig for atsui; lets do a header check AC_CHECK_HEADER(Carbon/Carbon.h, [use_atsui=yes], [use_atsui=no]) ]) diff --git a/src/.gitignore b/src/.gitignore index abf1f37b6..82a14e259 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -7,6 +7,7 @@ Makefile.in *.la *.lo *.loT +*.pc cairo-features.h cairo.def *.o diff --git a/src/Makefile.am b/src/Makefile.am index 7756e8a0a..c25911cf3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,29 +5,32 @@ font_subset_sources = \ cairo-scaled-font-subsets.c \ cairo-scaled-font-subsets-private.h -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = cairo.pc +backend_pkgconfigs = if CAIRO_HAS_PS_SURFACE libcairo_ps_headers = cairo-ps.h libcairo_ps_sources = cairo-ps-surface.c cairo-ps-test.h libcairo_font_subset_sources = $(font_subset_sources) +backend_pkgconfigs += cairo-ps.pc endif if CAIRO_HAS_PDF_SURFACE libcairo_pdf_headers = cairo-pdf.h libcairo_pdf_sources = cairo-pdf-surface.c cairo-pdf-test.h libcairo_font_subset_sources = $(font_subset_sources) +backend_pkgconfigs += cairo-pdf.pc endif if CAIRO_HAS_PNG_FUNCTIONS libcairo_png_sources = cairo-png.c +backend_pkgconfigs += cairo-png.pc endif if CAIRO_HAS_SVG_SURFACE libcairo_svg_headers = cairo-svg.h libcairo_svg_sources = cairo-svg-surface.c cairo-svg-test.h libcairo_font_subset_sources = $(font_subset_sources) +backend_pkgconfigs += cairo-svg.pc endif if CAIRO_HAS_TEST_SURFACES @@ -39,16 +42,19 @@ endif if CAIRO_HAS_XLIB_SURFACE libcairo_xlib_headers = cairo-xlib.h cairo-xlib-xrender.h libcairo_xlib_sources = cairo-xlib-surface.c cairo-xlib-screen.c cairo-xlib-private.h cairo-xlib-test.h +backend_pkgconfigs += cairo-xlib.pc endif if CAIRO_HAS_QUARTZ_SURFACE libcairo_quartz_headers = cairo-quartz.h libcairo_quartz_sources = cairo-quartz-surface.c cairo-quartz-private.h +backend_pkgconfigs += cairo-quartz.pc endif if CAIRO_HAS_XCB_SURFACE libcairo_xcb_headers = cairo-xcb.h cairo-xcb-xrender.h libcairo_xcb_sources = cairo-xcb-surface.c +backend_pkgconfigs += cairo-xcb.pc endif libcairo_win32_sources = @@ -57,7 +63,9 @@ libcairo_win32_headers = cairo-win32.h libcairo_win32_sources += cairo-win32-surface.c cairo-win32-private.h export_symbols = -export-symbols cairo.def cairo_def_dependency = cairo.def +backend_pkgconfigs += cairo-win32.pc endif +# This is not really a separate conditional. Is TRUE iff the previous one is. if CAIRO_HAS_WIN32_FONT libcairo_win32_sources += cairo-win32-font.c endif @@ -66,6 +74,7 @@ libcairo_beos_sources = if CAIRO_HAS_BEOS_SURFACE libcairo_beos_headers = cairo-beos.h libcairo_beos_sources += cairo-beos-surface.cpp +backend_pkgconfigs += cairo-beos.pc noinst_LTLIBRARIES = libcairo_beos.la libcairo_beos_la_SOURCES = $(libcairo_beos_sources) @@ -76,21 +85,25 @@ endif if CAIRO_HAS_GLITZ_SURFACE libcairo_glitz_headers = cairo-glitz.h libcairo_glitz_sources = cairo-glitz-surface.c +backend_pkgconfigs += cairo-glitz.pc endif -if CAIRO_HAS_ATSUI_FONT -libcairo_atsui_headers = cairo-atsui.h -libcairo_atsui_sources = cairo-atsui-font.c +if CAIRO_HAS_DIRECTFB_SURFACE +libcairo_directfb_headers = cairo-directfb.h +libcairo_directfb_sources = cairo-directfb-surface.c +backend_pkgconfigs += cairo-directfb.pc endif if CAIRO_HAS_FT_FONT libcairo_ft_headers = cairo-ft.h libcairo_ft_sources = cairo-ft-font.c cairo-ft-private.h +backend_pkgconfigs += cairo-ft.pc endif -if CAIRO_HAS_DIRECTFB_SURFACE -libcairo_directfb_headers = cairo-directfb.h -libcairo_directfb_sources = cairo-directfb-surface.c +if CAIRO_HAS_ATSUI_FONT +libcairo_atsui_headers = cairo-atsui.h +libcairo_atsui_sources = cairo-atsui-font.c +backend_pkgconfigs += cairo-atsui.pc endif # Headers that declare the functions in the cairo DLL API on Windows @@ -216,6 +229,12 @@ libcairo_la_LIBADD = $(top_builddir)/pixman/src/libpixman.la $(CAIRO_LIBS) $(noi libcairo_la_DEPENDENCIES = $(cairo_def_dependency) $(top_builddir)/pixman/src/libpixman.la $(noinst_LTLIBRARIES) +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = cairo.pc $(backend_pkgconfigs) +DISTCLEANFILES = $(backend_pkgconfigs) +EXTRA_DIST = cairo-backend.pc.in + + cairo.def: $(cairo_win32_api_headers) (echo EXPORTS; \ cat $(cairo_win32_api_headers) | \ diff --git a/src/cairo-backend.pc.in b/src/cairo-backend.pc.in new file mode 100644 index 000000000..fa724ec17 --- /dev/null +++ b/src/cairo-backend.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: @backend_name@ +Description: @Backend_Name@ backend for cairo graphics library +Version: @VERSION@ + +Requires: cairo @BACKEND_REQUIRES@ +Libs: +Cflags: -I${includedir}/cairo |