Subject: Re: [patch] lang/gcc/buildlink.mk
To: Sebastian <sebastian-p@gmx.net>
From: None <wulf@ping.net.au>
List: tech-pkg
Date: 03/02/2003 13:58:39
> 
> 
> --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--

whats wrong with

hotdog# gcc -dumpversion
3.2.2

hence my suggestions:

----------------------- cut ---------------------------
--- buildlink2.mk.orig  Sun Mar  2 13:56:12 2003
+++ buildlink2.mk       Sun Mar  2 13:56:54 2003
@@ -34,7 +34,7 @@

 BUILDLINK_LDFLAGS.gcc= -L${_GCC_ARCHDIR} -Wl,-R${_GCC_ARCHDIR}

 -_GCC_VERSION!=         ( gcc --version ) 2>/dev/null || ${ECHO} 0
 +_GCC_VERSION!=         ( gcc -dumpversion ) 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".
----------------------- cut ---------------------------

this works for both, gcc and gcc3....

cheerio Berndt