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">26</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 <error>WX_DEBUG=$(WX_DEBUG).</error>
138 <set var="WXLIBPOSTFIX">
139 <if cond="WX_DEBUG=='1' and WX_UNICODE=='1'">ud</if>
140 <if cond="WX_DEBUG=='1' and WX_UNICODE=='0'">d</if>
141 <if cond="WX_DEBUG=='0' and WX_UNICODE=='1'">u</if>
143 <set var="WX3RDPARTLIBPOSTFIX">
144 <if cond="WX_DEBUG=='1'">d</if>
147 <set var="WXLIBPATH">
148 <if cond="WX_SHARED=='0'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)_lib</if>
149 <if cond="WX_SHARED=='1'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)_dll</if>
152 <set var="WXLIBINCLUDE">$(WXLIBPATH)$(DIRSEP)msw$(WXLIBPOSTFIX)</set>
158 <!-- While not required, templates make your -->
159 <!-- bakefiles much more readable. Templates, in -->
160 <!-- essence, are abstract classes like c++. -->
162 <!-- Your build targets "inherit" the template, -->
163 <!-- along with the info associated with the template -->
166 <!-- wxWidgets LIBRARY/APP TEMPLATE -->
168 <!-- The "base class" of all our build targets -->
169 <!-- This links with the appropriate native -->
170 <!-- libraries required by the platform, the libraries -->
171 <!-- we want for our stuff, and the wxWindows libs. -->
175 <!-- this tag is used to include wx libraries: -->
176 <define-tag name="wx-lib" rules="exe,dll,module">
177 <if cond="value=='base'">
178 <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)</sys-lib>
180 <if cond="value in ['net','xml', 'odbc']">
181 <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)</sys-lib>
183 <if cond="value not in ['base','net','xml']">
184 <sys-lib>wxmsw$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)</sys-lib>
188 <!-- just a placeholder to mark the place where <wx-lib> will be placed,
189 thanks to the order precedence declaration below it: -->
190 <define-tag name="__wx-libs-point" rules="exe,dll,module"/>
191 <tag-info name="wx-lib"
192 position="before:__wx-libs-point"/>
193 <tag-info name="__wx-syslibs"
194 position="after:__wx-libs-point"/>
197 <!-- template for static wx libraries: -->
198 <template id="wx-lib">
199 <!-- MISCELLANEOUS -->
200 <if cond="FORMAT=='mingw'">
201 <define>HAVE_W32API_H</define>
202 <ldflags>-mthreads</ldflags>
205 <define>$(WXUNICODE_DEFINE)</define>
206 <define>$(WXDEBUG_DEFINE)</define>
207 <define>__WXMSW__</define>
209 <include>$(WX_DIR)$(WXLIBINCLUDE)</include>
210 <include>$(WX_DIR)/include</include>
214 <!-- this ugly tag contains all sys-lib tags used by "wx" template,
215 in order to make sure they are not reorder when wx-lib is moved
216 after __wx-libs-point: -->
217 <define-tag name="__wx-syslibs" rules="exe,dll,module">
218 <!-- wx 3rd party libs, always use them: -->
219 <sys-lib>wxtiff$(WX3RDPARTLIBPOSTFIX)</sys-lib>
220 <sys-lib>wxjpeg$(WX3RDPARTLIBPOSTFIX)</sys-lib>
221 <sys-lib>wxpng$(WX3RDPARTLIBPOSTFIX)</sys-lib>
222 <sys-lib>wxzlib$(WX3RDPARTLIBPOSTFIX)</sys-lib>
223 <!-- For regex we won't use the WX3RDPARTLIBPOSTIX postfix:
224 unliked tiff, jpeg, png, zlib, expat, when building
225 in Unicode mode, the "u" suffix is appended to regex -->
226 <sys-lib>wxregex$(WXLIBPOSTFIX)</sys-lib>
227 <sys-lib>wxexpat$(WX3RDPARTLIBPOSTFIX)</sys-lib>
229 <!-- link-in system libs that wx depends on: -->
230 <!-- If on borland, we don't need to do much -->
231 <if cond="FORMAT=='borland'">
232 <sys-lib>ole2w32</sys-lib>
235 <!-- Non-borland, on the other hand... -->
236 <if cond="FORMAT!='borland'">
237 <sys-lib>kernel32</sys-lib>
238 <sys-lib>user32</sys-lib>
239 <sys-lib>gdi32</sys-lib>
240 <sys-lib>comdlg32</sys-lib>
241 <sys-lib>winspool</sys-lib>
242 <sys-lib>winmm</sys-lib>
243 <sys-lib>shell32</sys-lib>
244 <sys-lib>comctl32</sys-lib>
245 <sys-lib>ole32</sys-lib>
246 <sys-lib>oleaut32</sys-lib>
247 <sys-lib>uuid</sys-lib>
248 <sys-lib>rpcrt4</sys-lib>
249 <sys-lib>advapi32</sys-lib>
250 <sys-lib>wsock32</sys-lib>
251 <sys-lib>odbc32</sys-lib>
254 <!-- Libs common to both borland and MSVC -->
255 <if cond="FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'">
256 <sys-lib>oleacc</sys-lib>
260 <!-- template for wx executables/dlls: -->
261 <template id="wx" template="wx-lib">
262 <lib-path>$(WX_DIR)$(WXLIBPATH)</lib-path>
264 <!-- wx libs must come before 3rd party and sys libs, this is
265 the place where the hack explained above is carried on: -->