[Distutils] Re: Help with --with-pydebug installation of NumPy on Windows?

David Abrahams David Abrahams" <david.abrahams@rcn.com
Tue Apr 9 00:59:01 2002


Thanks very much, Thomas! I would have done something like this myself,
but I don't know the distutils internals very well.

I hope you get this into the next release. Does it require any external
stimulation (e.g. setup.py changes), or does it "just work"?

-Dave

----- Original Message -----
From: "Thomas Heller" <thomas.heller@ion-tof.com>
To: "Tim Peters" <tim.one@comcast.net>; "David Abrahams"
<david.abrahams@rcn.com>
Cc: <distutils-sig@python.org>
Sent: Monday, April 08, 2002 3:14 AM
Subject: Re: Help with --with-pydebug installation of NumPy on Windows?


> [CC to distutils-sig. The context is: distutils doesn't work
> with source distributions on windows]
>
> David, Tim,
>
> Here is a patch which allows distutils on windows to work
> with the source distribution. I've tested it with Numeric,
> but nothing else so far:
>
> Index: build_ext.py
> ===================================================================
> RCS file:
/cvsroot/python/python/dist/src/Lib/distutils/command/build_ext.py,v
> retrieving revision 1.79
> diff -c -r1.79 build_ext.py
> *** build_ext.py 31 Jan 2002 18:56:00 -0000 1.79
> --- build_ext.py 8 Apr 2002 08:09:33 -0000
> ***************
> *** 167,172 ****
> --- 167,176 ----
>               else:
>                   self.build_temp = os.path.join(self.build_temp,
"Release")
>
> +             # Append the source distribution include and library
directories
> +             self.include_dirs.append(os.path.join(sys.exec_prefix,
'PC'))
> +             self.library_dirs.append(os.path.join(sys.exec_prefix,
'PCBuild'))
> +
>           # OS/2 (EMX) doesn't support Debug vs Release builds, but
has the
>           # import libraries in its "Config" subdirectory
>           if os.name == 'os2':
>
> And here is one which is also very useful for debug builds: it feeds
> absolute path names to MSVC, which has the advantage that the MSVC
debugger
> finds the debugged files automatically, without asking the user to
find them:
>
> Index: msvccompiler.py
> ===================================================================
> RCS file:
/cvsroot/python/python/dist/src/Lib/distutils/msvccompiler.py,v
> retrieving revision 1.45
> diff -c -r1.45 msvccompiler.py
> *** msvccompiler.py 8 Feb 2002 14:41:31 -0000 1.45
> --- msvccompiler.py 8 Apr 2002 08:12:47 -0000
> ***************
> *** 309,314 ****
> --- 309,316 ----
>               else:
>                   self.mkpath (os.path.dirname (obj))
>
> +                 if debug:
> +                     src = os.path.abspath(src)
>                   if ext in self._c_extensions:
>                       input_opt = "/Tc" + src
>                   elif ext in self._cpp_extensions:
>
> IMO, both changes look innocent enough so that I could check
> them into CVS.
>
> Thomas
>