| @@ -1,103 +1,105 @@ | | | @@ -1,103 +1,105 @@ |
1 | # $NetBSD: motif.buildlink3.mk,v 1.11 2006/11/06 11:29:38 joerg Exp $ | | 1 | # $NetBSD: motif.buildlink3.mk,v 1.12 2008/09/10 16:01:52 joerg Exp $ |
2 | # | | 2 | # |
3 | # Package-settable variables: | | 3 | # Package-settable variables: |
4 | # | | 4 | # |
5 | # MOTIFBASE | | 5 | # MOTIFBASE |
6 | # choose the Motif-2.0 installation at the named location. | | 6 | # choose the Motif-2.0 installation at the named location. |
7 | # | | 7 | # |
8 | # MOTIF_TYPE | | 8 | # MOTIF_TYPE |
9 | # choose a specific Motif-2.0 package. | | 9 | # choose a specific Motif-2.0 package. |
10 | # | | 10 | # |
11 | # Result variables: | | 11 | # Result variables: |
12 | # | | 12 | # |
13 | # MOTIFBASE | | 13 | # MOTIFBASE |
14 | # The chosen Motif installation. | | 14 | # The chosen Motif installation. |
15 | # | | 15 | # |
16 | # MOTIF_TYPE | | 16 | # MOTIF_TYPE |
17 | # The chosen Motif package. | | 17 | # The chosen Motif package. |
18 | | | 18 | |
19 | .if !defined(MOTIF_BUILDLINK3_MK) | | 19 | .if !defined(MOTIF_BUILDLINK3_MK) |
20 | MOTIF_BUILDLINK3_MK= # defined | | 20 | MOTIF_BUILDLINK3_MK= # defined |
21 | | | 21 | |
22 | .include "../../mk/bsd.prefs.mk" | | 22 | .include "../../mk/bsd.prefs.mk" |
23 | | | 23 | |
| | | 24 | BUILD_DEFS+= MOTIF_TYPE MOTIF_BASE |
| | | 25 | |
24 | # | | 26 | # |
25 | # If /usr/dt is a valid Motif-2.0 installation, then use it. Otherwise, | | 27 | # If /usr/dt is a valid Motif-2.0 installation, then use it. Otherwise, |
26 | # check to see if a pkgsrc Motif-2.0 is installed and valid, then use it. | | 28 | # check to see if a pkgsrc Motif-2.0 is installed and valid, then use it. |
27 | # Otherwise, if ${X11BASE} is valid, then use it. Otherwise, use the | | 29 | # Otherwise, if ${X11BASE} is valid, then use it. Otherwise, use the |
28 | # Motif-2.0 specified by ${MOTIF_TYPE_DEFAULT}. | | 30 | # Motif-2.0 specified by ${MOTIF_TYPE_DEFAULT}. |
29 | # | | 31 | # |
30 | .if exists(/usr/dt/include/Xm/Xm.h) && \ | | 32 | .if exists(/usr/dt/include/Xm/Xm.h) && \ |
31 | exists(/usr/dt/include/Xm/Gadget.h) | | 33 | exists(/usr/dt/include/Xm/Gadget.h) |
32 | _MOTIF_TYPE= dt | | 34 | _MOTIF_TYPE= dt |
33 | .elif exists(${X11BASE}/lib/X11/config/OpenMotif.tmpl) || \ | | 35 | .elif exists(${X11BASE}/lib/X11/config/OpenMotif.tmpl) || \ |
34 | exists(${LOCALBASE}/lib/X11/config/OpenMotif.tmpl) | | 36 | exists(${LOCALBASE}/lib/X11/config/OpenMotif.tmpl) |
35 | _MOTIF_TYPE= openmotif | | 37 | _MOTIF_TYPE= openmotif |
36 | .elif exists(${X11BASE}/lib/X11/config/LessTif.tmpl) || \ | | 38 | .elif exists(${X11BASE}/lib/X11/config/LessTif.tmpl) || \ |
37 | exists(${LOCALBASE}/lib/X11/config/LessTif.tmpl) | | 39 | exists(${LOCALBASE}/lib/X11/config/LessTif.tmpl) |
38 | _MOTIF_TYPE= lesstif | | 40 | _MOTIF_TYPE= lesstif |
39 | .elif exists(${X11BASE}/include/Xm.h) && \ | | 41 | .elif exists(${X11BASE}/include/Xm.h) && \ |
40 | exists(${X11BASE}/include/Xm/Gadget.h) | | 42 | exists(${X11BASE}/include/Xm/Gadget.h) |
41 | _MOTIF_TYPE= none | | 43 | _MOTIF_TYPE= none |
42 | .else | | 44 | .else |
43 | _MOTIF_TYPE= ${MOTIF_TYPE_DEFAULT} | | 45 | _MOTIF_TYPE= ${MOTIF_TYPE_DEFAULT} |
44 | .endif | | 46 | .endif |
45 | | | 47 | |
46 | # If MOTIF_TYPE is set, then let that override the Motif-discovery just | | 48 | # If MOTIF_TYPE is set, then let that override the Motif-discovery just |
47 | # performed. We only recognize the tested strings as proper values for | | 49 | # performed. We only recognize the tested strings as proper values for |
48 | # MOTIF_TYPE. | | 50 | # MOTIF_TYPE. |
49 | # | | 51 | # |
50 | .if defined(MOTIF_TYPE) | | 52 | .if defined(MOTIF_TYPE) |
51 | . if (${MOTIF_TYPE} == "dt") || \ | | 53 | . if (${MOTIF_TYPE} == "dt") || \ |
52 | (${MOTIF_TYPE} == "lesstif") || \ | | 54 | (${MOTIF_TYPE} == "lesstif") || \ |
53 | (${MOTIF_TYPE} == "openmotif") | | 55 | (${MOTIF_TYPE} == "openmotif") |
54 | _MOTIF_TYPE= ${MOTIF_TYPE} | | 56 | _MOTIF_TYPE= ${MOTIF_TYPE} |
55 | . endif | | 57 | . endif |
56 | .endif | | 58 | .endif |
57 | | | 59 | |
58 | # | | 60 | # |
59 | # If MOTIFBASE is set, then let that override all other Motif-2.0 | | 61 | # If MOTIFBASE is set, then let that override all other Motif-2.0 |
60 | # discovery just performed. | | 62 | # discovery just performed. |
61 | # | | 63 | # |
62 | .if defined(MOTIFBASE) | | 64 | .if defined(MOTIFBASE) |
63 | _MOTIF_TYPE= none | | 65 | _MOTIF_TYPE= none |
64 | _MOTIFBASE= ${MOTIFBASE} | | 66 | _MOTIFBASE= ${MOTIFBASE} |
65 | .else | | 67 | .else |
66 | . if ${_MOTIF_TYPE} == "dt" | | 68 | . if ${_MOTIF_TYPE} == "dt" |
67 | _MOTIFBASE= /usr/dt | | 69 | _MOTIFBASE= /usr/dt |
68 | . elif ${_MOTIF_TYPE} == "none" | | 70 | . elif ${_MOTIF_TYPE} == "none" |
69 | _MOTIFBASE= ${X11BASE} | | 71 | _MOTIFBASE= ${X11BASE} |
70 | . endif | | 72 | . endif |
71 | .endif | | 73 | .endif |
72 | | | 74 | |
73 | .if ${_MOTIF_TYPE} == "openmotif" | | 75 | .if ${_MOTIF_TYPE} == "openmotif" |
74 | . include "../../x11/openmotif/buildlink3.mk" | | 76 | . include "../../x11/openmotif/buildlink3.mk" |
75 | _MOTIFBASE= ${BUILDLINK_PREFIX.openmotif} | | 77 | _MOTIFBASE= ${BUILDLINK_PREFIX.openmotif} |
76 | .elif ${_MOTIF_TYPE} == "lesstif" | | 78 | .elif ${_MOTIF_TYPE} == "lesstif" |
77 | . include "../../x11/lesstif/buildlink3.mk" | | 79 | . include "../../x11/lesstif/buildlink3.mk" |
78 | _MOTIFBASE= ${BUILDLINK_PREFIX.lesstif} | | 80 | _MOTIFBASE= ${BUILDLINK_PREFIX.lesstif} |
79 | .else | | 81 | .else |
80 | # | | 82 | # |
81 | # Link the pre-existing Motif libraries and headers in ${_MOTIFBASE} into | | 83 | # Link the pre-existing Motif libraries and headers in ${_MOTIFBASE} into |
82 | # ${BUILDLINK_DIR}. | | 84 | # ${BUILDLINK_DIR}. |
83 | # | | 85 | # |
84 | BUILDLINK_PREFIX.motif= ${_MOTIFBASE} | | 86 | BUILDLINK_PREFIX.motif= ${_MOTIFBASE} |
85 | | | 87 | |
86 | .include "../../mk/x11.buildlink3.mk" | | 88 | .include "../../mk/x11.buildlink3.mk" |
87 | .endif | | 89 | .endif |
88 | | | 90 | |
89 | .if !defined(MOTIFBASE) | | 91 | .if !defined(MOTIFBASE) |
90 | MOTIF_TYPE:= ${_MOTIF_TYPE} | | 92 | MOTIF_TYPE:= ${_MOTIF_TYPE} |
91 | MOTIFBASE= ${_MOTIFBASE} | | 93 | MOTIFBASE= ${_MOTIFBASE} |
92 | .endif | | 94 | .endif |
93 | | | 95 | |
94 | | | 96 | |
95 | MAKE_ENV+= MOTIFLIB=${MOTIFLIB:Q} | | 97 | MAKE_ENV+= MOTIFLIB=${MOTIFLIB:Q} |
96 | MAKE_ENV+= MOTIFBASE=${_MOTIFBASE:Q} | | 98 | MAKE_ENV+= MOTIFBASE=${_MOTIFBASE:Q} |
97 | CPPFLAGS+= -I${_MOTIFBASE}/include | | 99 | CPPFLAGS+= -I${_MOTIFBASE}/include |
98 | LDFLAGS+= -L${_MOTIFBASE}/lib | | 100 | LDFLAGS+= -L${_MOTIFBASE}/lib |
99 | LDFLAGS+= ${COMPILER_RPATH_FLAG}${_MOTIFBASE}/lib | | 101 | LDFLAGS+= ${COMPILER_RPATH_FLAG}${_MOTIFBASE}/lib |
100 | MOTIFLIB?= ${COMPILER_RPATH_FLAG}${_MOTIFBASE}/lib \ | | 102 | MOTIFLIB?= ${COMPILER_RPATH_FLAG}${_MOTIFBASE}/lib \ |
101 | -L${_MOTIFBASE}/lib -lXm -lXp | | 103 | -L${_MOTIFBASE}/lib -lXm -lXp |
102 | | | 104 | |
103 | .endif # MOTIF_BUILDLINK3_MK | | 105 | .endif # MOTIF_BUILDLINK3_MK |