From 2554d1265c11257a79bfa541c5f0efcfdf097312 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 2 Sep 2021 12:19:59 +0200 Subject: [PATCH] build: make `sed` calls portable The `-i` option on sed isn't standard, and e.g. FreeBSD sed behaves different regarding the parameter. Avoid it. Signed-off-by: David Lamparter --- configure.ac | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index cf1c1e499c..917e791182 100644 --- a/configure.ac +++ b/configure.ac @@ -487,9 +487,12 @@ LT_INIT _LT_CONFIG_LIBTOOL([ patch -N -i "${srcdir}/m4/libtool-whole-archive.patch" libtool >&AS_MESSAGE_LOG_FD || \ AC_MSG_WARN([Could not patch libtool for static linking support. Loading modules into a statically linked daemon will fail.]) - sed -e 's%func_warning "relinking%true #\0%' -i libtool || true - sed -e 's%func_warning "remember to run%true #\0%' -i libtool || true - sed -e 's%func_warning ".*has not been installed in%true #\0%' -i libtool || true +dnl the -i option is not POSIX sed and the BSDs implement it differently +dnl cat'ing the output back instead of mv/cp keeps permissions on libtool intact + sed -e 's%func_warning "relinking%true #\0%' libtool > libtool.sed && cat libtool.sed > libtool + sed -e 's%func_warning "remember to run%true #\0%' libtool > libtool.sed && cat libtool.sed > libtool + sed -e 's%func_warning ".*has not been installed in%true #\0%' libtool > libtool.sed && cat libtool.sed > libtool + test -f libtool.sed && rm libtool.sed ]) if test "$enable_static_bin" = "yes"; then AC_LDFLAGS_EXEC="-static" @@ -2659,8 +2662,9 @@ if test "$enable_rpath" = "yes" ; then true else # See https://old-en.opensuse.org/openSUSE:Packaging_Guidelines#Removing_Rpath - sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool - sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool + sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool > libtool.sed && cat libtool.sed > libtool + sed -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool > libtool.sed && cat libtool.sed > libtool + test -f libtool.sed && rm libtool.sed fi echo " -- 2.39.5