1 # $NetBSD: motif.buildlink3.mk,v 1.5 2004/08/27 06:29:09 jlam Exp $
4 # choose the Motif-2.0 installation at the named location.
7 # choose a specific Motif-2.0 package.
9 .if !defined(MOTIF_BUILDLINK3_MK)
10 MOTIF_BUILDLINK3_MK= # defined
12 .include "../../mk/bsd.prefs.mk"
15 # If /usr/dt is a valid Motif-2.0 installation, then use it. Otherwise,
16 # check to see if a pkgsrc Motif-2.0 is installed and valid, then use it.
17 # Otherwise, if ${X11BASE} is valid, then use it. Otherwise, use the
18 # Motif-2.0 specified by ${MOTIF_TYPE_DEFAULT}.
20 .if exists(/usr/dt/include/Xm/Xm.h) && \
21 exists(/usr/dt/include/Xm/Gadget.h)
23 .elif exists(${X11BASE}/lib/X11/config/OpenMotif.tmpl) || \
24 exists(${LOCALBASE}/lib/X11/config/OpenMotif.tmpl)
25 _MOTIF_TYPE= openmotif
26 .elif exists(${X11BASE}/lib/X11/config/LessTif.tmpl) || \
27 exists(${LOCALBASE}/lib/X11/config/LessTif.tmpl)
29 .elif exists(${X11BASE}/include/Xm.h) && \
30 exists(${X11BASE}/include/Xm/Gadget.h)
33 _MOTIF_TYPE= ${MOTIF_TYPE_DEFAULT}
36 # If MOTIF_TYPE is set, then let that override the Motif-discovery just
37 # performed. We only recognize the tested strings as proper values for
40 .if defined(MOTIF_TYPE)
41 . if (${MOTIF_TYPE} == "dt") || \
42 (${MOTIF_TYPE} == "lesstif") || \
43 (${MOTIF_TYPE} == "openmotif")
44 _MOTIF_TYPE= ${MOTIF_TYPE}
49 # If MOTIFBASE is set, then let that override all other Motif-2.0
50 # discovery just performed.
52 .if defined(MOTIFBASE)
54 _MOTIFBASE= ${MOTIFBASE}
56 . if ${_MOTIF_TYPE} == "dt"
58 . elif ${_MOTIF_TYPE} == "none"
59 _MOTIFBASE= ${X11BASE}
63 .if ${_MOTIF_TYPE} == "openmotif"
64 . include "../../x11/openmotif/buildlink3.mk"
65 _MOTIFBASE= ${BUILDLINK_PREFIX.openmotif}
66 .elif ${_MOTIF_TYPE} == "lesstif"
67 . include "../../x11/lesstif/buildlink3.mk"
68 _MOTIFBASE= ${BUILDLINK_PREFIX.lesstif}
71 # Link the pre-existing Motif libraries and headers in ${_MOTIFBASE} into
74 BUILDLINK_PREFIX.motif= ${_MOTIFBASE}
77 .if !defined(MOTIFBASE)
78 MOTIF_TYPE:= ${_MOTIF_TYPE}
79 MOTIFBASE= ${_MOTIFBASE}
83 MAKE_ENV+= MOTIFLIB="${MOTIFLIB}"
84 MAKE_ENV+= MOTIFBASE="${_MOTIFBASE}"
85 CPPFLAGS+= -I${_MOTIFBASE}/include
86 LDFLAGS+= -L${_MOTIFBASE}/lib
87 LDFLAGS+= ${COMPILER_RPATH_FLAG}${_MOTIFBASE}/lib
88 MOTIFLIB?= ${COMPILER_RPATH_FLAG}${_MOTIFBASE}/lib \
89 -L${_MOTIFBASE}/lib -lXm -lXp
91 .endif # MOTIF_BUILDLINK3_MK