Updated build instructions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19527 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -8,10 +8,9 @@ your sources from and what your desired end result is, there are
|
|||||||
several permutations of those steps. At a high level the basic steps
|
several permutations of those steps. At a high level the basic steps
|
||||||
are:
|
are:
|
||||||
|
|
||||||
1. Get the wxWindows sources
|
1. Get the sources
|
||||||
2. Build the wxWindows DLL
|
2. Build the wxWindows DLL
|
||||||
3. Get the wxPython sources
|
3. Build and Install wxPython
|
||||||
4. Build and Install wxPython
|
|
||||||
|
|
||||||
We'll go into more detail of each of these steps below, but first a
|
We'll go into more detail of each of these steps below, but first a
|
||||||
few bits of background information on tools.
|
few bits of background information on tools.
|
||||||
@@ -21,6 +20,10 @@ C++ sources used in the wxPython extension module. However you don't
|
|||||||
need to have SWIG unless you want to modify the *.i files. I've made
|
need to have SWIG unless you want to modify the *.i files. I've made
|
||||||
several modifications to SWIG specific to wxPython's needs and so the
|
several modifications to SWIG specific to wxPython's needs and so the
|
||||||
modified sources are included in the wx CVS at.../wxPython/wxSWIG.
|
modified sources are included in the wx CVS at.../wxPython/wxSWIG.
|
||||||
|
But because of the size and since most people won't need it my SWIG is
|
||||||
|
not included in the wxPythonSrc tarball. You'll need to get it from
|
||||||
|
CVS or a CVS snapshot.
|
||||||
|
|
||||||
If you need to modify the *.i files for wxPython then change to this
|
If you need to modify the *.i files for wxPython then change to this
|
||||||
directory and run:
|
directory and run:
|
||||||
|
|
||||||
@@ -42,6 +45,7 @@ If anybody wants to try it I'll take any required patches for the
|
|||||||
setup script and for these instructions.
|
setup script and for these instructions.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UNICODE
|
UNICODE
|
||||||
-------
|
-------
|
||||||
|
|
||||||
@@ -69,36 +73,34 @@ And now on to the fun stuff...
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
1. Get the wxWindows sources
|
1. Get the sources
|
||||||
----------------------------
|
------------------
|
||||||
|
|
||||||
A. There are a few possible ways to get sources for wxWindows. You
|
A. You can either use a tarball with the released version of the
|
||||||
can download a released version from http://wxwindows.org/ or you
|
source code for wxWindows/wxPython, or you can get current
|
||||||
can get current development sources from the CVS server. (Some
|
development sources from the CVS repository. (Some information
|
||||||
information about annonymous CVS access is at the
|
about annonymous CVS access is at the http://wxwindows.org/cvs.htm
|
||||||
http://wxwindows.org/cvs.htm site.) The advantage of using CVS is
|
site.) The advantage of using CVS is that you can easily update as
|
||||||
that you can easily update as soon as the developers check in new
|
soon as the developers check in new sources or fixes. The
|
||||||
sources or fixes. The advantage of using a released version is
|
advantage of using a released version is that it usually has had
|
||||||
that it usually has had more thorough testing done. You can decide
|
more thorough testing done. You can decide which method is best
|
||||||
which method is best for you.
|
for you. The released version file is named
|
||||||
|
wxPythonSrc-[version].tar.gz and is available from the wxPython
|
||||||
|
website at http://wxpython.org/download.php. You can use WinZip to
|
||||||
|
unpack it if you don't have tar and gzip.
|
||||||
|
|
||||||
B. You'll usually want to use wxWindows sources that have the same
|
|
||||||
version number as the wxPython sources you are using. (Another
|
|
||||||
advantage of using CVS is that you'll get both at the same time.)
|
|
||||||
|
|
||||||
C. Once you get the sources be sure to put them in a path without a
|
B. Once you get the sources be sure to put them in a path without a
|
||||||
space in it (i.e., NOT c:\Program Files\wx) and set an environment
|
space in it (i.e., NOT c:\Program Files\wx) and set an environment
|
||||||
variable named WXWIN to this directory. For example:
|
variable named WXWIN to the top level directory. For example:
|
||||||
|
|
||||||
mkdir \wx2
|
set WXWIN=c:\wx\wxPythonSrc-2.4.0.4
|
||||||
cd \wx2
|
|
||||||
unzip wxMSW-2.2.2.zip
|
|
||||||
set WXWIN=c:\wx2
|
|
||||||
|
|
||||||
You'll probably want to add that last line to your autoexec.bat or
|
You'll probably want to add that line to your autoexec.bat or
|
||||||
System Properties depending on the type of system you are on.
|
System Properties depending on the type of system you are on.
|
||||||
|
|
||||||
D. Change to the wx2\include\wx\msw directory and copy setup0.h to
|
|
||||||
|
C. Change to the %WXWIN%\include\wx\msw directory and copy setup0.h to
|
||||||
setup.h and then edit setup.h. This is how you control which parts
|
setup.h and then edit setup.h. This is how you control which parts
|
||||||
of wxWindows are compiled into or left out of the build, simply by
|
of wxWindows are compiled into or left out of the build, simply by
|
||||||
turning options on or off. I have the following differences from
|
turning options on or off. I have the following differences from
|
||||||
@@ -136,6 +138,7 @@ A. Although MSVC project files are provided I always use the makefiles
|
|||||||
Python, (and I make sure they stay that way.) You would have to
|
Python, (and I make sure they stay that way.) You would have to
|
||||||
edit the project files a bit to make it work otherwise.
|
edit the project files a bit to make it work otherwise.
|
||||||
|
|
||||||
|
|
||||||
B. There are three different types of wxWindows DLLs that can be
|
B. There are three different types of wxWindows DLLs that can be
|
||||||
produced by the VC makefile simply by providing a flag on the nmake
|
produced by the VC makefile simply by providing a flag on the nmake
|
||||||
command-line, I call the three types DEBUG, FINAL, and HYBRID.
|
command-line, I call the three types DEBUG, FINAL, and HYBRID.
|
||||||
@@ -159,43 +162,41 @@ B. There are three different types of wxWindows DLLs that can be
|
|||||||
wxmsw[version].dll. This DLL is compiled with optimizations
|
wxmsw[version].dll. This DLL is compiled with optimizations
|
||||||
turned on and without debugging information and without
|
turned on and without debugging information and without
|
||||||
__WXDEBUG__. The /MD flag is used which means that you
|
__WXDEBUG__. The /MD flag is used which means that you
|
||||||
can use this version with the standard python.exe. This
|
can use this version with the standard python.exe.
|
||||||
is the version that I use when making the binary installer
|
|
||||||
for win32.
|
|
||||||
|
|
||||||
HYBRID Specified with "FINAL=hybrid" and produces a DLL named
|
HYBRID Specified with "FINAL=hybrid" and produces a DLL named
|
||||||
wxmsw[version]h.dll. This DLL is almost the same as the
|
wxmsw[version]h.dll. This DLL is almost the same as the
|
||||||
DEBUG version except the /MD flag is used which means that
|
FINAL version except the __WXDEBUG__ is used which means
|
||||||
you can use the standard python.exe but you still get the
|
that you will get extra runtime assertions and validations
|
||||||
debugging info and the __WXDEBUG__ code enabled. With the
|
from wxWindows. If any of these fail then they are turned
|
||||||
debugger you can trace through the the code for the
|
into a Python exception that you can catch and deal with
|
||||||
wxPython extension and the wxWindows DLL, but not the
|
in your code. This is the version that I use when making
|
||||||
Python interpreter. You might use this version when you
|
the binary installer for win32.
|
||||||
want to deploy a wxPython app with the __WXDEBUG__ code
|
|
||||||
enabled. I use this mode most of the time during
|
|
||||||
development simply because it's easier than having to
|
|
||||||
remember to type python_d all the time.
|
|
||||||
|
|
||||||
Since different DLL names and object file directories are used you
|
Since different DLL names and object file directories are used you
|
||||||
can build all three types if you like.
|
can build all three types if you like.
|
||||||
|
|
||||||
C. Change to the wx2\src\msw directory and type the following command,
|
|
||||||
|
C. Change to the %WXWIN%\src\msw directory and type the following command,
|
||||||
using the value for FINAL that you want:
|
using the value for FINAL that you want:
|
||||||
|
|
||||||
nmake -f makefile.vc dll pch FINAL=hybrid
|
nmake -f makefile.vc dll FINAL=hybrid
|
||||||
|
|
||||||
Your machine will then crunch away for possibly a long time,
|
Your machine will then crunch away for possibly a long time,
|
||||||
depending on your hardware, and when it's done you should have a
|
depending on your hardware, and when it's done you should have a
|
||||||
DLL and some library files in \wx2\lib.
|
DLL and some library files in %WXWIN%\lib.
|
||||||
|
|
||||||
D. You'll either need to add \wx2\lib to the PATH or copy the DLL file
|
|
||||||
to a directory already on the PATH so the DLL can be found at
|
D. You'll either need to add %WXWIN%\lib to the PATH or copy the DLL
|
||||||
|
file to a directory already on the PATH so the DLL can be found at
|
||||||
runtime. Another option is to copy the DLL to the directory that
|
runtime. Another option is to copy the DLL to the directory that
|
||||||
the wxPython pacakge is installed to, for example,
|
the wxPython pacakge is installed to, for example,
|
||||||
c:\Python22\lib\site-packages\wxPython.
|
c:\Python22\lib\site-packages\wxPython.
|
||||||
|
|
||||||
|
|
||||||
E. You can test your build by changing to one of the directories under
|
E. You can test your build by changing to one of the directories under
|
||||||
\wx2\samples or \wx2\demos and typing (using the right FINAL flag):
|
%WXWIN%\samples or %WXWIN\demos and typing (using the right FINAL flag):
|
||||||
|
|
||||||
nmake -f makefile.vc FINAL=hybrid WXUSINGDLL=1
|
nmake -f makefile.vc FINAL=hybrid WXUSINGDLL=1
|
||||||
|
|
||||||
@@ -203,20 +204,8 @@ E. You can test your build by changing to one of the directories under
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
3. Get the wxPython sources
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
A. You have the same options (and same advantages/disadvantages) for
|
3. Build and Install wxPython
|
||||||
getting the wxPython source, either a released snapshot or from
|
|
||||||
CVS. The released version file is named wxPython-[version].tar.gz
|
|
||||||
and is available at http://wxpython.org/download.php. You can use
|
|
||||||
WinZip to unpack it if you don't have tar and gzip. If you want to
|
|
||||||
use CVS you'll find wxPython in the wxWindows CVS tree (see above)
|
|
||||||
in the wxWindows/wxPython directory.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
4. Build and Install wxPython
|
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
A. As mentioned previouslly, wxPython is built with the standard
|
A. As mentioned previouslly, wxPython is built with the standard
|
||||||
@@ -224,6 +213,7 @@ A. As mentioned previouslly, wxPython is built with the standard
|
|||||||
are all set, otherwise you need to download and install Distutils
|
are all set, otherwise you need to download and install Distutils
|
||||||
1.0 from http://www.python.org/sigs/distutils-sig/.
|
1.0 from http://www.python.org/sigs/distutils-sig/.
|
||||||
|
|
||||||
|
|
||||||
B. Change to the root wxPython directory and look at the setup.py
|
B. Change to the root wxPython directory and look at the setup.py
|
||||||
file. This is the script that configures and defines all the
|
file. This is the script that configures and defines all the
|
||||||
information that Distutils needs to build wxPython. There are some
|
information that Distutils needs to build wxPython. There are some
|
||||||
@@ -248,17 +238,7 @@ B. Change to the root wxPython directory and look at the setup.py
|
|||||||
will be executed to regenerate the wrapper C++
|
will be executed to regenerate the wrapper C++
|
||||||
and shadow python files.
|
and shadow python files.
|
||||||
|
|
||||||
IN_CVS_TREE If you are using the CVS version of the
|
etc.
|
||||||
wxWindows and wxPython sources, or a combined
|
|
||||||
source archive from the CVS snapshots or the
|
|
||||||
distributed wxPythonSrc-*.tar.gz then you will
|
|
||||||
need to set this flag to non-zero. This is
|
|
||||||
needed because some source files from the
|
|
||||||
wxWindows tree are copied to be under the
|
|
||||||
wxPython tree in order to keep Distutils happy.
|
|
||||||
With this flag set then setup.py will
|
|
||||||
automatically keep these copied sources up to
|
|
||||||
date if the original version is ever updated.
|
|
||||||
|
|
||||||
|
|
||||||
C. To build and install wxPython you simply need to execute the
|
C. To build and install wxPython you simply need to execute the
|
||||||
@@ -287,6 +267,7 @@ D. At this point you should be able to change into the wxPython\demo
|
|||||||
|
|
||||||
python demo.py
|
python demo.py
|
||||||
|
|
||||||
|
|
||||||
E. If you would like to make a test build that doesn't overwrite the
|
E. If you would like to make a test build that doesn't overwrite the
|
||||||
installed version of wxPython you can do so with one of these
|
installed version of wxPython you can do so with one of these
|
||||||
commands instead of the install command above:
|
commands instead of the install command above:
|
||||||
@@ -302,8 +283,8 @@ E. If you would like to make a test build that doesn't overwrite the
|
|||||||
To run using this test version just add the base wxPython source
|
To run using this test version just add the base wxPython source
|
||||||
directory to the PYTHONPATH:
|
directory to the PYTHONPATH:
|
||||||
|
|
||||||
set PYTHONPATH=c:\wx2\wxPython
|
set PYTHONPATH=%WXDIR%\wxPython
|
||||||
cd c:\wx2\wxPython\demo
|
cd %WXDIR%\wxPython\demo
|
||||||
python demo.py
|
python demo.py
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user