aboutsummaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2002-06-19 08:21:27 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2002-06-19 08:21:27 +0000
commit683ff40aac243e98aa4632230281eb47e828b9e2 (patch)
treee5cf6dc64ba56258ff155cb24dfcc80167d81e8b /Mk
parent480346363349d34df50ccbe8af45c0135915e85e (diff)
downloadports-683ff40aac243e98aa4632230281eb47e828b9e2.tar.gz
ports-683ff40aac243e98aa4632230281eb47e828b9e2.zip
Change the way REINPLACE_CMD works - instead of using perl(1) on systems
where sed(1) can't do in-place editing add a new USE_REINPLACE knob, which if turned on defines REINPLACE_CMD and adds textproc/sed_inplace port into BUILD_DEPENDS if necessary. Not objected by: portmgr@
Notes
Notes: svn path=/head/; revision=61546
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk18
1 files changed, 11 insertions, 7 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 7b466115e154..8a7a389acbdf 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -623,13 +623,6 @@ OSVERSION!= /usr/sbin/sysctl -n kern.osreldate
.endif
.endif
-# Special macro for doing in-place file editing using regexps
-.if ${OSVERSION} <= 500033
-REINPLACE_CMD?= ${PERL} -p -i.bak
-.else
-REINPLACE_CMD?= ${SED} -i.bak
-.endif
-
# Get the object format.
.if !defined(PORTOBJFORMAT)
PORTOBJFORMAT!= test -x /usr/bin/objformat && /usr/bin/objformat || echo aout
@@ -716,6 +709,17 @@ FILESDIR?= ${MASTERDIR}/files
SCRIPTDIR?= ${MASTERDIR}/scripts
PKGDIR?= ${MASTERDIR}
+# Special macro for doing in-place file editing using regexps
+.if defined(USE_REINPLACE)
+REINPLACE_ARGS?= -i.bak
+.if ${OSVERSION} <= 500033
+BUILD_DEPENDS+= ${LOCALBASE}/bin/sed_inplace:${PORTSDIR}/textproc/sed_inplace
+REINPLACE_CMD?= ${LOCALBASE}/bin/sed_inplace ${REINPLACE_ARGS}
+.else
+REINPLACE_CMD?= ${SED} ${REINPLACE_ARGS}
+.endif
+.endif
+
.if defined(USE_IMAKE) && !defined(USE_X_PREFIX)
USE_X_PREFIX= yes
.endif