summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-04-16 11:55:00 +0200
committerJakub Jelinek <jakub@redhat.com>2020-04-16 11:55:00 +0200
commit437eea66a4b010d8e94aa81c2b40ccf0588e5fab (patch)
tree81c209397de5b0ca4f5a413e13702de9ac94bd97 /contrib
parentbd87b1fddbbe7d424671ebf81c96e12d748fafc7 (diff)
intl: Unbreak intl build with bison 3 when no regeneration is needed [PR92008]
As Iain reported, my change broke the case when one has bison >= 3, but make decides there is no reason to regenerate plural.c, unfortunately that seems to be a scenario I haven't tested. The problem is that the pregenerated plural.c has been generated with bison 1.35, but when config.h says HAVE_BISON3, the code assumes it is the bison3 variant. What used to work fine is when one has bison >= 3 and plural.c has been regenerated (e.g. do touch intl/plural.y and it will work), or when one doesn't have any bison (then nothing is regenerated, but HAVE_BISON3 isn't defined either), or when one has bison < 3 and doesn't need to regenerate, or when one has bison < 3 and it is regenerated. The following patch fixes this, by killing the HAVE_BISON3 macro from config.h, and instead remembering the fact whether plural.c has been created with bison < 3 or bison >= 3 in a separate new plural-config.h header. The way this works: - user doesn't have bison - user has bison >= 3, but intl/{plural-config.h,plural.c} aren't older than intl/plural.y - user has bison < 3, but intl/{plural-config.h,plural.c} aren't older than intl/plural.y pregenerated !USE_BISON3 plural.c and plural-config.h from source dir is used, nothing in the objdir - user has bison >= 3 and intl/plural.y is newer Makefile generates plural.c and USE_BISON3 plural-config.h in the objdir, which is then used in preference to srcdir copies - user has bison < 3 and intl/plural.y is newer Makefile generates plural.c and !USE_BISON3 plural-config.h in the objdir, which is then used in preference to srcdir copies I have tested all these cases and make all-yes worked in all the cases. If one uses the unsupported ./configure where srcdir == objdir, I guess (though haven't tested) that it should still work, just it would be nice if such people didn't try to check in the plural{.c,-config.h} they have regenerated. What doesn't work, but didn't work before either (just tested gcc-9 branch too) is when one doesn't have bison and plural.y is newer than plural.c. Don't do that ;) 2020-04-16 Jakub Jelinek <jakub@redhat.com> PR bootstrap/92008 intl/ * 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. contrib/ * gcc_update: Add intl/plural.y dependency for intl/plural-config.h.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ChangeLog5
-rwxr-xr-xcontrib/gcc_update1
2 files changed, 6 insertions, 0 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index ab9254baac2..7efe9a4956e 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 8c980b15ad3..5e8af0e9a7c 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