[Libreoffice-commits] core.git: solenv/gbuild solenv/gcc-wrappers

Peter Foley pefoley2 at verizon.net
Sat Mar 23 08:47:13 PDT 2013


 solenv/gbuild/platform/com_MSC_class.mk |    4 ++--
 solenv/gcc-wrappers/g++.cxx             |    2 --
 solenv/gcc-wrappers/gcc.cxx             |    2 --
 solenv/gcc-wrappers/wrapper.cxx         |   11 +++++++++++
 4 files changed, 13 insertions(+), 6 deletions(-)

New commits:
commit 28fb57daa77438f5e63132d3417062a11a44461e
Author: Peter Foley <pefoley2 at verizon.net>
Date:   Sat Mar 23 09:30:52 2013 -0400

    make gcc-wrapper work with ccache
    
    Change-Id: I4db04d8ce04c928b67d86172fcbe33adacbd85d8

diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 60855e4..274c7cc 100755
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -560,9 +560,9 @@ endef
 # /opt/lo/bin/ccache /cygdrive/c/PROGRA~2/MICROS~2.0/VC/bin/cl.exe
 
 gb_AUTOCONF_WRAPPERS := \
-	REAL_CC="$(shell cygpath -w $(lastword $(CC)))" \
+	REAL_CC="$(shell cygpath -w $(CC))" \
 	CC="$(call gb_Executable_get_target,gcc-wrapper)" \
-	REAL_CXX="$(shell cygpath -w  $(lastword $(CXX)))" \
+	REAL_CXX="$(shell cygpath -w  $(CXX))" \
 	CXX="$(call gb_Executable_get_target,g++-wrapper)" \
     LD="$(shell cygpath -w $(COMPATH)/bin/link.exe) -nologo"
 
diff --git a/solenv/gcc-wrappers/g++.cxx b/solenv/gcc-wrappers/g++.cxx
index 19106af..d2ee3d5 100644
--- a/solenv/gcc-wrappers/g++.cxx
+++ b/solenv/gcc-wrappers/g++.cxx
@@ -18,8 +18,6 @@ int main(int argc, char *argv[]) {
 
     setupccenv();
 
-    cerr << "CXX= " << command << " " << args << endl;
-
     return startprocess(command,args);
 
 }
diff --git a/solenv/gcc-wrappers/gcc.cxx b/solenv/gcc-wrappers/gcc.cxx
index e8b15bb..b8983cf 100644
--- a/solenv/gcc-wrappers/gcc.cxx
+++ b/solenv/gcc-wrappers/gcc.cxx
@@ -18,8 +18,6 @@ int main(int argc, char *argv[]) {
 
     setupccenv();
 
-    cerr << "CC= " << command << " " << args << endl;
-
     return startprocess(command,args);
 
 }
diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index 7a4fb91..2b2f233 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -9,6 +9,8 @@
 
 #include "wrapper.hxx"
 
+#define WIN32_LEAN_AND_MEAN
+
 #include <windows.h>
 
 #define BUFLEN 2048
@@ -139,6 +141,14 @@ int startprocess(string command, string args) {
     si.hStdOutput=childout_write;
     si.hStdError=childout_write;
 
+    size_t pos=command.find("ccache ");
+    if(pos != string::npos) {
+        args.insert(0,"cl.exe");
+        command=command.substr(0,pos+strlen("ccache"))+".exe";
+    }
+
+    //cerr << "CMD= " << command << " " << args << endl;
+
     // Commandline may be modified by CreateProcess
     char* cmdline=_strdup(args.c_str());
 
@@ -177,6 +187,7 @@ int startprocess(string command, string args) {
             WriteFile(stdout_handle,buffer,readlen,&writelen,NULL);
         }
     }
+    WaitForSingleObject(pi.hProcess, INFINITE);
     GetExitCodeProcess(pi.hProcess, &ret);
     CloseHandle(pi.hThread);
     CloseHandle(pi.hProcess);


More information about the Libreoffice-commits mailing list