4 <!-- Original source: http://wiki.wxwidgets.org/wiki.pl?Bakefile -->
5 <!-- Modified by: Francesco Montorsi <frm@users.sourceforge.net> -->
6 <!-- Vaclav Slavik <vslavik@fastmail.fm> to better fit
7 into Bakefile's presets -->
8 <!-- Creation date: 6/9/2004 -->
9 <!-- Last revision: 22/1/2005 off-CVS -->
15 FIXME: this template has (at least) the following bugs:
17 * it's MSW-only, the port is assumed to be wxMSW unconditionally
19 * multiple wx configurations (CFG variable set when building the
20 library) are not supported
24 <!-- makefile tag signifies the beginning of the bakefile -->
27 <requires version=
"0.1.5"/>
31 <!-- These are essentially the configurations you -->
32 <!-- want in bakefile. -->
34 <!-- In MSVC these are the different build -->
35 <!-- configurations you can have (in the build menu), -->
36 <!-- and in autoconf is enabled with enable-xxx=xx. -->
37 <!-- For other compilers a seperate configuration -->
38 <!-- file is created (such as config.gcc on gcc) -->
39 <!-- which has several options a user can modify. -->
41 <!-- Note that the above only happens if an option -->
42 <!-- is not constant, i.e. if it cannot be determined -->
43 <!-- by bakefile itself. -->
45 <!-- this is a temporary variable until there is non general -->
46 <!-- function in bakefiles for returning native markup for -->
47 <!-- reading envrionment variables -->
49 <if cond=
"FORMAT=='watcom'">%
</if>
50 <if cond=
"FORMAT!='watcom'"></if>
53 <!-- The directory where wxWidgets is installed: -->
54 <set var=
"WX_DIR_DEFAULT" overwrite=
"0">$(DOLLAR)($(ENV_VAR)WXWIN)
</set>
55 <option name=
"WX_DIR" category=
"path">
56 <default-value>$(WX_DIR_DEFAULT)
</default-value>
58 The directory where wxWidgets library is installed
62 <!-- This is a standard option that determines -->
63 <!-- whether the user wants to build this library as -->
64 <!-- a dll or as a static library. -->
65 <set var=
"WX_SHARED_DEFAULT" overwrite=
"0">0</set>
66 <option name=
"WX_SHARED">
68 <values-description>,DLL
</values-description>
69 <default-value>$(WX_SHARED_DEFAULT)
</default-value>
71 Use DLL build of wx library to use?
75 <!-- Configuration for building the bakefile with -->
76 <!-- unicode strings or not (unicode or ansi). -->
77 <set var=
"WX_UNICODE_DEFAULT" overwrite=
"0">0</set>
78 <option name=
"WX_UNICODE">
80 <values-description>,Unicode
</values-description>
81 <default-value>$(WX_UNICODE_DEFAULT)
</default-value>
83 Compile Unicode build of wxWidgets?
87 <set var=
"WX_DEBUG_DEFAULT" overwrite=
"0">1</set>
88 <option name=
"WX_DEBUG">
90 <values-description>,Debug
</values-description>
91 <default-value>$(WX_DEBUG_DEFAULT)
</default-value>
93 Use debug build of wxWidgets (define __WXDEBUG__)?
97 <set var=
"WX_VERSION_DEFAULT" overwrite=
"0">26</set>
98 <option name=
"WX_VERSION">
99 <default-value>$(WX_VERSION_DEFAULT)
</default-value>
101 Version of the wx library to build against.
105 <!-- HELPER VARIABLES -->
109 <!-- The unicode define we want. By default bakefile -->
110 <!-- makes variables an empty string, so if unicode -->
111 <!-- is not defined $(UNICODE_DEFINE) would expand -->
112 <!-- to nothing (literally). -->
113 <set var=
"WXUNICODE_DEFINE">
114 <if cond=
"WX_UNICODE=='1'">_UNICODE
</if>
117 <!-- The debug define we need with win32 compilers -->
118 <!-- (on Linux, the wx-config program is used). -->
119 <set var=
"WXDEBUG_DEFINE">
120 <if cond=
"WX_DEBUG=='1'">__WXDEBUG__
</if>
123 <!-- These are handy ways of dealing with the -->
124 <!-- extensions in the library names of the -->
125 <!-- wxWindows library. -->
126 <set var=
"WXLIBPOSTFIX">
127 <if cond=
"WX_DEBUG=='1' and WX_UNICODE=='1'">ud
</if>
128 <if cond=
"WX_DEBUG=='1' and WX_UNICODE=='0'">d
</if>
129 <if cond=
"WX_DEBUG=='0' and WX_UNICODE=='1'">u
</if>
131 <set var=
"WX3RDPARTLIBPOSTFIX">
132 <if cond=
"WX_DEBUG=='1'">d
</if>
135 <set var=
"WXLIBPATH">
136 <if cond=
"WX_SHARED=='0'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)_lib
</if>
137 <if cond=
"WX_SHARED=='1'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)_dll
</if>
140 <set var=
"WXLIBINCLUDE">$(WXLIBPATH)$(DIRSEP)msw$(WXLIBPOSTFIX)
</set>
146 <!-- While not required, templates make your -->
147 <!-- bakefiles much more readable. Templates, in -->
148 <!-- essence, are abstract classes like c++. -->
150 <!-- Your build targets "inherit" the template, -->
151 <!-- along with the info associated with the template -->
154 <!-- wxWidgets LIBRARY/APP TEMPLATE -->
156 <!-- The "base class" of all our build targets -->
157 <!-- This links with the appropriate native -->
158 <!-- libraries required by the platform, the libaries -->
159 <!-- we want for our stuff, and the wxWindows libs. -->
163 <!-- this tag is used to include wx libraries: -->
164 <define-tag name=
"wx-lib" rules=
"exe,dll,module">
165 <if cond=
"value=='base'">
166 <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)
</sys-lib>
168 <if cond=
"value in ['net','xml', 'odbc']">
169 <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)
</sys-lib>
171 <if cond=
"value not in ['base','net','xml']">
172 <sys-lib>wxmsw$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)
</sys-lib>
176 <!-- just a placeholder to mark the place where <wx-lib> will be placed,
177 thanks to the order precedence declaration below it: -->
178 <define-tag name=
"__wx-libs-point" rules=
"exe,dll,module"/>
179 <tag-info name=
"wx-lib"
180 position=
"before:__wx-libs-point"/>
181 <tag-info name=
"__wx-syslibs"
182 position=
"after:__wx-libs-point"/>
185 <!-- template for static wx libraries: -->
186 <template id=
"wx-lib">
187 <!-- MISCELLANEOUS -->
188 <if cond=
"FORMAT=='mingw'">
189 <define>HAVE_W32API_H
</define>
190 <ldflags>-mthreads
</ldflags>
193 <define>$(WXUNICODE_DEFINE)
</define>
194 <define>$(WXDEBUG_DEFINE)
</define>
195 <define>__WXMSW__
</define>
197 <include>$(WX_DIR)$(WXLIBINCLUDE)
</include>
198 <include>$(WX_DIR)/include
</include>
202 <!-- this ugly tag contains all sys-lib tags used by "wx" template,
203 in order to make sure they are not reorder when wx-lib is moved
204 after __wx-libs-point: -->
205 <define-tag name=
"__wx-syslibs" rules=
"exe,dll,module">
206 <!-- wx 3rd party libs, always use them: -->
207 <sys-lib>wxtiff$(WX3RDPARTLIBPOSTFIX)
</sys-lib>
208 <sys-lib>wxjpeg$(WX3RDPARTLIBPOSTFIX)
</sys-lib>
209 <sys-lib>wxpng$(WX3RDPARTLIBPOSTFIX)
</sys-lib>
210 <sys-lib>wxzlib$(WX3RDPARTLIBPOSTFIX)
</sys-lib>
211 <!-- For regex we won't use the WX3RDPARTLIBPOSTIX postfix:
212 unliked tiff, jpeg, png, zlib, expat, when building
213 in Unicode mode, the "u" suffix is appended to regex -->
214 <sys-lib>wxregex$(WXLIBPOSTFIX)
</sys-lib>
215 <sys-lib>wxexpat$(WX3RDPARTLIBPOSTFIX)
</sys-lib>
217 <!-- link-in system libs that wx depends on: -->
218 <!-- If on borland, we don't need to do much -->
219 <if cond=
"FORMAT=='borland'">
220 <sys-lib>ole2w32
</sys-lib>
223 <!-- Non-borland, on the other hand... -->
224 <if cond=
"FORMAT!='borland'">
225 <sys-lib>kernel32
</sys-lib>
226 <sys-lib>user32
</sys-lib>
227 <sys-lib>gdi32
</sys-lib>
228 <sys-lib>comdlg32
</sys-lib>
229 <sys-lib>winspool
</sys-lib>
230 <sys-lib>winmm
</sys-lib>
231 <sys-lib>shell32
</sys-lib>
232 <sys-lib>comctl32
</sys-lib>
233 <sys-lib>ole32
</sys-lib>
234 <sys-lib>oleaut32
</sys-lib>
235 <sys-lib>uuid
</sys-lib>
236 <sys-lib>rpcrt4
</sys-lib>
237 <sys-lib>advapi32
</sys-lib>
238 <sys-lib>wsock32
</sys-lib>
239 <sys-lib>odbc32
</sys-lib>
242 <!-- Libs common to both borland and MSVC -->
243 <if cond=
"FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'">
244 <sys-lib>oleacc
</sys-lib>
248 <!-- template for wx executables/dlls: -->
249 <template id=
"wx" template=
"wx-lib">
250 <lib-path>$(WX_DIR)$(WXLIBPATH)
</lib-path>
252 <!-- wx libs must come before 3rd party and sys libs, this is
253 the place where the hack explained above is carried on: -->