Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 73aa1ff

Browse files
committed
More fixes for building MacPython extension modules. It now actually succeeds
in building various modules.
1 parent 3d9addd commit 73aa1ff

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

setup.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,11 @@ def detect_modules(self):
309309

310310
# fcntl(2) and ioctl(2)
311311
exts.append( Extension('fcntl', ['fcntlmodule.c']) )
312-
# pwd(3)
313-
exts.append( Extension('pwd', ['pwdmodule.c']) )
314-
# grp(3)
315-
exts.append( Extension('grp', ['grpmodule.c']) )
312+
if platform not in ['mac']:
313+
# pwd(3)
314+
exts.append( Extension('pwd', ['pwdmodule.c']) )
315+
# grp(3)
316+
exts.append( Extension('grp', ['grpmodule.c']) )
316317
# posix (UNIX) errno values
317318
exts.append( Extension('errno', ['errnomodule.c']) )
318319
# select(2); not on ancient System V
@@ -338,14 +339,15 @@ def detect_modules(self):
338339
exts.append( Extension('cPickle', ['cPickle.c']) )
339340

340341
# Memory-mapped files (also works on Win32).
341-
if platform not in ['atheos']:
342+
if platform not in ['atheos', 'mac']:
342343
exts.append( Extension('mmap', ['mmapmodule.c']) )
343344

344345
# Lance Ellinghaus's modules:
345346
# enigma-inspired encryption
346347
exts.append( Extension('rotor', ['rotormodule.c']) )
347-
# syslog daemon interface
348-
exts.append( Extension('syslog', ['syslogmodule.c']) )
348+
if platform not in ['mac']:
349+
# syslog daemon interface
350+
exts.append( Extension('syslog', ['syslogmodule.c']) )
349351

350352
# George Neville-Neil's timing module:
351353
exts.append( Extension('timing', ['timingmodule.c']) )
@@ -381,14 +383,14 @@ def detect_modules(self):
381383
exts.append( Extension('readline', ['readline.c'],
382384
library_dirs=['/usr/lib/termcap'],
383385
libraries=readline_libs) )
384-
385-
# crypt module.
386-
387-
if self.compiler.find_library_file(lib_dirs, 'crypt'):
388-
libs = ['crypt']
389-
else:
390-
libs = []
391-
exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) )
386+
if platform not in ['mac']:
387+
# crypt module.
388+
389+
if self.compiler.find_library_file(lib_dirs, 'crypt'):
390+
libs = ['crypt']
391+
else:
392+
libs = []
393+
exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) )
392394

393395
# socket(2)
394396
exts.append( Extension('_socket', ['socketmodule.c'],
@@ -535,7 +537,7 @@ class found(Exception): pass
535537
dblib_dir = None
536538

537539
# The standard Unix dbm module:
538-
if platform not in ['cygwin']:
540+
if platform not in ['cygwin', 'mac']:
539541
if (self.compiler.find_library_file(lib_dirs, 'ndbm')):
540542
exts.append( Extension('dbm', ['dbmmodule.c'],
541543
libraries = ['ndbm'] ) )

0 commit comments

Comments
 (0)