Subject: pkg/22866: mk/compiler.mk gets the egcs test backwards for 1.5.x
To: None <gnats-bugs@gnats.netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 09/19/2003 20:35:18
>Number:         22866
>Category:       pkg
>Synopsis:       mk/compiler.mk gets the egcs test backwards for 1.5.x
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 20 00:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Greg A. Woods
>Release:        NetBSD-1.5.x
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD 1.5.4_ALPHA
Architecture: i386
Machine: i386
>Description:

	It seems to me as though pkgsrc/mk/compiler.mk gets the test for
	egcs "backwards", at least for 1.5.x.

	note that the string contains "gcc" and so the test for "egcs"
	must be done first, not second.....


>How-To-Repeat:

	$ uname -srm
	NetBSD 1.5.4_ALPHA i386
	$ gcc -v
	Using builtin specs.
	gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)

	(same thing happens on 1.5W (aka -current as of 2001/06/24))

>Fix:

Index: mk/compiler.mk
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/mk/compiler.mk,v
retrieving revision 1.8
diff -c -r1.8 compiler.mk
*** mk/compiler.mk	17 Sep 2003 19:58:08 -0000	1.8
--- mk/compiler.mk	20 Sep 2003 00:26:12 -0000
***************
*** 63,73 ****
  			fi
  
  # egcs is considered to be gcc-2.8.1.
! .  if !empty(_CC_VERSION_STRING:Mgcc*)
! _CC_VERSION!=		${CC} -dumpversion
! _CC_IS_GCC=		YES
! .  elif !empty(_CC_VERSION_STRING:Megcs*)
  _CC_VERSION=		2.8.1
  _CC_IS_GCC=		YES
  .  endif
  
--- 63,73 ----
  			fi
  
  # egcs is considered to be gcc-2.8.1.
! .  if !empty(_CC_VERSION_STRING:Megcs*)
  _CC_VERSION=		2.8.1
+ _CC_IS_GCC=		YES
+ .  elif !empty(_CC_VERSION_STRING:Mgcc*)
+ _CC_VERSION!=		${CC} -dumpversion
  _CC_IS_GCC=		YES
  .  endif
  

>Release-Note:
>Audit-Trail:
>Unformatted: