The attached patch fixes the followoing problems:
diff -cr distutils/command/build_ext.py distutils.new/command/build_ext.py *** distutils/command/build_ext.py Wed Mar 29 10:33:48 2000 --- distutils.new/command/build_ext.py Wed Mar 29 21:16:16 2000
* 125,130 ** --- 125,141 ----
# XXX how the heck are 'self.define' and 'self.undef' supposed to
# be set?
* 189,195 ** self.compiler.set_link_objects (self.link_objects)
# Now actually compile and link everything.
! self.build_extensions ()
# run ()
--- 200,206 ---- self.compiler.set_link_objects (self.link_objects)
# Now actually compile and link everything.
! self.build_extensions (self.extensions)
# run ()
* 313,318 ** --- 324,336 ---- else: modname = string.split (extension_name, '.')[-1] extra_args.append('/export:init%s'%modname)
extra_args.append ('/IMPLIB:' + implib_dir) # if MSVC
fullname = self.get_ext_fullname (extension_name)
* 351,356 ** --- 369,385 ---- def get_ext_filename (self, ext_name): from distutils import sysconfig ext_path = string.split (ext_name, '.')
return apply (os.path.join, ext_path) + '.lib'
# class BuildExt diff -cr distutils/msvccompiler.py distutils.new/msvccompiler.py *** distutils/msvccompiler.py Wed Mar 29 09:01:40 2000 --- distutils.new/msvccompiler.py Wed Mar 29 20:58:54 2000
* 319,333 ** raise TypeError, "'output_dir' must be a string or None" if output_dir is not None: output_filename = os.path.join (output_dir, output_filename)
if self._need_link (objects, output_filename):
if debug:
ldflags = self.ldflags_shared_debug
--- 319,331 ---- raise TypeError, "'output_dir' must be a string or None" if output_dir is not None: output_filename = os.path.join (output_dir, output_filename)
output_dir = os.path.dirname (output_filename)
if self._need_link (objects, output_filename):
if debug:
ldflags = self.ldflags_shared_debug
else:
ldflags = self.ldflags_shared
Thomas Heller ION-TOF GmbH
How about using the same convention Python itself does?
Debug and release outputs go into the same directory (as they have different names - _d for debug). This allows people to add the build directory to their sys.path, and have it work for both debug and release.
Build\Temp\Release and Build\Temp\Debug are where the intermediate files go. This makes it easy to manually clean your file system - one directory and all temp files are gone.
Mark.
How about using the same convention Python itself does?
Debug and release outputs go into the same directory (as they have different names - _d for debug). This allows people to add the build directory to their sys.path, and have it work for both debug and release.
Build\Temp\Release and Build\Temp\Debug are where the intermediate files go. This makes it easy to manually clean your file system - one directory and all temp files are gone.
Mark.
It seems my description was unclear: Intermediate files go into build\temp.win32\Release... or build\temp.win32\Debug... These are: .obj, .lib, .exp files.
Debug and Release outputs go into the same directory, debug versions have _d appended.
Cleaning files: distutils now has a clean command (which will delete build\temp.win32 directory): Manual cleaning not needed.
Thomas
On 29 March 2000, Thomas Heller said:
The attached patch fixes the followoing problems:
Thanks! I see a few potential problems here (maybe -- remember, I'm not a Windows user, so if these sound like trying to apply The Unix Way to Windows, tell me).
So you'll have build directories build/temp.nt/Debug and build/temp.nt/Release -- is that somehow better than build/temp.nt-debug and build/temp.nt-release? I was kinda thinking along the latter lines; I don't think it makes any difference, apart from aesthetics. Does it? I'm guessing that The Microsoft Way would be to create an unnecessarily deep hierarchy.
diff -cr distutils/msvccompiler.py distutils.new/msvccompiler.py *** distutils/msvccompiler.py Wed Mar 29 09:01:40 2000 --- distutils.new/msvccompiler.py Wed Mar 29 20:58:54 2000 [...] --- 319,331 ---- raise TypeError, "'output_dir' must be a string or None" if output_dir is not None: output_filename = os.path.join (output_dir, output_filename)
What does this add? The name 'output_dir' isn't referenced anywhere after this point.
I fixed the stupid 'build_extensions' bug differently, so that part of your patch is unneeded. (Thanks anyway. ;-)
There, I've just applied your patch, discarded the unneeded 'build_extensions' and 'output_dir' bits, and checked it all in. Looks like it all still works for me under Linux...
Thanks again!
Greg
-- Greg Ward - Unix bigot gward@python.net http://starship.python.net/~gward/ God is real, unless declared integer.
So you'll have build directories build/temp.nt/Debug and build/temp.nt/Release -- is that somehow better than build/temp.nt-debug and build/temp.nt-release? I was kinda thinking along the latter lines; I don't think it makes any difference, apart from aesthetics. Does
Nope - just aesthetics. This is my preference, as it is a single directory to ignore, rather than 2 :-)
I'm guessing that The Microsoft Way would be to create an unnecessarily deep hierarchy.
Actually, by default it is very shallow - all temp and output files go into either ".\Release" or ".\Debug" - adding the intermediate layers (and sneaking them into Python itself) is my doing :-)
But given the 2 alternatives above, my preference is so slight it is barely worth mentioning :-)
I can't answer your other question...
Mark.
diff -cr distutils/msvccompiler.py distutils.new/msvccompiler.py *** distutils/msvccompiler.py Wed Mar 29 09:01:40 2000 --- distutils.new/msvccompiler.py Wed Mar 29 20:58:54 2000 [...] --- 319,331 ---- raise TypeError, "'output_dir' must be a string or None" if output_dir is not None: output_filename = os.path.join (output_dir, output_filename)
What does this add? The name 'output_dir' isn't referenced anywhere after this point. Not needed any longer. You are right.
There, I've just applied your patch, discarded the unneeded 'build_extensions' and 'output_dir' bits, and checked it all in. Looks like it all still works for me under Linux...
I did an cvs update this morning, and it works. Thanks!
Thomas