@@ -18,7 +18,7 @@ def add_dir_to_list(dirlist, dir):
1818 """Add the directory 'dir' to the list 'dirlist' (at the front) if
1919 1) 'dir' is not already in 'dirlist'
2020 2) 'dir' actually exists, and is a directory."""
21- if os .path .isdir (dir ) and dir not in dirlist :
21+ if dir is not None and os .path .isdir (dir ) and dir not in dirlist :
2222 dirlist .insert (0 , dir )
2323
2424def find_file (filename , std_dirs , paths ):
@@ -99,7 +99,7 @@ def build_extensions(self):
9999
100100 # Platform-dependent module source and include directories
101101 platform = self .get_platform ()
102- if platform == 'darwin' :
102+ if platform in ( 'darwin' , 'mac' ) :
103103 # Mac OS X also includes some mac-specific modules
104104 macmoddir = os .path .join (os .getcwd (), srcdir , 'Mac/Modules' )
105105 moddirlist .append (macmoddir )
@@ -126,20 +126,21 @@ def build_extensions(self):
126126 if ext .name in sys .builtin_module_names :
127127 self .extensions .remove (ext )
128128
129- # Parse Modules/Setup to figure out which modules are turned
130- # on in the file.
131- input = text_file .TextFile ('Modules/Setup' , join_lines = 1 )
132- remove_modules = []
133- while 1 :
134- line = input .readline ()
135- if not line : break
136- line = line .split ()
137- remove_modules .append ( line [0 ] )
138- input .close ()
139-
140- for ext in self .extensions [:]:
141- if ext .name in remove_modules :
142- self .extensions .remove (ext )
129+ if platform != 'mac' :
130+ # Parse Modules/Setup to figure out which modules are turned
131+ # on in the file.
132+ input = text_file .TextFile ('Modules/Setup' , join_lines = 1 )
133+ remove_modules = []
134+ while 1 :
135+ line = input .readline ()
136+ if not line : break
137+ line = line .split ()
138+ remove_modules .append ( line [0 ] )
139+ input .close ()
140+
141+ for ext in self .extensions [:]:
142+ if ext .name in remove_modules :
143+ self .extensions .remove (ext )
143144
144145 # When you run "make CC=altcc" or something similar, you really want
145146 # those environment variables passed into the setup.py phase. Here's
@@ -258,7 +259,7 @@ def detect_modules(self):
258259
259260 # Check for MacOS X, which doesn't need libm.a at all
260261 math_libs = ['m' ]
261- if platform in ['darwin' , 'beos' ]:
262+ if platform in ['darwin' , 'beos' , 'mac' ]:
262263 math_libs = []
263264
264265 # XXX Omitted modules: gl, pure, dl, SGI-specific modules
0 commit comments