[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenonbeta/icecream/icecream/client
From:       Holger Freyther <freyther () gmx ! net>
Date:       2005-02-14 14:11:56
Message-ID: 20050214141156.9EF7A1B93E () office ! kde ! org
[Download RAW message or body]

CVS commit by zecke: 

Support for native-to-target cross compilers. These compilers run
on the host but produce code for the target architecture (e.g ARM cores).

One can select the precompiler and local compiler by setting ICECC_CC
and ICECC_CXX. This allows to use both the native and cross compiler
for distributed compiling at once.


  M +1 -0      client.h   1.13
  M +1 -6      cpp.cpp   1.16
  M +20 -3     local.cpp   1.23


--- kdenonbeta/icecream/icecream/client/client.h  #1.12:1.13
@@ -48,4 +48,5 @@ pid_t call_cpp (CompileJob &job, int fdw
 int build_local (CompileJob& job, struct rusage *used = 0);
 std::string find_compiler( const std::string &compiler );
+std::string get_compiler_name( const CompileJob &job );
 
 /* In remote.cpp - permill is the probability it will be compiled three times */

--- kdenonbeta/icecream/icecream/client/cpp.cpp  #1.15:1.16
@@ -96,10 +96,5 @@ pid_t call_cpp(CompileJob &job, int fdwr
             argc += 2; // -E file.i
             argv = new char*[argc + 1];
-            if (job.language() == CompileJob::Lang_C)
-                argv[0] = strdup( find_compiler( "gcc" ).c_str() );
-            else if (job.language() == CompileJob::Lang_CXX)
-                argv[0] = strdup( find_compiler( "g++" ).c_str() );
-            else
-                assert(0);
+            argv[0] = strdup( find_compiler( get_compiler_name(job) ).c_str() );
             int i = 1;
             for ( list<string>::const_iterator it = flags.begin();

--- kdenonbeta/icecream/icecream/client/local.cpp  #1.22:1.23
@@ -42,4 +42,23 @@ extern const char * rs_program_name;
 #define CLIENT_DEBUG 0
 
+/*
+ * Get the name of the compiler depedant on the
+ * language of the job and the environment
+ * variable set. This is useful for native cross-compilers.
+ * (arm-linux-gcc for example)
+ */
+string get_compiler_name( const CompileJob &job ) {
+    string compiler_name = "gcc";
+
+    if ( getenv( "ICECC_CC" ) != 0 )
+        compiler_name = getenv( "ICECC_CC" );
+
+    if ( job.language() == CompileJob::Lang_CXX )
+        compiler_name = getenv( "ICECC_CXX" ) != 0 ?
+                        getenv( "ICECC_CXX" ) : "g++";
+
+    return compiler_name;
+}
+
 string find_compiler( const string &compiler )
 {
@@ -118,7 +137,5 @@ int build_local(CompileJob &job, struct 
     list<string> arguments;
 
-    string compiler_name = "gcc";
-    if ( job.language() == CompileJob::Lang_CXX )
-        compiler_name = "g++";
+    string compiler_name = get_compiler_name( job );
     compiler_name = find_compiler( compiler_name );
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic