build: Detect sed at configure time

Check whether sed is available and use the implementation matching the
requirements via the SED variable.
This commit is contained in:
Guillem Jover 2021-08-17 02:59:59 +02:00
parent 50b50a4330
commit 731b0a7739
3 changed files with 3 additions and 2 deletions

View File

@ -48,6 +48,7 @@ AM_CONDITIONAL([HAVE_LINKER_VERSION_SCRIPT],
# Checks for programs.
AC_PROG_CC
AC_PROG_SED
AC_PROG_INSTALL
AC_PROG_LN_S

View File

@ -11,7 +11,7 @@ CLEANFILES = \
SED_MD5_SUBST = -e 's/mdX/md5/g' -e 's/mdY/md4/g' -e 's/MDX/MD5/g'
md5.3bsd: $(srcdir)/mdX.3bsd
$(AM_V_GEN) sed $(SED_MD5_SUBST) $< > $@
$(AM_V_GEN) $(SED) $(SED_MD5_SUBST) $< > $@
dist_man_MANS = \
LIST_CLASS_ENTRY.3bsd \

View File

@ -136,7 +136,7 @@ install-exec-hook:
mv $(DESTDIR)$(libdir)/libbsd*.so.* \
$(DESTDIR)$(runtimelibdir)/; \
soname=`readlink $(DESTDIR)$(libdir)/libbsd.so`; \
sorelprefix=`echo $(libdir) | sed -r -e 's:(^/)?[^/]+:..:g'`; \
sorelprefix=`echo $(libdir) | $(SED) -r -e 's:(^/)?[^/]+:..:g'`; \
ln -sf $$sorelprefix$(runtimelibdir)/$$soname \
$(DESTDIR)$(libdir)/libbsd.so; \
fi