This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rpetrov
Recipients AndyP, flub, legerf, rpetrov, skip.montanaro, tlesher
Date 2008-12-07.22:52:08
SpamBayes Score 0.002389195
Marked as misclassified No
Message-id <1228690329.12.0.991200522446.issue4483@psf.upfronthosting.co.za>
In-reply-to
Content
The old if statement was "flat":
if find_file("ndbm.h", inc_dirs, []) is not None:
   <CODE>
elif (self.compiler.find_library_file(lib_dirs, 'gdbm')
      and find_file("gdbm/ndbm.h", inc_dirs, []) is not None):
   <CODE>
elif db_incs is not None:
   <CODE>
else:
   miss
If the second case fail, try third and if  succeed build dbm with
"berkeley db".

The new if statement contain nested if:
Now the second case is only "self.compiler.find_library_file(lib_dirs,
'gdbm'):" and if succeed (my case) =>
Failed to find the necessary bits to build these modules:
... dbm ...
Note the build system lack headers "gdbm/ndbm.h", "gdbm-ndbm.h".


To restore previous I add copy of code from third case as new case in
nested if:
===============
                         'dbm', ['dbmmodule.c'],
                         define_macros=[('HAVE_GDBM_DASH_NDBM_H',None)],
                         libraries = gdbm_libs ) )
+                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))
                 else:
                     missing.append('dbm')
             elif db_incs is not None:
===============
Note that above is not proposed patch as I don't like nested ifs and
code duplicate.
Is possible the checks to be in a new separate function ?
History
Date User Action Args
2008-12-07 22:52:09rpetrovsetrecipients: + rpetrov, skip.montanaro, flub, tlesher, legerf, AndyP
2008-12-07 22:52:09rpetrovsetmessageid: <1228690329.12.0.991200522446.issue4483@psf.upfronthosting.co.za>
2008-12-07 22:52:08rpetrovlinkissue4483 messages
2008-12-07 22:52:08rpetrovcreate