From 1f9510f1a373fef033cd5f05453b4c48ec6366f8 Mon Sep 17 00:00:00 2001 From: Marco Bonardo Date: Wed, 22 Jan 2014 09:22:30 +0100 Subject: [PATCH] Bug 960458 - cl.py doesn't properly parse showIncludes prefix on some localized versions. r=glandium --- configure.in | 8 +++++++- js/src/configure.in | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index a1ebbcc88605..05a54dd22f5c 100644 --- a/configure.in +++ b/configure.in @@ -7740,8 +7740,14 @@ else else echo '#include ' > dummy-hello.c changequote(,) - CL_INCLUDES_PREFIX=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/^\([^:]*:[^:]*:\).*stdio.h$/\1/p'` + dnl This output is localized, split at the first double space or colon and space. + _CL_PREFIX_REGEX="^\([^:]*:.*[ :] \)\(.*stdio.h\)$" + CL_INCLUDES_PREFIX=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\1/p'` + _CL_STDIO_PATH=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\2/p'` changequote([,]) + if ! test -e "$_CL_STDIO_PATH"; then + AC_MSG_ERROR([Unable to parse cl -showIncludes prefix. This compiler's locale has an unsupported formatting.]) + fi if test -z "$CL_INCLUDES_PREFIX"; then AC_MSG_ERROR([Cannot find cl -showIncludes prefix.]) fi diff --git a/js/src/configure.in b/js/src/configure.in index d92695339bfa..a318507ddeff 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -3820,8 +3820,14 @@ else else echo '#include ' > dummy-hello.c changequote(,) - CL_INCLUDES_PREFIX=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/^\([^:]*:[^:]*:\).*stdio.h$/\1/p'` + dnl This output is localized, split at the first double space or colon and space. + _CL_PREFIX_REGEX="^\([^:]*:.*[ :] \)\(.*stdio.h\)$" + CL_INCLUDES_PREFIX=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\1/p'` + _CL_STDIO_PATH=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\2/p'` changequote([,]) + if ! test -e "$_CL_STDIO_PATH"; then + AC_MSG_ERROR([Unable to parse cl -showIncludes prefix. This compiler's locale has an unsupported formatting.]) + fi if test -z "$CL_INCLUDES_PREFIX"; then AC_MSG_ERROR([Cannot find cl -showIncludes prefix.]) fi