freebsd-dev/config/always-sed.m4
qzdanis 9109b89cd7
Add compatibility for busybox mktemp
Busybox's mktemp requires at least six X's in the template, causing
the current sed --in-place check to fail because the file does not
exist. This change adds additional X's to mktemp templates that do
not already have at least six X's in them.

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Quentin Zdanis <zdanisq@gmail.com>
Closes #11269
2020-12-03 10:01:16 -08:00

17 lines
539 B
Plaintext

dnl #
dnl # Set the flags used for sed in-place edits.
dnl #
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_SED], [
AC_REQUIRE([AC_PROG_SED])dnl
AC_CACHE_CHECK([for sed --in-place], [ac_cv_inplace], [
tmpfile=$(mktemp conftest.XXXXXX)
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])
])