summaryrefslogtreecommitdiff
path: root/mk/buildlink2
diff options
context:
space:
mode:
authorjlam <jlam>2003-08-27 11:29:56 +0000
committerjlam <jlam>2003-08-27 11:29:56 +0000
commit007f13f900ede91d78c74c52dadc07e8fe582e18 (patch)
treeb27904a27f1a3c2d035f1484bf240a843ec6c802 /mk/buildlink2
parent58bc673bf70e14821b5f844a1b2379742badabd6 (diff)
downloadpkgsrc-007f13f900ede91d78c74c52dadc07e8fe582e18.tar.gz
(*) Nuke the _BUILDLINK_SUBST_USE target now that subst.mk does the same
thing. (*) Move the code to adjust Makefiles to refer to the correct PKGLOCALEDIR into bsd.pkg.mk and reimplement it using subst.mk so that it's non-USE_BUILDLINK2 packages can use it, too. (*) Reimplement the PKGCONFIG_OVERRIDE code in bsd.pkg.mk using subst.mk. (*) Reimplement the unbuildlink code in bsd.buildlink2.mk using subst.mk.
Diffstat (limited to 'mk/buildlink2')
-rw-r--r--mk/buildlink2/bsd.buildlink2.mk96
1 files changed, 7 insertions, 89 deletions
diff --git a/mk/buildlink2/bsd.buildlink2.mk b/mk/buildlink2/bsd.buildlink2.mk
index a603b7532f6..2b581aae1bb 100644
--- a/mk/buildlink2/bsd.buildlink2.mk
+++ b/mk/buildlink2/bsd.buildlink2.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink2.mk,v 1.94 2003/08/16 08:50:20 jlam Exp $
+# $NetBSD: bsd.buildlink2.mk,v 1.95 2003/08/27 11:29:57 jlam Exp $
#
# An example package buildlink2.mk file:
#
@@ -383,54 +383,6 @@ _BLNK_TRANSFORM+= ${_BLNK_UNPROTECT}
_BLNK_TRANSFORM_SED+= -f ${_BLNK_TRANSFORM_SEDFILE}
_BLNK_UNTRANSFORM_SED+= -f ${_BLNK_UNTRANSFORM_SEDFILE}
-_BLNK_CHECK_IS_TEXT_FILE?= \
- ${FILE_CMD} $${file} | ${EGREP} "(shell script|text)" >/dev/null 2>&1
-
-# _BUILDLINK_SUBST_USE is a make macro that executes code to do general text
-# replacement in files in ${WRKSRC}. The following variables are used:
-#
-# BUILDLINK_SUBST_MESSAGE.<package> message to display, noting what is
-# being substituted
-#
-# BUILDLINK_SUBST_FILES.<package> files on which to run the substitution;
-# these are relative to ${WRKSRC}
-#
-# BUILDLINK_SUBST_SED.<package> sed(1) substitution expression to run
-# on the specified files.
-#
-# The _BUILDLINK_SUBST_USE macro code will try to verify that a file is a text
-# file before attempting any substitutions.
-#
-_BUILDLINK_SUBST_USE: .USE
- ${_PKG_SILENT}${_PKG_DEBUG} \
- cookie=${BUILDLINK_DIR}/.${.TARGET:S/-buildlink-subst//:S/-/_/g}_buildlink_subst_done; \
- if [ ! -f $${cookie} ]; then \
- ${MKDIR} ${BUILDLINK_DIR}; \
- if [ -n "${BUILDLINK_SUBST_SED.${.TARGET:S/-buildlink-subst//}:C/[ ]//g:Q}" ]; then \
- cd ${WRKSRC}; \
- files="${BUILDLINK_SUBST_FILES.${.TARGET:S/-buildlink-subst//}}"; \
- if [ -n "$${files}" ]; then \
- ${ECHO_BUILDLINK_MSG} ${BUILDLINK_SUBST_MESSAGE.${.TARGET:S/-buildlink-subst//}}; \
- cd ${WRKSRC}; \
- for file in $${files}; do \
- if ${_BLNK_CHECK_IS_TEXT_FILE}; then \
- ${MV} -f $${file} $${file}.blsav; \
- ${SED} ${BUILDLINK_SUBST_SED.${.TARGET:S/-buildlink-subst//}} \
- $${file}.blsav > $${file}; \
- if [ -x $${file}.blsav ]; then \
- ${CHMOD} +x $${file}; \
- fi; \
- if ${CMP} -s $${file}.blsav $${file}; then \
- ${MV} -f $${file}.blsav $${file}; \
- else \
- ${ECHO} $${file} >> $${cookie}; \
- fi; \
- fi; \
- done; \
- fi; \
- fi; \
- fi
-
REPLACE_BUILDLINK_PATTERNS?= # empty
_REPLACE_BUILDLINK_PATTERNS= ${REPLACE_BUILDLINK_PATTERNS}
_REPLACE_BUILDLINK_PATTERNS+= *-config
@@ -453,47 +405,13 @@ REPLACE_BUILDLINK_SED?= # empty
_REPLACE_BUILDLINK_SED= ${REPLACE_BUILDLINK_SED}
_REPLACE_BUILDLINK_SED+= ${LIBTOOL_ARCHIVE_UNTRANSFORM_SED}
-BUILDLINK_SUBST_MESSAGE.unbuildlink= \
+SUBST_CLASSES+= unbuildlink
+SUBST_STAGE.unbuildlink= post-build
+SUBST_MESSAGE.unbuildlink= \
"Fixing buildlink references in files-to-be-installed."
-BUILDLINK_SUBST_FILES.unbuildlink= ${_REPLACE_BUILDLINK}
-BUILDLINK_SUBST_SED.unbuildlink= ${_REPLACE_BUILDLINK_SED}
-BUILDLINK_SUBST_SED.unbuildlink+= ${_BLNK_UNTRANSFORM_SED}
-
-post-build: unbuildlink-buildlink-subst
-unbuildlink-buildlink-subst: _BUILDLINK_SUBST_USE
-
-# Fix locale directory references.
-#
-USE_PKGLOCALEDIR?= no
-_PKGLOCALEDIR= ${PREFIX}/${PKGLOCALEDIR}/locale
-REPLACE_LOCALEDIR_PATTERNS?= # empty
-_REPLACE_LOCALEDIR_PATTERNS= ${REPLACE_LOCALEDIR_PATTERNS}
-.if defined(HAS_CONFIGURE) || defined(GNU_CONFIGURE)
-_REPLACE_LOCALEDIR_PATTERNS+= Makefile.in*
-.else
-_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= \
- ${_REPLACE_LOCALEDIR}
-BUILDLINK_SUBST_SED.pkglocaledir= \
- -e 's|^\(localedir[ :]*=\).*|\1 ${_PKGLOCALEDIR}|' \
- -e 's|^\(gnulocaledir[ :]*=\).*|\1 ${_PKGLOCALEDIR}|' \
- -e 's|\(-DLOCALEDIR[ ]*=\)[^ ]*\(.*\)|\1"\\"${_PKGLOCALEDIR}\\""\2|'
-
-.if empty(USE_PKGLOCALEDIR:M[nN][oO])
-pre-configure: pkglocaledir-buildlink-subst
-.endif
-pkglocaledir-buildlink-subst: _BUILDLINK_SUBST_USE
+SUBST_FILES.unbuildlink= ${_REPLACE_BUILDLINK}
+SUBST_SED.unbuildlink= ${_REPLACE_BUILDLINK_SED}
+SUBST_SED.unbuildlink+= ${_BLNK_UNTRANSFORM_SED}
.if !defined(USE_LIBTOOL)
BUILDLINK_FAKE_LA= ${TRUE}