.\python\import.c Modified to support dynamic loading in DLLs.
.\modules\posixmodule.cpp A few changes needed to this (which becomes NT module)
.\include\*.h Quite a few Python include files. Most of
these are a single change in defn for their global
object data item.
Build Process:
--------------
Hopefully, simply running MAKE_NT from the top-level Python directory will kick off a successful build. However, before you start, please make sure:
* Your compiler and linker etc are on your path.
* Your compiler and linker know where to locate their header and library files.
MAKE_NT is a batch file, which simply calls NMAKE on the lower level directories. Most options passed to the batchfile are passed directly onto NMAKE. Note that often Macro definitions must be passed in quotes.
The lower level makefiles get a lot of functionality from winnt32.mak, which has been designed to allow single makefiles across all NT platforms. As a result, many compile options are set by the facilities provided in the generic Winnt32.mak. For example:
make_nt "NODEBUG=1" will build an optimised version. There are also flags to build version for performance profiling etc. See winnt32.mak for descriptions of these.
To save lots of warnings for Microsoft Visual C++ users, you should also pass "MSVC=1" to the MAKE_NT batchfile.
Dynamic Loading:
----------------
Python supports dynamic loading of Python 'C' modules built as DLL's. Note that any DLL's used for dynamic loading _must_ be on PYTHONPATH, and need not be on the PATH. This is because Python itself searches for the file, and sends the fully qualified name to Windows.
For an example of Dynamic Loading, see the "Demo/nt.dl" directory.
Building Dynamically Loadable Modules:
--------------------------------------
In general, any Python extension 'C' module can be built as a DLL, with the following restriction: Any modules which define new Python data type _must_ be compiled by a C++ compiler. This is because this sort of extension module must take the address of a data item from the main Python DLL, and place it into a static pointer. The MSoft doco says this is because the C++ compiler guarantees the initialisation of this data, where the C compiler does not. (My guess is that this means that _code_ is required to initialise these vars, and not just a linker address resolution. Go figure!).
Anyway, the practical reality of this is that the code must be ANSI 'C', to be passed by the C++ compiler.
The file MAKE_NT.IN has some default rules for building extension DLL's, and the directory Demo/dl.nt" has a sample DLL.