Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / mk / bsd.pkg.use.mk
blob2716b8b604add1b210342041ac87f374d7d39246
1 # $NetBSD: bsd.pkg.use.mk,v 1.53 2013/05/09 23:37:25 riastradh Exp $
3 # Turn USE_* macros into proper depedency logic. Included near the top of
4 # bsd.pkg.mk, after bsd.prefs.mk.
6 # Package-settable variables:
8 # USE_BSD_MAKEFILE
9 # Should be set to "yes" whenever a package uses a BSD-style
10 # Makefile. These Makefiles typically end with a line including
11 # <bsd.prog.mk>.
13 # USE_IMAKE
14 # When set to "yes", means that the package uses imake as the
15 # primary (and often only) build system. This is different from
16 # USE_TOOLS+=imake, which only states that the package uses imake
17 # among other tools.
19 # Keywords: imake
22 .if defined(USE_BSD_MAKEFILE)
23 MAKE_ENV+= ${BSD_MAKE_ENV} INSTALL=${TOOLS_INSTALL:Q}
24 .endif
26 .if defined(USE_IMAKE) || !empty(USE_TOOLS:Mimake)
27 PLIST_SUBST+= IMAKE_MAN_SOURCE_PATH=${IMAKE_MAN_SOURCE_PATH:Q}
28 PLIST_SUBST+= IMAKE_MAN_DIR=${IMAKE_MAN_DIR:Q}
29 PLIST_SUBST+= IMAKE_LIBMAN_DIR=${IMAKE_LIBMAN_DIR:Q}
30 PLIST_SUBST+= IMAKE_KERNMAN_DIR=${IMAKE_KERNMAN_DIR:Q}
31 PLIST_SUBST+= IMAKE_FILEMAN_DIR=${IMAKE_FILEMAN_DIR:Q}
32 PLIST_SUBST+= IMAKE_GAMEMAN_DIR=${IMAKE_GAMEMAN_DIR:Q}
33 PLIST_SUBST+= IMAKE_MISCMAN_DIR=${IMAKE_MISCMAN_DIR:Q}
34 PLIST_SUBST+= IMAKE_MAN_SUFFIX=${IMAKE_MAN_SUFFIX:Q}
35 PLIST_SUBST+= IMAKE_LIBMAN_SUFFIX=${IMAKE_LIBMAN_SUFFIX:Q}
36 PLIST_SUBST+= IMAKE_KERNMAN_SUFFIX=${IMAKE_KERNMAN_SUFFIX:Q}
37 PLIST_SUBST+= IMAKE_FILEMAN_SUFFIX=${IMAKE_FILEMAN_SUFFIX:Q}
38 PLIST_SUBST+= IMAKE_GAMEMAN_SUFFIX=${IMAKE_GAMEMAN_SUFFIX:Q}
39 PLIST_SUBST+= IMAKE_MISCMAN_SUFFIX=${IMAKE_MISCMAN_SUFFIX:Q}
40 PLIST_SUBST+= IMAKE_MANNEWSUFFIX=${IMAKE_MANNEWSUFFIX:Q}
41 .endif
43 .if defined(USE_IMAKE) && empty(USE_TOOLS:Mitools)
44 USE_X11BASE?= implied
45 .endif
47 .if defined(USE_IMAKE)
48 MAKE_FLAGS+= CC=${CC:Q} CXX=${CXX:Q}
49 .endif
51 .if defined(USE_X11BASE) && ${X11_TYPE} != "modular"
52 . include "x11.buildlink3.mk"
53 .endif
55 .if ${PKG_INSTALLATION_TYPE} == "pkgviews"
56 PREFIX= ${DEPOTBASE}/${PKGNAME}
57 .elif ${PKG_INSTALLATION_TYPE} == "overwrite"
58 . if defined(INSTALLATION_PREFIX)
59 PREFIX= ${INSTALLATION_PREFIX}
60 . elif defined(USE_X11BASE)
61 PREFIX= ${X11PREFIX}
62 . elif defined(USE_CROSSBASE)
63 PREFIX= ${CROSSBASE}
64 . else
65 PREFIX= ${LOCALBASE}
66 . endif
67 .endif
69 .if (${PKG_INSTALLATION_TYPE} == "pkgviews") && defined(INSTALLATION_PREFIX)
70 PKG_FAIL_REASON= "INSTALLATION_PREFIX can't be used in a pkgviews package"
71 .endif
73 ############################################################################
74 # General settings
75 ############################################################################
77 ### PKG_USE_KERBEROS
79 .if defined(PKG_USE_KERBEROS)
80 CRYPTO?= uses Kerberos encryption code
81 BUILD_DEFS+= KERBEROS
82 .endif
84 ### USE_LIBTOOL, PKG_[SH]LIBTOOL
87 # PKG_LIBTOOL is the path to the libtool script installed by libtool-base.
88 # _LIBTOOL is the path the libtool used by the build, which could be the
89 # path to a libtool wrapper script.
90 # LIBTOOL is the publicly-readable variable that should be used by
91 # Makefiles to invoke the proper libtool.
93 .if defined(USE_LANGUAGES) && !empty(USE_LANGUAGES:Mfortran) || \
94 defined(USE_LANGUAGES) && !empty(USE_LANGUAGES:Mfortran77)
95 . if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) # XXX
96 PKG_FAIL_REASON+= "Cross-compiling Fortran with libtool NYI."
97 . endif
99 PKG_LIBTOOL?= ${LOCALBASE}/bin/libtool-fortran
100 PKG_SHLIBTOOL?= ${LOCALBASE}/bin/shlibtool-fortran
102 . if defined(USE_LIBTOOL)
103 BUILD_DEPENDS+= libtool-fortran>=${_OPSYS_LIBTOOL_REQD:U${LIBTOOL_REQD}}:../../devel/libtool-fortran
104 . endif
105 .else
106 . if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
107 PKG_LIBTOOL?= ${CROSSBASE}/bin/libtool
108 PKG_SHLIBTOOL?= ${CROSSBASE}/bin/shlibtool
109 . else
110 PKG_LIBTOOL?= ${LOCALBASE}/bin/libtool
111 PKG_SHLIBTOOL?= ${LOCALBASE}/bin/shlibtool
112 . endif
113 .endif
114 _LIBTOOL?= ${PKG_LIBTOOL}
115 _SHLIBTOOL?= ${PKG_SHLIBTOOL}
116 LIBTOOL?= ${PKG_LIBTOOL}
117 SHLIBTOOL?= ${PKG_SHLIBTOOL}
118 .if defined(USE_LIBTOOL)
119 LIBTOOL_REQD?= 2.2.6bnb3
120 .if !empty(USE_CROSS_COMPILE:M[yY][eE][sS])
121 TOOL_DEPENDS+= cross-libtool-base-${MACHINE_ARCH}>=${_OPSYS_LIBTOOL_REQD:U${LIBTOOL_REQD}}:../../cross/libtool-base
122 .else
123 TOOL_DEPENDS+= libtool-base>=${_OPSYS_LIBTOOL_REQD:U${LIBTOOL_REQD}}:../../devel/libtool-base
124 .endif
125 CONFIGURE_ENV+= LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}"
126 MAKE_ENV+= LIBTOOL="${LIBTOOL} ${LIBTOOL_FLAGS}"
127 .endif