[cairo-commit] configure.in src/cairo-backend.pc.in src/cairo.pc.in src/Makefile.am

Behdad Esfahbod behdad at kemper.freedesktop.org
Wed Jul 12 01:28:03 PDT 2006


 configure.in            |   56 +++++++++++++++++++++++++++++-------------------
 src/Makefile.am         |    2 -
 src/cairo-backend.pc.in |    2 -
 src/cairo.pc.in         |    5 ++--
 4 files changed, 39 insertions(+), 26 deletions(-)

New commits:
diff-tree f79a9f5a5259f33284d5e63ef2ddac0be4ea7d41 (from 973d3a3d1466830dcaa94e9fe39fa6fdf510fbbc)
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Wed Jul 12 04:27:55 2006 -0400

    Improve backend .pc files generation:
    - Add all non-pkgconfig libs to Libs.private in cairo.pc
    - Make cairo-xlib-xrender.pc Require cairo-xlib.pc

diff --git a/configure.in b/configure.in
index b249d8e..9e48511 100644
--- a/configure.in
+++ b/configure.in
@@ -122,6 +122,7 @@ AC_DEFUN([CAIRO_BACKEND_ENABLE],
 			    $1[]_LIBS=""
 			    $1[]_NONPKGCONFIG_CFLAGS=""
 			    $1[]_NONPKGCONFIG_LIBS=""
+			    $1[]_BASE=cairo
 			    $6
 			    cairo_cv_backend_[]$1[]_use=$use_[]$1
 			    cairo_cv_backend_[]$1[]_requires=$[]$1[]_REQUIRES
@@ -129,15 +130,25 @@ AC_DEFUN([CAIRO_BACKEND_ENABLE],
 			    cairo_cv_backend_[]$1[]_libs=$[]$1[]_LIBS
 			    cairo_cv_backend_[]$1[]_nonpkgconfig_cflags=$[]$1[]_NONPKGCONFIG_CFLAGS
 			    cairo_cv_backend_[]$1[]_nonpkgconfig_libs=$[]$1[]_NONPKGCONFIG_LIBS
+			    cairo_cv_backend_[]$1[]_base=$[]$1[]_BASE
 			    AC_MSG_CHECKING([whether cairo's $2 backend could be enabled])])
 
 	    # split the backend spec into its components
 	    use_[]$1=$cairo_cv_backend_[]$1[]_use
-	    $1[]_REQUIRES=$cairo_cv_backend_[]$1[]_requires
-	    $1[]_CFLAGS=$cairo_cv_backend_[]$1[]_cflags
-	    $1[]_LIBS=$cairo_cv_backend_[]$1[]_libs
-	    $1[]_NONPKGCONFIG_CFLAGS=$cairo_cv_backend_[]$1[]_nonpkgconfig_cflags
-	    $1[]_NONPKGCONFIG_LIBS=$cairo_cv_backend_[]$1[]_nonpkgconfig_libs
+	    $1[]_BASE=$cairo_cv_backend_[]$1[]_base
+
+	    $1[]_REQUIRES="$cairo_cv_backend_[]$1[]_requires "
+	    $1[]_CFLAGS="$cairo_cv_backend_[]$1[]_cflags "
+	    $1[]_LIBS="$cairo_cv_backend_[]$1[]_libs "
+	    $1[]_NONPKGCONFIG_CFLAGS="$cairo_cv_backend_[]$1[]_nonpkgconfig_cflags "
+	    $1[]_NONPKGCONFIG_LIBS="$cairo_cv_backend_[]$1[]_nonpkgconfig_libs "
+
+	    # null the ones that only have space
+	    test "x$$1[]_REQUIRES" = "x " && $1[]_REQUIRES=""
+	    test "x$$1[]_CFLAGS" = "x " && $1[]_CFLAGS=""
+	    test "x$$1[]_LIBS" = "x " && $1[]_LIBS=""
+	    test "x$$1[]_NONPKGCONFIG_CFLAGS" = "x " && $1[]_NONPKGCONFIG_CFLAGS=""
+	    test "x$$1[]_NONPKGCONFIG_LIBS" = "x " && $1[]_NONPKGCONFIG_LIBS=""
 
 	    case $enable_[]$1 in
 	      yes)
@@ -152,16 +163,19 @@ AC_DEFUN([CAIRO_BACKEND_ENABLE],
 		;;
 	    esac
 	    if test "x$use_[]$1" = xyes; then
-	      CAIRO_FEATURES="$CAIRO_FEATURES $4"
-	      CAIRO_REQUIRES="$CAIRO_REQUIRES $$1_REQUIRES"
-	      CAIRO_CFLAGS="$CAIRO_CFLAGS $$1_CFLAGS $$1_NONPKGCONFIG_CFLAGS"
-	      CAIRO_LIBS="$CAIRO_LIBS $$1_LIBS $$1_NONPKGCONFIG_LIBS"
+	      CAIRO_FEATURES="$4 $CAIRO_FEATURES"
+	      CAIRO_REQUIRES="$$1_REQUIRES$CAIRO_REQUIRES"
+	      CAIRO_CFLAGS="$$1_NONPKGCONFIG_CFLAGS$$1_CFLAGS$CAIRO_CFLAGS"
+	      CAIRO_LIBS="$$1_NONPKGCONFIG_LIBS$$1_LIBS$CAIRO_LIBS"
+	      CAIRO_NONPKGCONFIG_CFLAGS="$$1_NONPKGCONFIG_CFLAGS$CAIRO_NONPKGCONFIG_CFLAGS"
+	      CAIRO_NONPKGCONFIG_LIBS="$$1_NONPKGCONFIG_LIBS$CAIRO_NONPKGCONFIG_LIBS"
 	      outfile=`echo src/cairo-$1.pc | sed -e s/_/-/g`
 	      AC_MSG_NOTICE([creating $outfile])
 	      mkdir -p src
 	      AS_IF([sed \
 			-e "s, at backend_name@,$1,g" \
 			-e "s, at Backend_Name@,$2,g" \
+			-e "s, at BACKEND_BASE@,$$1_BASE,g" \
 			-e "s, at BACKEND_REQUIRES@,$$1_REQUIRES,g" \
 			-e "s%@BACKEND_NONPKGCONFIG_LIBS@%$$1_NONPKGCONFIG_LIBS%g" \
 			-e "s, at BACKEND_NONPKGCONFIG_CFLAGS@,$$1_NONPKGCONFIG_CFLAGS,g" \
@@ -181,8 +195,10 @@ AC_DEFUN([CAIRO_BACKEND_ENABLE],
 
 CAIRO_FEATURES=""
 CAIRO_REQUIRES=""
-CAIRO_CFLAGS=""
-CAIRO_LIBS="-lm"
+CAIRO_NONPKGCONFIG_CFLAGS=""
+CAIRO_NONPKGCONFIG_LIBS="-lm"
+CAIRO_CFLAGS=$CAIRO_NONPKGCONFIG_CFLAGS
+CAIRO_LIBS=$CAIRO_NONPKGCONFIG_LIBS
 
 dnl ===========================================================================
 
@@ -191,8 +207,8 @@ CAIRO_BACKEND_ENABLE(xlib, Xlib, xlib, X
   if test "x$no_x" = xyes; then
     use_xlib="no (requires Xlib)"
   else
-    xlib_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
-    xlib_CFLAGS=$X_CFLAGS
+    xlib_NONPKGCONFIG_LIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
+    xlib_NONPKGCONFIG_CFLAGS=$X_CFLAGS
   fi
 ])
 
@@ -204,14 +220,13 @@ CAIRO_BACKEND_ENABLE(xlib_xrender, Xlib 
   use_xlib_xrender=$use_xlib
   if test "x$use_xlib_xrender" = xyes; then
     dnl Check for Xrender header files if the Xrender package is not installed:
+    xlib_xrender_BASE=cairo-xlib
     xlib_xrender_REQUIRES="xrender >= 0.6"
     PKG_CHECK_MODULES(xlib_xrender, $xlib_xrender_REQUIRES, ,
 		      [xlib_xrender_REQUIRES=""
 		       AC_CHECK_HEADER(X11/extensions/Xrender.h,
 				       [xlib_xrender_LIBS="-lXrender"],
 				       [use_xlib_xrender="no (requires Xrender http://freedesktop.org/Software/xlibs)"])])
-    xlib_xrender_CFLAGS="$xlib_CFLAGS $xlib_xrender_CFLAGS"
-    xlib_xrender_LIBS="$xlib_LIBS $xlib_xrender_LIBS"
   fi
 ])
 
@@ -407,11 +422,6 @@ CAIRO_BACKEND_ENABLE(ft, FreeType font, 
 have_ft_load_sfnt_table=no
 
 if test "x$use_ft" = "xyes"; then
-  FREETYPE_CONFIG_CFLAGS=$cairo_cv_ft_config_CFLAGS
-  FREETYPE_CONFIG_LIBS=$cairo_cv_ft_config_LIBS
-  AC_SUBST(FREETYPE_CONFIG_CFLAGS)
-  AC_SUBST(FREETYPE_CONFIG_LIBS)
-
   temp_save_libs="$LIBS"
   temp_save_cflags="$CFLAGS"
   LIBS="$LIBS $ft_LIBS"
@@ -447,7 +457,7 @@ CAIRO_BACKEND_ENABLE(ps, PostScript, ps,
                  [AC_CHECK_HEADER(zlib.h, [],
 		 [use_ps="no (requires zlib http://www.gzip.org/zlib/)"])],
 		 [use_ps="no (requires zlib http://www.gzip.org/zlib/)"])
-    ps_LIBS=-lz
+    ps_NONPKGCONFIG_LIBS=-lz
   fi
 ])
 
@@ -462,7 +472,7 @@ CAIRO_BACKEND_ENABLE(pdf, PDF, pdf, PDF_
                  [AC_CHECK_HEADER(zlib.h, [],
 		 [use_ps="no (requires zlib http://www.gzip.org/zlib/)"])],
 		 [use_ps="no (requires zlib http://www.gzip.org/zlib/)"])
-    pdf_LIBS=-lz
+    pdf_NONPKGCONFIG_LIBS=-lz
   fi
 ])
 
@@ -533,6 +543,8 @@ AC_SUBST(WARN_CFLAGS)
 CAIRO_CFLAGS="$CAIRO_CFLAGS $WARN_CFLAGS"
 
 AC_SUBST(CAIRO_REQUIRES)
+AC_SUBST(CAIRO_NONPKGCONFIG_CFLAGS)
+AC_SUBST(CAIRO_NONPKGCONFIG_LIBS)
 AC_SUBST(CAIRO_CFLAGS)
 AC_SUBST(CAIRO_LIBS)
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 277f81e..f490607 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -230,7 +230,7 @@ pkgconfig_DATA = cairo.pc $(backend_pkgc
 DISTCLEANFILES = $(backend_pkgconfigs)
 EXTRA_DIST = cairo-backend.pc.in
 $(backend_pkgconfigs): $(top_srcdir)/configure
-	$(top_builddir)/config.status --recheck
+	cd $(top_builddir) && ./config.status --recheck
 
 $(top_builddir)/config.h: $(top_srcdir)/config.h.in
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) config.h
diff --git a/src/cairo-backend.pc.in b/src/cairo-backend.pc.in
index 3988ffd..8fc5157 100644
--- a/src/cairo-backend.pc.in
+++ b/src/cairo-backend.pc.in
@@ -7,6 +7,6 @@ Name: @backend_name@
 Description: @Backend_Name@ backend for cairo graphics library
 Version: @VERSION@
 
-Requires: cairo @BACKEND_REQUIRES@
+Requires: @BACKEND_BASE@ @BACKEND_REQUIRES@
 Libs: @BACKEND_NONPKGCONFIG_LIBS@
 Cflags: -I${includedir}/cairo @BACKEND_NONPKGCONFIG_CFLAGS@
diff --git a/src/cairo.pc.in b/src/cairo.pc.in
index c41c41f..b361edf 100644
--- a/src/cairo.pc.in
+++ b/src/cairo.pc.in
@@ -8,5 +8,6 @@ Description: Multi-platform 2D graphics 
 Version: @VERSION@
 
 @PKGCONFIG_REQUIRES@: @CAIRO_REQUIRES@
-Libs: @FREETYPE_CONFIG_LIBS@ -L${libdir} -lcairo 
-Cflags: @FREETYPE_CONFIG_CFLAGS@ -I${includedir}/cairo
+Libs: -L${libdir} -lcairo
+Libs.private: @CAIRO_NONPKGCONFIG_LIBS@
+Cflags: -I${includedir}/cairo


More information about the cairo-commit mailing list