Brew在MAC OS X Mavericks上安装x86_64(64位)版本

时间:2013-11-14 23:32:40

标签: x86-64 homebrew osx-mavericks

首先,我知道有similar questions但我没有运气,所以决定自己问一个新的。

我正在尝试安装64位版本的pjsip,但我总是最终得到i386版本。

我见过那些brew--env会产生CFLAGS和CXXFLAGS的人,但出于某种原因,我的没有,所以我不知道在哪里设置正确的架构。

$ brew --env
HOMEBREW_CC: clang
HOMEBREW_CXX: clang++
MAKEFLAGS: -j2
CMAKE_PREFIX_PATH: /usr/local
CMAKE_INCLUDE_PATH: /usr/include/libxml2:/System/Library/Frameworks/OpenGL.framework/Versions/Current/Headers
CMAKE_LIBRARY_PATH: /System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries
PKG_CONFIG_LIBDIR: /usr/lib/pkgconfig:/usr/local/Library/ENV/pkgconfig/10.9
ACLOCAL_PATH: /usr/local/share/aclocal
PATH: /usr/local/Library/ENV/4.3:/usr/bin:/bin:/usr/sbin:/sbin

$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 8c19edbdd364200fb2cc9276b0bc49ec4cb98aae
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: dual-core 64-bit penryn
OS X: 10.9-x86_64
Xcode: 5.0.1
CLT: 5.0.1.0.1.1382131676
GCC-4.0: build 5494
Clang: 5.0 build 500
X11: 2.7.4 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /Library/Frameworks/Python.framework/Versions/2.7/bin/python => /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby

我见过人们提到红宝石的版本,我不确定这是否重要,但我的是一个环球版本:

$ file /usr/bin/ruby 
/usr/bin/ruby: Mach-O universal binary with 2 architectures
/usr/bin/ruby (for architecture x86_64):    Mach-O 64-bit executable x86_64
/usr/bin/ruby (for architecture i386):  Mach-O executable i386

1 个答案:

答案 0 :(得分:1)

brew install -v pjsip显示:

==> ./configure --prefix=/usr/local/Cellar/pjsip/2.1
checking build system type... i386-apple-darwin13.0.0
checking host system type... i386-apple-darwin13.0.0
checking target system type... i386-apple-darwin13.0.0

不知何故,它认为我们使用的是64位系统,这很奇怪,因为我肯定在运行64位操作系统。检查arch-host-OS检测代码显示使用arch来确定体系结构。由于一些奇怪的原因,这是报告我们是一个32位系统:

$ arch
i386

在linux下:

$ arch
x86_64

快速解决方案是执行brew edit pjsip,并将第22行更改为:

    system "./configure", "--prefix=#{prefix}", "--host=x86_64-apple-darwin13.0.0", "--target=x86_64-apple-darwin13.0.0", "--host=x86_64-apple-darwin13.0.0"

然后执行brew install pjsip,看起来你有64位pjsip。

可能需要修改配方以获得正确的拱门,而不是仅仅传递--build--host--target选项。