009-do-not-use-dblib_dir-when-cross-compiling.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132
  1. --- a/setup.py
  2. +++ b/setup.py
  3. @@ -1083,6 +1083,7 @@ class PyBuildExt(build_ext):
  4. if db_setup_debug: print "db lib: ", dblib, "not found"
  5. except db_found:
  6. + rt_dblib_dir = None if cross_compiling else dblib_dir
  7. if db_setup_debug:
  8. print "bsddb using BerkeleyDB lib:", db_ver, dblib
  9. print "bsddb lib dir:", dblib_dir, " inc dir:", db_incdir
  10. @@ -1097,7 +1098,7 @@ class PyBuildExt(build_ext):
  11. exts.append(Extension('_bsddb', ['_bsddb.c'],
  12. depends = ['bsddb.h'],
  13. library_dirs=dblib_dir,
  14. - runtime_library_dirs=dblib_dir,
  15. + runtime_library_dirs=rt_dblib_dir,
  16. include_dirs=db_incs,
  17. libraries=dblibs))
  18. else:
  19. @@ -1308,10 +1309,11 @@ class PyBuildExt(build_ext):
  20. break
  21. elif cand == "bdb":
  22. if db_incs is not None:
  23. + rt_dblib_dir = None if cross_compiling else dblib_dir
  24. print "building dbm using bdb"
  25. dbmext = Extension('dbm', ['dbmmodule.c'],
  26. library_dirs=dblib_dir,
  27. - runtime_library_dirs=dblib_dir,
  28. + runtime_library_dirs=rt_dblib_dir,
  29. include_dirs=db_incs,
  30. define_macros=[
  31. ('HAVE_BERKDB_H', None),