[cairo-commit] 13 commits - acinclude.m4 build/configure.ac.enable configure.ac .gitignore

Behdad Esfahbod behdad at kemper.freedesktop.org
Sat Sep 6 14:58:58 PDT 2008


 .gitignore                |    2 
 acinclude.m4              |    1 
 build/configure.ac.enable |  694 +++++++++++++++++++++++++++++-----------------
 configure.ac              |    4 
 4 files changed, 444 insertions(+), 257 deletions(-)

New commits:
commit c881226afd03a95e9b94f497477315d69197c238
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Sep 6 17:26:51 2008 -0400

    [configure.ac.enable] Further break feature configuration hooks

diff --git a/build/configure.ac.enable b/build/configure.ac.enable
index 3df45cd..0bc5e93 100644
--- a/build/configure.ac.enable
+++ b/build/configure.ac.enable
@@ -238,6 +238,9 @@ dnl ===========================================================================
 dnl
 dnl Cairo-specific configuration facilities
 dnl
+dnl ===========================================================================
+
+
 
 dnl
 dnl Define macros to enable various features.
@@ -273,120 +276,43 @@ AC_DEFUN([CAIRO_ENABLE_FUNCTIONS],
 	[_CAIRO_ENABLE([$1],	[$2 functions],		functions,	[$3],[$4])])
 
 
-
-dnl ===========================================================================
 dnl
-dnl Hooks
+dnl Define cr_feature_tag ala other cr_feature_* macros
+dnl Expands to CAIRO_HAS_FEATURE_ID
 dnl
-
-m4_pattern_allow(^CAIRO_HAS_)
 m4_define([_CAIRO_BUILD_FEATURE_TAG_NORMALIZED],
 	[CAIRO_HAS_[$1]m4_bmatch([$1],[$2$],,[$2])])
-
 m4_define([_CAIRO_BUILD_FEATURE_TAG],
 	[_CAIRO_BUILD_FEATURE_TAG_NORMALIZED(AS_TR_CPP([$1]),AS_TR_CPP(m4_ifval([$2],[ $2])))])
-
 m4_define([cr_feature_tag],
 	[_CAIRO_BUILD_FEATURE_TAG(cr_feature,cr_feature_what)])
 
-CAIRO_FEATURE_HOOK_REGISTER(*,*,
-[
-
-	if test "x$use_$1" = xyes; then
-
-		CAIRO_FEATURE_VARS_FOREACH([cr_var], [[test -n "$]cr_feature[_]cr_var[" && CAIRO_]cr_var[="$]cr_feature[_]cr_var[ $CAIRO_]cr_var["]
-		])
-		CAIRO_FEATURES="cr_feature_tag $CAIRO_FEATURES"
-		m4_define([cairo_backend_pc], m4_bpatsubst(src/cairo-$1.pc,_,-))
-		AC_CONFIG_FILES(cairo_backend_pc():src/cairo-backend.pc.in,
-		[
-			$SED -i -e "
-			s, at backend_name@,$1,g;
-			s, at Backend_Name@,cr_feature_name,g;
-			s, at BACKEND_BASE@,$$1_BASE,g;
-			s, at BACKEND_REQUIRES@,$$1_REQUIRES,g;
-			s%@BACKEND_NONPKGCONFIG_LIBS@%$$1_NONPKGCONFIG_LIBS%g;
-			s, at BACKEND_NONPKGCONFIG_CFLAGS@,$$1_NONPKGCONFIG_CFLAGS,g;
-			" "]cairo_backend_pc()[" ||
-			AC_MSG_ERROR(failed to update ]cairo_backend_pc()[)
-		],[
-			SED='$SED'
-			$1_BASE='$$1_BASE'
-			$1_REQUIRES='$$1_REQUIRES'
-			$1_NONPKGCONFIG_LIBS='$$1_NONPKGCONFIG_LIBS'
-			$1_NONPKGCONFIG_CFLAGS='$$1_NONPKGCONFIG_CFLAGS'
-		])
-	fi
+dnl Allow feature tags in the output
+m4_pattern_allow(^CAIRO_HAS_)
 
-	AM_CONDITIONAL(cr_feature_tag, test "x$use_$1" = xyes)
-
-	dnl Collect list of all supported but disabled features
-	AS_IF([test "x$use_$1" != xyes -a "x]cr_feature_default[" != xno],
-	[
-		CAIRO_NO_FEATURES="cr_feature_tag $CAIRO_NO_FEATURES"
-	])
-
-	dnl Collect list of all (un)supported features and cairo headers
-	AS_IF([test "x]cr_feature_default[" = xno],
-	[
-		CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
-unsupported_cairo_headers += $(cairo_$1_headers)'
-		CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
-unsupported_cairo_headers += $(cairo_$1_headers)'
-	],[
-		CAIRO_SUPPORTED_FEATURES="cr_feature_tag $CAIRO_SUPPORTED_FEATURES"
-		CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
-supported_cairo_headers += $(cairo_$1_headers)'
-		CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
-supported_cairo_headers += $(cairo_$1_headers)'
-	  ])
-
-	dnl Collect list of all/enabled cairo source files
-	CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
-all_cairo_pkgconf += $(cairo_$1_pkgconf)
-all_cairo_headers += $(cairo_$1_headers)
-all_cairo_private += $(cairo_$1_private)
-all_cairo_sources += $(cairo_$1_sources)
-if cr_feature_tag
-enabled_cairo_pkgconf += $(cairo_$1_pkgconf)
-enabled_cairo_headers += $(cairo_$1_headers)
-enabled_cairo_private += $(cairo_$1_private)
-enabled_cairo_sources += $(cairo_$1_sources)
-endif
-'
-	CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
-all_cairo_pkgconf += $(cairo_$1_pkgconf)
-all_cairo_headers += $(cairo_$1_headers)
-all_cairo_private += $(cairo_$1_private)
-all_cairo_sources += $(cairo_$1_sources)
-ifeq ($(cr_feature_tag),1)
-enabled_cairo_pkgconf += $(cairo_$1_pkgconf)
-enabled_cairo_headers += $(cairo_$1_headers)
-enabled_cairo_private += $(cairo_$1_private)
-enabled_cairo_sources += $(cairo_$1_sources)
-endif
-'
-])
 
 
 dnl ===========================================================================
 dnl
-dnl All .pc files are generated automatically except for this one
+dnl Hooks
 dnl
-AC_CONFIG_FILES([src/cairo.pc])
+dnl ===========================================================================
 
 
 dnl ===========================================================================
 dnl
-dnl pkg-config requires, non-pkgconfig cflags and libs, and total cflags and libs
+dnl Automake conditionals for all features
 dnl
+CAIRO_FEATURE_HOOK_REGISTER(*,*,
+[
+	AM_CONDITIONAL(cr_feature_tag, test "x$use_$1" = xyes)
+])
 
-dnl Accumulators
-CAIRO_FEATURE_VARS_REGISTER([REQUIRES BASE])
-CAIRO_FEATURE_VARS_REGISTER([CFLAGS NONPKGCONFIG_CFLAGS])
-CAIRO_FEATURE_VARS_REGISTER([LIBS NONPKGCONFIG_LIBS], [$LIBS])
 
+dnl ===========================================================================
+dnl
 dnl Substitute vars
+dnl
 AC_SUBST(CAIRO_REQUIRES)
 AC_SUBST(CAIRO_BASE)
 AC_SUBST(CAIRO_CFLAGS)
@@ -397,6 +323,21 @@ AC_SUBST(CAIRO_NONPKGCONFIG_LIBS)
 
 dnl ===========================================================================
 dnl
+dnl Accumulate values for all feature vars
+dnl
+
+CAIRO_FEATURE_HOOK_REGISTER(*,*,
+[
+	CAIRO_FEATURE_IF_ENABLED($1,
+	[
+		CAIRO_FEATURE_VARS_FOREACH([cr_var], [[test -n "$]cr_feature[_]cr_var[" && CAIRO_]cr_var[="$]cr_feature[_]cr_var[ $CAIRO_]cr_var["]
+		])
+	])
+])
+
+
+dnl ===========================================================================
+dnl
 dnl Generate {src,boilerplate}/Makefile.{am,win32}.config
 dnl
 
@@ -428,12 +369,117 @@ CAIRO_CONFIG_COMMANDS([$srcdir/src/Makefile.win32.config],
 		      [echo "$CAIRO_CONFIG_WIN32"],
 		      [CAIRO_CONFIG_WIN32='$CAIRO_CONFIG_WIN32'])
 
+dnl Collect list of all supported cairo headers
+CAIRO_FEATURE_HOOK_REGISTER(!no,*,
+[
+	CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'm4_newline()supported_cairo_headers += $(cairo_$1_headers)'
+	CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'm4_newline()supported_cairo_headers += $(cairo_$1_headers)'
+])
+
+dnl Collect list of all unsupported cairo headers
+CAIRO_FEATURE_HOOK_REGISTER(no,*,
+[
+	CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'm4_newline()unsupported_cairo_headers += $(cairo_$1_headers)'
+	CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'm4_newline()unsupported_cairo_headers += $(cairo_$1_headers)'
+])
+
+dnl Collect list of all/enabled cairo source files
+CAIRO_FEATURE_HOOK_REGISTER(*,*,
+[
+	CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
+all_cairo_pkgconf += $(cairo_$1_pkgconf)
+all_cairo_headers += $(cairo_$1_headers)
+all_cairo_private += $(cairo_$1_private)
+all_cairo_sources += $(cairo_$1_sources)
+if cr_feature_tag
+enabled_cairo_pkgconf += $(cairo_$1_pkgconf)
+enabled_cairo_headers += $(cairo_$1_headers)
+enabled_cairo_private += $(cairo_$1_private)
+enabled_cairo_sources += $(cairo_$1_sources)
+endif
+'
+	CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
+all_cairo_pkgconf += $(cairo_$1_pkgconf)
+all_cairo_headers += $(cairo_$1_headers)
+all_cairo_private += $(cairo_$1_private)
+all_cairo_sources += $(cairo_$1_sources)
+ifeq ($(cr_feature_tag),1)
+enabled_cairo_pkgconf += $(cairo_$1_pkgconf)
+enabled_cairo_headers += $(cairo_$1_headers)
+enabled_cairo_private += $(cairo_$1_private)
+enabled_cairo_sources += $(cairo_$1_sources)
+endif
+'
+])
+
+
+dnl ===========================================================================
+dnl
+dnl Generate .pc files
+dnl
+
+dnl All .pc files are generated automatically except for this one
+AC_CONFIG_FILES([src/cairo.pc])
+
+dnl pkg-config requires, non-pkgconfig cflags and libs, and total cflags and libs
+CAIRO_FEATURE_VARS_REGISTER([REQUIRES BASE])
+CAIRO_FEATURE_VARS_REGISTER([CFLAGS NONPKGCONFIG_CFLAGS])
+CAIRO_FEATURE_VARS_REGISTER([LIBS NONPKGCONFIG_LIBS], [$LIBS])
+
+dnl Generate .pc files for enabled features
+CAIRO_FEATURE_HOOK_REGISTER(*,*,
+[
+	CAIRO_FEATURE_IF_ENABLED($1,
+	[
+		m4_define([cairo_backend_pc], m4_bpatsubst(src/cairo-$1.pc,_,-))
+		AC_CONFIG_FILES(cairo_backend_pc():src/cairo-backend.pc.in,
+		[
+			$SED -i -e "
+			s, at backend_name@,$1,g;
+			s, at Backend_Name@,cr_feature_name,g;
+			s, at BACKEND_BASE@,$$1_BASE,g;
+			s, at BACKEND_REQUIRES@,$$1_REQUIRES,g;
+			s%@BACKEND_NONPKGCONFIG_LIBS@%$$1_NONPKGCONFIG_LIBS%g;
+			s, at BACKEND_NONPKGCONFIG_CFLAGS@,$$1_NONPKGCONFIG_CFLAGS,g;
+			" "]cairo_backend_pc()[" ||
+			AC_MSG_ERROR(failed to update ]cairo_backend_pc()[)
+		],[
+			SED='$SED'
+			$1_BASE='$$1_BASE'
+			$1_REQUIRES='$$1_REQUIRES'
+			$1_NONPKGCONFIG_LIBS='$$1_NONPKGCONFIG_LIBS'
+			$1_NONPKGCONFIG_CFLAGS='$$1_NONPKGCONFIG_CFLAGS'
+		])
+	])
+])
+
 
 dnl ===========================================================================
 dnl
-dnl List of enabled, supported but disabled, and all supported features
+dnl Generate src/cairo-features.h src/cairo-supported-features.h
 dnl
 
+dnl Collect list of enabled features
+CAIRO_FEATURE_HOOK_REGISTER(*,*,
+[
+	CAIRO_FEATURE_IF_ENABLED($1,
+	[
+		CAIRO_FEATURES="cr_feature_tag $CAIRO_FEATURES"
+	])
+])
+CAIRO_FEATURE_HOOK_REGISTER(!no,*,
+[
+	dnl Collect list of all supported features
+	CAIRO_SUPPORTED_FEATURES="cr_feature_tag $CAIRO_SUPPORTED_FEATURES"
+
+	dnl Collect list of all supported but disabled features
+	CAIRO_FEATURE_IF_ENABLED($1,[],
+	[
+		CAIRO_NO_FEATURES="cr_feature_tag $CAIRO_NO_FEATURES"
+	])
+
+])
+
 dnl Accumulators
 m4_pattern_allow(^CAIRO_FEATURES$)
 CAIRO_FEATURES=""
@@ -564,4 +610,3 @@ AC_DEFUN([CAIRO_REPORT],
 	echo "$CAIRO_WARNING_MESSAGE"
 ])
 
-
commit 31b09965b7c6210e5602167e260fa21b4c310bd1
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Sep 6 16:59:41 2008 -0400

    [configure.ac.enable] Move macros around

diff --git a/build/configure.ac.enable b/build/configure.ac.enable
index 1dd5aeb..3df45cd 100644
--- a/build/configure.ac.enable
+++ b/build/configure.ac.enable
@@ -133,40 +133,6 @@ AC_DEFUN([_CAIRO_ENABLE],
 	_CAIRO_FEATURE_HOOKS(cr_feature, cr_feature_name, cr_feature_default, cr_feature_what)
 ])
 
-dnl
-dnl Define macros to enable various features.
-dnl  - Macro: CAIRO_ENABLE_* (ID, NAME, DEFAULT, COMMANDS)
-dnl
-dnl where:
-dnl
-dnl	ID is the feature id, eg. "ft" for cairo_ft_...
-dnl	NAME is the human-readable name of the feature, eg. "FreeType"
-dnl	DEFAULT is the default state of the feature:
-dnl		"no" for experimental backends, eg. your favorite new backend
-dnl		"yes" for mandatory backends, eg. png
-dnl		"auto" for other supported backends, eg. xlib
-dnl	COMMANDS are run to check whether the feature can be enabled.  Their
-dnl		result may be cached, so user should not count on them being run.
-dnl		They should set use_$(ID) to something other than yes if the
-dnl		feature cannot be built, eg. "no (requires SomeThing)".  It then
-dnl		should also set $(ID)_REQUIRES/CFLAGS/LIBS/...
-dnl		appropriately.  Look at the macro definition for more details,
-dnl		or ask if in doubt.
-dnl
-
-AC_DEFUN([CAIRO_ENABLE],
-	[_CAIRO_ENABLE([$1],	[$2],			,		[$3],[$4])])
-
-AC_DEFUN([CAIRO_ENABLE_SURFACE_BACKEND],
-	[_CAIRO_ENABLE([$1],	[$2 surface backend],	surface,	[$3],[$4])])
-
-AC_DEFUN([CAIRO_ENABLE_FONT_BACKEND],
-	[_CAIRO_ENABLE([$1],	[$2 font backend],	font,	  	[$3],[$4])])
-
-AC_DEFUN([CAIRO_ENABLE_FUNCTIONS],
-	[_CAIRO_ENABLE([$1],	[$2 functions],		functions,	[$3],[$4])])
-
-
 
 dnl ===========================================================================
 
@@ -198,6 +164,7 @@ AC_DEFUN([CAIRO_FEATURE_VARS_FOREACH],
 	m4_foreach_w([$1], m4_expand(CAIRO_FEATURE_VARS), [$2])
 ])
 
+
 dnl ===========================================================================
 
 AC_DEFUN([CAIRO_FEATURE_IF_ENABLED],
@@ -266,6 +233,47 @@ AC_DEFUN([CAIRO_FEATURE_HOOK_REGISTER],
 ])
 
 
+
+dnl ===========================================================================
+dnl
+dnl Cairo-specific configuration facilities
+dnl
+
+dnl
+dnl Define macros to enable various features.
+dnl  - Macro: CAIRO_ENABLE_* (ID, NAME, DEFAULT, COMMANDS)
+dnl
+dnl where:
+dnl
+dnl	ID is the feature id, eg. "ft" for cairo_ft_...
+dnl	NAME is the human-readable name of the feature, eg. "FreeType"
+dnl	DEFAULT is the default state of the feature:
+dnl		"no" for experimental backends, eg. your favorite new backend
+dnl		"yes" for mandatory backends, eg. png
+dnl		"auto" for other supported backends, eg. xlib
+dnl	COMMANDS are run to check whether the feature can be enabled.  Their
+dnl		result may be cached, so user should not count on them being run.
+dnl		They should set use_$(ID) to something other than yes if the
+dnl		feature cannot be built, eg. "no (requires SomeThing)".  It then
+dnl		should also set $(ID)_REQUIRES/CFLAGS/LIBS/...
+dnl		appropriately.  Look at the macro definition for more details,
+dnl		or ask if in doubt.
+dnl
+
+AC_DEFUN([CAIRO_ENABLE],
+	[_CAIRO_ENABLE([$1],	[$2],			,		[$3],[$4])])
+
+AC_DEFUN([CAIRO_ENABLE_SURFACE_BACKEND],
+	[_CAIRO_ENABLE([$1],	[$2 surface backend],	surface,	[$3],[$4])])
+
+AC_DEFUN([CAIRO_ENABLE_FONT_BACKEND],
+	[_CAIRO_ENABLE([$1],	[$2 font backend],	font,	  	[$3],[$4])])
+
+AC_DEFUN([CAIRO_ENABLE_FUNCTIONS],
+	[_CAIRO_ENABLE([$1],	[$2 functions],		functions,	[$3],[$4])])
+
+
+
 dnl ===========================================================================
 dnl
 dnl Hooks
@@ -363,91 +371,6 @@ endif
 
 dnl ===========================================================================
 dnl
-dnl Report
-dnl
-
-dnl Accumulator for warning messages
-CAIRO_FEATURE_VARS_REGISTER([WARNING_MESSAGE])
-
-dnl Collect warning message for enabled unsupported backends
-CAIRO_FEATURE_HOOK_REGISTER(no,*,
-[
-	CAIRO_FEATURE_IF_ENABLED($1,
-	[
-		CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE]m4_newline[m4_text_wrap([The ]cr_feature_name[ feature is still under active development and is included in this release only as a preview. It does NOT fully work yet and incompatible changes may yet be made to ]cr_feature_name[ specific API.], [--- ],, 78)
-"
-	])
-])
-
-dnl Collect warning message for disabled recommended backends
-CAIRO_FEATURE_HOOK_REGISTER(yes,*,
-[
-	CAIRO_FEATURE_IF_ENABLED($1,
-	[],[
-		CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE]m4_newline[m4_text_wrap([It is strictly recommended that you do NOT disable the ]cr_feature_name[ backend.], [+++ ],, 78)
-"
-	])
-])
-
-
-AC_DEFUN([CAIRO_REPORT],
-[
-	V="$CAIRO_VERSION_MAJOR.$CAIRO_VERSION_MINOR.$CAIRO_VERSION_MICRO"
-	echo ""
-	echo "cairo (version $V [[$CAIRO_RELEASE_STATUS]]) will be compiled with the following surface backends:"
-	echo "  Image:         yes (always builtin)"
-	echo "  Xlib:          $use_xlib"
-	echo "  Xlib Xrender:  $use_xlib_xrender"
-	echo "  Quartz:        $use_quartz"
-	echo "  Quartz-image:  $use_quartz_image"
-	echo "  XCB:           $use_xcb"
-	echo "  Win32:         $use_win32"
-	echo "  OS2:           $use_os2"
-	echo "  PostScript:    $use_ps"
-	echo "  PDF:           $use_pdf"
-	echo "  SVG:           $use_svg"
-	echo "  glitz:         $use_glitz"
-	echo "  BeOS:          $use_beos"
-	echo "  DirectFB:      $use_directfb"
-	echo ""
-	echo "the following font backends:"
-	echo "  User:          yes (always builtin)"
-	echo "  FreeType:      $use_ft"
-	echo "  Win32:         $use_win32_font"
-	echo "  Quartz:        $use_quartz_font"
-	echo ""
-	echo "the following features:"
-	echo "  PNG functions: $use_png"
-	echo ""
-	echo "and the following debug options:"
-	echo "  gcov support:  $use_gcov"
-	echo "  test surfaces: $use_test_surfaces"
-	echo "  ps testing:    $test_ps"
-	echo "  pdf testing:   $test_pdf"
-	echo "  svg testing:   $test_svg"
-	if test x"$use_win32" = "xyes"; then
-		echo "  win32 printing testing:    $test_win32_printing"
-	fi
-	echo ""
-	echo "using CFLAGS:"
-	echo $CAIRO_CFLAGS
-	echo ""
-
-	if test x"$use_ft"          != "xyes" && \
-	   test x"$use_win32_font"  != "xyes" && \
-	   test x"$use_quartz_font" != "xyes" ; then
-
-	   AC_MSG_ERROR([Cairo requires at least one font backend.
-			  Please install freetype and fontconfig, then try again:
-			  http://freetype.org/	http://fontconfig.org/
-			])
-	fi
-	echo "$CAIRO_WARNING_MESSAGE"
-])
-
-
-dnl ===========================================================================
-dnl
 dnl All .pc files are generated automatically except for this one
 dnl
 AC_CONFIG_FILES([src/cairo.pc])
@@ -556,3 +479,89 @@ CAIRO_CONFIG_COMMANDS([$srcdir/src/cairo-supported-features.h],
 	CAIRO_SUPPORTED_FEATURES='$CAIRO_SUPPORTED_FEATURES'
 ])
 
+
+dnl ===========================================================================
+dnl
+dnl Report
+dnl
+
+dnl Accumulator for warning messages
+CAIRO_FEATURE_VARS_REGISTER([WARNING_MESSAGE])
+
+dnl Collect warning message for enabled unsupported backends
+CAIRO_FEATURE_HOOK_REGISTER(no,*,
+[
+	CAIRO_FEATURE_IF_ENABLED($1,
+	[
+		CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE]m4_newline[m4_text_wrap([The ]cr_feature_name[ feature is still under active development and is included in this release only as a preview. It does NOT fully work yet and incompatible changes may yet be made to ]cr_feature_name[ specific API.], [--- ],, 78)
+"
+	])
+])
+
+dnl Collect warning message for disabled recommended backends
+CAIRO_FEATURE_HOOK_REGISTER(yes,*,
+[
+	CAIRO_FEATURE_IF_ENABLED($1,
+	[],[
+		CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE]m4_newline[m4_text_wrap([It is strictly recommended that you do NOT disable the ]cr_feature_name[ backend.], [+++ ],, 78)
+"
+	])
+])
+
+
+AC_DEFUN([CAIRO_REPORT],
+[
+	V="$CAIRO_VERSION_MAJOR.$CAIRO_VERSION_MINOR.$CAIRO_VERSION_MICRO"
+	echo ""
+	echo "cairo (version $V [[$CAIRO_RELEASE_STATUS]]) will be compiled with the following surface backends:"
+	echo "  Image:         yes (always builtin)"
+	echo "  Xlib:          $use_xlib"
+	echo "  Xlib Xrender:  $use_xlib_xrender"
+	echo "  Quartz:        $use_quartz"
+	echo "  Quartz-image:  $use_quartz_image"
+	echo "  XCB:           $use_xcb"
+	echo "  Win32:         $use_win32"
+	echo "  OS2:           $use_os2"
+	echo "  PostScript:    $use_ps"
+	echo "  PDF:           $use_pdf"
+	echo "  SVG:           $use_svg"
+	echo "  glitz:         $use_glitz"
+	echo "  BeOS:          $use_beos"
+	echo "  DirectFB:      $use_directfb"
+	echo ""
+	echo "the following font backends:"
+	echo "  User:          yes (always builtin)"
+	echo "  FreeType:      $use_ft"
+	echo "  Win32:         $use_win32_font"
+	echo "  Quartz:        $use_quartz_font"
+	echo ""
+	echo "the following features:"
+	echo "  PNG functions: $use_png"
+	echo ""
+	echo "and the following debug options:"
+	echo "  gcov support:  $use_gcov"
+	echo "  test surfaces: $use_test_surfaces"
+	echo "  ps testing:    $test_ps"
+	echo "  pdf testing:   $test_pdf"
+	echo "  svg testing:   $test_svg"
+	if test x"$use_win32" = "xyes"; then
+		echo "  win32 printing testing:    $test_win32_printing"
+	fi
+	echo ""
+	echo "using CFLAGS:"
+	echo $CAIRO_CFLAGS
+	echo ""
+
+	if test x"$use_ft"          != "xyes" && \
+	   test x"$use_win32_font"  != "xyes" && \
+	   test x"$use_quartz_font" != "xyes" ; then
+
+	   AC_MSG_ERROR([Cairo requires at least one font backend.
+			  Please install freetype and fontconfig, then try again:
+			  http://freetype.org/	http://fontconfig.org/
+			])
+	fi
+	echo "$CAIRO_WARNING_MESSAGE"
+])
+
+
commit e19103e38d0a23e3d49c8a63945b80069e2d949b
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Sep 6 16:34:18 2008 -0400

    [configure.ac.enable] Redo cache invalidation to be automatic

diff --git a/build/configure.ac.enable b/build/configure.ac.enable
index fc00044..1dd5aeb 100644
--- a/build/configure.ac.enable
+++ b/build/configure.ac.enable
@@ -8,14 +8,6 @@ dnl
 dnl ===========================================================================
 
 dnl
-dnl cairo_cache_version should be increased every time that the feature
-dnl detection stuff changes in a way that removing the config.cache file may be
-dnl needed for correct operation. (this is only for the feature detection
-dnl changes;  it doesn't have any effect on any other cached thing.)
-dnl
-m4_define(cairo_cache_version, 5)
-
-dnl
 dnl Define a macro to enable features
 dnl  - Macro: _CAIRO_ENABLE (ID, NAME, WHAT, DEFAULT, COMMANDS)
 dnl
@@ -54,6 +46,7 @@ AC_DEFUN([_CAIRO_ENABLE],
 	m4_define([cr_feature_what], m4_normalize(m4_expand([$3])))
 	m4_define([cr_feature_default], m4_normalize(m4_expand([$4])))
 	m4_define([cr_feature_commands], [$5])
+	m4_define([cr_feature_commands_len], m4_len([$5]))
 
 	m4_define([cr_feature_arg], m4_translit([$1],[_],[-]))
 
@@ -66,10 +59,39 @@ AC_DEFUN([_CAIRO_ENABLE],
 		use_$1="no (disabled, use --enable-cr_feature_arg to enable)"
 	;;
 	yes|auto)
-		if test "x$cairo_cv_[]$1[]_cache_version" != "x[]cairo_cache_version"; then
-			# cached results for this feature (if any) are stale.  force rechecking.
-			unset cairo_cv_[]$1[]_use
-		fi
+		dnl Cache invalidating:
+		dnl
+		dnl To be extremely user-friendly, we discard cache results if
+		dnl any of the following conditions happens:
+		dnl
+		dnl   - Set of cached variables changes
+		dnl     (XXX should also do if the default value of such
+		dnl     variables changes.  Argh...)
+		dnl
+		dnl   - Length of the COMMANDS string changes!
+		dnl     (This is much more friendly to the cache than caching
+		dnl     the commands string itself.  Note that this still does
+		dnl     not catch all valid cases where we should be
+		dnl     invalidting.  For example if COMMANDS uses
+		dnl     variables/macros defined outside, we don't detect changes
+		dnl     in those variables.  Also doesn't detect in-place
+		dnl     modifications like bumping verson numbers.
+		dnl     Just modify COMMANDS in an obvious way to force recheck.
+		dnl     Hashing sounds a bit too harsh to do here...)
+		dnl
+		dnl  - If feature is requested and cached results for enabling
+		dnl    feature is no.  We are going to terminate with an error
+		dnl    if this happens anyway, so we can be more friendly by
+		dnl    assuming that user installed some missing pieces since
+		dnl    last time and so we recheck.  Although even in that
+		dnl    case other cached values probably get in the way...
+		dnl
+		AS_IF([test "x$cairo_cv_[]$1[]_cache_commands_len" != "x[]cr_feature_commands_len" -o \
+			    "x$cairo_cv_[]$1[]_cache_vars" != "x[]CAIRO_FEATURE_VARS"],
+		      [unset cairo_cv_[]$1[]_use])
+		AS_IF([test "x$enable_$1" = xyes -a "x$cairo_cv_[]$1[]_use" != xyes],
+		      [unset cairo_cv_[]$1[]_use])
+
 		AC_CACHE_CHECK([for cairo's ]cr_feature_name[ feature], cairo_cv_[]$1[]_use,
 		[
 			echo
@@ -78,7 +100,8 @@ AC_DEFUN([_CAIRO_ENABLE],
 			])
 			cr_feature_commands
 			cairo_cv_[]$1[]_use=$use_[]$1
-			cairo_cv_[]$1[]_cache_version=cairo_cache_version
+			cairo_cv_[]$1[]_cache_vars="CAIRO_FEATURE_VARS"
+			cairo_cv_[]$1[]_cache_commands_len="cr_feature_commands_len"
 			CAIRO_FEATURE_VARS_FOREACH([cr_var], [[cairo_cv_]cr_feature[_]cr_var[=$]cr_feature[_]cr_var
 			])
 			AC_MSG_CHECKING([whether cairo's ]cr_feature_name[ feature could be enabled])
commit d520d5432bb94eb664652b09322cd254987bde6c
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Sep 6 15:54:23 2008 -0400

    [configure.ac.enable] Simplify _CAIRO_ENABLE_FULL

diff --git a/build/configure.ac.enable b/build/configure.ac.enable
index dd3d8c7..fc00044 100644
--- a/build/configure.ac.enable
+++ b/build/configure.ac.enable
@@ -17,14 +17,12 @@ m4_define(cairo_cache_version, 5)
 
 dnl
 dnl Define a macro to enable features
-dnl  - Macro: _CAIRO_ENABLE_FULL (ID, NAME, ARG, TAG, WHAT, DEFAULT, COMMANDS)
+dnl  - Macro: _CAIRO_ENABLE (ID, NAME, WHAT, DEFAULT, COMMANDS)
 dnl
 dnl where:
 dnl
 dnl	ID is the sub-namespace in function names, eg. "ft" for cairo_ft_...
 dnl	NAME is the human-readable name of the feature, eg. "FreeType font"
-dnl	ARG is what enables the feature, eg. "ft" for --enable-ft
-dnl	TAG is the feature conditional, eg. CAIRO_HAS_FT_FONT
 dnl	WHAT is the type of feature:
 dnl		"surface" for surface backends
 dnl		"font" for font backends
@@ -42,15 +40,22 @@ dnl		should also set $(ID)_REQUIRES/CFLAGS/LIBS/...
 dnl		appropriately.  Look at the macro definition for more details,
 dnl		or ask if in doubt.
 dnl
-AC_DEFUN([_CAIRO_ENABLE_FULL],
+AC_DEFUN([_CAIRO_ENABLE],
 [
+	dnl Sanity check ID
+	m4_if(
+		[$1],
+		m4_tolower(AS_TR_SH([$1])),
+		,
+		[m4_fatal([invalid feature name `$1'])]
+	)
 	m4_define([cr_feature], [$1])
-	m4_define([cr_feature_name], m4_expand([$2]))
-	m4_define([cr_feature_arg], m4_expand([$3]))
-	m4_define([cr_feature_tag], m4_expand([$4]))
-	m4_define([cr_feature_what], m4_expand([$5]))
-	m4_define([cr_feature_default], m4_expand([$6]))
-	m4_define([cr_feature_commands], [$7])
+	m4_define([cr_feature_name], m4_normalize(m4_expand([$2])))
+	m4_define([cr_feature_what], m4_normalize(m4_expand([$3])))
+	m4_define([cr_feature_default], m4_normalize(m4_expand([$4])))
+	m4_define([cr_feature_commands], [$5])
+
+	m4_define([cr_feature_arg], m4_translit([$1],[_],[-]))
 
 	AC_ARG_ENABLE(cr_feature_arg,
 		      AS_HELP_STRING([--enable-]cr_feature_arg[=@<:@no/auto/yes@:>@],
@@ -105,33 +110,6 @@ AC_DEFUN([_CAIRO_ENABLE_FULL],
 	_CAIRO_FEATURE_HOOKS(cr_feature, cr_feature_name, cr_feature_default, cr_feature_what)
 ])
 
-m4_pattern_allow(^CAIRO_HAS_)
-m4_define([_CAIRO_BUILD_FEATURE_TAG_NORMALIZED],
-	[CAIRO_HAS_[$1]m4_bmatch([$1],[$2$],,[$2])])
-
-m4_define([_CAIRO_BUILD_FEATURE_TAG],
-	[_CAIRO_BUILD_FEATURE_TAG_NORMALIZED(AS_TR_CPP([$1]),AS_TR_CPP(m4_ifval([$2],[ $2])))])
-
-dnl Like _CAIRO_ENABLE*, but takes an object type too
-AC_DEFUN([_CAIRO_ENABLE],
-[
-	m4_if(
-		[$1],
-		m4_tolower(AS_TR_SH([$1])),
-		,
-		[m4_fatal([invalid feature name `$1'])]
-	)
-	_CAIRO_ENABLE_FULL(
-		[$1],
-		m4_normalize([$2]),
-		m4_translit([$1],[_],[-]),
-		_CAIRO_BUILD_FEATURE_TAG([$1],m4_normalize([$3])),
-		m4_normalize([$3]),
-		m4_normalize([$4]),
-		[$5]
-	)dnl
-])
-
 dnl
 dnl Define macros to enable various features.
 dnl  - Macro: CAIRO_ENABLE_* (ID, NAME, DEFAULT, COMMANDS)
@@ -270,6 +248,15 @@ dnl
 dnl Hooks
 dnl
 
+m4_pattern_allow(^CAIRO_HAS_)
+m4_define([_CAIRO_BUILD_FEATURE_TAG_NORMALIZED],
+	[CAIRO_HAS_[$1]m4_bmatch([$1],[$2$],,[$2])])
+
+m4_define([_CAIRO_BUILD_FEATURE_TAG],
+	[_CAIRO_BUILD_FEATURE_TAG_NORMALIZED(AS_TR_CPP([$1]),AS_TR_CPP(m4_ifval([$2],[ $2])))])
+
+m4_define([cr_feature_tag],
+	[_CAIRO_BUILD_FEATURE_TAG(cr_feature,cr_feature_what)])
 
 CAIRO_FEATURE_HOOK_REGISTER(*,*,
 [
commit ee97873e0dad3ac60f6c39fb46bb5a7bb7480ae7
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Sep 6 15:34:29 2008 -0400

    [configure.ac.bulid] Break feature config into smaller hooks

diff --git a/build/configure.ac.enable b/build/configure.ac.enable
index da65821..dd3d8c7 100644
--- a/build/configure.ac.enable
+++ b/build/configure.ac.enable
@@ -348,24 +348,9 @@ enabled_cairo_private += $(cairo_$1_private)
 enabled_cairo_sources += $(cairo_$1_sources)
 endif
 '
-	dnl Collect warning message for enabled unsupported backends
-	AS_IF([test "x$use_$1" = xyes -a "x]cr_feature_default[" = xno],
-	[
-		CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE
-m4_text_wrap([The ]cr_feature_name[ feature is still under active development and is included in this release only as a preview. It does NOT fully work yet and incompatible changes may yet be made to ]cr_feature_name[ specific API.], [--- ],, 72)
-"
-	])
-
-	dnl Collect warning message for disabled recommended backends
-	AS_IF([test "x$use_$1" != xyes -a "x]cr_feature_default[" = xyes],
-	[
-		CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE
-m4_text_wrap([It is strictly recommended that you do NOT disable the ]cr_feature_name[ backend.], [+++ ],, 72)
-"
-	])
-
 ])
 
+
 dnl ===========================================================================
 dnl
 dnl Report
@@ -374,6 +359,27 @@ dnl
 dnl Accumulator for warning messages
 CAIRO_FEATURE_VARS_REGISTER([WARNING_MESSAGE])
 
+dnl Collect warning message for enabled unsupported backends
+CAIRO_FEATURE_HOOK_REGISTER(no,*,
+[
+	CAIRO_FEATURE_IF_ENABLED($1,
+	[
+		CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE]m4_newline[m4_text_wrap([The ]cr_feature_name[ feature is still under active development and is included in this release only as a preview. It does NOT fully work yet and incompatible changes may yet be made to ]cr_feature_name[ specific API.], [--- ],, 78)
+"
+	])
+])
+
+dnl Collect warning message for disabled recommended backends
+CAIRO_FEATURE_HOOK_REGISTER(yes,*,
+[
+	CAIRO_FEATURE_IF_ENABLED($1,
+	[],[
+		CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE]m4_newline[m4_text_wrap([It is strictly recommended that you do NOT disable the ]cr_feature_name[ backend.], [+++ ],, 78)
+"
+	])
+])
+
+
 AC_DEFUN([CAIRO_REPORT],
 [
 	V="$CAIRO_VERSION_MAJOR.$CAIRO_VERSION_MINOR.$CAIRO_VERSION_MICRO"
commit 3ed9787f4358048965bbc35acf958a75a95261dd
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Sep 6 15:27:24 2008 -0400

    [configure.ac.enable] Add CAIRO_FEATURE_IF_ENABLED

diff --git a/build/configure.ac.enable b/build/configure.ac.enable
index c6251ce..da65821 100644
--- a/build/configure.ac.enable
+++ b/build/configure.ac.enable
@@ -199,6 +199,11 @@ AC_DEFUN([CAIRO_FEATURE_VARS_FOREACH],
 
 dnl ===========================================================================
 
+AC_DEFUN([CAIRO_FEATURE_IF_ENABLED],
+[
+	AS_IF([test "x$use_]m4_default([$1], cr_feature)[" = xyes], [$2], [$3])
+])
+
 m4_define([_CAIRO_FEATURE_HOOK_MATCH],
 [
 	m4_case([$1],
@@ -240,12 +245,13 @@ dnl		"functions" for set of functions
 dnl		"" for private configurations
 dnl
 dnl These four values are also set as $1 to $4.  To know if feature was
-dnl enabled, compare $use_$1 to string "yes".  As in:
+dnl enabled use CAIRO_FEATURE_IF_ENABLED:
+dnl
+dnl	CAIRO_FEATURE_IF_ENABLED($1, [IF-ENABLED], [IF-DISABLED])
+dnl
+dnl or compare $use_$1 to string "yes".  As in:
 dnl
-dnl	AS_IF([test "x$use_$1" = "xyes"],
-dnl	[
-dnl		code goes here...
-dnl	])
+dnl	AS_IF([test "x$use_$1" = "xyes"], [IF-ENABLED], [IF-DISABLED])
 dnl
 AC_DEFUN([CAIRO_FEATURE_HOOK_REGISTER],
 [
commit aba88e3437d88ebdf5bbeba72f0130ff4297bcdc
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Sep 6 15:12:32 2008 -0400

    [configure.ac.enable] Move all feature configureation to a single hook
    
    To be broken up in followup commits.

diff --git a/build/configure.ac.enable b/build/configure.ac.enable
index 05a1a4d..c6251ce 100644
--- a/build/configure.ac.enable
+++ b/build/configure.ac.enable
@@ -103,97 +103,6 @@ AC_DEFUN([_CAIRO_ENABLE_FULL],
 
 
 	_CAIRO_FEATURE_HOOKS(cr_feature, cr_feature_name, cr_feature_default, cr_feature_what)
-
-
-	if test "x$use_$1" = xyes; then
-
-		CAIRO_FEATURE_VARS_FOREACH([cr_var], [[test -n "$]cr_feature[_]cr_var[" && CAIRO_]cr_var[="$]cr_feature[_]cr_var[ $CAIRO_]cr_var["]
-		])
-		CAIRO_FEATURES="cr_feature_tag $CAIRO_FEATURES"
-		m4_define([cairo_backend_pc], m4_bpatsubst(src/cairo-$1.pc,_,-))
-		AC_CONFIG_FILES(cairo_backend_pc():src/cairo-backend.pc.in,
-		[
-			$SED -i -e "
-			s, at backend_name@,$1,g;
-			s, at Backend_Name@,cr_feature_name,g;
-			s, at BACKEND_BASE@,$$1_BASE,g;
-			s, at BACKEND_REQUIRES@,$$1_REQUIRES,g;
-			s%@BACKEND_NONPKGCONFIG_LIBS@%$$1_NONPKGCONFIG_LIBS%g;
-			s, at BACKEND_NONPKGCONFIG_CFLAGS@,$$1_NONPKGCONFIG_CFLAGS,g;
-			" "]cairo_backend_pc()[" ||
-			AC_MSG_ERROR(failed to update ]cairo_backend_pc()[)
-		],[
-			SED='$SED'
-			$1_BASE='$$1_BASE'
-			$1_REQUIRES='$$1_REQUIRES'
-			$1_NONPKGCONFIG_LIBS='$$1_NONPKGCONFIG_LIBS'
-			$1_NONPKGCONFIG_CFLAGS='$$1_NONPKGCONFIG_CFLAGS'
-		])
-	fi
-
-	AM_CONDITIONAL(cr_feature_tag, test "x$use_$1" = xyes)
-
-	dnl Collect list of all supported but disabled features
-	AS_IF([test "x$use_$1" != xyes -a "x]cr_feature_default[" != xno],
-	[
-		CAIRO_NO_FEATURES="cr_feature_tag $CAIRO_NO_FEATURES"
-	])
-
-	dnl Collect list of all (un)supported features and cairo headers
-	AS_IF([test "x]cr_feature_default[" = xno],
-	[
-		CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
-unsupported_cairo_headers += $(cairo_$1_headers)'
-		CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
-unsupported_cairo_headers += $(cairo_$1_headers)'
-	],[
-		CAIRO_SUPPORTED_FEATURES="cr_feature_tag $CAIRO_SUPPORTED_FEATURES"
-		CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
-supported_cairo_headers += $(cairo_$1_headers)'
-		CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
-supported_cairo_headers += $(cairo_$1_headers)'
-	  ])
-
-	dnl Collect list of all/enabled cairo source files
-	CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
-all_cairo_pkgconf += $(cairo_$1_pkgconf)
-all_cairo_headers += $(cairo_$1_headers)
-all_cairo_private += $(cairo_$1_private)
-all_cairo_sources += $(cairo_$1_sources)
-if cr_feature_tag
-enabled_cairo_pkgconf += $(cairo_$1_pkgconf)
-enabled_cairo_headers += $(cairo_$1_headers)
-enabled_cairo_private += $(cairo_$1_private)
-enabled_cairo_sources += $(cairo_$1_sources)
-endif
-'
-	CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
-all_cairo_pkgconf += $(cairo_$1_pkgconf)
-all_cairo_headers += $(cairo_$1_headers)
-all_cairo_private += $(cairo_$1_private)
-all_cairo_sources += $(cairo_$1_sources)
-ifeq ($(cr_feature_tag),1)
-enabled_cairo_pkgconf += $(cairo_$1_pkgconf)
-enabled_cairo_headers += $(cairo_$1_headers)
-enabled_cairo_private += $(cairo_$1_private)
-enabled_cairo_sources += $(cairo_$1_sources)
-endif
-'
-	dnl Collect warning message for enabled unsupported backends
-	AS_IF([test "x$use_$1" = xyes -a "x]cr_feature_default[" = xno],
-	[
-		CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE
-m4_text_wrap([The ]cr_feature_name[ feature is still under active development and is included in this release only as a preview. It does NOT fully work yet and incompatible changes may yet be made to ]cr_feature_name[ specific API.], [--- ],, 72)
-"
-	])
-
-	dnl Collect warning message for disabled recommended backends
-	AS_IF([test "x$use_$1" != xyes -a "x]cr_feature_default[" = xyes],
-	[
-		CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE
-m4_text_wrap([It is strictly recommended that you do NOT disable the ]cr_feature_name[ backend.], [+++ ],, 72)
-"
-	])
 ])
 
 m4_pattern_allow(^CAIRO_HAS_)
@@ -302,11 +211,16 @@ m4_define([_CAIRO_FEATURE_HOOK_MATCH],
 m4_define([_CAIRO_FEATURE_HOOKS])
 
 dnl
-dnl CAIRO_FEATURE_HOOK_REGISTER(WHAT, DEFAULT, COMMANDS)
+dnl CAIRO_FEATURE_HOOK_REGISTER(DEFAULT, WHAT, COMMANDS)
+dnl
+dnl	DEFAULT is the default value of features to match
+dnl	WHAT is the type of features to match
+dnl	COMMANDS is commands to run for matched features.
 dnl
-dnl Runs COMMANDS for features matching WHAT and DEFAULT.
+dnl Runs COMMANDS for features matching DEFAULT and WHAT.  Hooks are run for
+dnl each feature in the order they are added.
 dnl
-dnl WHAT and DEFAULT are matched like this:
+dnl DEFAULT and WHAT are matched like this:
 dnl	[*]	matches all values
 dnl	[val]	matches [val]
 dnl	[!val]	matches anything other than [val]
@@ -333,14 +247,12 @@ dnl	[
 dnl		code goes here...
 dnl	])
 dnl
-dnl Hooks are run for each feature in the order they are added.
-dnl
 AC_DEFUN([CAIRO_FEATURE_HOOK_REGISTER],
 [
 	m4_append([_CAIRO_FEATURE_HOOKS],
 	[
-		_CAIRO_FEATURE_HOOK_MATCH(m4_expand([$1]), cr_feature_what,
-		[_CAIRO_FEATURE_HOOK_MATCH(m4_expand([$2]), cr_feature_default,
+		_CAIRO_FEATURE_HOOK_MATCH(m4_expand([$1]), cr_feature_default,
+		[_CAIRO_FEATURE_HOOK_MATCH(m4_expand([$2]), cr_feature_what,
 		 [$3]
 		)])
 	], m4_newline)
@@ -349,6 +261,107 @@ AC_DEFUN([CAIRO_FEATURE_HOOK_REGISTER],
 
 dnl ===========================================================================
 dnl
+dnl Hooks
+dnl
+
+
+CAIRO_FEATURE_HOOK_REGISTER(*,*,
+[
+
+	if test "x$use_$1" = xyes; then
+
+		CAIRO_FEATURE_VARS_FOREACH([cr_var], [[test -n "$]cr_feature[_]cr_var[" && CAIRO_]cr_var[="$]cr_feature[_]cr_var[ $CAIRO_]cr_var["]
+		])
+		CAIRO_FEATURES="cr_feature_tag $CAIRO_FEATURES"
+		m4_define([cairo_backend_pc], m4_bpatsubst(src/cairo-$1.pc,_,-))
+		AC_CONFIG_FILES(cairo_backend_pc():src/cairo-backend.pc.in,
+		[
+			$SED -i -e "
+			s, at backend_name@,$1,g;
+			s, at Backend_Name@,cr_feature_name,g;
+			s, at BACKEND_BASE@,$$1_BASE,g;
+			s, at BACKEND_REQUIRES@,$$1_REQUIRES,g;
+			s%@BACKEND_NONPKGCONFIG_LIBS@%$$1_NONPKGCONFIG_LIBS%g;
+			s, at BACKEND_NONPKGCONFIG_CFLAGS@,$$1_NONPKGCONFIG_CFLAGS,g;
+			" "]cairo_backend_pc()[" ||
+			AC_MSG_ERROR(failed to update ]cairo_backend_pc()[)
+		],[
+			SED='$SED'
+			$1_BASE='$$1_BASE'
+			$1_REQUIRES='$$1_REQUIRES'
+			$1_NONPKGCONFIG_LIBS='$$1_NONPKGCONFIG_LIBS'
+			$1_NONPKGCONFIG_CFLAGS='$$1_NONPKGCONFIG_CFLAGS'
+		])
+	fi
+
+	AM_CONDITIONAL(cr_feature_tag, test "x$use_$1" = xyes)
+
+	dnl Collect list of all supported but disabled features
+	AS_IF([test "x$use_$1" != xyes -a "x]cr_feature_default[" != xno],
+	[
+		CAIRO_NO_FEATURES="cr_feature_tag $CAIRO_NO_FEATURES"
+	])
+
+	dnl Collect list of all (un)supported features and cairo headers
+	AS_IF([test "x]cr_feature_default[" = xno],
+	[
+		CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
+unsupported_cairo_headers += $(cairo_$1_headers)'
+		CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
+unsupported_cairo_headers += $(cairo_$1_headers)'
+	],[
+		CAIRO_SUPPORTED_FEATURES="cr_feature_tag $CAIRO_SUPPORTED_FEATURES"
+		CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
+supported_cairo_headers += $(cairo_$1_headers)'
+		CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
+supported_cairo_headers += $(cairo_$1_headers)'
+	  ])
+
+	dnl Collect list of all/enabled cairo source files
+	CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
+all_cairo_pkgconf += $(cairo_$1_pkgconf)
+all_cairo_headers += $(cairo_$1_headers)
+all_cairo_private += $(cairo_$1_private)
+all_cairo_sources += $(cairo_$1_sources)
+if cr_feature_tag
+enabled_cairo_pkgconf += $(cairo_$1_pkgconf)
+enabled_cairo_headers += $(cairo_$1_headers)
+enabled_cairo_private += $(cairo_$1_private)
+enabled_cairo_sources += $(cairo_$1_sources)
+endif
+'
+	CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
+all_cairo_pkgconf += $(cairo_$1_pkgconf)
+all_cairo_headers += $(cairo_$1_headers)
+all_cairo_private += $(cairo_$1_private)
+all_cairo_sources += $(cairo_$1_sources)
+ifeq ($(cr_feature_tag),1)
+enabled_cairo_pkgconf += $(cairo_$1_pkgconf)
+enabled_cairo_headers += $(cairo_$1_headers)
+enabled_cairo_private += $(cairo_$1_private)
+enabled_cairo_sources += $(cairo_$1_sources)
+endif
+'
+	dnl Collect warning message for enabled unsupported backends
+	AS_IF([test "x$use_$1" = xyes -a "x]cr_feature_default[" = xno],
+	[
+		CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE
+m4_text_wrap([The ]cr_feature_name[ feature is still under active development and is included in this release only as a preview. It does NOT fully work yet and incompatible changes may yet be made to ]cr_feature_name[ specific API.], [--- ],, 72)
+"
+	])
+
+	dnl Collect warning message for disabled recommended backends
+	AS_IF([test "x$use_$1" != xyes -a "x]cr_feature_default[" = xyes],
+	[
+		CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE
+m4_text_wrap([It is strictly recommended that you do NOT disable the ]cr_feature_name[ backend.], [+++ ],, 72)
+"
+	])
+
+])
+
+dnl ===========================================================================
+dnl
 dnl Report
 dnl
 
commit 7d39e4cbd722e39396904a43798c4743321b174c
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Sep 6 15:10:24 2008 -0400

    [configure.ac.enable] Add all-powerful hook registration macro

diff --git a/build/configure.ac.enable b/build/configure.ac.enable
index 3075b4a..05a1a4d 100644
--- a/build/configure.ac.enable
+++ b/build/configure.ac.enable
@@ -6,6 +6,7 @@ dnl cairo-features.h and other generated files.
 dnl
 
 dnl ===========================================================================
+
 dnl
 dnl cairo_cache_version should be increased every time that the feature
 dnl detection stuff changes in a way that removing the config.cache file may be
@@ -14,10 +15,9 @@ dnl changes;  it doesn't have any effect on any other cached thing.)
 dnl
 m4_define(cairo_cache_version, 5)
 
-dnl ===========================================================================
 dnl
 dnl Define a macro to enable features
-dnl  - Macro: _CAIRO_ENABLE_FULL (ID, NAME, ARG, TAG, DEFAULT, WHAT, COMMANDS)
+dnl  - Macro: _CAIRO_ENABLE_FULL (ID, NAME, ARG, TAG, WHAT, DEFAULT, COMMANDS)
 dnl
 dnl where:
 dnl
@@ -26,10 +26,10 @@ dnl	NAME is the human-readable name of the feature, eg. "FreeType font"
 dnl	ARG is what enables the feature, eg. "ft" for --enable-ft
 dnl	TAG is the feature conditional, eg. CAIRO_HAS_FT_FONT
 dnl	WHAT is the type of feature:
-dnl	     "surface" for surface backends
-dnl	     "font" for font backends
-dnl	     "functions" for set of functions
-dnl	     "" for private configurations
+dnl		"surface" for surface backends
+dnl		"font" for font backends
+dnl		"functions" for set of functions
+dnl		"" for private configurations
 dnl	DEFAULT is the default state of the feature:
 dnl		"no" for experimental backends, eg. your favorite new backend
 dnl		"yes" for mandatory backends, eg. png
@@ -53,9 +53,9 @@ AC_DEFUN([_CAIRO_ENABLE_FULL],
 	m4_define([cr_feature_commands], [$7])
 
 	AC_ARG_ENABLE(cr_feature_arg,
-                      AS_HELP_STRING([--enable-]cr_feature_arg[=@<:@no/auto/yes@:>@],
-                                     [Enable cairo's ]cr_feature_name[ feature @<:@default=]cr_feature_default[@:>@]),
-                      enable_$1=$enableval, enable_$1=cr_feature_default)
+		      AS_HELP_STRING([--enable-]cr_feature_arg[=@<:@no/auto/yes@:>@],
+				     [Enable cairo's ]cr_feature_name[ feature @<:@default=]cr_feature_default[@:>@]),
+		      enable_$1=$enableval, enable_$1=cr_feature_default)
 	case $enable_$1 in
 	no)
 		use_$1="no (disabled, use --enable-cr_feature_arg to enable)"
@@ -101,6 +101,10 @@ AC_DEFUN([_CAIRO_ENABLE_FULL],
 		])
 	])
 
+
+	_CAIRO_FEATURE_HOOKS(cr_feature, cr_feature_name, cr_feature_default, cr_feature_what)
+
+
 	if test "x$use_$1" = xyes; then
 
 		CAIRO_FEATURE_VARS_FOREACH([cr_var], [[test -n "$]cr_feature[_]cr_var[" && CAIRO_]cr_var[="$]cr_feature[_]cr_var[ $CAIRO_]cr_var["]
@@ -255,6 +259,7 @@ AC_DEFUN([CAIRO_ENABLE_FUNCTIONS],
 
 
 dnl ===========================================================================
+
 dnl
 dnl CAIRO_FEATURE_VARS_REGISTER(VARS, INITIAL-VALUE=[])
 dnl
@@ -284,6 +289,65 @@ AC_DEFUN([CAIRO_FEATURE_VARS_FOREACH],
 ])
 
 dnl ===========================================================================
+
+m4_define([_CAIRO_FEATURE_HOOK_MATCH],
+[
+	m4_case([$1],
+		[*],	[$3],
+		[$2],	[$3],
+		[!$2],	,
+			[m4_bmatch([$1], [^!], [$3])])
+])
+
+m4_define([_CAIRO_FEATURE_HOOKS])
+
+dnl
+dnl CAIRO_FEATURE_HOOK_REGISTER(WHAT, DEFAULT, COMMANDS)
+dnl
+dnl Runs COMMANDS for features matching WHAT and DEFAULT.
+dnl
+dnl WHAT and DEFAULT are matched like this:
+dnl	[*]	matches all values
+dnl	[val]	matches [val]
+dnl	[!val]	matches anything other than [val]
+dnl
+dnl The following macros can be used in COMMANDS:
+dnl
+dnl	cr_feature expands to the feature id, eg "ft"
+dnl	cr_feature_name	expands to the human-readable name of the feature, eg. "FreeType font"
+dnl	cr_feature_default expands to the default state of the feature:
+dnl		"no" for experimental backends, eg. your favorite new backend
+dnl		"yes" for mandatory backends, eg. png
+dnl		"auto" for other supported backends, eg. xlib
+dnl	cr_what expands to the type of feature:
+dnl		"surface" for surface backends
+dnl		"font" for font backends
+dnl		"functions" for set of functions
+dnl		"" for private configurations
+dnl
+dnl These four values are also set as $1 to $4.  To know if feature was
+dnl enabled, compare $use_$1 to string "yes".  As in:
+dnl
+dnl	AS_IF([test "x$use_$1" = "xyes"],
+dnl	[
+dnl		code goes here...
+dnl	])
+dnl
+dnl Hooks are run for each feature in the order they are added.
+dnl
+AC_DEFUN([CAIRO_FEATURE_HOOK_REGISTER],
+[
+	m4_append([_CAIRO_FEATURE_HOOKS],
+	[
+		_CAIRO_FEATURE_HOOK_MATCH(m4_expand([$1]), cr_feature_what,
+		[_CAIRO_FEATURE_HOOK_MATCH(m4_expand([$2]), cr_feature_default,
+		 [$3]
+		)])
+	], m4_newline)
+])
+
+
+dnl ===========================================================================
 dnl
 dnl Report
 dnl
commit 61ef0ebdc39828fd8f1e10de914694e22c6b6aa1
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Sep 6 14:51:57 2008 -0400

    [.gitignore] Update

diff --git a/.gitignore b/.gitignore
index b24ce5e..b240109 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,12 +7,14 @@ Makefile
 Makefile.in
 aclocal.m4
 autom4te.cache
+autoscan.log
 config.cache
 config.h
 config.h.in
 config.log
 config.status
 configure
+configure.scan
 libtool
 releases
 stamp-h
commit eddb3f6a849a22bed0946e0f5031133e82429812
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Sat Sep 6 09:50:57 2008 -0400

    [configure.ac.enable] More macro cleanup

diff --git a/acinclude.m4 b/acinclude.m4
index 09a8a43..7d95ade 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -124,6 +124,7 @@ dnl
 dnl Cairo-specific macros
 dnl
 m4_pattern_forbid([CAIRO])
+m4_pattern_forbid([^cr_])
 
 dnl ==========================================================================
 
diff --git a/build/configure.ac.enable b/build/configure.ac.enable
index e70246e..3075b4a 100644
--- a/build/configure.ac.enable
+++ b/build/configure.ac.enable
@@ -1,122 +1,117 @@
 dnl
-dnl These are the facilities for enable/disabling various backends/features,
-dnl and for collecting CFLAGS/LIBS and generating per backend/feature .pc
+dnl These are the facilities for enable/disabling various features,
+dnl and for collecting CFLAGS/LIBS and generating per feature .pc
 dnl files, assembling list of source files to compile, and creating
 dnl cairo-features.h and other generated files.
 dnl
 
 dnl ===========================================================================
 dnl
-dnl cairo_cache_version should be increased every time that the backend
+dnl cairo_cache_version should be increased every time that the feature
 dnl detection stuff changes in a way that removing the config.cache file may be
-dnl needed for correct operation. (this is only for the backend detection
+dnl needed for correct operation. (this is only for the feature detection
 dnl changes;  it doesn't have any effect on any other cached thing.)
 dnl
-m4_define(cairo_cache_version, 4)
+m4_define(cairo_cache_version, 5)
 
 dnl ===========================================================================
 dnl
 dnl Define a macro to enable features
-dnl  - Macro: _CAIRO_ENABLE_FULL (NAMESPACE, NAME, ARG, FEATURE_NAME, DEFAULT, WHAT, COMMANDS)
+dnl  - Macro: _CAIRO_ENABLE_FULL (ID, NAME, ARG, TAG, DEFAULT, WHAT, COMMANDS)
 dnl
 dnl where:
 dnl
-dnl	NAMESPACE is the sub-namespace in function names, eg. "ft" for cairo_ft_...
-dnl	NAME is the human-readable name of the backend, eg. "FreeType font"
-dnl	ARG is what enables the backend, eg. "freetype" for --enable-freetype
-dnl	FEATURE_NAME is the feature conditional, eg. CAIRO_HAS_FT_FONT
+dnl	ID is the sub-namespace in function names, eg. "ft" for cairo_ft_...
+dnl	NAME is the human-readable name of the feature, eg. "FreeType font"
+dnl	ARG is what enables the feature, eg. "ft" for --enable-ft
+dnl	TAG is the feature conditional, eg. CAIRO_HAS_FT_FONT
 dnl	WHAT is the type of feature:
 dnl	     "surface" for surface backends
 dnl	     "font" for font backends
 dnl	     "functions" for set of functions
 dnl	     "" for private configurations
-dnl	DEFAULT is the default state of the backend:
+dnl	DEFAULT is the default state of the feature:
 dnl		"no" for experimental backends, eg. your favorite new backend
 dnl		"yes" for mandatory backends, eg. png
 dnl		"auto" for other supported backends, eg. xlib
-dnl	COMMANDS are run to check whether the backend can be enabled.  Their
+dnl	COMMANDS are run to check whether the feature can be enabled.  Their
 dnl		result may be cached, so user should not count on them being run.
-dnl		They should set use_$(NAMESPACE) to something other than yes if the
-dnl		backend cannot be built, eg. "no (requires SomeThing)".  It then
-dnl		should also set $(NAMESPACE)_REQUIRES/CFLAGS/LIBS/...
+dnl		They should set use_$(ID) to something other than yes if the
+dnl		feature cannot be built, eg. "no (requires SomeThing)".  It then
+dnl		should also set $(ID)_REQUIRES/CFLAGS/LIBS/...
 dnl		appropriately.  Look at the macro definition for more details,
 dnl		or ask if in doubt.
 dnl
 AC_DEFUN([_CAIRO_ENABLE_FULL],
-[	AC_ARG_ENABLE([$3],
-                      AS_HELP_STRING([--enable-$3=@<:@no/auto/yes@:>@],
-                                     [Enable cairo's $2 backend @<:@default=$6@:>@]),
-                      enable_$1=$enableval, enable_$1=$6)
+[
+	m4_define([cr_feature], [$1])
+	m4_define([cr_feature_name], m4_expand([$2]))
+	m4_define([cr_feature_arg], m4_expand([$3]))
+	m4_define([cr_feature_tag], m4_expand([$4]))
+	m4_define([cr_feature_what], m4_expand([$5]))
+	m4_define([cr_feature_default], m4_expand([$6]))
+	m4_define([cr_feature_commands], [$7])
+
+	AC_ARG_ENABLE(cr_feature_arg,
+                      AS_HELP_STRING([--enable-]cr_feature_arg[=@<:@no/auto/yes@:>@],
+                                     [Enable cairo's ]cr_feature_name[ feature @<:@default=]cr_feature_default[@:>@]),
+                      enable_$1=$enableval, enable_$1=cr_feature_default)
 	case $enable_$1 in
 	no)
-		use_$1="no (disabled, use --enable-$3 to enable)"
+		use_$1="no (disabled, use --enable-cr_feature_arg to enable)"
 	;;
 	yes|auto)
-		if test "x$cairo_cv_backend_[]$1[]_cache_version" != "x[]cairo_cache_version"; then
-			# cached results for this backend (if any) are stale.  force rechecking.
-			unset cairo_cv_backend_[]$1[]_use
+		if test "x$cairo_cv_[]$1[]_cache_version" != "x[]cairo_cache_version"; then
+			# cached results for this feature (if any) are stale.  force rechecking.
+			unset cairo_cv_[]$1[]_use
 		fi
-		AC_CACHE_CHECK([for cairo's $2 backend], cairo_cv_backend_[]$1[]_use,
+		AC_CACHE_CHECK([for cairo's ]cr_feature_name[ feature], cairo_cv_[]$1[]_use,
 		[
 			echo
 			use_[]$1=yes
-			$1[]_REQUIRES=$ac_env_[]$1[]_REQUIRES_value
-			$1[]_CFLAGS=$ac_env_[]$1[]_CFLAGS_value
-			$1[]_LIBS=$ac_env_[]$1[]_LIBS_value
-			$1[]_NONPKGCONFIG_CFLAGS=$ac_env_[]$1[]_NONPKGCONFIG_CFLAGS_value
-			$1[]_NONPKGCONFIG_LIBS=$ac_env_[]$1[]_NONPKGCONFIG_LIBS_value
-			$1[]_BASE=cairo
-			$7
-			cairo_cv_backend_[]$1[]_use=$use_[]$1
-			cairo_cv_backend_[]$1[]_cache_version=cairo_cache_version
-			cairo_cv_backend_[]$1[]_requires=$[]$1[]_REQUIRES
-			cairo_cv_backend_[]$1[]_cflags=$[]$1[]_CFLAGS
-			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])
+			CAIRO_FEATURE_VARS_FOREACH(cr_var, [cr_feature[_]cr_var[=$ac_env_]cr_feature[_]cr_var[_value]
+			])
+			cr_feature_commands
+			cairo_cv_[]$1[]_use=$use_[]$1
+			cairo_cv_[]$1[]_cache_version=cairo_cache_version
+			CAIRO_FEATURE_VARS_FOREACH([cr_var], [[cairo_cv_]cr_feature[_]cr_var[=$]cr_feature[_]cr_var
+			])
+			AC_MSG_CHECKING([whether cairo's ]cr_feature_name[ feature could be enabled])
 		])
 
-		use_[]$1=$cairo_cv_backend_[]$1[]_use
-		$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=""
+		use_[]$1=$cairo_cv_[]$1[]_use
 
 		AS_IF([test "x$enable_$1" = "xyes" -a "x$use_$1" != xyes],
 		[
-			AC_MSG_ERROR([requested $2 backend could not be enabled])
+			AC_MSG_ERROR([requested ]cr_feature_name[ feature could not be enabled])
 		])
 	;;
 	*)
-		AC_MSG_ERROR([invalid argument passed to --enable-$3: $use_$1, should be one of @<:@no/auto/yes@:>@])
+		AC_MSG_ERROR([invalid argument passed to --enable-]cr_feature_arg[: `$use_$1', should be one of @<:@no/auto/yes@:>@])
 	;;
 	esac
 
+	AS_IF([test "x$use_$1" = "xyes"],
+	[
+		CAIRO_FEATURE_VARS_FOREACH([cr_var], [cr_feature[_]cr_var[=$cairo_cv_]cr_feature[_]cr_var
+		])
+	],[
+		dnl If not enabled, empty the vars so no one accidentally uses them.
+		CAIRO_FEATURE_VARS_FOREACH([cr_var], [cr_feature[_]cr_var[=$cairo_cv_]cr_feature[_]cr_var
+		])
+	])
+
 	if test "x$use_$1" = xyes; then
-		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"
+
+		CAIRO_FEATURE_VARS_FOREACH([cr_var], [[test -n "$]cr_feature[_]cr_var[" && CAIRO_]cr_var[="$]cr_feature[_]cr_var[ $CAIRO_]cr_var["]
+		])
+		CAIRO_FEATURES="cr_feature_tag $CAIRO_FEATURES"
 		m4_define([cairo_backend_pc], m4_bpatsubst(src/cairo-$1.pc,_,-))
 		AC_CONFIG_FILES(cairo_backend_pc():src/cairo-backend.pc.in,
 		[
 			$SED -i -e "
 			s, at backend_name@,$1,g;
-			s, at Backend_Name@,$2,g;
+			s, at Backend_Name@,cr_feature_name,g;
 			s, at BACKEND_BASE@,$$1_BASE,g;
 			s, at BACKEND_REQUIRES@,$$1_REQUIRES,g;
 			s%@BACKEND_NONPKGCONFIG_LIBS@%$$1_NONPKGCONFIG_LIBS%g;
@@ -132,23 +127,23 @@ AC_DEFUN([_CAIRO_ENABLE_FULL],
 		])
 	fi
 
-	AM_CONDITIONAL($4, test "x$use_$1" = xyes)
+	AM_CONDITIONAL(cr_feature_tag, test "x$use_$1" = xyes)
 
 	dnl Collect list of all supported but disabled features
-	AS_IF([test "x$use_$1" != xyes -a "x$6" != xno],
+	AS_IF([test "x$use_$1" != xyes -a "x]cr_feature_default[" != xno],
 	[
-		CAIRO_NO_FEATURES="$4 $CAIRO_NO_FEATURES"
+		CAIRO_NO_FEATURES="cr_feature_tag $CAIRO_NO_FEATURES"
 	])
 
 	dnl Collect list of all (un)supported features and cairo headers
-	AS_IF([test "x$6" = xno],
+	AS_IF([test "x]cr_feature_default[" = xno],
 	[
 		CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
 unsupported_cairo_headers += $(cairo_$1_headers)'
 		CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
 unsupported_cairo_headers += $(cairo_$1_headers)'
 	],[
-		CAIRO_SUPPORTED_FEATURES="$4 $CAIRO_SUPPORTED_FEATURES"
+		CAIRO_SUPPORTED_FEATURES="cr_feature_tag $CAIRO_SUPPORTED_FEATURES"
 		CAIRO_CONFIG_AMAKE=$CAIRO_CONFIG_AMAKE'
 supported_cairo_headers += $(cairo_$1_headers)'
 		CAIRO_CONFIG_WIN32=$CAIRO_CONFIG_WIN32'
@@ -161,7 +156,7 @@ all_cairo_pkgconf += $(cairo_$1_pkgconf)
 all_cairo_headers += $(cairo_$1_headers)
 all_cairo_private += $(cairo_$1_private)
 all_cairo_sources += $(cairo_$1_sources)
-if $4
+if cr_feature_tag
 enabled_cairo_pkgconf += $(cairo_$1_pkgconf)
 enabled_cairo_headers += $(cairo_$1_headers)
 enabled_cairo_private += $(cairo_$1_private)
@@ -173,7 +168,7 @@ all_cairo_pkgconf += $(cairo_$1_pkgconf)
 all_cairo_headers += $(cairo_$1_headers)
 all_cairo_private += $(cairo_$1_private)
 all_cairo_sources += $(cairo_$1_sources)
-ifeq ($($4),1)
+ifeq ($(cr_feature_tag),1)
 enabled_cairo_pkgconf += $(cairo_$1_pkgconf)
 enabled_cairo_headers += $(cairo_$1_headers)
 enabled_cairo_private += $(cairo_$1_private)
@@ -181,32 +176,28 @@ enabled_cairo_sources += $(cairo_$1_sources)
 endif
 '
 	dnl Collect warning message for enabled unsupported backends
-	AS_IF([test "x$use_$1" = xyes -a "x$6" = xno],
+	AS_IF([test "x$use_$1" = xyes -a "x]cr_feature_default[" = xno],
 	[
 		CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE
-*** The $2 backend is still under active development and
-*** is included in this release only as a preview. It does NOT
-*** fully work yet and incompatible changes may yet be made
-*** to $2-backend specific API.
+m4_text_wrap([The ]cr_feature_name[ feature is still under active development and is included in this release only as a preview. It does NOT fully work yet and incompatible changes may yet be made to ]cr_feature_name[ specific API.], [--- ],, 72)
 "
 	])
 
 	dnl Collect warning message for disabled recommended backends
-	AS_IF([test "x$use_$1" != xyes -a "x$6" = xyes],
+	AS_IF([test "x$use_$1" != xyes -a "x]cr_feature_default[" = xyes],
 	[
 		CAIRO_WARNING_MESSAGE="$CAIRO_WARNING_MESSAGE
-*** It is strictly recommended that you do NOT disable
-*** the $2 backend.
+m4_text_wrap([It is strictly recommended that you do NOT disable the ]cr_feature_name[ backend.], [+++ ],, 72)
 "
 	])
 ])
 
 m4_pattern_allow(^CAIRO_HAS_)
-m4_define([_CAIRO_BUILD_FEATURE_NAME_NORMALIZED],
+m4_define([_CAIRO_BUILD_FEATURE_TAG_NORMALIZED],
 	[CAIRO_HAS_[$1]m4_bmatch([$1],[$2$],,[$2])])
 
-m4_define([_CAIRO_BUILD_FEATURE_NAME],
-	[_CAIRO_BUILD_FEATURE_NAME_NORMALIZED(AS_TR_CPP([$1]),AS_TR_CPP(m4_ifval([$2],[ $2])))])
+m4_define([_CAIRO_BUILD_FEATURE_TAG],
+	[_CAIRO_BUILD_FEATURE_TAG_NORMALIZED(AS_TR_CPP([$1]),AS_TR_CPP(m4_ifval([$2],[ $2])))])
 
 dnl Like _CAIRO_ENABLE*, but takes an object type too
 AC_DEFUN([_CAIRO_ENABLE],
@@ -221,31 +212,30 @@ AC_DEFUN([_CAIRO_ENABLE],
 		[$1],
 		m4_normalize([$2]),
 		m4_translit([$1],[_],[-]),
-		_CAIRO_BUILD_FEATURE_NAME([$1],m4_normalize([$3])),
+		_CAIRO_BUILD_FEATURE_TAG([$1],m4_normalize([$3])),
 		m4_normalize([$3]),
 		m4_normalize([$4]),
 		[$5]
 	)dnl
 ])
 
-dnl ===========================================================================
 dnl
 dnl Define macros to enable various features.
-dnl  - Macro: CAIRO_ENABLE_* (NAMESPACE, NAME, DEFAULT, COMMANDS)
+dnl  - Macro: CAIRO_ENABLE_* (ID, NAME, DEFAULT, COMMANDS)
 dnl
 dnl where:
 dnl
-dnl	FEATURENAME is the feature name, eg. "ft" for cairo_ft_...
+dnl	ID is the feature id, eg. "ft" for cairo_ft_...
 dnl	NAME is the human-readable name of the feature, eg. "FreeType"
-dnl	DEFAULT is the default state of the backend:
+dnl	DEFAULT is the default state of the feature:
 dnl		"no" for experimental backends, eg. your favorite new backend
 dnl		"yes" for mandatory backends, eg. png
 dnl		"auto" for other supported backends, eg. xlib
 dnl	COMMANDS are run to check whether the feature can be enabled.  Their
 dnl		result may be cached, so user should not count on them being run.
-dnl		They should set use_$(NAMESPACE) to something other than yes if the
-dnl		backend cannot be built, eg. "no (requires SomeThing)".  It then
-dnl		should also set $(NAMESPACE)_REQUIRES/CFLAGS/LIBS/...
+dnl		They should set use_$(ID) to something other than yes if the
+dnl		feature cannot be built, eg. "no (requires SomeThing)".  It then
+dnl		should also set $(ID)_REQUIRES/CFLAGS/LIBS/...
 dnl		appropriately.  Look at the macro definition for more details,
 dnl		or ask if in doubt.
 dnl
@@ -263,14 +253,43 @@ AC_DEFUN([CAIRO_ENABLE_FUNCTIONS],
 	[_CAIRO_ENABLE([$1],	[$2 functions],		functions,	[$3],[$4])])
 
 
+
+dnl ===========================================================================
+dnl
+dnl CAIRO_FEATURE_VARS_REGISTER(VARS, INITIAL-VALUE=[])
+dnl
+dnl Registers variables to be collected from feature-enabling code segments.
+dnl VARS should be a whitespace-separate list of variable names.
+dnl
+dnl XXX Should be able to set default value
+dnl
+dnl XXX Set separator.  Also, prepend/append setting
+dnl
+dnl XXX An aggregate of the values from all enabled features is collected in
+dnl variables named as VARS but prefixed with CAIRO_.
+dnl
+AC_DEFUN([CAIRO_FEATURE_VARS_REGISTER],
+[
+	m4_foreach_w([cr_var], [$1],
+		     [m4_append_uniq([CAIRO_FEATURE_VARS], cr_var, [ ],,
+				     [m4_fatal([Feature variable `]cr_var[' already registered])])])
+	m4_foreach_w([cr_var], [$1], [[CAIRO_]cr_var[="$2"]
+	])
+	m4_foreach_w([cr_var], [$1], [m4_pattern_allow([CAIRO_]cr_var)])
+])
+
+AC_DEFUN([CAIRO_FEATURE_VARS_FOREACH],
+[
+	m4_foreach_w([$1], m4_expand(CAIRO_FEATURE_VARS), [$2])
+])
+
 dnl ===========================================================================
 dnl
 dnl Report
 dnl
 
 dnl Accumulator for warning messages
-m4_pattern_allow(^CAIRO_WARNING_MESSAGE$)
-CAIRO_WARNING_MESSAGE=""
+CAIRO_FEATURE_VARS_REGISTER([WARNING_MESSAGE])
 
 AC_DEFUN([CAIRO_REPORT],
 [
@@ -341,18 +360,17 @@ dnl pkg-config requires, non-pkgconfig cflags and libs, and total cflags and lib
 dnl
 
 dnl Accumulators
-CAIRO_REQUIRES=""
-CAIRO_NONPKGCONFIG_CFLAGS=""
-CAIRO_NONPKGCONFIG_LIBS="$LIBS"
-CAIRO_CFLAGS=$CAIRO_NONPKGCONFIG_CFLAGS
-CAIRO_LIBS=$CAIRO_NONPKGCONFIG_LIBS
+CAIRO_FEATURE_VARS_REGISTER([REQUIRES BASE])
+CAIRO_FEATURE_VARS_REGISTER([CFLAGS NONPKGCONFIG_CFLAGS])
+CAIRO_FEATURE_VARS_REGISTER([LIBS NONPKGCONFIG_LIBS], [$LIBS])
 
-dnl Substitute
+dnl Substitute vars
 AC_SUBST(CAIRO_REQUIRES)
-AC_SUBST(CAIRO_NONPKGCONFIG_CFLAGS)
-AC_SUBST(CAIRO_NONPKGCONFIG_LIBS)
+AC_SUBST(CAIRO_BASE)
 AC_SUBST(CAIRO_CFLAGS)
+AC_SUBST(CAIRO_NONPKGCONFIG_CFLAGS)
 AC_SUBST(CAIRO_LIBS)
+AC_SUBST(CAIRO_NONPKGCONFIG_LIBS)
 
 
 dnl ===========================================================================
commit 96e45e6779320cb0bed2a8d5f601180167c8a706
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Sep 5 01:18:39 2008 -0400

    [configure.ac] Cosmetic

diff --git a/build/configure.ac.enable b/build/configure.ac.enable
index 58c42bd..e70246e 100644
--- a/build/configure.ac.enable
+++ b/build/configure.ac.enable
@@ -206,19 +206,27 @@ m4_define([_CAIRO_BUILD_FEATURE_NAME_NORMALIZED],
 	[CAIRO_HAS_[$1]m4_bmatch([$1],[$2$],,[$2])])
 
 m4_define([_CAIRO_BUILD_FEATURE_NAME],
-[_CAIRO_BUILD_FEATURE_NAME_NORMALIZED(AS_TR_CPP([$1]),AS_TR_CPP(m4_ifval([$2],[ $2])))])
+	[_CAIRO_BUILD_FEATURE_NAME_NORMALIZED(AS_TR_CPP([$1]),AS_TR_CPP(m4_ifval([$2],[ $2])))])
 
 dnl Like _CAIRO_ENABLE*, but takes an object type too
 AC_DEFUN([_CAIRO_ENABLE],
-[m4_if([$1],m4_tolower(AS_TR_SH([$1])),,[m4_fatal([invalid feature name `$1'])])_CAIRO_ENABLE_FULL(
-	[$1],
-	m4_normalize([$2]),
-	m4_translit([$1],[_],[-]),
-	_CAIRO_BUILD_FEATURE_NAME([$1],m4_normalize([$3])),
-	m4_normalize([$3]),
-	m4_normalize([$4]),
-	[$5]
-)])
+[
+	m4_if(
+		[$1],
+		m4_tolower(AS_TR_SH([$1])),
+		,
+		[m4_fatal([invalid feature name `$1'])]
+	)
+	_CAIRO_ENABLE_FULL(
+		[$1],
+		m4_normalize([$2]),
+		m4_translit([$1],[_],[-]),
+		_CAIRO_BUILD_FEATURE_NAME([$1],m4_normalize([$3])),
+		m4_normalize([$3]),
+		m4_normalize([$4]),
+		[$5]
+	)dnl
+])
 
 dnl ===========================================================================
 dnl
@@ -241,14 +249,19 @@ dnl		should also set $(NAMESPACE)_REQUIRES/CFLAGS/LIBS/...
 dnl		appropriately.  Look at the macro definition for more details,
 dnl		or ask if in doubt.
 dnl
+
 AC_DEFUN([CAIRO_ENABLE],
-[_CAIRO_ENABLE([$1],[$2],,[$3],[$4])])
+	[_CAIRO_ENABLE([$1],	[$2],			,		[$3],[$4])])
+
 AC_DEFUN([CAIRO_ENABLE_SURFACE_BACKEND],
-[_CAIRO_ENABLE([$1],[$2 surface backend],surface,[$3],[$4])])
+	[_CAIRO_ENABLE([$1],	[$2 surface backend],	surface,	[$3],[$4])])
+
 AC_DEFUN([CAIRO_ENABLE_FONT_BACKEND],
-[_CAIRO_ENABLE([$1],[$2 font backend],font,[$3],[$4])])
+	[_CAIRO_ENABLE([$1],	[$2 font backend],	font,	  	[$3],[$4])])
+
 AC_DEFUN([CAIRO_ENABLE_FUNCTIONS],
-[_CAIRO_ENABLE([$1],[$2 functions],functions,[$3],[$4])])
+	[_CAIRO_ENABLE([$1],	[$2 functions],		functions,	[$3],[$4])])
+
 
 dnl ===========================================================================
 dnl
commit a37806a9da21a196e94dfa99500c3551ff119231
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Sep 5 01:07:30 2008 -0400

    [configure.ac] Quote version macros

diff --git a/configure.ac b/configure.ac
index 896b498..b159293 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,8 +1,8 @@
 AC_PREREQ(2.58)
 CAIRO_PARSE_VERSION
 AC_INIT([cairo],
-      cairo_version_major.cairo_version_minor.cairo_version_micro,
-      [http://bugs.freedesktop.org/enter_bug.cgi?product=cairo])
+	[cairo_version_major.cairo_version_minor.cairo_version_micro],
+	[http://bugs.freedesktop.org/enter_bug.cgi?product=cairo])
 AC_CONFIG_SRCDIR(src/cairo.h)
 AC_CONFIG_HEADERS(config.h)
 AC_CONFIG_AUX_DIR(build)
commit 4edda79e711c3d82b5596694abb307ffa3fe855b
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Fri Sep 5 00:57:15 2008 -0400

    [configure.ac] Sanitize feature names

diff --git a/build/configure.ac.enable b/build/configure.ac.enable
index 062ac7a..58c42bd 100644
--- a/build/configure.ac.enable
+++ b/build/configure.ac.enable
@@ -206,17 +206,17 @@ m4_define([_CAIRO_BUILD_FEATURE_NAME_NORMALIZED],
 	[CAIRO_HAS_[$1]m4_bmatch([$1],[$2$],,[$2])])
 
 m4_define([_CAIRO_BUILD_FEATURE_NAME],
-[_CAIRO_BUILD_FEATURE_NAME_NORMALIZED(m4_translit([$1],[a-z_ -],[A-Z___]),m4_translit(m4_ifval([$2],[ $2]),[a-z_ -],[A-Z___]))])
+[_CAIRO_BUILD_FEATURE_NAME_NORMALIZED(AS_TR_CPP([$1]),AS_TR_CPP(m4_ifval([$2],[ $2])))])
 
 dnl Like _CAIRO_ENABLE*, but takes an object type too
 AC_DEFUN([_CAIRO_ENABLE],
-[_CAIRO_ENABLE_FULL(
-	m4_translit([$1],[A-Z_ -],[a-z___]),
-	[$2],
-	m4_translit([$1],[A-Z_ -],[a-z---]),
-	_CAIRO_BUILD_FEATURE_NAME([$1],[$3]),
-	[$3],
-	[$4],
+[m4_if([$1],m4_tolower(AS_TR_SH([$1])),,[m4_fatal([invalid feature name `$1'])])_CAIRO_ENABLE_FULL(
+	[$1],
+	m4_normalize([$2]),
+	m4_translit([$1],[_],[-]),
+	_CAIRO_BUILD_FEATURE_NAME([$1],m4_normalize([$3])),
+	m4_normalize([$3]),
+	m4_normalize([$4]),
 	[$5]
 )])
 
@@ -227,7 +227,7 @@ dnl  - Macro: CAIRO_ENABLE_* (NAMESPACE, NAME, DEFAULT, COMMANDS)
 dnl
 dnl where:
 dnl
-dnl	NAMESPACE is the sub-namespace in function names, eg. "ft" for cairo_ft_...
+dnl	FEATURENAME is the feature name, eg. "ft" for cairo_ft_...
 dnl	NAME is the human-readable name of the feature, eg. "FreeType"
 dnl	DEFAULT is the default state of the backend:
 dnl		"no" for experimental backends, eg. your favorite new backend


More information about the cairo-commit mailing list