mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 19:31:54 +08:00
Simplify the various configurations.
Solaris might be fixed for gcc and broken for standard compiler.
This commit is contained in:
@ -18,63 +18,50 @@ thread_safe_library = NO
|
||||
|
||||
mysqlclient = thread_safe_library and "mysqlclient_r" or "mysqlclient"
|
||||
|
||||
if sys.platform in ("linux-i386", "linux2"): # most Linux
|
||||
# MySQL-3.23 and newer need libz
|
||||
libraries = [mysqlclient, "z"]
|
||||
|
||||
# On some platorms, this can be used to find the shared libraries
|
||||
# at runtime, if they are in a non-standard location. Doesn't
|
||||
# work for Linux gcc.
|
||||
runtime_library_dirs = []
|
||||
|
||||
# This can be used to force linking against static libraries.
|
||||
extra_objects = []
|
||||
|
||||
# Sometimes the compiler or linker needs an extra switch to make
|
||||
# things work.
|
||||
extra_compile_args = []
|
||||
extra_link_args = []
|
||||
|
||||
if sys.platform in ("linux-i386", "linux2"): # most Linux platforms
|
||||
include_dirs = ['/usr/include/mysql']
|
||||
library_dirs = ['/usr/lib/mysql']
|
||||
libraries = [mysqlclient, "z"]
|
||||
runtime_library_dirs = []
|
||||
extra_objects = []
|
||||
extra_link_args = []
|
||||
elif sys.platform in ("freebsd4", "openbsd2"):
|
||||
elif sys.platform in ("freebsd4", "openbsd2"): # *BSD
|
||||
include_dirs = ['/usr/local/include/mysql']
|
||||
library_dirs = ['/usr/local/lib/mysql']
|
||||
libraries = [mysqlclient, "z"]
|
||||
runtime_library_dirs = []
|
||||
extra_objects = []
|
||||
extra_link_args = []
|
||||
elif sys.platform == "netbsd1":
|
||||
elif sys.platform == "netbsd1": # more *BSD
|
||||
include_dirs = ['/usr/pkg/include/mysql']
|
||||
library_dirs = ['/usr/pkg/lib/mysql']
|
||||
libraries = [mysqlclient, "z"]
|
||||
runtime_library_dirs = []
|
||||
extra_objects = []
|
||||
extra_link_args = []
|
||||
elif sys.platform == "sunos5": # Solaris 2.8
|
||||
elif sys.platform == "sunos5": # Solaris 2.8 + gcc
|
||||
include_dirs = ['/usr/local/mysql/include/mysql']
|
||||
library_dirs = ['/usr/local/mysql/lib/mysql']
|
||||
libraries = [mysqlclient, "z"]
|
||||
runtime_library_dirs = ['/usr/local/lib:/usr/openwin/lib:/usr/dt/lib']
|
||||
extra_objects = []
|
||||
extra_link_args = []
|
||||
elif sys.platform == "win32":
|
||||
extra_compile_args = ["-fPIC"]
|
||||
elif sys.platform == "win32": # Ugh
|
||||
include_dirs = [r'c:\mysql\include']
|
||||
library_dirs = [r'c:\mysql\lib\opt']
|
||||
libraries = [mysqlclient, 'zlib', 'msvcrt', 'libcmt',
|
||||
'wsock32', 'advapi32']
|
||||
runtime_library_dirs = []
|
||||
extra_objects = [r'c:\mysql\lib\opt\mysqlclient.lib']
|
||||
extra_link_args = []
|
||||
elif sys.platform == "darwin1": # Mac OS X
|
||||
include_dirs = ['/usr/local/mysql/include/mysql']
|
||||
library_dirs = ['/usr/local/mysql/lib/mysql']
|
||||
libraries = [mysqlclient, "z"]
|
||||
runtime_library_dirs = []
|
||||
extra_objects = []
|
||||
extra_link_args = ['-flat_namespace']
|
||||
elif os.name == "posix": # most Linux/UNIX platforms
|
||||
elif os.name == "posix": # UNIX-ish platforms not covered above
|
||||
include_dirs = ['/usr/include/mysql']
|
||||
library_dirs = ['/usr/lib/mysql']
|
||||
# MySQL-3.23 needs libz
|
||||
libraries = [mysqlclient, "z"]
|
||||
# On some platorms, this can be used to find the shared libraries
|
||||
# at runtime, if they are in a non-standard location. Doesn't
|
||||
# work for Linux gcc.
|
||||
## runtime_library_dirs = library_dirs
|
||||
runtime_library_dirs = []
|
||||
# This can be used on Linux to force use of static mysqlclient lib
|
||||
## extra_objects = ['/usr/lib/mysql/libmysqlclient.a']
|
||||
extra_objects = []
|
||||
extra_link_args = []
|
||||
else:
|
||||
raise "UnknownPlatform", "sys.platform=%s, os.name=%s" % \
|
||||
(sys.platform, os.name)
|
||||
@ -135,5 +122,6 @@ setup (# Distribution meta-data
|
||||
libraries=libraries,
|
||||
extra_objects=extra_objects,
|
||||
extra_link_args=extra_link_args,
|
||||
extra_compile_args=extra_compile_args,
|
||||
)],
|
||||
)
|
||||
|
Reference in New Issue
Block a user