]> granicus.if.org Git - python/commitdiff
Patch #428494: Prefer linking against ncursesw over ncurses library
authorMartin v. Löwis <martin@v.loewis.de>
Sat, 11 Feb 2006 15:55:14 +0000 (15:55 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 11 Feb 2006 15:55:14 +0000 (15:55 +0000)
Misc/NEWS
setup.py

index 8b388325f425091fd476f241350fd9fcf654feef..c9e7a309ea1675bc231dba9ad34453b67d70fb2f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -699,6 +699,8 @@ Library
 Build
 -----
 
+- Patch #1428494: Prefer linking against ncursesw over ncurses library.
+
 - Patch #881820: look for openpty and forkpty also in libbsd.
 
 - The sources of zlib are now part of the Python distribution (zlib 1.2.3).
index 9762b9a60e79b2ff27c5928cfda9fb1e16107d22..9eae12621dbc473f9cc26519970c09aac3a1e1b5 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -450,6 +450,9 @@ class PyBuildExt(build_ext):
         if self.compiler.find_library_file(lib_dirs, 'readline'):
             readline_libs = ['readline']
             if self.compiler.find_library_file(lib_dirs,
+                                                 'ncursesw'):
+                readline_libs.append('ncursesw')
+            elif self.compiler.find_library_file(lib_dirs,
                                                  'ncurses'):
                 readline_libs.append('ncurses')
             elif self.compiler.find_library_file(lib_dirs, 'curses'):
@@ -751,7 +754,11 @@ class PyBuildExt(build_ext):
 
         # Curses support, requiring the System V version of curses, often
         # provided by the ncurses library.
-        if (self.compiler.find_library_file(lib_dirs, 'ncurses')):
+        if (self.compiler.find_library_file(lib_dirs, 'ncursesw')):
+            curses_libs = ['ncursesw']
+            exts.append( Extension('_curses', ['_cursesmodule.c'],
+                                   libraries = curses_libs) )
+        elif (self.compiler.find_library_file(lib_dirs, 'ncurses')):
             curses_libs = ['ncurses']
             exts.append( Extension('_curses', ['_cursesmodule.c'],
                                    libraries = curses_libs) )