diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-01-07 18:11:43 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2018-01-07 18:11:43 +0100 |
commit | bcb0f034b6ed1e2b0f362747287479e17c9da2de (patch) | |
tree | 27e690dad9de919d0ad232b7151914d906ffb7bd /src/blogc-make | |
parent | 08050afb48e347b61f45e28a771974ecb2fc0e18 (diff) | |
download | blogc-bcb0f034b6ed1e2b0f362747287479e17c9da2de.tar.gz blogc-bcb0f034b6ed1e2b0f362747287479e17c9da2de.tar.bz2 blogc-bcb0f034b6ed1e2b0f362747287479e17c9da2de.zip |
make: use embedded blogc, if possible
Diffstat (limited to 'src/blogc-make')
-rw-r--r-- | src/blogc-make/exec.c | 13 |
1 files changed, 13 insertions, 0 deletions
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 <config.h> +#endif /* HAVE_CONFIG_H */ + #include <stdbool.h> #include <stdlib.h> #include <stdio.h> @@ -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) { |