1 # $NetBSD: motif.buildlink3.mk,v 1.15 2012/01/12 15:51:14 hans 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
${X11_TYPE} == "native" && \
33 exists
(/usr
/dt
/include/Xm
/Xm.h
) && \
34 exists
(/usr
/dt
/include/Xm
/Gadget.h
)
36 .elif exists
(${X11BASE}/lib
/X11
/config
/OpenMotif.tmpl
) || \
37 exists
(${LOCALBASE}/lib
/X11
/config
/OpenMotif.tmpl
)
38 _MOTIF_TYPE
= openmotif
39 .elif exists
(${X11BASE}/lib
/X11
/config
/LessTif.tmpl
) || \
40 exists
(${LOCALBASE}/lib
/X11
/config
/LessTif.tmpl
)
42 .elif exists
(${X11BASE}/include/Xm.h
) && \
43 exists
(${X11BASE}/include/Xm
/Gadget.h
)
46 _MOTIF_TYPE
= ${MOTIF_TYPE_DEFAULT}
49 # If MOTIF_TYPE is set, then let that override the Motif-discovery just
50 # performed. We only recognize the tested strings as proper values for
53 .if defined
(MOTIF_TYPE
)
54 . if
(${MOTIF_TYPE} == "dt") || \
55 (${MOTIF_TYPE} == "lesstif") || \
56 (${MOTIF_TYPE} == "motif") || \
57 (${MOTIF_TYPE} == "openmotif")
58 _MOTIF_TYPE
= ${MOTIF_TYPE}
63 # If MOTIFBASE is set, then let that override all other Motif-2.0
64 # discovery just performed.
66 .if defined
(MOTIFBASE
)
68 _MOTIFBASE
= ${MOTIFBASE}
70 . if
${_MOTIF_TYPE} == "dt"
72 . elif
${_MOTIF_TYPE} == "none"
73 _MOTIFBASE
= ${X11BASE}
77 .if
${_MOTIF_TYPE} == "motif"
78 .
include "../../x11/motif/buildlink3.mk"
79 .elif
${_MOTIF_TYPE} == "openmotif"
80 .
include "../../x11/openmotif/buildlink3.mk"
81 .elif
${_MOTIF_TYPE} == "lesstif"
82 .
include "../../x11/lesstif/buildlink3.mk"
85 # Link the pre-existing Motif libraries and headers in ${_MOTIFBASE} into
88 BUILDLINK_PREFIX.motif
= ${_MOTIFBASE}
90 .
include "../../mk/x11.buildlink3.mk"
93 .if
!defined
(MOTIFBASE
)
94 MOTIF_TYPE
:= ${_MOTIF_TYPE}
95 MOTIFBASE
= ${_MOTIFBASE}
99 MAKE_ENV
+= MOTIFLIB
=${MOTIFLIB
:Q
}
100 MAKE_ENV
+= MOTIFBASE
=${_MOTIFBASE
:Q
}
101 CPPFLAGS
+= -I
${_MOTIFBASE}/include
102 LDFLAGS
+= -L
${_MOTIFBASE}/lib
103 LDFLAGS
+= ${COMPILER_RPATH_FLAG}${_MOTIFBASE}/lib
104 MOTIFLIB?
= ${COMPILER_RPATH_FLAG}${_MOTIFBASE}/lib \
105 -L
${_MOTIFBASE}/lib
-lXm
-lXp
107 .
endif # MOTIF_BUILDLINK3_MK