2019-10-17 05:19:48 +03:00
|
|
|
dnl #
|
|
|
|
dnl # Set the flags used for sed in-place edits.
|
|
|
|
dnl #
|
|
|
|
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_SED], [
|
2020-06-22 19:08:12 +03:00
|
|
|
AC_REQUIRE([AC_PROG_SED])dnl
|
|
|
|
AC_CACHE_CHECK([for sed --in-place], [ac_cv_inplace], [
|
2020-12-03 21:01:16 +03:00
|
|
|
tmpfile=$(mktemp conftest.XXXXXX)
|
2020-06-22 19:08:12 +03:00
|
|
|
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])
|
2019-10-17 05:19:48 +03:00
|
|
|
])
|