diff options
author | Sam James <sam@gentoo.org> | 2021-10-09 06:03:32 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2021-10-20 01:45:49 +0000 |
commit | b4afce4f330a0ea9eded0dda8dbba28da040b321 (patch) | |
tree | 906b5c28e8f7386a123ecd131c861051c0424472 /dev-util/kbuild | |
parent | sys-libs/liburing: fix build on arm (diff) | |
download | gentoo-b4afce4f330a0ea9eded0dda8dbba28da040b321.tar.gz gentoo-b4afce4f330a0ea9eded0dda8dbba28da040b321.tar.bz2 gentoo-b4afce4f330a0ea9eded0dda8dbba28da040b321.zip |
dev-util/kbuild: workaround build failure with Bison 3.7
Force usage of either byacc or yacc or older-not-in-tree Bison (< 3.7);
it's not enough to just depend on these because we can't really be sure
what kbuild will try to use, especially if a newer Bison is installed
(it'll just try to use it and die).
We choose byacc > yacc > older Bison but allow the user to override
it via the environment if they wish.
Right now, manual intervention seems to be required for people
to install this if, as is likely, users have modern Bison
installed (they'd need to unmerge (ugh!) Bison and then
install byacc or yacc & hope the build system picks it up).
Bug: https://bugs.gentoo.org/734354
Signed-off-by: Sam James <sam@gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/22522
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/kbuild')
-rw-r--r-- | dev-util/kbuild/kbuild-0.1.9998.3499.ebuild | 21 | ||||
-rw-r--r-- | dev-util/kbuild/kbuild-9999.ebuild | 22 |
2 files changed, 40 insertions, 3 deletions
diff --git a/dev-util/kbuild/kbuild-0.1.9998.3499.ebuild b/dev-util/kbuild/kbuild-0.1.9998.3499.ebuild index 574abc5324a7..1679cabf9a2f 100644 --- a/dev-util/kbuild/kbuild-0.1.9998.3499.ebuild +++ b/dev-util/kbuild/kbuild-0.1.9998.3499.ebuild @@ -65,7 +65,26 @@ src_prepare() { } src_compile() { - kBuild/env.sh --full emake -f bootstrap.gmk AUTORECONF=true AR="$(tc-getAR)" \ + if [[ -z ${YACC} ]] ; then + # If the user hasn't picked one, let's prefer byacc > yacc > old bison for now. + # See bug #734354 - bison doesn't work here. + # We can remove this once Bison works again! + if has_version "dev-util/byacc" ; then + export YACC=byacc + elif has_version "dev-util/yacc" ; then + export YACC=yacc + elif has_version "<sys-devel/bison-3.7" ; then + export YACC=bison + else + die "This case shouldn't be possible; no suitable YACC impl installed." + fi + + einfo "Chosen YACC=${YACC} for build..." + else + einfo "Chosen user-provided YACC=${YACC} for build..." + fi + + kBuild/env.sh --full emake -f bootstrap.gmk AUTORECONF=true AR="$(tc-getAR)" YACC="${YACC}" \ || die "bootstrap failed" } diff --git a/dev-util/kbuild/kbuild-9999.ebuild b/dev-util/kbuild/kbuild-9999.ebuild index 92a4a2a25437..942718bd4bf5 100644 --- a/dev-util/kbuild/kbuild-9999.ebuild +++ b/dev-util/kbuild/kbuild-9999.ebuild @@ -67,8 +67,26 @@ src_prepare() { } src_compile() { - kBuild/env.sh --full \ - emake -f bootstrap.gmk AUTORECONF=true AR="$(tc-getAR)" \ + if [[ -z ${YACC} ]] ; then + # If the user hasn't picked one, let's prefer byacc > yacc > old bison for now. + # See bug #734354 - bison doesn't work here. + # We can remove this once Bison works again! + if has_version "dev-util/byacc" ; then + export YACC=byacc + elif has_version "dev-util/yacc" ; then + export YACC=yacc + elif has_version "<sys-devel/bison-3.7" ; then + export YACC=bison + else + die "This case shouldn't be possible; no suitable YACC impl installed." + fi + + einfo "Chosen YACC=${YACC} for build..." + else + einfo "Chosen user-provided YACC=${YACC} for build..." + fi + + kBuild/env.sh --full emake -f bootstrap.gmk AUTORECONF=true AR="$(tc-getAR)" YACC="${YACC}" \ || die "bootstrap failed" } |