Repository: lucy
Updated Branches:
  refs/heads/0.4 435ccf645 -> 3f97b23d1


Regenerate charmonizer.c to fix OS detection


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

Branch: refs/heads/0.4
Commit: 3f97b23d14cce4b0fb8b2ee87da74228e125a116
Parents: 435ccf6
Author: Nick Wellnhofer <wellnho...@aevum.de>
Authored: Tue Jan 26 13:23:58 2016 +0100
Committer: Nick Wellnhofer <wellnho...@aevum.de>
Committed: Tue Jan 26 13:24:28 2016 +0100

----------------------------------------------------------------------
 common/charmonizer.c | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/3f97b23d/common/charmonizer.c
----------------------------------------------------------------------
diff --git a/common/charmonizer.c b/common/charmonizer.c
index c277371..b95da4b 100644
--- a/common/charmonizer.c
+++ b/common/charmonizer.c
@@ -2788,6 +2788,7 @@ chaz_CC_compile_exe(const char *source_path, const char 
*exe_name,
         chaz_OS_run_quietly(command);
     }
     else {
+        printf("%s\n", command);
         system(command);
     }
 
@@ -2846,6 +2847,7 @@ chaz_CC_compile_obj(const char *source_path, const char 
*obj_name,
         chaz_OS_run_quietly(command);
     }
     else {
+        printf("%s\n", command);
         system(command);
     }
 
@@ -5305,8 +5307,20 @@ chaz_OS_init(void) {
         printf("Trying to find a bit-bucket a la /dev/null...\n");
     }
 
-    /* Detect shell based on whether the bitbucket is "/dev/null" or "nul". */
-    if (chaz_Util_can_open_file("/dev/null")) {
+    /* Detect shell based on whether the bitbucket is "/dev/null" or "nul".
+     * Start with "nul" as some Windows boxes seem to have a "/dev/null".
+     */
+    if (chaz_Util_can_open_file("nul")) {
+        strcpy(chaz_OS.name, "windows");
+        strcpy(chaz_OS.dev_null, "nul");
+        strcpy(chaz_OS.dir_sep, "\\");
+        strcpy(chaz_OS.exe_ext, ".exe");
+        strcpy(chaz_OS.shared_lib_ext, ".dll");
+        strcpy(chaz_OS.static_lib_ext, ".lib");
+        strcpy(chaz_OS.local_command_start, ".\\");
+        chaz_OS.shell_type = CHAZ_OS_CMD_EXE;
+    }
+    else if (chaz_Util_can_open_file("/dev/null")) {
         char   *uname;
         size_t  uname_len;
         size_t i;
@@ -5339,20 +5353,14 @@ chaz_OS_init(void) {
         }
         strcpy(chaz_OS.local_command_start, "./");
     }
-    else if (chaz_Util_can_open_file("nul")) {
-        strcpy(chaz_OS.name, "windows");
-        strcpy(chaz_OS.dev_null, "nul");
-        strcpy(chaz_OS.dir_sep, "\\");
-        strcpy(chaz_OS.exe_ext, ".exe");
-        strcpy(chaz_OS.shared_lib_ext, ".dll");
-        strcpy(chaz_OS.static_lib_ext, ".lib");
-        strcpy(chaz_OS.local_command_start, ".\\");
-        chaz_OS.shell_type = CHAZ_OS_CMD_EXE;
-    }
     else {
         /* Bail out because we couldn't find anything like /dev/null. */
         chaz_Util_die("Couldn't find anything like /dev/null");
     }
+
+    if (chaz_Util_verbosity) {
+        printf("Detected OS: %s\n", chaz_OS.name);
+    }
 }
 
 const char*

Reply via email to