summaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2002-06-19 08:21:27 +0000
committersobomax <sobomax@FreeBSD.org>2002-06-19 08:21:27 +0000
commitcf724f0a1054e38a8cb521c6b6a0e5ced6fedab4 (patch)
treea48b1bf53a275e8bcf97355ae017381e8166ebd7 /Mk
parent57c5b31de7e18245f582318496394bea5bb4aefc (diff)
downloadFreeBSD-ports-cf724f0a1054e38a8cb521c6b6a0e5ced6fedab4.zip
FreeBSD-ports-cf724f0a1054e38a8cb521c6b6a0e5ced6fedab4.tar.gz
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@
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 7b46611..8a7a389 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
OpenPOWER on IntegriCloud