[cairo-commit] 4 commits - build/Makefile.win32.common build/Makefile.win32.inform Makefile.am Makefile.win32 test/any2ppm.c test/cairo-test.c test/Makefile.win32

Andrea Canciani ranma42 at kemper.freedesktop.org
Thu Feb 16 14:52:25 PST 2012


 Makefile.am                 |    1 +
 Makefile.win32              |    8 +++++++-
 build/Makefile.win32.common |   15 +--------------
 build/Makefile.win32.inform |   13 +++++++++++++
 test/Makefile.win32         |   28 ++++++++++++++++++++++++----
 test/any2ppm.c              |   12 +++++++++---
 test/cairo-test.c           |    3 +++
 7 files changed, 58 insertions(+), 22 deletions(-)

New commits:
commit 93b0fcffc7a098333aa219ce0d59b7f9d1ac35e6
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Thu Feb 16 19:53:56 2012 +0100

    test: Create output directory even on Win32
    
    This avoids cluttering the test directory with thousands of PNG files
    and makes the behavior more consistent with other OSes.

diff --git a/test/cairo-test.c b/test/cairo-test.c
index 9e0341b..c5ef843 100644
--- a/test/cairo-test.c
+++ b/test/cairo-test.c
@@ -73,7 +73,10 @@
 
 #ifdef _MSC_VER
 #include <crtdbg.h>
+#include <direct.h>
 #define F_OK 0
+#define HAVE_MKDIR 1
+#define mkdir _mkdir
 #endif
 
 #ifndef FALSE
commit 80c46d400b0bc329ca3b09eb87684920ec1045ef
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Fri Nov 11 18:16:04 2011 +0100

    test: Fix any2ppm on MSVC
    
    C99 initialization is not allowed.
    
    Error macros are used even in the non-daemon version, hence errno.h
    should always be included.
    
    Fixes:
    
    any2ppm.c(107) : error C2065: 'EINTR' : undeclared identifier
    any2ppm.c(107) : error C2051: case expression not constant
    any2ppm.c(108) : error C2065: 'EAGAIN' : undeclared identifier
    any2ppm.c(108) : error C2051: case expression not constant
    any2ppm.c(271) : error C2059: syntax error : '.'

diff --git a/test/any2ppm.c b/test/any2ppm.c
index 40c304b..0ae0877 100644
--- a/test/any2ppm.c
+++ b/test/any2ppm.c
@@ -77,6 +77,8 @@
 #include <libspectre/spectre.h>
 #endif
 
+#include <errno.h>
+
 #if HAVE_UNISTD_H && HAVE_FCNTL_H && HAVE_SIGNAL_H && HAVE_SYS_STAT_H && HAVE_SYS_SOCKET_H && HAVE_SYS_POLL_H && HAVE_SYS_UN_H
 #include <fcntl.h>
 #include <signal.h>
@@ -84,7 +86,6 @@
 #include <sys/socket.h>
 #include <sys/poll.h>
 #include <sys/un.h>
-#include <errno.h>
 
 #define SOCKET_PATH "./.any2ppm"
 #define TIMEOUT 60000 /* 60 seconds */
@@ -268,8 +269,13 @@ _cairo_script_render_page (const char *filename,
     cairo_surface_t *surface = NULL;
     cairo_status_t status;
     const cairo_script_interpreter_hooks_t hooks = {
-	.closure = &surface,
-	.surface_create = _create_image,
+	&surface,
+	_create_image,
+	NULL, /* surface_destroy */
+	NULL, /* context_create */
+	NULL, /* context_destroy */
+	NULL, /* show_page */
+	NULL  /* copy_page */
     };
 
     csi = cairo_script_interpreter_create ();
commit b2d978a8150cb3f5bb66b3c3971fadc908d82e82
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Fri Nov 11 18:14:44 2011 +0100

    test: Compile any2ppm on Windows
    
    any2ppm is required in order to test the script backend.

diff --git a/test/Makefile.win32 b/test/Makefile.win32
index 5235769..5131b2b 100644
--- a/test/Makefile.win32
+++ b/test/Makefile.win32
@@ -2,9 +2,17 @@ top_srcdir = ..
 include $(top_srcdir)/build/Makefile.win32.common
 include $(top_srcdir)/test/Makefile.sources
 
-CFLAGS += -I$(top_srcdir)/boilerplate -I./pdiff
-
-TEST_LIBS = ./pdiff/$(CFG)/pdiff.lib $(top_builddir)/src/$(CFG)/cairo-static.lib $(top_builddir)/boilerplate/$(CFG)/boiler.lib
+CFLAGS += \
+	-I$(top_srcdir)/boilerplate \
+	-I$(top_srcdir)/util/cairo-script/ \
+	-I./pdiff \
+	$(NULL)
+
+TEST_LIBS = \
+	./pdiff/$(CFG)/pdiff.lib \
+	$(top_builddir)/boilerplate/$(CFG)/boiler.lib \
+	$(top_builddir)/src/$(CFG)/cairo-static.lib \
+	$(NULL)
 
 all: inform $(CFG)/cairo-test-suite.exe
 
@@ -15,9 +23,18 @@ SOURCES = $(cairo_test_suite_sources) $(test_sources) cairo-test-constructors.c
 
 OBJECTS = $(patsubst %.c, $(CFG)/%-static.obj, $(SOURCES))
 
+ANY2PPM_OBJS = \
+	$(CFG)/any2ppm-static.obj \
+	$(top_builddir)/util/cairo-script/$(CFG)/libcairo-script-interpreter.lib \
+	$(top_builddir)/src/$(CFG)/cairo-static.lib \
+	$(NULL)
+
 $(CFG)/cairo-test-suite.exe: $(OBJECTS) $(TEST_LIBS)
 	@$(LD) $(CAIRO_LDFLAGS) -OUT:$@ $(OBJECTS) $(TEST_LIBS) $(CAIRO_LIBS)
 
+$(CFG)/any2ppm.exe: $(ANY2PPM_OBJS)
+	$(LD) $(CAIRO_LDFLAGS) -OUT:$@ $^ $(CAIRO_LIBS)
+
 ./pdiff/$(CFG)/pdiff.lib:
 	$(MAKE) -C pdiff -f Makefile.win32
 
@@ -27,9 +44,12 @@ $(top_builddir)/src/$(CFG)/cairo-static.lib:
 $(top_builddir)/boilerplate/$(CFG)/boiler.lib:
 	$(MAKE) -C $(top_srcdir)/boilerplate -f Makefile.win32
 
+$(top_builddir)/util/cairo-script/$(CFG)/libcairo-script-interpreter.lib:
+	$(MAKE) -C $(top_srcdir)/util/cairo-script -f Makefile.win32
+
 .PHONY: check test
 
-check: inform $(CFG)/cairo-test-suite.exe
+check: inform $(CFG)/any2ppm.exe $(CFG)/cairo-test-suite.exe
 	./$(CFG)/cairo-test-suite.exe
 
 test: inform check
commit ed803a193585544d2c4a290e95700cf9b68d0f10
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Thu Feb 16 19:21:47 2012 +0100

    build: Add 'clean' target to Makefile.win32 build system
    
    The Makefile.win32 in the subdirectories provide a working 'clean'
    target (defined in Makefile.win32.common), the central Makefile.win32
    'clean' target does not do anything.
    
    Replace the noop 'clean' target with one that cleans all the subdirs.

diff --git a/Makefile.am b/Makefile.am
index 7c03294..e7f59d9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,6 +5,7 @@ EXTRA_DIST += \
 	README.win32 \
 	Makefile.win32 \
 	build/Makefile.win32.common \
+	build/Makefile.win32.inform \
 	build/Makefile.win32.features \
 	build/Makefile.win32.features-h \
 	$(NULL)
diff --git a/Makefile.win32 b/Makefile.win32
index f475246..e5a2c46 100644
--- a/Makefile.win32
+++ b/Makefile.win32
@@ -2,7 +2,7 @@
 # Edit build/Makefile.win32.common for customization
 
 top_srcdir = .
-include $(top_srcdir)/build/Makefile.win32.common
+include $(top_srcdir)/build/Makefile.win32.inform
 
 all: cairo
 
@@ -14,3 +14,9 @@ perf: inform
 
 test: inform
 	@$(MAKE) -C test -f Makefile.win32 test
+
+clean:
+	@$(MAKE) -C boilerplate -f Makefile.win32 clean
+	@$(MAKE) -C perf -f Makefile.win32 clean
+	@$(MAKE) -C src -f Makefile.win32 clean
+	@$(MAKE) -C test -f Makefile.win32 clean
diff --git a/build/Makefile.win32.common b/build/Makefile.win32.common
index eb3fb6b..01a38cd 100644
--- a/build/Makefile.win32.common
+++ b/build/Makefile.win32.common
@@ -3,6 +3,7 @@ default: all
 #
 # Edit build/Makefile.win32.features to enable features to build
 #
+include $(top_srcdir)/build/Makefile.win32.inform
 include $(top_srcdir)/build/Makefile.win32.features
 include $(top_srcdir)/build/Makefile.win32.features-h
 
@@ -48,20 +49,6 @@ DEFAULT_ARFLAGS = -nologo
 CAIRO_LDFLAGS = $(DEFAULT_LDFLAGS) $(LDFLAGS)
 CAIRO_ARFLAGS = $(DEFAULT_ARFLAGS) $(LDFLAGS)
 
-inform:
-	@echo
-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 $(top_srcdir)/src/cairo-features.h
diff --git a/build/Makefile.win32.inform b/build/Makefile.win32.inform
new file mode 100644
index 0000000..ba11165
--- /dev/null
+++ b/build/Makefile.win32.inform
@@ -0,0 +1,13 @@
+inform:
+	@echo
+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


More information about the cairo-commit mailing list