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:
9 # Should be set to "yes" whenever a package uses a BSD-style
10 # Makefile. These Makefiles typically end with a line including
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
22 .if defined
(USE_BSD_MAKEFILE
)
23 MAKE_ENV
+= ${BSD_MAKE_ENV} INSTALL
=${TOOLS_INSTALL
:Q
}
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
}
43 .if defined
(USE_IMAKE
) && empty
(USE_TOOLS
:Mitools
)
47 .if defined
(USE_IMAKE
)
48 MAKE_FLAGS
+= CC
=${CC
:Q
} CXX
=${CXX
:Q
}
51 .if defined
(USE_X11BASE
) && ${X11_TYPE} != "modular"
52 .
include "x11.buildlink3.mk"
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
)
62 . elif defined
(USE_CROSSBASE
)
69 .if
(${PKG_INSTALLATION_TYPE} == "pkgviews") && defined
(INSTALLATION_PREFIX
)
70 PKG_FAIL_REASON
= "INSTALLATION_PREFIX can't be used in a pkgviews package"
73 ############################################################################
75 ############################################################################
79 .if defined
(PKG_USE_KERBEROS
)
80 CRYPTO?
= uses Kerberos encryption code
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."
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
106 . if
!empty
(USE_CROSS_COMPILE
:M
[yY
][eE
][sS
])
107 PKG_LIBTOOL?
= ${CROSSBASE}/bin
/libtool
108 PKG_SHLIBTOOL?
= ${CROSSBASE}/bin
/shlibtool
110 PKG_LIBTOOL?
= ${LOCALBASE}/bin
/libtool
111 PKG_SHLIBTOOL?
= ${LOCALBASE}/bin
/shlibtool
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
123 TOOL_DEPENDS
+= libtool-base
>=${_OPSYS_LIBTOOL_REQD
:U
${LIBTOOL_REQD}}:..
/..
/devel
/libtool-base
125 CONFIGURE_ENV
+= LIBTOOL
="${LIBTOOL} ${LIBTOOL_FLAGS}"
126 MAKE_ENV
+= LIBTOOL
="${LIBTOOL} ${LIBTOOL_FLAGS}"