NetBSD Problem Report #1468

From gnats  Fri Sep 15 23:41:25 1995
Received: from yarrina.connect.com.au (yarrina.connect.com.au [192.189.54.17]) by sun-lamp.pc.cs.cmu.edu (8.6.11/8.6.10) with ESMTP id XAA23575 for <gnats-bugs@gnats.netbsd.org>; Fri, 15 Sep 1995 23:41:22 -0400
Message-Id: <199509152352.JAA02194@topaz.nemeton.com.au>
Date: Sat, 16 Sep 1995 09:52:15 +1000
From: Giles Lean <giles@nemeton.com.au>
Reply-To: giles@nemeton.com.au
To: gnats-bugs@gnats.netbsd.org
Subject: Change request for sys.mk to allow override of CC etc
X-Send-Pr-Version: 3.2

>Number:         1468
>Category:       misc
>Synopsis:       Change request for sys.mk to allow override of CC etc
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 15 23:50:02 +0000 1995
>Closed-Date:    Sat Feb 10 18:29:57 +0000 1996
>Last-Modified:  Sat Feb 10 18:30:38 +0000 1996
>Originator:     Giles Lean
>Release:        September 10 1995
>Organization:
Giles Lean                                             Nemeton Pty Ltd
<giles@nemeton.com.au>                           phone: +61 3 480 2118        
>Environment:

System: NetBSD topaz.nemeton.com.au 1.0A NetBSD 1.0A (TOPAZ) #8: Sun Sep 3 12:30:54 EST 1995 giles@topaz.nemeton.com.au:/usr/src/sys/arch/i386/compile/TOPAZ i386


>Description:
	/usr/share/mk/sys.mk clobbers CC, CFLAGS, LD etc unconditionally.
	This makes it difficult to override CFLAGS when debugging
	a single program, for example, or to direct the standard
	build environment to use /usr/bin/g++ in preferance to any
	other versions in $PATH.

	I have used the following patch for some time without ill
	effects.  Note that applying it means that the environment
	variables CFLAGS, CC etc matter so these variables need to
	be unset for a 'standard' make.

	An invitation to discuss this on tech-userlevel produced
	only one response (from cgd, in favour).
>How-To-Repeat:
>Fix:
	Note that MAKE and SHELL are *not* altered, although a
	case could be made for both it looked more dangerous
	than useful.

*** src/share/mk/sys.mk-orig	Sun Jun 25 17:07:11 1995
--- src/share/mk/sys.mk	Sat Sep 16 09:41:33 1995
***************
*** 7,41 ****

  .LIBS:		.a

! AR=		ar
! ARFLAGS=	rl
! RANLIB=		ranlib

! AS=		as
! AFLAGS=
  COMPILE.s=	${AS} ${AFLAGS}
  LINK.s=		${CC} ${AFLAGS} ${LDFLAGS}
  COMPILE.S=	${CC} ${AFLAGS} ${CPPFLAGS} -c
  LINK.S=		${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}

! CC=		cc
! CFLAGS=		-O
  COMPILE.c=	${CC} ${CFLAGS} ${CPPFLAGS} -c
  LINK.c=		${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}

! CXX=		g++
! CXXFLAGS=	${CFLAGS}
  COMPILE.cc=	${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
  LINK.cc=	${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}

! CPP=		cpp
  .if defined(DESTDIR)
  CPPFLAGS+=	-nostdinc -idirafter ${DESTDIR}/usr/include
  .endif

! FC=		f77
! FFLAGS=		-O
! RFLAGS=
  COMPILE.f=	${FC} ${FFLAGS} -c
  LINK.f=		${FC} ${FFLAGS} ${LDFLAGS}
  COMPILE.F=	${FC} ${FFLAGS} ${CPPFLAGS} -c
--- 7,41 ----

  .LIBS:		.a

! AR?=		ar
! ARFLAGS?=	rl
! RANLIB?=	ranlib

! AS?=		as
! AFLAGS?=
  COMPILE.s=	${AS} ${AFLAGS}
  LINK.s=		${CC} ${AFLAGS} ${LDFLAGS}
  COMPILE.S=	${CC} ${AFLAGS} ${CPPFLAGS} -c
  LINK.S=		${CC} ${AFLAGS} ${CPPFLAGS} ${LDFLAGS}

! CC?=		cc
! CFLAGS?=	-O
  COMPILE.c=	${CC} ${CFLAGS} ${CPPFLAGS} -c
  LINK.c=		${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}

! CXX?=		g++
! CXXFLAGS?=	${CFLAGS}
  COMPILE.cc=	${CXX} ${CXXFLAGS} ${CPPFLAGS} -c
  LINK.cc=	${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS}

! CPP?=		cpp
  .if defined(DESTDIR)
  CPPFLAGS+=	-nostdinc -idirafter ${DESTDIR}/usr/include
  .endif

! FC?=		f77
! FFLAGS?=	-O
! RFLAGS?=
  COMPILE.f=	${FC} ${FFLAGS} -c
  LINK.f=		${FC} ${FFLAGS} ${LDFLAGS}
  COMPILE.F=	${FC} ${FFLAGS} ${CPPFLAGS} -c
***************
*** 43,69 ****
  COMPILE.r=	${FC} ${FFLAGS} ${RFLAGS} -c
  LINK.r=		${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}

! LEX=		lex
! LFLAGS=
  LEX.l=		${LEX} ${LFLAGS}

! LD=		ld
! LDFLAGS=

! LINT=		lint
! LINTFLAGS=	-chapbx

  MAKE=		make

! PC=		pc
! PFLAGS=
  COMPILE.p=	${PC} ${PFLAGS} ${CPPFLAGS} -c
  LINK.p=		${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}

  SHELL=		sh

! YACC=		yacc
! YFLAGS=		-d
  YACC.y=		${YACC} ${YFLAGS}

  # C
--- 43,69 ----
  COMPILE.r=	${FC} ${FFLAGS} ${RFLAGS} -c
  LINK.r=		${FC} ${FFLAGS} ${RFLAGS} ${LDFLAGS}

! LEX?=		lex
! LFLAGS?=
  LEX.l=		${LEX} ${LFLAGS}

! LD?=		ld
! LDFLAGS?=

! LINT?=		lint
! LINTFLAGS?=	-chapbx

  MAKE=		make

! PC?=		pc
! PFLAGS?=
  COMPILE.p=	${PC} ${PFLAGS} ${CPPFLAGS} -c
  LINK.p=		${PC} ${PFLAGS} ${CPPFLAGS} ${LDFLAGS}

  SHELL=		sh

! YACC?=		yacc
! YFLAGS?=	-d
  YACC.y=		${YACC} ${YFLAGS}

  # C
>Release-Note:
>Audit-Trail:

From: matthew green <mrg@mame.mu.OZ.AU>
To: giles@nemeton.com.au
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: misc/1468: Change request for sys.mk to allow override of CC etc 
Date: Sat, 16 Sep 1995 23:11:34 +1000

    	Note that MAKE and SHELL are *not* altered, although a
    	case could be made for both it looked more dangerous
    	than useful.

 i actually think it is a bug that MAKE is set unconditionally.  recently
 i installed our make on our sunos 4 & 5 machines at work, but, i had to
 call it pmake.  when i used bsd.subdir.mk, my make files broke because
 it ran make (ie, the sun one) in the subdir.  this was less than acceptable.
 the change i made was to use the ?= operator -- it's even arguable (though,
 i wouldn't do this) that having it at all is useless, as pmake sets the
 variable MAKE *very* close to the top of main() to the value of argv[0].

 .mrg.
State-Changed-From-To: open->closed 
State-Changed-By: christos 
State-Changed-When: Sat Feb 10 13:29:57 EST 1996 
State-Changed-Why:  
I think I fixed it a long time ago 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.