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

Skip to content

Commit ab5320b

Browse files
committed
Fixed various MacPython-specific issues found by attempting to use the standard core setup.py for MacPython.
1 parent 0a2963c commit ab5320b

2 files changed

Lines changed: 37 additions & 4 deletions

File tree

Lib/distutils/mwerkscompiler.py

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def link (self,
161161
return
162162
# Build the export file
163163
exportfilename = os.path.join(build_temp, exportname)
164-
log.debug("\tCreate export file", exportfilename)
164+
log.debug("\tCreate export file %s", exportfilename)
165165
fp = open(exportfilename, 'w')
166166
fp.write('%s\n'%export_symbols[0])
167167
fp.close()
@@ -182,7 +182,7 @@ def link (self,
182182
# because we pass this pathname to CodeWarrior in an AppleEvent, and CW
183183
# doesn't have a clue about our working directory.
184184
xmlfilename = os.path.join(os.getcwd(), os.path.join(build_temp, xmlname))
185-
log.debug("\tCreate XML file", xmlfilename)
185+
log.debug("\tCreate XML file %s", xmlfilename)
186186
xmlbuilder = mkcwproject.cwxmlgen.ProjectBuilder(settings)
187187
xmlbuilder.generate()
188188
xmldata = settings['tmp_projectxmldata']
@@ -191,7 +191,7 @@ def link (self,
191191
fp.close()
192192
# Generate the project. Again a full pathname.
193193
projectfilename = os.path.join(os.getcwd(), os.path.join(build_temp, projectname))
194-
log.debug('\tCreate project file', projectfilename)
194+
log.debug('\tCreate project file %s', projectfilename)
195195
mkcwproject.makeproject(xmlfilename, projectfilename)
196196
# And build it
197197
log.debug('\tBuild project')
@@ -213,3 +213,31 @@ def _filename_to_abs(self, filename):
213213
if components[i] == '..':
214214
components[i] = ''
215215
return string.join(components, ':')
216+
217+
def library_dir_option (self, dir):
218+
"""Return the compiler option to add 'dir' to the list of
219+
directories searched for libraries.
220+
"""
221+
return # XXXX Not correct...
222+
223+
def runtime_library_dir_option (self, dir):
224+
"""Return the compiler option to add 'dir' to the list of
225+
directories searched for runtime libraries.
226+
"""
227+
# Nothing needed or Mwerks/Mac.
228+
return
229+
230+
def library_option (self, lib):
231+
"""Return the compiler option to add 'dir' to the list of libraries
232+
linked into the shared library or executable.
233+
"""
234+
return
235+
236+
def find_library_file (self, dirs, lib, debug=0):
237+
"""Search the specified list of directories for a static or shared
238+
library file 'lib' and return the full path to that file. If
239+
'debug' true, look for a debugging version (if that makes sense on
240+
the current platform). Return None if 'lib' wasn't found in any of
241+
the specified directories.
242+
"""
243+
return 0

Lib/distutils/sysconfig.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ def get_python_inc(plat_specific=0, prefix=None):
6666
elif os.name == "nt":
6767
return os.path.join(prefix, "include")
6868
elif os.name == "mac":
69-
return os.path.join(prefix, "Include")
69+
if plat_specific:
70+
return os.path.join(prefix, "Mac", "Include")
71+
else:
72+
return os.path.join(prefix, "Include")
7073
elif os.name == "os2":
7174
return os.path.join(prefix, "Include")
7275
else:
@@ -403,6 +406,8 @@ def _init_mac():
403406
g['install_lib'] = os.path.join(EXEC_PREFIX, "Lib")
404407
g['install_platlib'] = os.path.join(EXEC_PREFIX, "Mac", "Lib")
405408

409+
# These are used by the extension module build
410+
g['srcdir'] = ':'
406411
global _config_vars
407412
_config_vars = g
408413

0 commit comments

Comments
 (0)