Repository: lucy-clownfish Updated Branches: refs/heads/solaris_fixes 0709cab66 -> 7b3deeff0
Regenerate charmonizer.c Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/7b3deeff Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/7b3deeff Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/7b3deeff Branch: refs/heads/solaris_fixes Commit: 7b3deeff0bb701b5b527197480a084556ff0e5dc Parents: 0709cab Author: Nick Wellnhofer <[email protected]> Authored: Tue Aug 19 22:04:08 2014 +0200 Committer: Nick Wellnhofer <[email protected]> Committed: Tue Aug 19 22:04:08 2014 +0200 ---------------------------------------------------------------------- compiler/common/charmonizer.c | 50 +++++++++++++++----------------------- runtime/common/charmonizer.c | 50 +++++++++++++++----------------------- 2 files changed, 38 insertions(+), 62 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/7b3deeff/compiler/common/charmonizer.c ---------------------------------------------------------------------- diff --git a/compiler/common/charmonizer.c b/compiler/common/charmonizer.c index d5d9392..8a20531 100644 --- a/compiler/common/charmonizer.c +++ b/compiler/common/charmonizer.c @@ -2065,7 +2065,7 @@ static struct { } chaz_CC = { NULL, NULL, NULL, "", "", - 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, NULL, NULL }; @@ -3781,12 +3781,10 @@ struct chaz_MakeFile { /* Static vars. */ static struct { char *make_command; - int is_gnu_make; - int is_nmake; int shell_type; } chaz_Make = { NULL, - 0, 0, 0 + 0 }; /* Detect make command. @@ -3824,20 +3822,13 @@ chaz_Make_init(void) { make = chaz_Make.make_command; if (make) { - if (strcmp(make, "make") == 0 - || strcmp(make, "gmake") == 0 - || strcmp(make, "mingw32-make") == 0 - || strcmp(make, "mingw64-make") == 0 - ) { - /* TODO: Add a feature test for GNU make. */ - chaz_Make.is_gnu_make = 1; - /* TODO: Feature test which shell GNU make uses on Windows. */ - chaz_Make.shell_type = CHAZ_OS_POSIX; - } - else if (strcmp(make, "nmake") == 0) { - chaz_Make.is_nmake = 1; + if (strcmp(make, "nmake") == 0) { chaz_Make.shell_type = CHAZ_OS_CMD_EXE; } + else { + /* TODO: Feature test which shell make uses on Windows. */ + chaz_Make.shell_type = CHAZ_OS_POSIX; + } } } @@ -4380,34 +4371,31 @@ chaz_MakeRule_add_make_command(chaz_MakeRule *rule, const char *dir, const char *target) { char *command; - if (chaz_Make.is_gnu_make) { + if (chaz_Make.shell_type == CHAZ_OS_POSIX) { if (!target) { - command = chaz_Util_join(" ", "$(MAKE)", "-C", dir, NULL); + command = chaz_Util_join("", "(cd ", dir, " && $(MAKE))", NULL); } else { - command = chaz_Util_join(" ", "$(MAKE)", "-C", dir, target, NULL); + command = chaz_Util_join("", "(cd ", dir, " && $(MAKE) ", target, + ")", NULL); } chaz_MakeRule_add_command(rule, command); free(command); } - else if (chaz_Make.is_nmake) { - command = chaz_Util_join(" ", "cd", dir, NULL); - chaz_MakeRule_add_command(rule, command); - free(command); - + else if (chaz_Make.shell_type == CHAZ_OS_CMD_EXE) { if (!target) { - chaz_MakeRule_add_command(rule, "$(MAKE) /nologo"); + command = chaz_Util_join(" ", "pushd", dir, "&& $(MAKE) && popd", + NULL); } else { - command = chaz_Util_join(" ", "$(MAKE) /nologo", target, NULL); - chaz_MakeRule_add_command(rule, command); - free(command); + command = chaz_Util_join(" ", "pushd", dir, "&& $(MAKE)", target, + "&& popd", NULL); } - - chaz_MakeRule_add_command(rule, "cd $(MAKEDIR)"); + chaz_MakeRule_add_command(rule, command); + free(command); } else { - chaz_Util_die("Couldn't find a supported 'make' utility."); + chaz_Util_die("Unsupported shell type: %d", chaz_Make.shell_type); } } http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/7b3deeff/runtime/common/charmonizer.c ---------------------------------------------------------------------- diff --git a/runtime/common/charmonizer.c b/runtime/common/charmonizer.c index 08f431d..c05e4a5 100644 --- a/runtime/common/charmonizer.c +++ b/runtime/common/charmonizer.c @@ -2065,7 +2065,7 @@ static struct { } chaz_CC = { NULL, NULL, NULL, "", "", - 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, NULL, NULL }; @@ -3781,12 +3781,10 @@ struct chaz_MakeFile { /* Static vars. */ static struct { char *make_command; - int is_gnu_make; - int is_nmake; int shell_type; } chaz_Make = { NULL, - 0, 0, 0 + 0 }; /* Detect make command. @@ -3824,20 +3822,13 @@ chaz_Make_init(void) { make = chaz_Make.make_command; if (make) { - if (strcmp(make, "make") == 0 - || strcmp(make, "gmake") == 0 - || strcmp(make, "mingw32-make") == 0 - || strcmp(make, "mingw64-make") == 0 - ) { - /* TODO: Add a feature test for GNU make. */ - chaz_Make.is_gnu_make = 1; - /* TODO: Feature test which shell GNU make uses on Windows. */ - chaz_Make.shell_type = CHAZ_OS_POSIX; - } - else if (strcmp(make, "nmake") == 0) { - chaz_Make.is_nmake = 1; + if (strcmp(make, "nmake") == 0) { chaz_Make.shell_type = CHAZ_OS_CMD_EXE; } + else { + /* TODO: Feature test which shell make uses on Windows. */ + chaz_Make.shell_type = CHAZ_OS_POSIX; + } } } @@ -4380,34 +4371,31 @@ chaz_MakeRule_add_make_command(chaz_MakeRule *rule, const char *dir, const char *target) { char *command; - if (chaz_Make.is_gnu_make) { + if (chaz_Make.shell_type == CHAZ_OS_POSIX) { if (!target) { - command = chaz_Util_join(" ", "$(MAKE)", "-C", dir, NULL); + command = chaz_Util_join("", "(cd ", dir, " && $(MAKE))", NULL); } else { - command = chaz_Util_join(" ", "$(MAKE)", "-C", dir, target, NULL); + command = chaz_Util_join("", "(cd ", dir, " && $(MAKE) ", target, + ")", NULL); } chaz_MakeRule_add_command(rule, command); free(command); } - else if (chaz_Make.is_nmake) { - command = chaz_Util_join(" ", "cd", dir, NULL); - chaz_MakeRule_add_command(rule, command); - free(command); - + else if (chaz_Make.shell_type == CHAZ_OS_CMD_EXE) { if (!target) { - chaz_MakeRule_add_command(rule, "$(MAKE) /nologo"); + command = chaz_Util_join(" ", "pushd", dir, "&& $(MAKE) && popd", + NULL); } else { - command = chaz_Util_join(" ", "$(MAKE) /nologo", target, NULL); - chaz_MakeRule_add_command(rule, command); - free(command); + command = chaz_Util_join(" ", "pushd", dir, "&& $(MAKE)", target, + "&& popd", NULL); } - - chaz_MakeRule_add_command(rule, "cd $(MAKEDIR)"); + chaz_MakeRule_add_command(rule, command); + free(command); } else { - chaz_Util_die("Couldn't find a supported 'make' utility."); + chaz_Util_die("Unsupported shell type: %d", chaz_Make.shell_type); } }
