diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/always-sed.m4 | 16 | ||||
-rw-r--r-- | config/zfs-build.m4 | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/config/always-sed.m4 b/config/always-sed.m4 new file mode 100644 index 000000000..b9c7afd63 --- /dev/null +++ b/config/always-sed.m4 @@ -0,0 +1,16 @@ +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]) +]) diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 index f0c2066af..91fe04844 100644 --- a/config/zfs-build.m4 +++ b/config/zfs-build.m4 @@ -164,6 +164,7 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [ ZFS_AC_CONFIG_ALWAYS_ARCH ZFS_AC_CONFIG_ALWAYS_PYTHON ZFS_AC_CONFIG_ALWAYS_PYZFS + ZFS_AC_CONFIG_ALWAYS_SED ]) AC_DEFUN([ZFS_AC_CONFIG], [ |