Index: setup.py =================================================================== --- setup.py (revision 66336) +++ setup.py (working copy) @@ -1237,65 +1237,68 @@ self.detect_ctypes(inc_dirs, lib_dirs) # Richard Oudkerk's multiprocessing module - if platform == 'win32': # Windows - macros = dict() - libraries = ['ws2_32'] + if sysconfig.get_config_var('WITH_THREAD'): + if platform == 'win32': # Windows + macros = dict() + libraries = ['ws2_32'] - elif platform == 'darwin': # Mac OSX - macros = dict( - HAVE_SEM_OPEN=1, - HAVE_SEM_TIMEDWAIT=0, - HAVE_FD_TRANSFER=1, - HAVE_BROKEN_SEM_GETVALUE=1 - ) - libraries = [] + elif platform == 'darwin': # Mac OSX + macros = dict( + HAVE_SEM_OPEN=1, + HAVE_SEM_TIMEDWAIT=0, + HAVE_FD_TRANSFER=1, + HAVE_BROKEN_SEM_GETVALUE=1 + ) + libraries = [] - elif platform == 'cygwin': # Cygwin - macros = dict( - HAVE_SEM_OPEN=1, - HAVE_SEM_TIMEDWAIT=1, - HAVE_FD_TRANSFER=0, - HAVE_BROKEN_SEM_UNLINK=1 - ) - libraries = [] + elif platform == 'cygwin': # Cygwin + macros = dict( + HAVE_SEM_OPEN=1, + HAVE_SEM_TIMEDWAIT=1, + HAVE_FD_TRANSFER=0, + HAVE_BROKEN_SEM_UNLINK=1 + ) + libraries = [] - elif platform in ('freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'): - # FreeBSD's P1003.1b semaphore support is very experimental - # and has many known problems. (as of June 2008) - macros = dict( # FreeBSD - HAVE_SEM_OPEN=0, - HAVE_SEM_TIMEDWAIT=0, - HAVE_FD_TRANSFER=1, - ) - libraries = [] + elif platform in ('freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'): + # FreeBSD's P1003.1b semaphore support is very experimental + # and has many known problems. (as of June 2008) + macros = dict( # FreeBSD + HAVE_SEM_OPEN=0, + HAVE_SEM_TIMEDWAIT=0, + HAVE_FD_TRANSFER=1, + ) + libraries = [] - else: # Linux and other unices - macros = dict( - HAVE_SEM_OPEN=1, - HAVE_SEM_TIMEDWAIT=1, - HAVE_FD_TRANSFER=1 - ) - libraries = ['rt'] + else: # Linux and other unices + macros = dict( + HAVE_SEM_OPEN=1, + HAVE_SEM_TIMEDWAIT=1, + HAVE_FD_TRANSFER=1 + ) + libraries = ['rt'] - if platform == 'win32': - multiprocessing_srcs = [ '_multiprocessing/multiprocessing.c', - '_multiprocessing/semaphore.c', - '_multiprocessing/pipe_connection.c', - '_multiprocessing/socket_connection.c', - '_multiprocessing/win32_functions.c' - ] + if platform == 'win32': + multiprocessing_srcs = [ '_multiprocessing/multiprocessing.c', + '_multiprocessing/semaphore.c', + '_multiprocessing/pipe_connection.c', + '_multiprocessing/socket_connection.c', + '_multiprocessing/win32_functions.c' + ] - else: - multiprocessing_srcs = [ '_multiprocessing/multiprocessing.c', - '_multiprocessing/socket_connection.c' - ] + else: + multiprocessing_srcs = [ '_multiprocessing/multiprocessing.c', + '_multiprocessing/socket_connection.c' + ] - if macros.get('HAVE_SEM_OPEN', False): - multiprocessing_srcs.append('_multiprocessing/semaphore.c') + if macros.get('HAVE_SEM_OPEN', False): + multiprocessing_srcs.append('_multiprocessing/semaphore.c') - exts.append ( Extension('_multiprocessing', multiprocessing_srcs, - define_macros=macros.items(), - include_dirs=["Modules/_multiprocessing"])) + exts.append ( Extension('_multiprocessing', multiprocessing_srcs, + define_macros=macros.items(), + include_dirs=["Modules/_multiprocessing"])) + else: + missing.append('_multiprocessing') # End multiprocessing