From owner-freebsd-ports Sun Dec 23 2:50: 8 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id A412137B41E for ; Sun, 23 Dec 2001 02:50:00 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fBNAo0j21222; Sun, 23 Dec 2001 02:50:00 -0800 (PST) (envelope-from gnats) Received: from electron.databits.net (electron.databits.net [207.29.204.16]) by hub.freebsd.org (Postfix) with ESMTP id 5ECED37B419 for ; Sun, 23 Dec 2001 02:43:27 -0800 (PST) Received: (from petef@localhost) by electron.databits.net (8.11.1/8.11.1) id fBNAhKp17154; Sun, 23 Dec 2001 05:43:21 -0500 (EST) (envelope-from petef) Message-Id: <200112231043.fBNAhKp17154@electron.databits.net> Date: Sun, 23 Dec 2001 05:43:21 -0500 (EST) From: Pete Fritchman Reply-To: Pete Fritchman To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: ports/33108: Generate an error if WRKDIRPREFIX == /usr/obj Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 33108 >Category: ports >Synopsis: Generate an error if WRKDIRPREFIX == /usr/obj >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sun Dec 23 02:50:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Pete Fritchman >Release: FreeBSD 5.0-CURRENT i386 >Organization: Databits Network Services, Inc. >Environment: System: FreeBSD entropy.csh.rit.edu 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Sat Dec 22 10:49:03 EST 2001 petef@entropy.csh.rit.edu:/usr/obj/usr/src/sys/ENTROPY i386 This bug exists in -STABLE as well. >Description: make(1) does Special Things when dealing with /usr/obj (mainly it doesn't update ${.CURDIR} if curdir = objdir, and objdir defaults to /usr/obj). I'm not sure of the _exact_ bug (the make(1) code is either bad, or I just suck at C - which is more likely), but if you change /usr/obj to /usr/foo in /usr/src/usr.bin/make/pathnames.h, setting WRKDIRPREFIX=/usr/obj doesn't cause any ports problem. The bug looks like this: 'configure' is up to date. make: don't know how to make real-build. Stop *** Error code 2 This is because ${.CURDIR} points to ${WRKSRC} (/usr/obj/usr/ports/.../work/foo), and bsd.port.mk has a bunch of recursive makes like: cd ${.CURDIR} && make configure cd ${.CURDIR} && make real-build ... and this obviously won't work because it expects that ${.CURDIR} is pointing to the port skeleton directory (as it should be, really). >How-To-Repeat: cd /usr/ports/foo/bar && make WRKDIRPREFIX=/usr/obj This has been brought up on the lists a few times as well. >Fix: After discussing this with Will, I think we should catch this error in bsd.port.mk so people don't shoot themselves in the foot. I'm looking into a proper fix for make(1), too. Index: bsd.port.mk =================================================================== RCS file: /home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.395 diff -u -r1.395 bsd.port.mk --- bsd.port.mk 22 Dec 2001 17:13:38 -0000 1.395 +++ bsd.port.mk 23 Dec 2001 10:34:22 -0000 @@ -805,6 +805,14 @@ _POSTMKINCLUDED= yes +.if defined(WRKDIRPREFIX) +.if (${WRKDIRPREFIX} == "/usr/obj") +pre-everything:: + @${ECHO} "Error: due to a make(1) bug, WRKDIRPREFIX cannot be set to /usr/obj" + @${FALSE} +.endif +.endif + WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}/work .if defined(NO_WRKSUBDIR) WRKSRC?= ${WRKDIR} >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message