|
Graham Dumpleton
graham.dumpleton at gmail.com
Mon Apr 20 03:05:24 EDT 2009
2009/4/18 Eeswar Kameswara Rao <eeswar at pbsystems.com>: > Currently how things look on my system > -------------------------------------------------- > SRC/MAKEFILE > > CC=gcc > AR=ar > APXS=/usr/sbin/apxs > MKDEP=@MKDEP@ > > # requires flex 2.5.31 for reentrant support > LEX=/usr/bin/flex > INCLUDES=-I/Users/Tool/mod_python-3.3.1/src/include -I/usr/include/apache2 -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 > LIBS=-lm -framework Python -ldl > LDFLAGS= -Wl,-framework,Python -u _PyMac_Error -framework Python -Wl,-F/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5 -arch i386 LDFLAGS is wrong. It should be something like: LDFLAGS = -F/System/Library/Frameworks -framework Python -u _PyMac_Error As I said before, you are better off checking out latest version from subversion repository rather than fudging it yourself. Your changes aren't going to cover all places where fixes are required and in particular PSP support may not work if you need this to be working under multiple architectures at some point. Graham > OPT= > CFLAGS=$(OPT) $(INCLUDES) -arch i386 > CPPFLAGS = -I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 -DNDEBUG -DMACOSX -DENABLE_DTRACE > srcdir=. > > SRCS= mod_python.c _apachemodule.c requestobject.c tableobject.c util.c \ > serverobject.c connobject.c filterobject.c hlist.c \ > hlistobject.c finfoobject.c > > all: dso > > psp_parser.c: psp_parser.l > @rm -f psp_parser.c > $(LEX) -R -opsp_parser.c --header-file=include/psp_flex.h psp_parser.l > > dso: mod_python.so > @echo dso > .install > > mod_python.so: $(SRCS) > @echo > @echo 'Compiling for DSO.' > @echo > $(APXS) $(INCLUDES) -c -Wc,"-arch i386" $(SRCS) $(LDFLAGS) $(LIBS) > @rm -f mod_python.so > @ln -s .libs/mod_python.so mod_python.so > clean: > rm -rf $(OBJS) core libpython.a mod_python.so *~ .libs *.o *.slo *.lo *.la > > distclean: clean > rm -f Makefile .depend .install > > # this is a hack to help avoid a gcc/solaris problem > # python uses assert() which needs _eprintf(). See > # SOLARIS_HACKS above > _eprintf.o: > ar -x `gcc -print-libgcc-file-name` _eprintf.o > _floatdidf.o: > ar -x `gcc -print-libgcc-file-name` _floatdidf.o > _muldi3.o: > ar -x `gcc -print-libgcc-file-name` _muldi3.o > > # DO NOT DELETE THIS LINE > > > Symlink 'Current' status > -------------------------------------------- > #####Initally > > 0 drwxr-xr-x 9 root wheel 306 Oct 14 2008 2.3 > 0 drwxr-xr-x 11 root wheel 374 Mar 13 15:06 2.5 > 8 lrwxrwxrwx 1 root wheel 3 Oct 14 2008 Current -> 2.3 > > ##MeanWhile to Configure mod_python > drwxr-xr-x 9 root wheel 306 Oct 14 2008 2.3 > drwxrwxrwx 11 root wheel 374 Mar 13 15:06 2.5 > lrwxr-xr-x 1 root wheel 3 Apr 18 11:36 Current -> 2.5 > lrwxrwxrwx 1 root wheel 3 Oct 14 2008 Current_bak_18_APR -> 2.3 > > ##After creating mod_python Reset back to 2.3. So, Finally > 0 drwxr-xr-x 9 root wheel 306 Oct 14 2008 2.3 > 0 drwxr-xr-x 11 root wheel 374 Mar 13 15:06 2.5 > 8 lrwxrwxrwx 1 root wheel 3 Oct 14 2008 Current -> 2.3 > 8 lrwxr-xr-x 1 root wheel 3 Apr 18 11:36 Current2.5 -> 2.5 > > > Regards, > Eeswar > > > ________________________________________ > From: Eeswar Kameswara Rao > Sent: Saturday, April 18, 2009 1:35 PM > To: Graham Dumpleton > Cc: mod_python at modpython.org > Subject: RE: [mod_python] mod_python: How-to Resolve Python Version conflicts > > Thank you Graham for the immediate response. > > Sorry I could not reply immediately. > I have actually figured the solution and fell asleep (work in a different time zone). > > I missed to mention the following facts: - > 1. I have two different users for each of the Python versions > 2. One user runs on Python 2.5.1 and another user on Python 2.3.5 > 3. I run Mac OSX 10.5.6 with latest updates > 4. For each of the users the default python PATHS are setup so that each gets his/her own version of python at command prompt > > > Changes I made to make Python 2.5 and 2.3 co-exist without interfering with each other > ------------------------------------------------------------------------------------------------------------ > 1. I modified the symlink /System/Library/Frameworks/Python/Versions/Current point to 2.5 > 2. Then redid the following > ./configure --with-ptyhon=/usr/bin/python2.5 > Modified the paths in Makefile to point to Python2.5 > Added '-arch i386' options wherever required in the Makefile > make && sudo make install > www:src Tool$ otool -L mod_python.so >> mod_python.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) >> www:src Tool$ file mod_python.so >> mod_python.so: Mach-O bundle i386 > > I have reset the symlink Current to 2.3. |