2009/2/12 Mara Rinn <[email protected]>:
>
> On Feb 8, 10:57 am, Graham Dumpleton <[email protected]>
> wrote:
>> Version 1.1 of mod_wsgi is quite old now. Why can't you compile from
>> source code? Latest version is mod_wsgi 2.3.
>
> MacPorts is stuck at 1.1, there have been some folks promising to
> package it but nothing happens.
>
> Here's what I've done with mod_wsgi 2 as part of the infrastructure
> for my Django application (I'm trying to get the WSGI service running
> as we speak, but that's not particularly relevant for this thread):
>
> [kla...@gort:/tmp/mod_wsgi-2.3]
> 12:33 [0|2046]% make distclean
> 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
> rm -f Makefile Makefile.in
>
> [kla...@gort:/tmp/mod_wsgi-2.3]
> 12:33 [0|2047]% ./configure
> checking for apxs2... no
> checking for apxs... /usr/sbin/apxs
> checking Apache version... 2.2.9
> checking for python... /usr/bin/python
> configure: creating ./config.status
> config.status: creating Makefile
>
> [kla...@gort:/tmp/mod_wsgi-2.3]
> 12:33 [0|2048]% python -V
> Python 2.5.1
>
> [kla...@gort:/tmp/mod_wsgi-2.3]
> 12:33 [0|2049]% make
> /usr/sbin/apxs -c -I/System/Library/Frameworks/Python.framework/
> Versions/2.5/include/python2.5 -DNDEBUG -DMACOSX -DENABLE_DTRACE  -
> Wc,'-arch ppc7400' -Wc,'-arch ppc64' -Wc,'-arch i386' -Wc,'-arch
> x86_64' mod_wsgi.c -arch ppc7400 -arch ppc64 -arch i386 -arch x86_64 -
> Wl,-F/System/Library/Frameworks -framework Python -u _PyMac_Error -
> framework Python -ldl
> /usr/share/apr-1/build-1/libtool --silent --mode=compile gcc    -
> DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp  -I/usr/include/
> apache2  -I/usr/include/apr-1   -I/usr/include/apr-1  -arch ppc7400 -
> arch ppc64 -arch i386 -arch x86_64 -I/System/Library/Frameworks/
> Python.framework/Versions/2.5/include/python2.5 -DNDEBUG -DMACOSX -
> DENABLE_DTRACE  -c -o mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo
> /usr/share/apr-1/build-1/libtool --silent --mode=link gcc -o
> mod_wsgi.la  -rpath /usr/libexec/apache2 -module -avoid-version
> mod_wsgi.lo -arch ppc7400 -arch ppc64 -arch i386 -arch x86_64 -Wl,-F/
> System/Library/Frameworks -framework Python -u _PyMac_Error -framework
> Python -ldl
>
> [kla...@gort:/tmp/mod_wsgi-2.3]
> 12:34 [0|2050]% sudo make install
> /usr/sbin/apxs -i -S LIBEXECDIR=/usr/libexec/apache2 -n 'mod_wsgi'
> mod_wsgi.la
> /usr/share/httpd/build/instdso.sh SH_LIBTOOL='/usr/share/apr-1/build-1/
> libtool' mod_wsgi.la /usr/libexec/apache2
> /usr/share/apr-1/build-1/libtool --mode=install cp mod_wsgi.la /usr/
> libexec/apache2/
> cp .libs/mod_wsgi.so /usr/libexec/apache2/mod_wsgi.so
> cp .libs/mod_wsgi.lai /usr/libexec/apache2/mod_wsgi.la
> cp .libs/mod_wsgi.a /usr/libexec/apache2/mod_wsgi.a
> ranlib /usr/libexec/apache2/mod_wsgi.a
> chmod 644 /usr/libexec/apache2/mod_wsgi.a
> ----------------------------------------------------------------------
> Libraries have been installed in:
>   /usr/libexec/apache2
>
> 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/libexec/apache2/mod_wsgi.so
>
> [kla...@gort:/tmp/mod_wsgi-2.3]
> 12:38 [0|2061]% otool -L .libs/mod_wsgi.so
> .libs/mod_wsgi.so:
>        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
> version 111.1.3)
>        /System/Library/Frameworks/Python.framework/Versions/2.5/Python
> (compatibility version 2.5.0, current version 2.5.1)
>        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current
> version 1.0.0)

Which all looks perfectly fine given that it picked up standard MacOS
X Python version and not MacPorts version.

Previously you had:

10:42 [0|2002]% ./configure
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
checking for python... /opt/local/bin/python
checking Apache version... 2.2.9
configure: creating ./config.status
config.status: creating Makefile

So you must have have /opt/local/bin in PATH first.

If you really want to use MacPorts Python use:

  ./configure --with-python=/opt/local/bin/python

Just be aware that MacPorts Python distributions, as described in
mod_wsgi wiki page about MacOS X, aren't necessarily all built
correctly and can't be used when Apache runs as 64 bit. To work around
that, you may have to manually removed 64 bit compile options from
generated mod_wsgi Makefile.

What exactly is you want to achieve? The build above would work fine
if wanting to use MacOS X Python 2.5.2 and MacOS X Apache 2.2.9.

Graham

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to