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