Use the shared library libclntsh.so to determine which Oracle version is in use

rather than the static client libraries which are not shipped with Oracle XE
or the instant client; thanks to Catherine Devlin for pointing this out and
providing an initial patch. In addition, allow for the situation where the
instant client is installed as Linux RPMs which use different locations than
the standard client in that situation.
This commit is contained in:
Anthony Tuininga 2007-10-13 03:01:33 +00:00
parent 1d057bcd5f
commit 1cea81e08d

View File

@ -75,12 +75,21 @@ elif sys.platform == "cygwin":
libDirs[i] = os.path.join(oracleHome, libDirs[i])
libs = ["oci"]
else:
includeDirs = ["rdbms/demo", "rdbms/public", "network/public",
possibleIncludeDirs = ["rdbms/demo", "rdbms/public", "network/public",
"sdk/include"]
if sys.platform == "darwin":
includeDirs.append("plsql/public")
for i in range(len(includeDirs)):
includeDirs[i] = os.path.join(oracleHome, includeDirs[i])
possibleIncludeDirs.append("plsql/public")
includeDirs = []
for dir in possibleIncludeDirs:
path = os.path.join(oracleHome, dir)
if os.path.isdir(path):
includeDirs.append(path)
if not includeDirs:
path = oracleHome.replace("lib", "include")
if os.path.isdir(path):
includeDirs.append(path)
if not includeDirs:
raise DistutilsSetupError, "cannot locate Oracle include files"
libPath = os.path.join(oracleHome, "lib")
if sys.maxint == 2 ** 31 - 1:
alternatePath = os.path.join(oracleHome, "lib32")
@ -129,9 +138,9 @@ class Distribution(distutils.dist.Distribution):
else:
subDir = "lib"
filesToCheck = [
("11g", "libclient11.a"),
("10g", "libclient10.a"),
("9i", "libclient9.a"),
("11g", "libclntsh.so.11.1"),
("10g", "libclntsh.so.10.1"),
("9i", "libclntsh.so.9.0"),
("8i", "libclient8.a")
]
self.oracleVersion = None