The version of GNU Bison on my mac is 2.3 but I know that Bison 2.5 was released long ago. The book Flex & Bison uses version 2.5.
Should I upgrade to 2.5 myself? Is it necessary?
What's the difference between 2.3 and 2.5?
OS X Lion, also known as Mac OS X Lion, (version 10.7) is the eighth major release of macOS, Apple's desktop and server operating system for Mac computers. Apple Inc.
If you are using zsh
:
$ brew unlink bison
$ echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> ~/.zshrc
$ export LDFLAGS="-L/usr/local/opt/bison/lib"
$ source ~/.zshrc
$ bison -V
bison (GNU Bison) 3.4.1
Written by Robert Corbett and Richard Stallman.
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
So I figured out how to get rid of bison build issues on Mojave and Catalina.
Here's what I did:
$ brew install bison
$ cp /usr/local/opt/bison/bin/bison /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bison
--
Didn't need admin privileges, the cp command will overwrite the bison binary in your Xcode app with the latest one installed by homebrew.
now I can do this:
$ bison -V
bison (GNU Bison) 3.7.1
Been having so many problems building wine on multiple macOS systems running Mojave. Mostly due to this weird need for a library I've never heard of, but this fix got it working.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With