From alex@vaio.alexdupre.com  Thu Jul 11 01:12:44 2002
Return-Path: <alex@vaio.alexdupre.com>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7767437B400
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 11 Jul 2002 01:12:44 -0700 (PDT)
Received: from vaio.alexdupre.com (212-41-211-209.adsl.galactica.it [212.41.211.209])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A436343E58
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 11 Jul 2002 01:12:37 -0700 (PDT)
	(envelope-from alex@vaio.alexdupre.com)
Received: from vaio.alexdupre.com (localhost [127.0.0.1])
	by vaio.alexdupre.com (8.12.2/8.12.2) with ESMTP id g6B8EURb000318
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 11 Jul 2002 10:14:30 +0200 (CEST)
	(envelope-from alex@vaio.alexdupre.com)
Received: (from alex@localhost)
	by vaio.alexdupre.com (8.12.2/8.12.2/Submit) id g6B8ETeF000317;
	Thu, 11 Jul 2002 10:14:29 +0200 (CEST)
Message-Id: <200207110814.g6B8ETeF000317@vaio.alexdupre.com>
Date: Thu, 11 Jul 2002 10:14:29 +0200 (CEST)
From: Alex Dupre <sysadmin@alexdupre.com>
Reply-To: Alex Dupre <sysadmin@alexdupre.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [bmake bug] BSD make cannot find system mks (on new releases)
X-Send-Pr-Version: 3.113
X-GNATS-Notify: ru

>Number:         40448
>Category:       bin
>Synopsis:       [bmake bug] BSD make cannot find system mks (on new releases)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    jmallett
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 11 01:20:01 PDT 2002
>Closed-Date:    Tue Oct 22 19:00:02 PDT 2002
>Last-Modified:  Tue Oct 22 19:00:02 PDT 2002
>Originator:     Alex Dupre
>Release:        FreeBSD 4.5-ALEXDUPRE i386
>Organization:
>Environment:
System: FreeBSD vaio.alexdupre.com 4.5-ALEXDUPRE FreeBSD 4.5-ALEXDUPRE #0: Fri Apr 12 14:12:57 CEST 2002 alex@vaio.alexdupre.com:/usr/obj/usr/src/sys/VAIO i386


	
>Description:
On fresh installs of FreeBSD 4.6-STABLE (I tried with a 20020704-JPSNAP) bmake
has a different behaviour (I think it's a bug). It seems it cannot find system
makefiles, like bsd.lib.mk, located in /usr/share/mk. This avoids correct
building of some ports (until now I discovered pdflib and gd2...for the first
it's enough to use gmake, for the second I had to put complete paths to find
the mks), but I think it's more serious than that. 
	
>How-To-Repeat:
I tried to run "make -f bsd.lib.mk -d A" on an "old" machine and on the new
one, from my home dir. The outputs become to differ here:


[old bmake, working]

Searching for bsd.lib.mk...failed.
Searching for bsd.lib.mk.../usr/share/mk...here...returning /usr/share/mk/bsd.lib.mk
Global:MAKEFILE = /usr/share/mk/bsd.lib.mk
Searching for /usr/home/alex/../Makefile.inc...Looking for "/usr/home/alex/../Makefile.inc"...failed. Returning NULL
Searching for /usr/home/alex/shlib_version...Looking for "/usr/home/alex/shlib_version"...failed. Returning NULL
lhs = "elf", rhs = "elf", op = ==
Global:SONAME = ${SHLIB_NAME}
lhs = "elf", rhs = "aout", op = !=
Searching for bsd.libnames.mk...failed.
Searching for bsd.libnames.mk...failed.
Searching for bsd.libnames.mk.../usr/share/mk...here...returning /usr/share/mk/bsd.libnames.mk
Global:LIBCRT0 = ${DESTDIR}${LIBDIR}/crt0.o
Global:LIBKZHEAD = ${DESTDIR}${LIBDIR}/kzhead.o
Global:LIBKZTAIL = ${DESTDIR}${LIBDIR}/kztail.o
[...] many lines here
#*** Input graph:


[new bmake, not working]

Searching for /usr/home/alex/bsd.lib.mk...Looking for "/usr/home/alex/bsd.lib.mk"...failed. Returning NULL
Searching for /usr/home/alex/bsd.lib.mk.../usr/share/mk...here...component mismatch -- continuing...Looking for "/usr/home/alex/bsd.lib.mk"...failed. Returning
NULL
#*** Input graph:

	
>Fix:
Ports work-around as described before. For bmake I dunno.
	


>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: Alex Dupre <sysadmin@alexdupre.com>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG, <jmallett@FreeBSD.ORG>
Subject: Re: bin/40448: [bmake bug] BSD make cannot find system mks (on new
 releases)
Date: Fri, 12 Jul 2002 04:52:14 +1000 (EST)

 On Thu, 11 Jul 2002, Alex Dupre wrote:
 
 > >Description:
 > On fresh installs of FreeBSD 4.6-STABLE (I tried with a 20020704-JPSNAP) bmake
 > has a different behaviour (I think it's a bug). It seems it cannot find system
 > makefiles, like bsd.lib.mk, located in /usr/share/mk. This avoids correct
 > building of some ports (until now I discovered pdflib and gd2...for the first
 > it's enough to use gmake, for the second I had to put complete paths to find
 > the mks), but I think it's more serious than that.
 >
 > >How-To-Repeat:
 > I tried to run "make -f bsd.lib.mk -d A" on an "old" machine and on the new
 > one, from my home dir. The outputs become to differ here:
 
 I think this _was_ a bug.  I think "make -f foo" says to search for the
 makefile named "foo" in the current directory only.  It was searched for
 in system directories, so bsd.lib.mk was found.  This was fixed in
 rev.1.35.2.5 of make/main.c.
 
 "foo" is still searched for in the object directory.  So is "./foo".  The
 search order is undocumented.
 
 This is probably related to the bug that .depend is searched for in the
 current directory and the object directory in an undocumented order.
 Stale .depend files in the current directory can cause very confusing
 problems.
 
 Bruce
 
Responsible-Changed-From-To: freebsd-bugs->jmallett 
Responsible-Changed-By: ru 
Responsible-Changed-When: Mon Sep 16 05:57:16 PDT 2002 
Responsible-Changed-Why:  
Juli did the code change, so she might as well want to close this PR. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40448 
State-Changed-From-To: open->closed 
State-Changed-By: jmallett 
State-Changed-When: Tue Oct 22 18:59:31 PDT 2002 
State-Changed-Why:  
For all intents and purposes this issue is fixed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=40448 
>Unformatted:
