Commit c0b10753 authored by Ell's avatar Ell

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.
parent 45fc30ca
......@@ -580,21 +580,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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment