summaryrefslogtreecommitdiff
path: root/mk/buildlink2
diff options
context:
space:
mode:
authorsalo <salo@pkgsrc.org>2002-11-28 14:21:32 +0000
committersalo <salo@pkgsrc.org>2002-11-28 14:21:32 +0000
commitfd4ecd6aa4c722f283c44915f7f7f459f4cd119f (patch)
tree0816324ba177998c0433aa190a61935e25259562 /mk/buildlink2
parent16a06b3d0076e225dd13d542f71d4f11ac261c11 (diff)
downloadpkgsrc-fd4ecd6aa4c722f283c44915f7f7f459f4cd119f.tar.gz
Introduce new framework for handling packages' locale directories.
The logic is: - if package defines USE_PKGLOCALEDIR and PKGLOCALEDIR is not 'share' as GNU autotools expects then - fix variables 'localedir', 'gnulocaledir' and define coorect 'LOCALEDIR' in the Makefile.in.* files From Packages.txt: 10.29 Packages providing locale catalogues ========================================== If the package provides its own locale catalogues, the variable USE_PKGLOCALEDIR should be defined. It will ensure that the package's Makefile template files are fixed and point to the correct locale directories (which may vary, depending on OS), if necessary. See also section 5.1 for details about ${PKGLOCALEDIR}. This functionality is buildlink2-only.
Diffstat (limited to 'mk/buildlink2')
-rw-r--r--mk/buildlink2/bsd.buildlink2.mk21
1 files changed, 20 insertions, 1 deletions
diff --git a/mk/buildlink2/bsd.buildlink2.mk b/mk/buildlink2/bsd.buildlink2.mk
index e9beddef2e3..2290eff183d 100644
--- a/mk/buildlink2/bsd.buildlink2.mk
+++ b/mk/buildlink2/bsd.buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink2.mk,v 1.57 2002/11/26 22:46:59 jlam Exp $
+# $NetBSD: bsd.buildlink2.mk,v 1.58 2002/11/28 14:21:34 salo Exp $
#
# An example package buildlink2.mk file:
#
@@ -412,6 +412,25 @@ _REPLACE_BUILDLINK= \
${REPLACE_BUILDLINK} \
`${FIND} . ${_REPLACE_BUILDLINK_PATTERNS_FIND} -print | ${SED} -e 's|^\./||' | ${SORT} -u`
+# Fix locale directory references.
+#
+USE_PKGLOCALEDIR?= no
+_PKGLOCALEDIR= ${PREFIX}/${PKGLOCALEDIR}/locale
+BUILDLINK_SUBST_MESSAGE.pkglocaledir= \
+ "Fixing locale directory references."
+BUILDLINK_SUBST_FILES.pkglocaledir= \
+ `${FIND} . -name "Makefile.in*" -print | ${GREP} -v "\.orig"`
+BUILDLINK_SUBST_SED.pkglocaledir= \
+ -e 's|^\(localedir[ ]*=\).*|\1 ${_PKGLOCALEDIR}|' \
+ -e 's|^\(gnulocaledir[ ]*=\).*|\1 ${_PKGLOCALEDIR}|' \
+ -e 's|\(-DLOCALEDIR[ ]*=\)[^ ]*\(.*\)|\1"\\"${_PKGLOCALEDIR}\\""\2|'
+
+pkglocaledir-buildlink-subst: _BUILDLINK_SUBST_USE
+
+.if (${PKGLOCALEDIR} != "share") && empty(USE_PKGLOCALEDIR:M[nN][oO])
+
+pre-configure: pkglocaledir-buildlink-subst
+.endif
# When "unbuildlinkifying" a file, we must remove references to the
# buildlink directories and change any -llib to the proper replacement
# libraries (-lreadline -> -ledit, etc.). Redundant -Idir and -Ldir