Date: Sun, 23 Dec 2001 05:43:21 -0500 (EST) From: Pete Fritchman <petef@freebsd.org> To: FreeBSD-gnats-submit@freebsd.org Subject: ports/33108: Generate an error if WRKDIRPREFIX == /usr/obj Message-ID: <200112231043.fBNAhKp17154@electron.databits.net>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112231043.fBNAhKp17154>