]>
Commit | Line | Data |
---|---|---|
41509312 RD |
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. For *nix systems I run configure with these | |
25 | flags: | |
26 | ||
27 | --with-gtk | |
28 | --with-libjpeg | |
29 | --without-odbc | |
30 | --enable-unicode=no | |
31 | --enable-threads=yes | |
32 | --enable-socket=yes | |
33 | --enable-static=no | |
34 | --enable-shared=yes | |
35 | --disable-std_iostreams | |
36 | ||
37 | You can use whatever flags you want, but these work for me. | |
38 | ||
39 | For Win32 systems I use Visual C++ 6.0, but 5.0 should work. The | |
1b55cabf | 40 | wxPython build utility currently does not support any other win32 |
41509312 RD |
41 | compilers. Be sure to copy include/wx/msw/setup0.h to |
42 | include/wx/msw/setup.h and edit it for the options you want. | |
43 | ||
44 | ||
45 | 2. For either platform, you should be sure to set an environment | |
46 | variable named WXWIN to be the path to the top of the wxWindows | |
47 | tree. | |
48 | ||
1b55cabf | 49 | |
41509312 RD |
50 | 3. If you are working from a copy of the code retrieved from CVS, then |
51 | you will find wxPython in $WXWIN/utils/wxPython. If you are | |
52 | working from the tar.gz or .zip files then you will probably want | |
53 | to unpack wxPython in the $WXWIN/utils directory and rename the new | |
54 | directory to wxPython (or use a symlink.) If you want to keep it | |
55 | in a separate directory then you can change where the build.py tool | |
1b55cabf | 56 | expects to find it by creating a file named build.local (see step 7 |
41509312 RD |
57 | for more examples about build.local,) containing something like |
58 | this: | |
59 | ||
60 | WXPSRCDIR = "~/MyStuff/wxPython-2.1.11/src" | |
61 | ||
62 | ||
63 | 4. At this point you may want to make an alias or symlink, script, | |
1b55cabf | 64 | batch file, or whatever on the PATH that invokes |
41509312 RD |
65 | $WXWIN/utils/wxPython/distrib/build.py to help simplify matters |
66 | somewhat. For example, on my win32 system I have a file named | |
67 | build.bat in a directory on the PATH that contains: | |
68 | ||
69 | python %WXWIN%/utils/wxPython/distrib/build.py %1 %2 %3 %4 %5 %6 | |
70 | ||
71 | ||
72 | 5. Change into the $(WXWIN)/utils/wxPython/src directory. | |
73 | ||
74 | ||
1b55cabf RD |
75 | 6. If you don't use SWIG, or have a new enough version installed, you |
76 | may have to update the timestamps of the files it generates so the | |
77 | make utility won't think they are out of date and try to run SWIG | |
78 | to update them. The standard touch utility can do this for you: | |
79 | ||
80 | touch gtk/*.cpp gtk/*.py | |
81 | ||
82 | ||
83 | 7. Type "build -b" to build wxPython and "build -i" to install it. | |
41509312 RD |
84 | |
85 | The build.py script actually generates a Makefile based on what it | |
86 | finds on your system and information found in the build.cfg file. | |
87 | If you have troubles building or you want it built or installed in | |
88 | a different way, take a look at the docstring in build.py. You may | |
89 | be able to override configuration options in a file named | |
1b55cabf RD |
90 | build.local. For example, you can set a new TARGETDIR (the |
91 | installation directory) just by creating a file named build.local | |
92 | in your wxPython source directory and assign a value to it, like | |
93 | this: | |
41509312 RD |
94 | |
95 | TARGETDIR = "/usr/local/lib/python1.5/site-packages/wxPython" | |
96 | ||
97 | The build.local file is executed as Python code so you can do very | |
98 | creative things there if you need to. | |
99 | ||
100 | ||
1b55cabf | 101 | 8. To build and install the add-on modules, change to the appropriate |
41509312 RD |
102 | directory under $WXWIN/utils/wxPython/modules and run the build |
103 | utility again. | |
104 | ||
105 | ||
1b55cabf | 106 | 9. Change to the $WXWIN/utils/wxPython/demo directory. |
41509312 RD |
107 | |
108 | ||
1b55cabf | 109 | 10. Try executing the demo program. For example: |
41509312 RD |
110 | |
111 | python demo.py | |
112 | ||
1b55cabf RD |
113 | To run it without requiring a console on win32, you can use the |
114 | pythonw.exe version of Python either from the command line or from | |
115 | a shortcut. | |
116 | ||
117 | ||
118 | ||
41509312 RD |
119 | |
120 |