From 529a31c967a202458abd126d378a2f690c2ec256 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 19 Feb 2014 14:12:36 +0100 Subject: [PATCH] configure: fix expanding system commands in qmake parser with GNU awk < 4 qmake variables using $$system() were incorrectly parsed by the custom qmake parser in the configure script, when using GNU awk 3.1.8 or earlier. They are parsed correctly with GNU awk 4 or mawk. This was occurring with such an assignement (from an extra mkspecs file): QMAKE_CC = $$system($$CMD QMAKE_CC 2>/dev/null) The custom qmake parser in the configure script first attempts to expand $$UPPERCASE variables, before running $$system(), using this: match(value, /\$\$(\{[_A-Z0-9.]+\}|[_A-Z0-9.]+)/) But when using non-ASCII locales with GNU awk 3.1.8 or earlier, $$system was expanded (to an empty string) because these earlier awk versions match lowercase letters for the [A-Z] regexp, which is traditionally used to match uppercase letters. This behavior has been changed in GNU awk 4.0.0, which only matches uppercase letters for [A-Z] by default. A workaround for earlier GNU awk versions is to run awk with the C locale. See GNU awk NEWS "Changes from 3.1.8 to 4.0.0": 25. Gawk now treats ranges of the form [d-h] as if they were in the C locale, no matter what kind of regexp is being used, and even if --posix. The latest POSIX standard allows this, and the documentation has been updated. Maybe this will stop all the questions about [a-z] matching uppercase letters. THIS CHANGES BEHAVIOR!!!! See also gawk.info "A.7 Regexp Ranges and Locales: A Long Sad Story" Change-Id: Ibb3eb28738c3e77d496c634e1f5c9f630957e730 Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index cb8d78fd3c..b3b7528382 100755 --- a/configure +++ b/configure @@ -195,7 +195,7 @@ expandQMakeConf() extractQMakeVariables() { - $AWK ' + LC_ALL=C $AWK ' BEGIN { values["LITERAL_WHITESPACE"] = " " values["LITERAL_DOLLAR"] = "$"