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

List:       kde-commits
Subject:    icecream/client
From:       Stephan Kulow <coolo () kde ! org>
Date:       2006-06-09 9:03:43
Message-ID: 1149843823.067250.5834.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 549607 by coolo:

found more variables :)


 M  +1 -2      client.h  
 M  +1 -1      cpp.cpp  
 M  +6 -6      local.cpp  
 M  +8 -13     main.cpp  


--- trunk/icecream/client/client.h #549606:549607
@@ -45,8 +45,7 @@
 
 /* In local.cpp.  */
 extern int build_local (CompileJob& job, MsgChannel *daemon, struct rusage *usage =0);
-extern std::string find_compiler( const std::string &compiler );
-extern std::string get_compiler_name( const CompileJob &job );
+extern std::string find_compiler( CompileJob::Language lang );
 
 /* In remote.cpp - permill is the probability it will be compiled three times */
 extern int build_remote (CompileJob &job, MsgChannel *scheduler, const Environments &envs, int permill);
--- trunk/icecream/client/cpp.cpp #549606:549607
@@ -95,7 +95,7 @@
 	    argc++; // the program
 	    argc += 2; // -E file.i
 	    argv = new char*[argc + 1];
-   	    argv[0] = strdup( find_compiler( get_compiler_name(job) ).c_str() );
+   	    argv[0] = strdup( find_compiler( job.language() ).c_str() );
 	    int i = 1;
 	    for ( list<string>::const_iterator it = flags.begin();
 		  it != flags.end(); ++it) {
--- trunk/icecream/client/local.cpp #549606:549607
@@ -47,21 +47,22 @@
  * variable set. This is useful for native cross-compilers.
  * (arm-linux-gcc for example)
  */
-string get_compiler_name( const CompileJob &job ) {
+static string get_compiler_name( CompileJob::Language lang ) {
     string compiler_name = "gcc";
 
     if ( getenv( "ICECC_CC" ) != 0 )
         compiler_name = getenv( "ICECC_CC" );
 
-    if ( job.language() == CompileJob::Lang_CXX )
+    if ( lang == CompileJob::Lang_CXX )
         compiler_name = getenv( "ICECC_CXX" ) != 0 ?
                         getenv( "ICECC_CXX" ) : "g++";
 
     return compiler_name;
 }
 
-string find_compiler( const string &compiler )
+string find_compiler( CompileJob::Language lang )
 {
+    string compiler = get_compiler_name( lang );
     if ( compiler.at( 0 ) == '/' )
         return compiler;
 
@@ -142,12 +143,11 @@
 {
     list<string> arguments;
 
-    string compiler_name = get_compiler_name( job );
-    compiler_name = find_compiler( compiler_name );
+    string compiler_name = find_compiler( job.language() );
     trace() << "build_local " << local_daemon << " compiler: " << compiler_name <<  endl;
 
     if ( compiler_name.empty() ) {
-        log_error() << "could not find " << get_compiler_name (job ) << " in PATH." << endl;
+        log_error() << "could not find " << get_compiler_name (job.language() ) << " in PATH." << endl;
         return EXIT_NO_SUCH_FILE;
     }
 
--- trunk/icecream/client/main.cpp #549606:549607
@@ -79,7 +79,9 @@
 "   ICECC_REPEAT_RATE          the number of jobs out of 1000 that should be\n"
 "                              compiled on multiple hosts to ensure that they're\n"
 "                              producing the same output.  The default is 10.\n"
-"   ICECC_PREFERRED_HOST       Always compile jobs on the given remote host.\n"
+"   ICECC_PREFERRED_HOST       overrides scheduler decisions if set.\n"
+"   IECCC_CC                   set C compiler name (default gcc).\n"
+"   ICECC_CXX                  set C++ compiler name (default g++).\n"
 "\n");
 }
 
@@ -129,26 +131,19 @@
 
 static int create_native()
 {
-    const char *value = getenv("CC");
-    string gcc = "gcc";
-    if (value)
-        gcc = value;
-    string gpp = "g++";
-    value = getenv("CXX");
-    if (value)
-        gpp = value;
-
     struct stat st;
+    string gcc, gpp;
+
     // perhaps we're on gentoo
     if ( !lstat("/usr/bin/gcc-config", &st) ) {
         string gccpath=read_output("/usr/bin/gcc-config -B") + "/";
         gcc=gccpath + "gcc";
         gpp=gccpath + "g++";
+    } else {
+        gcc = find_compiler( CompileJob::Lang_C );
+        gpp = find_compiler( CompileJob::Lang_CXX );
     }
 
-    gcc = find_compiler(gcc);
-    gpp = find_compiler(gpp);
-
     if ( gcc.empty() || gpp.empty())
 	return 1;
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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