From 826401ad2b57e890d78a94c1e62ffe53abfde0ce Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Thu, 9 Dec 2021 15:58:30 +0100 Subject: Temporary hack: handle all extensions via .addext() Use .addext() for all modules in order to enable Makefile control over building them. --- configure.ac | 7 +++++++ setup.py | 26 +++++++++++++------------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/configure.ac b/configure.ac index fedec52f05a..24adc962280 100644 --- a/configure.ac +++ b/configure.ac @@ -6576,6 +6576,13 @@ PY_STDLIB_MOD_SIMPLE([_codecs_tw]) PY_STDLIB_MOD_SIMPLE([_multibytecodec]) PY_STDLIB_MOD_SIMPLE([unicodedata]) +dnl Gentoo hack +PY_STDLIB_MOD_SIMPLE([_curses]) +PY_STDLIB_MOD_SIMPLE([_curses_panel]) +PY_STDLIB_MOD_SIMPLE([_dbm]) +PY_STDLIB_MOD_SIMPLE([readline]) +PY_STDLIB_MOD_SIMPLE([_tkinter]) + dnl By default we always compile these even when OpenSSL is available dnl (issue #14693). The modules are small. PY_STDLIB_MOD([_md5], [test "$with_builtin_md5" = yes]) diff --git a/setup.py b/setup.py index e47b2ab9095..b05a2ab4ef5 100644 --- a/setup.py +++ b/setup.py @@ -1179,11 +1179,11 @@ def detect_readline_curses(self): ['/usr/lib/termcap'], 'termcap'): readline_libs.append('termcap') - self.add(Extension('readline', ['readline.c'], + self.addext(Extension('readline', ['readline.c'], library_dirs=['/usr/lib/termcap'], libraries=readline_libs)) else: - self.missing.append('readline') + self.addext(Extension('readline', ['readline.c'])) # Curses support, requiring the System V version of curses, often # provided by the ncurses library. @@ -1213,7 +1213,7 @@ def detect_readline_curses(self): curses_enabled = True if curses_library.startswith('ncurses'): curses_libs = [curses_library] - self.add(Extension('_curses', ['_cursesmodule.c'], + self.addext(Extension('_curses', ['_cursesmodule.c'], include_dirs=curses_includes, define_macros=curses_defines, libraries=curses_libs)) @@ -1227,24 +1227,24 @@ def detect_readline_curses(self): else: curses_libs = ['curses'] - self.add(Extension('_curses', ['_cursesmodule.c'], + self.addext(Extension('_curses', ['_cursesmodule.c'], define_macros=curses_defines, libraries=curses_libs)) else: curses_enabled = False - self.missing.append('_curses') + self.addext(Extension('_curses', ['_cursesmodule.c'])) # If the curses module is enabled, check for the panel module # _curses_panel needs some form of ncurses skip_curses_panel = True if AIX else False if (curses_enabled and not skip_curses_panel and self.compiler.find_library_file(self.lib_dirs, panel_library)): - self.add(Extension('_curses_panel', ['_curses_panel.c'], + self.addext(Extension('_curses_panel', ['_curses_panel.c'], include_dirs=curses_includes, define_macros=curses_defines, libraries=[panel_library, *curses_libs])) elif not skip_curses_panel: - self.missing.append('_curses_panel') + self.addext(Extension('_curses_panel', ['_curses_panel.c'])) def detect_crypt(self): self.addext(Extension('_crypt', ['_cryptmodule.c'])) @@ -1317,9 +1317,9 @@ def detect_dbm_gdbm(self): ) break if dbmext is not None: - self.add(dbmext) + self.addext(dbmext) else: - self.missing.append('_dbm') + self.addext(Extension('_dbm', ['_dbmmodule.c'])) # Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm: self.addext(Extension('_gdbm', ['_gdbmmodule.c'])) @@ -1429,7 +1429,7 @@ def detect_modules(self): self.detect_ctypes() self.detect_multiprocessing() if not self.detect_tkinter(): - self.missing.append('_tkinter') + self.addext(Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'])) self.detect_uuid() # Uncomment the next line if you want to play with xxmodule.c @@ -1481,7 +1481,7 @@ def detect_tkinter_fromenv(self): extra_compile_args = tcltk_includes.split() extra_link_args = tcltk_libs.split() - self.add(Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], + self.addext(Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], define_macros=[('WITH_APPINIT', 1)], extra_compile_args = extra_compile_args, extra_link_args = extra_link_args)) @@ -1611,7 +1611,7 @@ def detect_tkinter_darwin(self): if '-Wstrict-prototypes' in cflags.split(): compile_args.append('-Wno-strict-prototypes') - self.add(Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], + self.addext(Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], define_macros=[('WITH_APPINIT', 1)], include_dirs=include_dirs, libraries=[], @@ -1735,7 +1735,7 @@ def detect_tkinter(self): # *** Uncomment these for TOGL extension only: # -lGL -lGLU -lXext -lXmu \ - self.add(Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], + self.addext(Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], define_macros=[('WITH_APPINIT', 1)] + defs, include_dirs=include_dirs, libraries=libs, -- cgit v1.2.3-65-gdbad