1--- setup3.py.orig	2021-05-19 15:44:48 UTC
2+++ setup3.py
3@@ -44,7 +44,7 @@ import glob
4 # See https://setuptools.readthedocs.io/en/latest/deprecated/\
5 #                                      distutils-legacy.html
6 os.environ['SETUPTOOLS_USE_DISTUTILS'] = 'local'
7-from setuptools import setup, Extension
8+from distutils.core import setup, Extension
9 import distutils.ccompiler
10
11 # read the module version number out of the .c file
12@@ -256,8 +256,8 @@ if os.name == 'posix':
13         incdir = os.path.join(BERKELEYDB_DIR, 'include')
14     if not libdir:
15         libdir = os.path.join(BERKELEYDB_DIR, 'lib')
16-    if not '-ldb' in LIBS:
17-        libname = [dblib]
18+    if not '-l%%BDB_LIB_NAME%%' in LIBS:
19+        libname = ['%%BDB_LIB_NAME%%']
20     else:
21         if debug: print("LIBS already contains '-ldb' not adding our own", "'-l"+dblib+"'")
22         libname = []
23@@ -296,7 +296,7 @@ if os.name == 'posix':
24
25     # read db.h to figure out what version of Oracle Berkeley DB this is
26     ver = None
27-    with open(os.path.join(incdir, 'db.h'), 'r') as f :
28+    with open('%%BDB_INCLUDE_DIR%%/db.h', 'r') as f :
29         db_h_lines = f.readlines()
30     db_ver_re = re.compile(
31         r'^#define\s+DB_VERSION_STRING\s.*Berkeley DB (\d+\.\d+).*')
32