]> git.saurik.com Git - wxWidgets.git/blob - build/bakefiles/common.bkl
unicode compilation fix
[wxWidgets.git] / build / bakefiles / common.bkl
1 <?xml version="1.0" ?>
2 <!-- $Id$ -->
3
4 <makefile>
5
6 <!-- bakefile modules we need: -->
7 <using module="datafiles"/>
8
9 <!-- load python module with wxwindows helpers: -->
10 <using module="wxwin"/>
11
12 <include file="config.bkl"/>
13
14
15 <!-- ================================================================== -->
16 <!-- wxWindows version numbers: -->
17 <!-- ================================================================== -->
18
19 <set var="WXVER_MAJOR">$(wxwin.getVersionMajor())</set>
20 <set var="WXVER_MINOR">$(wxwin.getVersionMinor())</set>
21 <set var="WXVER_RELEASE">$(wxwin.getVersionRelease())</set>
22 <set var="WX_VERSION" make_var="1">
23 $(WXVER_MAJOR).$(WXVER_MINOR).$(WXVER_RELEASE)
24 </set>
25
26 <set var="WX_STABLE_BRANCH">$(int(int(WXVER_MINOR) % 2 == 0))</set>
27
28 <set var="WXSOVERSION">
29 <if cond="WX_STABLE_BRANCH=='1'">0.0.0</if>
30 <if cond="WX_STABLE_BRANCH=='0'">$(WXVER_RELEASE).0.0</if>
31 </set>
32 <set var="WXMACVERSION">$(WX_VERSION)</set>
33 <set var="WXWIN32DLLVERSION">
34 <if cond="WX_STABLE_BRANCH=='1'">$(WXVER_MAJOR)$(WXVER_MINOR)</if>
35 <if cond="WX_STABLE_BRANCH=='0'">$(WXVER_MAJOR)$(WXVER_MINOR)$(WXVER_RELEASE)</if>
36 </set>
37
38
39 <!-- ================================================================== -->
40 <!-- Names of libraries and DLLs: -->
41 <!-- ================================================================== -->
42
43 <set var="PORTNAME">
44 <if cond="USE_GUI=='0'">base</if>
45 <if cond="USE_GUI=='1'">$(TOOLKIT_LOWERCASE)$(TOOLKIT_VERSION)</if>
46 </set>
47
48 <set var="WXBASEPORT">
49 <if cond="TOOLKIT=='MAC'">_carbon</if>
50 </set>
51
52 <set var="COMPILERORGCC">
53 <if cond="isdefined('COMPILER')">$(COMPILER)</if>
54 <if cond="not isdefined('COMPILER')">gcc</if>
55 </set>
56 <set var="WXCOMPILER">
57 <if cond="PLATFORM_WIN32=='1'">_$(COMPILERORGCC)</if>
58 </set>
59
60 <set var="VENDORTAG">
61 <if cond="PLATFORM_WIN32=='1' and OFFICIAL_BUILD=='1'"></if>
62 <if cond="PLATFORM_WIN32=='1' and OFFICIAL_BUILD=='0'">_$(VENDOR)</if>
63 </set>
64
65 <set var="WXDEBUGFLAG">
66 <if cond="BUILD=='debug' and DEBUG_FLAG=='default'">d</if>
67 <if cond="DEBUG_FLAG=='1'">d</if>
68 </set>
69 <set var="WXUNICODEFLAG">
70 <if cond="UNICODE=='1'">u</if>
71 </set>
72 <set var="WXNAMESUFFIX">
73 $(WXUNICODEFLAG)$(WXDEBUGFLAG)
74 </set>
75
76 <set var="WXUNIVNAME">
77 <if cond="WXUNIV=='1'">univ</if>
78 </set>
79 <set var="WXUNIV_DEFINE">
80 <if cond="WXUNIV=='1'">__WXUNIVERSAL__</if>
81 </set>
82
83 <if cond="FORMAT=='autoconf'">
84 <set var="WXNAMEPREFIX">wx_base$(WXBASEPORT)</set>
85 <set var="WXNAMEPREFIXGUI">wx_$(PORTNAME)$(WXUNIVNAME)</set>
86 <set var="WXVERSIONTAG">-$(WXVER_MAJOR).$(WXVER_MINOR)</set>
87 </if>
88 <if cond="FORMAT!='autoconf'">
89 <set var="WXNAMEPREFIX">
90 wxbase$(WXBASEPORT)$(WXVER_MAJOR)$(WXVER_MINOR)
91 </set>
92 <set var="WXNAMEPREFIXGUI">
93 wx$(PORTNAME)$(WXUNIVNAME)$(WXVER_MAJOR)$(WXVER_MINOR)</set>
94 <set var="WXVERSIONTAG"></set>
95 </if>
96 <set var="WXDLLNAMEPREFIX">
97 <if cond="PLATFORM_WIN32=='1'">
98 wxbase$(WXBASEPORT)$(WXWIN32DLLVERSION)
99 </if>
100 <if cond="PLATFORM_WIN32=='0'">$(WXNAMEPREFIX)</if>
101 </set>
102 <set var="WXDLLNAMEPREFIXGUI">
103 <if cond="PLATFORM_WIN32=='1'">
104 wx$(PORTNAME)$(WXUNIVNAME)$(WXWIN32DLLVERSION)
105 </if>
106 <if cond="PLATFORM_WIN32=='0'">$(WXNAMEPREFIXGUI)</if>
107 </set>
108 <set var="WXDLLVERSIONTAG">
109 <if cond="PLATFORM_WIN32=='1'"></if>
110 <if cond="PLATFORM_WIN32=='0'">$(WXVERSIONTAG)</if>
111 </set>
112
113
114 <!-- =============================================================== -->
115 <!-- Names of component libraries: -->
116 <!-- =============================================================== -->
117
118 <set var="WXLIB_BASE">
119 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('base')))</if>
120 </set>
121 <set var="WXLIB_NET">
122 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('net')))</if>
123 </set>
124 <set var="WXLIB_CORE">
125 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('core')))</if>
126 </set>
127 <set var="WXLIB_ADV">
128 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('adv')))</if>
129 </set>
130 <set var="WXLIB_HTML">
131 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('html')))</if>
132 </set>
133 <set var="WXLIB_XML">
134 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('xml')))</if>
135 </set>
136 <set var="WXLIB_ODBC">
137 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('odbc')))</if>
138 </set>
139 <set var="WXLIB_DBGRID">
140 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('dbgrid')))</if>
141 </set>
142
143 <set var="WXLIB_MONO">
144 <if cond="MONOLITHIC=='1'">$(mk.evalExpr(wxwin.mkLibName('mono')))</if>
145 </set>
146
147
148 <!-- =============================================================== -->
149 <!-- Where to store built libraries and objects: -->
150 <!-- =============================================================== -->
151
152
153 <if cond="FORMAT!='autoconf'">
154 <set var="WXDLLFLAG">
155 <if cond="SHARED=='1'">dll</if>
156 </set>
157 <set var="CFG_NAME_PART">
158 $(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
159 </set>
160 <set var="OBJS" make_var="1">$(COMPILER)_$(CFG_NAME_PART)</set>
161 <set var="BUILDDIR">$(OBJS)</set>
162 </if>
163
164 <set var="LIBDIRNAME" make_var="1">
165 <if cond="FORMAT=='autoconf'">$(top_builddir)lib</if>
166 <if cond="FORMAT!='autoconf'">
167 $(nativePaths(TOP_SRCDIR))lib$(DIRSEP)$(COMPILER)_$(CFG_NAME_PART)
168 </if>
169 </set>
170
171
172 <!-- =============================================================== -->
173 <!-- Templates for libs: -->
174 <!-- =============================================================== -->
175
176 <set var="DEBUGINFO">
177 <if cond="BUILD=='debug' and DEBUG_INFO=='default'">on</if>
178 <if cond="DEBUG_INFO=='1'">on</if>
179 <if cond="BUILD=='release' and DEBUG_INFO=='default'">off</if>
180 <if cond="DEBUG_INFO=='0'">off</if>
181 </set>
182 <set var="DEBUGRUNTIME">
183 <if cond="DEBUG_RUNTIME_LIBS=='default'">$(DEBUGINFO)</if>
184 <if cond="DEBUG_RUNTIME_LIBS=='0'">off</if>
185 <if cond="DEBUG_RUNTIME_LIBS=='1'">on</if>
186 </set>
187 <set var="OPTIMIZEFLAG">
188 <if cond="BUILD=='debug'">off</if>
189 <if cond="BUILD=='release'">speed</if>
190 </set>
191
192 <set var="DEBUG_DEFINE">
193 <if cond="FORMAT!='autoconf' and BUILD=='debug' and DEBUG_FLAG=='default'">__WXDEBUG__</if>
194 <if cond="FORMAT!='autoconf' and DEBUG_FLAG=='1'">__WXDEBUG__</if>
195 </set>
196 <set var="UNICODE_DEFINE">
197 <if cond="FORMAT!='autoconf' and UNICODE=='1'">wxUSE_UNICODE=1</if>
198 </set>
199
200 <set var="UNICOWS_LIB">
201 <if cond="MSLU=='1'">unicows</if>
202 </set>
203
204 <template id="common_settings">
205 <debug-info>$(DEBUGINFO)</debug-info>
206 <debug-runtime-libs>$(DEBUGRUNTIME)</debug-runtime-libs>
207 <optimize>$(OPTIMIZEFLAG)</optimize>
208 <threading>multi</threading>
209 <runtime-libs>$(RUNTIME_LIBS)</runtime-libs>
210 <if cond="FORMAT!='autoconf'">
211 <cppflags>$(EXTRACFLAGS)</cppflags>
212 </if>
213 </template>
214
215 <template id="anylib">
216 <dirname>$(LIBDIRNAME)</dirname>
217 <install-to>$(LIBDIR)</install-to>
218 </template>
219
220 <template id="3rdparty_lib" template="common_settings,anylib">
221 <libname>$(id)$(WXDEBUGFLAG)$(HOST_SUFFIX)</libname>
222 <!--
223 we want to install 3rd party libs system-wide only with static
224 version of wxWindows; otherwise they are embedded in shared libs:
225 -->
226 <install-if>SHARED=='0'</install-if>
227 </template>
228
229
230 <!-- =============================================================== -->
231 <!-- 3rd party libs: -->
232 <!-- =============================================================== -->
233
234 <!-- 3rd party libraries: -->
235 <include file="regex.bkl"/>
236 <include file="zlib.bkl"/>
237 <include file="png.bkl"/>
238 <include file="jpeg.bkl"/>
239 <include file="tiff.bkl"/>
240 <include file="odbc.bkl"/>
241 <include file="expat.bkl"/>
242
243
244 <!-- =============================================================== -->
245 <!-- Templates for wxWindows libs: -->
246 <!-- =============================================================== -->
247
248 <template id="wx" template="common_settings">
249 <set var="wxid">$(wxwin.mk_wxid(id))</set>
250 <define>__WX$(TOOLKIT)__</define>
251 <define>$(WXUNIV_DEFINE)</define>
252 <define>$(DEBUG_DEFINE)</define>
253 <define>$(UNICODE_DEFINE)</define>
254 <include>$(TOP_SRCDIR)include</include>
255 <lib-path>$(LIBDIRNAME)</lib-path>
256 <include cond="FORMAT!='autoconf'">$(LIBDIRNAME)</include>
257 <include>$(INC_TIFF)</include>
258 <include>$(INC_JPEG)</include>
259 <include>$(INC_PNG)</include>
260 <include>$(INC_ZLIB)</include>
261 <include>$(INC_ODBC)</include>
262 <include>$(INC_REGEX)</include>
263 <include>$(INC_EXPAT)</include>
264 </template>
265
266 <!-- for both GUI and wxBase libs/samples: -->
267 <template id="wx_append_base_nomono">
268 <!-- link against builtin 3rd party libs, if needed: -->
269 <sys-lib>$(LIB_TIFF)</sys-lib>
270 <sys-lib>$(LIB_JPEG)</sys-lib>
271 <sys-lib>$(LIB_PNG)</sys-lib>
272 <sys-lib>$(LIB_ZLIB)</sys-lib>
273 <sys-lib>$(LIB_ODBC)</sys-lib>
274 <sys-lib>$(LIB_REGEX)</sys-lib>
275 <sys-lib>$(LIB_EXPAT)</sys-lib>
276
277 <ldlibs>$(EXTRALIBS)</ldlibs>
278
279 <!-- system libraries on windows: -->
280 <if cond="FORMAT!='autoconf'">
281 <sys-lib>$(UNICOWS_LIB)</sys-lib>
282 <if cond="COMPILER=='bcc'">
283 <sys-lib>import32</sys-lib>
284 <sys-lib>ole2w32</sys-lib>
285 </if>
286 <if cond="COMPILER!='bcc'">
287 <sys-lib>kernel32</sys-lib>
288 <sys-lib>user32</sys-lib>
289 <sys-lib>gdi32</sys-lib>
290 <sys-lib>comdlg32</sys-lib>
291 <sys-lib>winspool</sys-lib>
292 <sys-lib>winmm</sys-lib>
293 <sys-lib>shell32</sys-lib>
294 <sys-lib>comctl32</sys-lib>
295 <sys-lib>odbc32</sys-lib>
296 <sys-lib>ole32</sys-lib>
297 <sys-lib>oleaut32</sys-lib>
298 <sys-lib>uuid</sys-lib>
299 <sys-lib>rpcrt4</sys-lib>
300 <sys-lib>advapi32</sys-lib>
301 <sys-lib>wsock32</sys-lib>
302 </if>
303 </if>
304 </template>
305
306 <define-tag name="msvc-headers" rules="dll,lib">
307 <if cond="FORMAT=='msvc6prj'">
308 <msvc-project-files>
309 $(addPrefixToList('include\', wxwin.headersOnly(value)))
310 </msvc-project-files>
311 </if>
312 </define-tag>
313
314 <define-tag name="msvc-copy-setup-h" rules="dll,lib">
315 <if cond="FORMAT=='msvc6prj'">
316 <msvc-headers>wx/msw/setup.h</msvc-headers>
317 <set var="__custom_build_files" append="1">
318 include\wx\msw\setup.h
319 </set>
320 <set var="__custom_build_include_wx_msw_setup_h">
321 Creating $(LIBDIRNAME)\wx\setup.h
322 InputPath=..\include\wx\msw\setup.h
323
324 "$(LIBDIRNAME)\wx\setup.h" : $(DOLLAR)(SOURCE) "$(DOLLAR)(INTDIR)" "$(DOLLAR)(OUTDIR)"
325 $(TAB)copy "$(DOLLAR)(InputPath)" $(LIBDIRNAME)\wx\setup.h
326 </set>
327 </if>
328 </define-tag>
329
330
331 <!-- for GUI libs/samples: -->
332 <template id="wx_append_nomono" template="wx_append_base_nomono">
333 <ldlibs>$(EXTRALIBS_GUI)</ldlibs>
334 </template>
335
336
337 <template id="wx_append_base" template_append="wx_append_base_nomono">
338 <!-- Always link against the wxWin library in monolithic build: -->
339 <sys-lib>$(WXLIB_MONO)</sys-lib>
340 </template>
341 <template id="wx_append" template_append="wx_append_nomono">
342 <!-- Always link against the wxWin library in monolithic build: -->
343 <sys-lib>$(WXLIB_MONO)</sys-lib>
344 </template>
345
346
347 <set var="WX_DISABLE_PRECOMP_HEADERS" overwrite="0">0</set>
348
349 <template id="wx_lib_b" template="wx,anylib">
350 <set var="WXLIBNAME">$(wxwin.mkLibName(wxid))</set>
351 <libname>$(WXLIBNAME)</libname>
352
353 <if cond="WX_DISABLE_PRECOMP_HEADERS=='0'">
354 <if cond="FORMAT!='autoconf'">
355 <sources>$(WXTOPDIR)src/msw/dummy.cpp</sources>
356 <precomp-headers-gen>
357 $(WXTOPDIR)src/msw/dummy.cpp
358 </precomp-headers-gen>
359 </if>
360 <precomp-headers-header>wx/wxprec.h</precomp-headers-header>
361 <precomp-headers>on</precomp-headers>
362 <precomp-headers-file>wxprec_$(id)</precomp-headers-file>
363 <precomp-headers-exclude>
364 src/common/unzip.c
365 src/common/extended.c
366 src/msw/gsocket.c
367 src/msw/gsockmsw.c
368 </precomp-headers-exclude>
369 </if>
370
371 <if cond="FORMAT=='msvc6prj' and BUILDING_LIB=='1'">
372 <msvc-file-group>Common Sources:src/common/*</msvc-file-group>
373 <msvc-file-group>MSW Sources:src/msw/*</msvc-file-group>
374 <msvc-file-group>Generic Sources:src/generic/*</msvc-file-group>
375 <msvc-file-group>wxUniv Sources:src/univ/*</msvc-file-group>
376 <msvc-file-group>wxHTML Sources:src/html/*</msvc-file-group>
377 <msvc-file-group>Setup Headers:*/setup.h</msvc-file-group>
378 <msvc-file-group>MSW Headers:*wx/msw/*.h</msvc-file-group>
379 <msvc-file-group>Generic Headers:*wx/generic/*.h</msvc-file-group>
380 <msvc-file-group>wxUniv Headers:*wx/univ/*.h</msvc-file-group>
381 <msvc-file-group>wxHTML Headers:*wx/html/*.h</msvc-file-group>
382 <msvc-file-group>Common Headers:*wx/*.h</msvc-file-group>
383 </if>
384 </template>
385
386 <template id="wx_dll_b" template="wx_lib_b">
387 <set var="WXDLLNAME">$(wxwin.mkDllName(wxid))</set>
388 <dllname>$(WXDLLNAME)</dllname>
389 <version>$(WX_VERSION)</version>
390 <so_version>$(WXSOVERSION)</so_version>
391 <mac_version>$(WXMACVERSION)</mac_version>
392 </template>
393
394 <template id="wx_3rdparty_dependencies">
395 <depends>wxtiff</depends>
396 <depends>wxjpeg</depends>
397 <depends>wxpng</depends>
398 <depends>wxexpat</depends>
399 <depends>wxzlib</depends>
400 <depends cond="FORMAT=='autoconf'">wxodbc</depends>
401 <depends>wxregex</depends>
402 </template>
403
404 <template id="wx_lib" template="wx_lib_b"/>
405 <template id="wx_base_lib" template="wx_lib_b">
406 <define>wxUSE_GUI=0</define>
407 </template>
408
409 <template id="wx_dll" template="wx_dll_b,wx_3rdparty_dependencies"
410 template_append="wx_append_nomono"/>
411 <template id="wx_base_dll" template="wx_dll_b,wx_3rdparty_dependencies"
412 template_append="wx_append_base_nomono">
413 <define>wxUSE_GUI=0</define>
414 </template>
415
416 <!-- =============================================================== -->
417 <!-- Templates for building wxWindows plugins: -->
418 <!-- =============================================================== -->
419
420 <if cond="WX_STABLE_BRANCH=='1'">
421 <set var="PLUGIN_VERSION">
422 <if cond="PLATFORM_UNIX=='1'">
423 -$(WXVER_MAJOR).$(WXVER_MINOR)
424 </if>
425 <if cond="PLATFORM_UNIX=='0'">
426 $(WXVER_MAJOR)$(WXVER_MINOR)
427 </if>
428 </set>
429 </if>
430 <if cond="WX_STABLE_BRANCH=='0'">
431 <set var="PLUGIN_VERSION">
432 <if cond="PLATFORM_UNIX=='1'">
433 -$(WXVER_MAJOR).$(WXVER_MINOR).$(WXVER_RELEASE)
434 </if>
435 <if cond="PLATFORM_UNIX=='0'">
436 $(WXVER_MAJOR)$(WXVER_MINOR)$(WXVER_RELEASE)
437 </if>
438 </set>
439 </if>
440
441 <define-rule name="wx-base-plugin" extends="module">
442 <template>
443 <dllname>
444 $(id)$(addPrefixIfNotEmpty('_',WXNAMESUFFIX))$(PLUGIN_VERSION)
445 </dllname>
446 <define>WXUSINGDLL</define>
447 <define>wxUSE_GUI=0</define>
448 </template>
449 </define-rule>
450
451 <define-rule name="wx-gui-plugin" extends="module">
452 <template template="wx">
453 <dllname>
454 $(id)_$(PORTNAME)$(WXUNIVNAME)$(WXNAMESUFFIX)$(PLUGIN_VERSION)
455 </dllname>
456 <define>WXUSINGDLL</define>
457 </template>
458 </define-rule>
459
460 <!-- =============================================================== -->
461 <!-- Support for wxWindows samples and contrib: -->
462 <!-- =============================================================== -->
463
464 <!-- Link against one wxWin library. Value must be literal! -->
465 <define-tag name="wx-lib" rules="exe,dll,module">
466 <sys-lib>$(wxwin.libToLink(value))</sys-lib>
467 <if cond="FORMAT=='msvc6prj' and MONOLITHIC=='0'">
468 <depends-on-dsp>$(wxwin.makeDspDependency(value))</depends-on-dsp>
469 </if>
470 </define-tag>
471
472 </makefile>