mod_wsgi: compile error on ML, OSX10.8.xctoolchain #13919

2bits opened this Issue Aug 3, 2012 · 6 comments

3 participants


mod_wsgi fails to build on Mountain Lion due to its using /usr/share/apr-1/build-1/libtool to compile and the fact that apr-1 has an invalid path buried in its apr-1-config and libtool files.

/usr/share/apr-1/build-1/libtool --tag=CC --mode=link /usr/bin/clang -o  -rpath /usr/libexec/apache2 -module -avoid-version    mod_wsgi.lo -L/usr/local/lib -Wl,-F/usr/local/Cellar/python/2.7.3/Frameworks -framework Python -u _PyMac_Error -arch x86_64 -ldl -framework CoreFoundation
/Applications/ ${wl}-undefined ${wl}dynamic_lookup -o .libs/ -bundle  .libs/mod_wsgi.o  -L/usr/local/lib -ldl  -Wl,-F/usr/local/Cellar/python/2.7.3/Frameworks -framework Python -arch x86_64 -framework CoreFoundation
/usr/share/apr-1/build-1/libtool: line 4574: /Applications/ No such file or directory
apxs:Error: Command failed with rc=8323072
make: *** [] Error 1

Unlink serf, this can't be fixed easily in the formula because there are no configure variables that can be set. The only known workaround is to symlink the correct toolchain path to the one it's looking for that doesn't exist:

ln -s /Applications/ /Applications/`/Contents/Developer/Toolchains/OSX10.8.xctoolchain/usr/bin/cc

I suppose we could make a requirement for this, but I'm not thrilled by that. I haven't bug reported this to Apple yet. This was originally reported in #13586


I spent several hours banging my head against this yesterday. I was looking for some way to override apr-1-config's values, but they're pretty well baked in.

This might very well be overkill, what about just compiling our own apr? It's fairly lightweight and would allow us to completely route around the botched apr config values in 10.8.

I likely won't be able to get to this today, but it seems worth looking into.


well, apr was easy enough to install, but apxs was still pulling from the original location. So no go on that.


It's probably better not to roll apr and apxs. Homebrew doesn't like to duplicate system software.


Doing a search through regular files to search for "OSX10.8.xctoolchain" turned up several possibly broken apps:


It's possible that editing all those file to be correct would fix this. Dunno.


The two most relevant files are and Changes to are reflected by apxs, but not by apr-1-config.

After fussing with this for a while, I don't know that it's something we can fix without recompiling APR or writing a new makefile which calls the compiler and libtool directly instead of using apxs.

I posted a question on StackOverflow, Changing APR-embedded values returned by apr-1-config?
but I'm not expecting much.

The symlink workaround fixes this, maybe that should just be added to brew doctor?


We've migrated this formula to:

@adamv adamv closed this Sep 7, 2012
@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.