Add lang/perl5 early, but not specifically as part of BULK_PREREQ, so that
[pkgsrc.git] / mk / motif.buildlink3.mk
1 # $NetBSD: motif.buildlink3.mk,v 1.7 2005/05/22 21:44:07 rillig Exp $
2 #
3 # MOTIFBASE
4 #       choose the Motif-2.0 installation at the named location.
5 #
6 # MOTIF_TYPE
7 #       choose a specific Motif-2.0 package.
8
9 .if !defined(MOTIF_BUILDLINK3_MK)
10 MOTIF_BUILDLINK3_MK=    # defined
11
12 .include "../../mk/bsd.prefs.mk"
13
14 #
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}.
19 #
20 .if exists(/usr/dt/include/Xm/Xm.h) && \
21       exists(/usr/dt/include/Xm/Gadget.h)
22 _MOTIF_TYPE=            dt
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)
28 _MOTIF_TYPE=            lesstif
29 .elif exists(${X11BASE}/include/Xm.h) && \
30         exists(${X11BASE}/include/Xm/Gadget.h)
31 _MOTIF_TYPE=            none
32 .else
33 _MOTIF_TYPE=            ${MOTIF_TYPE_DEFAULT}
34 .endif
35
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
38 # MOTIF_TYPE.
39 #
40 .if defined(MOTIF_TYPE)
41 .  if (${MOTIF_TYPE} == "dt") || \
42         (${MOTIF_TYPE} == "lesstif") || \
43         (${MOTIF_TYPE} == "openmotif")
44 _MOTIF_TYPE=            ${MOTIF_TYPE}
45 .  endif
46 .endif
47
48 #
49 # If MOTIFBASE is set, then let that override all other Motif-2.0
50 # discovery just performed.
51 #
52 .if defined(MOTIFBASE)
53 _MOTIF_TYPE=            none
54 _MOTIFBASE=             ${MOTIFBASE}
55 .else
56 .  if ${_MOTIF_TYPE} == "dt"
57 _MOTIFBASE=             /usr/dt
58 .  elif ${_MOTIF_TYPE} == "none"
59 _MOTIFBASE=             ${X11BASE}
60 .  endif
61 .endif
62
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}
69 .else
70 #
71 # Link the pre-existing Motif libraries and headers in ${_MOTIFBASE} into
72 # ${BUILDLINK_DIR}.
73 #
74 BUILDLINK_PREFIX.motif= ${_MOTIFBASE}
75 .endif
76
77 .if !defined(MOTIFBASE)
78 MOTIF_TYPE:=            ${_MOTIF_TYPE}
79 MOTIFBASE=              ${_MOTIFBASE}
80 .endif
81
82 .include "../../mk/x11.buildlink3.mk"
83
84 MAKE_ENV+=              MOTIFLIB="${MOTIFLIB}"
85 MAKE_ENV+=              MOTIFBASE="${_MOTIFBASE}"
86 CPPFLAGS+=              -I${_MOTIFBASE}/include
87 LDFLAGS+=               -L${_MOTIFBASE}/lib
88 LDFLAGS+=               ${COMPILER_RPATH_FLAG}${_MOTIFBASE}/lib
89 MOTIFLIB?=              ${COMPILER_RPATH_FLAG}${_MOTIFBASE}/lib \
90                         -L${_MOTIFBASE}/lib -lXm -lXp
91
92 .endif  # MOTIF_BUILDLINK3_MK