Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I build mod_jk on Mac OS X Mountain Lion?

I followed the instructions in BUILDING.txt in the native directory and executed

./configure --with-apxs=/usr/sbin/apxs

Here is some of the output

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.

Naturally, I searched StackOverflow for solutions since gcc was not in /usr/bin. So I popped open XCode and installed Command Line Tools. GCC was now in /usr/bin ... but I keep getting the same error.

Any ideas?

like image 825
Adrian Rodriguez Avatar asked Nov 28 '12 00:11

Adrian Rodriguez


1 Answers

After an hour of digging, I finally ran into this post and added my responses that took care of my problem.

So first you need to install Command Line Tools from XCode THEN you have to create this symlink by executing

sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain

This is a problem in the APXS supplied by apple in Mac OS X 10.8. The configure script tries to find the C compiler by executing /usr/sbin/apxs -q CC. The path output is either incorrect OR Apple forgot to create the symlink for you upon install 10.8.

Once you create the symlink, everything will be ok and you'll be able to compile mod_jk

like image 96
Adrian Rodriguez Avatar answered Nov 15 '22 07:11

Adrian Rodriguez