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 <!-- The directory where wxWidgets is installed: -->
46 <option name="WX_DIR" category="path">
47 <default-value>$(DOLLAR)(WXWIN)</default-value>
49 The directory where wxWidgets library is installed
53 <!-- This is a standard option that determines -->
54 <!-- whether the user wants to build this library as -->
55 <!-- a dll or as a static library. -->
56 <option name="WX_SHARED">
58 <values-description>,DLL</values-description>
59 <default-value>0</default-value>
61 Use DLL build of wx library to use?
65 <!-- Configuration for building the bakefile with -->
66 <!-- unicode strings or not (unicode or ansi). -->
67 <option name="WX_UNICODE">
69 <values-description>,Unicode</values-description>
70 <default-value>0</default-value>
72 Compile Unicode build of wxWidgets?
76 <option name="WX_DEBUG">
78 <values-description>,Debug</values-description>
79 <default-value>1</default-value>
81 Use debug build of wxWidgets (define __WXDEBUG__)?
85 <option name="WX_VERSION">
86 <default-value>25</default-value>
88 Version of the wx library to build against.
92 <!-- HELPER VARIABLES -->
96 <!-- The unicode define we want. By default bakefile -->
97 <!-- makes variables an empty string, so if unicode -->
98 <!-- is not defined $(UNICODE_DEFINE) would expand -->
99 <!-- to nothing (literally). -->
100 <set var="WXUNICODE_DEFINE">
101 <if cond="WX_UNICODE=='1'">_UNICODE</if>
104 <!-- The debug define we need with win32 compilers -->
105 <!-- (on Linux, the wx-config program is used). -->
106 <set var="WXDEBUG_DEFINE">
107 <if cond="WX_DEBUG=='1'">__WXDEBUG__</if>
110 <!-- These are handy ways of dealing with the -->
111 <!-- extensions in the library names of the -->
112 <!-- wxWindows library. -->
113 <set var="WXLIBPOSTFIX">
114 <if cond="WX_DEBUG=='1' and WX_UNICODE=='1'">ud</if>
115 <if cond="WX_DEBUG=='1' and WX_UNICODE=='0'">d</if>
116 <if cond="WX_DEBUG=='0' and WX_UNICODE=='1'">u</if>
118 <set var="WXSUBLIBPOSTFIX">
119 <if cond="WX_DEBUG=='1' and WX_UNICODE=='0'">d</if>
122 <set var="WXLIBPATH">
123 <if cond="WX_SHARED=='0'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)_lib</if>
124 <if cond="WX_SHARED=='1'">$(DIRSEP)lib$(DIRSEP)$(COMPILER)_dll</if>
127 <set var="WXLIBINCLUDE">$(WXLIBPATH)$(DIRSEP)msw$(WXLIBPOSTFIX)</set>
133 <!-- While not required, templates make your -->
134 <!-- bakefiles much more readable. Templates, in -->
135 <!-- essence, are abstract classes like c++. -->
137 <!-- Your build targets "inherit" the template, -->
138 <!-- along with the info associated with the template -->
141 <!-- wxWidgets LIBRARY/APP TEMPLATE -->
143 <!-- The "base class" of all our build targets -->
144 <!-- This links with the appropriate native -->
145 <!-- libraries required by the platform, the libaries -->
146 <!-- we want for our stuff, and the wxWindows libs. -->
150 <!-- this tag is used to include wx libraries: -->
151 <define-tag name="wx-lib" rules="exe,dll,module">
152 <if cond="value=='base'">
153 <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)</sys-lib>
155 <if cond="value in ['net','xml']">
156 <sys-lib>wxbase$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)</sys-lib>
158 <if cond="value not in ['base','net','xml']">
159 <sys-lib>wxmsw$(WX_VERSION)$(WXLIBPOSTFIX)_$(value)</sys-lib>
163 <!-- just a placeholder to mark the place where <wx-lib> will be placed,
164 thanks to the order precedence declaration below it: -->
165 <define-tag name="__wx-libs-point" rules="exe,dll,module"/>
166 <tag-info name="wx-lib"
167 position="before:__wx-libs-point"/>
171 <!-- MISCELLANEOUS -->
172 <if cond="FORMAT=='mingw'">
173 <define>HAVE_W32API_H</define>
174 <ldflags>-mthreads</ldflags>
177 <define>$(WXUNICODE_DEFINE)</define>
178 <define>$(WXDEBUG_DEFINE)</define>
179 <define>__WXMSW__</define>
181 <include>$(WX_DIR)$(WXLIBINCLUDE)</include>
182 <include>$(WX_DIR)/include</include>
184 <lib-path>$(WX_DIR)$(WXLIBPATH)</lib-path>
186 <!-- wx libs must come before 3rd party and sys libs, this is
187 the place where the hack explained above is carried on: -->
190 <!-- wx 3rd party libs, always use them: -->
191 <sys-lib>wxtiff$(WXSUBLIBPOSTFIX)</sys-lib>
192 <sys-lib>wxjpeg$(WXSUBLIBPOSTFIX)</sys-lib>
193 <sys-lib>wxpng$(WXSUBLIBPOSTFIX)</sys-lib>
194 <sys-lib>wxzlib$(WXSUBLIBPOSTFIX)</sys-lib>
195 <!-- For regex we won't use the WXSUBLIBPOSTIX postfix:
196 unliked tiff, jpeg, png, zlib, expat, when building
197 in Unicode mode, the "u" suffix is appended to regex -->
198 <sys-lib>wxregex$(WXLIBPOSTFIX)</sys-lib>
199 <sys-lib>wxexpat$(WXSUBLIBPOSTFIX)</sys-lib>
201 <!-- link-in system libs that wx depends on: -->
202 <!-- If on borland, we don't need to do much -->
203 <if cond="FORMAT=='borland'">
204 <sys-lib>ole2w32</sys-lib>
207 <!-- Non-borland, on the other hand... -->
208 <if cond="FORMAT!='borland'">
209 <sys-lib>kernel32</sys-lib>
210 <sys-lib>user32</sys-lib>
211 <sys-lib>gdi32</sys-lib>
212 <sys-lib>comdlg32</sys-lib>
213 <sys-lib>winspool</sys-lib>
214 <sys-lib>winmm</sys-lib>
215 <sys-lib>shell32</sys-lib>
216 <sys-lib>comctl32</sys-lib>
217 <sys-lib>ole32</sys-lib>
218 <sys-lib>oleaut32</sys-lib>
219 <sys-lib>uuid</sys-lib>
220 <sys-lib>rpcrt4</sys-lib>
221 <sys-lib>advapi32</sys-lib>
222 <sys-lib>wsock32</sys-lib>
223 <sys-lib>odbc32</sys-lib>
226 <!-- Libs common to both borland and MSVC -->
227 <if cond="FORMAT=='msvc' or FORMAT=='msvc6prj' or FORMAT=='borland'">
228 <sys-lib>oleacc</sys-lib>