1 # $NetBSD: motif.buildlink3.mk,v 1.12 2008/09/10 16:01:52 joerg Exp $
3 # Package-settable variables:
6 # choose the Motif-2.0 installation at the named location.
9 # choose a specific Motif-2.0 package.
14 # The chosen Motif installation.
17 # The chosen Motif package.
19 .if !defined(MOTIF_BUILDLINK3_MK)
20 MOTIF_BUILDLINK3_MK= # defined
22 .include "../../mk/bsd.prefs.mk"
24 BUILD_DEFS+= MOTIF_TYPE MOTIFBASE
27 # If /usr/dt is a valid Motif-2.0 installation, then use it. Otherwise,
28 # check to see if a pkgsrc Motif-2.0 is installed and valid, then use it.
29 # Otherwise, if ${X11BASE} is valid, then use it. Otherwise, use the
30 # Motif-2.0 specified by ${MOTIF_TYPE_DEFAULT}.
32 .if exists(/usr/dt/include/Xm/Xm.h) && \
33 exists(/usr/dt/include/Xm/Gadget.h)
35 .elif exists(${X11BASE}/lib/X11/config/OpenMotif.tmpl) || \
36 exists(${LOCALBASE}/lib/X11/config/OpenMotif.tmpl)
37 _MOTIF_TYPE= openmotif
38 .elif exists(${X11BASE}/lib/X11/config/LessTif.tmpl) || \
39 exists(${LOCALBASE}/lib/X11/config/LessTif.tmpl)
41 .elif exists(${X11BASE}/include/Xm.h) && \
42 exists(${X11BASE}/include/Xm/Gadget.h)
45 _MOTIF_TYPE= ${MOTIF_TYPE_DEFAULT}
48 # If MOTIF_TYPE is set, then let that override the Motif-discovery just
49 # performed. We only recognize the tested strings as proper values for
52 .if defined(MOTIF_TYPE)
53 . if (${MOTIF_TYPE} == "dt") || \
54 (${MOTIF_TYPE} == "lesstif") || \
55 (${MOTIF_TYPE} == "openmotif")
56 _MOTIF_TYPE= ${MOTIF_TYPE}
61 # If MOTIFBASE is set, then let that override all other Motif-2.0
62 # discovery just performed.
64 .if defined(MOTIFBASE)
66 _MOTIFBASE= ${MOTIFBASE}
68 . if ${_MOTIF_TYPE} == "dt"
70 . elif ${_MOTIF_TYPE} == "none"
71 _MOTIFBASE= ${X11BASE}
75 .if ${_MOTIF_TYPE} == "openmotif"
76 . include "../../x11/openmotif/buildlink3.mk"
77 _MOTIFBASE= ${BUILDLINK_PREFIX.openmotif}
78 .elif ${_MOTIF_TYPE} == "lesstif"
79 . include "../../x11/lesstif/buildlink3.mk"
80 _MOTIFBASE= ${BUILDLINK_PREFIX.lesstif}
83 # Link the pre-existing Motif libraries and headers in ${_MOTIFBASE} into
86 BUILDLINK_PREFIX.motif= ${_MOTIFBASE}
88 .include "../../mk/x11.buildlink3.mk"
91 .if !defined(MOTIFBASE)
92 MOTIF_TYPE:= ${_MOTIF_TYPE}
93 MOTIFBASE= ${_MOTIFBASE}
97 MAKE_ENV+= MOTIFLIB=${MOTIFLIB:Q}
98 MAKE_ENV+= MOTIFBASE=${_MOTIFBASE:Q}
99 CPPFLAGS+= -I${_MOTIFBASE}/include
100 LDFLAGS+= -L${_MOTIFBASE}/lib
101 LDFLAGS+= ${COMPILER_RPATH_FLAG}${_MOTIFBASE}/lib
102 MOTIFLIB?= ${COMPILER_RPATH_FLAG}${_MOTIFBASE}/lib \
103 -L${_MOTIFBASE}/lib -lXm -lXp
105 .endif # MOTIF_BUILDLINK3_MK