Subject: bin/2188: g++ still doesn't know where cc is
To: None <gnats-bugs@NetBSD.ORG>
From: Jason Downs <downsj@teeny.org>
List: netbsd-bugs
Date: 03/07/1996 14:35:56
>Number:         2188
>Category:       bin
>Synopsis:       g++ still doesn't know where cc is
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar  7 18:05:02 1996
>Last-Modified:
>Originator:     Jason Downs
>Organization:
Jason Downs
downsj@teeny.org  --> teeny.org: Free Software for a Free Internet <--
http://www.teeny.org/

"Take away the right to say 'fuck' and you take away the right to say 'fuck
 the government.'"		-- Lenny Bruce (1923-1966)
>Release:        NetBSD-current 3/7/96
>Environment:
	
System: NetBSD threadway 1.1A NetBSD 1.1A (THREADWAY) #1: Sun Mar 3 16:57:51 PST 1996 downsj@threadway:/usr/src/sys/arch/i386/compile/THREADWAY i386


>Description:
	g++ appends GCC_NAME to part of it's own path.  Since GCC_NAME
	contains it's own full path, this breaks when it tries to run

	/usr/bin//usr/bin/cc

>How-To-Repeat:
	g++ -v

>Fix:

*** gnu/usr.bin/gcc/g++/orig/Makefile	Thu Feb  8 04:28:03 1996
--- gnu/usr.bin/gcc/g++/Makefile	Sun Mar  3 01:27:24 1996
***************
*** 7,13 ****
  BINDIR=		/usr/bin
  CFLAGS+=        -I$(.CURDIR) -I$(.CURDIR)/../common \
  		-I$(.CURDIR)/../arch -I$(.CURDIR)/../arch/$(MACHINE_ARCH) \
! 		-DGCC_NAME=\"/usr/bin/cc\"
  LDADD+=		-lgnumalloc
  DPADD+=		/usr/lib/libgnumalloc.a
  
--- 7,13 ----
  BINDIR=		/usr/bin
  CFLAGS+=        -I$(.CURDIR) -I$(.CURDIR)/../common \
  		-I$(.CURDIR)/../arch -I$(.CURDIR)/../arch/$(MACHINE_ARCH) \
! 		-DGCC_NAME=\"/usr/bin/cc\" -DGCC_FULLNAME
  LDADD+=		-lgnumalloc
  DPADD+=		/usr/lib/libgnumalloc.a
  
*** gnu/usr.bin/gcc/g++/orig/g++.c	Thu Feb  8 04:28:04 1996
--- gnu/usr.bin/gcc/g++/g++.c	Thu Mar  7 14:32:35 1996
***************
*** 418,423 ****
--- 418,424 ----
      fatal ("No input files specified.\n");
  
  #ifndef __MSDOS__
+ #ifndef GCC_FULLNAME
    /* We do a little magic to find out where the main gcc executable
       is.  If they ran us as /usr/local/bin/g++, then we will look
       for /usr/local/bin/gcc; similarly, if they just ran us as `g++',
***************
*** 429,434 ****
--- 430,439 ----
  			     * sizeof (char));
        sprintf (gcc, "%s/%s", argv[0], GCC_NAME);
      }
+ #else
+       gcc = (char *) malloc (strlen (GCC_NAME) + 1);
+       strcpy (gcc, GCC_NAME);
+ #endif
  #endif
  
    args = (int *) malloc (argc * sizeof (int));
>Audit-Trail:
>Unformatted: