如何在Mac OS X Mountain Lion上构建mod_jk?

Adr*_*uez 6 apache macos mod-jk osx-mountain-lion

我按照native目录中的BUILDING.txt中的说明进行操作

./configure --with-apxs=/usr/sbin/apxs
Run Code Online (Sandbox Code Playgroud)

这是一些输出

building connector for "apache-2.0"
checking for gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
Run Code Online (Sandbox Code Playgroud)

当然,我搜索StackOverflow寻求解决方案,因为gcc不在/usr/bin.所以我打开了XCode并安装了命令行工具.GCC现在在/ usr/bin ...但我一直得到同样的错误.

有任何想法吗?

Adr*_*uez 20

经过一个小时的挖掘,我终于遇到了这篇文章,并添加了我的回答来解决我的问题.

首先,您需要从XCode安装命令行工具,然后您必须通过执行来创建此符号链接

sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain
Run Code Online (Sandbox Code Playgroud)

这是Apple在Mac OS X 10.8中提供的APXS中的问题.configure脚本尝试通过执行来查找C编译器/usr/sbin/apxs -q CC.路径输出不正确或Apple在安装10.8时忘记为您创建符号链接.

一旦你创建了符号链接,一切都会好的,你就可以编译mod_jk了