1999-11-25 02:12:34 -05:00
|
|
|
Build Instructions
|
|
|
|
------------------
|
|
|
|
I used SWIG (http://www.swig.org) to create the source code for the
|
|
|
|
extension module. This enabled me to only have to deal with a small
|
|
|
|
amount of code and only have to bother with the exceptional issues.
|
|
|
|
SWIG takes care of the rest and generates all the repetative code for
|
|
|
|
me. You don't need SWIG to build the extension module as all the
|
|
|
|
generated C++ code is included under the src directory.
|
|
|
|
|
|
|
|
I added a few minor features to SWIG to control some of the code
|
|
|
|
generation. If you want to play around with this you will need to get
|
|
|
|
a recent version of SWIG from their CVS or from a daily build. See
|
|
|
|
http://www.swig.org/ for details.
|
|
|
|
|
|
|
|
wxPython is organized as a Python package. This means that the
|
|
|
|
directory containing the results of the build process should be a
|
|
|
|
subdirectory of a directory on the PYTHONPATH. (And preferably should
|
|
|
|
be named wxPython.) You can control where the build process will dump
|
|
|
|
wxPython by setting the TARGETDIR variable for the build utility, (see
|
|
|
|
below.)
|
|
|
|
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-11-25 02:12:34 -05:00
|
|
|
1. Build and install wxWindows as described in its BuildCVS.txt or
|
2000-01-31 16:07:04 -05:00
|
|
|
INSTALL.txt file.
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
1a. Building wxWindows on Unix/Linux/Etc.
|
2000-01-31 16:07:04 -05:00
|
|
|
|
|
|
|
For *nix systems I run configure with these flags:
|
1999-11-25 02:12:34 -05:00
|
|
|
|
|
|
|
--with-gtk
|
|
|
|
--with-libjpeg
|
2000-07-15 15:51:35 -04:00
|
|
|
--with-opengl
|
1999-11-25 02:12:34 -05:00
|
|
|
--without-odbc
|
|
|
|
--enable-unicode=no
|
|
|
|
--enable-threads=yes
|
|
|
|
--enable-socket=yes
|
|
|
|
--enable-static=no
|
|
|
|
--enable-shared=yes
|
|
|
|
--disable-std_iostreams
|
2000-07-15 15:51:35 -04:00
|
|
|
--enable-newgrid
|
|
|
|
|
|
|
|
You can use whatever flags you want, but these work for me. If you
|
|
|
|
want debug libraries, then you should add the "--enable-debug
|
|
|
|
--enable-mem_tracing" flags. I reccommend creating an empty build
|
|
|
|
directory, and then running make and configure from there. This
|
|
|
|
makes it easy to experiment with different configure options
|
|
|
|
without losing old builds.
|
1999-11-25 02:12:34 -05:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Be sure to run "make install" to install the wxWindows headers and
|
2000-01-31 16:07:04 -05:00
|
|
|
shared library. You can check where the wxPython build will expect
|
|
|
|
to find them by running "wx-config --cflags" and "wx-config --libs"
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
1b. Building wxWindows on Win32.
|
1999-11-25 02:12:34 -05:00
|
|
|
|
|
|
|
For Win32 systems I use Visual C++ 6.0, but 5.0 should work. The
|
1999-12-31 03:29:02 -05:00
|
|
|
wxPython build utility currently does not support any other win32
|
1999-11-25 02:12:34 -05:00
|
|
|
compilers. Be sure to copy include/wx/msw/setup0.h to
|
2000-01-31 16:07:04 -05:00
|
|
|
include/wx/msw/setup.h and edit it for the options you want. At a
|
|
|
|
minimum you should set the following:
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
wxUSE_NEW_GRID 1
|
2000-01-31 16:07:04 -05:00
|
|
|
wxUSE_GLOBAL_MEMORY_OPERATORS 0
|
|
|
|
wxUSE_LIBTIFF 1
|
2000-07-15 15:51:35 -04:00
|
|
|
wxUSE_GLCANVAS 1
|
2000-01-31 16:07:04 -05:00
|
|
|
|
|
|
|
I also change these:
|
|
|
|
|
|
|
|
wxUSE_DIALUP_MANAGER 0
|
2000-07-15 15:51:35 -04:00
|
|
|
wxUSE_DYNLIB_CLASS 0
|
|
|
|
wxUSE_DOC_VIEW_ARCHITECTURE 0
|
|
|
|
wxUSE_MDI_ARCHITECTURE 0
|
|
|
|
wxUSE_PLOT 0
|
|
|
|
wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0
|
|
|
|
|
2000-01-31 16:07:04 -05:00
|
|
|
|
|
|
|
There are probably other flags that can be disabled to remove
|
|
|
|
things not being used in wxPython, but I havn't investigated all
|
|
|
|
the potential configurations yet.
|
|
|
|
|
|
|
|
I find it easiest to build wxWindows using the makefiles, that way
|
|
|
|
I don't have to worry about what the IDE might be doing behind the
|
|
|
|
scenes that might screw things up. Simply go to the src/msw
|
|
|
|
directory and run:
|
|
|
|
|
|
|
|
nmake -f makefile.vc CRTFLAG=/MD EXTRAFLAGS=-D__NO_VC_CRTDBG__ dll pch
|
|
|
|
|
|
|
|
If you want to make a release build, add FINAL=1 to the nmake
|
|
|
|
command, as well as to build.local for wxPython, (see below.)
|
1999-11-25 02:12:34 -05:00
|
|
|
|
|
|
|
|
2000-08-08 02:11:51 -04:00
|
|
|
2. For the win32 platform you should be sure to set an environment
|
1999-11-25 02:12:34 -05:00
|
|
|
variable named WXWIN to be the path to the top of the wxWindows
|
2000-08-08 02:11:51 -04:00
|
|
|
source tree.
|
1999-11-25 02:12:34 -05:00
|
|
|
|
1999-12-31 03:29:02 -05:00
|
|
|
|
1999-11-25 02:12:34 -05:00
|
|
|
3. If you are working from a copy of the code retrieved from CVS, then
|
2000-07-15 15:51:35 -04:00
|
|
|
you will find wxPython in $WXWIN/wxPython. If you are working from
|
|
|
|
the tar.gz or .zip files then you will probably want to unpack
|
|
|
|
wxPython in the $WXWIN directory and rename the new directory to
|
|
|
|
wxPython (or use a symlink.) If you want to keep it in a separate
|
|
|
|
directory then you can change where the build.py tool expects to
|
|
|
|
find it by creating a file named build.local (see step 7 for more
|
|
|
|
examples about build.local,) containing something like this:
|
1999-11-25 02:12:34 -05:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
WXPSRCDIR = "~/MyStuff/wxPython-2.1.15/src"
|
1999-11-25 02:12:34 -05:00
|
|
|
|
2000-08-08 02:11:51 -04:00
|
|
|
If your wxPython sources are not under $WXWIN then you'll need to
|
|
|
|
adjust the remainder of these instructions accordingly.
|
|
|
|
|
1999-11-25 02:12:34 -05:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
4. At this point you may want to make an alias, symlink, script,
|
1999-12-31 03:29:02 -05:00
|
|
|
batch file, or whatever on the PATH that invokes
|
2000-07-15 15:51:35 -04:00
|
|
|
$WXWIN/wxPython/distrib/build.py to help simplify matters somewhat.
|
|
|
|
For example, on my win32 system I have a file named build.bat in a
|
|
|
|
directory on the PATH that contains:
|
1999-11-25 02:12:34 -05:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
python %WXWIN%/wxPython/distrib/build.py %1 %2 %3 %4 %5 %6
|
1999-11-25 02:12:34 -05:00
|
|
|
|
|
|
|
|
2000-08-08 02:11:51 -04:00
|
|
|
5. Change into the $(WXWIN)/wxPython/src directory.
|
1999-11-25 02:12:34 -05:00
|
|
|
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
6. If you don't use SWIG, or don't have a new enough version
|
|
|
|
installed, you may have to update the timestamps of the files it
|
|
|
|
generates so the make utility won't think they are out of date and
|
|
|
|
try to run SWIG to update them. The standard touch utility can do
|
|
|
|
this for you:
|
1999-12-31 03:29:02 -05:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
touch gtk/*.cpp gtk/*.py
|
|
|
|
or
|
|
|
|
touch msw\*.cpp msw\*.py
|
1999-12-31 03:29:02 -05:00
|
|
|
|
|
|
|
|
|
|
|
7. Type "build -b" to build wxPython and "build -i" to install it.
|
1999-11-25 02:12:34 -05:00
|
|
|
|
|
|
|
The build.py script actually generates a Makefile based on what it
|
|
|
|
finds on your system and information found in the build.cfg file.
|
|
|
|
If you have troubles building or you want it built or installed in
|
2000-07-15 15:51:35 -04:00
|
|
|
a different way, take a look at the doc-string in build.py. You may
|
1999-11-25 02:12:34 -05:00
|
|
|
be able to override configuration options in a file named
|
1999-12-31 03:29:02 -05:00
|
|
|
build.local. For example, you can set a new TARGETDIR (the
|
|
|
|
installation directory) just by creating a file named build.local
|
|
|
|
in your wxPython source directory and assign a value to it, like
|
|
|
|
this:
|
1999-11-25 02:12:34 -05:00
|
|
|
|
|
|
|
TARGETDIR = "/usr/local/lib/python1.5/site-packages/wxPython"
|
|
|
|
|
|
|
|
The build.local file is executed as Python code so you can do very
|
|
|
|
creative things there if you need to.
|
|
|
|
|
|
|
|
|
1999-12-31 03:29:02 -05:00
|
|
|
8. To build and install the add-on modules, change to the appropriate
|
2000-07-15 15:51:35 -04:00
|
|
|
directory under $WXWIN/wxPython/contrib and run the build utility
|
|
|
|
again.
|
1999-11-25 02:12:34 -05:00
|
|
|
|
|
|
|
|
2000-08-08 02:11:51 -04:00
|
|
|
9. Change to the $WXWIN/wxPython/demo directory.
|
1999-11-25 02:12:34 -05:00
|
|
|
|
|
|
|
|
1999-12-31 03:29:02 -05:00
|
|
|
10. Try executing the demo program. For example:
|
1999-11-25 02:12:34 -05:00
|
|
|
|
|
|
|
python demo.py
|
|
|
|
|
1999-12-31 03:29:02 -05:00
|
|
|
To run it without requiring a console on win32, you can use the
|
|
|
|
pythonw.exe version of Python either from the command line or from
|
|
|
|
a shortcut.
|