diff options
author | jlam <jlam@pkgsrc.org> | 2002-12-03 08:31:41 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2002-12-03 08:31:41 +0000 |
commit | 7eabdf1ddf9eb467f1469781c9dd4072965e2591 (patch) | |
tree | 218f7cbcdd1451a33874a635d3a3ff3ac25bd814 /mk/buildlink2 | |
parent | 8232526896a84a472a8ea6cd217e69beac0a7889 (diff) | |
download | pkgsrc-7eabdf1ddf9eb467f1469781c9dd4072965e2591.tar.gz |
Allow package Makefiles to define REPLACE_LOCALEDIR, which is a space-
separated list of files relative to ${WRKSRC} on which we do PKGLOCALEDIR
replacement. This is in addition to the files on which we already do the
PKGLOCALEDIR replacement (Makefile.in* and Makefile*).
Diffstat (limited to 'mk/buildlink2')
-rw-r--r-- | mk/buildlink2/bsd.buildlink2.mk | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/mk/buildlink2/bsd.buildlink2.mk b/mk/buildlink2/bsd.buildlink2.mk index 9afeeed12de..758abe75630 100644 --- a/mk/buildlink2/bsd.buildlink2.mk +++ b/mk/buildlink2/bsd.buildlink2.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.buildlink2.mk,v 1.61 2002/12/02 17:08:40 jschauma Exp $ +# $NetBSD: bsd.buildlink2.mk,v 1.62 2002/12/03 08:31:41 jlam Exp $ # # An example package buildlink2.mk file: # @@ -442,21 +442,31 @@ unbuildlink-buildlink-subst: _BUILDLINK_SUBST_USE # USE_PKGLOCALEDIR?= no _PKGLOCALEDIR= ${PREFIX}/${PKGLOCALEDIR}/locale -BUILDLINK_SUBST_MESSAGE.pkglocaledir= \ - "Fixing locale directory references." +REPLACE_LOCALEDIR_PATTERNS?= # empty +_REPLACE_LOCALEDIR_PATTERNS= ${REPLACE_LOCALEDIR_PATTERNS} .if defined(HAS_CONFIGURE) || defined(GNU_CONFIGURE) -_PKGLOCALEDIR_FILES= "Makefile.in\*" +_REPLACE_LOCALEDIR_PATTERNS+= Makefile.in* .else -_PKGLOCALEDIR_FILES= "Makefile\*" +_REPLACE_LOCALEDIR_PATTERNS+= Makefile* .endif +_REPLACE_LOCALEDIR_PATTERNS_FIND= \ + \( ${_REPLACE_LOCALEDIR_PATTERNS:S/$/!/:S/^/-o -name !/:S/!/"/g:S/-o//1} \) + +REPLACE_LOCALEDIR?= # empty +_REPLACE_LOCALEDIR= \ + ${REPLACE_LOCALEDIR} \ + `${FIND} . ${_REPLACE_LOCALEDIR_PATTERNS_FIND} -print | ${SED} -e 's|^\./||' | ${GREP} -v '\.orig' | ${SORT} -u` + +BUILDLINK_SUBST_MESSAGE.pkglocaledir= \ + "Fixing locale directory references." BUILDLINK_SUBST_FILES.pkglocaledir= \ - `${FIND} . -name "${_PKGLOCALEDIR_FILES}" -print | ${GREP} -v "\.orig"` + ${_REPLACE_LOCALEDIR} BUILDLINK_SUBST_SED.pkglocaledir= \ - -e 's|^\(localedir[ ]*=\).*|\1 ${_PKGLOCALEDIR}|' \ - -e 's|^\(gnulocaledir[ ]*=\).*|\1 ${_PKGLOCALEDIR}|' \ - -e 's|\(-DLOCALEDIR[ ]*=\)[^ ]*\(.*\)|\1"\\"${_PKGLOCALEDIR}\\""\2|' + -e 's|^\(localedir[ :]*=\).*|\1 ${_PKGLOCALEDIR}|' \ + -e 's|^\(gnulocaledir[ :]*=\).*|\1 ${_PKGLOCALEDIR}|' \ + -e 's|\(-DLOCALEDIR[ ]*=\)[^ ]*\(.*\)|\1"\\"${_PKGLOCALEDIR}\\""\2|' -.if (${PKGLOCALEDIR} != "share") && empty(USE_PKGLOCALEDIR:M[nN][oO]) +.if empty(USE_PKGLOCALEDIR:M[nN][oO]) pre-configure: pkglocaledir-buildlink-subst .endif pkglocaledir-buildlink-subst: _BUILDLINK_SUBST_USE |