Subject: [patch] lang/gcc/buildlink.mk
To: None <tech-pkg@netbsd.org>
From: Sebastian <sebastian-p@gmx.net>
List: tech-pkg
Date: 03/01/2003 16:49:11
--Boundary-00=_3ZNY+B9SmZIe43e
Content-Type: text/plain;
  charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

my gcc 3.2.1 (linux - if that matters) prints out more than just the version:

# gcc --verison
gcc (GCC) 3.2.1
Copyright (C) 2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


my little patch strips off everithing exept the version itself so that the 
buildlink.mk file works as expected



--Boundary-00=_3ZNY+B9SmZIe43e
Content-Type: text/x-diff;
  charset="us-ascii";
  name="gcc3_buildlink.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="gcc3_buildlink.patch"

--- buildlink2.mk	2003-03-01 16:27:09.000000000 +0100
+++ buildlink2.mk_foo	2003-03-01 16:03:53.000000000 +0100
@@ -34,7 +34,9 @@
 
 BUILDLINK_LDFLAGS.gcc=	-L${_GCC_ARCHDIR} -Wl,-R${_GCC_ARCHDIR}
 
-_GCC_VERSION!=		( gcc --version ) 2>/dev/null || ${ECHO} 0
+# gcc 3.2.1 prints out lots of stuff, so strip 
+# off everything exept the version itself
+_GCC_VERSION!=		( gcc --version | ${AWK} '/[0-9]+\.[0-9]+\.[0-9]+/ {print}' | ${SED} 's/[a-zA-Z ()]//g' ) 2>/dev/null || ${ECHO} 0
 #
 # GCC_VERSION is the version number of the gcc detected above.  EGCS gcc is
 # considered to be "gcc-2.8.1" so that it will match "gcc>=2.8.0".

--Boundary-00=_3ZNY+B9SmZIe43e--