Use configure detected or user specified sed in build system

Sometimes system default sed is not the best option.
With this modification user may easily override sed used by build system
without editing any file.

Signed-off-by: Karlson2k (Evgeny Grin) <k2k@narod.ru>
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Evgeny Grin 2023-05-19 18:06:02 +03:00 committed by Andrew Borodin
parent 054a051b42
commit f45d02ba2a
10 changed files with 16 additions and 16 deletions

View File

@ -13,7 +13,7 @@ rm -f INSTALL && ln -s doc/INSTALL
# Generate po/POTFILES.in
${XGETTEXT:-xgettext} --keyword=_ --keyword=N_ --keyword=Q_ --output=- \
`find . -name '*.[ch]'` | sed -ne '/^#:/{s/#://;s/:[0-9]*/\
`find . -name '*.[ch]'` | ${SED-sed} -ne '/^#:/{s/#://;s/:[0-9]*/\
/g;s/ //g;p;}' | \
grep -v '^$' | sort | uniq >po/POTFILES.in

View File

@ -710,7 +710,7 @@ po/Makefile.in
dnl https://stackoverflow.com/questions/30897170/ac-subst-does-not-expand-variable/30932102#30932102
AC_CONFIG_FILES(
[misc/syntax/Syntax], [sed -i -e "s%\${prefix}%$PREFIX%" misc/syntax/Syntax], [export PREFIX=$prefix]
[misc/syntax/Syntax], [${SED-sed} -i -e "s%\${prefix}%$PREFIX%" misc/syntax/Syntax], [export PREFIX=$prefix]
)
AC_CONFIG_FILES([

View File

@ -19,14 +19,14 @@ EXTRA_DIST = \
$(noinst_DATA)
mc.csh: $(top_builddir)/config.status $(srcdir)/mc.csh.in
sed "s%@""pkglibexecdir@%$(pkglibexecdir)%" $(srcdir)/mc.csh.in > mc.csh
$(SED) "s%@""pkglibexecdir@%$(pkglibexecdir)%" $(srcdir)/mc.csh.in > mc.csh
mc.sh: $(top_builddir)/config.status $(srcdir)/mc.sh.in
sed "s%@""pkglibexecdir@%$(pkglibexecdir)%" $(srcdir)/mc.sh.in > mc.sh
$(SED) "s%@""pkglibexecdir@%$(pkglibexecdir)%" $(srcdir)/mc.sh.in > mc.sh
mc-wrapper.csh: $(top_builddir)/config.status $(srcdir)/mc-wrapper.csh.in
sed "s%@""bindir@%$(bindir)%" $(srcdir)/mc-wrapper.csh.in > mc-wrapper.csh
$(SED) "s%@""bindir@%$(bindir)%" $(srcdir)/mc-wrapper.csh.in > mc-wrapper.csh
mc-wrapper.sh: $(top_builddir)/config.status $(srcdir)/mc-wrapper.sh.in
sed "s%@""bindir@%$(bindir)%" $(srcdir)/mc-wrapper.sh.in > mc-wrapper.sh
$(SED) "s%@""bindir@%$(bindir)%" $(srcdir)/mc-wrapper.sh.in > mc-wrapper.sh

View File

@ -13,12 +13,12 @@ MAN_DATE_CMD = \
mc.1: $(srcdir)/mc.1.in
MAN_FILE=$<; MAN_DATE=$$($(MAN_DATE_CMD)); \
sed $(SED_PARAMETERS) $< > $@
$(SED) $(SED_PARAMETERS) $< > $@
mcedit.1: $(srcdir)/mcedit.1.in
MAN_FILE=$<; MAN_DATE=$$($(MAN_DATE_CMD)); \
sed $(SED_PARAMETERS) $< > $@
$(SED) $(SED_PARAMETERS) $< > $@
mcview.1: $(srcdir)/mcview.1.in
MAN_FILE=$<; MAN_DATE=$$($(MAN_DATE_CMD)); \
sed $(SED_PARAMETERS) $< > $@
$(SED) $(SED_PARAMETERS) $< > $@

View File

@ -49,7 +49,7 @@ AC_DEFUN([mc_G_MODULE_SUPPORTED], [
esac
if test -n "$lib"; then
lib1=`echo $i | sed 's/^-l//'`
lib1=`echo $i | ${SED-sed} 's/^-l//'`
if test -f "$GLIB_LIBDIR/lib${lib1}.a"; then
add="$GLIB_LIBDIR/lib${lib1}.a"
else

View File

@ -10,7 +10,7 @@ dnl @modified Andrew Borodin <aborodin@vmail.ru>
AC_DEFUN([mc_VERSION],[
if test -f ${srcdir}/mc-version.h; then
VERSION=$(grep '^#define MC_CURRENT_VERSION' ${srcdir}/mc-version.h | sed 's/.*"\(.*\)"$/\1/')
VERSION=$(grep '^#define MC_CURRENT_VERSION' ${srcdir}/mc-version.h | ${SED-sed} 's/.*"\(.*\)"$/\1/')
else
VERSION="unknown"
fi

View File

@ -37,7 +37,7 @@ findIncludeDupsInDir() {
dir_name=$1; shift
for i in $(find "${dir_name}" -name '*.[ch]'); do
file_name=$(echo $i | sed 's@'"${MC_SOURCE_ROOT_DIR}/"'@@g')
file_name=$(echo $i | ${SED-sed} 's@'"${MC_SOURCE_ROOT_DIR}/"'@@g')
[ $(grep "^\s*${file_name}$" -c "${MC_SOURCE_ROOT_DIR}/maint/utils/find-dup-includes/exclude-list.cfg") -ne 0 ] && continue
"${MC_SOURCE_ROOT_DIR}/maint/utils/find-dup-includes/find-in-one-file.pl" "${i}"
done

View File

@ -9,7 +9,7 @@ LINE="Copyright (C)"
for i in "$SOURCES"; do
# replace year: XXXX-YYYY -> XXXX-ZZZZ
# add year: XXXX -> XXXX-ZZZZ
sed -i -e "
${SED-sed} -i -e "
1,20 {
/$LINE/s/-[0-9]\{4\}$/-$YEAR/
};
@ -19,4 +19,4 @@ for i in "$SOURCES"; do
done
# special case
sed -i -e "/$LINE/s/-[0-9]\{4\} the/-$YEAR the/" src/editor/editwidget.c
${SED-sed} -i -e "/$LINE/s/-[0-9]\{4\} the/-$YEAR the/" src/editor/editwidget.c

View File

@ -1,7 +1,7 @@
update-po: Makefile
$(MAKE) $(DOMAIN).pot-update && \
sed \
$(SED) \
-e '/#, fuzzy/d' \
-e 's/Project-Id-Version: PACKAGE VERSION/Project-Id-Version: $(PACKAGE) $(VERSION)/' \
-e 's/^"Plural-Forms: nplurals=INTEGER;/# "Plural-Forms: nplurals=INTEGER;/' \

View File

@ -63,7 +63,7 @@ SHOR_MC_VERSION="${PREV_MC_VERSION}"
if [ -r "${VERSION_FILE}" ]
then
PREV_MC_VERSION=`sed -n 's/^#define MC_CURRENT_VERSION "\(.*\)"$/\1/p' "${VERSION_FILE}"`
PREV_MC_VERSION=`${SED-sed} -n 's/^#define MC_CURRENT_VERSION "\(.*\)"$/\1/p' "${VERSION_FILE}"`
CURR_MC_VERSION="${PREV_MC_VERSION}"
SHOR_MC_VERSION="${PREV_MC_VERSION}"
fi