]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/BUILD.txt
More updates.
[wxWidgets.git] / utils / wxPython / BUILD.txt
1 Build Instructions
2 ------------------
3 I used SWIG (http://www.swig.org) to create the source code for the
4 extension module. This enabled me to only have to deal with a small
5 amount of code and only have to bother with the exceptional issues.
6 SWIG takes care of the rest and generates all the repetative code for
7 me. You don't need SWIG to build the extension module as all the
8 generated C++ code is included under the src directory.
9
10 I added a few minor features to SWIG to control some of the code
11 generation. If you want to play around with this you will need to get
12 a recent version of SWIG from their CVS or from a daily build. See
13 http://www.swig.org/ for details.
14
15 wxPython is organized as a Python package. This means that the
16 directory containing the results of the build process should be a
17 subdirectory of a directory on the PYTHONPATH. (And preferably should
18 be named wxPython.) You can control where the build process will dump
19 wxPython by setting the TARGETDIR variable for the build utility, (see
20 below.)
21
22
23 1. Build and install wxWindows as described in its BuildCVS.txt or
24 INSTALL.txt file.
25
26 1a. Building wxWindows on Unix/Linux.
27
28 For *nix systems I run configure with these flags:
29
30 --with-gtk
31 --with-libjpeg
32 --without-odbc
33 --enable-unicode=no
34 --enable-threads=yes
35 --enable-socket=yes
36 --enable-static=no
37 --enable-shared=yes
38 --disable-std_iostreams
39
40 You can use whatever flags you want, but these work for me. Be
41 sure to run "make install" to install the wxWindows headers and
42 shared library. You can check where the wxPython build will expect
43 to find them by running "wx-config --cflags" and "wx-config --libs"
44
45 1b. Building wxWindows on Win32.
46
47 For Win32 systems I use Visual C++ 6.0, but 5.0 should work. The
48 wxPython build utility currently does not support any other win32
49 compilers. Be sure to copy include/wx/msw/setup0.h to
50 include/wx/msw/setup.h and edit it for the options you want. At a
51 minimum you should set the following:
52
53 wxUSE_NEW_GRID 0
54 wxUSE_GLOBAL_MEMORY_OPERATORS 0
55 wxUSE_LIBTIFF 1
56
57 I also change these:
58
59 wxUSE_DIALUP_MANAGER 0
60 wxUSE_SOCKETS 0
61 wxUSE_FS_INET 0
62
63 There are probably other flags that can be disabled to remove
64 things not being used in wxPython, but I havn't investigated all
65 the potential configurations yet.
66
67 I find it easiest to build wxWindows using the makefiles, that way
68 I don't have to worry about what the IDE might be doing behind the
69 scenes that might screw things up. Simply go to the src/msw
70 directory and run:
71
72 nmake -f makefile.vc CRTFLAG=/MD EXTRAFLAGS=-D__NO_VC_CRTDBG__ dll pch
73
74 If you want to make a release build, add FINAL=1 to the nmake
75 command, as well as to build.local for wxPython, (see below.)
76
77
78 2. For either platform, you should be sure to set an environment
79 variable named WXWIN to be the path to the top of the wxWindows
80 tree.
81
82
83 3. If you are working from a copy of the code retrieved from CVS, then
84 you will find wxPython in $WXWIN/utils/wxPython. If you are
85 working from the tar.gz or .zip files then you will probably want
86 to unpack wxPython in the $WXWIN/utils directory and rename the new
87 directory to wxPython (or use a symlink.) If you want to keep it
88 in a separate directory then you can change where the build.py tool
89 expects to find it by creating a file named build.local (see step 7
90 for more examples about build.local,) containing something like
91 this:
92
93 WXPSRCDIR = "~/MyStuff/wxPython-2.1.11/src"
94
95
96 4. At this point you may want to make an alias or symlink, script,
97 batch file, or whatever on the PATH that invokes
98 $WXWIN/utils/wxPython/distrib/build.py to help simplify matters
99 somewhat. For example, on my win32 system I have a file named
100 build.bat in a directory on the PATH that contains:
101
102 python %WXWIN%/utils/wxPython/distrib/build.py %1 %2 %3 %4 %5 %6
103
104
105 5. Change into the $(WXWIN)/utils/wxPython/src directory.
106
107
108 6. If you don't use SWIG, or have a new enough version installed, you
109 may have to update the timestamps of the files it generates so the
110 make utility won't think they are out of date and try to run SWIG
111 to update them. The standard touch utility can do this for you:
112
113 touch gtk/*.cpp gtk/*.py
114
115
116 7. Type "build -b" to build wxPython and "build -i" to install it.
117
118 The build.py script actually generates a Makefile based on what it
119 finds on your system and information found in the build.cfg file.
120 If you have troubles building or you want it built or installed in
121 a different way, take a look at the docstring in build.py. You may
122 be able to override configuration options in a file named
123 build.local. For example, you can set a new TARGETDIR (the
124 installation directory) just by creating a file named build.local
125 in your wxPython source directory and assign a value to it, like
126 this:
127
128 TARGETDIR = "/usr/local/lib/python1.5/site-packages/wxPython"
129
130 The build.local file is executed as Python code so you can do very
131 creative things there if you need to.
132
133
134 8. To build and install the add-on modules, change to the appropriate
135 directory under $WXWIN/utils/wxPython/modules and run the build
136 utility again.
137
138
139 9. Change to the $WXWIN/utils/wxPython/demo directory.
140
141
142 10. Try executing the demo program. For example:
143
144 python demo.py
145
146 To run it without requiring a console on win32, you can use the
147 pythonw.exe version of Python either from the command line or from
148 a shortcut.