[gimp/gimp-2-10] configure.ac: escape backslash chars in compiler version string



commit 9ae2e4932d12166714ea7c36fc7afa80fc2d587b
Author: Ell <ell_se yahoo com>
Date:   Sun Nov 11 05:45:07 2018 -0500

    configure.ac: escape backslash chars in compiler version string
    
    When constructing CC_VERSION, escape backslash characters in the
    compiler version string, so that they don't get interpreted as
    escape sequences by the compiler.  This is especially important on
    Windows, where the version string of MinGW may contain backslash
    characters as part of paths.
    
    (cherry picked from commit c0b107531e65e47149c248449ca7bac8d20632ee)

 configure.ac | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e43d37112e..bcf5d0d587 100644
--- a/configure.ac
+++ b/configure.ac
@@ -578,21 +578,23 @@ WARNING: GCC 7.2.0 has a serious bug affecting GEGL/GIMP. We advise
          See https://bugzilla.gnome.org/show_bug.cgi?id=787222";
   fi
   # For GCC, use -v which has more information than --version.
-  CC_VERSION="\\\\t`$CC -v 2>&1 | sed -e 's/$/\\\\n\\\\t/g' | tr -d '\n'`"
+  CC_VERSION="`$CC -v 2>&1`"
 else
   # This is the list of common options used by autotools to check
   # versions for various compilers.
-  CC_VERSION="\\\\t`$CC --version 2>&1 | sed -e 's/$/\\\\n\\\\t/g' | tr -d '\n'`"
+  CC_VERSION="`$CC --version 2>&1`"
   if test $? != 0; then
-    CC_VERSION="\\\\t`$CC -v 2>&1` | sed -e 's/$/\\\\n\\\\t/g' | tr -d '\n'"
+    CC_VERSION="`$CC -v 2>&1`"
     if test $? != 0; then
-      CC_VERSION="\\\\t`$CC -V 2>&1` | sed -e 's/$/\\\\n\\\\t/g' | tr -d '\n'"
+      CC_VERSION="`$CC -V 2>&1`"
       if test $? != 0; then
-        CC_VERSION="\\\\t`$CC -qversion 2>&1` | sed -e 's/$/\\\\n\\\\t/g' | tr -d '\n'"
+        CC_VERSION="`$CC -qversion 2>&1`"
       fi
     fi
   fi
 fi
+# Format and escape CC_VERSION
+CC_VERSION="\\t`echo "$CC_VERSION" | sed -e 's/\\\\/\\\\\\\\/g;s/$/\\\\n\\\\t/g' | tr -d '\n'`"
 AC_SUBST(CC_VERSION)
 
 AC_HEADER_STDC


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]