The patch submitted last night had a typo (missing comma) in it. The corrected version is attached.

Jim

Jim Gallacher wrote:
I found a couple of errors in dist/setup.py.in. The attached patch should fix the problems.

Changes:

1. The regular expression used by the getconfigure_option function to search the config.status file for the requested option was incorrect. Possibly a cross platform difference in the way configure generates config.status? Made the re more forgiving of a lack of spaces in the compiled pattern.

2. Corrected an indent error in the getconfigure_option function. The raise AssertionError call was an inside the loop interating over config.status file so only the first line was examined. Move it outside the loop.

3. Corrected class ModPyExtension to make it more cross platform. It was using libraries specific to Windows. Changed to make it linux friendly.

Regards,
Jim


Index: setup.py.in
===================================================================
--- setup.py.in (revision 169406)
+++ setup.py.in (working copy)
@@ -39,12 +39,12 @@
     if not os.path.exists(config_status_file):
         raise AssertionError("config.status not found in expected location 
(%s)" % config_status_file)
     header = open(config_status_file, 'r')
-    r = re.compile('s, @%s@, (?P<OPTION_STRING>[^,]+), ' % (option_name))
+    r = re.compile(r's,[EMAIL PROTECTED]@,\s*(?P<OPTION_STRING>[^,]+),\s*' % 
(option_name))
     for line in header.readlines():
         m = r.search(line)
         if m is not None:
             return m.group('OPTION_STRING')
-        raise AssertionError("unable to find @%s@ definition in %s", 
(option_name, config_status_file))
+    raise AssertionError("unable to find @%s@ definition in %s", (option_name, 
config_status_file))
 
 def getmp_version():
     """finds out the version of mod_python"""
@@ -120,10 +120,15 @@
 class ModPyExtension(Extension):
     """a class that actually builds the mod_python.so extension for Apache 
(yikes)"""
     def __init__(self, source_dir, include_dirs, library_dirs):
+        if winbuild:
+            libraries = ['libhttpd', 'libapr', 'libaprutil', 'ws2_32']
+        else:
+            libraries = ['apr-0', 'aprutil-0']
+
         Extension.__init__(self, "mod_python_so",
             sources = [os.path.join(source_dir, source_file) for source_file 
in modpy_src_files],
                            include_dirs=include_dirs,
-            libraries = ['libhttpd', 'libapr', 'libaprutil', 'ws2_32'],
+            libraries = libraries,
             library_dirs=library_dirs
                            )
         if winbuild:

Reply via email to