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 <!-- Presets for limited dmars make.exe format: -->
55 <if cond=
"FORMAT=='dmars'">
56 <set var=
"WX_UNICODE">0</set>
57 <set var=
"WX_DEBUG">1</set>
58 <set var=
"WX_SHARED">0</set>
62 <!-- The directory where wxWidgets is installed: -->
63 <if cond=
"not isdefined('WX_DIR')">
64 <set var=
"WX_DIR_DEFAULT" overwrite=
"0">$(DOLLAR)($(ENV_VAR)WXWIN)
</set>
65 <option name=
"WX_DIR" category=
"path">
66 <default-value>$(WX_DIR_DEFAULT)
</default-value>
68 The directory where wxWidgets library is installed
73 <!-- This is a standard option that determines -->
74 <!-- whether the user wants to build this library as -->
75 <!-- a dll or as a static library. -->
76 <if cond=
"not isdefined('WX_SHARED')">
77 <set var=
"WX_SHARED_DEFAULT" overwrite=
"0">0</set>
78 <option name=
"WX_SHARED">
80 <values-description>,DLL
</values-description>
81 <default-value>$(WX_SHARED_DEFAULT)
</default-value>
83 Use DLL build of wx library to use?
88 <!-- Configuration for building the bakefile with -->
89 <!-- unicode strings or not (unicode or ansi). -->
90 <if cond=
"not isdefined('WX_UNICODE')">
91 <set var=
"WX_UNICODE_DEFAULT" overwrite=
"0">0</set>
92 <option name=
"WX_UNICODE">
94 <values-description>,Unicode
</values-description>
95 <default-value>$(WX_UNICODE_DEFAULT)
</default-value>
97 Compile Unicode build of wxWidgets?
102 <if cond=
"not isdefined('WX_DEBUG')">
103 <set var=
"WX_DEBUG_DEFAULT" overwrite=
"0">1</set>
104 <option name=
"WX_DEBUG">
106 <values-description>Release,Debug
</values-description>
107 <default-value>$(WX_DEBUG_DEFAULT)
</default-value>
109 Use debug build of wxWidgets (define __WXDEBUG__)?
114 <if cond=
"not isdefined('WX_VERSION')">
115 <set var=
"WX_VERSION_DEFAULT" overwrite=
"0">27</set>
116 <option name=
"WX_VERSION">
117 <default-value>$(WX_VERSION_DEFAULT)
</default-value>
119 Version of the wx library to build against.
124 <!-- HELPER VARIABLES -->
128 <!-- The unicode define we want. By default bakefile -->
129 <!-- makes variables an empty string, so if unicode -->
130 <!-- is not defined $(UNICODE_DEFINE) would expand -->
131 <!-- to nothing (literally). -->
132 <set var=
"WXUNICODE_DEFINE">
133 <if cond=
"WX_UNICODE=='1'">_UNICODE
</if>
136 <!-- The debug define we need with win32 compilers -->
137 <!-- (on Linux, the wx-config program is used). -->
138 <set var=
"WXDEBUG_DEFINE">
139 <if cond=
"WX_DEBUG=='1'">__WXDEBUG__
</if>
142 <!-- These are handy ways of dealing with the -->
143 <!-- extensions in the library names of the -->
144 <!-- wxWindows library. -->
145 <set var=
"WXLIBPOSTFIX">
146 <if cond=
"WX_DEBUG=='1' and WX_UNICODE=='1'">ud
</if>
147 <if cond=
"WX_DEBUG=='1' and WX_UNICODE=='0'">d
</if>
148 <if cond=
"WX_DEBUG=='0' and WX_UNICODE=='1'">u
</if>
150 <set var=
"WX3RDPARTYLIBPOSTFIX">
151 <if cond=
"WX_DEBUG=='1'">d
</if>
155 <if cond=
"FORMAT=='msevc4prj'">_$(CPU)
</if>
158 <set var=
"WXLIBPATH">
159 <if cond=
"WX_SHARED=='0'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)$(WXCPU)_lib
</if>
160 <if cond=
"WX_SHARED=='1'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)$(WXCPU)_dll
</if>
164 <if cond=
"FORMAT=='msevc4prj'">wince
</if>
165 <if cond=
"FORMAT!='msevc4prj'">msw
</if>
167 <set var=
"WXLIBINCLUDE">$(WXLIBPATH)$(DIRSEP)$(WXPORT)$(WXLIBPOSTFIX)
</set>
173 <!-- While not required, templates make your -->
174 <!-- bakefiles much more readable. Templates, in -->
175 <!-- essence, are abstract classes like c++. -->
177 <!-- Your build targets "inherit" the template, -->
178 <!-- along with the info associated with the template -->
181 <!-- wxWidgets LIBRARY/APP TEMPLATE -->
183 <!-- The "base class" of all our build targets -->
184 <!-- This links with the appropriate native -->
185 <!-- libraries required by the platform, the libraries -->
186 <!-- we want for our stuff, and the wxWindows libs. -->
190 <!-- this tag is used to include wx libraries: -->
191 <define-tag name=
"wx-lib" rules=
"exe,dll,module">
192 <if cond=
"value=='base'">
193 <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)
</sys-lib>
195 <if cond=
"value in ['net','xml', 'odbc']">
196 <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)
</sys-lib>
198 <if cond=
"value not in ['base','net', 'odbc', 'xml']">
199 <sys-lib>wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)
</sys-lib>
203 <!-- just a placeholder to mark the place where <wx-lib> will be placed,
204 thanks to the order precedence declaration below it: -->
205 <define-tag name=
"__wx-libs-point" rules=
"exe,dll,module"/>
206 <tag-info name=
"wx-lib"
207 position=
"before:__wx-libs-point"/>
208 <tag-info name=
"__wx-syslibs"
209 position=
"after:__wx-libs-point"/>
212 <!-- template for static wx libraries: -->
213 <template id=
"wx-lib">
214 <!-- MISCELLANEOUS -->
215 <if cond=
"FORMAT=='mingw'">
216 <define>HAVE_W32API_H
</define>
217 <ldflags>-mthreads
</ldflags>
220 <define>$(WXUNICODE_DEFINE)
</define>
221 <define>$(WXDEBUG_DEFINE)
</define>
222 <define>__WXMSW__
</define>
224 <include>$(WX_DIR)$(WXLIBINCLUDE)
</include>
225 <include>$(WX_DIR)/include
</include>
229 <!-- this ugly tag contains all sys-lib tags used by "wx" template,
230 in order to make sure they are not reorder when wx-lib is moved
231 after __wx-libs-point: -->
232 <define-tag name=
"__wx-syslibs" rules=
"exe,dll,module">
233 <!-- wx 3rd party libs, always use them: -->
234 <sys-lib cond=
"FORMAT!='msevc4prj'">wxtiff$(WX3RDPARTYLIBPOSTFIX)
</sys-lib>
235 <sys-lib>wxjpeg$(WX3RDPARTYLIBPOSTFIX)
</sys-lib>
236 <sys-lib>wxpng$(WX3RDPARTYLIBPOSTFIX)
</sys-lib>
237 <sys-lib>wxzlib$(WX3RDPARTYLIBPOSTFIX)
</sys-lib>
238 <!-- For regex we won't use the WX3RDPARTYLIBPOSTIX postfix:
239 unliked tiff, jpeg, png, zlib, expat, when building
240 in Unicode mode, the "u" suffix is appended to regex -->
241 <sys-lib cond=
"FORMAT!='msevc4prj'">wxregex$(WXLIBPOSTFIX)
</sys-lib>
242 <sys-lib>wxexpat$(WX3RDPARTYLIBPOSTFIX)
</sys-lib>
244 <!-- link-in system libs that wx depends on: -->
245 <!-- If on borland, we don't need to do much -->
246 <if cond=
"FORMAT=='borland'">
247 <sys-lib>ole2w32
</sys-lib>
248 <sys-lib>odbc32
</sys-lib>
251 <!-- Non-borland, on the other hand... -->
252 <if cond=
"FORMAT not in ['borland','msevc4prj']">
253 <sys-lib>kernel32
</sys-lib>
254 <sys-lib>user32
</sys-lib>
255 <sys-lib>gdi32
</sys-lib>
256 <sys-lib>comdlg32
</sys-lib>
257 <sys-lib>winspool
</sys-lib>
258 <sys-lib>winmm
</sys-lib>
259 <sys-lib>shell32
</sys-lib>
260 <sys-lib>comctl32
</sys-lib>
261 <sys-lib>ole32
</sys-lib>
262 <sys-lib>oleaut32
</sys-lib>
263 <sys-lib>uuid
</sys-lib>
264 <sys-lib>rpcrt4
</sys-lib>
265 <sys-lib>advapi32
</sys-lib>
266 <sys-lib>wsock32
</sys-lib>
267 <sys-lib>odbc32
</sys-lib>
270 <!-- Libs common to both borland and MSVC -->
271 <if cond=
"FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'">
272 <sys-lib>oleacc
</sys-lib>
276 <!-- template for wx executables/dlls: -->
277 <template id=
"wx" template=
"wx-lib">
278 <lib-path>$(WX_DIR)$(WXLIBPATH)
</lib-path>
280 <!-- wx libs must come before 3rd party and sys libs, this is
281 the place where the hack explained above is carried on: -->