]> git.saurik.com Git - wxWidgets.git/blob - build/bakefiles/wxpresets/presets/wx_win32.bkl
previous commit didn't work with bkl-0.1.8, fixed
[wxWidgets.git] / build / bakefiles / wxpresets / presets / wx_win32.bkl
1 <?xml version="1.0" ?>
2 <!-- $Id$ -->
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$ -->
11
12
13 <!--
14
15 FIXME: 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 <!-- this is a temporary variable until there is non general -->
46 <!-- function in bakefiles for returning native markup for -->
47 <!-- reading envrionment variables -->
48 <set var="ENV_VAR">
49 <if cond="FORMAT=='watcom'">%</if>
50 <if cond="FORMAT!='watcom'"></if>
51 </set>
52
53
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>
59 <description>
60 The directory where wxWidgets library is installed
61 </description>
62 </option>
63 </if>
64
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">
71 <values>0,1</values>
72 <values-description>,DLL</values-description>
73 <default-value>$(WX_SHARED_DEFAULT)</default-value>
74 <description>
75 Use DLL build of wx library to use?
76 </description>
77 </option>
78 </if>
79
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">
85 <values>0,1</values>
86 <values-description>,Unicode</values-description>
87 <default-value>$(WX_UNICODE_DEFAULT)</default-value>
88 <description>
89 Compile Unicode build of wxWidgets?
90 </description>
91 </option>
92 </if>
93
94 <if cond="not isdefined('WX_DEBUG')">
95 <set var="WX_DEBUG_DEFAULT" overwrite="0">1</set>
96 <option name="WX_DEBUG">
97 <values>0,1</values>
98 <values-description>Release,Debug</values-description>
99 <default-value>$(WX_DEBUG_DEFAULT)</default-value>
100 <description>
101 Use debug build of wxWidgets (define __WXDEBUG__)?
102 </description>
103 </option>
104 </if>
105
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>
110 <description>
111 Version of the wx library to build against.
112 </description>
113 </option>
114 </if>
115
116 <!-- HELPER VARIABLES -->
117 <!-- -->
118
119
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>
126 </set>
127
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>
132 </set>
133
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>
141 </set>
142 <set var="WX3RDPARTYLIBPOSTFIX">
143 <if cond="WX_DEBUG=='1'">d</if>
144 </set>
145
146 <set var="WXCPU">
147 <if cond="FORMAT=='msevc4prj'">_$(CPU)</if>
148 </set>
149
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>
153 </set>
154
155 <set var="WXLIBINCLUDE">$(WXLIBPATH)$(DIRSEP)msw$(WXLIBPOSTFIX)</set>
156
157
158 <!-- WX TEMPLATE -->
159 <!-- -->
160 <!-- -->
161 <!-- While not required, templates make your -->
162 <!-- bakefiles much more readable. Templates, in -->
163 <!-- essence, are abstract classes like c++. -->
164 <!-- -->
165 <!-- Your build targets "inherit" the template, -->
166 <!-- along with the info associated with the template -->
167
168 <!-- -->
169 <!-- wxWidgets LIBRARY/APP TEMPLATE -->
170 <!-- -->
171 <!-- The "base class" of all our build targets -->
172 <!-- This links with the appropriate native -->
173 <!-- libraries required by the platform, the libraries -->
174 <!-- we want for our stuff, and the wxWindows libs. -->
175
176
177
178 <!-- this tag is used to include wx libraries: -->
179 <define-tag name="wx-lib" rules="exe,dll,module">
180 <if cond="value=='base'">
181 <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)</sys-lib>
182 </if>
183 <if cond="value in ['net','xml', 'odbc']">
184 <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)</sys-lib>
185 </if>
186 <if cond="value not in ['base','net','xml']">
187 <sys-lib>wxmsw$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)</sys-lib>
188 </if>
189 </define-tag>
190
191 <!-- just a placeholder to mark the place where <wx-lib> will be placed,
192 thanks to the order precedence declaration below it: -->
193 <define-tag name="__wx-libs-point" rules="exe,dll,module"/>
194 <tag-info name="wx-lib"
195 position="before:__wx-libs-point"/>
196 <tag-info name="__wx-syslibs"
197 position="after:__wx-libs-point"/>
198
199
200 <!-- template for static wx libraries: -->
201 <template id="wx-lib">
202 <!-- MISCELLANEOUS -->
203 <if cond="FORMAT=='mingw'">
204 <define>HAVE_W32API_H</define>
205 <ldflags>-mthreads</ldflags>
206 </if>
207
208 <define>$(WXUNICODE_DEFINE)</define>
209 <define>$(WXDEBUG_DEFINE)</define>
210 <define>__WXMSW__</define>
211
212 <include>$(WX_DIR)$(WXLIBINCLUDE)</include>
213 <include>$(WX_DIR)/include</include>
214 </template>
215
216
217 <!-- this ugly tag contains all sys-lib tags used by "wx" template,
218 in order to make sure they are not reorder when wx-lib is moved
219 after __wx-libs-point: -->
220 <define-tag name="__wx-syslibs" rules="exe,dll,module">
221 <!-- wx 3rd party libs, always use them: -->
222 <sys-lib>wxtiff$(WX3RDPARTYLIBPOSTFIX)</sys-lib>
223 <sys-lib>wxjpeg$(WX3RDPARTYLIBPOSTFIX)</sys-lib>
224 <sys-lib>wxpng$(WX3RDPARTYLIBPOSTFIX)</sys-lib>
225 <sys-lib>wxzlib$(WX3RDPARTYLIBPOSTFIX)</sys-lib>
226 <!-- For regex we won't use the WX3RDPARTYLIBPOSTIX postfix:
227 unliked tiff, jpeg, png, zlib, expat, when building
228 in Unicode mode, the "u" suffix is appended to regex -->
229 <sys-lib>wxregex$(WXLIBPOSTFIX)</sys-lib>
230 <sys-lib>wxexpat$(WX3RDPARTYLIBPOSTFIX)</sys-lib>
231
232 <!-- link-in system libs that wx depends on: -->
233 <!-- If on borland, we don't need to do much -->
234 <if cond="FORMAT=='borland'">
235 <sys-lib>ole2w32</sys-lib>
236 </if>
237
238 <!-- Non-borland, on the other hand... -->
239 <if cond="FORMAT not in ['borland','msevc4prj']">
240 <sys-lib>kernel32</sys-lib>
241 <sys-lib>user32</sys-lib>
242 <sys-lib>gdi32</sys-lib>
243 <sys-lib>comdlg32</sys-lib>
244 <sys-lib>winspool</sys-lib>
245 <sys-lib>winmm</sys-lib>
246 <sys-lib>shell32</sys-lib>
247 <sys-lib>comctl32</sys-lib>
248 <sys-lib>ole32</sys-lib>
249 <sys-lib>oleaut32</sys-lib>
250 <sys-lib>uuid</sys-lib>
251 <sys-lib>rpcrt4</sys-lib>
252 <sys-lib>advapi32</sys-lib>
253 <sys-lib>wsock32</sys-lib>
254 <sys-lib>odbc32</sys-lib>
255 </if>
256
257 <!-- Libs common to both borland and MSVC -->
258 <if cond="FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'">
259 <sys-lib>oleacc</sys-lib>
260 </if>
261 </define-tag>
262
263 <!-- template for wx executables/dlls: -->
264 <template id="wx" template="wx-lib">
265 <lib-path>$(WX_DIR)$(WXLIBPATH)</lib-path>
266
267 <!-- wx libs must come before 3rd party and sys libs, this is
268 the place where the hack explained above is carried on: -->
269 <__wx-libs-point/>
270 <__wx-syslibs/>
271 </template>
272
273 </makefile>