Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I've updated to OS X Mountain Lion. Update has removed all of my python and apache modules including mod_wsgi.

Now I'm trying to recompile mod_wsgi (it compiled without problems on Lion).

I use source code from here: http://code.google.com/p/modwsgi/wiki/DownloadTheSoftware?tm=2

./configure creates Makefile without problems:

$ ./configure
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking Apache version... 2.2.22
checking for python... /usr/bin/python
configure: creating ./config.status
config.status: creating Makefile

But make returns error:

$ make
/usr/sbin/apxs -c -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE  -Wc,'-arch x86_64' mod_wsgi.c -Wl,-F/System/Library/Frameworks -framework Python -u _PyMac_Error /System/Library/Frameworks/  -arch x86_64 -ldl  -framework CoreFoundation  
/usr/share/apr-1/build-1/libtool --silent --mode=compile /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc    -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -I/usr/local/include -I/usr/include/apache2  -I/usr/include/apr-1   -I/usr/include/apr-1  -arch x86_64 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE  -c -o mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo
env: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc: No such file or directory
apxs:Error: Command failed with rc=65536
.
make: *** [mod_wsgi.la] Error 1
share|improve this question
add comment

2 Answers 2

up vote 30 down vote accepted

I solved this problem while writting question:

For some reason /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain/ folder (it contains Xcode's comand line utilities) is situated here: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain

To fix it here is the fast solution:

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

Greg Bair suggestion for Mavericks:

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

This creates symlink to the right folder.

share|improve this answer
4  
Should be highlighted that this is an issue with apxs build configuration that Apple supplied as far as I know and nothing to do with mod_wsgi. It came up prior to Mountain Lion being released and someone provided feedback to Apple somehow, but Apple didn't fix it. It is likely that this issue would affect any attempt to build Apache modules using apxs and not just mod_wsgi. –  Graham Dumpleton Jul 29 '12 at 23:50
    
Problem I submited seems to be make utilit related. For some reason it thinks that compiler (gcc) is situated in other folder. It is simply fixable by creating symlink (see my answer for details). sudo make install after that also works. –  Daniil Jul 30 '12 at 3:07
    
Presuming same file location as older MacOS X, the issue is going to be in definitions in /usr/share/httpd/build/config_vars.mk which apxs uses. –  Graham Dumpleton Jul 30 '12 at 3:22
    
As @GrahamDumpleton suggests, this solution also fixes make problems with mod_fastcgi v2.4.6. –  Graham Miln Oct 9 '12 at 13:05
3  
Note that this also works for Mavericks, but it would be $ sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/ /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.9.xctoolchain –  Greg Bair Oct 26 '13 at 14:29
add comment

Ran into the same problem, however creating the symlink did not solve it for me. What did work was adding the flag --disable-framework to the ./configure command. See the gist for more details.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.