sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain
I did this and tried to make mod_wsgi using Homebrew but it throws a cryptic apxs error. Long story short, I eventually compiled mod_wsgi from source myself, but it continued to through various errors, even though things seemed to be configured properly. I went back to a different Mountain Lion machine I had configured earlier using MacPorts. When I did that machine, I had no problems with mod_wsgi or the need for this toolchain symlink. Examining the Portfile for mod_wsgi gives the key. The missing element is adding the --disable-framework flag to the config file. After that, everything works fine.
This flag should be added to the Homebrew Formula for mod_wsgi. I have never made a Formula before, but maybe one day I will do it. Below is the Gist showing what I did and how it worked.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./configure --with-apxs=/usr/local/Cellar/httpd/2.2.25/sbin/apxs --disable-framework | |
checking Apache version... 2.2.25 | |
checking for python... /usr/local/bin/python | |
configure: creating ./config.status | |
config.status: creating Makefile | |
$ make | |
26 warnings generated. | |
/usr/local/Cellar/httpd/2.2.25/share/apache2/build/libtool --silent --mode=link cc -o mod_wsgi.la -rpath /usr/local/Cellar/httpd/2.2.25/libexec -module -avoid-version mod_wsgi.lo -L/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib -L/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -arch x86_64 -lpython2.7 -ldl -framework CoreFoundation | |
$ make install | |
/usr/local/Cellar/httpd/2.2.25/sbin/apxs -i -S LIBEXECDIR=/usr/local/Cellar/httpd/2.2.25/libexec -n 'mod_wsgi' mod_wsgi.la | |
/usr/local/Cellar/httpd/2.2.25/share/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/Cellar/httpd/2.2.25/share/apache2/build/libtool' mod_wsgi.la /usr/local/Cellar/httpd/2.2.25/libexec | |
/usr/local/Cellar/httpd/2.2.25/share/apache2/build/libtool --mode=install cp mod_wsgi.la /usr/local/Cellar/httpd/2.2.25/libexec/ | |
cp .libs/mod_wsgi.so /usr/local/Cellar/httpd/2.2.25/libexec/mod_wsgi.so | |
cp .libs/mod_wsgi.lai /usr/local/Cellar/httpd/2.2.25/libexec/mod_wsgi.la | |
cp .libs/mod_wsgi.a /usr/local/Cellar/httpd/2.2.25/libexec/mod_wsgi.a | |
chmod 644 /usr/local/Cellar/httpd/2.2.25/libexec/mod_wsgi.a | |
ranlib /usr/local/Cellar/httpd/2.2.25/libexec/mod_wsgi.a | |
---------------------------------------------------------------------- | |
Libraries have been installed in: | |
/usr/local/Cellar/httpd/2.2.25/libexec | |
If you ever happen to want to link against installed libraries | |
in a given directory, LIBDIR, you must either use libtool, and | |
specify the full pathname of the library, or use the `-LLIBDIR' | |
flag during linking and do at least one of the following: | |
- add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable | |
during execution | |
See any operating system documentation about shared libraries for | |
more information, such as the ld(1) and ld.so(8) manual pages. | |
---------------------------------------------------------------------- | |
chmod 755 /usr/local/Cellar/httpd/2.2.25/libexec/mod_wsgi.so | |
$ make clean | |
rm -rf .libs | |
rm -f mod_wsgi.o mod_wsgi.la mod_wsgi.lo mod_wsgi.slo mod_wsgi.loT | |
rm -f config.log config.status | |
rm -rf autom4te.cache |
No comments:
Post a Comment