Compensation for bkl 0.1.9.X/eVC4/RTTI bug.
[wxWidgets.git] / build / bakefiles / common.bkl
1 <?xml version="1.0" ?>
2 <!-- $Id$ -->
3
4 <makefile>
5
6     <requires version="0.1.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     <include file="config.bkl"/>
29
30     <include file="plugins_deps.bkl"/>
31
32
33     <!-- wxWidgets version numbers logic: -->
34     <include file="version.bkl"/>
35
36
37     <!-- ================================================================== -->
38     <!--                     Names of libraries and DLLs:                   -->
39     <!-- ================================================================== -->
40
41     <set var="PORTNAME">
42         <if cond="USE_GUI=='0'">base</if>
43         <if cond="USE_GUI=='1'">$(TOOLKIT_LOWERCASE)$(TOOLKIT_VERSION)</if>
44     </set>
45
46     <set var="WXBASEPORT">
47         <if cond="TOOLKIT=='MAC'">_carbon</if>
48     </set>
49
50     <set var="COMPILERORGCC">
51         <if cond="isdefined('COMPILER')">$(COMPILER)</if>
52         <if cond="not isdefined('COMPILER')">gcc</if>
53     </set>
54     <set var="WXCOMPILER">
55         <if cond="PLATFORM_WIN32=='1'">_$(COMPILERORGCC)</if>
56     </set>
57
58     <set var="VENDORTAG">
59         <if cond="PLATFORM_WIN32=='1' and OFFICIAL_BUILD=='1'"></if>
60         <if cond="PLATFORM_WIN32=='1' and OFFICIAL_BUILD=='0'">_$(VENDOR)</if>
61     </set>
62
63     <set var="WXDEBUGFLAG">
64         <if cond="BUILD=='debug' and DEBUG_FLAG=='default'">d</if>
65         <if cond="DEBUG_FLAG=='1'">d</if>
66     </set>
67     <set var="WXUNICODEFLAG">
68         <!-- WinCE is Unicode-only platform: -->
69         <if cond="UNICODE=='1' and FORMAT!='msevc4prj'">u</if>
70     </set>
71     <set var="WXNAMESUFFIX">
72         $(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)
73     </set>
74
75     <set var="WXUNIVNAME">
76         <if cond="WXUNIV=='1'">univ</if>
77     </set>
78     <set var="WXUNIV_DEFINE">
79         <if cond="WXUNIV=='1'">__WXUNIVERSAL__</if>
80     </set>
81
82     <if cond="FORMAT=='autoconf'">
83         <set var="WXNAMEPREFIX">wx_base$(WXBASEPORT)</set>
84         <set var="WXNAMEPREFIXGUI">wx_$(PORTNAME)$(WXUNIVNAME)</set>
85         <set var="WXVERSIONTAG">-$(WX_RELEASE)</set>
86     </if>
87     <if cond="FORMAT!='autoconf'">
88         <set var="WXNAMEPREFIX">
89             wxbase$(WXBASEPORT)$(WX_RELEASE_NODOT)
90         </set>
91         <set var="WXNAMEPREFIXGUI">
92             wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE_NODOT)</set>
93         <set var="WXVERSIONTAG"></set>
94     </if>
95     <set var="WXDLLNAMEPREFIX">
96         <if cond="PLATFORM_WIN32=='1'">
97             wxbase$(WXBASEPORT)$(WXWIN32DLLVERSION)
98         </if>
99         <if cond="PLATFORM_WIN32=='0'">$(WXNAMEPREFIX)</if>
100     </set>
101     <set var="WXDLLNAMEPREFIXGUI">
102         <if cond="PLATFORM_WIN32=='1'">
103             wx$(PORTNAME)$(WXUNIVNAME)$(WXWIN32DLLVERSION)
104         </if>
105         <if cond="PLATFORM_WIN32=='0'">$(WXNAMEPREFIXGUI)</if>
106     </set>
107     <set var="WXDLLVERSIONTAG">
108         <if cond="PLATFORM_WIN32=='1'"></if>
109         <if cond="PLATFORM_WIN32=='0'">$(WXVERSIONTAG)</if>
110     </set>
111
112
113     <!-- =============================================================== -->
114     <!--                    Names of component libraries:                -->
115     <!-- =============================================================== -->
116
117     <set var="WXLIB_BASE">
118         <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('base')))</if>
119     </set>
120     <set var="WXLIB_NET">
121         <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('net')))</if>
122     </set>
123     <set var="WXLIB_QA">
124         <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('qa')))</if>
125     </set>
126     <set var="WXLIB_CORE">
127         <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('core')))</if>
128     </set>
129     <set var="WXLIB_ADV">
130         <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('adv')))</if>
131     </set>
132     <set var="WXLIB_MEDIA">
133         <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('media')))</if>
134     </set>
135     <set var="WXLIB_HTML">
136         <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('html')))</if>
137     </set>
138     <set var="WXLIB_XML">
139         <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('xml')))</if>
140     </set>
141     <set var="WXLIB_XRC">
142         <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('xrc')))</if>
143     </set>
144     <set var="WXLIB_ODBC">
145         <if cond="MONOLITHIC=='0' and USE_ODBC=='1'">
146             $(mk.evalExpr(wxwin.mkLibName('odbc')))
147         </if>
148     </set>
149     <set var="WXLIB_DBGRID">
150         <if cond="MONOLITHIC=='0'">$(mk.evalExpr(wxwin.mkLibName('dbgrid')))</if>
151     </set>
152
153     <set var="WXLIB_MONO">
154         <if cond="MONOLITHIC=='1'">$(mk.evalExpr(wxwin.mkLibName('mono')))</if>
155     </set>
156
157
158     <!-- =============================================================== -->
159     <!--             Where to store built libraries and objects:         -->
160     <!-- =============================================================== -->
161
162     <set var="DIR_SUFFIX_CPU">
163         <if cond="FORMAT=='msevc4prj'">_$(CPU)</if>
164     </set>
165
166     <if cond="FORMAT!='autoconf'">
167         <set var="WXDLLFLAG">
168             <if cond="SHARED=='1'">dll</if>
169         </set>
170         <set var="CFG_NAME_PART">
171             $(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WXDLLFLAG)$(CFG)
172         </set>
173         <set var="OBJS" make_var="1">
174             <if cond="FORMAT!='cbuilderx'">
175                 $(COMPILER)_$(CFG_NAME_PART)$(DIR_SUFFIX_CPU)
176             </if>
177             <!-- FIXME: waiting for removal after CBX has better ../ dirs
178                  support -->
179             <if cond="FORMAT=='cbuilderx'">build_cbx_$(CFG_NAME_PART)</if>
180         </set>
181
182         <set var="BUILDDIR">$(OBJS)</set>
183     </if>
184
185     <set var="LIBTYPE_SUFFIX" make_var="1">
186         <if cond="FORMAT!='autoconf' and SHARED=='0' and PLATFORM_WIN32=='1'">lib</if>
187         <if cond="FORMAT!='autoconf' and SHARED=='1' and PLATFORM_WIN32=='1'">dll</if>
188         <if cond="FORMAT=='watcom' and SHARED=='0' and PLATFORM_WIN32=='0'">$(TOOLKIT_LOWERCASE)_lib</if>
189         <if cond="FORMAT=='watcom' and SHARED=='1' and PLATFORM_WIN32=='0'">$(TOOLKIT_LOWERCASE)_dll</if>
190     </set>
191
192     <set var="LIBDIRNAME" make_var="1">
193         <if cond="FORMAT=='autoconf'">$(top_builddir)lib</if>
194         <if cond="FORMAT!='autoconf'">
195             $(nativePaths(TOP_SRCDIR))lib$(DIRSEP)$(COMPILER)$(DIR_SUFFIX_CPU)_$(LIBTYPE_SUFFIX)$(CFG)
196         </if>
197     </set>
198
199     <if cond="FORMAT!='autoconf'">
200         <set var="SETUPHDIR" make_var="1">
201             $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)
202         </set>
203     </if>
204
205
206
207     <!-- =============================================================== -->
208     <!--                        Templates for libs:                      -->
209     <!-- =============================================================== -->
210
211     <set var="DEBUGINFO">
212         <if cond="BUILD=='debug' and DEBUG_INFO=='default'">on</if>
213         <if cond="DEBUG_INFO=='1'">on</if>
214         <if cond="BUILD=='release' and DEBUG_INFO=='default'">off</if>
215         <if cond="DEBUG_INFO=='0'">off</if>
216     </set>
217     <set var="DEBUGRUNTIME">
218         <if cond="DEBUG_RUNTIME_LIBS=='default' and BUILD=='debug'">on</if>
219         <if cond="DEBUG_RUNTIME_LIBS=='default' and BUILD=='release'">off</if>
220         <if cond="DEBUG_RUNTIME_LIBS=='0'">off</if>
221         <if cond="DEBUG_RUNTIME_LIBS=='1'">on</if>
222     </set>
223     <set var="OPTIMIZEFLAG">
224         <if cond="BUILD=='debug'">off</if>
225         <if cond="BUILD=='release'">speed</if>
226     </set>
227     <set var="EXCEPTIONSFLAG">
228         <if cond="USE_EXCEPTIONS=='1'">on</if>
229         <if cond="USE_EXCEPTIONS=='0'">off</if>
230     </set>
231     <set var="RTTIFLAG">
232         <if cond="USE_RTTI=='1'">on</if>
233         <if cond="USE_RTTI=='0'">off</if>
234     </set>
235     <set var="THREADSFLAG">
236         <if cond="USE_THREADS=='1'">multi</if>
237         <if cond="USE_THREADS=='0'">single</if>
238     </set>
239
240     <set var="RTTI_DEFINE">
241         <if cond="USE_RTTI=='0'">wxNO_RTTI</if>
242     </set>
243     <set var="EXCEPTIONS_DEFINE">
244         <if cond="USE_EXCEPTIONS=='0'">wxNO_EXCEPTIONS</if>
245     </set>
246     <set var="THREAD_DEFINE">
247         <if cond="USE_THREADS=='0'">wxNO_THREADS</if>
248     </set>
249
250     <set var="DEBUG_DEFINE">
251         <if cond="FORMAT!='autoconf' and BUILD=='debug' and DEBUG_FLAG=='default'">__WXDEBUG__</if>
252         <if cond="FORMAT!='autoconf' and DEBUG_FLAG=='1'">__WXDEBUG__</if>
253     </set>
254     <!-- does not cover all cases, but better than nothing -->
255     <set var="NO_VC_CRTDBG">
256         <if cond="FORMAT=='msvc' and BUILD=='debug' and DEBUG_RUNTIME_LIBS=='0'">__NO_VC_CRTDBG__</if>
257         <if cond="FORMAT=='msvc' and BUILD=='release' and DEBUG_FLAG=='1'">__NO_VC_CRTDBG__</if>
258     </set>
259     <set var="UNICODE_DEFINE">
260         <if cond="FORMAT!='autoconf' and UNICODE=='1'">_UNICODE</if>
261     </set>
262     <set var="MSLU_DEFINE">
263         <if cond="FORMAT!='autoconf' and MSLU=='1'">wxUSE_UNICODE_MSLU=1</if>
264     </set>
265
266     <!-- fill for the specific case of the format/compiler -->
267     <set var="WIN32_WINNT">
268         <if cond="FORMAT=='dmars' or FORMAT=='dmars_smake'">_WIN32_WINNT=0x0400</if>
269     </set>
270
271     <set var="UNICOWS_LIB">
272         <if cond="MSLU=='1'">unicows</if>
273     </set>
274
275     <template id="common_settings">
276         <debug-info>$(DEBUGINFO)</debug-info>
277         <debug-runtime-libs>$(DEBUGRUNTIME)</debug-runtime-libs>
278         <optimize>$(OPTIMIZEFLAG)</optimize>
279         <threading>$(THREADSFLAG)</threading>
280         <runtime-libs>$(RUNTIME_LIBS)</runtime-libs>
281         <cxx-rtti>$(RTTIFLAG)</cxx-rtti>
282         <cxx-exceptions>$(EXCEPTIONSFLAG)</cxx-exceptions>
283         <if cond="FORMAT!='autoconf'">
284             <cppflags>$(EXTRACFLAGS)</cppflags>
285         </if>
286         <define>$(NO_VC_CRTDBG)</define>
287         <define>$(WIN32_WINNT)</define>
288         <if cond="FORMAT=='msevc4prj' and
289                   BAKEFILE_VERSION in ['0.1.9'] and
290                   USE_RTTI=='0'">
291             <!-- hack to make eVC4 2.6.2 project files compatible with what we had in 2.6.1 -->
292             <set var="_ldlibs">$(_ldlibs.replace('ccrtrtti.lib', ''))</set>
293             <set var="_cppflags">$(_cppflags.replace('/GR', ''))</set>
294         </if>
295     </template>
296
297     <template id="anylib">
298         <dirname>$(LIBDIRNAME)</dirname>
299         <install-to>$(LIBDIR)</install-to>
300     </template>
301
302     <template id="3rdparty_lib" template="common_settings,anylib">
303         <if cond="FORMAT=='autoconf'">
304             <libname>$(id)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX)</libname>
305         </if>
306         <if cond="FORMAT!='autoconf'">
307             <libname>$(id)$(WXDEBUGFLAG)$(HOST_SUFFIX)</libname>
308         </if>
309         <!--
310         we want to install 3rd party libs system-wide only with static
311         version of wxWidgets; otherwise they are embedded in shared libs:
312         -->
313         <install-if>SHARED=='0'</install-if>
314         <pic>$(substituteFromDict(SHARED, {'0':'off', '1':'on'}))</pic>
315     </template>
316
317
318     <!-- deal with the need to copy setup.h here: -->
319
320     <set var="IS_MSVC_PRJ">$(FORMAT in ['msvc6prj','msevc4prj'])</set>
321
322     <define-tag name="msvc-headers" rules="dll,lib">
323         <if cond="IS_MSVC_PRJ">
324             <!-- FIXME: remove this once we require >=bkl-0.1.9 -->
325             <if cond="BAKEFILE_VERSION in ['0.1.7', '0.1.8']">
326                 <msvc-project-files>
327                     $(addPrefixToList('include\', wxwin.headersOnly(value)))
328                 </msvc-project-files>
329             </if>
330             <if cond="BAKEFILE_VERSION not in ['0.1.7', '0.1.8']">
331                 <msvc-project-files>
332                     $(addPrefixToList('include\\', wxwin.headersOnly(value)))
333                 </msvc-project-files>
334             </if>
335         </if>
336     </define-tag>
337
338     <set var="msvc_copy_setup_h_script">
339         <if cond="IS_MSVC_PRJ">
340 Creating $(SETUPHDIR)\wx\setup.h
341 InputPath=..\include\wx\%s
342
343 "$(SETUPHDIR)\wx\setup.h" : $(DOLLAR)(SOURCE) "$(DOLLAR)(INTDIR)" "$(DOLLAR)(OUTDIR)"
344 $(TAB)copy "$(DOLLAR)(InputPath)" $(SETUPHDIR)\wx\setup.h
345         </if>
346     </set>
347
348     <define-tag name="msvc-headers-setup-h" rules="dll,lib">
349         <if cond="IS_MSVC_PRJ">
350             <msvc-headers>
351                 $(addPrefixToList('wx/', value))
352             </msvc-headers>
353             <set var="_custom_build_files" append="1">
354                 $(nativePaths(addPrefixToList('include/wx/', value)))
355             </set>
356         </if>
357     </define-tag>
358
359     <define-tag name="msvc-copy-setup-h" rules="dll,lib">
360         <if cond="IS_MSVC_PRJ">
361             <if cond="FORMAT=='msevc4prj'">
362                 <msvc-headers-setup-h>
363                     msw/wince/setup.h
364                 </msvc-headers-setup-h>
365                 <set var="_custom_build_include_wx_msw_wince_setup_h">
366                     $(msvc_copy_setup_h_script % 'msw\wince\setup.h')
367                 </set>
368             </if>
369             <if cond="FORMAT!='msevc4prj'">
370                 <msvc-headers-setup-h>
371                     msw/setup.h
372                     univ/setup.h
373                 </msvc-headers-setup-h>
374                 <set var="_custom_build_include_wx_msw_setup_h">
375                     <if cond="WXUNIV=='0'">
376                         $(msvc_copy_setup_h_script % 'msw\setup.h')
377                     </if>
378                 </set>
379                 <set var="_custom_build_include_wx_univ_setup_h">
380                     <if cond="WXUNIV=='1'">
381                         $(msvc_copy_setup_h_script % 'univ\setup.h')
382                     </if>
383                 </set>
384             </if>
385         </if>
386     </define-tag>
387
388     <template id="msvc_setup_h">
389         <msvc-copy-setup-h/>
390     </template>
391
392     <!-- =============================================================== -->
393     <!--                         3rd party libs:                         -->
394     <!-- =============================================================== -->
395
396     <!-- 3rd party libraries: -->
397     <include file="regex.bkl"/>
398     <include file="zlib.bkl"/>
399     <include file="png.bkl"/>
400     <include file="jpeg.bkl"/>
401     <include file="tiff.bkl"/>
402     <include file="odbc.bkl"/>
403     <include file="expat.bkl"/>
404
405
406     <!-- =============================================================== -->
407     <!--                  Templates for wxWidgets libs:                  -->
408     <!-- =============================================================== -->
409
410     <!-- NB: in monolithic build, even wxBase-only must be linked against
411              GUI extralibs, otherwise there would be unresolved references.
412              The variables below are defined so that all libs are used
413              in monolithic build, but not in multilib one. -->
414     <set var="EXTRALIBS_FOR_BASE">
415         <if cond="MONOLITHIC=='1'">$(EXTRALIBS) $(EXTRALIBS_GUI)</if>
416         <if cond="MONOLITHIC=='0'">$(EXTRALIBS)</if>
417     </set>
418     <set var="EXTRALIBS_FOR_GUI">
419         <if cond="MONOLITHIC=='1'"></if>
420         <if cond="MONOLITHIC=='0'">$(EXTRALIBS_GUI)</if>
421     </set>
422
423     <template id="wx" template="common_settings">
424         <set var="wxid">$(wxwin.mk_wxid(id))</set>
425         <define>__WX$(TOOLKIT)__</define>
426         <define>$(WXUNIV_DEFINE)</define>
427         <define>$(DEBUG_DEFINE)</define>
428         <define>$(EXCEPTIONS_DEFINE)</define>
429         <define>$(RTTI_DEFINE)</define>
430         <define>$(THREAD_DEFINE)</define>
431         <define>$(UNICODE_DEFINE)</define>
432         <define>$(MSLU_DEFINE)</define>
433         <!-- this include is added by configure, we need to put other
434              includes before it: -->
435         <include cond="FORMAT!='autoconf'">$(TOP_SRCDIR)include</include>
436         <lib-path>$(LIBDIRNAME)</lib-path>
437         <include cond="FORMAT!='autoconf'">$(SETUPHDIR)</include>
438         <warnings>max</warnings>
439         <cppflags-watcom>
440             -wcd=549 <!-- 'sizeof' operand contains compiler generated information -->
441             -wcd=656 <!-- define this function inside its class definition (may improve code quality) -->
442             -wcd=657 <!-- define this function inside its class definition (could have improved code quality) -->
443             -wcd=667 <!-- 'va_start' macro will not work without an argument before '...' -->
444         </cppflags-watcom>
445         <cxxflags-mingw>
446             -Wno-ctor-dtor-privacy <!-- only defines a private destructor and has no friends -->
447         </cxxflags-mingw>
448     </template>
449
450     <!-- for both GUI and wxBase libs/samples: -->
451     <template id="wx_append_base_nomono">
452         <!-- link against builtin 3rd party libs, if needed: -->
453         <sys-lib>$(LIB_TIFF)</sys-lib>
454         <sys-lib>$(LIB_JPEG)</sys-lib>
455         <sys-lib>$(LIB_PNG)</sys-lib>
456         <sys-lib>$(LIB_ZLIB)</sys-lib>
457         <sys-lib>$(LIB_ODBC)</sys-lib>
458         <sys-lib>$(LIB_REGEX)</sys-lib>
459         <sys-lib>$(LIB_EXPAT)</sys-lib>
460
461         <ldlibs>$(EXTRALIBS_FOR_BASE)</ldlibs>
462
463         <!-- system libraries on os2: -->
464         <if cond="FORMAT!='autoconf' and PLATFORM_OS2=='1'">
465             <if cond="FORMAT=='watcom'">
466                 <sys-lib>upm32</sys-lib>
467             </if>
468         </if>
469
470         <!-- system libraries on windows: -->
471         <if cond="FORMAT!='autoconf' and PLATFORM_WIN32=='1'">
472             <sys-lib>$(UNICOWS_LIB)</sys-lib>
473             <if cond="FORMAT=='borland'">
474                 <sys-lib>ole2w32</sys-lib>
475             </if>
476             <if cond="FORMAT=='msevc4prj'">
477                 <sys-lib>ole32</sys-lib>
478                 <sys-lib>oleaut32</sys-lib>
479                 <sys-lib>uuid</sys-lib>
480                 <sys-lib>commctrl</sys-lib>
481                 <sys-lib>winsock</sys-lib>
482                 <sys-lib>wininet</sys-lib>
483             </if>
484             <if cond="FORMAT!='borland' and FORMAT!='msevc4prj'">
485                 <sys-lib>kernel32</sys-lib>
486                 <sys-lib>user32</sys-lib>
487                 <sys-lib>gdi32</sys-lib>
488                 <sys-lib>comdlg32</sys-lib>
489                 <sys-lib>winspool</sys-lib>
490                 <sys-lib>winmm</sys-lib>
491                 <sys-lib>shell32</sys-lib>
492                 <sys-lib>comctl32</sys-lib>
493                 <sys-lib>ole32</sys-lib>
494                 <sys-lib>oleaut32</sys-lib>
495                 <sys-lib>uuid</sys-lib>
496                 <sys-lib>rpcrt4</sys-lib>
497                 <sys-lib>advapi32</sys-lib>
498                 <sys-lib>wsock32</sys-lib>
499             </if>
500             <if cond="FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'">
501                 <sys-lib>oleacc</sys-lib>
502             </if>
503             <if cond="FORMAT!='msevc4prj'">
504                 <sys-lib>odbc32</sys-lib>
505             </if>
506         </if>
507     </template>
508
509
510     <!-- for GUI libs/samples: -->
511     <template id="wx_append_nomono" template="wx_append_base_nomono">
512         <ldlibs>$(EXTRALIBS_FOR_GUI)</ldlibs>
513     </template>
514
515
516     <template id="wx_append_base" template_append="wx_append_base_nomono">
517         <!-- Always link against the wxWin library in monolithic build: -->
518         <sys-lib>$(WXLIB_MONO)</sys-lib>
519     </template>
520     <template id="wx_append" template_append="wx_append_nomono">
521         <!-- Always link against the wxWin library in monolithic build: -->
522         <sys-lib>$(WXLIB_MONO)</sys-lib>
523     </template>
524
525
526     <set var="WX_DISABLE_PRECOMP_HEADERS" overwrite="0">0</set>
527
528     <template id="wx_lib_b" template="wx,anylib">
529         <set var="WXLIBNAME">$(wxwin.mkLibName(wxid))</set>
530         <libname>$(WXLIBNAME)</libname>
531
532         <if cond="WX_DISABLE_PRECOMP_HEADERS=='0'">
533             <if cond="FORMAT!='autoconf' and TOOLKIT in ['MSW','WINCE']">
534                 <sources>$(WXTOPDIR)src/msw/dummy.cpp</sources>
535                 <precomp-headers-gen>
536                     $(WXTOPDIR)src/msw/dummy.cpp
537                 </precomp-headers-gen>
538             </if>
539             <precomp-headers-location>$(WXTOPDIR)include</precomp-headers-location>
540             <precomp-headers-header>wx/wxprec.h</precomp-headers-header>
541             <precomp-headers>on</precomp-headers>
542             <precomp-headers-file>wxprec_$(id)</precomp-headers-file>
543             <precomp-headers-exclude>
544                 src/common/extended.c
545             </precomp-headers-exclude>
546         </if>
547
548         <if cond="IS_MSVC_PRJ=='1' and BUILDING_LIB=='1'">
549             <msvc-file-group>Common Sources:src/common/*</msvc-file-group>
550             <msvc-file-group>MSW Sources:src/msw/*</msvc-file-group>
551             <msvc-file-group>Generic Sources:src/generic/*</msvc-file-group>
552             <msvc-file-group>wxUniv Sources:src/univ/*</msvc-file-group>
553             <msvc-file-group>wxHTML Sources:src/html/*</msvc-file-group>
554             <msvc-file-group>Setup Headers:*/setup.h</msvc-file-group>
555             <msvc-file-group>MSW Headers:*wx/msw/*.h</msvc-file-group>
556             <msvc-file-group>Generic Headers:*wx/generic/*.h</msvc-file-group>
557             <msvc-file-group>wxUniv Headers:*wx/univ/*.h</msvc-file-group>
558             <msvc-file-group>wxHTML Headers:*wx/html/*.h</msvc-file-group>
559             <msvc-file-group>Common Headers:*wx/*.h</msvc-file-group>
560         </if>
561     </template>
562
563     <template id="wx_dll_b" template="wx_lib_b">
564         <set var="WXDLLNAME">$(wxwin.mkDllName(wxid))</set>
565         <dllname>$(WXDLLNAME)</dllname>
566         <version>$(WX_VERSION)</version>
567         <so_version>$(WXSOVERSION)</so_version>
568
569         <!-- FIXME: until libtool scheme is implemented in bakefile -->
570         <ldflags cond="FORMAT=='autoconf'">$(WXMACVERSION_CMD)</ldflags>
571
572         <!-- version info resources: -->
573         <if cond="FORMAT not in ['rpmspec','wx24dsp']"> <!-- FIXME: fix for bkl-0.1.7 only, remove the cond later -->
574             <res-define>WXDLLNAME=$(WXDLLNAME)</res-define>
575             <res-include cond="FORMAT=='autoconf'">
576                 $(TOP_SRCDIR)include
577             </res-include>
578         </if>
579         <win32-res>$(WXTOPDIR)src/msw/version.rc</win32-res>
580     </template>
581
582     <template id="wx_3rdparty_dependencies_gui" cond="USE_GUI=='1'">
583         <depends>wxtiff</depends>
584         <depends>wxjpeg</depends>
585         <depends>wxpng</depends>
586     </template>
587
588     <template id="wx_3rdparty_dependencies"
589               template="wx_3rdparty_dependencies_gui">
590         <depends>wxexpat</depends>
591         <depends>wxzlib</depends>
592         <depends cond="FORMAT=='autoconf'">wxodbc</depends>
593         <depends>wxregex</depends>
594     </template>
595
596     <template id="wx_3rdparty_includes_gui" cond="USE_GUI=='1'">
597         <include>$(INC_TIFF)</include>
598         <include>$(INC_JPEG)</include>
599         <include>$(INC_PNG)</include>
600     </template>
601
602     <template id="wx_3rdparty_includes"
603               template="wx_3rdparty_includes_gui">
604         <include>$(INC_ZLIB)</include>
605         <include>$(INC_ODBC)</include>
606         <include>$(INC_REGEX)</include>
607         <include>$(INC_EXPAT)</include>
608     </template>
609
610     <template id="wx_lib"
611               template="wx_lib_b,wx_3rdparty_includes,msvc_setup_h"/>
612     <template id="wx_base_lib"
613               template="wx_lib_b,wx_3rdparty_includes,msvc_setup_h">
614         <define>wxUSE_GUI=0</define>
615     </template>
616
617     <template id="wx_dll"
618               template="wx_dll_b,wx_3rdparty_dependencies,wx_3rdparty_includes"
619               template_append="msvc_setup_h,wx_append_nomono"/>
620     <template id="wx_base_dll"
621               template="wx_dll_b,wx_3rdparty_dependencies,wx_3rdparty_includes"
622               template_append="msvc_setup_h,wx_append_base_nomono">
623         <define>wxUSE_GUI=0</define>
624     </template>
625
626     <!-- =============================================================== -->
627     <!--             Templates for building wxWidgets plugins:           -->
628     <!-- =============================================================== -->
629
630     <if cond="WX_STABLE_BRANCH=='1'">
631         <set var="PLUGIN_VERSION0">
632             <if cond="PLATFORM_UNIX=='1'">$(WX_RELEASE)</if>
633             <if cond="PLATFORM_UNIX=='0'">$(WX_RELEASE_NODOT)</if>
634         </set>
635     </if>
636     <if cond="WX_STABLE_BRANCH=='0'">
637         <set var="PLUGIN_VERSION0">
638             <if cond="PLATFORM_UNIX=='1'">$(WX_VERSION)</if>
639             <if cond="PLATFORM_UNIX=='0'">$(WX_VERSION_NODOT)</if>
640         </set>
641     </if>
642     <set var="PLUGVERDELIM">
643         <if cond="PLATFORM_UNIX=='1'">-</if>
644         <if cond="PLATFORM_UNIX=='0'"></if>
645     </set>
646     <set var="PLUGIN_VERSION">$(PLUGVERDELIM)$(PLUGIN_VERSION0)</set>
647
648     <set var="PLUGINSUFFIX">
649         <if cond="UNICODE=='0' and BUILD=='release'"></if>
650         <if cond="UNICODE=='0' and BUILD=='debug'">d</if>
651         <if cond="UNICODE=='1' and BUILD=='release'">u</if>
652         <if cond="UNICODE=='1' and BUILD=='debug'">ud</if>
653     </set>
654
655     <set var="PLUGINS_INST_DIR" make_var="1">
656         $(LIBDIR)/wx/$(PLUGIN_VERSION0)
657     </set>
658
659     <define-rule name="wx-base-plugin" extends="module">
660         <template>
661             <dllname>
662                 $(id)$(PLUGINSUFFIX)$(PLUGIN_VERSION)$(WXCOMPILER)
663             </dllname>
664             <define>WXUSINGDLL</define>
665             <define>wxUSE_GUI=0</define>
666             <install-to>$(PLUGINS_INST_DIR)</install-to>
667         </template>
668     </define-rule>
669
670     <define-rule name="wx-gui-plugin" extends="module">
671         <template template="wx">
672             <dllname>
673                 $(id)_$(PORTNAME)$(WXUNIVNAME)$(PLUGINSUFFIX)$(PLUGIN_VERSION)$(WXCOMPILER)
674             </dllname>
675             <define>WXUSINGDLL</define>
676             <install-to>$(PLUGINS_INST_DIR)</install-to>
677         </template>
678     </define-rule>
679
680     <!-- =============================================================== -->
681     <!--               Support for wxWidgets samples and contrib:        -->
682     <!-- =============================================================== -->
683
684     <!-- Link against one wxWin library. Value must be literal! -->
685     <define-tag name="wx-lib" rules="exe,dll,module">
686         <sys-lib>$(wxwin.libToLink(value))</sys-lib>
687         <ldlibs>$(wxwin.extraLdflags(value))</ldlibs>
688         <if cond="IS_MSVC_PRJ=='1' and MONOLITHIC=='0'">
689             <depends-on-dsp>$(wxwin.makeDspDependency(value))</depends-on-dsp>
690         </if>
691     </define-tag>
692
693
694     <!-- A hack to keep autoconf happy (we pass CPPFLAGS that contain
695          {top_srcdir} from configure, poor bakefile can't know that
696          and won't output top_srcdir = @top_srcdir@ line): -->
697     <set var="VARS_DONT_ELIMINATE" append="1">top_srcdir</set>
698
699
700 </makefile>