diff -r bb94f6222fef setup.py --- a/setup.py Wed Dec 19 14:33:35 2012 +0200 +++ b/setup.py Wed Dec 19 19:56:47 2012 +0000 @@ -1523,6 +1523,9 @@ class PyBuildExt(build_ext): # Call the method for detecting whether _tkinter can be compiled self.detect_tkinter(inc_dirs, lib_dirs) + # Maybe enable the toy module + self.maybe_enable_xxmodule(force=False) + if '_tkinter' not in [e.name for e in self.extensions]: missing.append('_tkinter') @@ -1723,14 +1726,6 @@ class PyBuildExt(build_ext): ) self.extensions.append(ext) -## # Uncomment these lines if you want to play with xxmodule.c -## ext = Extension('xx', ['xxmodule.c']) -## self.extensions.append(ext) - if 'd' not in sys.abiflags: - ext = Extension('xxlimited', ['xxlimited.c'], - define_macros=[('Py_LIMITED_API', 1)]) - self.extensions.append(ext) - # XXX handle these, but how to detect? # *** Uncomment and edit for PIL (TkImaging) extension only: # -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \ @@ -1739,6 +1734,16 @@ class PyBuildExt(build_ext): # *** Uncomment these for TOGL extension only: # -lGL -lGLU -lXext -lXmu \ + def maybe_enable_xxmodule(self, force): + # force = True # uncomment this line to build xxmodule.c + if force: + ext = Extension('xx', ['xxmodule.c']) + self.extensions.append(ext) + if 'd' not in sys.abiflags: + ext = Extension('xxlimited', ['xxlimited.c'], + define_macros=[('Py_LIMITED_API', 1)]) + self.extensions.append(ext) + def configure_ctypes_darwin(self, ext): # Darwin (OS X) uses preconfigured files, in # the Modules/_ctypes/libffi_osx directory.