From owner-freebsd-ports Fri Oct 6 01:15:24 1995 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA16594 for ports-outgoing; Fri, 6 Oct 1995 01:15:24 -0700 Received: from veda.is (root@veda.is [193.4.230.1]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id BAA16589 for ; Fri, 6 Oct 1995 01:15:17 -0700 Received: (from adam@localhost) by veda.is (8.6.12/8.6.12) id IAA11823; Fri, 6 Oct 1995 08:14:57 GMT From: Adam David Message-Id: <199510060814.IAA11823@veda.is> Subject: Re: nntp dependency To: asami@cs.berkeley.edu (Satoshi Asami) Date: Fri, 6 Oct 1995 08:14:54 +0000 (GMT) Cc: ports@freebsd.org In-Reply-To: <199510060212.TAA18875@forgery.CS.Berkeley.EDU> from "Satoshi Asami" at Oct 5, 95 07:12:25 pm X-Mailer: ELM [version 2.4 PL24 ME8a] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Length: 850 Sender: owner-ports@freebsd.org Precedence: bulk > * Is there an accepted convention for substituting variables such as > * ${PREFIX} into patchfiles? This port currently has /usr/local > * hardcoded at a deeper level, and I suspect there are other ports > * that suffer from the same problem. > > The default do-build target will pass down PREFIX in the environment > so if you can pick it up from there, it will be fine. Just do a > "CFLAGS += -DPREFIX=${PREFIX}" or something in the Makefile. > > Satoshi Not generic enough. A port might already #define PREFIX for another purpose, and this would not make substitutions in scripts, only in .c and .h files. I have seen some of the ports use a magic string to delineate hardcoded substitutions into source files (using sed for instance). What I am asking for is a documented convention, a recommended method. -- Adam David