]> git.saurik.com Git - wxWidgets.git/blob - build/bakefiles/common.bkl
Don't use wx[H|V]SCROLL styles
[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">
161 <if cond="FORMAT!='cbuilderx'">$(COMPILER)_$(CFG_NAME_PART)</if>
162 <!-- FIXME: waiting for removal after CBX has better ../ dirs
163 support -->
164 <if cond="FORMAT=='cbuilderx'">build_cbx_$(CFG_NAME_PART)</if>
165 </set>
166
167 <set var="BUILDDIR">$(OBJS)</set>
168 </if>
169
170 <set var="LIBDIRNAME" make_var="1">
171 <if cond="FORMAT=='autoconf'">$(top_builddir)lib</if>
172 <if cond="FORMAT!='autoconf' and SHARED=='0'">
173 $(nativePaths(TOP_SRCDIR))lib$(DIRSEP)$(COMPILER)_lib$(CFG)
174 </if>
175 <if cond="FORMAT!='autoconf' and SHARED=='1'">
176 $(nativePaths(TOP_SRCDIR))lib$(DIRSEP)$(COMPILER)_dll$(CFG)
177 </if>
178 </set>
179
180 <if cond="FORMAT!='autoconf'">
181 <set var="SETUPHDIR" make_var="1">
182 $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)
183 </set>
184 </if>
185
186
187
188 <!-- =============================================================== -->
189 <!-- Templates for libs: -->
190 <!-- =============================================================== -->
191
192 <set var="DEBUGINFO">
193 <if cond="BUILD=='debug' and DEBUG_INFO=='default'">on</if>
194 <if cond="DEBUG_INFO=='1'">on</if>
195 <if cond="BUILD=='release' and DEBUG_INFO=='default'">off</if>
196 <if cond="DEBUG_INFO=='0'">off</if>
197 </set>
198 <set var="DEBUGRUNTIME">
199 <if cond="DEBUG_RUNTIME_LIBS=='default'">$(DEBUGINFO)</if>
200 <if cond="DEBUG_RUNTIME_LIBS=='0'">off</if>
201 <if cond="DEBUG_RUNTIME_LIBS=='1'">on</if>
202 </set>
203 <set var="OPTIMIZEFLAG">
204 <if cond="BUILD=='debug'">off</if>
205 <if cond="BUILD=='release'">speed</if>
206 </set>
207 <set var="EXCEPTIONSFLAG">
208 <if cond="USE_EXCEPTIONS=='1'">on</if>
209 <if cond="USE_EXCEPTIONS=='0'">off</if>
210 </set>
211
212 <set var="DEBUG_DEFINE">
213 <if cond="FORMAT!='autoconf' and BUILD=='debug' and DEBUG_FLAG=='default'">__WXDEBUG__</if>
214 <if cond="FORMAT!='autoconf' and DEBUG_FLAG=='1'">__WXDEBUG__</if>
215 </set>
216 <!-- does not cover all cases, but better than nothing -->
217 <set var="NO_VC_CRTDBG">
218 <if cond="FORMAT=='msvc' and BUILD=='debug' and DEBUG_RUNTIME_LIBS=='0'">__NO_VC_CRTDBG__</if>
219 <if cond="FORMAT=='msvc' and BUILD=='release' and DEBUG_FLAG=='1'">__NO_VC_CRTDBG__</if>
220 </set>
221 <set var="UNICODE_DEFINE">
222 <if cond="FORMAT!='autoconf' and UNICODE=='1'">_UNICODE</if>
223 </set>
224
225 <set var="UNICOWS_LIB">
226 <if cond="MSLU=='1'">unicows</if>
227 </set>
228
229 <template id="common_settings">
230 <debug-info>$(DEBUGINFO)</debug-info>
231 <debug-runtime-libs>$(DEBUGRUNTIME)</debug-runtime-libs>
232 <optimize>$(OPTIMIZEFLAG)</optimize>
233 <threading>multi</threading>
234 <runtime-libs>$(RUNTIME_LIBS)</runtime-libs>
235 <cxx-rtti>$(EXCEPTIONSFLAG)</cxx-rtti>
236 <cxx-exceptions>$(EXCEPTIONSFLAG)</cxx-exceptions>
237 <if cond="FORMAT!='autoconf'">
238 <cppflags>$(EXTRACFLAGS)</cppflags>
239 </if>
240 <define>$(NO_VC_CRTDBG)</define>
241 </template>
242
243 <template id="anylib">
244 <dirname>$(LIBDIRNAME)</dirname>
245 <install-to>$(LIBDIR)</install-to>
246 </template>
247
248 <template id="3rdparty_lib" template="common_settings,anylib">
249 <libname>$(id)$(WXDEBUGFLAG)$(HOST_SUFFIX)</libname>
250 <!--
251 we want to install 3rd party libs system-wide only with static
252 version of wxWindows; otherwise they are embedded in shared libs:
253 -->
254 <install-if>SHARED=='0'</install-if>
255 </template>
256
257
258 <!-- =============================================================== -->
259 <!-- 3rd party libs: -->
260 <!-- =============================================================== -->
261
262 <!-- 3rd party libraries: -->
263 <include file="regex.bkl"/>
264 <include file="zlib.bkl"/>
265 <include file="png.bkl"/>
266 <include file="jpeg.bkl"/>
267 <include file="tiff.bkl"/>
268 <include file="odbc.bkl"/>
269 <include file="expat.bkl"/>
270
271
272 <!-- =============================================================== -->
273 <!-- Templates for wxWindows libs: -->
274 <!-- =============================================================== -->
275
276 <template id="wx" template="common_settings">
277 <set var="wxid">$(wxwin.mk_wxid(id))</set>
278 <define>__WX$(TOOLKIT)__</define>
279 <define>$(WXUNIV_DEFINE)</define>
280 <define>$(DEBUG_DEFINE)</define>
281 <define>$(UNICODE_DEFINE)</define>
282 <!-- this include is added by configure, we need to put other
283 includes before it: -->
284 <include cond="FORMAT!='autoconf'">$(TOP_SRCDIR)include</include>
285 <lib-path>$(LIBDIRNAME)</lib-path>
286 <include cond="FORMAT!='autoconf'">$(SETUPHDIR)</include>
287 <warnings>max</warnings>
288 </template>
289
290 <!-- for both GUI and wxBase libs/samples: -->
291 <template id="wx_append_base_nomono">
292 <!-- link against builtin 3rd party libs, if needed: -->
293 <sys-lib>$(LIB_TIFF)</sys-lib>
294 <sys-lib>$(LIB_JPEG)</sys-lib>
295 <sys-lib>$(LIB_PNG)</sys-lib>
296 <sys-lib>$(LIB_ZLIB)</sys-lib>
297 <sys-lib>$(LIB_ODBC)</sys-lib>
298 <sys-lib>$(LIB_REGEX)</sys-lib>
299 <sys-lib>$(LIB_EXPAT)</sys-lib>
300
301 <ldlibs>$(EXTRALIBS)</ldlibs>
302
303 <!-- system libraries on windows: -->
304 <if cond="FORMAT!='autoconf'">
305 <sys-lib>$(UNICOWS_LIB)</sys-lib>
306 <if cond="FORMAT=='borland'">
307 <sys-lib>ole2w32</sys-lib>
308 </if>
309 <if cond="FORMAT!='borland'">
310 <sys-lib>kernel32</sys-lib>
311 <sys-lib>user32</sys-lib>
312 <sys-lib>gdi32</sys-lib>
313 <sys-lib>comdlg32</sys-lib>
314 <sys-lib>winspool</sys-lib>
315 <sys-lib>winmm</sys-lib>
316 <sys-lib>shell32</sys-lib>
317 <sys-lib>comctl32</sys-lib>
318 <sys-lib>odbc32</sys-lib>
319 <sys-lib>ole32</sys-lib>
320 <sys-lib>oleaut32</sys-lib>
321 <sys-lib>uuid</sys-lib>
322 <sys-lib>rpcrt4</sys-lib>
323 <sys-lib>advapi32</sys-lib>
324 <sys-lib>wsock32</sys-lib>
325 </if>
326 <if cond="FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'">
327 <sys-lib>oleacc</sys-lib>
328 </if>
329 </if>
330 </template>
331
332 <define-tag name="msvc-headers" rules="dll,lib">
333 <if cond="FORMAT=='msvc6prj'">
334 <msvc-project-files>
335 $(addPrefixToList('include\', wxwin.headersOnly(value)))
336 </msvc-project-files>
337 </if>
338 </define-tag>
339
340 <define-tag name="msvc-copy-setup-h" rules="dll,lib">
341 <if cond="FORMAT=='msvc6prj'">
342 <msvc-headers>wx/msw/setup.h</msvc-headers>
343 <set var="__custom_build_files" append="1">
344 include\wx\msw\setup.h
345 </set>
346 <set var="__custom_build_include_wx_msw_setup_h">
347 Creating $(SETUPHDIR)\wx\setup.h
348 InputPath=..\include\wx\msw\setup.h
349
350 "$(SETUPHDIR)\wx\setup.h" : $(DOLLAR)(SOURCE) "$(DOLLAR)(INTDIR)" "$(DOLLAR)(OUTDIR)"
351 $(TAB)copy "$(DOLLAR)(InputPath)" $(SETUPHDIR)\wx\setup.h
352 </set>
353 </if>
354 </define-tag>
355
356
357 <!-- for GUI libs/samples: -->
358 <template id="wx_append_nomono" template="wx_append_base_nomono">
359 <ldlibs>$(EXTRALIBS_GUI)</ldlibs>
360 </template>
361
362
363 <template id="wx_append_base" template_append="wx_append_base_nomono">
364 <!-- Always link against the wxWin library in monolithic build: -->
365 <sys-lib>$(WXLIB_MONO)</sys-lib>
366 </template>
367 <template id="wx_append" template_append="wx_append_nomono">
368 <!-- Always link against the wxWin library in monolithic build: -->
369 <sys-lib>$(WXLIB_MONO)</sys-lib>
370 </template>
371
372
373 <set var="WX_DISABLE_PRECOMP_HEADERS" overwrite="0">0</set>
374
375 <template id="wx_lib_b" template="wx,anylib">
376 <set var="WXLIBNAME">$(wxwin.mkLibName(wxid))</set>
377 <libname>$(WXLIBNAME)</libname>
378
379 <if cond="WX_DISABLE_PRECOMP_HEADERS=='0'">
380 <if cond="FORMAT!='autoconf'">
381 <sources>$(WXTOPDIR)src/msw/dummy.cpp</sources>
382 <precomp-headers-gen>
383 $(WXTOPDIR)src/msw/dummy.cpp
384 </precomp-headers-gen>
385 </if>
386 <precomp-headers-header>wx/wxprec.h</precomp-headers-header>
387 <precomp-headers>on</precomp-headers>
388 <precomp-headers-file>wxprec_$(id)</precomp-headers-file>
389 <precomp-headers-exclude>
390 src/common/unzip.c
391 src/common/extended.c
392 src/msw/gsocket.c
393 src/msw/gsockmsw.c
394 </precomp-headers-exclude>
395 </if>
396
397 <if cond="FORMAT=='msvc6prj' and BUILDING_LIB=='1'">
398 <msvc-file-group>Common Sources:src/common/*</msvc-file-group>
399 <msvc-file-group>MSW Sources:src/msw/*</msvc-file-group>
400 <msvc-file-group>Generic Sources:src/generic/*</msvc-file-group>
401 <msvc-file-group>wxUniv Sources:src/univ/*</msvc-file-group>
402 <msvc-file-group>wxHTML Sources:src/html/*</msvc-file-group>
403 <msvc-file-group>Setup Headers:*/setup.h</msvc-file-group>
404 <msvc-file-group>MSW Headers:*wx/msw/*.h</msvc-file-group>
405 <msvc-file-group>Generic Headers:*wx/generic/*.h</msvc-file-group>
406 <msvc-file-group>wxUniv Headers:*wx/univ/*.h</msvc-file-group>
407 <msvc-file-group>wxHTML Headers:*wx/html/*.h</msvc-file-group>
408 <msvc-file-group>Common Headers:*wx/*.h</msvc-file-group>
409 </if>
410 </template>
411
412 <template id="wx_dll_b" template="wx_lib_b">
413 <set var="WXDLLNAME">$(wxwin.mkDllName(wxid))</set>
414 <dllname>$(WXDLLNAME)</dllname>
415 <version>$(WX_VERSION)</version>
416 <so_version>$(WXSOVERSION)</so_version>
417 <mac_version>$(WXMACVERSION)</mac_version>
418 </template>
419
420 <template id="wx_3rdparty_dependencies">
421 <depends>wxtiff</depends>
422 <depends>wxjpeg</depends>
423 <depends>wxpng</depends>
424 <depends>wxexpat</depends>
425 <depends>wxzlib</depends>
426 <depends cond="FORMAT=='autoconf'">wxodbc</depends>
427 <depends>wxregex</depends>
428 </template>
429
430 <template id="wx_3rdparty_includes">
431 <include>$(INC_TIFF)</include>
432 <include>$(INC_JPEG)</include>
433 <include>$(INC_PNG)</include>
434 <include>$(INC_ZLIB)</include>
435 <include>$(INC_ODBC)</include>
436 <include>$(INC_REGEX)</include>
437 <include>$(INC_EXPAT)</include>
438 </template>
439
440 <template id="msvc_setup_h">
441 <msvc-copy-setup-h/>
442 </template>
443
444 <template id="wx_lib"
445 template="wx_lib_b,wx_3rdparty_includes,msvc_setup_h"/>
446 <template id="wx_base_lib"
447 template="wx_lib_b,wx_3rdparty_includes,msvc_setup_h">
448 <define>wxUSE_GUI=0</define>
449 </template>
450
451 <template id="wx_dll"
452 template="wx_dll_b,wx_3rdparty_dependencies,wx_3rdparty_includes"
453 template_append="msvc_setup_h,wx_append_nomono"/>
454 <template id="wx_base_dll"
455 template="wx_dll_b,wx_3rdparty_dependencies,wx_3rdparty_includes"
456 template_append="msvc_setup_h,wx_append_base_nomono">
457 <define>wxUSE_GUI=0</define>
458 </template>
459
460 <!-- =============================================================== -->
461 <!-- Templates for building wxWindows plugins: -->
462 <!-- =============================================================== -->
463
464 <if cond="WX_STABLE_BRANCH=='1'">
465 <set var="PLUGIN_VERSION">
466 <if cond="PLATFORM_UNIX=='1'">
467 -$(WXVER_MAJOR).$(WXVER_MINOR)
468 </if>
469 <if cond="PLATFORM_UNIX=='0'">
470 $(WXVER_MAJOR)$(WXVER_MINOR)
471 </if>
472 </set>
473 </if>
474 <if cond="WX_STABLE_BRANCH=='0'">
475 <set var="PLUGIN_VERSION">
476 <if cond="PLATFORM_UNIX=='1'">
477 -$(WXVER_MAJOR).$(WXVER_MINOR).$(WXVER_RELEASE)
478 </if>
479 <if cond="PLATFORM_UNIX=='0'">
480 $(WXVER_MAJOR)$(WXVER_MINOR)$(WXVER_RELEASE)
481 </if>
482 </set>
483 </if>
484
485 <define-rule name="wx-base-plugin" extends="module">
486 <template>
487 <dllname>
488 $(id)$(addPrefixIfNotEmpty('_',WXNAMESUFFIX))$(PLUGIN_VERSION)$(WXCOMPILER)
489 </dllname>
490 <define>WXUSINGDLL</define>
491 <define>wxUSE_GUI=0</define>
492 </template>
493 </define-rule>
494
495 <define-rule name="wx-gui-plugin" extends="module">
496 <template template="wx">
497 <dllname>
498 $(id)_$(PORTNAME)$(WXUNIVNAME)$(WXNAMESUFFIX)$(PLUGIN_VERSION)$(WXCOMPILER)
499 </dllname>
500 <define>WXUSINGDLL</define>
501 </template>
502 </define-rule>
503
504 <!-- =============================================================== -->
505 <!-- Support for wxWindows samples and contrib: -->
506 <!-- =============================================================== -->
507
508 <!-- Link against one wxWin library. Value must be literal! -->
509 <define-tag name="wx-lib" rules="exe,dll,module">
510 <sys-lib>$(wxwin.libToLink(value))</sys-lib>
511 <ldlibs>$(wxwin.extraLdflags(value))</ldlibs>
512 <if cond="FORMAT=='msvc6prj' and MONOLITHIC=='0'">
513 <depends-on-dsp>$(wxwin.makeDspDependency(value))</depends-on-dsp>
514 </if>
515 </define-tag>
516
517
518 <!-- A hack to keep autoconf happy (we pass CPPFLAGS that contain
519 {top_srcdir} from configure, poor bakefile can't know that
520 and won't output top_srcdir = @top_srcdir@ line): -->
521 <set var="VARS_DONT_ELIMINATE" append="1">top_srcdir</set>
522
523
524 </makefile>