summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@centrum.cz>2021-11-02 18:28:53 +0000
committerLuboš Luňák <l.lunak@collabora.com>2021-11-03 07:27:21 +0100
commit9b9a8f47894760e7a95ed276feeef00d3b1c94d1 (patch)
treed9304e87909718eab1b4a07061314204900b3637
parent33db559089fcf5ff9f6e0e5bb4e41fce969cbdad (diff)
fix gcc-wrapper for ccache.exe
This reverts a part of 18cc01b63996f81b284e3bc827d1be7f3da8983a . Change-Id: Ib7abbc41eeb6abd573f540ae2d0d2822e68b9abb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124613 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r--config_host.mk.in2
-rw-r--r--configure.ac8
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk4
-rw-r--r--solenv/gbuild/platform/com_MSC_defs.mk2
-rw-r--r--solenv/gcc-wrappers/wrapper.cxx9
5 files changed, 10 insertions, 15 deletions
diff --git a/config_host.mk.in b/config_host.mk.in
index 4b4f58f80fc2..ff8944af0cce 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -667,8 +667,6 @@ export TOUCH=@TOUCH@
export UCRTSDKDIR=@UCRTSDKDIR@
export UCRTVERSION=@UCRTVERSION@
export UCRT_REDISTDIR=@UCRT_REDISTDIR@
-export UNCACHED_CC=@UNCACHED_CC@
-export UNCACHED_CXX=@UNCACHED_CXX@
export USE_LD=@USE_LD@
export USE_LIBRARY_BIN_TAR=@USE_LIBRARY_BIN_TAR@
export USE_XINERAMA=@USE_XINERAMA@
diff --git a/configure.ac b/configure.ac
index 2c7ed9fb3aec..78dc6c8deae6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4318,7 +4318,6 @@ AC_SUBST(SHOWINCLUDES_PREFIX)
#
# prefix C with ccache if needed
#
-UNCACHED_CC="$CC"
if test "$CCACHE" != ""; then
AC_MSG_CHECKING([whether $CC_BASE is already ccached])
@@ -6792,7 +6791,6 @@ AC_SUBST(BOOST_CXXFLAGS)
#
# prefx CXX with ccache if needed
#
-UNCACHED_CXX="$CXX"
if test "$CCACHE" != ""; then
AC_MSG_CHECKING([whether $CXX_BASE is already ccached])
AC_LANG_PUSH([C++])
@@ -12360,8 +12358,6 @@ fi
#
# prefix LO_CLANG_CC/LO_CLANG_CXX with ccache if needed
#
-UNCACHED_CLANG_CC="$LO_CLANG_CC"
-UNCACHED_CLANG_CXX="$LO_CLANG_CXX"
if test "$CCACHE" != "" -a -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
AC_MSG_CHECKING([whether $LO_CLANG_CC is already ccached])
AC_LANG_PUSH([C])
@@ -12402,12 +12398,8 @@ if test "$CCACHE" != "" -a -n "$LO_CLANG_CC" -a -n "$LO_CLANG_CXX"; then
AC_LANG_POP([C++])
fi
-AC_SUBST(UNCACHED_CC)
-AC_SUBST(UNCACHED_CXX)
AC_SUBST(LO_CLANG_CC)
AC_SUBST(LO_CLANG_CXX)
-AC_SUBST(UNCACHED_CLANG_CC)
-AC_SUBST(UNCACHED_CLANG_CXX)
AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSE2)
AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSSE3)
AC_SUBST(LO_CLANG_CXXFLAGS_INTRINSICS_SSE41)
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index f02e2a48649f..f0da634be0b9 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -623,10 +623,10 @@ endef
# /opt/lo/bin/ccache /cygdrive/c/PROGRA~2/MICROS~2.0/VC/bin/cl.exe
gb_AUTOCONF_WRAPPERS = \
- REAL_CC="$(shell cygpath -w $(filter-out -%,$(UNCACHED_CC)))" \
+ REAL_CC="$(shell cygpath -w $(filter-out -%,$(CC)))" \
REAL_CC_FLAGS="$(filter -%,$(CC))" \
CC="$(call gb_Executable_get_target_for_build,gcc-wrapper)" \
- REAL_CXX="$(shell cygpath -w $(filter-out -%,$(UNCACHED_CXX)))" \
+ REAL_CXX="$(shell cygpath -w $(filter-out -%,$(CXX)))" \
REAL_CXX_FLAGS="$(filter -%,$(CXX))" \
CXX="$(call gb_Executable_get_target_for_build,g++-wrapper)" \
LD="$(shell cygpath -w $(COMPATH)/bin/link.exe) -nologo"
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 8dccadd1f743..e1912285c4b7 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -319,7 +319,7 @@ endef
# we explicitly have to replace cygwin with mingw32 for the host, but the build must stay cygwin, or cmd.exe processes will be spawned
gb_WIN_GPG_WINDRES_target := $(if $(filter INTEL,$(CPUNAME)),pe-i386,pe-x86-64)
gb_WIN_GPG_platform_switches := --build=$(BUILD_PLATFORM) --host=$(subst cygwin,mingw32,$(HOST_PLATFORM))
-gb_WIN_GPG_cross_setup_exports = export REAL_BUILD_CC="$(filter-out -%,$(UNCACHED_CC))" REAL_BUILD_CC_FLAGS="$(filter -%,$(UNCACHED_CC))" \
+gb_WIN_GPG_cross_setup_exports = export REAL_BUILD_CC="$(filter-out -%,$(CC_FOR_BUILD))" REAL_BUILD_CC_FLAGS="$(filter -%,$(CC_FOR_BUILD))" \
&& export CC_FOR_BUILD="$(call gb_Executable_get_target_for_build,gcc-wrapper) --wrapper-env-prefix=REAL_BUILD_ $(SOLARINC) -L$(subst ;, -L,$(ILIB_FOR_BUILD))" \
&& export RC='windres -O COFF --target=$(gb_WIN_GPG_WINDRES_target) --preprocessor=$(call gb_Executable_get_target_for_build,cpp) --preprocessor-arg=-+ -DRC_INVOKED -DWINAPI_FAMILY=0 $(SOLARINC)'
diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index 72e48e5a7b37..3504d3d8c5ab 100644
--- a/solenv/gcc-wrappers/wrapper.cxx
+++ b/solenv/gcc-wrappers/wrapper.cxx
@@ -251,9 +251,14 @@ int startprocess(std::string command, std::string args, bool verbose)
// support ccache
size_t pos=command.find("ccache ");
+ size_t len = strlen("ccache ");
+ if(pos == std::string::npos) {
+ pos=command.find("ccache.exe ");
+ len = strlen("ccache.exe ");
+ }
if(pos != std::string::npos) {
- args.insert(0,"cl.exe");
- command=command.substr(0,pos+strlen("ccache"))+".exe";
+ args.insert(0,command.substr(pos+len));
+ command=command.substr(0,pos+len-1);
}
auto cmdline = "\"" + command + "\" " + args;