diff --git a/contrib/ChangeLog b/contrib/ChangeLog index ab9254baac27826fdd3f3ae25aaa7afa2e05db07..7efe9a4956ea73f656dc993d5c5a1286f4e4b42b 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,8 @@ +2020-04-16 Jakub Jelinek <jakub@redhat.com> + + PR bootstrap/92008 + * gcc_update: Add intl/plural.y dependency for intl/plural-config.h. + 2020-04-03 Martin Liska <mliska@suse.cz> * gcc-git-customization.sh: Search for the pattern diff --git a/contrib/gcc_update b/contrib/gcc_update index 8c980b15ad36524e76186c1bc3790f0e7c362f99..5e8af0e9a7c529a8eebfc22c29c6c6c40830f2d2 100755 --- a/contrib/gcc_update +++ b/contrib/gcc_update @@ -72,6 +72,7 @@ fixincludes/configure: fixincludes/configure.ac fixincludes/aclocal.m4 fixincludes/config.h.in: fixincludes/configure.ac fixincludes/aclocal.m4 # intl library intl/plural.c: intl/plural.y +intl/plural-config.h: intl/plural.y intl/configure: intl/configure.ac intl/aclocal.m4 intl/config.h.in: intl/configure.ac intl/aclocal.m4 # Now, proceed to gcc automatically generated files diff --git a/intl/ChangeLog b/intl/ChangeLog index a3762f81f566ca1a963f737ff456d951c82632e6..e8f0d36d20267408a9717957f5d001cccffd767b 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,5 +1,20 @@ 2020-04-16 Jakub Jelinek <jakub@redhat.com> + PR bootstrap/92008 + * configure.ac: Remove HAVE_BISON3 AC_DEFINE. + * Makefile.in (HEADERS): Add plural-config.h. + (.y.c): Also create plural-config.h. + (dcigettext.o loadmsgcat.o plural.o plural-exp.o): Also depend + on plural-config.h. + (plural-config.h): Depend on plural.c. + * plural-exp.h: Include plural-config.h. Use USE_BISON3 instead + of HAVE_BISON3. + * plural.y: Use USE_BISON3 instead of HAVE_BISON3. + * configure: Regenerated. + * plural.c: Regenerated. + * config.h.in: Regenerated. + * plural-config.h: Generated. + PR bootstrap/92008 * configure.ac: Add check for bison >= 3, AC_DEFINE HAVE_BISON3 and AC_SUBST BISON3_YES and BISON3_NO. diff --git a/intl/Makefile.in b/intl/Makefile.in index bdb74ebb78c6af4be5fad7f37f31fd7fd5f13d72..356c8ab9b653d568d1d17dcf0bc3a07dc7ed589f 100644 --- a/intl/Makefile.in +++ b/intl/Makefile.in @@ -57,6 +57,7 @@ HEADERS = \ gettextP.h \ hash-string.h \ loadinfo.h \ + plural-config.h \ plural-exp.h \ eval-plural.h \ localcharset.h \ @@ -133,10 +134,12 @@ libintl.h: $(srcdir)/libgnuintl.h $(COMPILE) $< .y.c: +@BISON3_YES@ echo '#define USE_BISON3' > $(patsubst %.c,%-config.h,$@) @BISON3_YES@ sed 's,%pure_parser,,;s,^/\* BISON3 \(.*\) \*/$$,\1,' $< > $@.y @BISON3_YES@ $(YACC) $(YFLAGS) --output $@.c $@.y @BISON3_YES@ sed 's/\.c\.y"/.y"/' $@.c > $@ @BISON3_YES@ rm -f $@.c $@.y $@.h +@BISON3_NO@ echo '/* #define USE_BISON3 */' > $(patsubst %.c,%-config.h,$@) @BISON3_NO@ $(YACC) $(YFLAGS) --output $@ $< rm -f $*.h @@ -165,7 +168,7 @@ dngettext.o finddomain.o gettext.o intl-compat.o loadmsgcat.o \ localealias.o ngettext.o textdomain.o: gettextP.h gmo.h loadinfo.h dcigettext.o loadmsgcat.o: hash-string.h explodename.o l10nflist.o: loadinfo.h -dcigettext.o loadmsgcat.o plural.o plural-exp.o: plural-exp.h +dcigettext.o loadmsgcat.o plural.o plural-exp.o: plural-exp.h plural-config.h dcigettext.o: eval-plural.h localcharset.o: localcharset.h localealias.o localcharset.o relocatable.o: relocatable.h @@ -242,6 +245,8 @@ $(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps) config.h: stamp-h1 test -f config.h || (rm -f stamp-h1 && $(MAKE) stamp-h1) +plural-config.h: plural.c + stamp-h1: $(srcdir)/config.h.in config.status -rm -f stamp-h1 $(SHELL) ./config.status config.h diff --git a/intl/config.h.in b/intl/config.h.in index 87738c0aad2398cdc6867e63fe45cdb80e2b2db0..9c9b53dc0eac8b7cb63b7e1cc83f3f6ec16200c5 100644 --- a/intl/config.h.in +++ b/intl/config.h.in @@ -28,9 +28,6 @@ /* Define to 1 if you have the <argz.h> header file. */ #undef HAVE_ARGZ_H -/* Define if bison 3 or later is used. */ -#undef HAVE_BISON3 - /* Define if the GNU dcgettext() function is already present or preinstalled. */ #undef HAVE_DCGETTEXT diff --git a/intl/configure b/intl/configure index 58cee2983a5b1daf1939e994deaaf3367366b778..d69767b7d2190f772fb7954f77f613ec2d369a1f 100755 --- a/intl/configure +++ b/intl/configure @@ -6808,9 +6808,6 @@ $as_echo_n "checking bison 3 or later... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5 $as_echo "$ac_prog_version" >&6; } if test $ac_bison3 = yes; then - -$as_echo "#define HAVE_BISON3 1" >>confdefs.h - BISON3_YES= BISON3_NO='#' fi diff --git a/intl/configure.ac b/intl/configure.ac index b11033712bc589f9993cafb86d4b8e3f8fc8a8b2..6363e55e68a9c40ee4beca2b47bd45e985747682 100644 --- a/intl/configure.ac +++ b/intl/configure.ac @@ -62,7 +62,6 @@ changequote([,])dnl esac AC_MSG_RESULT([$ac_prog_version]) if test $ac_bison3 = yes; then - AC_DEFINE(HAVE_BISON3, 1, [Define if bison 3 or later is used.]) BISON3_YES= BISON3_NO='#' fi diff --git a/intl/plural-config.h b/intl/plural-config.h new file mode 100644 index 0000000000000000000000000000000000000000..53bbd11078e27fab8bf0109fedd3cfc839b80b08 --- /dev/null +++ b/intl/plural-config.h @@ -0,0 +1 @@ +/* #define USE_BISON3 */ diff --git a/intl/plural-exp.h b/intl/plural-exp.h index e27c28050937889cf5a8595406da0649e6061b94..2dbb104099efaa0188aa52a910697a95ce10e3d9 100644 --- a/intl/plural-exp.h +++ b/intl/plural-exp.h @@ -20,6 +20,8 @@ #ifndef _PLURAL_EXP_H #define _PLURAL_EXP_H +#include <plural-config.h> + #ifndef PARAMS # if __STDC__ || defined __GNUC__ || defined __SUNPRO_C || defined __cplusplus || __PROTOTYPES # define PARAMS(args) args @@ -111,7 +113,7 @@ struct parse_args extern void FREE_EXPRESSION PARAMS ((struct expression *exp)) internal_function; -#ifdef HAVE_BISON3 +#ifdef USE_BISON3 extern int PLURAL_PARSE PARAMS ((struct parse_args *arg)); #else extern int PLURAL_PARSE PARAMS ((void *arg)); diff --git a/intl/plural.c b/intl/plural.c index ad86faa89ce325928dffb05c1f35b3fbf84b7e2f..f9a8faa783883269f35e7c6becfdf93da07bdaba 100644 --- a/intl/plural.c +++ b/intl/plural.c @@ -59,7 +59,7 @@ # define __gettextparse PLURAL_PARSE #endif -#ifndef HAVE_BISON3 +#ifndef USE_BISON3 #define YYLEX_PARAM &((struct parse_args *) arg)->cp #define YYPARSE_PARAM arg #endif @@ -89,7 +89,7 @@ static inline struct expression *new_exp_3 PARAMS ((enum operator op, struct expression *bexp, struct expression *tbranch, struct expression *fbranch)); -#ifdef HAVE_BISON3 +#ifdef USE_BISON3 static int yylex PARAMS ((YYSTYPE *lval, struct parse_args *arg)); static void yyerror PARAMS ((struct parse_args *arg, const char *str)); #else @@ -1372,7 +1372,7 @@ FREE_EXPRESSION (exp) } -#ifdef HAVE_BISON3 +#ifdef USE_BISON3 static int yylex (lval, arg) YYSTYPE *lval; @@ -1526,7 +1526,7 @@ yylex (lval, pexp) } -#ifdef HAVE_BISON3 +#ifdef USE_BISON3 static void yyerror (arg, str) struct parse_args *arg; diff --git a/intl/plural.y b/intl/plural.y index c97f09a6f697429021591e8a78a3774a6d181fad..7531da5a7b2ec26bab832a466febabc0cb5fcb69 100644 --- a/intl/plural.y +++ b/intl/plural.y @@ -40,7 +40,7 @@ # define __gettextparse PLURAL_PARSE #endif -#ifndef HAVE_BISON3 +#ifndef USE_BISON3 #define YYLEX_PARAM &((struct parse_args *) arg)->cp #define YYPARSE_PARAM arg #endif @@ -71,7 +71,7 @@ static inline struct expression *new_exp_3 PARAMS ((enum operator op, struct expression *bexp, struct expression *tbranch, struct expression *fbranch)); -#ifdef HAVE_BISON3 +#ifdef USE_BISON3 static int yylex PARAMS ((YYSTYPE *lval, struct parse_args *arg)); static void yyerror PARAMS ((struct parse_args *arg, const char *str)); #else @@ -266,7 +266,7 @@ FREE_EXPRESSION (exp) } -#ifdef HAVE_BISON3 +#ifdef USE_BISON3 static int yylex (lval, arg) YYSTYPE *lval; @@ -420,7 +420,7 @@ yylex (lval, pexp) } -#ifdef HAVE_BISON3 +#ifdef USE_BISON3 static void yyerror (arg, str) struct parse_args *arg;