[Libreoffice-commits] core.git: configure.ac

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 18 14:25:12 UTC 2020


 configure.ac |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

New commits:
commit a88e477346361665311eb2310e84023ce8a2fe59
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Mon Aug 17 14:40:52 2020 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Tue Aug 18 16:24:28 2020 +0200

    make --enable-ccache affect also CLANG_CC/CXX
    
    Change-Id: I743ef8cc00eb605ee20da5d9524a5a46ed841e3b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100865
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/configure.ac b/configure.ac
index ce2cdec3be4c..62052bb63a58 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11489,6 +11489,49 @@ if test "$ENABLE_SKIA" = TRUE -a "$COM_IS_CLANG" != TRUE; then
         CXX="$save_CXX"
     fi
 fi
+#
+# prefix CLANG_CC/CLANG_CXX with ccache if needed
+#
+if test "$CCACHE" != "" -a -n "$CLANG_CC" -a -n "$CLANG_CXX"; then
+    AC_MSG_CHECKING([whether $CLANG_CC is already ccached])
+    AC_LANG_PUSH([C])
+    save_CC="$CC"
+    CC="$CLANG_CC"
+    save_CFLAGS=$CFLAGS
+    CFLAGS="$CFLAGS --ccache-skip -O2"
+    dnl an empty program will do, we're checking the compiler flags
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
+                      [use_ccache=yes], [use_ccache=no])
+    if test $use_ccache = yes; then
+        AC_MSG_RESULT([yes])
+    else
+        CLANG_CC="$CCACHE $CLANG_CC"
+        AC_MSG_RESULT([no])
+    fi
+    CFLAGS=$save_CFLAGS
+    CC=$save_CC
+    AC_LANG_POP([C])
+
+    AC_MSG_CHECKING([whether $CLANG_CXX is already ccached])
+    AC_LANG_PUSH([C++])
+    save_CXX="$CXX"
+    CXX="$CLANG_CXX"
+    save_CXXFLAGS=$CXXFLAGS
+    CXXFLAGS="$CXXFLAGS --ccache-skip -O2"
+    dnl an empty program will do, we're checking the compiler flags
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[])],
+                      [use_ccache=yes], [use_ccache=no])
+    if test $use_ccache = yes; then
+        AC_MSG_RESULT([yes])
+    else
+        CLANG_CXX="$CCACHE $CLANG_CXX"
+        AC_MSG_RESULT([no])
+    fi
+    CXXFLAGS=$save_CXXFLAGS
+    CXX=$save_CXX
+    AC_LANG_POP([C++])
+fi
+
 AC_SUBST(CLANG_CC)
 AC_SUBST(CLANG_CXX)
 AC_SUBST(CLANG_CXXFLAGS_INTRINSICS_SSE2)


More information about the Libreoffice-commits mailing list