构建并安装x86的Brew应用程序
我做完这些之后:
brew安装git
我这样做:
哪个git
其中返回:
在/ usr / local / bin目录/混帐
然后我这样做:
文件/ usr / local / bin / git
其中返回:
/ usr / local / bin / git:Mach-O可执行文件i386
我需要brew来安装为x86_64。
我如何强制brew来构建和安装我的应用程序为x86_64?
brew --config
返回:
HOMEBREW_VERSION: 0.9
HEAD: 1c64a6624ed83ef17af6e98638b8165400e9e908
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.7.4
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A
GCC-4.2: N/A
LLVM: build 2336
Clang: 3.1 build 318
MacPorts or Fink? false
X11: /usr/X11
System Ruby: 1.8.7-357
Which Perl: /usr/bin/perl
Which Python: /usr/bin/python
Which Ruby: /Users/tdewell/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
更新:添加brew --env
$ brew --env
CC: /usr/bin/xcrun gcc-4.2 => /Developer/usr/bin/gcc-4.2
CXX: /usr/bin/xcrun g++-4.2 => /Developer/usr/bin/g++-4.2
LD: /usr/bin/xcrun gcc-4.2 => /Developer/usr/bin/gcc-4.2
CFLAGS: -Os -w -pipe -march=core2 -msse4
CXXFLAGS: -Os -w -pipe -march=core2 -msse4
MAKEFLAGS: -j4
这已经解决了。
我通过App Store安装了Xcode 4.3.2并安装了命令行工具,但是我从几年前就安装了现有的Xcode 3.1。 我搜索了一下,发现了这些命令:
sudo /Developer/Library/uninstall-devtools –mode=all
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
这解决了我的问题,并且在我完成之后,编译器因brew改变了:
$ brew --env
CC: /usr/bin/clang
CXX: /usr/bin/clang++ => /usr/bin/clang
LD: /usr/bin/clang
CFLAGS: -Os -w -pipe -march=native -Qunused-arguments
CXXFLAGS: -Os -w -pipe -march=native -Qunused-arguments
MAKEFLAGS: -j4
brew安装现在好多了:
$ which git
/usr/local/bin/git
$ file /usr/local/bin/git
/usr/local/bin/git: Mach-O 64-bit executable x86_64
尝试
xcode-select --install
链接地址: http://www.djcxy.com/p/10857.html