]>
Commit | Line | Data |
---|---|---|
4313a5b4 RM |
1 | dnl # |
2 | dnl # Set the flags used for sed in-place edits. | |
3 | dnl # | |
4 | AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_SED], [ | |
5ca349f9 AS |
5 | AC_REQUIRE([AC_PROG_SED])dnl |
6 | AC_CACHE_CHECK([for sed --in-place], [ac_cv_inplace], [ | |
9109b89c | 7 | tmpfile=$(mktemp conftest.XXXXXX) |
5ca349f9 AS |
8 | echo foo >$tmpfile |
9 | AS_IF([$SED --in-place 's#foo#bar#' $tmpfile 2>/dev/null], | |
10 | [ac_cv_inplace="--in-place"], | |
11 | [$SED -i '' 's#foo#bar#' $tmpfile 2>/dev/null], | |
12 | [ac_cv_inplace="-i ''"], | |
13 | [AC_MSG_ERROR([$SED does not support in-place])]) | |
14 | ]) | |
15 | AC_SUBST([ac_inplace], [$ac_cv_inplace]) | |
4313a5b4 | 16 | ]) |