1

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

我正在尝试 brew 安装 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

我见过人们提到 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
4

1 回答 1

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

快速解决方案是执行 a 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"

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

可能可以通过编辑配方来获得正确的拱门来修复,而不仅仅是传递--build,--host--target选项。

于 2013-11-15T00:04:40.460 回答