From: Bruno Haible Date: Sun, 21 Oct 2007 02:55:56 +0000 (+0000) Subject: Make the libintl.res rule work with older versions of sed as well. X-Git-Tag: v0.17~93 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=901ed10483b2cf202ff25e5f39e5016cb60b2943;p=thirdparty%2Fgettext.git Make the libintl.res rule work with older versions of sed as well. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 91012ed76..4c503c604 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,8 @@ +2007-10-20 Bruno Haible + + * Makefile.in (libintl.res): Put more literal newlines into the sed + scripts. + 2007-10-14 Bruno Haible * dcigettext.c (DCIGETTEXT): Save errno also around the tfind() call. @@ -4069,4 +4074,4 @@ Sun Jul 2 02:06:50 1995 Ulrich Drepper needed to internationalize own packages. It provides functions which allow to use the X/Open catgets function with an interface like the Uniforum gettext function. For system which does not - have neither of those a complete implementation is provided. \ No newline at end of file + have neither of those a complete implementation is provided. diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in index 3fb0a0928..855761d22 100644 --- a/gettext-runtime/intl/Makefile.in +++ b/gettext-runtime/intl/Makefile.in @@ -273,18 +273,17 @@ osdep.lo: $(srcdir)/osdep.c intl-compat.lo: $(srcdir)/intl-compat.c $(LIBTOOL) --mode=compile $(COMPILE) $(srcdir)/intl-compat.c -# The following sed expressions contain a minimal amount of newlines, so that -# they can be written in a Makefile without requiring a temporary file. It is -# not POSIX compliant to use semicolons instead of newlines inside a group of -# sed commands {...}. But this rule is executed only on Woe32 systems, which -# can assume the presence of GNU sed (and GNU make). +# This rule is executed only on Woe32 systems. +# The following sed expressions come from the windres-options script. They are +# inlined here, so that they can be written in a Makefile without requiring a +# temporary file. They must contain literal newlines rather than semicolons, +# so that they work with the sed-3.02 that is shipped with MSYS. We can use +# GNU bash's $'\n' syntax to obtain such a newline. libintl.res: $(srcdir)/libintl.rc - sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q};a\ - 0'; \ - sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q};a\ - 0'; \ - sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q};a\ - 0'; \ + nl=$$'\n'; \ + sed_extract_major='/^[0-9]/{'$${nl}'s/^\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'a\'$${nl}0$${nl}q; \ + sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'a\'$${nl}0$${nl}q; \ + sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{'$${nl}'s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p'$${nl}q$${nl}'}'$${nl}'a\'$${nl}0$${nl}q; \ $(WINDRES) \ "-DPACKAGE_VERSION_STRING=\\\"$(VERSION)\\\"" \ "-DPACKAGE_VERSION_MAJOR="`echo '$(VERSION)' | sed -n -e "$$sed_extract_major"` \