[cairo-commit] boilerplate/cairo-boilerplate.c test/Makefile.win32

Andrea Canciani ranma42 at kemper.freedesktop.org
Wed Feb 22 15:17:46 PST 2012


 boilerplate/cairo-boilerplate.c |   11 +++++++++--
 test/Makefile.win32             |    2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit d95cf87c03f2b4f2677450cae1d0be3aa15c0a97
Author: Andrea Canciani <ranma42 at gmail.com>
Date:   Wed Feb 22 23:50:21 2012 +0100

    boilerplate: Use any2ppm from ANY2PPM env variable
    
    If the environment variable ANY2PPM is set, use it as the path to the
    any2ppm program. Otherwise, default to "./any2ppm" as before.
    
    This makes it possible to set the ANY2PPM variable in the
    Makefile.win32 build system, which makes it possible to use the "test"
    target on the script backend.

diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c
index 89ab1ce..41db8b8 100644
--- a/boilerplate/cairo-boilerplate.c
+++ b/boilerplate/cairo-boilerplate.c
@@ -790,16 +790,23 @@ cairo_boilerplate_open_any2ppm (const char   *filename,
 				int        (**close_cb) (FILE *))
 {
     char command[4096];
+    const char *any2ppm;
 #if HAS_DAEMON
     int sk;
     struct sockaddr_un addr;
     int len;
+#endif
+
+    any2ppm = getenv ("ANY2PPM");
+    if (any2ppm == NULL)
+	any2ppm = "./any2ppm";
 
+#if HAS_DAEMON
     if (flags & CAIRO_BOILERPLATE_OPEN_NO_DAEMON)
 	goto POPEN;
 
     if (! any2ppm_daemon_exists ()) {
-	if (system ("./any2ppm") != 0)
+	if (system (any2ppm) != 0)
 	    goto POPEN;
     }
 
@@ -829,7 +836,7 @@ POPEN:
 #endif
 
     *close_cb = pclose;
-    sprintf (command, "./any2ppm %s %d", filename, page);
+    sprintf (command, "%s %s %d", any2ppm, filename, page);
     return popen (command, "r");
 }
 
diff --git a/test/Makefile.win32 b/test/Makefile.win32
index 5131b2b..ba8ea5b 100644
--- a/test/Makefile.win32
+++ b/test/Makefile.win32
@@ -50,6 +50,6 @@ $(top_builddir)/util/cairo-script/$(CFG)/libcairo-script-interpreter.lib:
 .PHONY: check test
 
 check: inform $(CFG)/any2ppm.exe $(CFG)/cairo-test-suite.exe
-	./$(CFG)/cairo-test-suite.exe
+	@ANY2PPM=$(CFG)\\any2ppm.exe $(CFG)/cairo-test-suite.exe
 
 test: inform check


More information about the cairo-commit mailing list