Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / mk / motif.buildlink3.mk
blob4311e8f5e5affcdb3dfa82e8a7dc6a29f4e951ce
1 # $NetBSD: motif.buildlink3.mk,v 1.15 2012/01/12 15:51:14 hans Exp $
3 # Package-settable variables:
5 # MOTIFBASE
6 # choose the Motif-2.0 installation at the named location.
8 # MOTIF_TYPE
9 # choose a specific Motif-2.0 package.
11 # Result variables:
13 # MOTIFBASE
14 # The chosen Motif installation.
16 # MOTIF_TYPE
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)
35 _MOTIF_TYPE= dt
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)
41 _MOTIF_TYPE= lesstif
42 .elif exists(${X11BASE}/include/Xm.h) && \
43 exists(${X11BASE}/include/Xm/Gadget.h)
44 _MOTIF_TYPE= none
45 .else
46 _MOTIF_TYPE= ${MOTIF_TYPE_DEFAULT}
47 .endif
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
51 # MOTIF_TYPE.
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}
59 . endif
60 .endif
63 # If MOTIFBASE is set, then let that override all other Motif-2.0
64 # discovery just performed.
66 .if defined(MOTIFBASE)
67 _MOTIF_TYPE= none
68 _MOTIFBASE= ${MOTIFBASE}
69 .else
70 . if ${_MOTIF_TYPE} == "dt"
71 _MOTIFBASE= /usr/dt
72 . elif ${_MOTIF_TYPE} == "none"
73 _MOTIFBASE= ${X11BASE}
74 . endif
75 .endif
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"
83 .else
85 # Link the pre-existing Motif libraries and headers in ${_MOTIFBASE} into
86 # ${BUILDLINK_DIR}.
88 BUILDLINK_PREFIX.motif= ${_MOTIFBASE}
90 .include "../../mk/x11.buildlink3.mk"
91 .endif
93 .if !defined(MOTIFBASE)
94 MOTIF_TYPE:= ${_MOTIF_TYPE}
95 MOTIFBASE= ${_MOTIFBASE}
96 .endif
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