[issue4587] Need to rework the dbm lib/include selection process
Matthias Klose d...@debian.org added the comment: applied on the py3k branch as well -- resolution: - accepted status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4587 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4587] Need to rework the dbm lib/include selection process
Matthias Klose d...@debian.org added the comment: checked in my patch as rev72107 on the trunk. Will apply it for py3k tomorrow. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4587 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4587] Need to rework the dbm lib/include selection process
Matthias Klose d...@debian.org added the comment: here is an updated patch, adding a new configure option --with-dbmliborder, and checking the config args in setup.py. this is the same approach as taken with the --with-system-libffi option. -- nosy: +doko Added file: http://bugs.python.org/file13645/dbmliborder.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4587 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4587] Need to rework the dbm lib/include selection process
Roumen Petrov [EMAIL PROTECTED] added the comment: ok for patch ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4587 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4587] Need to rework the dbm lib/include selection process
Skip Montanaro [EMAIL PROTECTED] added the comment: Thanks Roumen. Can I get a verdict on this approach from one of the main Python developers? I'm thinking a better way to control this would be to add a --flag to the build command to control the search order. -- assignee: - skip.montanaro keywords: +needs review stage: - patch review ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4587 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4587] Need to rework the dbm lib/include selection process
Roumen Petrov [EMAIL PROTECTED] added the comment: About my environment : - one is linux : a) gdbm library, with header gdbm.h, without *ndbm.h b) Berkeley DB many versions but the last is 4.4 I think - other is cross and native(msys) mingw32 environment only Berkeley DB 4.7 I will check later the patch but at first look is expected to fail. Lets see http://svn.python.org/view/python/trunk/Modules/dbmmodule.c?rev=67614view=auto . This module don't include gdbm.h header. I expect linux build to fail with error No ndbm.h available! I could test patch later when I get access to build environment. Did you like I to test what is result (linux build) when header gdbm.h is included in module ? ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4587 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4587] Need to rework the dbm lib/include selection process
Roumen Petrov [EMAIL PROTECTED] added the comment: I confirm my expectation: in case 'elif cand == gdbm:' the if statement for gdbm.h has to be removed. This header don't provide dbm/ndbm compatible structure/function names. If setup is without 'if find_file(gdbm.h...' statement dbm module is build successfully and test_dbm pass. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4587 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4587] Need to rework the dbm lib/include selection process
Skip Montanaro [EMAIL PROTECTED] added the comment: Roumen I confirm my expectation: Roumen in case 'elif cand == gdbm:' the if statement for gdbm.h has to be Roumen removed. This header don't provide dbm/ndbm compatible Roumen structure/function names. Roumen If setup is without 'if find_file(gdbm.h...' statement dbm module is Roumen build successfully and test_dbm pass. Right. Dumb move on my part. New patch attached. Skip Added file: http://bugs.python.org/file12290/setup.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4587 ___Index: setup.py === --- setup.py(revision 67628) +++ setup.py(working copy) @@ -1010,39 +1010,63 @@ # The standard Unix dbm module: if platform not in ['cygwin']: -if find_file(ndbm.h, inc_dirs, []) is not None: -# Some systems have -lndbm, others don't -if self.compiler.find_library_file(lib_dirs, 'ndbm'): -ndbm_libs = ['ndbm'] -else: -ndbm_libs = [] -exts.append( Extension('dbm', ['dbmmodule.c'], - define_macros=[('HAVE_NDBM_H',None)], - libraries = ndbm_libs ) ) -elif self.compiler.find_library_file(lib_dirs, 'gdbm'): -gdbm_libs = ['gdbm'] -if self.compiler.find_library_file(lib_dirs, 'gdbm_compat'): -gdbm_libs.append('gdbm_compat') -if find_file(gdbm/ndbm.h, inc_dirs, []) is not None: -exts.append( Extension( -'dbm', ['dbmmodule.c'], -define_macros=[('HAVE_GDBM_NDBM_H',None)], -libraries = gdbm_libs ) ) -elif find_file(gdbm-ndbm.h, inc_dirs, []) is not None: -exts.append( Extension( -'dbm', ['dbmmodule.c'], -define_macros=[('HAVE_GDBM_DASH_NDBM_H',None)], -libraries = gdbm_libs ) ) -else: -missing.append('dbm') -elif db_incs is not None: -exts.append( Extension('dbm', ['dbmmodule.c'], - library_dirs=dblib_dir, - runtime_library_dirs=dblib_dir, - include_dirs=db_incs, - define_macros=[('HAVE_BERKDB_H',None), - ('DB_DBM_HSEARCH',None)], - libraries=dblibs)) +dbm_order = os.environ.get(PYDBMLIBORDER, + ndbm:gdbm:bdb).split(:) +dbmext = None +for cand in dbm_order: +if cand == ndbm: +if find_file(ndbm.h, inc_dirs, []) is not None: +# Some systems have -lndbm, others don't +if self.compiler.find_library_file(lib_dirs, 'ndbm'): +ndbm_libs = ['ndbm'] +else: +ndbm_libs = [] +print building dbm using ndbm +dbmext = Extension('dbm', ['dbmmodule.c'], + define_macros=[ + ('HAVE_NDBM_H',None), + ], + libraries=ndbm_libs) +break + +elif cand == gdbm: +if self.compiler.find_library_file(lib_dirs, 'gdbm'): +gdbm_libs = ['gdbm'] +if self.compiler.find_library_file(lib_dirs, 'gdbm_compat'): +gdbm_libs.append('gdbm_compat') +if find_file(gdbm/ndbm.h, inc_dirs, []) is not None: +print building dbm using gdbm +dbmext = Extension( +'dbm', ['dbmmodule.c'], +define_macros=[ +('HAVE_GDBM_NDBM_H', None), +], +libraries = gdbm_libs) +break +if find_file(gdbm-ndbm.h, inc_dirs, []) is not None: +print building dbm using gdbm +dbmext = Extension( +'dbm', ['dbmmodule.c'], +define_macros=[ +('HAVE_GDBM_DASH_NDBM_H', None), +], +
[issue4587] Need to rework the dbm lib/include selection process
Changes by Skip Montanaro [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file12275/setup.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4587 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4587] Need to rework the dbm lib/include selection process
New submission from Skip Montanaro [EMAIL PROTECTED]: Fixing issue4483 resulted in adding an extra header file check for gdbm-based header files when the gdbm library was found. This caused problems for Roumen Petrov. In considering the problems he encountered I decided we probably need to provide users some more flexibility when deciding which libraries and header files to use when building the dbm module (or _dbm on 3.0). For example, the current hard-coded perform checks in this order: ndbm, gdbm, BerkDB. What if the system has hdbm installed but the builder wants to use the BerkDB compatibility API? This ticket is to track the discussion and come up with a suitable system. -- messages: 77280 nosy: skip.montanaro severity: normal status: open title: Need to rework the dbm lib/include selection process ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4587 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4587] Need to rework the dbm lib/include selection process
Changes by Skip Montanaro [EMAIL PROTECTED]: -- components: +Build nosy: +rpetrov priority: - normal type: - behavior versions: +Python 2.6, Python 2.7, Python 3.0, Python 3.1 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4587 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4587] Need to rework the dbm lib/include selection process
Skip Montanaro [EMAIL PROTECTED] added the comment: Roumen, can you take a look at (and try) the attached patch? It uses an environment variable, PYDBMLIBORDER to define the order of libraries to check for dbm build suitability. If not specified it defaults to ndbm:gdbm:bdb. -- keywords: +patch Added file: http://bugs.python.org/file12275/setup.diff ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4587 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com