1 <project name="Inkscape" default="dist" basedir=".">
2 <description>
3 Build file for the Inkscape SVG editor. This file
4 was written for GTK-2.10 on Win32, but it should work
5 well for other types of builds with only minor adjustments.
6 </description>
8 <!-- set global properties for this build -->
9 <property name="version" value="0.45"/>
10 <property name="arch" value="i686-pc-mingw32-"/>
11 <!--<property name="archutil" value="${arch}"/>-->
12 <property name="archutil" value=""/>
13 <property name="src" location="src"/>
14 <property name="gtk" location="c:/gtk210"/>
15 <property name="lib" location="lib"/>
16 <property name="build" location="build"/>
17 <property name="dist" location="inkscape"/>
19 <target name="init">
20 <!-- Create the build directory structure used by compile -->
21 <mkdir dir="${build}"/>
22 <mkdir dir="${dist}"/>
23 <copy file="${src}/helper/sp-marshal.h.mingw"
24 tofile="${src}/helper/sp-marshal.h"/>
25 <copy file="${src}/helper/sp-marshal.cpp.mingw"
26 tofile="${src}/helper/sp-marshal.cpp"/>
27 <makefile file="inkscape_version.h">
28 #define INKSCAPE_VERSION "${version}+devel"
29 </makefile>
30 <makefile file="config.h">
31 #ifndef _CONFIG_H_
32 #define _CONFIG_H_
34 #ifndef WIN32
35 #define WIN32
36 #endif
38 /*######################################
39 ## This is for require-config.h, whose
40 ## purpose I cannot fathom.
41 ######################################*/
43 #define PACKAGE_TARNAME
45 /*######################################
46 #### RESOURCE DIRECTORIES
47 ######################################*/
49 #define INKSCAPE_DATADIR "."
50 #define PACKAGE_LOCALE_DIR "locale"
53 /*######################################
54 #### OTHER DEFINITIONS
55 ######################################*/
57 #define GETTEXT_PACKAGE "inkscape"
59 #define PACKAGE_STRING VERSION
61 #define HAVE_GETOPT_H 1
62 #define HAVE_STRING_H 1
63 #define HAVE_LIBINTL_H 1
64 #define HAVE_MALLOC_H 1
65 #define HAVE_STDLIB_H 1
66 #define HAVE_SYS_STAT_H 1
68 #define ENABLE_LCMS 1
70 #define ENABLE_NLS 1
71 #define HAVE_BIND_TEXTDOMAIN_CODESET 1
73 /* keep binreloc off */
74 #define BR_PTHREADS 0
75 #undef ENABLE_BINRELOC
77 /* CairoPDF options */
78 #define HAVE_CAIRO_PDF 1
79 #define PANGO_ENABLE_ENGINE 1
80 #define RENDER_WITH_PANGO_CAIRO 1
82 #define HAVE_GTK_WINDOW_FULLSCREEN 1
84 #define g_ascii_strtod fixed_g_ascii_strtod
86 #endif /* _CONFIG_H_ */
87 </makefile>
88 </target>
90 <target name="compile" depends="init"
91 description="compile the source " >
92 <!-- Compile from source to build -->
93 <cc cc="${arch}gcc" cxx="${arch}g++"
94 destdir="${build}/obj">
95 <fileset dir="${src}">
96 <!-- THINGS TO EXCLUDE -->
97 <exclude name="ast/.*"/>
98 <exclude name="bonobo/.*"/>
99 <exclude name="deptool.cpp"/>
100 <exclude name="dialogs/filedialog-win32.cpp"/>
101 <exclude name="display/testnr.cpp"/>
102 <exclude name="display/bezier-utils-test.cpp"/>
103 <exclude name="dom/jsdombind.cpp"/>
104 <exclude name="dom/work/.*"/>
105 <exclude name="dom/odf/SvgOdg.cpp"/>
106 <exclude name="extension/api.cpp"/>
107 <exclude name="extension/dxf2svg/.*"/>
108 <exclude name="extension/internal/gnome.cpp"/>
109 <exclude name="extension/script/bindtest.cpp"/>
110 <exclude name="extension/script/cpptest.cpp"/>
111 <exclude name="extension/plugin/.*"/>
112 <exclude name="extract-uri-test.cpp"/>
113 <exclude name="helper/units-test.cpp"/>
114 <!-- exclude name="inkview.cpp"/-->
115 <exclude name="libnr/in-svg-plane-test.cpp"/>
116 <exclude name="libnr/nr-compose-reference.cpp"/>
117 <exclude name="libnr/nr-compose-test.cpp"/>
118 <exclude name="libnr/nr-matrix-test.cpp"/>
119 <exclude name="libnr/nr-point-fns-test.cpp"/>
120 <exclude name="libnr/nr-rotate-fns-test.cpp"/>
121 <exclude name="libnr/nr-rotate-test.cpp"/>
122 <exclude name="libnr/nr-scale-test.cpp"/>
123 <exclude name="libnr/nr-translate-test.cpp"/>
124 <exclude name="libnr/nr-types-test.cpp"/>
125 <exclude name="livarot/Path-test.cpp"/>
126 <exclude name="mod360-test.cpp"/>
127 <exclude name="trace/potrace/potest.cpp"/>
128 <exclude name="round-test.cpp"/>
129 <exclude name="sp-gradient-test.cpp"/>
130 <exclude name="svg/ftos.cpp"/>
131 <exclude name="utest/.*"/>
132 <exclude name="widgets/test-widgets.cpp"/>
133 <exclude name="xml/quote-test.cpp"/>
134 <exclude name="xml/repr-action-test.cpp"/>
135 <exclude name="io/streamtest.cpp"/>
136 <!--JABBER-->
137 <exclude name="pedro/pedrogui.cpp"/>
138 <exclude name="pedro/pedrogui.h"/>
139 <exclude name="pedro/work/.*"/>
140 <!--WHITEBOARD-->
141 <exclude name="ui/dialog/session-player.cpp"/>
142 <exclude name="ui/dialog/whiteboard-connect.cpp"/>
143 <exclude name="ui/dialog/whiteboard-sharewithchat.cpp"/>
144 <exclude name="ui/dialog/whiteboard-sharewithuser.cpp"/>
145 <exclude name="dialogs/whiteboard-connect-dialog.cpp"/>
146 <exclude name="dialogs/whiteboard-common-dialog.cpp"/>
147 <exclude name="dialogs/whiteboard-sharewithchat-dialog.cpp"/>
148 <exclude name="dialogs/whiteboard-sharewithuser-dialog.cpp"/>
149 <exclude name="jabber_whiteboard/node-tracker.cpp"/>
150 <exclude name="jabber_whiteboard/node-utilities.cpp"/>
151 <!--WHITEBOARD-->
152 <exclude name="removeoverlap/placement_SolveVPSC.cpp"/>
153 <exclude name="removeoverlap/placement_SolveVPSC.h"/>
154 <exclude name="removeoverlap/test.cpp"/>
155 <exclude name="removeoverlap/remove_rectangle_overlap-test.cpp"/>
156 <exclude name="removeoverlap/remove_rectangle_overlap-test.h"/>
157 </fileset>
158 <flags>
159 -Wall -O3
160 -mms-bitfields
161 </flags>
162 <defines>
163 -DVERSION=\"${version}\"
164 -DHAVE_CONFIG_H
165 -DXP_WIN <!-- for JS -->
166 -D_INTL_REDIRECT_INLINE
167 -DWITH_INKBOARD -DHAVE_SSL <!-- inkboard -->
168 </defines>
169 <includes>
170 -I${gtk}/include
171 <!-- GTK / GTKMM -->
172 -I${gtk}/include/glibmm-2.4
173 -I${gtk}/lib/glibmm-2.4/include
174 -I${gtk}/include/gtkmm-2.4
175 -I${gtk}/lib/gtkmm-2.4/include
176 -I${gtk}/include/gdkmm-2.4
177 -I${gtk}/lib/gdkmm-2.4/include
178 -I${gtk}/include/pangomm-1.4
179 -I${gtk}/include/atkmm-1.6
180 -I${gtk}/include/cairomm-1.0
181 -I${gtk}/include/sigc++-2.0
182 -I${gtk}/lib/sigc++-2.0/include
183 -I${gtk}/include/gtk-2.0
184 -I${gtk}/lib/gtk-2.0/include
185 -I${gtk}/include/atk-1.0
186 -I${gtk}/include/pango-1.0
187 -I${gtk}/include/glib-2.0
188 -I${gtk}/lib/glib-2.0/include
189 <!-- OTHER -->
190 -I${gtk}/include/libxml2
191 -I${gtk}/include/freetype2
192 -I${gtk}/include/cairo
193 <!-- PERL -->
194 -Wno-comment -I${gtk}/perl/lib/CORE
195 <!-- PYTHON -->
196 -I${gtk}/python/include
197 </includes>
198 </cc>
199 </target>
201 <target name="lib" depends="compile">
202 <staticlib command="${archutil}ar crsv"
203 file="${build}/libinkscape.a">
204 <fileset dir="${build}/obj">
205 <exclude name="main,o"/>
206 <exclude name="winmain,o"/>
207 <exclude name="inkview,o"/>
208 </fileset>
209 </staticlib>
210 </target>
212 <target name="i18n" depends="compile">
213 <msgfmt todir="${build}/locale" owndir="true">
214 <fileset dir="po">
215 </fileset>
216 </msgfmt>
217 </target>
219 <target name="link" depends="lib">
220 <rc command="${archutil}windres"
221 file="${src}/inkscape.rc"
222 out="${build}/inkres.o">
223 <flags>
224 --include-dir=${src}
225 </flags>
226 </rc>
227 <link command="${arch}g++" out="${build}/inkscape.exe"
228 strip="true" symfile="${build}/inkscape.dbg"
229 stripcommand="${archutil}strip"
230 objcopycommand="${archutil}objcopy"
231 >
232 <flags>
233 </flags>
234 <fileset dir="${build}">
235 <include name="inkres.o"/>
236 <include name="obj/main.o"/>
237 <include name="obj/winmain.o"/>
238 <include name="libinkscape.a"/>
239 </fileset>
240 <libs>
241 -L${gtk}/lib
242 -lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4
243 -latkmm-1.6 -lpangomm-1.4 -lsigc-2.0
244 -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0
245 -lgdk_pixbuf-2.0
246 -lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0
247 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lcairo
248 <!-- PERL -->
249 -L${gtk}/perl/lib/CORE -lperl58
250 <!-- PYTHON -->
251 -L${gtk}/python/libs -lpython24
252 ${gtk}/bin/libxml2.dll
253 ${gtk}/lib/iconv.lib
254 -lfreetype.dll -lfontconfig.dll
255 -llcms.dll
256 -lssl -lcrypto
257 -lpng -lpopt ${gtk}/lib/zdll.lib
258 -lgc -mwindows -lws2_32 -lintl -lm
259 </libs>
260 </link>
261 </target>
263 <target name="linkinkview" depends="lib">
264 <rc command="${archutil}windres"
265 file="${src}/inkview.rc"
266 out="${build}/inkviewres.o">
267 <flags>
268 --include-dir=${src}
269 </flags>
270 </rc>
271 <link command="${arch}g++" out="${build}/inkview.exe"
272 strip="true" symfile="${build}/inkview.dbg"
273 stripcommand="${archutil}strip"
274 objcopycommand="${archutil}objcopy"
275 >
276 <flags>
277 </flags>
278 <fileset dir="${build}">
279 < include name="inkviewres.o"/ >
280 <include name="obj/inkview.o"/>
281 <include name="libinkscape.a"/>
282 </fileset>
283 <libs>
284 -L${gtk}/lib
285 -lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4
286 -latkmm-1.6 -lpangomm-1.4 -lsigc-2.0
287 -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0
288 -lgdk_pixbuf-2.0
289 -lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0
290 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lcairo
291 <!-- PERL -->
292 -L${gtk}/perl/lib/CORE -lperl58
293 <!-- PYTHON -->
294 -L${gtk}/python/libs -lpython24
295 ${gtk}/bin/libxml2.dll
296 ${gtk}/lib/iconv.lib
297 -lfreetype.dll -lfontconfig.dll
298 -llcms.dll
299 -lssl -lcrypto
300 -lpng -lpopt ${gtk}/lib/zdll.lib
301 -lgc -mwindows -lws2_32 -lintl -lm
302 </libs>
303 </link>
304 </target>
306 <target name="dist" depends="link,i18n,linkinkview"
307 description="generate the distribution" >
308 <!-- Create the distribution directory -->
309 <copy file="${build}/inkscape.exe" todir="${dist}"/>
310 <copy file="${build}/inkscape.dbg" todir="${dist}"/>
311 <copy file="${build}/inkview.exe" todir="${dist}"/>
312 <copy file="${build}/inkview.dbg" todir="${dist}"/>
313 <copy file="AUTHORS" todir="${dist}"/>
314 <copy file="COPYING" todir="${dist}"/>
315 <copy file="COPYING.LIB" todir="${dist}"/>
316 <copy file="NEWS" todir="${dist}"/>
317 <copy file="README" todir="${dist}"/>
318 <copy file="TRANSLATORS" todir="${dist}"/>
319 <copy file="${gtk}/bin/libatkmm-1.6-1.dll" todir="${dist}"/>
320 <copy file="${gtk}/bin/libglibmm-2.4-1.dll" todir="${dist}"/>
321 <copy file="${gtk}/bin/libgtkmm-2.4-1.dll" todir="${dist}"/>
322 <copy file="${gtk}/bin/libgdkmm-2.4-1.dll" todir="${dist}"/>
323 <copy file="${gtk}/bin/libpangomm-1.4-1.dll" todir="${dist}"/>
324 <copy file="${gtk}/bin/libcairomm-1.0-1.dll" todir="${dist}"/>
325 <copy file="${gtk}/bin/libsigc-2.0-0.dll" todir="${dist}"/>
326 <copy file="${gtk}/bin/freetype6.dll" todir="${dist}"/>
327 <copy file="${gtk}/bin/libatk-1.0-0.dll" todir="${dist}"/>
328 <copy file="${gtk}/bin/libgdk-win32-2.0-0.dll" todir="${dist}"/>
329 <copy file="${gtk}/bin/libgdk_pixbuf-2.0-0.dll" todir="${dist}"/>
330 <copy file="${gtk}/bin/libglib-2.0-0.dll" todir="${dist}"/>
331 <copy file="${gtk}/bin/libgmodule-2.0-0.dll" todir="${dist}"/>
332 <copy file="${gtk}/bin/libgobject-2.0-0.dll" todir="${dist}"/>
333 <copy file="${gtk}/bin/libgtk-win32-2.0-0.dll" todir="${dist}"/>
334 <copy file="${gtk}/bin/libgthread-2.0-0.dll" todir="${dist}"/>
335 <copy file="${gtk}/bin/libcairo-2.dll" todir="${dist}"/>
336 <copy file="${gtk}/bin/libpangocairo-1.0-0.dll" todir="${dist}"/>
337 <copy file="${gtk}/bin/libpango-1.0-0.dll" todir="${dist}"/>
338 <copy file="${gtk}/bin/libpangoft2-1.0-0.dll" todir="${dist}"/>
339 <copy file="${gtk}/bin/libpangowin32-1.0-0.dll" todir="${dist}"/>
340 <copy file="${gtk}/bin/freetype6.dll" todir="${dist}"/>
341 <copy file="${gtk}/bin/libfontconfig-1.dll" todir="${dist}"/>
342 <copy file="${gtk}/bin/libxml2.dll" todir="${dist}"/>
343 <copy file="${gtk}/bin/xmlparse.dll" todir="${dist}"/>
344 <copy file="${gtk}/bin/jpeg62.dll" todir="${dist}"/>
345 <copy file="${gtk}/bin/libpng13.dll" todir="${dist}"/>
346 <copy file="${gtk}/bin/msvcr70.dll" todir="${dist}"/>
347 <copy file="${gtk}/bin/msvcr71.dll" todir="${dist}"/>
348 <copy file="${gtk}/bin/zlib1.dll" todir="${dist}"/>
349 <copy file="${gtk}/bin/iconv.dll" todir="${dist}"/>
350 <copy file="${gtk}/bin/popt1.dll" todir="${dist}"/>
351 <copy file="${gtk}/bin/liblcms-1.dll" todir="${dist}"/>
352 <copy file="${gtk}/bin/intl.dll" todir="${dist}"/>
353 <copy file="${gtk}/bin/intl.dll" tofile="${dist}/libintl-2.dll"/>
355 <!-- MSGFMT files -->
356 <copy todir="${dist}">
357 <fileset dir="${build}/locale">
358 <exclude name=".*\.am"/>
359 </fileset>
360 </copy>
362 <!-- GTK -->
363 <copy todir="${dist}"> <fileset dir="${gtk}/etc"/> </copy>
364 <copy file="${gtk}/share/themes/MS-Windows/gtk-2.0/gtkrc" todir="${dist}/etc/gtk-2.0"/>
365 <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/gtk-2.0"/> </copy>
366 <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/glib-2.0"/> </copy>
367 <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/locale"/> </copy>
368 <copy todir="${dist}">
369 <fileset dir="share">
370 <exclude name=".*\.am"/>
371 </fileset>
372 </copy>
373 <copy todir="${dist}/share"> <fileset dir="${gtk}/share/themes"/> </copy>
374 <mkdir dir="${dist}/data"/>
375 <mkdir dir="${dist}/locale"/>
376 <mkdir dir="${dist}/modules"/>
377 <mkdir dir="${dist}/plugins"/>
378 <copy file="${gtk}/bin/gdb.exe" todir="${dist}"/>
380 <!-- PERL -->
381 <copy file="${gtk}/perl/bin/perl58.dll" todir="${dist}"/>
383 <!-- PYTHON -->
384 <copy file="${gtk}/python/python24.dll" todir="${dist}"/>
385 <copy file="${gtk}/python/python.exe" todir="${dist}/python"/>
386 <copy todir="${dist}/python"> <fileset dir="${gtk}/python/Lib"/> </copy>
387 <copy todir="${dist}/python"> <fileset dir="${gtk}/python/DLLs"/> </copy>
388 <copy todir="${dist}/python"> <fileset dir="${gtk}/python/Scripts"/> </copy>
391 </target>
393 <target name="clean"
394 description="clean up" >
395 <!-- Delete the ${build} and ${dist} directory trees -->
396 <delete dir="${build}"/>
397 <delete dir="${dist}"/>
398 </target>
399 </project>