configure.ac |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 92f952971908e84ea1c32ab93c8d6b2b6d66b392
Author:     Đoàn Trần Công Danh <congdan...@gmail.com>
AuthorDate: Wed Jul 24 22:06:12 2024 +0700
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Thu Oct 17 11:40:37 2024 +0200

    configure.ac: Drop bashism
    
    - ${var/pattern/replacement} and here-string are bashism.
    
    - here string (<<<<) is bashism too, depsited it's intended for Windows
      build only (which uses Bash inside msys), however the code block is
      still parsed on other platforms (without bash a /bin/sh) before
      evaluated. Let's remove that too.
    
    Change-Id: I3ba59d97b9e9a6b29496b3401c29c4fbf99f46d4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170969
    Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/configure.ac b/configure.ac
index dd2954a283b8..f622d1eb8a7b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4731,7 +4731,7 @@ if test "$CCACHE" != ""; then
                       [use_ccache=yes], [use_ccache=no])
     CFLAGS=$save_CFLAGS
     ac_c_werror_flag=$save_ac_c_werror_flag
-    if test $use_ccache = yes -a "${CCACHE/*sccache*/}" != ""; then
+    if test $use_ccache = yes -a "${CCACHE##*sccache*}" != ""; then
         AC_MSG_RESULT([yes])
     else
         CC="$CCACHE $CC"
@@ -7095,9 +7095,8 @@ if test "$_os" = "WINNT"; then
         WINDOWS_SDK_LIB_SUBDIR=$winsdklibsubdir
         # The variable also contains the Windows SDK version
         echo $WINDOWS_SDK_LIB_SUBDIR
-        IFS='.' read -r SDK_v1 SDK_v2 SDK_v3 SDK_v4 <<< 
"$WINDOWS_SDK_LIB_SUBDIR"
         # Assuming maximum of 5 digits for each part and ignoring last part
-        SDK_NORMALIZED_VER=$((SDK_v1 * 10000000000 + SDK_v2 * 100000 + SDK_v3))
+        SDK_NORMALIZED_VER=$(echo $WINDOWS_SDK_LIB_SUBDIR | awk -F. 
'{printf("%d%05d%05d
", $1, $2, $3)}')
         # 10.0.20348.0 is the minimum required version
         if test "$SDK_NORMALIZED_VER" -lt 100000020348; then
             AC_MSG_ERROR([You need Windows SDK greater than or equal 
10.0.20348.0])
@@ -7407,7 +7406,7 @@ if test "$CCACHE" != ""; then
     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 -a "${CCACHE/*sccache*/}" != ""; then
+    if test $use_ccache = yes -a "${CCACHE##*sccache*}" != ""; then
         AC_MSG_RESULT([yes])
     else
         CXX="$CCACHE $CXX"
@@ -13048,7 +13047,7 @@ if test "$CCACHE" != "" -a -n "$LO_CLANG_CC" -a -n 
"$LO_CLANG_CXX"; then
                       [use_ccache=yes], [use_ccache=no])
     CFLAGS=$save_CFLAGS
     CC=$save_CC
-    if test $use_ccache = yes -a "${CCACHE/*sccache*/}" != ""; then
+    if test $use_ccache = yes -a "${CCACHE##*sccache*}" != ""; then
         AC_MSG_RESULT([yes])
     else
         LO_CLANG_CC="$CCACHE $LO_CLANG_CC"
@@ -13065,7 +13064,7 @@ if test "$CCACHE" != "" -a -n "$LO_CLANG_CC" -a -n 
"$LO_CLANG_CXX"; then
     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 -a "${CCACHE/*sccache*/}" != ""; then
+    if test $use_ccache = yes -a "${CCACHE##*sccache*}" != ""; then
         AC_MSG_RESULT([yes])
     else
         LO_CLANG_CXX="$CCACHE $LO_CLANG_CXX"

Reply via email to