[PATCH] configure: Fix GCC version regex

Joel Stanley <[email protected]> Fri, 6 Jul 2018 12:02:35 +1000
Newsgroups gmane.comp.audio.mp3.lame
Message-ID <[email protected]>
The regex fails to extract a version:

  $ gcc --version | sed -n '1s/^[[^ ]]* (.*) //;s/ .*$//;1p'
  gcc

This is bad, as the configure script then decides to set GCC to false,
and no optimisation flags are applied. With the fixed regex we see:

  $ gcc --version | sed -n '1s/^[^ ]* (.*) //;s/ .*$//;1p'
  7.3.0

And importantly the optimisation flags are set. Tested on x86 and
ppc64le.

Signed-off-by: Joel Stanley <[email protected]>
---
 configure.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.in b/configure.in
index cea313d..aad5526 100644
--- a/configure.in
+++ b/configure.in
@@ -94,7 +94,7 @@ if test "x${GCC}" = "xyes"; then
 
 	if test "${HAVE_GCC}" = "yes"; then
 		AC_MSG_CHECKING(version of GCC)
-		GCC_version="`${CC} --version | sed -n '1s/^[[^ ]]* (.*) //;s/ .*$//;1p'`"
+		GCC_version="`${CC} --version | sed -n '1s/^[^ ]* (.*) //;s/ .*$//;1p'`"
 		case "${GCC_version}" in 
 		[0-9]*[0-9]*)
 			AC_MSG_RESULT(${GCC_version})
-- 
2.17.1


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot