FWIW, for the Apache issue, it was already documented in the group discussion thread you originally replied to. It said:
""" Try going to: /Applications/Xcode.app/Contents/Developer/Toolchains/ and do: ln -s XcodeDefault.xctoolchain OSX10.8.xctoolchain """ With this in place, the make runs fine. If using the Apple supplied Python you would then get: $ otool -L .libs/mod_wsgi.so .libs/mod_wsgi.so: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) /System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.2) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 744.18.0) If you were to run tool -L on your mod_wsgi.so, I suspect you may see the same, which is why what you are doing can cause problems, because it will be using Python 2.7.2 framework at run time but has been compiled against Python 2.7.3 header files. To summarise, do the following steps: 1. Add symlink for computer tool chain. cd /Applications/Xcode.app/Contents/Developer/Toolchains/ sudo ln -s XcodeDefault.xctoolchain OSX10.8.xctoolchain 2. Building using Apple Python by running mod_wsgi source code: make distclean ./configure --with-python=/usr/bin/python make If /usr/bin/python isn't saying it is 2.7.2, then you have big problems as your Apple supplied Python has been overwritten in some way. Graham On 22 March 2013 10:11, Graham Dumpleton <[email protected]> wrote: > > > > On 22 March 2013 09:30, Ignace Suy <[email protected]> wrote: > >> Hello Graham, >> >> I spend some 10 hours into building the module, got it to work properly >> and was happy to share the info on that with others. Since you took real >> serious effort into my message, here is more info on my challenge, maybe >> this helps you too solve future frustrations on OSX. >> >> in a nutshell: >> >> unpack mod_wsgi 3.4 >> run ./configure (no issues) >> the Makefile created states: >> CPPFLAGS = >> -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 >> -DNDEBUG >> >> lets take a look: >> ignace_air:bin ignace$ cd >> /Library/Frameworks/Python.framework/Versions/2.7/bin >> ignace_air:bin ignace$ ./python >> Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) >> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin >> Type "help", "copyright", "credits" or "license" for more information. >> >>> >> >> there is also another 2.5, 2.6, 2.7 version of python on this system, >> lets take a look: >> ignace_air:mod_wsgi-3.4 ignace$ cd >> /System/Library/Frameworks/Python.framework/Versions/2.7/bin >> ignace_air:bin ignace$ ./python >> Python 2.7.2 (default, Jun 20 2012, 16:23:33) >> [GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on >> darwin >> Type "help", "copyright", "credits" or "license" for more information. >> >>> ^D > > > On a fresh install of MacOS X and XCode there is only > /System/Library/Frameworks/Python.framework and it is version 2.7.2 of > Python. I have a brand new box here that hasn't been setup yet, so know > this to be. :-) > > The version 2.7.3 you have of Python cannot be from Apple and must have > been separately installed. > > There are a number of possibilities for how it could have got there. > > 1. The Python software foundation MacOS X installer for Python was > explicitly installed. > 2. You are using MacPorts, HomeBrew or fink packaging system and have > either explicitly installed it or it was installed as a dependency. > > >> >> > I did not install any python. I assume they came with the OS and with >> Xcode. Cant trace that anymore. I cannot judge which one is 'the best'. >> Basically: i did not choose consciously what python to use, ./configure >> took it. >> > > As I said, you are better off using the Apple one and using the > --with-python option to indicate that if necessary. > > The issue though is whether you system has been mucked up by the alternate > Python installation. > > I want you to run: > > which python > > what is the result of this? Does it say: > > /usr/bin/python > > or something else? > > When you run: > > /usr/bin/python > > and enter at the prompt: > > import sys > print sys.prefix > print sys.version_info > > what do you get? > > Then suggest in mod_sgi source code doing: > > make distclean > ./configure --with-python=/usr/bin/python > > Then send what CPPFLAGS, LDFLAGS and LDLIBS are set to. > > After we sort out this much, can then look at Apache issues next. > > >> If you have additional questions on this, or want me run a test on this >> OSX, now or later, pls feel free. >> >> >> This was NOT my problem. >> >> >> after unpacking and >> ./configure;make >> >> i got: >> /usr/sbin/apxs -c >> -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 >> -DNDEBUG -Wc,'-arch x86_64' mod_wsgi.c -Wl,-F/Library/Frameworks >> -framework Python -u _PyMac_Error -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/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 >> -DNDEBUG -c -o mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo >> mod_wsgi.c:34:10: fatal error: 'httpd.h' file not found >> #include "httpd.h" >> ^ >> 1 error generated. >> apxs:Error: Command failed with rc=65536 >> >> >> oops. where is apache? >> ignace_air:mod_wsgi-3.4 ignace$ sudo find /Library -name httpd.h >> ignace_air:mod_wsgi-3.4 ignace$ sudo find /usr -name httpd.h >> ignace_air:mod_wsgi-3.4 ignace$ sudo find /Applications/Xcode.app/ -name >> httpd.h >> >> /Applications/Xcode.app//Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/apache2/httpd.h >> >> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/apache2/httpd.h >> >> since i cannot find an option in ./configure to change the apache >> includes, i added them to the makefile (i am merely a web developer). i >> realize that apple maybe ditched the apache includes together with the >> hiding of apache in OSX 10.8.2 ... >> >> i ran into the same problems with: >> apr.h >> Availability.h >> >> they are all somewhere under: >> >> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include >> >> this solved the building process for me and i happily started using the >> module. >> As a sidenote: this machine is too new for several >> python-module-combinations :-( , so eventually i had to install linux on >> this hardware. >> >> >> kind regards, Ignace >> >> -- >> You received this message because you are subscribed to the Google Groups >> "modwsgi" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/modwsgi?hl=en. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/modwsgi?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
