--- Python-2.7.6/setup.py.~1~ 2013-11-10 11:36:41.000000000 +0400 +++ Python-2.7.6/setup.py 2014-06-04 10:11:58.356029565 +0400 @@ -437,9 +437,9 @@ def detect_modules(self): # Ensure that /usr/local is always used - if not cross_compiling: - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') + # if not cross_compiling: + # add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') + # add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') if cross_compiling: self.add_gcc_paths() self.add_multiarch_paths() @@ -761,6 +761,13 @@ ['/usr/lib/termcap'], 'termcap'): readline_libs.append('termcap') + + if host_platform == 'sunos5': + # insert '-zrecord' before the readline libraries that we + # want to link with to avoid rl_insert() elimination + readline_extra_link_args = ('-Wl,-zrecord','-lreadline','-lncurses') + readline_libs = () + exts.append( Extension('readline', ['readline.c'], library_dirs=['/usr/lib/termcap'], extra_link_args=readline_extra_link_args, @@ -780,9 +787,10 @@ exts.append( Extension('_csv', ['_csv.c']) ) # socket(2) + socket_libs = math_libs + [ 'socket', 'nsl' ] exts.append( Extension('_socket', ['socketmodule.c', 'timemodule.c'], depends=['socketmodule.h'], - libraries=math_libs) ) + libraries=socket_libs) ) # Detect SSL support for the socket module (via _ssl) search_for_ssl_incs_in = [ '/usr/local/ssl/include', @@ -1579,9 +1587,14 @@ sysconfig.get_config_var('POSIX_SEMAPHORES_NOT_ENABLED')): multiprocessing_srcs.append('_multiprocessing/semaphore.c') + multiproc_libs = [] + if host_platform == 'sunos5': + multiproc_libs = [ "xnet" ] + if sysconfig.get_config_var('WITH_THREAD'): exts.append ( Extension('_multiprocessing', multiprocessing_srcs, define_macros=macros.items(), + libraries=multiproc_libs, include_dirs=["Modules/_multiprocessing"])) else: missing.append('_multiprocessing') @@ -2075,7 +2088,8 @@ # this option. If you want to compile ctypes with the Sun # compiler, please research a proper solution, instead of # finding some -z option for the Sun compiler. - extra_link_args.append('-mimpure-text') + #extra_link_args.append('-mimpure-text') + pass elif host_platform.startswith('hp-ux'): extra_link_args.append('-fPIC')