You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2012/08/18 02:09:14 UTC

[lucy-commits] svn commit: r1374479 - /lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c

Author: marvin
Date: Sat Aug 18 00:09:14 2012
New Revision: 1374479

URL: http://svn.apache.org/viewvc?rev=1374479&view=rev
Log:
Skip linking when test compiling.

For simple test compiles, skip the linking phase by adding the `-c` flag
or equivalent.

Modified:
    lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c

Modified: lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c
URL: http://svn.apache.org/viewvc/lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c?rev=1374479&r1=1374478&r2=1374479&view=diff
==============================================================================
--- lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c (original)
+++ lucy/trunk/charmonizer/src/Charmonizer/Core/Compiler.c Sat Aug 18 00:09:14 2012
@@ -42,6 +42,7 @@ static char     *try_obj_name = NULL;
 static char      include_flag[10] = "";
 static char      object_flag[10]  = "";
 static char      exe_flag[10]     = "";
+static char      no_link_flag[10] = "";
 static char      error_flag[10]   = "";
 static int       defines___GNUC__  = 0;
 static int       defines__MSC_VER  = 0;
@@ -100,12 +101,14 @@ CC_init(const char *compiler_command, co
     strcpy(include_flag, "-I ");
     strcpy(object_flag,  "-o ");
     strcpy(exe_flag,     "-o ");
+    strcpy(no_link_flag, "-c ");
     compile_succeeded = CC_test_compile(code);
     if (!compile_succeeded) {
         /* Try MSVC argument style. */
         strcpy(include_flag, "/I");
         strcpy(object_flag,  "/Fo");
         strcpy(exe_flag,     "/Fe");
+        strcpy(no_link_flag, "/c");
         compile_succeeded = CC_test_compile(code);
     }
     if (!compile_succeeded) {
@@ -245,6 +248,7 @@ CC_compile_obj(const char *source_path, 
     size_t   obj_file_buf_len  = sprintf(obj_file, "%s%s", obj_name, obj_ext);
     char    *inc_dir_string    = S_inc_dir_string();
     size_t   command_max_size  = strlen(cc_command)
+                                 + strlen(no_link_flag)
                                  + strlen(error_flag)
                                  + strlen(source_path)
                                  + strlen(object_flag)
@@ -259,8 +263,8 @@ CC_compile_obj(const char *source_path, 
     Util_write_file(source_path, code);
 
     /* Prepare and run the compiler command. */
-    sprintf(command, "%s %s %s %s%s %s %s",
-            cc_command, error_flag,
+    sprintf(command, "%s %s %s %s %s%s %s %s",
+            cc_command, no_link_flag, error_flag,
             source_path, object_flag, 
             obj_file, inc_dir_string,
             cc_flags);