build: Detect sed at configure time Check whether sed is available and use the implementation matching the requirements via the SED variable.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
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