]> git.saurik.com Git - wxWidgets.git/blame - wxPython/wxSWIG/README
added clipping test
[wxWidgets.git] / wxPython / wxSWIG / README
CommitLineData
c90f71dd
RD
1SWIG (Simplified Wrapper and Interface Generator)
2Version 1.1 (Maintenance)
3
4Copyright (C) 1995-1999
5University of Utah and the Regents of the University of California
6
7August 8, 1999
8
91. Introduction
10---------------
11SWIG is a compiler that attempts to make it easy to integrate C, C++,
12or Objective-C code with scripting languages including Perl, Tcl, and
13Python. In a nutshell, you give it a bunch of ANSI C/C++ declarations
14and it generates an interface between C and your favorite scripting
15language. However, this is only scratching the surface of what SWIG
16can do--some of its more advanced features include automatic
17documentation generation, module and library management, extensive
18customization options, and more.
19
20SWIG is entirely the product of users who have used the system and
21suggested new ideas. There are far too many people to thank
22individually, but without this support, SWIG would be not be nearly as
23powerful or fun to use as it is now. Many thanks!
24
252. Currently Supported Languages
26----------------------------------
27
28To use SWIG, you will need at least one of the following scripting
29languages :
30
31 Tcl7.3, Tk3.6 (and all newer versions)
32 Tcl8.0, Tk8.0 (somewhat experimental)
33 Python1.3 (or newer)
34 Perl5.003 (or newer)
35 Perl4
36 FSF Guile 1.0 (experimental)
37
38If you don't have any of these, SWIG will still compile, but it won't
39be particularly useful. Note : it is not necessary to have *all* of
40these languages installed to use SWIG--only the scripting languages you
41want to use.
42
433. Installation (Unix)
44------------------------
45
46To compile and use SWIG, you will need the following on your machine:
47
48 A C++ compiler (ie. g++)
49 An ANSI C compiler (ie. gcc)
50 yacc or bison (only needed if you are going to rebuild the SWIG parser)
51
52To compile and install SWIG, type the following :
53
54 ./configure
55 make
56 make runtime (optional. see below)
57 make install
58
59The configuration script will attempt to locate various packages on
60your machine, including Tcl, Perl5, and Python. Don't panic if
61you get 'not found' messages--SWIG does not need these packages
62to compile or run. The configure script is actually looking for
63these packages so that you can try out the SWIG examples contained
64in the 'Examples' directory without having to hack Makefiles.
65See the Examples section below for more details.
66
67The 'make runtime' option is an optional step that can be used to
68build the SWIG runtime libraries. These libraries are only used with
69larger packages and are not necessary for learning SWIG or trying
70the examples (please refer to the "Advanced topics" section of the
71SWIG Users manual for more details about this).
72
73Typing 'make test' will run a rather extensive series of tests
74and can be run before running 'make install' (if you are paranoid).
75
76There are a number of configuration options that you can give to
77'configure' :
78
79 --prefix=/usr/local
80
81 Set the installation prefix. SWIG installs into
82 /usr/local by default.
83
84 --exec_prefix=/usr/local
85
86 Set the prefix used to install platform specific
87 files (binaries and libraries). Use this if the
88 location is different than that given with --prefix.
89
90 --with-lang={TCL,TCL8,PYTHON,PERL5,PERL4,GUILE}
91
92 This lets you choose the default SWIG target language.
93 By default, SWIG chooses TCL, but you can select
94 another as shown :
95
96 ./configure --with-lang=PYTHON
97
98 --with-doc={ASCII,LATEX,HTML,NODOC}
99
100 This lets you choose the default SWIG documentation
101 method. By default, SWIG chooses ASCII.
102
103
1044. Site specific installation
105-------------------------------
106
107While not required for compiling SWIG, the configuration script looks
108for various packages in order to create a makefile for compiling the
109examples. This makefile is also installed with the SWIG package.
110The following configuration options can be used to set the location
111of various packages.
112
113--with-tcl=pathname - Set root directory of Tcl installation.
114 SWIG will use $pathname/include and
115 $pathname/lib.
116
117--with-tclincl=pathname - Set exact location of Tcl include files
118
119--with-tcllib=pathname - Set exact location of Tcl library files
120
121--with-itcl=pathname - Same as above but for [incr Tcl]
122
123--with-itclincl=pathname - Location of [incr Tcl] include files
124
125--with-itcllib=pathname - Location of [incr Tcl] libraries
126
127--with-py=pathname - Set package location of Python. This is usually
128 something like /usr/local. configure will attempt
129 to locate the appropriate include and library files.
130
131--with-pyincl=pathname - Set location of Python include files
132 (for example, /usr/local/include)
133
134--with-pylib=pathname - Set location of Python library files
135 (for example, /usr/local/lib)
136
137--with-perl5=executable - Specify your perl5 executable. SWIG will figure
138 out where files are by running this version of
139 Perl and grabbing its configuration data.
140
141
142Other options :
143
144--without-yacc - Try to compile SWIG using a pregenerated YACC
145 file generated by Berkeley YACC (byacc). Only recommended
146 if you get compiler errors when trying to compile parser.y
147 or parser.cxx.
148
149Changing the C++ compiler:
150
151By default, SWIG will look for g++. You can change the C++ compile as follows :
152
153 env CXX=CC configure --prefix=/usr/local ... etc...
154
155 or
156
157 setenv CXX=CC
158 ./configure ... etc ...
159
160SWIG has been successfully compiled and tested under g++, the SGI C++
161compiler, and the SunPro C++ compiler.
162
1635. Testing
164-----------
165The SWIG parser and language modules can be tested by typing 'make test'.
166Be forewarned, this runs a large collection of tests on all of SWIG's
167language modules and documentation methods. The tests may take 5-10
168minutes to run, but a report of errors will be written to 'test.log'.
169If this exists, it will contain error messages for failed tests. If
170the file is missing, it means all tests were considered successful.
171
172The testing process requires approximately 30-40 Mbytes of disk space.
173After testing, you may wish to type 'make testclean' which will
174return the testing directory to its original state.
175
176Note : The testing procedure requires both 'sh' and 'perl'. If you
177don't have these installed, some of the tests won't work.
178
1796. Installation for Windows 95 and NT
180-------------------------------------
181
182The Win directory contains makefiles for Microsoft Visual C++ 4.x/5.x and
183Borland C++. See the README.txt file in the Win directory for specific
184build instructions. Many thanks to Kevin Butler (butler@cs.byu.edu)
185and Pier Giorgio Esposito for supplying these Makefiles.
186
1877. Installation for Macintosh
188-----------------------------
189
190A Macintosh version of SWIG is available separately as a PowerPC
191executable. A source version is also available, but is somewhat
192complicated to build due to dependencies on other packages
193including Tcl 8.0. Please refer to the SWIG homepage for more
194information.
195
1968. Examples
197------------
198
199The 'Examples' directory contains examples for all of the supported
200scripting languages. All of the examples rely on the file
201'Makefile.template' located in the top-level directory. This makefile
202is created by 'configure', but the configuration process is not
203foolproof. To check this Makefile type
204
205 make testbuild
206
207This will attempt to build various kinds of extensions and report its
208success or failure. If this fails, you may need to edit the file
209'Makefile.template' by hand. This usually isn't difficult--just
210follow the instructions contained within the file. Once the 'make
211testbuild' works for the language you are interested in using, you
212should be able to build the examples.
213
214The examples will not compile properly if you have not installed SWIG.
215If you would like to try the examples before installation, set the
216SWIG_LIB environment variable as follows :
217
218 setenv SWIG_LIB ${pathname}/SWIG1.1/swig_lib
219
220Where ${pathname} the location of the SWIG source.
221
222*** NOTE *** If you are replacing an older version of SWIG with a new
223one, the examples may not compile correctly unless you set the
224above environment variable or do a 'make install' first.
225
2269. Resources
227--------------
228
229Up-to-date SWIG related information can be found at
230
231 http://www.swig.org
232
233SWIG source code and software updates are also available via anonymous
234ftp at
235
236 ftp://ftp.swig.org
237
238
239You can join the SWIG mailing list by going to the following location:
240
241 http://www.cs.uchicago.edu/mailman/listinfo/swig
242
243The SWIG mailing list is a forum for discussing various applications
244of SWIG, installation problems, ideas for system improvements and
245future work.
246
247*** NEWSFLASH *** SWIG development has moved to the Univerity of
248Chicago. Developer information can be found at
249
250 http://swig.cs.uchicago.edu
251
25210. Installation Problems
253-------------------------
254
255As far as I know the installation works on the following platforms :
256
257 - SunOS 4.1.3
258 - Solaris
259 - Irix 5.3
260 - Irix 6.2
261 - HPUX
262 - AIX 4.1
263 - Linux
264 - MkLinux
265 - MachTen
266 - UNICOS
267 - Windows 95
268 - Windows NT 4.0
269 - MacOS System 7.5.3
270
271SWIG development takes place primarily on Linux and Solaris 2.6. I've
272tested most of the examples on these platforms. I have also tested
273SWIG under Win95 and MacOS, but that is still somewhat experimental.
274
275If you've tried everything and can't get SWIG to compile, please send
276me e-mail at beazley@cs.uchicago.edu, and we'll try to figure it out.
277I try to answer all e-mail that I receive. However, occasionally I
278receive messages with bad return addresses and can't respond. If you
279don't hear back within a few days, try sending a message to
280'swig@cs.uchicago.edu'.
281
28211. Documentation
283-----------------
284
285Over 300 pages of documentation describing almost every aspect of SWIG
286is available in the Doc directory. Don't let the amount of
287documentation scare you--SWIG is easy enough to use that you can
288probably start using it by only looking at a few simple examples.
289However, at some point you will probably want to know more so I hope
290that the manual will come in useful. Besides, I hate black boxes...
291
292The documentation is distributed in Adobe PDF format and can be viewed
293using the Adobe Acrobat Reader. Acrobat is available for virtually
294all machines and can be freely obtained from Adobe at www.adobe.com.
295Postscript and HTML versions of the manual are also available from the
296SWIG FTP site.
297
29812. Incompatibilities
299---------------------
300
301This release should be mostly compatible with SWIG 1.0
302(Final). However, the SWIG documentation system has been completely
303rewritten and the C API has been changed greatly. It is unlikely that
304any custom SWIG language modules written in C++ for 1.0 will work with
3051.1. While porting to 1.1 is not that difficult, there are a number
306of important changes. See the file 'Doc/Porting' for a list of
307changes to the C++ API and how to convert an older SWIG module to work
308with 1.1.
309
31013. Bug Reports
311----------------
312
313Bug reports should be submitted to the online bug-tracking system
314which is available at :
315
316 http://swig.cs.uchicago.edu/cgi-bin/swig
317
318Before submitting a bug, please check this site to see if it has
319already been reported. If not, provide as much information as
320possible including the SWIG version number, operating system, and
321compiler being used. Note : I tend to fix bugs in batches and may
322only respond to a bug report when it has actually been fixed---posting
323to the mailing list is often a better way to get an immediate response
324to a problem.
325
32614. Legal Stuff
327---------------
328SWIG is completely free and non-proprietary. You can do whatever you
329want with it (including distribution), provided that you follow these
330rules, 1) Keep all of the copyright notices intact, 2) don't claim
331that you wrote it, and 3) Don't sue anyone if it breaks. Otherwise,
332have fun.
333
33415. Disclaimer
335----------------
336
337While I believe that SWIG is reasonably stable, I'm always tinkering
338with it and trying to make it better. There may be a few bugs hiding
339around so if you experience any problems let me know. If you think
340that SWIG is missing some capability that would be useful to have
341have, post a message on the SWIG mailing list. Most of the previous
342suggestions have already been incorporated into this release.
343
34416. Acknowledgments
345---------------------
346
347SWIG would not be possible without the contributions of people who
348tried out the beta versions and offered feedback and bug reports.
349While there are far too many people to list at point, I'd like to
350especially acknowledge the following individuals and organizations
351for supporting SWIG and making major contributions :
352
353David Ascher, Erik Bierwagen, Kurtis Bleeker, John Buckman, Kevin
354Butler, Pier Giorgio Esposito, David Fletcher, Mark Hammond, Mark
355Harrison, Brad Holian, Gary Holt, Chris Johnson, Peter Lomdahl, Mark
356Lutz, Chris Myers, Paul Saxe, John Schmidt, Tom Schwaller, Peter-Pike
357Sloan, Patrick Tullmann, Larry Virden, Tser-Yuan Yang, Shujia Zhou.
358
359and
360
361Los Alamos National Laboratory
362Lawrence Livermore National Laboratory
363Cornell Theory Center
364University of Utah
365The Scientific Computing and Imaging Group (University of Utah)
366
367(My apologies to anyone I missed...)
368
369If you find SWIG to be useful, I'd like to know about it.
370
371Enjoy!
372
373Dave Beazley
374Department of Computer Science
375University of Chicago
376Chicago, IL 60637
377beazley@cs.uchicago.edu
378
379
380
381