4 <!-- Original source: http://wiki.wxwidgets.org/wiki.pl?Bakefile -->
5 <!-- Modified by: Francesco Montorsi <frm@users.sourceforge.net> -->
6 <!-- Vaclav Slavik <vslavik@fastmail.fm> to better fit
7 into Bakefile's presets -->
8 <!-- Creation date: 6/9/2004 -->
9 <!-- Last revision: 22/1/2005 off-CVS -->
15 FIXME: this template has (at least) the following bugs:
17 * it's MSW-only, the port is assumed to be wxMSW unconditionally
19 * multiple wx configurations (CFG variable set when building the
20 library) are not supported
24 <!-- makefile tag signifies the beginning of the bakefile -->
27 <requires version=
"0.1.5"/>
31 <!-- These are essentially the configurations you -->
32 <!-- want in bakefile. -->
34 <!-- In MSVC these are the different build -->
35 <!-- configurations you can have (in the build menu), -->
36 <!-- and in autoconf is enabled with enable-xxx=xx. -->
37 <!-- For other compilers a separate configuration -->
38 <!-- file is created (such as config.gcc on gcc) -->
39 <!-- which has several options a user can modify. -->
41 <!-- Note that the above only happens if an option -->
42 <!-- is not constant, i.e. if it cannot be determined -->
43 <!-- by bakefile itself. -->
45 <!-- this is a temporary variable until there is non general -->
46 <!-- function in bakefiles for returning native markup for -->
47 <!-- reading envrionment variables -->
49 <if cond=
"FORMAT=='watcom'">%
</if>
50 <if cond=
"FORMAT!='watcom'"></if>
54 <!-- The directory where wxWidgets is installed: -->
55 <if cond=
"not isdefined('WX_DIR')">
56 <set var=
"WX_DIR_DEFAULT" overwrite=
"0">$(DOLLAR)($(ENV_VAR)WXWIN)
</set>
57 <option name=
"WX_DIR" category=
"path">
58 <default-value>$(WX_DIR_DEFAULT)
</default-value>
60 The directory where wxWidgets library is installed
65 <!-- This is a standard option that determines -->
66 <!-- whether the user wants to build this library as -->
67 <!-- a dll or as a static library. -->
68 <if cond=
"not isdefined('WX_SHARED')">
69 <set var=
"WX_SHARED_DEFAULT" overwrite=
"0">0</set>
70 <option name=
"WX_SHARED">
72 <values-description>,DLL
</values-description>
73 <default-value>$(WX_SHARED_DEFAULT)
</default-value>
75 Use DLL build of wx library to use?
80 <!-- Configuration for building the bakefile with -->
81 <!-- unicode strings or not (unicode or ansi). -->
82 <if cond=
"not isdefined('WX_UNICODE')">
83 <set var=
"WX_UNICODE_DEFAULT" overwrite=
"0">0</set>
84 <option name=
"WX_UNICODE">
86 <values-description>,Unicode
</values-description>
87 <default-value>$(WX_UNICODE_DEFAULT)
</default-value>
89 Compile Unicode build of wxWidgets?
94 <if cond=
"not isdefined('WX_DEBUG')">
95 <set var=
"WX_DEBUG_DEFAULT" overwrite=
"0">1</set>
96 <option name=
"WX_DEBUG">
98 <values-description>Release,Debug
</values-description>
99 <default-value>$(WX_DEBUG_DEFAULT)
</default-value>
101 Use debug build of wxWidgets (define __WXDEBUG__)?
106 <if cond=
"not isdefined('WX_VERSION')">
107 <set var=
"WX_VERSION_DEFAULT" overwrite=
"0">27</set>
108 <option name=
"WX_VERSION">
109 <default-value>$(WX_VERSION_DEFAULT)
</default-value>
111 Version of the wx library to build against.
116 <!-- HELPER VARIABLES -->
120 <!-- The unicode define we want. By default bakefile -->
121 <!-- makes variables an empty string, so if unicode -->
122 <!-- is not defined $(UNICODE_DEFINE) would expand -->
123 <!-- to nothing (literally). -->
124 <set var=
"WXUNICODE_DEFINE">
125 <if cond=
"WX_UNICODE=='1'">_UNICODE
</if>
128 <!-- The debug define we need with win32 compilers -->
129 <!-- (on Linux, the wx-config program is used). -->
130 <set var=
"WXDEBUG_DEFINE">
131 <if cond=
"WX_DEBUG=='1'">__WXDEBUG__
</if>
134 <!-- These are handy ways of dealing with the -->
135 <!-- extensions in the library names of the -->
136 <!-- wxWindows library. -->
137 <set var=
"WXLIBPOSTFIX">
138 <if cond=
"WX_DEBUG=='1' and WX_UNICODE=='1'">ud
</if>
139 <if cond=
"WX_DEBUG=='1' and WX_UNICODE=='0'">d
</if>
140 <if cond=
"WX_DEBUG=='0' and WX_UNICODE=='1'">u
</if>
142 <set var=
"WX3RDPARTYLIBPOSTFIX">
143 <if cond=
"WX_DEBUG=='1'">d
</if>
147 <if cond=
"FORMAT=='msevc4prj'">_$(CPU)
</if>
150 <set var=
"WXLIBPATH">
151 <if cond=
"WX_SHARED=='0'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)$(WXCPU)_lib
</if>
152 <if cond=
"WX_SHARED=='1'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)$(WXCPU)_dll
</if>
156 <if cond=
"FORMAT=='msevc4prj'">wince
</if>
157 <if cond=
"FORMAT!='msevc4prj'">msw
</if>
159 <set var=
"WXLIBINCLUDE">$(WXLIBPATH)$(DIRSEP)$(WXPORT)$(WXLIBPOSTFIX)
</set>
165 <!-- While not required, templates make your -->
166 <!-- bakefiles much more readable. Templates, in -->
167 <!-- essence, are abstract classes like c++. -->
169 <!-- Your build targets "inherit" the template, -->
170 <!-- along with the info associated with the template -->
173 <!-- wxWidgets LIBRARY/APP TEMPLATE -->
175 <!-- The "base class" of all our build targets -->
176 <!-- This links with the appropriate native -->
177 <!-- libraries required by the platform, the libraries -->
178 <!-- we want for our stuff, and the wxWindows libs. -->
182 <!-- this tag is used to include wx libraries: -->
183 <define-tag name=
"wx-lib" rules=
"exe,dll,module">
184 <if cond=
"value=='base'">
185 <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)
</sys-lib>
187 <if cond=
"value in ['net','xml', 'odbc']">
188 <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)
</sys-lib>
190 <if cond=
"value not in ['base','net', 'odbc', 'xml']">
191 <sys-lib>wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)
</sys-lib>
195 <!-- just a placeholder to mark the place where <wx-lib> will be placed,
196 thanks to the order precedence declaration below it: -->
197 <define-tag name=
"__wx-libs-point" rules=
"exe,dll,module"/>
198 <tag-info name=
"wx-lib"
199 position=
"before:__wx-libs-point"/>
200 <tag-info name=
"__wx-syslibs"
201 position=
"after:__wx-libs-point"/>
204 <!-- template for static wx libraries: -->
205 <template id=
"wx-lib">
206 <!-- MISCELLANEOUS -->
207 <if cond=
"FORMAT=='mingw'">
208 <define>HAVE_W32API_H
</define>
209 <ldflags>-mthreads
</ldflags>
212 <define>$(WXUNICODE_DEFINE)
</define>
213 <define>$(WXDEBUG_DEFINE)
</define>
214 <define>__WXMSW__
</define>
216 <include>$(WX_DIR)$(WXLIBINCLUDE)
</include>
217 <include>$(WX_DIR)/include
</include>
221 <!-- this ugly tag contains all sys-lib tags used by "wx" template,
222 in order to make sure they are not reorder when wx-lib is moved
223 after __wx-libs-point: -->
224 <define-tag name=
"__wx-syslibs" rules=
"exe,dll,module">
225 <!-- wx 3rd party libs, always use them: -->
226 <sys-lib cond=
"FORMAT!='msevc4prj'">wxtiff$(WX3RDPARTYLIBPOSTFIX)
</sys-lib>
227 <sys-lib>wxjpeg$(WX3RDPARTYLIBPOSTFIX)
</sys-lib>
228 <sys-lib>wxpng$(WX3RDPARTYLIBPOSTFIX)
</sys-lib>
229 <sys-lib>wxzlib$(WX3RDPARTYLIBPOSTFIX)
</sys-lib>
230 <!-- For regex we won't use the WX3RDPARTYLIBPOSTIX postfix:
231 unliked tiff, jpeg, png, zlib, expat, when building
232 in Unicode mode, the "u" suffix is appended to regex -->
233 <sys-lib cond=
"FORMAT!='msevc4prj'">wxregex$(WXLIBPOSTFIX)
</sys-lib>
234 <sys-lib>wxexpat$(WX3RDPARTYLIBPOSTFIX)
</sys-lib>
236 <!-- link-in system libs that wx depends on: -->
237 <!-- If on borland, we don't need to do much -->
238 <if cond=
"FORMAT=='borland'">
239 <sys-lib>ole2w32
</sys-lib>
242 <!-- Non-borland, on the other hand... -->
243 <if cond=
"FORMAT not in ['borland','msevc4prj']">
244 <sys-lib>kernel32
</sys-lib>
245 <sys-lib>user32
</sys-lib>
246 <sys-lib>gdi32
</sys-lib>
247 <sys-lib>comdlg32
</sys-lib>
248 <sys-lib>winspool
</sys-lib>
249 <sys-lib>winmm
</sys-lib>
250 <sys-lib>shell32
</sys-lib>
251 <sys-lib>comctl32
</sys-lib>
252 <sys-lib>ole32
</sys-lib>
253 <sys-lib>oleaut32
</sys-lib>
254 <sys-lib>uuid
</sys-lib>
255 <sys-lib>rpcrt4
</sys-lib>
256 <sys-lib>advapi32
</sys-lib>
257 <sys-lib>wsock32
</sys-lib>
258 <sys-lib>odbc32
</sys-lib>
261 <!-- Libs common to both borland and MSVC -->
262 <if cond=
"FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'">
263 <sys-lib>oleacc
</sys-lib>
267 <!-- template for wx executables/dlls: -->
268 <template id=
"wx" template=
"wx-lib">
269 <lib-path>$(WX_DIR)$(WXLIBPATH)
</lib-path>
271 <!-- wx libs must come before 3rd party and sys libs, this is
272 the place where the hack explained above is carried on: -->