[cairo-commit] 12 commits - autogen.sh boilerplate/Makefile.am boilerplate/Makefile.win32 build/aclocal.makefile.m4 build/configure.ac.features build/Makefile.win32.common doc/public Makefile.am Makefile.win32 perf/Makefile.win32 src/Makefile.am src/Makefile.win32 test/Makefile.win32 test/pdiff

Behdad Esfahbod behdad at kemper.freedesktop.org
Mon Sep 22 20:41:50 PDT 2008


 Makefile.am                 |   12 ++-
 Makefile.win32              |   62 ----------------
 autogen.sh                  |    6 -
 boilerplate/Makefile.am     |    9 +-
 boilerplate/Makefile.win32  |   21 -----
 build/Makefile.win32.common |   62 ++++++++++++++++
 build/aclocal.makefile.m4   |  163 ++++++++++++++++++++++++++++++--------------
 build/configure.ac.features |   41 +++++------
 doc/public/Makefile.am      |    2 
 perf/Makefile.win32         |   26 -------
 src/Makefile.am             |   10 +-
 src/Makefile.win32          |   31 +-------
 test/Makefile.win32         |   22 -----
 test/pdiff/Makefile.win32   |    6 -
 14 files changed, 238 insertions(+), 235 deletions(-)

New commits:
commit fba0211ed6f649b9d61a9f2b3d83096dd801cb14
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Sep 22 23:41:07 2008 -0400

    [Makefile.win32] Add makefile rules to generate cairo-features.h

diff --git a/Makefile.am b/Makefile.am
index fd1b223..95ffe80 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,9 +4,11 @@ EXTRA_DIST += \
 	Makefile.win32 \
 	build/Makefile.win32.common \
 	build/Makefile.win32.features \
+	build/Makefile.win32.features-h \
 	$(NULL)
 MAINTAINERCLEANFILES += \
 	$(srcdir)/build/Makefile.win32.features \
+	$(srcdir)/build/Makefile.win32.features-h \
 	$(NULL)
 
 ACLOCAL_AMFLAGS = -I build
diff --git a/Makefile.win32 b/Makefile.win32
index 1e80365..b527fcf 100644
--- a/Makefile.win32
+++ b/Makefile.win32
@@ -1,15 +1,12 @@
 top_srcdir = .
 include $(top_srcdir)/build/Makefile.win32.common
+include $(top_srcdir)/build/Makefile.win32.features-h
 
 SUBDIRS = src
 TEST_SUBDIRS = boilerplate test
 
 all: inform cairo
 
-src/cairo-features.h:
-	@echo Warning: creating default cairo-features.h
-	@cp src/cairo-features-win32.h src/cairo-features.h
-
 cairo: src/cairo-features.h
 	@list='$(SUBDIRS)'; for f in $$list ; do \
 		echo making all in $$f... ; \
diff --git a/build/configure.ac.features b/build/configure.ac.features
index e9d8f22..5d5a388 100644
--- a/build/configure.ac.features
+++ b/build/configure.ac.features
@@ -282,6 +282,26 @@ CAIRO_FEATURE_HOOK_REGISTER(yes,*,,
 	AC_DEFINE(cr_feature_tag, 1, [Define to 1 to enable cairo's ]cr_feature_name[ feature])
 ])dnl
 
+
+dnl Generate build/Makefile.win32.features-h that generates src/cairo-features.h
+CAIRO_CONFIG_MAKEFILE_PRIVATE_WIN32([win32_features_h],[build],[features-h])
+dnl
+CAIRO_MAKEFILE_ACCUMULATE([win32_features_h],
+[src/cairo-features.h: build/Makefile.win32.features
+	@echo "Generating src/cairo-features.h"
+	@echo "/* Generated by Makefile.win32.  Do not edit. */" > src/cairo-features.h
+	@echo "[#]ifndef CAIRO_FEATURES_H" >> src/cairo-features.h
+	@echo "[#]define CAIRO_FEATURES_H 1" >> src/cairo-features.h]dnl
+)
+AC_CONFIG_COMMANDS_PRE(
+[dnl
+	CAIRO_MAKEFILE_ACCUMULATE([win32_features_h], [	@echo "[#]endif" >>  src/cairo-features.h])
+])dnl
+CAIRO_MAKEFILE_ACCUMULATE_FEATURE([win32_features_h],yes,*,*,dnl
+[	@echo "[#]define cr_feature_tag 1" >> src/cairo-features.h]dnl
+)dnl
+
+
 dnl ===========================================================================
 dnl
 dnl Report
diff --git a/src/Makefile.am b/src/Makefile.am
index 83eee4c..bf87efb 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,8 +13,8 @@ export_symbols = -export-symbols cairo.def
 cairo_def_dependency = cairo.def
 endif
 
-EXTRA_DIST           += cairo-supported-features.h cairo-features-win32.h
-MAINTAINERCLEANFILES += cairo-supported-features.h $(srcdir)/cairo-features-win32.h
+EXTRA_DIST           += cairo-supported-features.h
+MAINTAINERCLEANFILES += cairo-supported-features.h
 
 $(top_builddir)/config.h: $(top_srcdir)/config.h.in
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) config.h
commit 0bedbe78fe236cc9dabec87dea0f71714acfb76a
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Sep 22 22:34:57 2008 -0400

    [Makefile.win32] Misc cleanup

diff --git a/build/Makefile.win32.common b/build/Makefile.win32.common
index 46effba..711a56f 100644
--- a/build/Makefile.win32.common
+++ b/build/Makefile.win32.common
@@ -1,5 +1,11 @@
+default: all
+
 include $(top_srcdir)/build/Makefile.win32.features
 
+ifeq ($(top_builddir),)
+top_builddir = $(top_srcdir)
+endif
+
 CC := cl
 LINK := link
 
@@ -9,20 +15,27 @@ else
 OPT := -O2
 endif
 
-PIXMAN_DIR = $(top_srcdir)/../pixman
-PIXMAN_CFLAGS := -I$(PIXMAN_DIR)/pixman
-PIXMAN_LIBS := $(PIXMAN_DIR)/pixman/$(CFG)/pixman-1.lib
+PIXMAN_CFLAGS := -I$(top_srcdir)/../pixman/pixman
+PIXMAN_LIBS := $(top_builddir)/../pixman/pixman/$(CFG)/pixman-1.lib
 
-EXE_LDFLAGS = libpng.lib zlib.lib gdi32.lib msimg32.lib user32.lib
+CAIRO_LIBS =  gdi32.lib msimg32.lib user32.lib
+ifeq ($(CAIRO_HAS_PNG_FUNCTIONS),1)
+CAIRO_LIBS += libpng.lib
+endif
+ifeq ($(CAIRO_HAS_PS_SURFACE)$(CAIRO_HAS_PDF_SURFACE),00)
+else
+CAIRO_LIBS += zdll.lib
+endif
 
 DEFAULT_CFLAGS = -MD -nologo $(OPT)
 DEFAULT_CFLAGS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
-DEFAULT_CFLAGS += -I. 
+DEFAULT_CFLAGS += -I. -I$(top_srcdir)
 DEFAULT_CFLAGS += $(PIXMAN_CFLAGS)
 
-CFLAGS := $(DEFAULT_CFLAGS)
+CAIRO_CFLAGS = $(DEFAULT_CFLAGS) $(CFLAGS)
 
 inform:
+	@echo
 ifneq ($(CFG),release)
 ifneq ($(CFG),debug)
 	@echo "Invalid configuration "$(CFG)" specified."
@@ -39,11 +52,11 @@ endif
 
 $(CFG)/%.obj: %.c
 	@mkdir -p $(CFG)
-	@$(CC) $(CFLAGS) -c -Fo"$@" $<
+	@$(CC) $(CAIRO_CFLAGS) -c -Fo"$@" $<
 
 $(CFG)/%-static.obj: %.c
 	@mkdir -p $(CFG)
-	@$(CC) $(CFLAGS) -c -DCAIRO_WIN32_STATIC_BUILD=1 -Fo"$@" $<
+	@$(CC) $(CAIRO_CFLAGS) -c -DCAIRO_WIN32_STATIC_BUILD=1 -Fo"$@" $<
 
 clean:
 	@rm -f $(CFG)/*.obj $(CFG)/*.dll $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk || exit 0
diff --git a/src/Makefile.win32 b/src/Makefile.win32
index 6f4e89d..2698886 100644
--- a/src/Makefile.win32
+++ b/src/Makefile.win32
@@ -7,14 +7,14 @@ SOURCES = $(enabled_cairo_sources)
 STATIC_SOURCES = cairo-system.c
 
 OBJECTS = $(patsubst %.c, $(CFG)/%.obj, $(SOURCES))
-STATIC_OBJECTS = $(patsubst %.c, $(CFG)/%-static.obj, $(STATIC_SOURCES))
+OBJECTS_STATIC = $(patsubst %cairo-system.obj, %cairo-system-static.obj, $(OBJECTS))
 
 all: inform $(CFG)/cairo.dll $(CFG)/cairo-static.lib
 static: inform $(CFG)/cairo-static.lib
 dynamic: inform $(CFG)/cairo.dll
 
 $(CFG)/cairo.dll: $(OBJECTS)
-	$(CC) -MD -LD -Fe$@ $(PIXMAN_LIBS) $(OBJECTS) -link user32.lib gdi32.lib libpng.lib zdll.lib msimg32.lib
+	$(CC) -MD -LD -Fe$@ $(PIXMAN_LIBS) $(OBJECTS) -link $(CAIRO_LIBS)
 
-$(CFG)/cairo-static.lib: $(OBJECTS) $(STATIC_OBJECTS)
-	lib -NOLOGO -OUT:$@ $(PIXMAN_LIBS) $(OBJECTS) $(STATIC_OBJECTS)
+$(CFG)/cairo-static.lib: $(OBJECTS_STATIC)
+	lib -NOLOGO -OUT:$@ $(PIXMAN_LIBS) $(OBJECTS_STATIC)
commit ebb5eb57b7cab7e5fc4b3215969a459f49d95fbb
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Sep 22 21:18:09 2008 -0400

    Generate build/Makefile.win32.features

diff --git a/Makefile.am b/Makefile.am
index d875c3b..fd1b223 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,14 @@
 include $(top_srcdir)/build/Makefile.am.common
 
+EXTRA_DIST += \
+	Makefile.win32 \
+	build/Makefile.win32.common \
+	build/Makefile.win32.features \
+	$(NULL)
+MAINTAINERCLEANFILES += \
+	$(srcdir)/build/Makefile.win32.features \
+	$(NULL)
+
 ACLOCAL_AMFLAGS = -I build
 
 DIST_SUBDIRS = src doc util boilerplate test perf
@@ -33,7 +42,6 @@ EXTRA_DIST += \
 	COPYING-MPL-1.1 \
 	HACKING \
 	INSTALL \
-	Makefile.win32 \
 	NEWS \
 	PORTING_GUIDE \
 	README \
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am
index 80e3e6d..70911ac 100644
--- a/boilerplate/Makefile.am
+++ b/boilerplate/Makefile.am
@@ -3,6 +3,9 @@
 include $(top_srcdir)/build/Makefile.am.common
 include $(srcdir)/Makefile.am.features
 
+EXTRA_DIST += Makefile.win32      Makefile.win32.features
+MAINTAINERCLEANFILES += $(srcdir)/Makefile.win32.features
+
 AM_CPPFLAGS = \
 	-I$(srcdir) \
 	-I$(top_builddir)/src \
@@ -10,10 +13,6 @@ AM_CPPFLAGS = \
 	$(CAIRO_CFLAGS) \
 	$(NULL)
 
-EXTRA_DIST += Makefile.win32
-EXTRA_DIST           += Makefile.win32.config
-MAINTAINERCLEANFILES += $(srcdir)/Makefile.win32.config
-
 EXTRA_LTLIBRARIES += libcairoboilerplate.la
 
 libcairoboilerplate_la_SOURCES = \
diff --git a/build/Makefile.win32.common b/build/Makefile.win32.common
index 09cafa9..46effba 100644
--- a/build/Makefile.win32.common
+++ b/build/Makefile.win32.common
@@ -1,3 +1,4 @@
+include $(top_srcdir)/build/Makefile.win32.features
 
 CC := cl
 LINK := link
@@ -8,8 +9,9 @@ else
 OPT := -O2
 endif
 
-PIXMAN_CFLAGS := -I../../pixman/pixman
-PIXMAN_LIBS := ../../pixman/pixman/$(CFG)/pixman-1.lib
+PIXMAN_DIR = $(top_srcdir)/../pixman
+PIXMAN_CFLAGS := -I$(PIXMAN_DIR)/pixman
+PIXMAN_LIBS := $(PIXMAN_DIR)/pixman/$(CFG)/pixman-1.lib
 
 EXE_LDFLAGS = libpng.lib zlib.lib gdi32.lib msimg32.lib user32.lib
 
diff --git a/build/aclocal.makefile.m4 b/build/aclocal.makefile.m4
index df24c08..7077781 100644
--- a/build/aclocal.makefile.m4
+++ b/build/aclocal.makefile.m4
@@ -19,7 +19,7 @@ m4_define([cr_feature_tag],
 
 dnl ===========================================================================
 dnl
-dnl CAIRO_INIT_MAKEFILES()
+dnl CAIRO_INIT_MAKEFILES([AUX-DIR])
 dnl
 dnl Sets up automake and win32 conditionals for all features
 dnl
@@ -34,8 +34,8 @@ AC_DEFUN([CAIRO_INIT_MAKEFILES],
 		AM_CONDITIONAL(cr_feature_tag, [test "x$use_]cr_feature[" = xyes])dnl
 	])dnl
 
-	dnl An empty line per feature for readability
-	CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,*,*,[])dnl
+	CAIRO_CONFIG_MAKEFILE_PRIVATE_WIN32([_],[$1],[],[[# Generated by configure.  Modify to customize.]])dnl
+	CAIRO_MAKEFILE_ACCUMULATE_FEATURE([_],*,!always,*,[cr_feature_tag=m4_if(cr_feature_default,[yes],1,[m4_bmatch(cr_feature,[win32],1,0)])])dnl
 ])dnl
 
 dnl ===========================================================================
@@ -43,34 +43,38 @@ dnl ===========================================================================
 m4_define([_CAIRO_MAKEFILES])dnl
 
 dnl
-dnl CAIRO_CONFIG_MAKEFILE(TAG, DIR)
+dnl CAIRO_CONFIG_MAKEFILE(TAG, DIR, [SUFFIX], [HEADER])
 dnl
-dnl Create DIR/Makefile.*.features files
+dnl Create DIR/Makefile.{am,win32}.SUFFIX files
 dnl TAG is a TAG used by other CAIRO_MAKEFILE_* macros to append to these
 dnl Makefile's.
 dnl
+dnl HEADER is appended at the top of the Makefile's.  If HEADER is not
+dnl set, the generic "Generated by configure.  Do not edit." comment
+dnl is added.
+dnl
 AC_DEFUN([CAIRO_CONFIG_MAKEFILE],
 [dnl
 	m4_append_uniq([_CAIRO_MAKEFILES], [$1], [ ])dnl
-	CAIRO_CONFIG_MAKEFILE_PRIVATE([$1], [$2])dnl
+	CAIRO_CONFIG_MAKEFILE_PRIVATE([$1], [$2], [$3], [$4])dnl
 ])dnl
 
 dnl Like CAIRO_CONFIG_MAKEFILE but only generate win32 makefile
 AC_DEFUN([CAIRO_CONFIG_MAKEFILE_WIN32],
 [dnl
 	m4_append_uniq([_CAIRO_MAKEFILES], [$1], [ ])dnl
-	CAIRO_CONFIG_MAKEFILE_PRIVATE_WIN32([$1], [$2])dnl
+	CAIRO_CONFIG_MAKEFILE_PRIVATE_WIN32([$1], [$2], [$3], [$4])dnl
 ])dnl
 
 dnl Like CAIRO_CONFIG_MAKEFILE but only generate automake makefile
 AC_DEFUN([CAIRO_CONFIG_MAKEFILE_AMAKE],
 [dnl
 	m4_append_uniq([_CAIRO_MAKEFILES], [$1], [ ])dnl
-	CAIRO_CONFIG_MAKEFILE_PRIVATE_AMAKE([$1], [$2])dnl
+	CAIRO_CONFIG_MAKEFILE_PRIVATE_AMAKE([$1], [$2], [$3], [$4])dnl
 ])dnl
 
 dnl
-dnl CAIRO_CONFIG_MAKEFILE_PRIVATE(TAG, DIR)
+dnl CAIRO_CONFIG_MAKEFILE_PRIVATE(TAG, DIR, [SUFFIX], [HEADER])
 dnl
 dnl Like CAIRO_CONFIG_MAKEFILE but this makefile tag won't match
 dnl against '*' in makefile accumulators.
@@ -81,8 +85,8 @@ AC_DEFUN([CAIRO_CONFIG_MAKEFILE_PRIVATE],
 		 [m4_fatal([Makefile `$1' already registered])])dnl
         m4_define([cr_make_$1_dir],[$2])dnl
 
-	CAIRO_CONFIG_MAKEFILE_PRIVATE_AMAKE([$1],[$2])dnl
-	CAIRO_CONFIG_MAKEFILE_PRIVATE_WIN32([$1],[$2])dnl
+	CAIRO_CONFIG_MAKEFILE_PRIVATE_AMAKE([$1], [$2], [$3], [$4])dnl
+	CAIRO_CONFIG_MAKEFILE_PRIVATE_WIN32([$1], [$2], [$3], [$4])dnl
 ])dnl
 
 dnl Like CAIRO_CONFIG_MAKEFILE_PRIVATE but only generate automake makefile
@@ -94,10 +98,10 @@ AC_DEFUN([CAIRO_CONFIG_MAKEFILE_PRIVATE_AMAKE],
         m4_define([cr_make_$1_dir_any],[$2])dnl
 
 	dnl Accumulators
-	CAIRO_ACCUMULATORS_REGISTER(MAKEFILE_$1_AMAKE, m4_newline, [# Generated by configure.  Do not edit.]m4_newline[include $(top_srcdir)/$2/Makefile.sources]m4_newline)dnl
+	CAIRO_ACCUMULATORS_REGISTER(MAKEFILE_$1_AMAKE, m4_newline, m4_default([$4],[[# Generated by configure.  Do not edit.]])m4_newline)dnl
 
 	dnl Generate
-	CAIRO_CONFIG_COMMANDS([$srcdir/$2/Makefile.am.features],
+	CAIRO_CONFIG_COMMANDS([$srcdir/]m4_if([$2],[.],,[$2/])[Makefile.am.]m4_default([$3],[features]),
 			      [echo "$CAIRO_MAKEFILE_$1_AMAKE"],
 			      [CAIRO_MAKEFILE_$1_AMAKE='$CAIRO_MAKEFILE_$1_AMAKE'])dnl
 ])dnl
@@ -111,10 +115,10 @@ AC_DEFUN([CAIRO_CONFIG_MAKEFILE_PRIVATE_WIN32],
         m4_define([cr_make_$1_dir_any],[$2])dnl
 
 	dnl Accumulators
-	CAIRO_ACCUMULATORS_REGISTER(MAKEFILE_$1_WIN32, m4_newline, [# Generated by configure.  Do not edit.]m4_newline[ifeq ($(top_srcdir),)]m4_newline[include Makefile.sources]m4_newline[else]m4_newline[include $(top_srcdir)/$2/Makefile.sources]m4_newline[endif]m4_newline)dnl
+	CAIRO_ACCUMULATORS_REGISTER(MAKEFILE_$1_WIN32, m4_newline, m4_default([$4],[[# Generated by configure.  Do not edit.]])m4_newline)dnl
 
 	dnl Generate
-	CAIRO_CONFIG_COMMANDS([$srcdir/$2/Makefile.win32.features],
+	CAIRO_CONFIG_COMMANDS([$srcdir/]m4_if([$2],[.],,[$2/])[Makefile.win32.]m4_default([$3],[features]),
 			      [echo "$CAIRO_MAKEFILE_$1_WIN32"],
 			      [CAIRO_MAKEFILE_$1_WIN32='$CAIRO_MAKEFILE_$1_WIN32'])dnl
 ])dnl
@@ -125,6 +129,29 @@ m4_define([_CAIRO_MAKEFILE_CHECK],
         m4_ifdef([cr_make_$1_dir_any],,[m4_fatal([Makefile `]$1[' not defined.])])dnl
 ])dnl
 
+
+dnl
+dnl CAIRO_MAKEFILE_INCLUDE(TAG, FILE)
+dnl
+dnl Include FILE from Makefile's for TAG.  FILE should be placed
+dnl relative to directory for TAG. If TAG is *, FILE is included from
+dnl all Makefile's.
+dnl
+AC_DEFUN([CAIRO_MAKEFILE_INCLUDE],
+[dnl
+	m4_if([$1],[*],,[_CAIRO_MAKEFILE_CHECK([$1])])dnl
+	m4_foreach_w([cr_makefile], m4_if([$1],[*],_CAIRO_MAKEFILES,[$1]),
+	[dnl
+		m4_ifdef([cr_make_]cr_makefile[_dir_amake],dnl
+			 [CAIRO_ACCUMULATE([MAKEFILE_]cr_makefile[_AMAKE],[include $(top_srcdir)/cr_make_]cr_makefile[_dir_amake/$2]m4_newline)]
+		)dnl
+		m4_ifdef([cr_make_]cr_makefile[_dir_win32],dnl
+			 [CAIRO_ACCUMULATE([MAKEFILE_]cr_makefile[_WIN32],[ifeq ($(top_srcdir),)]m4_newline[include $2]m4_newline[else]m4_newline[include $(top_srcdir)/cr_make_]cr_makefile[_dir_win32/$2]m4_newline[endif]m4_newline)]
+		)dnl
+	])dnl
+])dnl
+
+
 m4_pattern_allow([cr_make_tmp])
 
 dnl
diff --git a/build/configure.ac.features b/build/configure.ac.features
index 13b7ede..e9d8f22 100644
--- a/build/configure.ac.features
+++ b/build/configure.ac.features
@@ -56,9 +56,12 @@ dnl
 dnl Generate {src,boilerplate}/Makefile.{am,win32}.config
 dnl
 
-CAIRO_INIT_MAKEFILES()
+CAIRO_INIT_MAKEFILES([build])
 CAIRO_CONFIG_MAKEFILE([cairo], [src])dnl
 CAIRO_CONFIG_MAKEFILE([cairo_boilerplate], [boilerplate])dnl
+CAIRO_MAKEFILE_INCLUDE(*,[Makefile.sources])dnl
+dnl An empty line per feature for readability
+CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,*,*,[])dnl
 
 
 dnl Collect list of all supported public headers
diff --git a/src/Makefile.am b/src/Makefile.am
index ebe501f..83eee4c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,6 +3,9 @@
 include $(top_srcdir)/build/Makefile.am.common
 include $(srcdir)/Makefile.am.features
 
+EXTRA_DIST += Makefile.win32      Makefile.win32.features
+MAINTAINERCLEANFILES += $(srcdir)/Makefile.win32.features
+
 AM_CPPFLAGS = -I$(srcdir) $(CAIRO_CFLAGS)
 
 if OS_WIN32
@@ -10,9 +13,8 @@ export_symbols = -export-symbols cairo.def
 cairo_def_dependency = cairo.def
 endif
 
-EXTRA_DIST += Makefile.win32
-EXTRA_DIST           += cairo-supported-features.h cairo-features-win32.h Makefile.win32.config
-MAINTAINERCLEANFILES += cairo-supported-features.h $(srcdir)/cairo-features-win32.h $(srcdir)/Makefile.win32.config
+EXTRA_DIST           += cairo-supported-features.h cairo-features-win32.h
+MAINTAINERCLEANFILES += cairo-supported-features.h $(srcdir)/cairo-features-win32.h
 
 $(top_builddir)/config.h: $(top_srcdir)/config.h.in
 	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) config.h
commit fd5cef50a7c856ef80b0a2191170c6a377071e78
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Sep 22 20:48:14 2008 -0400

    [aclocal] Add support for automake-only or win32-only makefiles

diff --git a/build/aclocal.makefile.m4 b/build/aclocal.makefile.m4
index 3a19369..df24c08 100644
--- a/build/aclocal.makefile.m4
+++ b/build/aclocal.makefile.m4
@@ -51,10 +51,24 @@ dnl Makefile's.
 dnl
 AC_DEFUN([CAIRO_CONFIG_MAKEFILE],
 [dnl
-	m4_append([_CAIRO_MAKEFILES], [$1], [ ])dnl
+	m4_append_uniq([_CAIRO_MAKEFILES], [$1], [ ])dnl
 	CAIRO_CONFIG_MAKEFILE_PRIVATE([$1], [$2])dnl
 ])dnl
 
+dnl Like CAIRO_CONFIG_MAKEFILE but only generate win32 makefile
+AC_DEFUN([CAIRO_CONFIG_MAKEFILE_WIN32],
+[dnl
+	m4_append_uniq([_CAIRO_MAKEFILES], [$1], [ ])dnl
+	CAIRO_CONFIG_MAKEFILE_PRIVATE_WIN32([$1], [$2])dnl
+])dnl
+
+dnl Like CAIRO_CONFIG_MAKEFILE but only generate automake makefile
+AC_DEFUN([CAIRO_CONFIG_MAKEFILE_AMAKE],
+[dnl
+	m4_append_uniq([_CAIRO_MAKEFILES], [$1], [ ])dnl
+	CAIRO_CONFIG_MAKEFILE_PRIVATE_AMAKE([$1], [$2])dnl
+])dnl
+
 dnl
 dnl CAIRO_CONFIG_MAKEFILE_PRIVATE(TAG, DIR)
 dnl
@@ -65,26 +79,50 @@ AC_DEFUN([CAIRO_CONFIG_MAKEFILE_PRIVATE],
 [dnl
 	m4_ifdef([cr_make_$1_dir],
 		 [m4_fatal([Makefile `$1' already registered])])dnl
-
-	dnl Remember directory for this makefile tag
         m4_define([cr_make_$1_dir],[$2])dnl
 
+	CAIRO_CONFIG_MAKEFILE_PRIVATE_AMAKE([$1],[$2])dnl
+	CAIRO_CONFIG_MAKEFILE_PRIVATE_WIN32([$1],[$2])dnl
+])dnl
+
+dnl Like CAIRO_CONFIG_MAKEFILE_PRIVATE but only generate automake makefile
+AC_DEFUN([CAIRO_CONFIG_MAKEFILE_PRIVATE_AMAKE],
+[dnl
+	m4_ifdef([cr_make_$1_dir_amake],
+		 [m4_fatal([Automake makefile `$1' already registered])])dnl
+        m4_define([cr_make_$1_dir_amake],[$2])dnl
+        m4_define([cr_make_$1_dir_any],[$2])dnl
+
 	dnl Accumulators
 	CAIRO_ACCUMULATORS_REGISTER(MAKEFILE_$1_AMAKE, m4_newline, [# Generated by configure.  Do not edit.]m4_newline[include $(top_srcdir)/$2/Makefile.sources]m4_newline)dnl
-	CAIRO_ACCUMULATORS_REGISTER(MAKEFILE_$1_WIN32, m4_newline, [# Generated by configure.  Do not edit.]m4_newline[ifeq ($(top_srcdir),)]m4_newline[include Makefile.sources]m4_newline[else]m4_newline[include $(top_srcdir)/$2/Makefile.sources]m4_newline[endif]m4_newline)dnl
 
 	dnl Generate
 	CAIRO_CONFIG_COMMANDS([$srcdir/$2/Makefile.am.features],
 			      [echo "$CAIRO_MAKEFILE_$1_AMAKE"],
 			      [CAIRO_MAKEFILE_$1_AMAKE='$CAIRO_MAKEFILE_$1_AMAKE'])dnl
+])dnl
+
+dnl Like CAIRO_CONFIG_MAKEFILE_PRIVATE but only generate win32 makefile
+AC_DEFUN([CAIRO_CONFIG_MAKEFILE_PRIVATE_WIN32],
+[dnl
+	m4_ifdef([cr_make_$1_dir_win32],
+		 [m4_fatal([Win32 makefile `$1' already registered])])dnl
+        m4_define([cr_make_$1_dir_win32],[$2])dnl
+        m4_define([cr_make_$1_dir_any],[$2])dnl
+
+	dnl Accumulators
+	CAIRO_ACCUMULATORS_REGISTER(MAKEFILE_$1_WIN32, m4_newline, [# Generated by configure.  Do not edit.]m4_newline[ifeq ($(top_srcdir),)]m4_newline[include Makefile.sources]m4_newline[else]m4_newline[include $(top_srcdir)/$2/Makefile.sources]m4_newline[endif]m4_newline)dnl
+
+	dnl Generate
 	CAIRO_CONFIG_COMMANDS([$srcdir/$2/Makefile.win32.features],
 			      [echo "$CAIRO_MAKEFILE_$1_WIN32"],
 			      [CAIRO_MAKEFILE_$1_WIN32='$CAIRO_MAKEFILE_$1_WIN32'])dnl
 ])dnl
 
+
 m4_define([_CAIRO_MAKEFILE_CHECK],
 [dnl
-        m4_ifdef([cr_make_$1_dir],,[m4_fatal([Makefile `]$1[' not defined.])])dnl
+        m4_ifdef([cr_make_$1_dir_any],,[m4_fatal([Makefile `]$1[' not defined.])])dnl
 ])dnl
 
 m4_pattern_allow([cr_make_tmp])
@@ -103,8 +141,12 @@ AC_DEFUN([CAIRO_MAKEFILE_ACCUMULATE],
 		m4_pushdef([cr_make_acc_contents],[$2])dnl
 		cr_make_tmp=_CAIRO_SH_ESCAPE(cr_make_acc_contents(cr_makefile))
 		m4_popdef([cr_make_acc_contents])dnl
-		CAIRO_ACCUMULATE_UNQUOTED_UNCHECKED([MAKEFILE_]cr_makefile[_AMAKE], [$cr_make_tmp])dnl
-		CAIRO_ACCUMULATE_UNQUOTED_UNCHECKED([MAKEFILE_]cr_makefile[_WIN32], [$cr_make_tmp])dnl
+		m4_ifdef([cr_make_]cr_makefile[_dir_amake],dnl
+			 [CAIRO_ACCUMULATE_UNQUOTED_UNCHECKED([MAKEFILE_]cr_makefile[_AMAKE], [$cr_make_tmp])]
+		)dnl
+		m4_ifdef([cr_make_]cr_makefile[_dir_win32],dnl
+			 [CAIRO_ACCUMULATE_UNQUOTED_UNCHECKED([MAKEFILE_]cr_makefile[_WIN32], [$cr_make_tmp])]
+		)dnl
 	])dnl
 ])dnl
 
@@ -144,16 +186,20 @@ AC_DEFUN([CAIRO_MAKEFILE_ACCUMULATE_FEATURE],
 		m4_foreach_w([cr_makefile], m4_if([$1],[*],_CAIRO_MAKEFILES,[$1]),
 		[dnl
 			cr_make_tmp=_CAIRO_SH_ESCAPE(cr_make_acc_contents]]m4_len(cr_make_acc_counter)([[cr_makefile,]][$][1],[$][2],[$][3],[$][4])[[)
-			_CAIRO_MAKEFILE_ACCUMULATE_FEATURE(
+			m4_ifdef([cr_make_]cr_makefile[_dir_amake],
+			[_CAIRO_MAKEFILE_ACCUMULATE_FEATURE(
 				[MAKEFILE_]cr_makefile[_AMAKE],
 				[$2],
 				[if ]cr_feature_tag, [else], [endif],
-				[$cr_make_tmp])dnl
-			_CAIRO_MAKEFILE_ACCUMULATE_FEATURE(
+				[$cr_make_tmp])
+			])dnl
+			m4_ifdef([cr_make_]cr_makefile[_dir_win32],
+			[_CAIRO_MAKEFILE_ACCUMULATE_FEATURE(
 				[MAKEFILE_]cr_makefile[_WIN32],
 				[$2],
 				[ifeq ($(]cr_feature_tag[),1)], [else], [endif],
 				[$cr_make_tmp])dnl
+			])dnl
 		])dnl
 	])dnl
 ])dnl
commit 42e4103015981b874035fac4f5e70018568db0d9
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Sep 22 20:33:23 2008 -0400

    [aclocal] Don't do automake conditionals for builtin features

diff --git a/build/aclocal.makefile.m4 b/build/aclocal.makefile.m4
index 584776c..3a19369 100644
--- a/build/aclocal.makefile.m4
+++ b/build/aclocal.makefile.m4
@@ -28,8 +28,8 @@ AC_DEFUN([CAIRO_INIT_MAKEFILES],
 	dnl Allow feature tags in the output
 	m4_pattern_allow(^CAIRO_HAS_)dnl
 
-	dnl Automake conditionals for all features
-	CAIRO_FEATURE_HOOK_REGISTER(*,*,*,
+	dnl Automake conditionals for non-builtin features
+	CAIRO_FEATURE_HOOK_REGISTER(*,!always,*,
 	[dnl
 		AM_CONDITIONAL(cr_feature_tag, [test "x$use_]cr_feature[" = xyes])dnl
 	])dnl
commit 79bc967a0dd1319035f0b915759eb86a49007f8d
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Sep 22 20:20:02 2008 -0400

    [build] Make including Makefile.win32.features files more robust
    
    By using top_srcdir if available.  Make's include is relative to
    current dir, not the Makefile being processed.  That makes it hard
    to include Makefile's relatively.

diff --git a/build/aclocal.makefile.m4 b/build/aclocal.makefile.m4
index 29fb07a..584776c 100644
--- a/build/aclocal.makefile.m4
+++ b/build/aclocal.makefile.m4
@@ -71,7 +71,7 @@ AC_DEFUN([CAIRO_CONFIG_MAKEFILE_PRIVATE],
 
 	dnl Accumulators
 	CAIRO_ACCUMULATORS_REGISTER(MAKEFILE_$1_AMAKE, m4_newline, [# Generated by configure.  Do not edit.]m4_newline[include $(top_srcdir)/$2/Makefile.sources]m4_newline)dnl
-	CAIRO_ACCUMULATORS_REGISTER(MAKEFILE_$1_WIN32, m4_newline, [# Generated by configure.  Do not edit.]m4_newline[include Makefile.sources]m4_newline)dnl
+	CAIRO_ACCUMULATORS_REGISTER(MAKEFILE_$1_WIN32, m4_newline, [# Generated by configure.  Do not edit.]m4_newline[ifeq ($(top_srcdir),)]m4_newline[include Makefile.sources]m4_newline[else]m4_newline[include $(top_srcdir)/$2/Makefile.sources]m4_newline[endif]m4_newline)dnl
 
 	dnl Generate
 	CAIRO_CONFIG_COMMANDS([$srcdir/$2/Makefile.am.features],
commit e686a00da8a84d28b7a00698a4fd744cd4dfd867
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Sep 22 20:11:10 2008 -0400

    [build] Add CAIRO_CONFIG_MAKEFILE_PRIVATE

diff --git a/build/aclocal.makefile.m4 b/build/aclocal.makefile.m4
index 3f394de..29fb07a 100644
--- a/build/aclocal.makefile.m4
+++ b/build/aclocal.makefile.m4
@@ -51,8 +51,20 @@ dnl Makefile's.
 dnl
 AC_DEFUN([CAIRO_CONFIG_MAKEFILE],
 [dnl
-	m4_append_uniq([_CAIRO_MAKEFILES], [$1], [ ],,
-		     [m4_fatal([Makefile `$1' already registered])])dnl
+	m4_append([_CAIRO_MAKEFILES], [$1], [ ])dnl
+	CAIRO_CONFIG_MAKEFILE_PRIVATE([$1], [$2])dnl
+])dnl
+
+dnl
+dnl CAIRO_CONFIG_MAKEFILE_PRIVATE(TAG, DIR)
+dnl
+dnl Like CAIRO_CONFIG_MAKEFILE but this makefile tag won't match
+dnl against '*' in makefile accumulators.
+dnl
+AC_DEFUN([CAIRO_CONFIG_MAKEFILE_PRIVATE],
+[dnl
+	m4_ifdef([cr_make_$1_dir],
+		 [m4_fatal([Makefile `$1' already registered])])dnl
 
 	dnl Remember directory for this makefile tag
         m4_define([cr_make_$1_dir],[$2])dnl
@@ -99,19 +111,19 @@ AC_DEFUN([CAIRO_MAKEFILE_ACCUMULATE],
 m4_define([_CAIRO_MAKEFILE_ACCUMULATE_FEATURE],
 [dnl
 	dnl Don't do a conditional for default=always features
-	m4_pushdef([_cr_mk_acc_feat_enabled],m4_if([$2],[yes],[m4_if(cr_feature_default,[always],[*],[$2])],[$2]))dnl
-	m4_case(_cr_mk_acc_feat_enabled,
+	m4_pushdef([cr_mk_acc_feat_enabled],m4_if([$2],[yes],[m4_if(cr_feature_default,[always],[*],[$2])],[$2]))dnl
+	m4_case(cr_mk_acc_feat_enabled,
 		[*],,
 		[yes],	[CAIRO_ACCUMULATE([$1], [$3])],
 		[no],	[CAIRO_ACCUMULATE([$1], [$3]m4_newline[$4])],
 			[m4_fatal([Invalid ENABLED value `]$2['])])dnl
 	CAIRO_ACCUMULATE_UNQUOTED_UNCHECKED([$1], [$6])dnl
-	m4_case(_cr_mk_acc_feat_enabled,
+	m4_case(cr_mk_acc_feat_enabled,
 		[*],,
 		[yes],	[CAIRO_ACCUMULATE([$1], [$5])],
 		[no],	[CAIRO_ACCUMULATE([$1], [$5])],
 			[m4_fatal([Invalid ENABLED value `]$2['])])dnl
-	m4_popdef([_cr_mk_acc_feat_enabled])dnl
+	m4_popdef([cr_mk_acc_feat_enabled])dnl
 ])dnl
 
 dnl
commit 0ac7a242f829bd31fd7fe12e886fba687ea6dc5e
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Sep 22 19:43:08 2008 -0400

    [build] Add Makefile.win32.common

diff --git a/Makefile.win32 b/Makefile.win32
index e1a78a4..1e80365 100644
--- a/Makefile.win32
+++ b/Makefile.win32
@@ -1,34 +1,7 @@
-#
-# Win32 makefile
-#
-
-CC := cl
-LINK := link
-
-ifeq ($(CFG),debug)
-OPT := -Od -Zi
-else
-OPT := -O2
-endif
-
-PIXMAN_CFLAGS := -I../../pixman/pixman
-PIXMAN_LIBS := ../../pixman/pixman/$(CFG)/pixman-1.lib
-
-EXE_LDFLAGS = libpng.lib zlib.lib gdi32.lib msimg32.lib user32.lib
-
-DEFAULT_CFLAGS = -MD -nologo $(OPT)
-DEFAULT_CFLAGS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
-DEFAULT_CFLAGS += -I. 
-DEFAULT_CFLAGS += $(PIXMAN_CFLAGS)
-
-CFLAGS := $(DEFAULT_CFLAGS)
-
-
-# Only if this was called as the top-level makefile
-ifeq ($(SUBMAKEFILE),)
+top_srcdir = .
+include $(top_srcdir)/build/Makefile.win32.common
 
 SUBDIRS = src
-
 TEST_SUBDIRS = boilerplate test
 
 all: inform cairo
@@ -52,29 +25,3 @@ test: cairo
 
 html:
 	@(cd test ; make -f Makefile.win32 html)
-
-inform:
-ifneq ($(CFG),release)
-ifneq ($(CFG),debug)
-	@echo "Invalid configuration "$(CFG)" specified."
-	@echo -n "You must specify a configuration when "
-	@echo "running make, e.g. make CFG=debug"
-	@echo
-	@echo -n "Possible choices for configuration are "
-	@echo "'release' and 'debug'"
-	@exit 1
-endif
-endif
-
-endif
-
-# Some generic rules
-
-$(CFG)/%.obj: %.c
-	@mkdir -p $(CFG)
-	@$(CC) $(CFLAGS) -c -Fo"$@" $<
-
-$(CFG)/%-static.obj: %.c
-	@mkdir -p $(CFG)
-	@$(CC) $(CFLAGS) -c -DCAIRO_WIN32_STATIC_BUILD=1 -Fo"$@" $<
-
diff --git a/boilerplate/Makefile.win32 b/boilerplate/Makefile.win32
index b1fcf36..4ea9a52 100644
--- a/boilerplate/Makefile.win32
+++ b/boilerplate/Makefile.win32
@@ -1,6 +1,5 @@
-SUBMAKEFILE = 1
-
-include ../Makefile.win32
+top_srcdir = ..
+include $(top_srcdir)/build/Makefile.win32.common
 include Makefile.win32.config
 
 CFLAGS += -I../src
@@ -18,19 +17,3 @@ all: $(CFG)/boiler.lib
 
 $(CFG)/boiler.lib: $(OBJECTS)
 	lib -NOLOGO -OUT:$@ $(OBJECTS) $(WIN_LIBS)
-
-clean:
-	@rm -f $(CFG)/*.obj $(CFG)/*.dll $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk || exit 0
-
-inform:
-ifneq ($(CFG),release)
-ifneq ($(CFG),debug)
-	@echo "Invalid configuration "$(CFG)" specified."
-	@echo -n "You must specify a configuration when "
-	@echo "running make, e.g. make CFG=debug"
-	@echo
-	@echo -n "Possible choices for configuration are "
-	@echo "'release' and 'debug'"
-	@exit 1
-endif
-endif
diff --git a/build/Makefile.win32.common b/build/Makefile.win32.common
new file mode 100644
index 0000000..09cafa9
--- /dev/null
+++ b/build/Makefile.win32.common
@@ -0,0 +1,47 @@
+
+CC := cl
+LINK := link
+
+ifeq ($(CFG),debug)
+OPT := -Od -Zi
+else
+OPT := -O2
+endif
+
+PIXMAN_CFLAGS := -I../../pixman/pixman
+PIXMAN_LIBS := ../../pixman/pixman/$(CFG)/pixman-1.lib
+
+EXE_LDFLAGS = libpng.lib zlib.lib gdi32.lib msimg32.lib user32.lib
+
+DEFAULT_CFLAGS = -MD -nologo $(OPT)
+DEFAULT_CFLAGS += -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE
+DEFAULT_CFLAGS += -I. 
+DEFAULT_CFLAGS += $(PIXMAN_CFLAGS)
+
+CFLAGS := $(DEFAULT_CFLAGS)
+
+inform:
+ifneq ($(CFG),release)
+ifneq ($(CFG),debug)
+	@echo "Invalid configuration "$(CFG)" specified."
+	@echo -n "You must specify a configuration when "
+	@echo "running make, e.g. make CFG=debug"
+	@echo
+	@echo -n "Possible choices for configuration are "
+	@echo "'release' and 'debug'"
+	@exit 1
+endif
+endif
+
+# Some generic rules
+
+$(CFG)/%.obj: %.c
+	@mkdir -p $(CFG)
+	@$(CC) $(CFLAGS) -c -Fo"$@" $<
+
+$(CFG)/%-static.obj: %.c
+	@mkdir -p $(CFG)
+	@$(CC) $(CFLAGS) -c -DCAIRO_WIN32_STATIC_BUILD=1 -Fo"$@" $<
+
+clean:
+	@rm -f $(CFG)/*.obj $(CFG)/*.dll $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk || exit 0
diff --git a/perf/Makefile.win32 b/perf/Makefile.win32
index 37b5143..47e73c4 100644
--- a/perf/Makefile.win32
+++ b/perf/Makefile.win32
@@ -1,11 +1,5 @@
-#
-# Win32 makefile
-#
-
-
-SUBMAKEFILE = 1
-
-include ../Makefile.win32
+top_srcdir = ..
+include $(top_srcdir)/build/Makefile.win32.common
 
 LDFLAGS += ../src/$(CFG)/cairo-static.lib $(PIXMAN_LIBS) ../boilerplate/$(CFG)/boiler.lib $(EXE_LDFLAGS)
 
@@ -44,19 +38,3 @@ $(CFG)/cairo-perf.exe: $(OBJECTS)
 cairo-perf-diff-files:
 	@mkdir -p $(CFG)
 	@$(CC) $(CFLAGS) -Fe"$@" cairo-perf-diff-files.c cairo-stats.c -link $(LDFLAGS)
-
-clean:
-	@rm -f $(CFG)/*.obj $(CFG)/*.exe $(CFG)/*.dll $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk || exit 0
-
-inform:
-ifneq ($(CFG),release)
-ifneq ($(CFG),debug)
-	@echo "Invalid configuration "$(CFG)" specified."
-	@echo -n "You must specify a configuration when "
-	@echo "running make, e.g. make CFG=debug"
-	@echo
-	@echo -n "Possible choices for configuration are "
-	@echo "'release' and 'debug'"
-	@exit 1
-endif
-endif
diff --git a/src/Makefile.win32 b/src/Makefile.win32
index b57478d..6f4e89d 100644
--- a/src/Makefile.win32
+++ b/src/Makefile.win32
@@ -1,7 +1,6 @@
-SUBMAKEFILE = 1
-
-include ../Makefile.win32
-include Makefile.win32.config
+top_srcdir = ..
+include $(top_srcdir)/build/Makefile.win32.common
+include Makefile.win32.features
 
 SOURCES = $(enabled_cairo_sources)
 
@@ -19,19 +18,3 @@ $(CFG)/cairo.dll: $(OBJECTS)
 
 $(CFG)/cairo-static.lib: $(OBJECTS) $(STATIC_OBJECTS)
 	lib -NOLOGO -OUT:$@ $(PIXMAN_LIBS) $(OBJECTS) $(STATIC_OBJECTS)
-
-clean:
-	@rm -f $(CFG)/*.obj $(CFG)/*.dll $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk || exit 0
-
-inform:
-ifneq ($(CFG),release)
-ifneq ($(CFG),debug)
-	@echo "Invalid configuration "$(CFG)" specified."
-	@echo -n "You must specify a configuration when "
-	@echo "running make, e.g. make CFG=debug"
-	@echo
-	@echo -n "Possible choices for configuration are "
-	@echo "'release' and 'debug'"
-	@exit 1
-endif
-endif
diff --git a/test/Makefile.win32 b/test/Makefile.win32
index e8fea28..003d96a 100644
--- a/test/Makefile.win32
+++ b/test/Makefile.win32
@@ -1,7 +1,5 @@
-
-SUBMAKEFILE = 1
-
-include ../Makefile.win32
+top_srcdir = ..
+include $(top_srcdir)/build/Makefile.win32.common
 
 CFLAGS += -I../src -I../boilerplate -I./pdiff
 
@@ -121,19 +119,3 @@ test: $(TEST_EXE)
 html:
 	@echo Creating index.html...
 	@perl make-html.pl > index.html
-
-clean:
-	@rm -f $(CFG)/*.obj $(CFG)/*.dll $(CFG)/*.lib $(CFG)/*.pdb $(CFG)/*.ilk $(CFG)/*.exe || exit 0
-
-inform:
-ifneq ($(CFG),release)
-ifneq ($(CFG),debug)
-	@echo "Invalid configuration "$(CFG)" specified."
-	@echo -n "You must specify a configuration when "
-	@echo "running make, e.g. make CFG=debug"
-	@echo
-	@echo -n "Possible choices for configuration are "
-	@echo "'release' and 'debug'"
-	@exit 1
-endif
-endif
diff --git a/test/pdiff/Makefile.win32 b/test/pdiff/Makefile.win32
index fccd7e9..5e6680d 100644
--- a/test/pdiff/Makefile.win32
+++ b/test/pdiff/Makefile.win32
@@ -1,7 +1,5 @@
-
-SUBMAKEFILE = 1
-
-include ../../Makefile.win32
+top_srcdir = ../..
+include $(top_srcdir)/build/Makefile.win32.common
 
 CFLAGS += -I../../src
 
commit 984320dff11d42d698ff5355c6befe0c5d32df59
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Sep 22 19:29:17 2008 -0400

    [build] Don't define feature variables in Makefile.win32.features
    
    This is not the right place to do that as one also needs to adjust
    cairo-features.h.  Working on a proper fix.

diff --git a/build/aclocal.makefile.m4 b/build/aclocal.makefile.m4
index 9e84a39..3f394de 100644
--- a/build/aclocal.makefile.m4
+++ b/build/aclocal.makefile.m4
@@ -3,22 +3,6 @@ dnl These are the facilities for generating Makefile.am.features and
 dnl Makefile.win32.features files.
 dnl
 
-dnl
-dnl CAIRO_FEATURE_HOOK_REGISTER_WIN32(WHAT, COMMANDS)
-dnl
-dnl Like CAIRO_FEATURE_HOOK_REGISTER but only applies to features that
-dnl are by default enabled on win32 build system and match WHAT.
-dnl
-AC_DEFUN([CAIRO_FEATURE_HOOK_REGISTER_WIN32],
-[dnl
-	dnl builtin features
-	CAIRO_FEATURE_HOOK_REGISTER([*], always, [$1], [$2])dnl
-	dnl recommended features
-	CAIRO_FEATURE_HOOK_REGISTER([*], yes, [$1], [$2])dnl
-	dnl native win32 features
-	CAIRO_FEATURE_HOOK_REGISTER([*], auto, [$1], [m4_bmatch(cr_feature, [win32], [$2])])dnl
-])dnl
-
 dnl ===========================================================================
 
 dnl
@@ -52,17 +36,6 @@ AC_DEFUN([CAIRO_INIT_MAKEFILES],
 
 	dnl An empty line per feature for readability
 	CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,*,*,[])dnl
-
-	dnl Turn win32 features on
-	CAIRO_FEATURE_HOOK_REGISTER_WIN32(*, [_CAIRO_MAKEFILES_WIN32_DEFINE_FEATURE])dnl
-])dnl
-
-m4_define([_CAIRO_MAKEFILES_WIN32_DEFINE_FEATURE],
-[
-	m4_foreach_w([cr_makefile], _CAIRO_MAKEFILES,
-	[dnl
-		CAIRO_ACCUMULATE([MAKEFILE_]cr_makefile[_WIN32], [ifeq ($(]cr_feature_tag[),)]m4_newline[]cr_feature_tag[ = 1]m4_newline[endif])dnl
-	])dnl
 ])dnl
 
 dnl ===========================================================================
diff --git a/build/configure.ac.features b/build/configure.ac.features
index 3660e8e..13b7ede 100644
--- a/build/configure.ac.features
+++ b/build/configure.ac.features
@@ -234,12 +234,6 @@ CAIRO_FEATURE_HOOK_REGISTER(no,!no,!,
 [dnl
 	CAIRO_ACCUMULATE(NO_FEATURES, cr_feature_tag)
 ])dnl
-dnl Collect list of public features to enable on win32 build system
-CAIRO_ACCUMULATORS_REGISTER(WIN32_FEATURES,[ ])dnl
-CAIRO_FEATURE_HOOK_REGISTER_WIN32(!,
-[dnl
-	CAIRO_ACCUMULATE(WIN32_FEATURES, cr_feature_tag)
-])dnl
 
 dnl Generate src/cairo-features.h
 CAIRO_CONFIG_COMMANDS([src/cairo-features.h],
@@ -285,22 +279,6 @@ CAIRO_FEATURE_HOOK_REGISTER(yes,*,,
 	AC_DEFINE(cr_feature_tag, 1, [Define to 1 to enable cairo's ]cr_feature_name[ feature])
 ])dnl
 
-dnl Generate src/cairo-features-win32.h
-CAIRO_CONFIG_COMMANDS([$srcdir/src/cairo-features-win32.h],
-[dnl
-	echo '/* Generated by configure.  Do not edit. */'
-	echo '#ifndef CAIRO_FEATURES_H'
-	echo '#define CAIRO_FEATURES_H'
-	echo ''
-	for FEATURE in $CAIRO_WIN32_FEATURES; do
-		echo "#define $FEATURE 1"
-	done
-	echo ''
-	echo '#endif'
-],[dnl
-	CAIRO_WIN32_FEATURES='$CAIRO_WIN32_FEATURES'
-])dnl
-
 dnl ===========================================================================
 dnl
 dnl Report
commit eb9ce580597b9ac639dd3dc15576774d753c44b6
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Sep 22 19:23:41 2008 -0400

    [build] Don't generate Makefile conditionals for default=always features

diff --git a/build/aclocal.makefile.m4 b/build/aclocal.makefile.m4
index 8891ea0..9e84a39 100644
--- a/build/aclocal.makefile.m4
+++ b/build/aclocal.makefile.m4
@@ -125,17 +125,20 @@ AC_DEFUN([CAIRO_MAKEFILE_ACCUMULATE],
 
 m4_define([_CAIRO_MAKEFILE_ACCUMULATE_FEATURE],
 [dnl
-	m4_case([$2],
+	dnl Don't do a conditional for default=always features
+	m4_pushdef([_cr_mk_acc_feat_enabled],m4_if([$2],[yes],[m4_if(cr_feature_default,[always],[*],[$2])],[$2]))dnl
+	m4_case(_cr_mk_acc_feat_enabled,
 		[*],,
 		[yes],	[CAIRO_ACCUMULATE([$1], [$3])],
 		[no],	[CAIRO_ACCUMULATE([$1], [$3]m4_newline[$4])],
 			[m4_fatal([Invalid ENABLED value `]$2['])])dnl
 	CAIRO_ACCUMULATE_UNQUOTED_UNCHECKED([$1], [$6])dnl
-	m4_case([$2],
+	m4_case(_cr_mk_acc_feat_enabled,
 		[*],,
 		[yes],	[CAIRO_ACCUMULATE([$1], [$5])],
 		[no],	[CAIRO_ACCUMULATE([$1], [$5])],
 			[m4_fatal([Invalid ENABLED value `]$2['])])dnl
+	m4_popdef([_cr_mk_acc_feat_enabled])dnl
 ])dnl
 
 dnl
commit caa3dbd61be8a46f576a60f00845269269200c99
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Sep 22 19:11:52 2008 -0400

    [build] Make Makefile.*.features files more readable
    
    By inserting a new line before each feature entry.

diff --git a/build/aclocal.makefile.m4 b/build/aclocal.makefile.m4
index f6febde..8891ea0 100644
--- a/build/aclocal.makefile.m4
+++ b/build/aclocal.makefile.m4
@@ -51,7 +51,7 @@ AC_DEFUN([CAIRO_INIT_MAKEFILES],
 	])dnl
 
 	dnl An empty line per feature for readability
-	CAIRO_MAKEFILE_ACCUMULATE(*,[]m4_newline[])dnl
+	CAIRO_MAKEFILE_ACCUMULATE_FEATURE(*,*,*,*,[])dnl
 
 	dnl Turn win32 features on
 	CAIRO_FEATURE_HOOK_REGISTER_WIN32(*, [_CAIRO_MAKEFILES_WIN32_DEFINE_FEATURE])dnl
commit 23b9767bb3b35995099ae9c7b3d84f18e7a76dcc
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Mon Sep 22 17:34:36 2008 -0400

    Rename Makefile.*.config to Makefile.*.features as they should not be modified
    
    The .config naming was giving people the impression that they can modify it.
    That's not the case.

diff --git a/autogen.sh b/autogen.sh
index f3170ba..7fd7605 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -169,9 +169,9 @@ do_cmd $ACLOCAL $ACLOCAL_FLAGS
 
 do_cmd $AUTOHEADER
 
-# create dummy */Makefile.am.config and ChangeLog to make automake happy
-> boilerplate/Makefile.am.config
-> src/Makefile.am.config
+# create dummy */Makefile.am.features and ChangeLog to make automake happy
+> boilerplate/Makefile.am.features
+> src/Makefile.am.features
 touch ChangeLog
 
 # We don't call gtkdocize right now.  When we do, we should then modify
diff --git a/boilerplate/Makefile.am b/boilerplate/Makefile.am
index 22f66a8..80e3e6d 100644
--- a/boilerplate/Makefile.am
+++ b/boilerplate/Makefile.am
@@ -1,7 +1,7 @@
 # Note: All source files are listed in Makefile.sources.
 
 include $(top_srcdir)/build/Makefile.am.common
-include $(srcdir)/Makefile.am.config
+include $(srcdir)/Makefile.am.features
 
 AM_CPPFLAGS = \
 	-I$(srcdir) \
diff --git a/build/aclocal.makefile.m4 b/build/aclocal.makefile.m4
index 1602a32..f6febde 100644
--- a/build/aclocal.makefile.m4
+++ b/build/aclocal.makefile.m4
@@ -1,6 +1,6 @@
 dnl
-dnl These are the facilities for generating Makefile.am.config and
-dnl Makefile.win32.config files.
+dnl These are the facilities for generating Makefile.am.features and
+dnl Makefile.win32.features files.
 dnl
 
 dnl
@@ -72,7 +72,7 @@ m4_define([_CAIRO_MAKEFILES])dnl
 dnl
 dnl CAIRO_CONFIG_MAKEFILE(TAG, DIR)
 dnl
-dnl Create DIR/Makefile.*.config files
+dnl Create DIR/Makefile.*.features files
 dnl TAG is a TAG used by other CAIRO_MAKEFILE_* macros to append to these
 dnl Makefile's.
 dnl
@@ -89,10 +89,10 @@ AC_DEFUN([CAIRO_CONFIG_MAKEFILE],
 	CAIRO_ACCUMULATORS_REGISTER(MAKEFILE_$1_WIN32, m4_newline, [# Generated by configure.  Do not edit.]m4_newline[include Makefile.sources]m4_newline)dnl
 
 	dnl Generate
-	CAIRO_CONFIG_COMMANDS([$srcdir/$2/Makefile.am.config],
+	CAIRO_CONFIG_COMMANDS([$srcdir/$2/Makefile.am.features],
 			      [echo "$CAIRO_MAKEFILE_$1_AMAKE"],
 			      [CAIRO_MAKEFILE_$1_AMAKE='$CAIRO_MAKEFILE_$1_AMAKE'])dnl
-	CAIRO_CONFIG_COMMANDS([$srcdir/$2/Makefile.win32.config],
+	CAIRO_CONFIG_COMMANDS([$srcdir/$2/Makefile.win32.features],
 			      [echo "$CAIRO_MAKEFILE_$1_WIN32"],
 			      [CAIRO_MAKEFILE_$1_WIN32='$CAIRO_MAKEFILE_$1_WIN32'])dnl
 ])dnl
diff --git a/doc/public/Makefile.am b/doc/public/Makefile.am
index b4db8b7..00ab27d 100644
--- a/doc/public/Makefile.am
+++ b/doc/public/Makefile.am
@@ -1,5 +1,5 @@
 include $(top_srcdir)/build/Makefile.am.common
-include $(top_srcdir)/src/Makefile.am.config
+include $(top_srcdir)/src/Makefile.am.features
 
 # The name of the module.
 DOC_MODULE=cairo
diff --git a/src/Makefile.am b/src/Makefile.am
index 4b6d86b..ebe501f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,7 @@
 # Note: All source files are listed in Makefile.sources.
 
 include $(top_srcdir)/build/Makefile.am.common
-include $(srcdir)/Makefile.am.config
+include $(srcdir)/Makefile.am.features
 
 AM_CPPFLAGS = -I$(srcdir) $(CAIRO_CFLAGS)
 


More information about the cairo-commit mailing list