1<?xml version="1.0" ?> 2<!-- $Id: wx_win32.bkl 46375 2007-06-08 18:25:40Z KO $ --> 3 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 --> 10<!-- $Id: wx_win32.bkl 46375 2007-06-08 18:25:40Z KO $ --> 11 12 13<!-- 14 15FIXME: this template has (at least) the following bugs: 16 17 * it's MSW-only, the port is assumed to be wxMSW unconditionally 18 19 * multiple wx configurations (CFG variable set when building the 20 library) are not supported 21 22--> 23 24<!-- makefile tag signifies the beginning of the bakefile --> 25<makefile> 26 27 <requires version="0.1.5"/> 28 29 <!-- OPTIONS --> 30 <!-- --> 31 <!-- These are essentially the configurations you --> 32 <!-- want in bakefile. --> 33 <!-- --> 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. --> 40 <!-- --> 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. --> 44 45 <!-- Presets for limited dmars make.exe format: --> 46 <if cond="FORMAT=='dmars'"> 47 <set var="WX_UNICODE">0</set> 48 <set var="WX_DEBUG">1</set> 49 <set var="WX_SHARED">0</set> 50 <set var="WX_PYTHON">0</set> 51 </if> 52 53 54 <!-- This is a standard option that determines --> 55 <!-- whether the user wants to build this library as --> 56 <!-- a dll or as a static library. --> 57 <if cond="not isdefined('WX_SHARED')"> 58 <set var="WX_SHARED_DEFAULT" overwrite="0">0</set> 59 <option name="WX_SHARED"> 60 <values>0,1</values> 61 <values-description>,DLL</values-description> 62 <default-value>$(WX_SHARED_DEFAULT)</default-value> 63 <description> 64 Use DLL build of wx library to use? 65 </description> 66 </option> 67 </if> 68 69 <!-- Configuration for building the bakefile with --> 70 <!-- unicode strings or not (unicode or ansi). --> 71 <if cond="not isdefined('WX_UNICODE')"> 72 <set var="WX_UNICODE_DEFAULT" overwrite="0">0</set> 73 <option name="WX_UNICODE"> 74 <values>0,1</values> 75 <values-description>,Unicode</values-description> 76 <default-value>$(WX_UNICODE_DEFAULT)</default-value> 77 <description> 78 Compile Unicode build of wxWidgets? 79 </description> 80 </option> 81 </if> 82 83 <if cond="not isdefined('WX_DEBUG')"> 84 <set var="WX_DEBUG_DEFAULT" overwrite="0">1</set> 85 <option name="WX_DEBUG"> 86 <values>0,1</values> 87 <values-description>Release,Debug</values-description> 88 <default-value>$(WX_DEBUG_DEFAULT)</default-value> 89 <description> 90 Use debug build of wxWidgets (define __WXDEBUG__)? 91 </description> 92 </option> 93 </if> 94 95 <if cond="not isdefined('WX_VERSION')"> 96 <set var="WX_VERSION_DEFAULT" overwrite="0">28</set> 97 <option name="WX_VERSION"> 98 <default-value>$(WX_VERSION_DEFAULT)</default-value> 99 <description> 100 Version of the wx library to build against. 101 </description> 102 </option> 103 </if> 104 105 <if cond="not isdefined('WX_MONOLITHIC')"> 106 <set var="WX_MONOLITHIC_DEFAULT" overwrite="0">0</set> 107 <option name="WX_MONOLITHIC"> 108 <values>0,1</values> 109 <values-description>Multilib,Monolithic</values-description> 110 <default-value>$(WX_MONOLITHIC_DEFAULT)</default-value> 111 <description> 112 Use monolithic build of wxWidgets? 113 </description> 114 </option> 115 </if> 116 117 <!-- set this to 1 to use specific settings for wxPython --> 118 <if cond="not isdefined('WX_PYTHON')"> 119 <option name="WX_PYTHON" category="path"> 120 <values>0,1</values> 121 <default-value>0</default-value> 122 <description> 123 Whether or not we're building against wxPython libraries. 124 </description> 125 </option> 126 </if> 127 128 <!-- HELPER VARIABLES --> 129 <!-- --> 130 131 132 <!-- The unicode define we want. By default bakefile --> 133 <!-- makes variables an empty string, so if unicode --> 134 <!-- is not defined $(UNICODE_DEFINE) would expand --> 135 <!-- to nothing (literally). --> 136 <set var="WXUNICODE_DEFINE"> 137 <if cond="WX_UNICODE=='1'">_UNICODE</if> 138 </set> 139 140 <!-- The debug define we need with win32 compilers --> 141 <!-- (on Linux, the wx-config program is used). --> 142 <set var="WXDEBUG_DEFINE"> 143 <if cond="WX_PYTHON=='1'">__WXDEBUG__</if> 144 <if cond="WX_PYTHON=='0' and WX_DEBUG=='1'">__WXDEBUG__</if> 145 </set> 146 147 <!-- These are handy ways of dealing with the --> 148 <!-- extensions in the library names of the --> 149 <!-- wxWindows library. --> 150 <set var="WXLIBPOSTFIX"> 151 <if cond="WX_PYTHON=='1' and WX_UNICODE=='1'">uh</if> 152 <if cond="WX_PYTHON=='1' and WX_UNICODE=='0'">h</if> 153 <if cond="WX_PYTHON=='0' and WX_DEBUG=='1' and WX_UNICODE=='1'">ud</if> 154 <if cond="WX_PYTHON=='0' and WX_DEBUG=='1' and WX_UNICODE=='0'">d</if> 155 <if cond="WX_PYTHON=='0' and WX_DEBUG=='0' and WX_UNICODE=='1'">u</if> 156 </set> 157 <set var="WX3RDPARTYLIBPOSTFIX"> 158 <if cond="WX_PYTHON==0 and WX_DEBUG=='1'">d</if> 159 <if cond="WX_PYTHON==1">h</if> 160 </set> 161 162 <set var="WXCPU"> 163 <if cond="FORMAT=='msevc4prj'">_$(CPU)</if> 164 </set> 165 166 <set var="WXLIBPATH"> 167 <if cond="WX_SHARED=='0'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)$(WXCPU)_lib</if> 168 <if cond="WX_SHARED=='1'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)$(WXCPU)_dll</if> 169 </set> 170 171 <set var="WXPORT"> 172 <if cond="FORMAT=='msevc4prj'">wince</if> 173 <if cond="FORMAT!='msevc4prj'">msw</if> 174 </set> 175 <set var="WXLIBINCLUDE">$(WXLIBPATH)$(DIRSEP)$(WXPORT)$(WXLIBPOSTFIX)</set> 176 177 178 <!-- All the possible mixes for the wx library names --> 179 <set var="WXLIB_BASE_NAME"> 180 <if cond="WX_MONOLITHIC=='0'">wxbase$(WX_VERSION)$(WXLIBPOSTFIX)</if> 181 182 <!-- 183 the trick used to support monolithic builds is here: when the 184 <wx-lib>base</wx-lib> tag is found, and user selected 185 WX_MONOLITHIC=1, then the base library is translated to the 186 monolithic library 187 --> 188 <if cond="WX_MONOLITHIC=='1'">wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)</if> 189 </set> 190 191 <!-- Libraries whose name is prefixed with 'wxbase' --> 192 <set var="WXLIB_NET_NAME"> 193 <if cond="WX_MONOLITHIC=='0'">wxbase$(WX_VERSION)$(WXLIBPOSTFIX)_net</if> 194 </set> 195 <set var="WXLIB_XML_NAME"> 196 <if cond="WX_MONOLITHIC=='0'">wxbase$(WX_VERSION)$(WXLIBPOSTFIX)_xml</if> 197 </set> 198 <set var="WXLIB_ODBC_NAME"> 199 <if cond="WX_MONOLITHIC=='0'">wxbase$(WX_VERSION)$(WXLIBPOSTFIX)_odbc</if> 200 </set> 201 202 <!-- Libraries whose name is prefixed with 'wx' only --> 203 <set var="WXLIB_CORE_NAME"> 204 <if cond="WX_MONOLITHIC=='0'">wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)_core</if> 205 </set> 206 <set var="WXLIB_MEDIA_NAME"> 207 <if cond="WX_MONOLITHIC=='0'">wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)_media</if> 208 </set> 209 <set var="WXLIB_XRC_NAME"> 210 <if cond="WX_MONOLITHIC=='0'">wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)_xrc</if> 211 </set> 212 <set var="WXLIB_HTML_NAME"> 213 <if cond="WX_MONOLITHIC=='0'">wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)_html</if> 214 </set> 215 <set var="WXLIB_ADV_NAME"> 216 <if cond="WX_MONOLITHIC=='0'">wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)_adv</if> 217 </set> 218 <set var="WXLIB_QA_NAME"> 219 <if cond="WX_MONOLITHIC=='0'">wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)_qa</if> 220 </set> 221 <set var="WXLIB_DBGRID_NAME"> 222 <if cond="WX_MONOLITHIC=='0'">wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)_dbgrid</if> 223 </set> 224 <set var="WXLIB_GL_NAME"> 225 <if cond="WX_MONOLITHIC=='0'">wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)_gl</if> 226 </set> 227 <set var="WXLIB_AUI_NAME"> 228 <if cond="WX_MONOLITHIC=='0'">wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)_aui</if> 229 </set> 230 <set var="WXLIB_RICHTEXT_NAME"> 231 <if cond="WX_MONOLITHIC=='0'">wx$(WXPORT)$(WX_VERSION)($WXLIBPOSTFIX)_richtext</if> 232 </set> 233 234 235 236 237 238 239 <!-- WX TEMPLATE --> 240 <!-- --> 241 <!-- --> 242 <!-- While not required, templates make your --> 243 <!-- bakefiles much more readable. Templates, in --> 244 <!-- essence, are abstract classes like c++. --> 245 <!-- --> 246 <!-- Your build targets "inherit" the template, --> 247 <!-- along with the info associated with the template --> 248 249 <!-- --> 250 <!-- wxWidgets LIBRARY/APP TEMPLATE --> 251 <!-- --> 252 <!-- The "base class" of all our build targets --> 253 <!-- This links with the appropriate native --> 254 <!-- libraries required by the platform, the libraries --> 255 <!-- we want for our stuff, and the wxWindows libs. --> 256 257 <!-- this tag is used to include wx libraries: --> 258 <define-tag name="wx-lib" rules="exe,dll,module"> 259 <if cond="value=='base'"><sys-lib>$(WXLIB_BASE_NAME)</sys-lib></if> 260 <if cond="value=='core'"><sys-lib>$(WXLIB_CORE_NAME)</sys-lib></if> 261 262 <if cond="value=='net'"><sys-lib>$(WXLIB_NET_NAME)</sys-lib></if> 263 <if cond="value=='xml'"><sys-lib>$(WXLIB_XML_NAME)</sys-lib></if> 264 <if cond="value=='odbc'"><sys-lib>$(WXLIB_ODBC_NAME)</sys-lib></if> 265 266 <if cond="value=='media'"><sys-lib>$(WXLIB_MEDIA_NAME)</sys-lib></if> 267 <if cond="value=='xrc'"><sys-lib>$(WXLIB_XRC_NAME)</sys-lib></if> 268 <if cond="value=='html'"><sys-lib>$(WXLIB_HTML_NAME)</sys-lib></if> 269 <if cond="value=='adv'"><sys-lib>$(WXLIB_ADV_NAME)</sys-lib></if> 270 <if cond="value=='gl'"><sys-lib>$(WXLIB_GL_NAME)</sys-lib></if> 271 <if cond="value=='dbgrid'"><sys-lib>$(WXLIB_DBGRID_NAME)</sys-lib></if> 272 <if cond="value=='qa'"><sys-lib>$(WXLIB_QA_NAME)</sys-lib></if> 273 <if cond="value=='aui'"><sys-lib>$(WXLIB_AUI_NAME)</sys-lib></if> 274 <if cond="value=='richtext'"><sys-lib>$(WXLIB_RICHTEXT_NAME)</sys-lib></if> 275 276 <!-- wx-lib can be used also to link against contrib libraries 277 (which always have the same name, regardless of WX_MONOLITHIC value) --> 278 <if cond="value in CONTRIBLIB_LIST.split()"> 279 <sys-lib>wx$(WXPORT)$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)</sys-lib> 280 </if> 281 282 <if cond="value not in ALLLIB_LIST.split()"> 283 <error>Unknown wxWidgets library given in the wx-lib tag</error> 284 </if> 285 </define-tag> 286 287 <!-- just a placeholder to mark the place where <wx-lib> will be placed, 288 thanks to the order precedence declaration below it: --> 289 <define-tag name="__wx-libs-point" rules="exe,dll,module"/> 290 <tag-info name="wx-lib" 291 position="before:__wx-libs-point"/> 292 <tag-info name="__wx-syslibs" 293 position="after:__wx-libs-point"/> 294 295 296 <!-- template for static wx libraries: --> 297 <template id="wx-lib"> 298 <!-- MISCELLANEOUS --> 299 <if cond="FORMAT=='mingw'"> 300 <define>HAVE_W32API_H</define> 301 <ldflags>-mthreads</ldflags> 302 </if> 303 304 <define>$(WXUNICODE_DEFINE)</define> 305 <define>$(WXDEBUG_DEFINE)</define> 306 <define>__WXMSW__</define> 307 308 <include>$(WX_DIR)$(WXLIBINCLUDE)</include> 309 <include>$(WX_DIR)/include</include> 310 </template> 311 312 313 <!-- this ugly tag contains all sys-lib tags used by "wx" template, 314 in order to make sure they are not reorder when wx-lib is moved 315 after __wx-libs-point: --> 316 <define-tag name="__wx-syslibs" rules="exe,dll,module"> 317 <!-- wx 3rd party libs, always use them: --> 318 <sys-lib cond="FORMAT!='msevc4prj'">wxtiff$(WX3RDPARTYLIBPOSTFIX)</sys-lib> 319 <sys-lib>wxjpeg$(WX3RDPARTYLIBPOSTFIX)</sys-lib> 320 <sys-lib>wxpng$(WX3RDPARTYLIBPOSTFIX)</sys-lib> 321 <sys-lib>wxzlib$(WX3RDPARTYLIBPOSTFIX)</sys-lib> 322 <!-- For regex we won't use the WX3RDPARTYLIBPOSTIX postfix: 323 unliked tiff, jpeg, png, zlib, expat, when building 324 in Unicode mode, the "u" suffix is appended to regex --> 325 <sys-lib cond="FORMAT!='msevc4prj'">wxregex$(WXLIBPOSTFIX)</sys-lib> 326 <sys-lib>wxexpat$(WX3RDPARTYLIBPOSTFIX)</sys-lib> 327 328 <!-- link-in system libs that wx depends on: --> 329 <!-- If on borland, we don't need to do much --> 330 <if cond="FORMAT=='borland'"> 331 <sys-lib>ole2w32</sys-lib> 332 <sys-lib>odbc32</sys-lib> 333 </if> 334 335 <!-- Non-borland, on the other hand... --> 336 <if cond="FORMAT not in ['borland','msevc4prj']"> 337 <sys-lib>kernel32</sys-lib> 338 <sys-lib>user32</sys-lib> 339 <sys-lib>gdi32</sys-lib> 340 <sys-lib>comdlg32</sys-lib> 341 <sys-lib>winspool</sys-lib> 342 <sys-lib>winmm</sys-lib> 343 <sys-lib>shell32</sys-lib> 344 <sys-lib>comctl32</sys-lib> 345 <sys-lib>ole32</sys-lib> 346 <sys-lib>oleaut32</sys-lib> 347 <sys-lib>uuid</sys-lib> 348 <sys-lib>rpcrt4</sys-lib> 349 <sys-lib>advapi32</sys-lib> 350 <sys-lib>wsock32</sys-lib> 351 <sys-lib>odbc32</sys-lib> 352 </if> 353 354 <!-- Libs common to both borland and MSVC --> 355 <if cond="FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'"> 356 <sys-lib>oleacc</sys-lib> 357 </if> 358 </define-tag> 359 360 <!-- template for wx executables/dlls: --> 361 <template id="wx" template="wx-lib"> 362 <lib-path>$(WX_DIR)$(WXLIBPATH)</lib-path> 363 364 <!-- wx libs must come before 3rd party and sys libs, this is 365 the place where the hack explained above is carried on: --> 366 <__wx-libs-point/> 367 <__wx-syslibs/> 368 </template> 369 370</makefile> 371