]> granicus.if.org Git - python/commitdiff
- Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify
authorMatthias Klose <doko@ubuntu.com>
Wed, 29 Apr 2009 19:52:49 +0000 (19:52 +0000)
committerMatthias Klose <doko@ubuntu.com>
Wed, 29 Apr 2009 19:52:49 +0000 (19:52 +0000)
  the order that backends for the dbm extension are checked.

configure.in
setup.py

index 2c6cb520e549f612b77cca1000e1e109d66282da..282861a912c93087745a1c57c636cfb000cd810c 100644 (file)
@@ -1921,7 +1921,7 @@ AC_MSG_RESULT($with_system_ffi)
 # Check for --with-dbmliborder
 AC_MSG_CHECKING(for --with-dbmliborder)
 AC_ARG_WITH(dbmliborder,
-            AC_HELP_STRING(--with-dbmliborder=db1:db2:..., order to check db backends for dbm),
+            AC_HELP_STRING([--with-dbmliborder=db1:db2:...], [order to check db backends for dbm. Valid value is a colon separated string with the backend names `ndbm', `gdbm' and `bdb'.]),
 [
 if test x$with_dbmliborder = xyes
 then
index dbac7258b0af5bd53718ef09ed4a336bec2fd043..ff24eec4b4a6d53a7b2f1c37dd8893589d2a2bc2 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1000,13 +1000,14 @@ class PyBuildExt(build_ext):
 
         # The standard Unix dbm module:
         if platform not in ['cygwin']:
-            config_args = sysconfig.get_config_var("CONFIG_ARGS")
-            dbm_args = [arg.split('=')[-1] for arg in args.split()
+            config_args = [arg.strip("'")
+                           for arg in sysconfig.get_config_var("CONFIG_ARGS").split()]
+            dbm_args = [arg.split('=')[-1] for arg in config_args
                         if arg.startswith('--with-dbmliborder=')]
             if dbm_args:
-                dbm_order = "ndbm:gdbm:bdb".split(":")
+                dbm_order = dbm_args[-1].split(":")
             else:
-                dbm_order = dbm_args.split(":")
+                dbm_order = "ndbm:gdbm:bdb".split(":")
             dbmext = None
             for cand in dbm_order:
                 if cand == "ndbm":