summaryrefslogtreecommitdiff
path: root/gettext-runtime
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-08-01 17:25:10 +0200
committerBruno Haible <bruno@clisp.org>2020-08-01 17:26:25 +0200
commitad3bbee2d98fab6c1e2f132394ca5565a7dae678 (patch)
treefa28fa6bc70a2f5d8b08e40b3b531b75e4716ffb /gettext-runtime
parent7cf68dffb2adb76375bfb0781e277510523a1f3e (diff)
downloadgettext-ad3bbee2d98fab6c1e2f132394ca5565a7dae678.tar.gz
Fix build failure with bison 3.7. Revisit bison Makefile rules.
* gettext-runtime/intl/Makefile.am ($(srcdir)/plural.c): Keep and distribute the plural.h file. Don't use --output option. * gettext-tools/src/Makefile.am (YACC): Removed unused variable. (po-gram-gen.c, po-gram-gen.h): Correct the #line statements in the generated files. (po-gram-gen2.h): Likewise. (cldr-plural.c, cldr-plural.h): Likewise.
Diffstat (limited to 'gettext-runtime')
-rw-r--r--gettext-runtime/intl/Makefile.am27
1 files changed, 19 insertions, 8 deletions
diff --git a/gettext-runtime/intl/Makefile.am b/gettext-runtime/intl/Makefile.am
index 22de832e9..d3fa63fc6 100644
--- a/gettext-runtime/intl/Makefile.am
+++ b/gettext-runtime/intl/Makefile.am
@@ -70,8 +70,9 @@ AM_CPPFLAGS += \
-DDEPENDS_ON_LIBICONV=1
BISON = @INTLBISON@
-YACC = $(BISON) -d
BISONFLAGS = --name-prefix=__gettext
+# Just to shut up Automake "error: Yacc source seen but 'YACC' is undefined".
+YACC = $(BISON) -d
# Tell the ELF linker which symbols to export.
AM_CFLAGS = @CFLAG_VISIBILITY@
@@ -321,19 +322,29 @@ MOSTLYCLEANFILES += localename-table.h
# script.
# Additionally, here we need a rule that works even without a VPATH variable.
# Therefore we override this rule.
+# Note: There is no point in using Bison's --output option, since we need to
+# postprocess the generated files and we don't want that unpostprocessed files
+# remain in place if the user interrupts the build through Ctrl-C.
$(srcdir)/plural.c: $(srcdir)/plural.y
- $(AM_V_YACC)$(YACC) $(BISONFLAGS) --output plural.c $(srcdir)/plural.y \
+ $(AM_V_YACC)$(BISON) -d $(BISONFLAGS) $(srcdir)/plural.y \
&& test ':' = '$(BISON)' || { \
- 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; \
+ sed -e 's|".*/plural.y"|"plural.y"|' \
+ -e 's|"plural\.tab\.c"|"plural.c"|' \
+ -e 's|"plural\.tab\.h"|"plural.h"|' \
+ < plural.tab.c > plural.c-tmp \
+ && sed -e 's|".*/plural.y"|"plural.y"|' \
+ -e 's|"plural\.tab\.h"|"plural.h"|' \
+ < plural.tab.h > plural.h-tmp \
+ && rm -f plural.tab.c plural.tab.h \
+ && mv plural.c-tmp $(srcdir)/plural.c \
+ && mv plural.h-tmp $(srcdir)/plural.h; \
}
# Don't put plural.c into BUILT_SOURCES. Since plural.c is in the source
# directory, 'make' does not find it without a VPATH variable.
-MOSTLYCLEANFILES += plural.c-tmp
-MAINTAINERCLEANFILES += plural.c
-EXTRA_DIST += plural.c
+MOSTLYCLEANFILES += plural.tab.c plural.tab.h plural.c-tmp plural.h-tmp
+MAINTAINERCLEANFILES += plural.c plural.h
+EXTRA_DIST += plural.c plural.h
# Rules for compiling a .c file, that work even without a VPATH variable.
bindtextdom.lo: $(srcdir)/bindtextdom.c