diff --git a/Makefile.am b/Makefile.am index 3e2d6e4dc9..6ba5ac3880 100644 --- a/Makefile.am +++ b/Makefile.am @@ -89,7 +89,7 @@ all-local: ${top_builddir}/scripts/zfs-tests.sh -c dist-hook: - sed ${ac_inplace} -e 's/Release:[[:print:]]*/Release: $(RELEASE)/' \ + $(SED) ${ac_inplace} -e 's/Release:[[:print:]]*/Release: $(RELEASE)/' \ $(distdir)/META if BUILD_LINUX diff --git a/cmd/arcstat/Makefile.am b/cmd/arcstat/Makefile.am index 4b79f4bdd0..a0728f9cec 100644 --- a/cmd/arcstat/Makefile.am +++ b/cmd/arcstat/Makefile.am @@ -8,6 +8,6 @@ dist_bin_SCRIPTS = arcstat # if USING_PYTHON_2 install-exec-hook: - sed ${ac_inplace} -e 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \ + $(SED) ${ac_inplace} -e 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \ $(DESTDIR)$(bindir)/arcstat endif diff --git a/cmd/dbufstat/Makefile.am b/cmd/dbufstat/Makefile.am index 10c9fbabbf..f3b7ed809f 100644 --- a/cmd/dbufstat/Makefile.am +++ b/cmd/dbufstat/Makefile.am @@ -8,6 +8,6 @@ dist_bin_SCRIPTS = dbufstat # if USING_PYTHON_2 install-exec-hook: - sed ${ac_inplace} -e 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \ + $(SED) ${ac_inplace} -e 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \ $(DESTDIR)$(bindir)/dbufstat endif diff --git a/config/always-sed.m4 b/config/always-sed.m4 index b9c7afd63d..19633e118a 100644 --- a/config/always-sed.m4 +++ b/config/always-sed.m4 @@ -2,15 +2,15 @@ dnl # dnl # Set the flags used for sed in-place edits. dnl # AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_SED], [ - ac_inplace="" - AC_CACHE_CHECK([for sed --in-place], [ac_cv_path_SED], - [AC_PATH_PROGS_FEATURE_CHECK([SED], [sed], - [[tmpfile=$(mktemp) - echo foo > $tmpfile - $ac_path_SED --in-place 's#foo#bar#' $tmpfile \ - && ac_cv_path_SED=$ac_path_SED - rm $tmpfile]], - [ac_inplace="-i ''"])]) - AS_IF([test "x$ac_inplace" = "x"], [ac_inplace="--in-place"]) - AC_SUBST([ac_inplace]) + AC_REQUIRE([AC_PROG_SED])dnl + AC_CACHE_CHECK([for sed --in-place], [ac_cv_inplace], [ + tmpfile=$(mktemp conftest.XXX) + echo foo >$tmpfile + AS_IF([$SED --in-place 's#foo#bar#' $tmpfile 2>/dev/null], + [ac_cv_inplace="--in-place"], + [$SED -i '' 's#foo#bar#' $tmpfile 2>/dev/null], + [ac_cv_inplace="-i ''"], + [AC_MSG_ERROR([$SED does not support in-place])]) + ]) + AC_SUBST([ac_inplace], [$ac_cv_inplace]) ]) diff --git a/tests/test-runner/bin/Makefile.am b/tests/test-runner/bin/Makefile.am index e7838e43d3..09032ba689 100644 --- a/tests/test-runner/bin/Makefile.am +++ b/tests/test-runner/bin/Makefile.am @@ -9,7 +9,7 @@ dist_pkgdata_SCRIPTS = \ # if USING_PYTHON_2 install-data-hook: - sed ${ac_inplace} -e 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \ + $(SED) ${ac_inplace} -e 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \ $(DESTDIR)$(pkgdatadir)/test-runner.py \ $(DESTDIR)$(pkgdatadir)/zts-report.py endif