diff --git a/configure b/configure
index 46312ee8568d3d30c403d70a8789ef64ce075209..8623f98b4f7106a9c8c93d326c6bc13c758f62f6 100755
--- a/configure
+++ b/configure
@@ -1629,7 +1629,7 @@ fi
 
 # Create compiler version string
 if test x"$GCC" = x"yes" ; then
-  cc_string="GCC `${CC} --version | head -1`"
+  cc_string="GCC `${CC} --version | sed q`"
 else
   cc_string=$CC
 fi
diff --git a/configure.in b/configure.in
index 165f546464c040206546e21dfb263aae55e39e1b..f69658acfc1363f50cf75b73e29e982755ff8c73 100644
--- a/configure.in
+++ b/configure.in
@@ -297,7 +297,7 @@ AC_SUBST(GCC)
 
 # Create compiler version string
 if test x"$GCC" = x"yes" ; then
-  cc_string="GCC `${CC} --version | head -1`"
+  cc_string="GCC `${CC} --version | sed q`"
 else
   cc_string=$CC
 fi