我开始在我的mac上使用GNU bison.当我使用时__CODE__,我看到野牛是v2.3,但很久以前野牛得到了2.5升级.本书__CODE__使用2.5版作为工具.我应该自己升级到2.5吗?有必要吗?或者2.3和2.5有什么区别?
小智 16
如果您正在使用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.
Run Code Online (Sandbox Code Playgroud)
你可以用自制软件安装新版本:
$ brew install bison
...
This formula is keg-only, which means it was not symlinked into /usr/local.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
Some formulae require a newer version of bison.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/bison/lib
==> Summary
/usr/local/Cellar/bison/3.0.4: 51 files, 2.2M, built in 74 seconds
Run Code Online (Sandbox Code Playgroud)
但是如果运行:bison -V,它仍将输出2.3,而不是新安装的3.0.4.要强制执行此操作,您可以运行以下命令:
arganzhengs-MacBook-Pro:thrift argan$ brew unlink bison
Unlinking /usr/local/Cellar/bison/3.0.4... 0 symlinks removed
arganzhengs-MacBook-Pro:thrift argan$ brew link bison
Warning: bison is keg-only and must be linked with --force
Note that doing so can interfere with building software.
arganzhengs-MacBook-Pro:thrift argan$ brew link bison --force
Linking /usr/local/Cellar/bison/3.0.4... 9 symlinks created
arganzhengs-MacBook-Pro:thrift argan$ bison -V
bison (GNU Bison) 2.3
Written by Robert Corbett and Richard Stallman.
Copyright (C) 2006 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.
arganzhengs-MacBook-Pro:thrift argan$ source ~/.bash_profile
arganzhengs-MacBook-Pro:thrift argan$ bison -V
bison (GNU Bison) 3.0.4
Written by Robert Corbett and Richard Stallman.
Run Code Online (Sandbox Code Playgroud)
如果你使用Brew:
brew tap homebrew/dupes && brew install bison
Run Code Online (Sandbox Code Playgroud)
如果您使用MacPorts:
sudo port install bison
Run Code Online (Sandbox Code Playgroud)
如果你使用Fink,他们仍然在2.3,就像Apple一样,所以你必须自己编辑包.
如果您知道如何安装Unix软件,请下载它,解压缩,然后像往常一样配置/ make/install.
如果以上所有内容都是希腊语,请查看http://mxcl.github.com/homebrew/和http://macports.org并确定哪一个看起来更友好.
我有同样的问题MacOSX 10.9.5.
做完之后:
brew install bison
Run Code Online (Sandbox Code Playgroud)
我将此添加到我的bash配置文件中:
export PATH=/usr/local/Cellar/bison/3.0.4/bin:$PATH
Run Code Online (Sandbox Code Playgroud)
(当你读到这篇文章时,你的版本可能与3.0.4不同)并且在我重新启动终端后,当我做了它时,它拿起了新版本的Bison bison -V
所以我想出了如何摆脱莫哈韦和卡塔琳娜上的野牛构建问题。
这就是我所做的:
$ brew install bison
$ cp /usr/local/opt/bison/bin/bison /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bison
Run Code Online (Sandbox Code Playgroud)
--
不需要管理员权限,cp 命令将使用 homebrew 安装的最新版本覆盖 Xcode 应用程序中的 bison 二进制文件。
现在我可以这样做:
$ bison -V
bison (GNU Bison) 3.7.1
Run Code Online (Sandbox Code Playgroud)
在多个运行 Mojave 的 macOS 系统上构建 wine 时遇到了很多问题。主要是因为对一个我从未听说过的库的奇怪需求,但这个修复让它工作了。
| 归档时间: |
|
| 查看次数: |
10330 次 |
| 最近记录: |