You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2014/11/08 19:54:45 UTC

lucy-charmonizer git commit: Option to pass make command without auto-detection

Repository: lucy-charmonizer
Updated Branches:
  refs/heads/perl_build_with_make [created] e27e69383


Option to pass make command without auto-detection


Project: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/commit/e27e6938
Tree: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/tree/e27e6938
Diff: http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/diff/e27e6938

Branch: refs/heads/perl_build_with_make
Commit: e27e69383b43c50909872acb1a0ab84a60ba8f02
Parents: 4e612a8
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Wed Nov 5 16:39:10 2014 +0100
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Wed Nov 5 17:56:17 2014 +0100

----------------------------------------------------------------------
 src/Charmonizer/Core/Make.c | 18 ++++++++++--------
 src/Charmonizer/Core/Make.h |  4 +++-
 src/Charmonizer/Probe.c     |  3 ++-
 3 files changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/blob/e27e6938/src/Charmonizer/Core/Make.c
----------------------------------------------------------------------
diff --git a/src/Charmonizer/Core/Make.c b/src/Charmonizer/Core/Make.c
index a45fdd5..d1ba159 100644
--- a/src/Charmonizer/Core/Make.c
+++ b/src/Charmonizer/Core/Make.c
@@ -79,15 +79,17 @@ static void
 S_write_rule(chaz_MakeRule *rule, FILE *out);
 
 void
-chaz_Make_init(void) {
-    const char *make;
-
-    chaz_Make_detect("make", "gmake", "nmake", "dmake", "mingw32-make",
-                     "mingw64-make", NULL);
-    make = chaz_Make.make_command;
+chaz_Make_init(const char *make_command) {
+    if (make_command) {
+        chaz_Make.make_command = chaz_Util_strdup(make_command);
+    }
+    else {
+        chaz_Make_detect("make", "gmake", "nmake", "dmake", "mingw32-make",
+                         "mingw64-make", NULL);
+    }
 
-    if (make) {
-        if (strcmp(make, "nmake") == 0) {
+    if (chaz_Make.make_command) {
+        if (strcmp(chaz_Make.make_command, "nmake") == 0) {
             chaz_Make.shell_type = CHAZ_OS_CMD_EXE;
         }
         else {

http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/blob/e27e6938/src/Charmonizer/Core/Make.h
----------------------------------------------------------------------
diff --git a/src/Charmonizer/Core/Make.h b/src/Charmonizer/Core/Make.h
index e15c3a4..2d43f32 100644
--- a/src/Charmonizer/Core/Make.h
+++ b/src/Charmonizer/Core/Make.h
@@ -35,9 +35,11 @@ typedef void (*chaz_Make_list_files_callback_t)(const char *dir, char *file,
                                                 void *context);
 
 /** Initialize the environment.
+ *
+ * @param make_command Name of the make command. Auto-detect if NULL.
  */
 void
-chaz_Make_init(void);
+chaz_Make_init(const char *make_command);
 
 /** Clean up the environment.
  */

http://git-wip-us.apache.org/repos/asf/lucy-charmonizer/blob/e27e6938/src/Charmonizer/Probe.c
----------------------------------------------------------------------
diff --git a/src/Charmonizer/Probe.c b/src/Charmonizer/Probe.c
index 6fb2c09..95a0fc4 100644
--- a/src/Charmonizer/Probe.c
+++ b/src/Charmonizer/Probe.c
@@ -45,6 +45,7 @@ chaz_Probe_parse_cli_args(int argc, const char *argv[], chaz_CLI *cli) {
     chaz_CLI_register(cli, "enable-coverage", NULL, CHAZ_CLI_NO_ARG);
     chaz_CLI_register(cli, "cc", "compiler command", CHAZ_CLI_ARG_REQUIRED);
     chaz_CLI_register(cli, "cflags", NULL, CHAZ_CLI_ARG_REQUIRED);
+    chaz_CLI_register(cli, "make", "make command", 0);
 
     /* Parse options, exiting on failure. */
     if (!chaz_CLI_parse(cli, argc, argv)) {
@@ -133,7 +134,7 @@ chaz_Probe_init(struct chaz_CLI *cli) {
     chaz_CC_init(chaz_CLI_strval(cli, "cc"), chaz_CLI_strval(cli, "cflags"));
     chaz_ConfWriter_init();
     chaz_HeadCheck_init();
-    chaz_Make_init();
+    chaz_Make_init(chaz_CLI_strval(cli, "make"));
 
     /* Enable output. */
     if (chaz_CLI_defined(cli, "enable-c")) {