Describe usage of LOCALBASE and X11BASE in relation with PREFIX.

This commit is contained in:
Satoshi Asami 1996-04-10 06:32:42 +00:00
parent 3ce1e63802
commit f12244be9e
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=304

View file

@ -1,4 +1,4 @@
<!-- $Id: porting.sgml,v 1.17 1996-03-25 09:35:25 asami Exp $ --> <!-- $Id: porting.sgml,v 1.18 1996-04-10 06:32:42 asami Exp $ -->
<!-- The FreeBSD Documentation Project --> <!-- The FreeBSD Documentation Project -->
<sect1><heading>Porting an existing piece of free software<label id="porting"></heading> <sect1><heading>Porting an existing piece of free software<label id="porting"></heading>
@ -156,7 +156,7 @@ The pattern is the year followed by the month.
# Date created: 5 December 1994 # Date created: 5 December 1994
# Whom: asami # Whom: asami
# #
# $Id: porting.sgml,v 1.17 1996-03-25 09:35:25 asami Exp $ # $Id: porting.sgml,v 1.18 1996-04-10 06:32:42 asami Exp $
# #
DISTNAME= oneko-1.1b DISTNAME= oneko-1.1b
@ -864,20 +864,39 @@ FETCH_DEPENDS= ncftp2:${PORTSDIR}/net/ncftp2
<sect3> <sect3>
<heading>PREFIX</heading> <heading>PREFIX</heading>
<p>Do try to make your port install relative to <p>Do try to make your port install relative to
<tt>&dollar;{PREFIX}</tt> in your Makefiles. This will <tt>&dollar;{PREFIX}</tt>. (The value of this variable will be
normally be set to <tt>/usr/local</tt>, or set to <tt>&dollar;{LOCALBASE}</tt> (default
<tt>/usr/X11R6</tt> if <tt>&dollar;{USE_IMAKE}</tt> or <tt>/usr/local</tt>), unless <tt>&dollar;{USE_IMAKE}</tt> or
<tt>&dollar;{USE_X11}</tt> is set, though it can be <tt>&dollar;{USE_X11}</tt> is set, in which case it will be
reassigned in your Makefile or in the users environment, if <tt>&dollar;{X11BASE}</tt> (default <tt>/usr/X11R6</tt>).)
need be.
<p>Not hard-coding <tt>/usr/local</tt> anywhere in your <p>Not hard-coding `<tt>/usr/local</tt>' or `<tt>/usr/X11R6</tt>'
installation will make the port much more flexible and cater anywhere in the source will make the port much more flexible and
to the needs of other sites. Note that this doesn't count able to cater to the needs of other sites. For X ports that use
for package `packing list' files since they have their own imake, this is automatic; otherwise, this can often be done by
scheme for relocating themselves and can be left independent simply replacing the occurrences of `<tt>/usr/local</tt>' (or
of <tt>&dollar;{PREFIX}</tt> unless the package is one that `<tt>/usr/X11R6</tt>' for X ports that don't use imake) in the
hard-codes itself to a compiled-in location. various scripts/Makefiles in the port to read
`<tt>&dollar;{PREFIX}</tt>', as this variable is automatically
passed down to every stage of the build and install processes.
<p>The variable <tt>&dollar;{PREFIX}</tt> can be reassigned in your
Makefile or in the user's environment. However, it is strongly
discouraged for individual ports to set this variable explicitly
in the Makefiles. (If your port is an X port but doesn't use
imake, set <tt>USE_X11=yes</tt>; this is quite different from
setting <tt>PREFIX=/usr/X11R6</tt>.)
<p>Also, refer to programs/files from other ports with the
variables mentioned above, not explicit pathnames. For instance,
if your port requires a macro <tt>PAGER</tt> to be the full
pathname of <tt>less</tt>, use the compiler flag:
`<tt>-DPAGER=\"&dollar;{PREFIX}/bin/less\"</tt>' (or
`<tt>-DPAGER=\"&dollar;{LOCALBASE}/bin/less\"</tt>' if this is an
X port), instead of `<tt>-DPAGER=\"/usr/local/bin/less\"</tt>'.
This way it will have a better chance of working if the system
administrator has moved the whole `/usr/local' tree somewhere
else.
<sect3> <sect3>
<heading>Subdirectories</heading> <heading>Subdirectories</heading>
@ -958,7 +977,7 @@ lib/libtcl.so.7.3
person who wrote this Makefile] person who wrote this Makefile]
# Whom: Satoshi Asami <asami@FreeBSD.ORG> # Whom: Satoshi Asami <asami@FreeBSD.ORG>
# #
# $Id: porting.sgml,v 1.17 1996-03-25 09:35:25 asami Exp $ # $Id: porting.sgml,v 1.18 1996-04-10 06:32:42 asami Exp $
[ ^^^^ don't worry about this...it will be automatically filled in by CVS when [ ^^^^ don't worry about this...it will be automatically filled in by CVS when
it is committed to our repository] it is committed to our repository]
# #