Subject: xpkgwedge vs. USE_X11 vs. ?
To: None <tech-pkg@NetBSD.ORG>
From: Todd Vierling <>
List: tech-pkg
Date: 07/30/1998 09:44:39
Okay, on xpkgwedge.  I have the following changes waiting to go into tree,
and I'm looking for reasons not to commit them.

- New variable to /etc/mk.conf (precludes the existing X11BASE=${LOCALBASE}
  which is /very/ broken):  USE_LOCALBASE_FOR_X11.  When set, fixes PREFIX
  at the value of ${LOCALBASE} no matter whether or not
  USE_{IMAKE,MOTIF,X11} is set.

  (Requires moving the inclusion of earlier in so that
  /etc/mk.conf will be read in before PREFIX is set.)

- xpkgwedge's own pkg forces PREFIX to X11BASE to override this behavior.

- when USE_LOCALBASE_FOR_X11 is set, xpkgwedge becomes a build dependency
  of any pkg that makes use of USE_{IMAKE,MOTIF,X11}.

- the USE_MOTIF stuff will check X11BASE for Xm.h; if not there, a
  dependency on ${PREFIX}/include/Xm/Xm.h:../../devel/lesstif will be
  added (as opposed to ${X11BASE}/include/Xm/Xm.h).  That lets motif/lesstif
  be installed in either location.

Documentation changes:

- If a pkg is making use of X11 and needs to get to the X11 includes and
  libraries, it will use ${X11BASE} to get there.

- If a pkg needs to get to pkg-installed includes and libraries, including 
  Motif, it will use BOTH ${X11BASE} and ${LOCALBASE} to get there.

  (Note that ${PREFIX} is _not_ used at all, as it may not be Correct in
  two ambiguous cases--USE_{IMAKE,MOTIF,X11} pkg using regular pkg libs,
  and a regular pkg using USE_{IMAKE,MOTIF,X11} libs.)


Now, as to USE_X11, that variable needs to be split, as Tim Rightnour
mentioned a while back.  Many pkgs are happy building for LOCALBASE without
even xpkgwedge, and those currently do not use USE_X11.  However, a batch
build will fail on these pkgs on systems that don't have X installed.

Two different variables would help here - one that just says "uses X11" and
one that says "needs to be installed with X11 distribution directories," if
xpkgwedge were not in use.  The latter would probably be needed most for
pkgs which install includes and libraries.

USE_X11 for the former and USE_X11BASE for the latter?  (USE_X11 would not
set PREFIX to X11BASE, whereas USE_X11BASE would--if xpkgwedge were not in 

-- Todd Vierling (Personal; Bus.