summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/motif.buildlink.mk132
-rw-r--r--x11/lesstif12/buildlink.mk44
2 files changed, 105 insertions, 71 deletions
diff --git a/mk/motif.buildlink.mk b/mk/motif.buildlink.mk
index e706dff210f..41764a6fbf6 100644
--- a/mk/motif.buildlink.mk
+++ b/mk/motif.buildlink.mk
@@ -1,12 +1,16 @@
-# $NetBSD: motif.buildlink.mk,v 1.6 2001/09/13 19:32:11 jlam Exp $
+# $NetBSD: motif.buildlink.mk,v 1.7 2001/09/13 22:06:33 jlam Exp $
#
-# This Makefile fragment is included by packages that use Motif-2.0.
+# This Makefile fragment is included by packages that use Motif.
#
# To use this Makefile fragment, simply:
#
-# (1) Optionally set MOTIF_TYPE choose a specific Motif-2.0-compatible
-# package to be used.
-# (2) Include this Makefile fragment in the package Makefile,
+# (1) Optionally set USE_MOTIF12 to use a Motif-1.2-compatible installation.
+# Otherwise, assume we want a Motif-2.0-compatible installation.
+# (2) Optionally set MOTIFBASE or MOTIF12BASE to choose the Motif-2.0 or
+# Motif-1.2-compatible installation at the named location,
+# (3) Or optionally set MOTIF_TYPE or MOTIF12_TYPE to choose a specific
+# Motif-2.0 or Motif-1.2-compatible package to be used,
+# (4) And include this Makefile fragment in the package Makefile.
.if !defined(MOTIF_BUILDLINK_MK)
MOTIF_BUILDLINK_MK= # defined
@@ -23,63 +27,123 @@ MOTIF_TYPE_DEFAULT?= dt
MOTIF_TYPE_DEFAULT?= openmotif
.endif
+# Default to using LessTif for Motif-1.2-compatible libraries. On Solaris,
+# default to DT-Motif (in /usr/dt).
+#
+.if ${OPSYS} == "SunOS"
+MOTIF12_TYPE_DEFAULT?= dt
+.else
+MOTIF12_TYPE_DEFAULT?= lesstif12
+.endif
+
+.if defined(USE_MOTIF12)
+#
+# If /usr/dt is a valid Motif-1.2 installation, then use it. Otherwise,
+# if ${X11BASE} is valid, then use it. Otherwise, use the Motif-1.2
+# specified by ${MOTIF12_TYPE_DEFAULT}.
+#
+. if exists(/usr/dt/include/Xm/Xm.h) && \
+ !exists(/usr/dt/include/Xm/Gadget.h)
+_MOTIF_TYPE= dt
+. elif exists(${X11BASE}/include/Xm/Xm.h) && \
+ !exists(${X11BASE}/include/Xm/Gadget.h)
+_MOTIF_TYPE= none
+. else
+_MOTIF_TYPE= ${MOTIF12_TYPE_DEFAULT}
+. endif
+.else
+#
# If /usr/dt is a valid Motif-2.0 installation, then use it. Otherwise,
# check to see if a pkgsrc Motif-2.0 is installed and valid, then use it.
# Otherwise, if ${X11BASE} is valid, then use it. Otherwise, use the
# Motif-2.0 specified by ${MOTIF_TYPE_DEFAULT}.
#
-.if exists(/usr/dt/include/Xm/Xm.h) && exists(/usr/dt/include/Xm/Gadget.h)
+. if exists(/usr/dt/include/Xm/Xm.h) && \
+ exists(/usr/dt/include/Xm/Gadget.h)
_MOTIF_TYPE= dt
-.elif exists(${X11BASE}/lib/X11/config/OpenMotif.tmpl) || \
- exists(${LOCALBASE}/lib/X11/config/OpenMotif.tmpl)
+. elif exists(${X11BASE}/lib/X11/config/OpenMotif.tmpl) || \
+ exists(${LOCALBASE}/lib/X11/config/OpenMotif.tmpl)
_MOTIF_TYPE= openmotif
-.elif exists(${X11BASE}/lib/X11/config/LessTif.tmpl) || \
- exists(${LOCALBASE}/lib/X11/config/LessTif.tmpl)
+. elif exists(${X11BASE}/lib/X11/config/LessTif.tmpl) || \
+ exists(${LOCALBASE}/lib/X11/config/LessTif.tmpl)
_MOTIF_TYPE= lesstif
-.elif exists(${X11BASE}/include/Xm.h) && exists(${X11BASE}/include/Xm/Gadget.h)
+. elif exists(${X11BASE}/include/Xm.h) && \
+ exists(${X11BASE}/include/Xm/Gadget.h)
_MOTIF_TYPE= none
-.else
+. else
_MOTIF_TYPE= ${MOTIF_TYPE_DEFAULT}
+. endif
.endif
# If MOTIF_TYPE is set, then let that override the Motif-discovery just
# performed. We only recognize the tested strings as proper values for
# MOTIF_TYPE.
#
-.if defined(MOTIF_TYPE)
-. if (${MOTIF_TYPE} == "openmotif") || \
- (${MOTIF_TYPE} == "lesstif") || \
- (${MOTIF_TYPE} == "dt")
+.if defined(USE_MOTIF12)
+. if defined(MOTIF12_TYPE)
+. if (${MOTIF12_TYPE} == "dt") || \
+ (${MOTIF12_TYPE} == "lesstif12")
+_MOTIF_TYPE= ${MOTIF12_TYPE}
+. endif
+. endif
+.else
+. if defined(MOTIF_TYPE)
+. if (${MOTIF_TYPE} == "dt") || \
+ (${MOTIF_TYPE} == "lesstif") || \
+ (${MOTIF_TYPE} == "openmotif")
_MOTIF_TYPE= ${MOTIF_TYPE}
+. endif
. endif
.endif
-# If MOTIFBASE is set, then let that override all other Motif-discovery
-# just performed.
+.if defined(USE_MOTIF12)
+#
+# If MOTIF12BASE is set, then let that override all other Motif-1.2
+# discovery just performed.
#
-.if defined(MOTIFBASE)
+. if defined(MOTIF12BASE)
_MOTIF_TYPE= none
+_MOTIFBASE= ${MOTIF12BASE}
+. else
+. if ${_MOTIF_TYPE} == "dt"
+_MOTIFBASE= /usr/dt
+. elif ${_MOTIF_TYPE} == "none"
+_MOTIFBASE= ${X11BASE}
+. endif
+. endif
.else
-. if ${_MOTIF_TYPE} == "dt"
-MOTIFBASE= /usr/dt
-. elif ${_MOTIF_TYPE} == "none"
-MOTIFBASE= ${X11BASE}
+#
+# If MOTIFBASE is set, then let that override all other Motif-2.0
+# discovery just performed.
+#
+. if defined(MOTIFBASE)
+_MOTIF_TYPE= none
+_MOTIFBASE= ${MOTIFBASE}
+. else
+. if ${_MOTIF_TYPE} == "dt"
+_MOTIFBASE= /usr/dt
+. elif ${_MOTIF_TYPE} == "none"
+_MOTIFBASE= ${X11BASE}
+. endif
. endif
.endif
.if ${_MOTIF_TYPE} == "openmotif"
. include "../../x11/openmotif/buildlink.mk"
-MOTIFBASE= ${BUILDLINK_PREFIX.openmotif}
+_MOTIFBASE= ${BUILDLINK_PREFIX.openmotif}
.elif ${_MOTIF_TYPE} == "lesstif"
. include "../../x11/lesstif/buildlink.mk"
-MOTIFBASE= ${BUILDLINK_PREFIX.lesstif}
+_MOTIFBASE= ${BUILDLINK_PREFIX.lesstif}
+.elif ${_MOTIF_TYPE} == "lesstif12"
+. include "../../x11/lesstif12/buildlink.mk"
+_MOTIFBASE= ${BUILDLINK_PREFIX.lesstif12}
.else
#
-# Link the pre-existing Motif-2.0 libraries and headers in ${MOTIFBASE} into
+# Link the pre-existing Motif libraries and headers in ${_MOTIFBASE} into
# ${BUILDLINK_DIR}.
#
. include "../../mk/bsd.buildlink.mk"
-BUILDLINK_PREFIX.motif= ${MOTIFBASE}
+BUILDLINK_PREFIX.motif= ${_MOTIFBASE}
BUILDLINK_FILES.motif= include/Mrm/*
BUILDLINK_FILES.motif+= include/Xm/*
BUILDLINK_FILES.motif+= include/uil/*
@@ -94,9 +158,19 @@ pre-configure: ${BUILDLINK_TARGETS.motif}
motif-buildlink: _BUILDLINK_USE
.endif
+.if defined(USE_MOTIF12)
+. if !defined(MOTIF12BASE)
+MOTIF12BASE= ${_MOTIFBASE}
+. endif
+.else
+. if !defined(MOTIFBASE)
+MOTIFBASE= ${_MOTIFBASE}
+. endif
+.endif
+
USE_X11= # defined
MAKE_ENV+= MOTIFLIB="${MOTIFLIB}"
-LDFLAGS+= -Wl,-R${MOTIFBASE}/lib
-MOTIFLIB?= -Wl,-R${MOTIFBASE}/lib -Wl,-R${X11BASE}/lib -L${BUILDLINK_DIR}/lib -lXm -lXp
+LDFLAGS+= -Wl,-R${_MOTIFBASE}/lib
+MOTIFLIB?= -Wl,-R${_MOTIFBASE}/lib -Wl,-R${X11BASE}/lib -L${BUILDLINK_DIR}/lib -lXm -lXp
.endif # MOTIF_BUILDLINK_MK
diff --git a/x11/lesstif12/buildlink.mk b/x11/lesstif12/buildlink.mk
index 91ac26ebb48..689d69aff38 100644
--- a/x11/lesstif12/buildlink.mk
+++ b/x11/lesstif12/buildlink.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink.mk,v 1.7 2001/08/06 10:53:48 tron Exp $
+# $NetBSD: buildlink.mk,v 1.8 2001/09/13 22:06:34 jlam Exp $
#
# This Makefile fragment is included by packages that use lesstif12.
#
@@ -18,45 +18,10 @@ LESSTIF12_BUILDLINK_MK= # defined
.include "../../mk/bsd.buildlink.mk"
BUILDLINK_DEPENDS.lesstif12?= lesstif12>=0.91.4
-
-.include "../../mk/bsd.prefs.mk"
-
-# On Solaris, assume that /usr/dt contains a valid Motif 1.2-compatible
-# installation. Otherwise, check to see if <Xm/Gadget.h> is installed.
-# If it is, then this is a Motif 2.0-compatible installation, so we need
-# lesstif12.
-#
-.if ${OPSYS} == "SunOS"
-_NEED_LESSTIF12= NO
-.else
-.if exists(${X11BASE}/include/Xm/Xm.h)
-.if exists(${X11BASE}/include/Xm/Gadget.h)
-_NEED_LESSTIF12= YES
-.else
-_IS_LESSTIF!= ${EGREP} -c LESSTIF ${X11BASE}/include/Xm/Xm.h || ${TRUE}
-.if ${_IS_LESSTIF} == "0"
-_NEED_LESSTIF12= NO
-.else
-_NEED_LESSTIF12= YES
-.endif
-.endif
-.else
-_NEED_LESSTIF12= YES
-.endif
-.endif
-
-.if ${_NEED_LESSTIF12} == "YES"
-MOTIFBASE?= ${X11PREFIX}/LessTif/Motif1.2
DEPENDS+= ${BUILDLINK_DEPENDS.lesstif12}:../../x11/lesstif12
-.else
-.if ${OPSYS} == "SunOS"
-MOTIFBASE?= /usr/dt
-.else
-MOTIFBASE?= ${X11BASE}
-.endif
-.endif
EVAL_PREFIX+= LESSTIF12_PREFIX=lesstif12
+LESSTIF12_PREFIX_DEFAULT= ${X11PREFIX}
BUILDLINK_PREFIX.lesstif12= ${LESSTIF12_PREFIX}/LessTif/Motif1.2
BUILDLINK_FILES.lesstif12= include/Mrm/*
BUILDLINK_FILES.lesstif12+= include/Xm/*
@@ -68,11 +33,6 @@ BUILDLINK_FILES.lesstif12+= lib/libXm.*
BUILDLINK_TARGETS.lesstif12= lesstif12-buildlink
BUILDLINK_TARGETS+= ${BUILDLINK_TARGETS.lesstif12}
-USE_X11= # defined
-MAKE_ENV+= MOTIFLIB="${MOTIFLIB}"
-LDFLAGS+= -Wl,-R${MOTIFBASE}/lib
-MOTIFLIB?= -Wl,-R${MOTIFBASE}/lib -Wl,-R${X11BASE}/lib -L${BUILDLINK_DIR}/lib -L${X11BASE}/lib -lXm -lXp
-
pre-configure: ${BUILDLINK_TARGETS.lesstif12}
lesstif12-buildlink: _BUILDLINK_USE