From 731b0a773903a5e631071d6070d98563a7c3cb3e Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 17 Aug 2021 02:59:59 +0200 Subject: [PATCH] build: Detect sed at configure time Check whether sed is available and use the implementation matching the requirements via the SED variable. --- configure.ac | 1 + man/Makefile.am | 2 +- src/Makefile.am | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 1591a93..645a95b 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/man/Makefile.am b/man/Makefile.am index 5dd37bf..9c6ad89 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -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 \ diff --git a/src/Makefile.am b/src/Makefile.am index 7ef2013..fe9d1e6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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