Subject: bsd.pkg.mk and Motif
To: None <tech-pkg@netbsd.org>
From: Johnny C. Lam <lamj@stat.cmu.edu>
List: tech-pkg
Date: 07/27/2000 05:33:07
I think after the X11PREFIX went in to allow xpkgwedge to work
correctly, the Motif checking code broke.  This is by inspection only,
but it seems that if xpkgwedge is installed, then bsd.pkg.mk only
checks for Motif on NetBSD in ${LOCALBASE}.  The following fixes this,
I think.  I also added some new code that allows packages to define
USE_MOTIF12 for Motif-1.2 libs/headers, as opposed to any Motif
libs/headers it can find.

Any objections to committing this?

	Thanks,

     -- Johnny C. Lam <lamj@stat.cmu.edu>
        Department of Statistics, Carnegie Mellon University
        http://www.stat.cmu.edu/~lamj/

--- bsd.pkg.mk.orig	Wed Jul 26 04:20:00 2000
+++ bsd.pkg.mk	Thu Jul 27 05:18:15 2000
@@ -91,15 +91,29 @@
 X11PREFIX=		${X11BASE}
 .endif
 
+.if defined(USE_MOTIF12)
+USE_MOTIF=		# defined
+.endif
+
 .if defined(USE_MOTIF)
-.if ${X11PREFIX} == ${LOCALBASE}
-MOTIFBASE?=		${LOCALBASE}
-.elif ${OPSYS} == "SunOS"
+.if ${OPSYS} == "SunOS"
 MOTIFBASE?=		/usr/dt
+.elif exists(${X11BASE}/include/Xm/Xm.h)
+MOTIFBASE?=		${X11BASE}
+.elif ${X11PREFIX} == ${LOCALBASE}
+.if defined(USE_MOTIF12)
+MOTIFBASE?=		${LOCALBASE}/LessTif/Motif1.2
+.else
+MOTIFBASE?=		${LOCALBASE}
+.endif
+.else
+.if defined(USE_MOTIF12)
+MOTIFBASE?=		${X11BASE}/LessTif/Motif1.2
 .else
 MOTIFBASE?=		${X11BASE}
 .endif
-.endif # USE_MOTIF
+.endif
+.endif  # USE_MOTIF
 
 .if defined(USE_IMAKE) || defined(USE_MOTIF) || defined(USE_X11BASE)
 .if ${X11PREFIX} == ${LOCALBASE}
@@ -697,13 +711,18 @@
 
 # Check if we got a real Motif, Lesstif or no Motif at all.
 .if defined(USE_MOTIF)
+.if defined(USE_MOTIF12)
+LESSTIF_DEPENDS=	lesstif12-*:../../x11/lesstif
+.else
+LESSTIF_DEPENDS=	lesstif-*:../../x11/lesstif
+.endif
 .if exists(${MOTIFBASE}/include/Xm/Xm.h)
 IS_LESSTIF!=	${EGREP} -c LESSTIF ${MOTIFBASE}/include/Xm/Xm.h || ${TRUE}
 .if (${IS_LESSTIF} != "0")
-DEPENDS+=	lesstif-*:../../x11/lesstif
+DEPENDS+=		${LESSTIF_DEPENDS}
 .endif
 .else
-DEPENDS+=	lesstif-*:../../x11/lesstif
+DEPENDS+=		${LESSTIF_DEPENDS}
 .endif
 .endif