[mod_python] Compile problems - Mod_Python 3.1.4

Jim Gallacher jg.lists at sympatico.ca
Tue May 10 01:09:15 EDT 2005


Frank,

I may have been a little premature with the solution I offered. The 
problem I found in setup.py is in the subversion trunk version, not in 
the mod_python 3.1.4 tarball. If you are compiling from the tarball then 
your problems may lie elsewhere. If you are using the svn repository, 
then the attached patch should fix your problems.

Changes:
Fixed regular expression problem in getconfigure_option()
Fixed indent problem in getconfigure_option()
Fixed incorrect libraries list in ModPyExtension. List was specific to 
windows.

(Nicolas - I'll email the patch to python-dev in a separate message).

Regards,
Jim

Nicolas Lehuen wrote:
> Did you try :
> 
> r = re.compile(r's,\s*@%s@,\s*(?P<OPTION_STRING>[^,]+),\s*' % (option_name))
> 
> Notice the "r" just before the quote to toggle the regular expression
> string mode.
> 
> Regards,
> Nicolas
> 
> 2005/5/9, Jim Gallacher <jg.lists at sympatico.ca>:
> 
>>Frank,
>>
>>Frank Gruman wrote:
>>
>>>Nicolas,
>>>
>>>The script you are running is automatically included as part of the make
>>>process on Linux.
>>>
>>>But I am willing to try anything...
>>
>>OK, here's something. :)
>>
>>
>>>Running the script with the method you specify returns the same ending
>>>error code that I found earlier (about the APXS definition not found).
>>>Thanks for the idea, though.
>>>
>>>Anyone have any idea why the setup.py script is not able to pass the
>>>APXS value from config.status back to setup.py (getconfigure_option
>>>function).  I have verified that there is a value assigned in
>>>config.status (/usr/local/apache2/bin/apxs).
>>
>>I think there is a problem with the regular expression which searches
>>for APXS in config.status. (I'm getting the same error on Debian as you
>>are on SLES).
>>
>>Setup.py is using the following re:
>>r = re.compile('s, @%s@, (?P<OPTION_STRING>[^,]+), ' % (option_name))
>>
>>While my config.status output looks like this:
>>s, at APXS@,/usr/bin/apxs2,;t t
>>
>>Notice the lack of spaces after the commas? I wonder if the output of
>>configure is somehow platform dependant, which is why Nicolas has not
>>seen a problem?
>>
>>I've been trying to tweak the re to make it work, but so far it's mainly
>>been an exercise in banging head against the monitor. (Somebody really
>>should come up with a padded monitor - they'd make a fortune). I both
>>love and hate regular expressions at the same time.
>>
>>Anyway, as a quick fix you could apply the following patch to
>>setup.py.in, and do the configure + make cycle again.
>>
>>Index: setup.py.in
>>===================================================================
>>--- setup.py.in (revision 169349)
>>+++ setup.py.in (working copy)
>>@@ -62,7 +62,8 @@
>>
>>  def getapxs_location():
>>      """finds the location of apxs from the config.status file"""
>>-    return getconfigure_option("APXS")
>>+    #return getconfigure_option("APXS")
>>+    return '/usr/local/apache2/bin/apxs'
>>
>>  def getapxs_option(option):
>>      APXS = getapxs_location()
>>
>>Also, I don't know if you resolved the psp_flex issue, but the
>>src/Makefile.in hard codes LEX=/usr/local/bin/flex, which fails on my
>>system since flex is located in /usr/bin. A quick edit of the Makefile
>>took care of that for me.
>>
>>If your luck is anything like mine the next thing you'll have to deal
>>with is the linker not finding libapr.
>>
>>Personally, I've avoided these issues by using the setup.py included
>>with Debian, even when compiling from the svn trunk.
>>
>>Regards,
>>Jim
>>
>>
>>
>>>Oh - also realized I didn't provide OS - SLES 9.
>>>
>>>Regards,
>>>Frank
>>>
>>>Nicolas Lehuen wrote:
>>>
>>>
>>>>Hi,
>>>>
>>>>Just a wild guess, as I'm building under Win32... Did you try :
>>>>
>>>>python setup.py install
>>>>
>>>>?
>>>>
>>>>This works under Win32.
>>>>
>>>>Regards,
>>>>
>>>>Nicolas
>>>>
>>>>2005/5/9, Frank Gruman <fgatwork at verizon.net>:
>>>>
>>>>
>>>>
>>>>>Hello all,
>>>>>
>>>>>I am trying to test the latest Apache dev version, and found an issue when trying to compile mod_python 3.1.4 with it.
>>>>>
>>>>>I originally tired using Apache 2.1.5-dev (from tip on Friday, 06-May) with mod_python 3.1.4 and Python 2.4.1.  When this failed, I thought that there might have been a resolution in the current mod_python tip, so pulled the mod_python tip as of 09-May @ 13:00.  Still ran into the same errors.
>>>>>
>>>>>The system goes through the ./configure without any issues.  Please see the steps / output below.  It gets quite long, so please bear with me.
>>>>>
>>>>>*  Configure *****************************************
>>>>>toybox:/sources/mod_python-3.1.4 # ./configure --with-apxs=/usr/local/apache2/bin/apxs
>>>>>checking for gcc... gcc
>>>>>checking for C compiler default output... a.out
>>>>>checking whether the C compiler works... yes
>>>>>checking whether we are cross compiling... no
>>>>>checking for suffix of executables...
>>>>>checking for suffix of object files... o
>>>>>checking whether we are using the GNU C compiler... yes
>>>>>checking whether gcc accepts -g... yes
>>>>>checking for ar... ar
>>>>>checking for a BSD-compatible install... /usr/bin/install -c
>>>>>checking whether make sets ${MAKE}... yes
>>>>>checking for main in -lm... yes
>>>>>checking for gcc option to accept ANSI C... none needed
>>>>>checking for an ANSI C-conforming const... yes
>>>>>checking your blood pressure... a bit high, but we can proceed
>>>>>configure: checking whether apxs is available...
>>>>>checking for --with-apxs... /usr/local/apache2/bin/apxs executable, good
>>>>>checking Apache version... 2.1.5-dev
>>>>>checking for Apache libexec directory... /usr/local/apache2/modules
>>>>>checking for Apache include directory... -I/usr/local/apache2/include
>>>>>checking for --with-python... no
>>>>>checking for python... /usr/bin/python
>>>>>checking Python version... 2.4
>>>>>checking Python install prefix... /usr
>>>>>checking for Py_NewInterpreter in -lpython2.4... yes
>>>>>checking what libraries Python was linked with... -lpython2.4   -lpthread -ldl  -lutil   -lm
>>>>>checking linker flags used to link Python...
>>>>>checking where Python include files are... -I/usr/include/python2.4
>>>>>configure: creating ./config.status
>>>>>