From owner-freebsd-hackers Fri Dec 21 3:17:19 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id AD25337B416; Fri, 21 Dec 2001 03:16:56 -0800 (PST) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.6/8.11.2) id fBLBGfg73736; Fri, 21 Dec 2001 13:16:41 +0200 (EET) (envelope-from ru) Date: Fri, 21 Dec 2001 13:16:41 +0200 From: Ruslan Ermilov To: Nik Clayton Cc: Sheldon Hearn , The Anarcat , freebsd-arch@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: making /usr/share/mk apps PREFIX-independant??? Message-ID: <20011221131641.A66666@sunbay.com> References: <20011221093030.D39918@sunbay.com> <49864.1008924553@axl.seasidesoftware.co.za> <20011221100658.M51511@clan.nothing-going-on.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011221100658.M51511@clan.nothing-going-on.org> User-Agent: Mutt/1.3.23i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Dec 21, 2001 at 10:06:58AM +0000, Nik Clayton wrote: > On Fri, Dec 21, 2001 at 10:49:13AM +0200, Sheldon Hearn wrote: > > On Fri, 21 Dec 2001 09:30:30 +0200, Ruslan Ermilov wrote: > > > I'm against PREFIX in share/mk files. Instead, just setting > > > DESTDIR=${PREFIX} should (almost) be enough. > > > > I agree. See ports/mail/popd/Makefile for an example of a port that > > uses a pure bsd.prog.mk-driven Makefile for ${PREFIX}-sensitive > > installation. > > Doesn't it strike anyone as being a bit, well, icky, that we have to do > this for software developed on this platform, using this platform's > standard infrastructure for defining Makefiles? > > Perhaps just a "USES_BSD_MK=yes" flag to wrap this for other ports as > well (I'm thinking specifically of the scr* stuff I wrote, but there may > be others). > You don't listen. :-) Just adding PREFIX won't solve anything, as you still need to supply the correct BINDIR (which is, for the main src/ tree makefiles, initialized by the root Makefile.inc in each subtree), and provide the correct MANDIR, LIBDIR, etc. In the port I maintain (ports/net/tcpmssd), the main program's Makefile looks like this: : PROG= tcpmssd : PREFIX?= /usr/local : BINDIR= ${PREFIX}/bin : MAN8= tcpmssd.8 : MANDIR= ${PREFIX}/man/man : : .include If you modify it to look like this (that's the goal?): : PROG= tcpmssd : MAN8= tcpmssd.8 : : .include You still need to supply BINDIR and MANDIR somehow. The following worked for my port flawlessly, but it's a prototype only, and the complete version should cover all bsd.own.mk defines: --- bsd.port.mk~ Wed Nov 28 07:00:36 2001 +++ bsd.port.mk Fri Dec 21 12:58:53 2001 @@ -1158,6 +1158,10 @@ MAKE_ENV+= ${INSTALL_MACROS} SCRIPTS_ENV+= ${INSTALL_MACROS} +.if defined(USE_BSD_MAKE) +MAKE_ENV+= BINDIR=${PREFIX}/bin MANDIR=${PREFIX}/man/man +.endif + # The user can override the NO_PACKAGE by specifying this from # the make command line .if defined(FORCE_PACKAGE) This should work for both /usr/local and /usr/X11R6 prefixes. I don't pretend that this solution is ideal, as a port may need different BINDIR settings for its different parts. I have given a little thinking to this, just to demonstrate that the "fixes" should go into ports/Mk, not into the base .mk files. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message