From: Bruno Haible Date: Sun, 25 Nov 2018 01:11:23 +0000 (+0100) Subject: build: Fix #line statements in bison-generated files. X-Git-Tag: v0.20~200 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba23f92889187ec33dd02fcaceed9503d1b65167;p=thirdparty%2Fgettext.git build: Fix #line statements in bison-generated files. * gettext-tools/src/plural-exp.c: Revert changes from 2014-12-03 and 2014-12-04. * gettext-runtime/intl/Makefile.in (PLURAL_OBJECT): Remove variable. (OBJECTS): Use plural.lo always. ($(srcdir)/plural.c): New rule. (.y.c, pluralx.c, pluralx.lo): Remove rules. (mostlyclean): Delete the temporary file of the plural.c rule. (maintainer-clean): Delete plural.c. * gettext-tools/configure.ac (intl/Makefile): Remove PLURAL_OBJECT hack. --- diff --git a/.gitignore b/.gitignore index 5faf45606..e76f0d55e 100644 --- a/.gitignore +++ b/.gitignore @@ -351,7 +351,6 @@ /gnulib-local/Makefile.in # Files generated by "make" and even kept by "make maintainer-clean": -/gettext-runtime/intl/plural.c /gettext-runtime/po/en@boldquot.po /gettext-runtime/po/en@quot.po /gettext-tools/po/en@boldquot.po @@ -451,6 +450,7 @@ /gettext-tools/libgettextpo/ostream.priv.h /gettext-tools/libgettextpo/ostream.vt.h # Files generated by "make", using bison. +/gettext-runtime/intl/plural.c /gettext-tools/src/cldr-plural.c /gettext-tools/src/cldr-plural.h /gettext-tools/src/po-gram-gen.c diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in index b19f3f3c4..bbc7f8e20 100644 --- a/gettext-runtime/intl/Makefile.in +++ b/gettext-runtime/intl/Makefile.in @@ -109,10 +109,6 @@ LIBS = @LIBS@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) -# This line will be replaced with pluralx.lo, when this file is used -# in gettext-tools/intl/. See the pluralx.lo rule below for the rationale. -PLURAL_OBJECT = plural.lo - HEADERS = \ gmo.h \ gettextP.h \ @@ -183,7 +179,7 @@ OBJECTS = \ dcngettext.lo \ dngettext.lo \ ngettext.lo \ - $(PLURAL_OBJECT) \ + plural.lo \ plural-exp.lo \ localcharset.lo \ threadlib.lo \ @@ -235,9 +231,11 @@ LTV_AGE=1 .SUFFIXES: .SUFFIXES: .c .y .lo .sin .sed -.y.c: - $(AM_V_YACC)$(YACC) $(YFLAGS) --output $@ $< - $(AM_V_at)rm -f $*.h +$(srcdir)/plural.c: $(srcdir)/plural.y + $(AM_V_YACC)$(YACC) $(YFLAGS) --output plural.c $(srcdir)/plural.y \ + && sed -e 's|".*/plural.y"|"plural.y"|' < plural.c > plural.c-tmp \ + && rm -f plural.c plural.h \ + && mv plural.c-tmp $(srcdir)/plural.c bindtextdom.lo: $(srcdir)/bindtextdom.c $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/bindtextdom.c @@ -271,13 +269,6 @@ ngettext.lo: $(srcdir)/ngettext.c $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/ngettext.c plural.lo: $(srcdir)/plural.c $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) $(srcdir)/plural.c -# $(srcdir)/plural.c contains a relative file name of the Bison source. -# That could mess up LCOV when the C source file is referred to from a -# different base directory. -pluralx.c: $(srcdir)/plural.c - $(AM_V_GEN)sed -e 's|^#line \([0-9]*\) "\(plural\.[cy]\)"|#line \1 "$(srcdir)/\2"|' < $(srcdir)/plural.c > $@ -pluralx.lo: pluralx.c - $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC --mode=compile $(COMPILE) pluralx.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 @@ -509,7 +500,7 @@ localename.lo: $(srcdir)/gettextP.h localename.lo localename-table.lo: localename-table.h hash-string.lo dcigettext.lo loadmsgcat.lo: $(srcdir)/hash-string.h explodename.lo l10nflist.lo: $(srcdir)/loadinfo.h -dcigettext.lo loadmsgcat.lo $(PLURAL_OBJECT) plural-exp.lo: $(srcdir)/plural-exp.h +dcigettext.lo loadmsgcat.lo plural.lo plural-exp.lo: $(srcdir)/plural-exp.h dcigettext.lo: $(srcdir)/eval-plural.h localcharset.lo: $(srcdir)/localcharset.h bindtextdom.lo dcigettext.lo finddomain.lo loadmsgcat.lo localealias.lo lock.lo log.lo: $(srcdir)/lock.h @@ -519,7 +510,7 @@ printf.lo: $(srcdir)/printf-args.h $(srcdir)/printf-args.c $(srcdir)/printf-pars # A bison-2.1 generated plural.c includes if ENABLE_NLS. PLURAL_DEPS_yes = libintl.h PLURAL_DEPS_no = -$(PLURAL_OBJECT): $(PLURAL_DEPS_@USE_INCLUDED_LIBINTL@) +plural.lo: $(PLURAL_DEPS_@USE_INCLUDED_LIBINTL@) tags: TAGS @@ -541,7 +532,7 @@ mostlyclean: rm -f *.a *.la *.o *.obj *.lo core core.* rm -f libgnuintl.h libintl.h localename-table.h ref-add.sed ref-del.sed rm -f -r .libs _libs - rm -f pluralx.c + rm -f plural.c-tmp clean: mostlyclean @@ -552,6 +543,7 @@ distclean: clean maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." + rm -f $(srcdir)/plural.c # GNU gettext needs not contain the file 'VERSION' but contains some diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index a944dc75c..82fa2cd76 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -504,10 +504,8 @@ AC_CONFIG_FILES([doc/Makefile]) AC_CONFIG_FILES([intl/Makefile:../gettext-runtime/intl/Makefile.in], [ # Change srcdir variable so that it points to ../gettext-runtime/intl. - # Change PLURAL_OBJECT variable so that pluralx.c is used instead of plural.c. sed -e 's|^srcdir =.*$|srcdir = $(top_srcdir)/../gettext-runtime/intl|' \ -e 's|^VPATH =.*$||' \ - -e 's|^PLURAL_OBJECT = .*$|PLURAL_OBJECT = pluralx.lo|' \ < intl/Makefile > intl/Makefile.tmp mv intl/Makefile.tmp intl/Makefile ]) diff --git a/gettext-tools/src/plural-exp.c b/gettext-tools/src/plural-exp.c index beee95506..a654a73c8 100644 --- a/gettext-tools/src/plural-exp.c +++ b/gettext-tools/src/plural-exp.c @@ -1,5 +1,5 @@ /* Expression parsing for plural form selection. - Copyright (C) 2000-2001, 2003, 2015-2016 Free Software Foundation, Inc. + Copyright (C) 2000-2001, 2003, 2014, 2018 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software: you can redistribute it and/or modify @@ -17,5 +17,5 @@ /* Include the expression parsing code from libintl, with different function names. */ -#include "../intl/pluralx.c" +#include "../../gettext-runtime/intl/plural.c" #include "../../gettext-runtime/intl/plural-exp.c"