diff options
author | Andrea Canciani <ranma42@gmail.com> | 2012-02-22 23:50:21 +0100 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2012-02-23 00:16:44 +0100 |
commit | d95cf87c03f2b4f2677450cae1d0be3aa15c0a97 (patch) | |
tree | 0042434422b1142f54f31ccc53533c350fa80723 /boilerplate | |
parent | 716a79bfcbc97401a9c43434783068b40da9a1f4 (diff) |
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.
Diffstat (limited to 'boilerplate')
-rw-r--r-- | boilerplate/cairo-boilerplate.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c index 89ab1ce03..41db8b887 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"); } |