Add "host" CLI arg for Clownfish runtime

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

Branch: refs/heads/thread_safe_errors
Commit: 8b939e5957789013899306ae11ac1b6bd7f4d1cb
Parents: c3aadd5
Author: Nick Wellnhofer <[email protected]>
Authored: Thu Dec 4 20:55:27 2014 +0100
Committer: Nick Wellnhofer <[email protected]>
Committed: Thu Dec 4 21:56:18 2014 +0100

----------------------------------------------------------------------
 compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm |  1 +
 runtime/c/configure                                     |  2 +-
 runtime/c/configure.bat                                 |  2 +-
 runtime/common/charmonizer.main                         | 10 ++++++----
 4 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/8b939e59/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm 
b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
index a37b6b4..7d55bb4 100644
--- a/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
+++ b/compiler/perl/lib/Clownfish/CFC/Perl/Build/Charmonic.pm
@@ -79,6 +79,7 @@ sub ACTION_charmony {
     my @command = (
         $CHARMONIZER_EXE_PATH,
         "--cc=$cc",
+        '--host=perl',
         '--enable-c',
         '--enable-perl',
     );

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/8b939e59/runtime/c/configure
----------------------------------------------------------------------
diff --git a/runtime/c/configure b/runtime/c/configure
index 29b0c14..9557e66 100755
--- a/runtime/c/configure
+++ b/runtime/c/configure
@@ -48,5 +48,5 @@ echo $command
 $command || exit
 
 echo Running charmonizer
-./charmonizer --cc="$CC" --enable-c --enable-makefile "$@"
+./charmonizer --cc="$CC" --host=c --enable-c --enable-makefile "$@"
 

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/8b939e59/runtime/c/configure.bat
----------------------------------------------------------------------
diff --git a/runtime/c/configure.bat b/runtime/c/configure.bat
index 40b5cb0..9a34abd 100644
--- a/runtime/c/configure.bat
+++ b/runtime/c/configure.bat
@@ -40,7 +40,7 @@ echo cl /nologo ..\common\charmonizer.c
 cl /nologo ..\common\charmonizer.c
 if errorlevel 1 exit /b 1
 echo Running charmonizer
-charmonizer.exe --cc=cl --enable-c --enable-makefile %*
+charmonizer.exe --cc=cl --host=c --enable-c --enable-makefile %*
 exit /b
 
 :found_gcc

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/8b939e59/runtime/common/charmonizer.main
----------------------------------------------------------------------
diff --git a/runtime/common/charmonizer.main b/runtime/common/charmonizer.main
index 4c2bcd5..30bdff2 100644
--- a/runtime/common/charmonizer.main
+++ b/runtime/common/charmonizer.main
@@ -97,6 +97,8 @@ int main(int argc, const char **argv) {
     /* Initialize. */
     chaz_CLI *cli
         = chaz_CLI_new(argv[0], "charmonizer: Probe C build environment");
+    chaz_CLI_register(cli, "host", "specify host binding language",
+                      CHAZ_CLI_ARG_REQUIRED);
     chaz_CLI_register(cli, "disable-threads", "whether to disable threads",
                       CHAZ_CLI_NO_ARG);
     chaz_CLI_set_usage(cli, "Usage: charmonizer [OPTIONS] [-- [CFLAGS]]");
@@ -185,7 +187,7 @@ S_add_compiler_flags(struct chaz_CLI *cli) {
         else if (getenv("LUCY_DEBUG")) {
             chaz_CFlags_append(extra_cflags,
                 "-DLUCY_DEBUG -pedantic -Wall -Wextra -Wno-variadic-macros");
-            if (chaz_CLI_defined(cli, "enable-perl")) {
+            if (strcmp(chaz_CLI_strval(cli, "host"), "perl") == 0) {
                 chaz_CFlags_append(extra_cflags, "-DPERL_GCC_PEDANTIC");
             }
         }
@@ -235,7 +237,7 @@ cfish_MakeFile_new(chaz_CLI *cli) {
     self->autogen_target
         = chaz_Util_join(dir_sep, "autogen", "hierarchy.json", NULL);
 
-    if (chaz_CLI_defined(cli, "enable-perl")) {
+    if (strcmp(chaz_CLI_strval(self->cli, "host"), "perl") == 0) {
         static const char *perl_autogen_src_files[] = {
             "boot",
             "callbacks",
@@ -355,7 +357,7 @@ cfish_MakeFile_write(cfish_MakeFile *self) {
     chaz_MakeFile_add_rule(self->makefile, "all", scratch);
     free(scratch);
 
-    if (!chaz_CLI_defined(self->cli, "enable-perl")) {
+    if (strcmp(chaz_CLI_strval(self->cli, "host"), "c") == 0) {
         cfish_MakeFile_write_c_cfc_rules(self);
     }
 
@@ -384,7 +386,7 @@ cfish_MakeFile_write(cfish_MakeFile *self) {
     chaz_MakeFile_add_static_lib(self->makefile, self->static_lib,
                                  "$(CLOWNFISH_OBJS)");
 
-    if (!chaz_CLI_defined(self->cli, "enable-perl")) {
+    if (strcmp(chaz_CLI_strval(self->cli, "host"), "c") == 0) {
         cfish_MakeFile_write_c_test_rules(self);
     }
 

Reply via email to