1SWIG(1) General Commands Manual SWIG(1)
2
3
4
6 swig - Simplified Wrapper and Interface Generator
7
9 swig [options] file
10
11
13 The swig command is used to create wrapper code to connect C and C++
14 code to scripting languages like Perl, Python, Tcl etc. from the defi‐
15 nition of the interface. For detailed information on writing those
16 interface definitions please refer to /usr/share/doc/swig-
17 doc-2.0.9/Doc/Manual/index.html from the swig-doc package. This man‐
18 page concentrates on explaining the invocation of the swig command.
19
20
22 Target Language Options:
23 -allegrocl
24 Generate ALLEGROCL wrappers
25
26 -chicken
27 Generate CHICKEN wrappers
28
29 -clisp Generate CLISP wrappers
30
31 -cffi Generate CFFI wrappers
32
33 -csharp
34 Generate C# wrappers
35
36 -d Generate D wrappers
37
38 -go Generate Go wrappers
39
40 -guile Generate Guile wrappers
41
42 -java Generate Java wrappers
43
44 -lua Generate Lua wrappers
45
46 -modula3
47 Generate Modula 3 wrappers
48
49 -mzscheme
50 Generate Mzscheme wrappers
51
52 -ocaml Generate Ocaml wrappers
53
54 -octave
55 Generate Octave wrappers
56
57 -perl Generate Perl wrappers
58
59 -php Generate PHP wrappers
60
61 -pike Generate Pike wrappers
62
63 -python
64 Generate Python wrappers
65
66 -r Generate R (aka GNU S) wrappers
67
68 -ruby Generate Ruby wrappers
69
70 -sexp Generate Lisp S-Expressions wrappers
71
72 -tcl Generate Tcl wrappers
73
74 -uffi Generate Common Lisp / UFFI wrappers
75
76 -xml Generate XML wrappers i
77
78
79 General Options:
80 -addextern
81 Add extra extern declarations
82
83 -c++ Enable C++ processing
84
85 -co file
86 Check file out of the SWIG library
87
88 -copyctor
89 Automatically generate copy constructors wherever possible
90
91 -cpperraswarn
92 Treat the preprocessor #error statement as #warning (default)
93
94 -copyright
95 Display copyright notices
96
97 -debug-classes
98 Display information about the classes found in the interface
99
100 -debug-module n
101 Display module parse tree at stages 1-4, n is a csv list of
102 stages
103
104 -debug-symtabs
105 Display symbol tables information
106
107 -debug-symbols
108 Display target language symbols in the symbol tables
109
110 -debug-csymbols
111 Display C symbols in the symbol tables
112
113 -debug-lsymbols
114 Display target language layer symbols
115
116 -debug-tags
117 Display information about the tags found in the interface
118
119 -debug-template
120 Display information for debugging templates
121
122 -debug-top n
123 Display entire parse tree at stages 1-4, n is a csv list of
124 stages
125
126 -debug-typedef
127 Display information about the types and typedefs in the inter‐
128 face
129
130 -debug-typemap
131 Display typemap debugging information
132
133 -debug-tmsearch
134 Display typemap search debugging information
135
136 -debug-tmused
137 Display typemaps used debugging information
138
139 -directors
140 Turn on director mode for all the classes, mainly for testing
141
142 -dirprot
143 Turn on wrapping of protected members for director classes
144 (default)
145
146 -Dsymbol
147 Define a symbol symbol (for conditional compilation)
148
149 -E Preprocess only, does not generate wrapper code
150
151 -external-runtime [file]
152 Export the SWIG runtime stack
153
154 -fakeversion v
155 Make SWIG fake the program version number to v
156
157 -fcompact
158 Compile in compact mode
159
160 -features list
161 Set global features, where list is a comma separated list of
162 features, eg -features directors,autodoc=1 If no explicit value
163 is given to the feature, a default of 1 is used
164
165 -fastdispatch
166 Enable fast dispatch mode to produce faster overload dispatcher
167 code
168
169 -Fmicrosoft
170 Display error/warning messages in Microsoft format
171
172 -Fstandard
173 Display error/warning messages in commonly used format
174
175 -fvirtual
176 Compile in virtual elimination mode
177
178 -help This output
179
180 -I- Don't search the current directory
181
182 -Idir Look for SWIG files in directory dir
183
184 -ignoremissing
185 Ignore missing include files
186
187 -importall
188 Follow all #include statements as imports
189
190 -includeall
191 Follow all #include statements
192
193 -lifile
194 Include SWIG library file ifile
195
196 -macroerrors
197 Report errors inside macros
198
199 -makedefault
200 Create default constructors/destructors (the default)
201
202 -M List all dependencies
203
204 -MD Is equivalent to ’-M -MF file’, except ’-E’ is not implied
205
206 -MF file
207 Generate dependencies into file and continue generating wrappers
208
209 -MM List dependencies, but omit files in SWIG library
210
211 -MMD Like ’-MD’, but omit files in SWIG library
212
213 -module name
214 Set module name to name
215
216 -MP Generate phony targets for all dependencies
217
218 -MT target
219 Set the target of the rule emitted by dependency generation
220
221 -nocontract
222 Turn off contract checking
223
224 -nocpperraswarn
225 Do not treat the preprocessor #error statement as #warning
226
227 -nodefault
228 Do not generate default constructors nor default destructors
229
230 -nodefaultctor
231 Do not generate implicit default constructors
232
233 -nodefaultdtor
234 Do not generate implicit default destructors
235
236 -nodirprot
237 Do not wrap director protected members
238
239 -noexcept
240 Do not wrap exception specifiers
241
242 -nofastdispatch
243 Disable fast dispatch mode (default)
244
245 -nopreprocess
246 Skip the preprocessor step
247
248 -notemplatereduce
249 Disable reduction of the typedefs in templates
250
251 -O Enable the optimization options: -fastdispatch -fvirtual
252
253 -o outfile
254 Set name of the output file to outfile
255
256 -oh headfile
257 Set name of the output header file to headfile
258
259 -outcurrentdir
260 Set default output dir to current dir instead of input file's
261 path
262
263 -outdir dir
264 Set language specific files output directory to dir
265
266 -pcreversion
267 Display PCRE version information
268
269 -small Compile in virtual elimination & compact mode
270
271 -swiglib
272 Report location of SWIG library and exit
273
274 -templatereduce
275 Reduce all the typedefs in templates
276
277 -v Run in verbose mode
278
279 -version
280 Display SWIG version number
281
282 -Wall Remove all warning suppression, also implies -Wextra
283
284 -Wallkw
285 Enable keyword warnings for all the supported languages
286
287 -Werror
288 Treat warnings as errors
289
290 -Wextra
291 Adds the following additional warnings: 202,309,403,512,321,322
292
293 -wlist Suppress/add warning messages, eg -w401,+321 see Warnings.html
294
295 -xmlout file
296 Write XML version of the parse tree to file after normal pro‐
297 cessing
298
299
300 Tcl 8 Options (available with -tcl)
301 -itcl Enable ITcl support
302
303 -nosafe
304 Leave out SafeInit module function.
305
306 -prefix name
307 Set a prefix name to be prepended to all names
308
309 -namespace
310 Build module into a Tcl 8 namespace
311
312 -pkgversion
313 Set package version
314
315
316 Note: 'swig -lang -help' displays options for a specific target lan‐
317 guage.
318
319
321 SWIG was originally created by David Beazley. For up-to-date informa‐
322 tion about authors and contributors please check
323 http://www.swig.org/guilty.html. This manual page was written by
324 Torsten Landschoff <torsten@debian.org> and updated by Jitka Plesnikova
325 <jplesnik@redhat.com> (but may be used by others).
326
327
328
329
330 2013-05-24 SWIG(1)