+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.
+
 2020-04-16  Jakub Jelinek  <jakub@redhat.com>
 
        PR bootstrap/92008
 
   gettextP.h \
   hash-string.h \
   loadinfo.h \
+  plural-config.h \
   plural-exp.h \
   eval-plural.h \
   localcharset.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
 
 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
 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
 
 /* 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
 
   { $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
 
   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
 
--- /dev/null
+/* #define USE_BISON3 */
 
 #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
 
 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));
 
 # define __gettextparse PLURAL_PARSE
 #endif
 
-#ifndef HAVE_BISON3
+#ifndef USE_BISON3
 #define YYLEX_PARAM    &((struct parse_args *) arg)->cp
 #define YYPARSE_PARAM  arg
 #endif
                                                   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
 }
 
 
-#ifdef HAVE_BISON3
+#ifdef USE_BISON3
 static int
 yylex (lval, arg)
      YYSTYPE *lval;
 }
 
 
-#ifdef HAVE_BISON3
+#ifdef USE_BISON3
 static void
 yyerror (arg, str)
      struct parse_args *arg;
 
 # define __gettextparse PLURAL_PARSE
 #endif
 
-#ifndef HAVE_BISON3
+#ifndef USE_BISON3
 #define YYLEX_PARAM    &((struct parse_args *) arg)->cp
 #define YYPARSE_PARAM  arg
 #endif
                                                   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
 }
 
 
-#ifdef HAVE_BISON3
+#ifdef USE_BISON3
 static int
 yylex (lval, arg)
      YYSTYPE *lval;
 }
 
 
-#ifdef HAVE_BISON3
+#ifdef USE_BISON3
 static void
 yyerror (arg, str)
      struct parse_args *arg;