lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [8/8] git commit: refs/heads/master - Regenerate charmonizer.c
Date Thu, 02 May 2013 14:03:09 GMT
Regenerate charmonizer.c


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

Branch: refs/heads/master
Commit: b2e42b38659084bedf9ba59314a326c481ea9b92
Parents: aaf812f
Author: Nick Wellnhofer <wellnhofer@aevum.de>
Authored: Thu May 2 14:01:41 2013 +0200
Committer: Nick Wellnhofer <wellnhofer@aevum.de>
Committed: Thu May 2 15:46:53 2013 +0200

----------------------------------------------------------------------
 clownfish/compiler/common/charmonizer.c |   24 ++++++++++++---
 clownfish/runtime/common/charmonizer.c  |   24 +++++++++++----
 common/charmonizer.c                    |   40 +++++++++++++++++++++----
 3 files changed, 70 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/b2e42b38/clownfish/compiler/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/common/charmonizer.c b/clownfish/compiler/common/charmonizer.c
index 4b8e834..c76bf71 100644
--- a/clownfish/compiler/common/charmonizer.c
+++ b/clownfish/compiler/common/charmonizer.c
@@ -1782,6 +1782,7 @@ chaz_CC_link_command() {
 char*
 chaz_CC_shared_lib_file(const char *name) {
     const char *prefix = "";
+    const char *shlib_ext = chaz_OS_shared_lib_ext();
     if (!chaz_CC.intval__MSC_VER) {
         if (strcmp(chaz_OS_name(), "cygwin") == 0) {
             prefix = "cyg";
@@ -1790,7 +1791,6 @@ chaz_CC_shared_lib_file(const char *name) {
             prefix = "lib";
         }
     }
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
     return chaz_Util_join("", prefix, name, shlib_ext, NULL);
 }
 
@@ -3220,6 +3220,17 @@ chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, const char *name,
 
     chaz_MakeRule_add_rm_command(makefile->clean, shared_lib);
 
+    if (chaz_CC_msvc_version_num()) {
+        /* Remove import library and export file under MSVC. */
+        char *filename;
+        filename = chaz_Util_join("", name, ".lib", NULL);
+        chaz_MakeRule_add_rm_command(makefile->clean, filename);
+        free(filename);
+        filename = chaz_Util_join("", name, ".exp", NULL);
+        chaz_MakeRule_add_rm_command(makefile->clean, filename);
+        free(filename);
+    }
+
     chaz_CFlags_destroy(local_flags);
     free(shared_lib);
     free(command);
@@ -3381,7 +3392,7 @@ chaz_MakeRule_add_rm_command(chaz_MakeRule *rule, const char *files)
{
     }
     else if (shell_type == CHAZ_OS_CMD_EXE) {
         command = chaz_Util_join("", "for %i in (", files,
-                                 ") do @if exist %i del /f %i\n", NULL);
+                                 ") do @if exist %i del /f %i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", shell_type);
@@ -3401,7 +3412,7 @@ chaz_MakeRule_add_recursive_rm_command(chaz_MakeRule *rule, const char
*dirs) {
     }
     else if (shell_type == CHAZ_OS_CMD_EXE) {
         command = chaz_Util_join("", "for %i in (", dirs,
-                                 ") do @if exist %i rmdir /s /q %i\n", NULL);
+                                 ") do @if exist %i rmdir /s /q %i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", shell_type);
@@ -3432,10 +3443,10 @@ chaz_MakeRule_add_make_command(chaz_MakeRule *rule, const char *dir,
         free(command);
 
         if (!target) {
-            chaz_MakeRule_add_command(rule, "$(MAKE)");
+            chaz_MakeRule_add_command(rule, "$(MAKE) /nologo");
         }
         else {
-            command = chaz_Util_join(" ", "$(MAKE)", target, NULL);
+            command = chaz_Util_join(" ", "$(MAKE) /nologo", target, NULL);
             chaz_MakeRule_add_command(rule, command);
             free(command);
         }
@@ -5337,6 +5348,9 @@ S_write_makefile(struct chaz_CLIArgs *args) {
     chaz_MakeFile_add_rule(makefile, "$(COMMON_OBJS)", parse_header_c);
 
     link_flags = chaz_CFlags_new(cflags_style);
+    if (chaz_CC_msvc_version_num()) {
+        chaz_CFlags_append(link_flags, "/nologo");
+    }
     if (args->code_coverage) {
         chaz_CFlags_enable_code_coverage(link_flags);
     }

http://git-wip-us.apache.org/repos/asf/lucy/blob/b2e42b38/clownfish/runtime/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/clownfish/runtime/common/charmonizer.c b/clownfish/runtime/common/charmonizer.c
index b4d50eb..f239ff1 100644
--- a/clownfish/runtime/common/charmonizer.c
+++ b/clownfish/runtime/common/charmonizer.c
@@ -2061,6 +2061,7 @@ chaz_CC_link_command() {
 char*
 chaz_CC_shared_lib_file(const char *name) {
     const char *prefix = "";
+    const char *shlib_ext = chaz_OS_shared_lib_ext();
     if (!chaz_CC.intval__MSC_VER) {
         if (strcmp(chaz_OS_name(), "cygwin") == 0) {
             prefix = "cyg";
@@ -2069,7 +2070,6 @@ chaz_CC_shared_lib_file(const char *name) {
             prefix = "lib";
         }
     }
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
     return chaz_Util_join("", prefix, name, shlib_ext, NULL);
 }
 
@@ -3499,6 +3499,17 @@ chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, const char *name,
 
     chaz_MakeRule_add_rm_command(makefile->clean, shared_lib);
 
+    if (chaz_CC_msvc_version_num()) {
+        /* Remove import library and export file under MSVC. */
+        char *filename;
+        filename = chaz_Util_join("", name, ".lib", NULL);
+        chaz_MakeRule_add_rm_command(makefile->clean, filename);
+        free(filename);
+        filename = chaz_Util_join("", name, ".exp", NULL);
+        chaz_MakeRule_add_rm_command(makefile->clean, filename);
+        free(filename);
+    }
+
     chaz_CFlags_destroy(local_flags);
     free(shared_lib);
     free(command);
@@ -3660,7 +3671,7 @@ chaz_MakeRule_add_rm_command(chaz_MakeRule *rule, const char *files)
{
     }
     else if (shell_type == CHAZ_OS_CMD_EXE) {
         command = chaz_Util_join("", "for %i in (", files,
-                                 ") do @if exist %i del /f %i\n", NULL);
+                                 ") do @if exist %i del /f %i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", shell_type);
@@ -3680,7 +3691,7 @@ chaz_MakeRule_add_recursive_rm_command(chaz_MakeRule *rule, const char
*dirs) {
     }
     else if (shell_type == CHAZ_OS_CMD_EXE) {
         command = chaz_Util_join("", "for %i in (", dirs,
-                                 ") do @if exist %i rmdir /s /q %i\n", NULL);
+                                 ") do @if exist %i rmdir /s /q %i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", shell_type);
@@ -3711,10 +3722,10 @@ chaz_MakeRule_add_make_command(chaz_MakeRule *rule, const char *dir,
         free(command);
 
         if (!target) {
-            chaz_MakeRule_add_command(rule, "$(MAKE)");
+            chaz_MakeRule_add_command(rule, "$(MAKE) /nologo");
         }
         else {
-            command = chaz_Util_join(" ", "$(MAKE)", target, NULL);
+            command = chaz_Util_join(" ", "$(MAKE) /nologo", target, NULL);
             chaz_MakeRule_add_command(rule, command);
             free(command);
         }
@@ -4776,8 +4787,9 @@ chaz_Floats_math_library(void) {
     static const char sqrt_code[] =
         CHAZ_QUOTE(  #include <math.h>                              )
         CHAZ_QUOTE(  #include <stdio.h>                             )
+        CHAZ_QUOTE(  typedef double (*sqrt_t)(double);              )
         CHAZ_QUOTE(  int main(void) {                               )
-        CHAZ_QUOTE(      printf("%p\n", sqrt);                      )
+        CHAZ_QUOTE(      printf("%p\n", (sqrt_t)sqrt);              )
         CHAZ_QUOTE(      return 0;                                  )
         CHAZ_QUOTE(  }                                              );
     chaz_CFlags *temp_cflags = chaz_CC_get_temp_cflags();

http://git-wip-us.apache.org/repos/asf/lucy/blob/b2e42b38/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/common/charmonizer.c b/common/charmonizer.c
index ba3849d..04d5e0d 100644
--- a/common/charmonizer.c
+++ b/common/charmonizer.c
@@ -2061,6 +2061,7 @@ chaz_CC_link_command() {
 char*
 chaz_CC_shared_lib_file(const char *name) {
     const char *prefix = "";
+    const char *shlib_ext = chaz_OS_shared_lib_ext();
     if (!chaz_CC.intval__MSC_VER) {
         if (strcmp(chaz_OS_name(), "cygwin") == 0) {
             prefix = "cyg";
@@ -2069,7 +2070,6 @@ chaz_CC_shared_lib_file(const char *name) {
             prefix = "lib";
         }
     }
-    const char *shlib_ext = chaz_OS_shared_lib_ext();
     return chaz_Util_join("", prefix, name, shlib_ext, NULL);
 }
 
@@ -3499,6 +3499,17 @@ chaz_MakeFile_add_shared_lib(chaz_MakeFile *makefile, const char *name,
 
     chaz_MakeRule_add_rm_command(makefile->clean, shared_lib);
 
+    if (chaz_CC_msvc_version_num()) {
+        /* Remove import library and export file under MSVC. */
+        char *filename;
+        filename = chaz_Util_join("", name, ".lib", NULL);
+        chaz_MakeRule_add_rm_command(makefile->clean, filename);
+        free(filename);
+        filename = chaz_Util_join("", name, ".exp", NULL);
+        chaz_MakeRule_add_rm_command(makefile->clean, filename);
+        free(filename);
+    }
+
     chaz_CFlags_destroy(local_flags);
     free(shared_lib);
     free(command);
@@ -3660,7 +3671,7 @@ chaz_MakeRule_add_rm_command(chaz_MakeRule *rule, const char *files)
{
     }
     else if (shell_type == CHAZ_OS_CMD_EXE) {
         command = chaz_Util_join("", "for %i in (", files,
-                                 ") do @if exist %i del /f %i\n", NULL);
+                                 ") do @if exist %i del /f %i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", shell_type);
@@ -3680,7 +3691,7 @@ chaz_MakeRule_add_recursive_rm_command(chaz_MakeRule *rule, const char
*dirs) {
     }
     else if (shell_type == CHAZ_OS_CMD_EXE) {
         command = chaz_Util_join("", "for %i in (", dirs,
-                                 ") do @if exist %i rmdir /s /q %i\n", NULL);
+                                 ") do @if exist %i rmdir /s /q %i", NULL);
     }
     else {
         chaz_Util_die("Unsupported shell type: %d", shell_type);
@@ -3711,10 +3722,10 @@ chaz_MakeRule_add_make_command(chaz_MakeRule *rule, const char *dir,
         free(command);
 
         if (!target) {
-            chaz_MakeRule_add_command(rule, "$(MAKE)");
+            chaz_MakeRule_add_command(rule, "$(MAKE) /nologo");
         }
         else {
-            command = chaz_Util_join(" ", "$(MAKE)", target, NULL);
+            command = chaz_Util_join(" ", "$(MAKE) /nologo", target, NULL);
             chaz_MakeRule_add_command(rule, command);
             free(command);
         }
@@ -4776,8 +4787,9 @@ chaz_Floats_math_library(void) {
     static const char sqrt_code[] =
         CHAZ_QUOTE(  #include <math.h>                              )
         CHAZ_QUOTE(  #include <stdio.h>                             )
+        CHAZ_QUOTE(  typedef double (*sqrt_t)(double);              )
         CHAZ_QUOTE(  int main(void) {                               )
-        CHAZ_QUOTE(      printf("%p\n", sqrt);                      )
+        CHAZ_QUOTE(      printf("%p\n", (sqrt_t)sqrt);              )
         CHAZ_QUOTE(      return 0;                                  )
         CHAZ_QUOTE(  }                                              );
     chaz_CFlags *temp_cflags = chaz_CC_get_temp_cflags();
@@ -6606,6 +6618,9 @@ S_write_makefile(struct chaz_CLIArgs *args) {
     chaz_MakeRule_add_prereq(rule, "$(AUTOGEN_DIR)");
 
     link_flags = chaz_CFlags_new(cflags_style);
+    if (chaz_CC_msvc_version_num()) {
+        chaz_CFlags_append(link_flags, "/nologo");
+    }
     math_library = chaz_Floats_math_library();
     if (math_library) {
         chaz_CFlags_add_library(link_flags, math_library);
@@ -6663,7 +6678,18 @@ S_write_makefile(struct chaz_CLIArgs *args) {
 
     clean_rule = chaz_MakeFile_clean_rule(makefile);
 
-    chaz_MakeRule_add_rm_command(clean_rule, "$(LUCY_OBJS)");
+    if (chaz_OS_shell_type() == CHAZ_OS_CMD_EXE) {
+        /*
+         * The length of the command would exceed the limit of 8191
+         * characters. As a work-around, delete all .obj files in BASE_DIR
+         * using 'del /s /q'.
+         */
+        chaz_MakeRule_add_command(clean_rule, "del /s /q $(BASE_DIR)\\*.obj");
+    }
+    else {
+        chaz_MakeRule_add_rm_command(clean_rule, "$(LUCY_OBJS)");
+    }
+
     chaz_MakeRule_add_rm_command(clean_rule, json_parser_h);
     chaz_MakeRule_add_rm_command(clean_rule, json_parser_c);
     chaz_MakeRule_add_recursive_rm_command(clean_rule, "$(AUTOGEN_DIR)");


Mime
View raw message