From: Andrew Clayton Date: Wed, 29 Apr 2026 18:18:03 +0000 (+0100) Subject: Configure: fix gcc version detection in some corner cases X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=35510ddc944373e41bd8497f4fea30d36606b1e7;p=nginx.git Configure: fix gcc version detection in some corner cases If the "gcc version ... " string appeared within "Configured with:", it was picked up rather than the real gcc version string. This might then break the configure scripts due to a malformed NGX_COMPILER macro. The simple fix is to look for "gcc version ... " at the start of the line, rather than anywhere within. Suggested-by: Aleksei Bavshin Closes: https://github.com/nginx/nginx/issues/1278 --- diff --git a/auto/cc/name b/auto/cc/name index f15a8538c..c958ad2f5 100644 --- a/auto/cc/name +++ b/auto/cc/name @@ -57,7 +57,7 @@ elif `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then NGX_CC_NAME=gcc echo " + using GNU C compiler" - NGX_CC_VER=`$CC -v 2>&1 | sed -n -e 's/^.*gcc version \(.*\)/\1/p'` + NGX_CC_VER=`$CC -v 2>&1 | sed -n -e 's/^gcc version \(.*\)/\1/p'` echo " + gcc version: $NGX_CC_VER" have=NGX_COMPILER value="\"gcc $NGX_CC_VER\"" . auto/define