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

List:       kde-commits
Subject:    icecream/client
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2008-09-02 19:40:10
Message-ID: 1220384410.447169.3905.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 856402 by ossi:

if called as "icecc" (i.e., not through a symlink) and the first argument starts with \
a slash, use that as the command to run. 


 M  +3 -2      arg.cpp  
 M  +6 -4      main.cpp  


--- trunk/icecream/client/arg.cpp #856401:856402
@@ -101,11 +101,12 @@
     trace() << endl;
 #endif
 
-    bool always_local = analyze_program(argv[0], job);
+    bool had_cc = (job.compilerName().size() > 0);
+    bool always_local = analyze_program(had_cc ? job.compilerName().c_str() : \
argv[0], job);  bool seen_c = false;
     bool seen_s = false;
 
-    for (int i = 1; argv[i]; i++) {
+    for (int i = had_cc ? 2 : 1; argv[i]; i++) {
         const char *a = argv[i];
 
         if (a[0] == '-') {
--- trunk/icecream/client/main.cpp #856401:856402
@@ -184,6 +184,8 @@
 
     setup_debug(debug_level, string(), "ICECC");
 
+    CompileJob job;
+
     string compiler_name = argv[0];
     dcc_client_catch_signals();
 
@@ -200,6 +202,8 @@
             }
 	    if ( arg == "--build-native" )
                 return create_native();
+            if ( arg.size() > 0 && arg.at(0) == '/' )
+                job.setCompilerName(arg);
         }
     }
 
@@ -214,8 +218,6 @@
      * see the EPIPE. */
     dcc_ignore_sigpipe(1);
 
-    CompileJob job;
-
     local |= analyse_argv( argv, job );
 
     /* if ICECC is set to no, then run job locally */
@@ -248,7 +250,7 @@
             Msg *umsg = local_daemon->get_msg(4 * 60);
             string native;
             if ( umsg && umsg->type == M_NATIVE_ENV )
-                native = dynamic_cast<UseNativeEnvMsg*>( umsg )->nativeVersion;
+                native = static_cast<UseNativeEnvMsg*>( umsg )->nativeVersion;
 
             if ( native.empty() || ::access( native.c_str(), R_OK ) ) {
 		log_warning() << "daemon can't determine native environment. Set $ICECC_VERSION to \
an icecc environment.\n"; @@ -312,7 +314,7 @@
                 log_error() << "got exception " << error << " (this should be an \
exception!)" <<  endl;
 
-            /* currently debugging a client ? throw an error then */
+            /* currently debugging a client? throw an error then */
             if (debug_level != Error)
                 return error;
             goto do_local_error;


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

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