]> git.saurik.com Git - wxWidgets.git/blob - build/bakefiles/common.bkl
2f5855f2cd877b0fe3a3c7383697b63dc9f33d4f
[wxWidgets.git] / build / bakefiles / common.bkl
1 <?xml version="1.0" ?>
2 <!-- $Id$ -->
3
4 <makefile>
5
6 <requires version="0.2.7"/>
7
8 <!-- bakefile modules we need: -->
9 <using module="datafiles"/>
10
11 <!-- load python module with wxwindows helpers: -->
12 <using module="wxwin"/>
13
14 <!-- DFE: Add a platform meaning regular MacOS (not OS X) -->
15 <!-- FIXME: This will be handled in Bakefile but for now I wanted to
16 get my changes to the wx bakefiles in the tree but invisible to
17 windows toolkits and their config.xxx settings -->
18 <if cond="FORMAT=='autoconf'">
19 <option name="PLATFORM_MACOS"/>
20 </if>
21 <if cond="FORMAT!='autoconf'">
22 <set var="PLATFORM_MACOS">0</set>
23 </if>
24
25 <!-- FIXME: PalmOS is another candidate to bakefiles -->
26 <set var="PLATFORM_PALMOS">0</set>
27
28
29 <include file="config.bkl"/>
30
31 <include file="plugins_deps.bkl"/>
32
33
34 <!-- wxWidgets version numbers logic: -->
35 <include file="version.bkl"/>
36
37
38 <!-- ================================================================== -->
39 <!-- Names of libraries and DLLs: -->
40 <!-- ================================================================== -->
41
42 <set var="PORTNAME">
43 <if cond="USE_GUI=='0'">base</if>
44 <if cond="USE_GUI=='1'">$(TOOLKIT_LOWERCASE)$(TOOLKIT_VERSION)</if>
45 </set>
46
47 <set var="WXBASEPORT">
48 <if cond="TOOLKIT=='MAC'">_carbon</if>
49 </set>
50
51 <set var="COMPILERORGCC">
52 <if cond="isdefined('COMPILER')">$(COMPILER)</if>
53 <if cond="not isdefined('COMPILER')">gcc</if>
54 </set>
55 <set var="WXCOMPILER">
56 <if cond="PLATFORM_WIN32=='1'">_$(COMPILERORGCC)</if>
57 </set>
58
59 <set var="VENDORTAG">
60 <if cond="PLATFORM_WIN32=='1' and OFFICIAL_BUILD=='1'"></if>
61 <if cond="PLATFORM_WIN32=='1' and OFFICIAL_BUILD=='0'">_$(VENDOR)</if>
62 </set>
63
64 <!-- debug suffix used for Windows libraries which use debug CRT -->
65 <set var="WXDEBUGFLAG">
66 <if cond="BUILD=='debug' and DEBUG_RUNTIME_LIBS=='default'">d</if>
67 <if cond="DEBUG_RUNTIME_LIBS=='1'">d</if>
68 </set>
69 <set var="WXUNICODEFLAG">
70 <!-- WinCE is Unicode-only platform: -->
71 <if cond="UNICODE=='1' and FORMAT!='msevc4prj'">u</if>
72 </set>
73 <set var="WX_U_D_SUFFIX">
74 $(WXUNICODEFLAG)$(WXDEBUGFLAG)
75 </set>
76 <set var="WXNAMESUFFIX">
77 $(WX_U_D_SUFFIX)$(WX_LIB_FLAVOUR)
78 </set>
79
80 <set var="WXUNIVNAME">
81 <if cond="WXUNIV=='1'">univ</if>
82 </set>
83 <set var="WXUNIV_DEFINE">
84 <if cond="WXUNIV=='1'">__WXUNIVERSAL__</if>
85 </set>
86
87 <if cond="FORMAT=='autoconf'">
88 <set var="WXNAMEPREFIX">wx_base$(WXBASEPORT)</set>
89 <set var="WXNAMEPREFIXGUI">wx_$(PORTNAME)$(WXUNIVNAME)</set>
90 <set var="WXVERSIONTAG">-$(WX_RELEASE)</set>
91 </if>
92 <if cond="FORMAT!='autoconf'">
93 <set var="WXNAMEPREFIX">
94 wxbase$(WXBASEPORT)$(WX_RELEASE_NODOT)
95 </set>
96 <set var="WXNAMEPREFIXGUI">
97 wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)</set>
98 <set var="WXVERSIONTAG"></set>
99 </if>
100 <set var="WXDLLNAMEPREFIX">
101 <if cond="PLATFORM_WIN32=='1'">
102 wxbase$(WXBASEPORT)$(WXWIN32DLLVERSION)
103 </if>
104 <if cond="PLATFORM_WIN32=='0'">$(WXNAMEPREFIX)</if>
105 </set>
106 <set var="WXDLLNAMEPREFIXGUI">
107 <if cond="PLATFORM_WIN32=='1'">
108 wx$(PORTNAME)$(WXUNIVNAME)$(WXWIN32DLLVERSION)
109 </if>
110 <if cond="PLATFORM_WIN32=='0'">$(WXNAMEPREFIXGUI)</if>
111 </set>
112 <set var="WXDLLVERSIONTAG">
113 <if cond="PLATFORM_WIN32=='1'"></if>
114 <if cond="PLATFORM_WIN32=='0'">$(WXVERSIONTAG)</if>
115 </set>
116
117
118 <!-- =============================================================== -->
119 <!-- Names of component libraries: -->
120 <!-- =============================================================== -->
121
122 <set var="WXLIB_BASE">
123 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('base')))</if>
124 </set>
125 <set var="WXLIB_NET">
126 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('net')))</if>
127 </set>
128 <set var="WXLIB_QA">
129 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('qa')))</if>
130 </set>
131 <set var="WXLIB_CORE">
132 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('core')))</if>
133 </set>
134 <set var="WXLIB_ADV">
135 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('adv')))</if>
136 </set>
137 <set var="WXLIB_MEDIA">
138 <if cond="MONOLITHIC=='0' and USE_MEDIA=='1'">$(mk.evalExpr(wxwin.mkLibName('media')))</if>
139 </set>
140 <set var="WXLIB_HTML">
141 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('html')))</if>
142 </set>
143 <set var="WXLIB_XML">
144 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('xml')))</if>
145 </set>
146 <set var="WXLIB_XRC">
147 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('xrc')))</if>
148 </set>
149 <set var="WXLIB_AUI">
150 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('aui')))</if>
151 </set>
152 <set var="WXLIB_RIBBON">
153 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('ribbon')))</if>
154 </set>
155 <set var="WXLIB_PROPGRID">
156 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('propgrid')))</if>
157 </set>
158 <set var="WXLIB_RICHTEXT">
159 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('richtext')))</if>
160 </set>
161 <set var="WXLIB_STC">
162 <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('stc')))</if>
163 </set>
164 <set var="WXLIB_WEBVIEW">
165 <if cond="MONOLITHIC=='0' and USE_WEBVIEW=='1'">$(mk.evalExpr(wxwin.mkLibName('webview')))</if>
166 </set>
167 <set var="WXLIB_MONO">
168 <if cond="MONOLITHIC=='1'">$(mk.evalExpr(wxwin.mkLibName('mono')))</if>
169 </set>
170
171
172 <!-- =============================================================== -->
173 <!-- Where to store built libraries and objects: -->
174 <!-- =============================================================== -->
175
176 <set var="DIR_SUFFIX_CPU">
177 <if cond="FORMAT=='msevc4prj'">_$(CPU)</if>
178 <if cond="TARGET_CPU=='amd64'">_amd64</if>
179 <if cond="TARGET_CPU=='AMD64'">_amd64</if>
180 <if cond="TARGET_CPU=='ia64'">_ia64</if>
181 <if cond="TARGET_CPU=='IA64'">_ia64</if>
182 </set>
183
184 <if cond="FORMAT!='autoconf'">
185 <set var="WXDLLFLAG">
186 <if cond="SHARED=='1'">dll</if>
187 </set>
188 <set var="CFG_NAME_PART">
189 $(PORTNAME)$(WXUNIVNAME)$(WX_U_D_SUFFIX)$(WXDLLFLAG)$(CFG)
190 </set>
191
192 <!-- NB: this is make_var so that it can be overridden on command line
193 like this: nmake -f makefile.vc COMPILER_PREFIX=vc6 -->
194 <set var="COMPILER_PREFIX" make_var="1">$(COMPILER)</set>
195
196 <set var="OBJS" make_var="1">
197 $(COMPILER_PREFIX)_$(CFG_NAME_PART)$(DIR_SUFFIX_CPU)
198 </set>
199
200 <set var="BUILDDIR">$(OBJS)</set>
201 </if>
202
203 <set var="LIBTYPE_SUFFIX" make_var="1">
204 <if cond="FORMAT!='autoconf' and SHARED=='0' and PLATFORM_WIN32=='1'">lib</if>
205 <if cond="FORMAT!='autoconf' and SHARED=='1' and PLATFORM_WIN32=='1'">dll</if>
206 <if cond="FORMAT=='watcom' and SHARED=='0' and PLATFORM_WIN32=='0'">$(TOOLKIT_LOWERCASE)_lib</if>
207 <if cond="FORMAT=='watcom' and SHARED=='1' and PLATFORM_WIN32=='0'">$(TOOLKIT_LOWERCASE)_dll</if>
208 </set>
209
210 <set var="LIBDIRNAME" make_var="1">
211 <if cond="FORMAT=='autoconf'">$(wx_top_builddir)/lib</if>
212 <if cond="FORMAT!='autoconf'">
213 $(nativePaths(TOP_SRCDIR))lib$(DIRSEP)$(COMPILER_PREFIX)$(DIR_SUFFIX_CPU)_$(LIBTYPE_SUFFIX)$(CFG)
214 </if>
215 </set>
216
217 <if cond="FORMAT!='autoconf'">
218 <set var="SETUPHDIR" make_var="1">
219 $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WX_U_D_SUFFIX)
220 </set>
221 </if>
222
223
224
225 <!-- =============================================================== -->
226 <!-- Templates for libs: -->
227 <!-- =============================================================== -->
228
229 <set var="DEBUGINFO">
230 <if cond="BUILD=='debug' and DEBUG_INFO=='default'">on</if>
231 <if cond="DEBUG_INFO=='1'">on</if>
232 <if cond="BUILD=='release' and DEBUG_INFO=='default'">off</if>
233 <if cond="DEBUG_INFO=='0'">off</if>
234 </set>
235 <set var="DEBUGRUNTIME">
236 <if cond="DEBUG_RUNTIME_LIBS=='default' and BUILD=='debug'">on</if>
237 <if cond="DEBUG_RUNTIME_LIBS=='default' and BUILD=='release'">off</if>
238 <if cond="DEBUG_RUNTIME_LIBS=='0'">off</if>
239 <if cond="DEBUG_RUNTIME_LIBS=='1'">on</if>
240 </set>
241 <set var="OPTIMIZEFLAG">
242 <if cond="BUILD=='debug'">off</if>
243 <if cond="BUILD=='release'">speed</if>
244 </set>
245 <set var="EXCEPTIONSFLAG">
246 <if cond="USE_EXCEPTIONS=='1'">on</if>
247 <if cond="USE_EXCEPTIONS=='0'">off</if>
248 </set>
249 <set var="RTTIFLAG">
250 <if cond="USE_RTTI=='1'">on</if>
251 <if cond="USE_RTTI=='0'">off</if>
252 </set>
253 <set var="THREADSFLAG">
254 <if cond="USE_THREADS=='1'">multi</if>
255 <if cond="USE_THREADS=='0'">single</if>
256 </set>
257
258 <set var="RTTI_DEFINE">
259 <if cond="USE_RTTI=='0'">wxNO_RTTI</if>
260 </set>
261 <set var="EXCEPTIONS_DEFINE">
262 <if cond="USE_EXCEPTIONS=='0'">wxNO_EXCEPTIONS</if>
263 </set>
264 <set var="THREAD_DEFINE">
265 <if cond="USE_THREADS=='0'">wxNO_THREADS</if>
266 </set>
267
268 <set var="DEBUG_DEFINE">
269 <if cond="DEBUG_FLAG=='0'">wxDEBUG_LEVEL=0</if>
270 </set>
271 <set var="NDEBUG_DEFINE">
272 <if cond="FORMAT!='autoconf' and DEBUG_RUNTIME_LIBS=='default' and BUILD=='release'">NDEBUG</if>
273 <if cond="FORMAT!='autoconf' and DEBUG_RUNTIME_LIBS=='0'">NDEBUG</if>
274 </set>
275
276 <!-- does not cover all cases, but better than nothing -->
277 <set var="NO_VC_CRTDBG">
278 <if cond="FORMAT=='msvc' and BUILD=='debug' and DEBUG_RUNTIME_LIBS=='0'">__NO_VC_CRTDBG__</if>
279 <if cond="FORMAT=='msvc' and BUILD=='release' and DEBUG_FLAG=='1'">__NO_VC_CRTDBG__</if>
280 </set>
281 <set var="UNICODE_DEFINE">
282 <if cond="FORMAT!='autoconf' and UNICODE=='1'">_UNICODE</if>
283 <if cond="FORMAT!='autoconf' and UNICODE=='0'">wxUSE_UNICODE=0</if>
284 </set>
285 <set var="MSLU_DEFINE">
286 <if cond="FORMAT!='autoconf' and MSLU=='1'">wxUSE_UNICODE_MSLU=1</if>
287 </set>
288
289 <!-- fill for the specific case of the format/compiler -->
290 <set var="WIN32_WINNT">
291 <if cond="FORMAT=='dmars' or FORMAT=='dmars_smake'">_WIN32_WINNT=0x0400</if>
292 </set>
293
294 <set var="UNICOWS_LIB">
295 <if cond="MSLU=='1'">unicows</if>
296 </set>
297 <set var="CAIRO_LIB">
298 <if cond="USE_CAIRO=='1'">cairo</if>
299 </set>
300 <set var="CAIRO_LIBDIR">
301 <if cond="USE_CAIRO=='1'">$(DOLLAR)(CAIRO_ROOT)/lib</if>
302 </set>
303 <set var="CAIRO_INCLUDEDIR">
304 <if cond="USE_CAIRO=='1'">$(DOLLAR)(CAIRO_ROOT)/include/cairo</if>
305 </set>
306
307 <set var="LINK_TARGET_CPU">
308 <if cond="TARGET_CPU=='amd64'">/MACHINE:X64</if>
309 <if cond="TARGET_CPU=='AMD64'">/MACHINE:X64</if>
310 <if cond="TARGET_CPU=='ia64'">/MACHINE:IA64</if>
311 <if cond="TARGET_CPU=='IA64'">/MACHINE:IA64</if>
312 </set>
313
314 <template id="common_settings">
315 <debug-info>$(DEBUGINFO)</debug-info>
316 <debug-runtime-libs>$(DEBUGRUNTIME)</debug-runtime-libs>
317 <optimize>$(OPTIMIZEFLAG)</optimize>
318 <threading>$(THREADSFLAG)</threading>
319 <runtime-libs>$(RUNTIME_LIBS)</runtime-libs>
320 <cxx-rtti>$(RTTIFLAG)</cxx-rtti>
321 <cxx-exceptions>$(EXCEPTIONSFLAG)</cxx-exceptions>
322 <if cond="FORMAT!='autoconf'">
323 <cppflags>$(EXTRACFLAGS)</cppflags>
324 </if>
325 <!-- Suppress deprecation warnings for standard library calls -->
326 <if cond="FORMAT in ['msvs2005prj','msvs2008prj']">
327 <define>_CRT_SECURE_NO_DEPRECATE=1</define>
328 <define>_CRT_NON_CONFORMING_SWPRINTFS=1</define>
329 <define>_SCL_SECURE_NO_WARNINGS=1</define>
330 </if>
331
332 <define>$(NO_VC_CRTDBG)</define>
333 <define>$(WIN32_WINNT)</define>
334 <if cond="FORMAT=='msvc'">
335 <ldflags>$(LINK_TARGET_CPU)</ldflags>
336 </if>
337 <include cond="FORMAT=='msevc4prj'">$(TOP_SRCDIR)build/wince/missing</include>
338 </template>
339
340 <template id="anylib">
341 <dirname>$(LIBDIRNAME)</dirname>
342 <install-to>$(LIBDIR)</install-to>
343 </template>
344
345 <template id="3rdparty_lib" template="common_settings,anylib">
346 <if cond="FORMAT=='autoconf'">
347 <libname>$(id)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)</libname>
348 </if>
349 <if cond="FORMAT!='autoconf'">
350 <libname>$(id)$(WXDEBUGFLAG)$(HOST_SUFFIX)</libname>
351 </if>
352 <!--
353 we want to install 3rd party libs system-wide only with static
354 version of wxWidgets; otherwise they are embedded in shared libs:
355 -->
356 <install-if>SHARED=='0'</install-if>
357 <pic>$(substituteFromDict(SHARED, {'0':'off', '1':'on'}))</pic>
358
359 <!--
360 we don't want to have asserts in the 3rd party libraries code,
361 neither we nor wx users are interested in debugging them anyhow
362 -->
363 <define>NDEBUG</define>
364
365 <if cond="IS_MSVC">
366 <!--
367 we're not interested in deprecation warnings about the use of
368 standard C functions in the 3rd party libraries (these warnings
369 are only given by VC8+ but it's simpler to just always define
370 this symbol which disables them, even for previous VC versions)
371 -->
372 <define>_CRT_SECURE_NO_WARNINGS</define>
373 </if>
374 </template>
375
376
377 <!-- deal with the need to copy setup.h here: -->
378
379 <define-tag name="msvc-headers" rules="dll,lib">
380 <if cond="IS_MSVC_PRJ">
381 <msvc-project-files>
382 $(addPrefixToList('include\\', wxwin.headersOnly(value)))
383 </msvc-project-files>
384 </if>
385 </define-tag>
386
387 <set var="msvc_copy_setup_h_script">
388 <if cond="IS_MSVC_PRJ=='1' and FORMAT not in ['msvc6prj','msevc4prj']">
389 Creating $(SETUPHDIR)\wx\setup.h
390 InputPath=..\..\include\wx\%s
391
392 "$(SETUPHDIR)\wx\setup.h" :
393 $(TAB)copy "$(DOLLAR)(InputPath)" $(SETUPHDIR)\wx\setup.h
394 </if>
395 <if cond="IS_MSVC_PRJ=='1' and FORMAT in ['msvc6prj','msevc4prj']">
396 Creating $(SETUPHDIR)\wx\setup.h
397 InputPath=..\..\include\wx\%s
398
399 "$(SETUPHDIR)\wx\setup.h" : $(DOLLAR)(SOURCE) "$(DOLLAR)(INTDIR)" "$(DOLLAR)(OUTDIR)"
400 $(TAB)copy "$(DOLLAR)(InputPath)" $(SETUPHDIR)\wx\setup.h
401 </if>
402 </set>
403
404 <define-tag name="msvc-headers-setup-h" rules="dll,lib">
405 <if cond="IS_MSVC_PRJ">
406 <msvc-headers>
407 $(addPrefixToList('wx/', value))
408 </msvc-headers>
409 <set var="_custom_build_files" append="1">
410 $(nativePaths(addPrefixToList('include/wx/', value)))
411 </set>
412 </if>
413 </define-tag>
414
415 <define-tag name="msvc-copy-setup-h" rules="dll,lib">
416 <if cond="IS_MSVC_PRJ">
417 <if cond="FORMAT=='msevc4prj'">
418 <msvc-headers-setup-h>
419 msw/wince/setup.h
420 </msvc-headers-setup-h>
421 <set var="_custom_build_include_wx_msw_wince_setup_h">
422 $(msvc_copy_setup_h_script % 'msw\wince\setup.h')
423 </set>
424 </if>
425 <if cond="FORMAT!='msevc4prj'">
426 <msvc-headers-setup-h>
427 msw/setup.h
428 univ/setup.h
429 </msvc-headers-setup-h>
430 <set var="_custom_build_include_wx_msw_setup_h">
431 <if cond="WXUNIV=='0'">
432 $(msvc_copy_setup_h_script % 'msw\setup.h')
433 </if>
434 </set>
435 <set var="_custom_build_include_wx_univ_setup_h">
436 <if cond="WXUNIV=='1'">
437 $(msvc_copy_setup_h_script % 'univ\setup.h')
438 </if>
439 </set>
440 </if>
441 </if>
442 </define-tag>
443
444 <define-tag name="msvc-create-rcdefs-h" rules="dll,lib">
445 <if cond="IS_MSVC_PRJ">
446 <msvc-headers-setup-h>
447 msw/genrcdefs.h
448 </msvc-headers-setup-h>
449 <!-- FIXME: we need another way to get the compiler name -->
450 <set var="VC_COMPILER">
451 <if cond="FORMAT=='msevc4prj'">$(_COMPILER)</if>
452 <if cond="FORMAT!='msevc4prj'">cl</if>
453 </set>
454 <set var="_custom_build_include_wx_msw_genrcdefs_h">
455 Creating $(SETUPHDIR)\wx\msw\rcdefs.h
456 InputPath=..\..\include\wx\msw\genrcdefs.h
457
458 "$(SETUPHDIR)\wx\msw\rcdefs.h" : "$(DOLLAR)(SOURCE)" "$(SETUPHDIR)\wx\msw"
459 $(TAB)$(VC_COMPILER) /EP /nologo "$(DOLLAR)(InputPath)" > "$(SETUPHDIR)\wx\msw\rcdefs.h"
460 </set>
461 </if>
462 </define-tag>
463
464 <template id="msvc_setup_h">
465 <msvc-copy-setup-h/>
466 <msvc-create-rcdefs-h/>
467 </template>
468
469 <!-- =============================================================== -->
470 <!-- 3rd party libs: -->
471 <!-- =============================================================== -->
472
473 <!-- 3rd party libraries: -->
474 <include file="regex.bkl"/>
475 <include file="zlib.bkl"/>
476 <include file="png.bkl"/>
477 <include file="jpeg.bkl"/>
478 <include file="tiff.bkl"/>
479 <include file="expat.bkl"/>
480 <include file="scintilla.bkl"/>
481
482
483 <!-- =============================================================== -->
484 <!-- Templates for wxWidgets libs: -->
485 <!-- =============================================================== -->
486
487 <!-- NB: in monolithic build, even wxBase-only must be linked against
488 GUI extralibs, otherwise there would be unresolved references.
489 The variables below are defined so that all libs are used
490 in monolithic build, but not in multilib one. -->
491 <set var="EXTRALIBS_FOR_BASE">
492 <if cond="MONOLITHIC=='1'">$(EXTRALIBS) $(EXTRALIBS_XML) $(EXTRALIBS_GUI)</if>
493 <if cond="MONOLITHIC=='0'">$(EXTRALIBS)</if>
494 </set>
495 <set var="EXTRALIBS_FOR_GUI">
496 <if cond="MONOLITHIC=='1'"></if>
497 <if cond="MONOLITHIC=='0'">$(EXTRALIBS_GUI)</if>
498 </set>
499
500 <if cond="TOOLKIT=='MGL' and FORMAT=='watcom'">
501 <set var="MGLLIBPATH">$(DOLLAR)(%SCITECH)/lib/$(BUILD)/dos32/ow10</set>
502 <set var="MGLPMLIBPATH">
503 <if cond="DOS32=='DOS4GW'">dos4gw</if>
504 </set>
505 </if>
506
507 <template id="wx" template="common_settings">
508 <set var="wxid">$(wxwin.mk_wxid(id))</set>
509 <define>__WX$(TOOLKIT)__</define>
510 <define>$(WXUNIV_DEFINE)</define>
511 <define>$(DEBUG_DEFINE)</define>
512 <define>$(NDEBUG_DEFINE)</define>
513 <define>$(EXCEPTIONS_DEFINE)</define>
514 <define>$(RTTI_DEFINE)</define>
515 <define>$(THREAD_DEFINE)</define>
516 <define>$(UNICODE_DEFINE)</define>
517 <define>$(MSLU_DEFINE)</define>
518 <include cond="FORMAT!='autoconf'">$(SETUPHDIR)</include>
519 <include cond="FORMAT!='autoconf'">$(TOP_SRCDIR)include</include>
520 <include cond="FORMAT!='autoconf'">$(CAIRO_INCLUDEDIR)</include>
521 <lib-path>$(LIBDIRNAME)</lib-path>
522 <if cond="TOOLKIT=='MGL' and FORMAT=='watcom'">
523 <lib-path>$(MGLLIBPATH)</lib-path>
524 <lib-path>$(MGLLIBPATH)/$(MGLPMLIBPATH)</lib-path>
525 </if>
526
527 <warnings>max</warnings>
528 <cxxflags cond="FORMAT=='autoconf'">$(CXXWARNINGS)</cxxflags>
529 <cppflags-watcom>
530 -wcd=549 <!-- 'sizeof' operand contains compiler generated information -->
531 -wcd=656 <!-- define this function inside its class definition (may improve code quality) -->
532 -wcd=657 <!-- define this function inside its class definition (could have improved code quality) -->
533 -wcd=667 <!-- 'va_start' macro will not work without an argument before '...' -->
534 </cppflags-watcom>
535 <cxxflags-mingw>
536 -Wno-ctor-dtor-privacy <!-- only defines a private destructor and has no friends -->
537 </cxxflags-mingw>
538 </template>
539
540 <!-- for both GUI and wxBase libs/samples: -->
541 <template id="wx_append_base_nomono">
542 <!-- link against builtin 3rd party libs, if needed: -->
543 <sys-lib>$(LIB_ZLIB)</sys-lib>
544 <sys-lib>$(LIB_REGEX)</sys-lib>
545 <sys-lib>$(LIB_EXPAT)</sys-lib>
546
547 <ldlibs>$(EXTRALIBS_FOR_BASE)</ldlibs>
548
549 <!-- system libraries on os2: -->
550 <if cond="FORMAT!='autoconf' and PLATFORM_OS2=='1'">
551 <if cond="FORMAT=='watcom'">
552 <sys-lib>upm32</sys-lib>
553 </if>
554 </if>
555
556 <!-- system libraries on mgl: -->
557 <if cond="FORMAT=='watcom' and TOOLKIT=='MGL'">
558 <sys-lib>mgl</sys-lib>
559 <sys-lib>mglcpp</sys-lib>
560 <sys-lib>pm</sys-lib>
561 </if>
562
563 <!-- system libraries on windows: -->
564 <if cond="FORMAT!='autoconf' and PLATFORM_WIN32=='1'">
565 <sys-lib>$(UNICOWS_LIB)</sys-lib>
566 <sys-lib>$(CAIRO_LIB)</sys-lib>
567 <lib-path>$(CAIRO_LIBDIR)</lib-path>
568 <if cond="FORMAT=='borland'">
569 <sys-lib>ole2w32</sys-lib>
570 </if>
571 <if cond="FORMAT=='msevc4prj'">
572 <sys-lib>ole32</sys-lib>
573 <sys-lib>oleaut32</sys-lib>
574 <sys-lib>uuid</sys-lib>
575 <sys-lib>commctrl</sys-lib>
576 <sys-lib>winsock</sys-lib>
577 <sys-lib>wininet</sys-lib>
578 </if>
579 <if cond="FORMAT!='borland' and FORMAT!='msevc4prj'">
580 <sys-lib>kernel32</sys-lib>
581 <sys-lib>user32</sys-lib>
582 <sys-lib>gdi32</sys-lib>
583 <sys-lib>comdlg32</sys-lib>
584 <sys-lib>winspool</sys-lib>
585 <sys-lib>winmm</sys-lib>
586 <sys-lib>shell32</sys-lib>
587 <sys-lib>comctl32</sys-lib>
588 <sys-lib>ole32</sys-lib>
589 <sys-lib>oleaut32</sys-lib>
590 <sys-lib>uuid</sys-lib>
591 <sys-lib>rpcrt4</sys-lib>
592 <sys-lib>advapi32</sys-lib>
593 <sys-lib>wsock32</sys-lib>
594 <!-- this one is only used if wxUSE_URL_NATIVE==1 but we don't
595 know if it is here so just add it unconditionally -->
596 <sys-lib>wininet</sys-lib>
597 </if>
598 <if cond="FORMAT=='borland'">
599 <sys-lib>oleacc</sys-lib>
600 </if>
601 </if>
602 </template>
603
604
605 <!-- for GUI libs/samples: -->
606 <template id="wx_append_nomono" template_append="wx_append_base_nomono">
607 <sys-lib>$(LIB_TIFF)</sys-lib>
608 <sys-lib>$(LIB_JPEG)</sys-lib>
609 <sys-lib>$(LIB_PNG)</sys-lib>
610 <ldlibs>$(EXTRALIBS_FOR_GUI)</ldlibs>
611 </template>
612
613 <set var="LIB_PNG_IF_MONO">
614 <if cond="MONOLITHIC=='1'">$(LIB_PNG)</if>
615 </set>
616
617 <template id="wx_append_base" template_append="wx_append_base_nomono">
618 <!-- Always link against the full wx library in monolithic build and
619 also against the PNG one as core code references it for Tango
620 icons and so it is pulled in even by the console programs. -->
621 <sys-lib>$(WXLIB_MONO)</sys-lib>
622 <sys-lib>$(LIB_PNG_IF_MONO)</sys-lib>
623 </template>
624 <template id="wx_append" template_append="wx_append_nomono">
625 <!-- Always link against the wxWin library in monolithic build: -->
626 <sys-lib>$(WXLIB_MONO)</sys-lib>
627 </template>
628
629
630 <set var="WX_DISABLE_PRECOMP_HEADERS" overwrite="0">0</set>
631
632 <template id="wx_lib_b" template="wx,anylib">
633 <set var="WXLIBNAME">$(wxwin.mkLibName(wxid))</set>
634 <libname>$(WXLIBNAME)</libname>
635
636 <define>WXBUILDING</define>
637
638 <if cond="WX_DISABLE_PRECOMP_HEADERS=='0'">
639 <if cond="FORMAT!='autoconf' and TOOLKIT in ['MSW','MGL','PM','WINCE']">
640 <sources>$(WXTOPDIR)src/common/dummy.cpp</sources>
641 <precomp-headers-gen>
642 $(WXTOPDIR)src/common/dummy.cpp
643 </precomp-headers-gen>
644 </if>
645 <precomp-headers-location>$(WXTOPDIR)include</precomp-headers-location>
646 <precomp-headers-header>wx/wxprec.h</precomp-headers-header>
647 <precomp-headers>on</precomp-headers>
648 <precomp-headers-file>wxprec_$(id)</precomp-headers-file>
649 <precomp-headers-exclude>
650 src/common/extended.c
651 </precomp-headers-exclude>
652 </if>
653
654 <if cond="IS_MSVC_PRJ=='1' and BUILDING_LIB=='1'">
655 <msvc-file-group>Common Sources:src/common/*</msvc-file-group>
656 <msvc-file-group>MSW Sources:src/msw/*</msvc-file-group>
657 <msvc-file-group>Generic Sources:src/generic/*</msvc-file-group>
658 <msvc-file-group>wxUniv Sources:src/univ/*</msvc-file-group>
659 <msvc-file-group>wxHTML Sources:src/html/*</msvc-file-group>
660 <msvc-file-group>Setup Headers:*/setup.h</msvc-file-group>
661 <msvc-file-group>MSW Headers:*wx/msw/*.h</msvc-file-group>
662 <msvc-file-group>Generic Headers:*wx/generic/*.h</msvc-file-group>
663 <msvc-file-group>wxUniv Headers:*wx/univ/*.h</msvc-file-group>
664 <msvc-file-group>wxHTML Headers:*wx/html/*.h</msvc-file-group>
665 <msvc-file-group>Common Headers:*wx/*.h</msvc-file-group>
666 </if>
667 </template>
668
669 <if cond="FORMAT=='autoconf'">
670 <set var="RCDEFDIR">
671 <if cond="TOOLKIT=='MSW'">
672 $(LIBDIRNAME)/wx/include/$(TOOLCHAIN_FULLNAME)
673 </if>
674 </set>
675 </if>
676
677 <template id="wx_dll_b" template="wx_lib_b">
678 <set var="WXDLLNAME">$(wxwin.mkDllName(wxid))</set>
679 <dllname>$(WXDLLNAME)</dllname>
680 <version>$(WX_VERSION)</version>
681 <so_version>$(WXSOVERSION)</so_version>
682
683 <!-- FIXME: until libtool scheme is implemented in bakefile -->
684 <ldflags cond="FORMAT=='autoconf'">$(WXMACVERSION_CMD)</ldflags>
685
686 <!-- version info resources: -->
687 <res-define>WXDLLNAME=$(WXDLLNAME)</res-define>
688 <if cond="FORMAT=='autoconf'">
689 <res-include>$(RCDEFDIR)</res-include>
690 <res-include>$(TOP_SRCDIR)include</res-include>
691 <postlink-command>$(DYLIB_RPATH_POSTLINK)</postlink-command>
692 </if>
693 <win32-res>$(WXTOPDIR)src/msw/version.rc</win32-res>
694
695 </template>
696
697 <template id="wx_3rdparty_dependencies_gui" cond="USE_GUI=='1'">
698 <depends>wxtiff</depends>
699 <depends>wxjpeg</depends>
700 <depends>wxpng</depends>
701 <depends>wxscintilla</depends>
702 </template>
703
704 <template id="wx_3rdparty_dependencies"
705 template="wx_3rdparty_dependencies_gui">
706 <depends>wxexpat</depends>
707 <depends>wxzlib</depends>
708 <depends>wxregex</depends>
709 </template>
710
711 <template id="wx_3rdparty_includes_gui" cond="USE_GUI=='1'">
712 <if cond="FORMAT=='watcom' and TOOLKIT=='MGL'">
713 <include>$(DOLLAR)(%SCITECH)/include</include>
714 </if>
715 <include>$(INC_TIFF_BUILD)</include>
716 <include>$(INC_TIFF)</include>
717 <include>$(INC_JPEG)</include>
718 <include>$(INC_PNG)</include>
719 </template>
720
721 <template id="wx_3rdparty_includes"
722 template="wx_3rdparty_includes_gui">
723 <include>$(INC_ZLIB)</include>
724 <include>$(INC_REGEX)</include>
725 <include>$(INC_EXPAT)</include>
726 </template>
727
728 <template id="wx_lib"
729 template="wx_lib_b,wx_3rdparty_includes,msvc_setup_h"/>
730 <template id="wx_base_lib"
731 template="wx_lib_b,wx_3rdparty_includes,msvc_setup_h">
732 <define>wxUSE_GUI=0</define>
733 </template>
734
735 <template id="wx_dll"
736 template="wx_dll_b,wx_3rdparty_dependencies,wx_3rdparty_includes"
737 template_append="msvc_setup_h,wx_append_nomono"/>
738 <template id="wx_base_dll"
739 template="wx_dll_b,wx_3rdparty_dependencies,wx_3rdparty_includes"
740 template_append="msvc_setup_h,wx_append_base_nomono">
741 <define>wxUSE_GUI=0</define>
742 </template>
743
744 <!-- =============================================================== -->
745 <!-- Templates for building wxWidgets plugins: -->
746 <!-- =============================================================== -->
747
748 <if cond="WX_STABLE_BRANCH=='1'">
749 <set var="PLUGIN_VERSION0">
750 <if cond="PLATFORM_UNIX=='1'">$(WX_RELEASE)</if>
751 <if cond="PLATFORM_UNIX=='0'">$(WX_RELEASE_NODOT)</if>
752 </set>
753 </if>
754 <if cond="WX_STABLE_BRANCH=='0'">
755 <set var="PLUGIN_VERSION0">
756 <if cond="PLATFORM_UNIX=='1'">$(WX_VERSION)</if>
757 <if cond="PLATFORM_UNIX=='0'">$(WX_VERSION_NODOT)</if>
758 </set>
759 </if>
760 <set var="PLUGVERDELIM">
761 <if cond="PLATFORM_UNIX=='1'">-</if>
762 <if cond="PLATFORM_UNIX=='0'"></if>
763 </set>
764 <set var="PLUGIN_VERSION">$(PLUGVERDELIM)$(PLUGIN_VERSION0)</set>
765
766 <set var="PLUGINS_INST_DIR" make_var="1">
767 $(LIBDIR)/wx/$(PLUGIN_VERSION0)
768 </set>
769
770 <define-rule name="wx-base-plugin" extends="module">
771 <template>
772 <dllname>
773 $(id)$(WX_U_D_SUFFIX)$(PLUGIN_VERSION)$(WXCOMPILER)
774 </dllname>
775 <define>WXUSINGDLL</define>
776 <define>wxUSE_GUI=0</define>
777 <install-to>$(PLUGINS_INST_DIR)</install-to>
778 </template>
779 </define-rule>
780
781 <define-rule name="wx-gui-plugin" extends="module">
782 <template template="wx">
783 <dllname>
784 $(id)_$(PORTNAME)$(WXUNIVNAME)$(WX_U_D_SUFFIX)$(PLUGIN_VERSION)$(WXCOMPILER)
785 </dllname>
786 <define>WXUSINGDLL</define>
787 <install-to>$(PLUGINS_INST_DIR)</install-to>
788 </template>
789 </define-rule>
790
791 <!-- =============================================================== -->
792 <!-- Support for wxWidgets samples: -->
793 <!-- =============================================================== -->
794
795 <!-- Link against one wxWin library. Value must be literal! -->
796 <define-tag name="wx-lib" rules="exe,dll,module">
797 <sys-lib>$(wxwin.libToLink(value))</sys-lib>
798 <ldlibs>$(wxwin.extraLdflags(value))</ldlibs>
799 <!-- msvs200?prj formats don't support external dependencies yet: -->
800 <if cond="FORMAT in ['msvc6prj','msevc4prj'] and MONOLITHIC=='0'">
801 <depends-on-dsp>$(wxwin.makeDspDependency(value))</depends-on-dsp>
802 </if>
803 </define-tag>
804
805
806 <!-- A hack to keep autoconf happy (we pass CPPFLAGS that contain
807 {top_srcdir} from configure, poor bakefile can't know that
808 and won't output top_srcdir = @top_srcdir@ line): -->
809 <set var="VARS_DONT_ELIMINATE" append="1">top_srcdir</set>
810
811
812 </makefile>