From: Daiki Ueno Date: Wed, 3 Dec 2014 06:14:44 +0000 (+0900) Subject: intl: Work around LCOV relative base directory resolution X-Git-Tag: v0.19.4~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=540bce16ab94cabf6d087e672d21005f16eb3f9f;p=thirdparty%2Fgettext.git intl: Work around LCOV relative base directory resolution * gettext-runtime/intl/Makefile.in (plural.lo): Resolve relative source file name given with '#line' directive, when $(srcdir) != $(builddir). (mostlyclean): Remove plural.c generated in the 'plural.lo' rule. * gettext-tools/src/plural-exp.c: Include "../intl/plural.c" instead of "../../gettext-runtime/intl/plural.c". --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 29c2de40b..d4cc23b10 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,10 @@ +2014-12-03 Daiki Ueno + + intl: Work around LCOV relative base directory resolution + * Makefile.in (plural.lo): Resolve relative source file name given + with '#line' directive, when $(srcdir) != $(builddir). + (mostlyclean): Remove plural.c generated in the 'plural.lo' rule. + 2014-10-15 Daiki Ueno * gettext 0.19.3 released. diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in index 2c9312629..836a86770 100644 --- a/gettext-runtime/intl/Makefile.in +++ b/gettext-runtime/intl/Makefile.in @@ -277,8 +277,13 @@ dngettext.lo: $(srcdir)/dngettext.c $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/dngettext.c ngettext.lo: $(srcdir)/ngettext.c $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/ngettext.c +# $(srcdir)/plural.c contains a relative file name of the Bison source. +# That could mess up gcov when the C source file is referred to from a +# different base directory. plural.lo: $(srcdir)/plural.c - $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/plural.c + $(AM_V_GEN)test "$(srcdir)" = . || \ + sed -e 's|^#line \([0-9]*\) "\(plural\.[cy]\)"|#line \1 "$(srcdir)/\2"|' < $(srcdir)/plural.c > plural.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) plural.c plural-exp.lo: $(srcdir)/plural-exp.c $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/plural-exp.c localcharset.lo: $(srcdir)/localcharset.c @@ -616,6 +621,7 @@ mostlyclean: rm -f *.a *.la *.o *.obj *.lo core core.* rm -f libgnuintl.h libintl.h charset.alias ref-add.sed ref-del.sed rm -f -r .libs _libs + test "$(srcdir)" = . || rm -f plural.c clean: mostlyclean diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 5be4e4432..5615a0915 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,9 @@ +2014-12-03 Daiki Ueno + + intl: Work around LCOV relative base directory resolution + * plural-exp.c: Include "../intl/plural.c" instead of + "../../gettext-runtime/intl/plural.c". + 2014-12-02 Daiki Ueno c: Minor cleanup of the previous commit diff --git a/gettext-tools/src/plural-exp.c b/gettext-tools/src/plural-exp.c index 919c69c77..34bc43565 100644 --- a/gettext-tools/src/plural-exp.c +++ b/gettext-tools/src/plural-exp.c @@ -17,5 +17,5 @@ /* Include the expression parsing code from libintl, with different function names. */ -#include "../../gettext-runtime/intl/plural.c" +#include "../intl/plural.c" #include "../../gettext-runtime/intl/plural-exp.c"