Last active
January 18, 2021 06:29
-
-
Save ajacocks/d260cb2db26b6be87e493c11d2a28688 to your computer and use it in GitHub Desktop.
Python 3.9.1 Solaris 10 setup.py patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Python-3.9.1/setup.py Mon Dec 7 09:02:38 2020 | |
+++ Python-3.9.1.new/setup.py Mon Jan 18 03:53:37 2021 | |
@@ -1084,7 +1084,26 @@ | |
elif curses_library == 'curses' and not MACOS: | |
# OSX has an old Berkeley curses, not good enough for | |
# the _curses module. | |
- if (self.compiler.find_library_file(self.lib_dirs, 'terminfo')): | |
+ curses_undefines = [] | |
+ curses_libraries = [] | |
+ curses_runtime = [] | |
+ curses_include = [] | |
+ # Bug 3786 and possibly Bug 13552: Solaris curses workarounds. | |
+ # Solaris 11 includes SysV curses, XPG4 curses, and GNU curses. | |
+ # This section sets up GNU curses. Since curses is found first | |
+ # we check and see if we can use the GNU version. | |
+ if platform == 'sunos5' and os.path.exists('/usr/include/ncurses'): | |
+ # this next guard may not be needed for gcc | |
+ if '-Kpic' in sysconfig.get_config_vars('CCSHARED'): | |
+ curses_defines=[] | |
+ # work around for assumption on line 128 of Modules/_cursesmodule.c | |
+ curses_undefines = ['__sun'] | |
+ curses_includes=['/opt/csw/include/ncurses'] | |
+ curses_libraries=['/opt/csw/lib'] | |
+ curses_runtime=['/opt/csw/lib'] | |
+ curses_libs = ['ncurses'] | |
+ # and as if by magical _curses_panel should work as well | |
+ elif (self.compiler.find_library_file(lib_dirs, 'terminfo')): | |
curses_libs = ['curses', 'terminfo'] | |
elif (self.compiler.find_library_file(self.lib_dirs, 'termcap')): | |
curses_libs = ['curses', 'termcap'] | |
@@ -1092,7 +1111,11 @@ | |
curses_libs = ['curses'] | |
self.add(Extension('_curses', ['_cursesmodule.c'], | |
- define_macros=curses_defines, | |
+ undef_macros = curses_undefines, | |
+ define_macros = curses_defines, | |
+ include_dirs = curses_includes, | |
+ library_dirs = curses_libraries, | |
+ runtime_library_dirs = curses_runtime, | |
libraries=curses_libs)) | |
else: | |
curses_enabled = False | |
@@ -2122,7 +2145,9 @@ | |
# 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') | |
+ if '-Kpic' not in sysconfig.get_config_vars('CCSHARED'): | |
+ # make sure this is only gcc and not the sunpro compiler | |
+ extra_link_args.append('-mimpure-text') | |
elif HOST_PLATFORM.startswith('hp-ux'): | |
extra_link_args.append('-fPIC') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment