I mean *setup.py* ! ... (more questions)
Andrew Kuchling
akuchlin at mems-exchange.org
Tue Jan 23 14:35:34 EST 2001
"Steven D. Majewski" <sdm7g at virginia.edu> writes:
> I was willing to write the other one off as a MacOSX oddity that
> nobody on python-dev was likely to know about, but -ltermcap is
> likely to be a problem on other systems too!
setup.py was written using 2.0's Modules/Setup.in as a guide to
platform specific problems; it didn't mention MacOS X, of course. Try
the untested patch below; you'll need to fix whatever sys.platform is
on MacOS X. Please let me know what it is and let me know if it
works.
> So that makes me think I'm missing some obvious way of overriding
> these switches. Are there any docs or tips on this new setup
> method ? Am I just supposed to edit the source of setup.py, or
> is it generated from some template ?
Right now the only way to fiddle with setup.py is to edit it, and
submit patches back. I'm planning to have some command-line switches
in the next alpha.
--amk
Index: setup.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/setup.py,v
retrieving revision 1.12
diff -u -r1.12 setup.py
--- setup.py 2001/01/22 10:38:27 1.12
+++ setup.py 2001/01/23 19:33:44
@@ -113,6 +113,11 @@
inc_dirs = ['/usr/include'] + self.compiler.include_dirs
exts = []
+ # Check for MacOS X, which doesn't need libm.a at all
+ math_libs = ['m']
+ if sys.platform == 'XXX fill this in':
+ math_libs = []
+
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
#
@@ -129,13 +134,16 @@
# array objects
exts.append( Extension('array', ['arraymodule.c']) )
# complex math library functions
- exts.append( Extension('cmath', ['cmathmodule.c'], libraries=['m']) )
+ exts.append( Extension('cmath', ['cmathmodule.c'],
+ libraries=math_libs) )
# math library functions, e.g. sin()
- exts.append( Extension('math', ['mathmodule.c'], libraries=['m']) )
+ exts.append( Extension('math', ['mathmodule.c'],
+ libraries=math_libs) )
# fast string operations implemented in C
exts.append( Extension('strop', ['stropmodule.c']) )
# time operations and variables
- exts.append( Extension('time', ['timemodule.c'], libraries=['m']) )
+ exts.append( Extension('time', ['timemodule.c'],
+ libraries=math_libs) )
# operator.add() and similar goodies
exts.append( Extension('operator', ['operator.c']) )
# access to the builtin codecs and codec registry
@@ -335,8 +343,11 @@
elif (self.compiler.find_library_file(lib_dirs, 'curses')):
if (self.compiler.find_library_file(lib_dirs, 'terminfo')):
curses_libs = ['curses', 'terminfo']
- else:
+ elif (self.compiler.find_library_file(lib_dirs, 'termcap')):
curses_libs = ['curses', 'termcap']
+ else:
+ # Assume that termcap/terminfo aren't needed at all.
+ curses_libs = ['curses']
exts.append( Extension('_curses', ['_cursesmodule.c'],
libraries = curses_libs) )
More information about the Python-list
mailing list