From bcb0f034b6ed1e2b0f362747287479e17c9da2de Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sun, 7 Jan 2018 18:11:43 +0100 Subject: make: use embedded blogc, if possible --- src/blogc-make/exec.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/blogc-make/exec.c b/src/blogc-make/exec.c index dc4ee22..dba7e5c 100644 --- a/src/blogc-make/exec.c +++ b/src/blogc-make/exec.c @@ -6,6 +6,10 @@ * See the file LICENSE. */ +#ifdef HAVE_CONFIG_H +#include +#endif /* HAVE_CONFIG_H */ + #include #include #include @@ -25,6 +29,15 @@ char* bm_exec_find_binary(const char *argv0, const char *bin, const char *env) { +#ifdef MAKE_EMBEDDED + // for embedded blogc-make, if we are looking for blogc, we just return + // argv0, because the static binary may not be named `blogc`, and we + // prefer to use our own `blogc` instead of some other version around. + if (0 == strcmp(bin, "blogc")) { + return bc_strdup(argv0); + } +#endif + // first try: env var const char *env_bin = getenv(env); if (env_bin != NULL) { -- cgit v1.2.3-18-g5258