Python-01-solaris-lib-dirs.diff revision 6957
--- Python-2.4.2/setup.py 2005-03-09 17:27:24.000000000 -0500
+++ Python-2.4.2.new/setup.py 2005-10-27 22:12:16.664549000 -0400
@@ -238,9 +238,10 @@
return sys.platform
def detect_modules(self):
- # Ensure that /usr/local is always used
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
+ if sys.platform != 'sunos5':
+ # Ensure that /usr/local is always used
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+ add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
# Add paths to popular package managers on OS X/darwin
if sys.platform == "darwin":
@@ -267,7 +268,7 @@
# be assumed that no additional -I,-L directives are needed.
lib_dirs = self.compiler.library_dirs + [
'/lib64', '/usr/lib64',
- '/lib', '/usr/lib',
+ '/lib', '/usr/lib'
]
inc_dirs = self.compiler.include_dirs + ['/usr/include']
exts = []
@@ -448,8 +449,19 @@
exts.append( Extension('_csv', ['_csv.c']) )
# socket(2)
+ socket_libs = []
+ if self.compiler.find_library_file(lib_dirs,
+ 'socket'):
+ socket_libs.append('socket')
+ if self.compiler.find_library_file(lib_dirs,
+ 'nsl'):
+ socket_libs.append('nsl')
+ if self.compiler.find_library_file(lib_dirs,
+ 'resolv'):
+ socket_libs.append('resolv')
exts.append( Extension('_socket', ['socketmodule.c'],
- depends = ['socketmodule.h']) )
+ depends = ['socketmodule.h'],
+ libraries = socket_libs) )
# Detect SSL support for the socket module (via _ssl)
ssl_incs = find_file('openssl/ssl.h', inc_dirs,
['/usr/local/ssl/include',
@@ -974,15 +983,25 @@
# Assume we haven't found any of the libraries or include files
# The versions with dots are used on Unix, and the versions without
- # dots on Windows, for detection by cygwin.
+ # dots on Windows, for detection by cygwin.
+ added_lib_dirs = []
+ tcl_tk_lib_dirs = ['/usr/sfw/lib']
+ tcl_tk_inc_dirs = ['/usr/sfw/include']
tcllib = tklib = tcl_includes = tk_includes = None
for version in ['8.5', '85', '8.4', '84', '8.3', '83', '8.2',
'82', '8.1', '81', '8.0', '80']:
- tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version)
- tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version)
+ tklib = self.compiler.find_library_file(lib_dirs, 'tk' + version, tcl_tk_lib_dirs)
+ tcllib = self.compiler.find_library_file(lib_dirs, 'tcl' + version, tcl_tk_lib_dirs)
if tklib and tcllib:
# Exit the loop when we've found the Tcl/Tk libraries
break
+ tklib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tk' + version)
+ tcllib = self.compiler.find_library_file(tcl_tk_lib_dirs, 'tcl' + version)
+ if tklib and tcllib:
+ # found the libs in a non-standard dir
+ added_lib_dirs.append(os.path.dirname(tcllib))
+ # Exit the loop when we've found the Tcl/Tk libraries
+ break
# Now check for the header files
if tklib and tcllib:
@@ -998,6 +1017,7 @@
for dir in inc_dirs:
tcl_include_sub += [dir + os.sep + "tcl" + dotversion]
tk_include_sub += [dir + os.sep + "tk" + dotversion]
+ tcl_include_sub += tcl_tk_inc_dirs
tk_include_sub += tcl_include_sub
tcl_includes = find_file('tcl.h', inc_dirs, tcl_include_sub)
tk_includes = find_file('tk.h', inc_dirs, tk_include_sub)
@@ -1009,7 +1029,7 @@
# OK... everything seems to be present for Tcl/Tk.
- include_dirs = [] ; libs = [] ; defs = [] ; added_lib_dirs = []
+ include_dirs = [] ; libs = [] ; defs = []
for dir in tcl_includes + tk_includes:
if dir not in include_dirs:
include_dirs.append(dir)
@@ -1062,6 +1082,7 @@
include_dirs = include_dirs,
libraries = libs,
library_dirs = added_lib_dirs,
+ runtime_library_dirs = added_lib_dirs
)
self.extensions.append(ext)