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"/>
23 <target name="init">
24 <!-- Create the build directory structure used by compile -->
25 <mkdir dir="${build}"/>
26 <mkdir dir="${dist}"/>
27 <copy file="${src}/helper/sp-marshal.h.mingw"
28 tofile="${src}/helper/sp-marshal.h"/>
29 <copy file="${src}/helper/sp-marshal.cpp.mingw"
30 tofile="${src}/helper/sp-marshal.cpp"/>
31 <makefile file="inkscape_version.h">
32 #define INKSCAPE_VERSION "${version}+devel"
33 </makefile>
34 <makefile file="config.h">
35 #ifndef _CONFIG_H_
36 #define _CONFIG_H_
38 #ifndef WIN32
39 #define WIN32
40 #endif
42 /*######################################
43 ## This is for require-config.h, whose
44 ## purpose I cannot fathom.
45 ######################################*/
47 #define PACKAGE_TARNAME
49 /*######################################
50 #### RESOURCE DIRECTORIES
51 ######################################*/
53 #define INKSCAPE_DATADIR "."
54 #define PACKAGE_LOCALE_DIR "locale"
57 /*######################################
58 #### OTHER DEFINITIONS
59 ######################################*/
61 #define GETTEXT_PACKAGE "inkscape"
63 #define PACKAGE_STRING VERSION
65 #define HAVE_GETOPT_H 1
66 #define HAVE_STRING_H 1
67 #define HAVE_LIBINTL_H 1
68 #define HAVE_MALLOC_H 1
69 #define HAVE_STDLIB_H 1
70 #define HAVE_SYS_STAT_H 1
72 #define ENABLE_LCMS 1
74 #define ENABLE_NLS 1
75 #define HAVE_BIND_TEXTDOMAIN_CODESET 1
77 /* keep binreloc off */
78 #define BR_PTHREADS 0
79 #undef ENABLE_BINRELOC
81 /* CairoPDF options */
82 #define HAVE_CAIRO_PDF 1
83 #define PANGO_ENABLE_ENGINE 1
84 #define RENDER_WITH_PANGO_CAIRO 1
86 #define HAVE_GTK_WINDOW_FULLSCREEN 1
88 #define g_ascii_strtod fixed_g_ascii_strtod
90 #endif /* _CONFIG_H_ */
91 </makefile>
92 </target>
98 <target name="compile" depends="init"
99 description="compile the source " >
100 <!-- Compile from source to build -->
101 <cc cc="${arch}gcc" cxx="${arch}g++"
102 destdir="${build}/obj">
103 <fileset dir="${src}">
104 <!-- THINGS TO EXCLUDE -->
105 <exclude name="ast/.*"/>
106 <exclude name="bonobo/.*"/>
107 <exclude name="deptool.cpp"/>
108 <exclude name="test-all.cpp"/>
109 <exclude name="dialogs/filedialog-win32.cpp"/>
110 <exclude name="display/testnr.cpp"/>
111 <exclude name="display/bezier-utils-test.cpp"/>
112 <exclude name="dom/jsdombind.cpp"/>
113 <exclude name="dom/work/.*"/>
114 <exclude name="dom/odf/SvgOdg.cpp"/>
115 <exclude name="extension/api.cpp"/>
116 <exclude name="extension/dxf2svg/.*"/>
117 <exclude name="extension/internal/gnome.cpp"/>
118 <exclude name="extension/script/bindtest.cpp"/>
119 <exclude name="extension/script/cpptest.cpp"/>
120 <exclude name="extension/plugin/.*"/>
121 <exclude name="extract-uri-test.cpp"/>
122 <exclude name="helper/units-test.cpp"/>
123 <!-- exclude name="inkview.cpp"/-->
124 <exclude name="libnr/test-nr.cpp"/>
125 <exclude name="libnr/test-nr-main.cpp"/>
126 <exclude name="libnr/testnr.cpp"/>
127 <exclude name="libnr/in-svg-plane-test.cpp"/>
128 <exclude name="libnr/nr-compose-reference.cpp"/>
129 <exclude name="libnr/nr-compose-test.cpp"/>
130 <exclude name="libnr/nr-matrix-test.cpp"/>
131 <exclude name="libnr/nr-point-fns-test.cpp"/>
132 <exclude name="libnr/nr-rotate-fns-test.cpp"/>
133 <exclude name="libnr/nr-rotate-test.cpp"/>
134 <exclude name="libnr/nr-scale-test.cpp"/>
135 <exclude name="libnr/nr-translate-test.cpp"/>
136 <exclude name="libnr/nr-types-test.cpp"/>
137 <exclude name="livarot/Path-test.cpp"/>
138 <exclude name="mod360-test.cpp"/>
139 <exclude name="trace/potrace/potest.cpp"/>
140 <exclude name="round-test.cpp"/>
141 <exclude name="sp-gradient-test.cpp"/>
142 <exclude name="svg/ftos.cpp"/>
143 <exclude name="svg/test-svg.cpp"/>
144 <exclude name="svg/test-svg-main.cpp"/>
145 <exclude name="utest/.*"/>
146 <exclude name="widgets/test-widgets.cpp"/>
147 <exclude name="xml/quote-test.cpp"/>
148 <exclude name="xml/repr-action-test.cpp"/>
149 <exclude name="xml/test-xml.cpp"/>
150 <exclude name="xml/test-xml-main.cpp"/>
151 <exclude name="io/streamtest.cpp"/>
152 <!--JABBER-->
153 <exclude name="pedro/pedrogui.cpp"/>
154 <exclude name="pedro/pedrogui.h"/>
155 <exclude name="pedro/work/.*"/>
156 <!--WHITEBOARD-->
157 <exclude name="ui/dialog/session-player.cpp"/>
158 <exclude name="ui/dialog/whiteboard-connect.cpp"/>
159 <exclude name="ui/dialog/whiteboard-sharewithchat.cpp"/>
160 <exclude name="ui/dialog/whiteboard-sharewithuser.cpp"/>
161 <exclude name="dialogs/whiteboard-connect-dialog.cpp"/>
162 <exclude name="dialogs/whiteboard-common-dialog.cpp"/>
163 <exclude name="dialogs/whiteboard-sharewithchat-dialog.cpp"/>
164 <exclude name="dialogs/whiteboard-sharewithuser-dialog.cpp"/>
165 <exclude name="jabber_whiteboard/node-tracker.cpp"/>
166 <exclude name="jabber_whiteboard/node-utilities.cpp"/>
167 <!--WHITEBOARD-->
168 <exclude name="removeoverlap/placement_SolveVPSC.cpp"/>
169 <exclude name="removeoverlap/placement_SolveVPSC.h"/>
170 <exclude name="removeoverlap/test.cpp"/>
171 <exclude name="removeoverlap/remove_rectangle_overlap-test.cpp"/>
172 <exclude name="removeoverlap/remove_rectangle_overlap-test.h"/>
173 </fileset>
174 <flags>
175 -Wall -O3
176 -mms-bitfields
177 </flags>
178 <defines>
179 -DVERSION=\"${version}\"
180 -DHAVE_CONFIG_H
181 -DXP_WIN <!-- for JS -->
182 -D_INTL_REDIRECT_INLINE
183 -DRELAYTOOL_SSL="static const int libssl_is_present=1; static int __attribute__((unused)) libssl_symbol_is_present(char *s){ return 1; }" <!-- inkboard -->
184 -DWITH_INKBOARD -DHAVE_SSL <!-- inkboard -->
185 </defines>
186 <includes>
187 -I${gtk}/include
188 <!-- GTK / GTKMM -->
189 -I${gtk}/include/glibmm-2.4
190 -I${gtk}/lib/glibmm-2.4/include
191 -I${gtk}/include/gtkmm-2.4
192 -I${gtk}/lib/gtkmm-2.4/include
193 -I${gtk}/include/gdkmm-2.4
194 -I${gtk}/lib/gdkmm-2.4/include
195 -I${gtk}/include/pangomm-1.4
196 -I${gtk}/include/atkmm-1.6
197 -I${gtk}/include/cairomm-1.0
198 -I${gtk}/include/sigc++-2.0
199 -I${gtk}/lib/sigc++-2.0/include
200 -I${gtk}/include/gtk-2.0
201 -I${gtk}/lib/gtk-2.0/include
202 -I${gtk}/include/atk-1.0
203 -I${gtk}/include/pango-1.0
204 -I${gtk}/include/glib-2.0
205 -I${gtk}/lib/glib-2.0/include
206 <!-- OTHER -->
207 -I${gtk}/include/libxml2
208 -I${gtk}/include/freetype2
209 -I${gtk}/include/cairo
210 <!-- PERL -->
211 -Wno-comment -I${gtk}/perl/lib/CORE
212 <!-- PYTHON -->
213 -I${gtk}/python/include
214 </includes>
215 </cc>
216 </target>
222 <target name="lib" depends="compile">
223 <staticlib command="${archutil}ar crsv"
224 file="${build}/libinkscape.a">
225 <fileset dir="${build}/obj">
226 <exclude name="main,o"/>
227 <exclude name="winmain,o"/>
228 <exclude name="inkview,o"/>
229 </fileset>
230 </staticlib>
231 </target>
237 <target name="i18n" depends="compile">
238 <msgfmt todir="${build}/locale" owndir="true"
239 out="LC_MESSAGES/inkscape.mo">
240 <fileset dir="po">
241 </fileset>
242 </msgfmt>
243 </target>
249 <target name="link" depends="lib">
250 <rc command="${archutil}windres"
251 file="${src}/inkscape.rc"
252 out="${build}/inkres.o">
253 <flags>
254 --include-dir=${src}
255 </flags>
256 </rc>
257 <link command="${arch}g++" out="${build}/inkscape.exe"
258 strip="true" symfile="${build}/inkscape.dbg"
259 stripcommand="${archutil}strip"
260 objcopycommand="${archutil}objcopy"
261 >
262 <flags>
263 </flags>
264 <fileset dir="${build}">
265 <include name="inkres.o"/>
266 <include name="obj/main.o"/>
267 <include name="obj/winmain.o"/>
268 <include name="libinkscape.a"/>
269 </fileset>
270 <libs>
271 -L${gtk}/lib
272 -lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4
273 -latkmm-1.6 -lpangomm-1.4 -lsigc-2.0
274 -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0
275 -lgdk_pixbuf-2.0
276 -lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0
277 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lcairo
278 <!-- PERL -->
279 -L${gtk}/perl/lib/CORE -lperl58
280 <!-- PYTHON -->
281 -L${gtk}/python/libs -lpython24
282 ${gtk}/bin/libxml2.dll
283 ${gtk}/lib/iconv.lib
284 -lfreetype.dll -lfontconfig.dll
285 -llcms.dll
286 -lssl -lcrypto
287 -lpng -lpopt ${gtk}/lib/zdll.lib
288 -lgc -mwindows -lws2_32 -lintl -lm
289 </libs>
290 </link>
291 </target>
297 <target name="linkinkview" depends="lib">
298 <rc command="${archutil}windres"
299 file="${src}/inkview.rc"
300 out="${build}/inkviewres.o">
301 <flags>
302 --include-dir=${src}
303 </flags>
304 </rc>
305 <link command="${arch}g++" out="${build}/inkview.exe"
306 strip="true" symfile="${build}/inkview.dbg"
307 stripcommand="${archutil}strip"
308 objcopycommand="${archutil}objcopy"
309 >
310 <flags>
311 </flags>
312 <fileset dir="${build}">
313 < include name="inkviewres.o"/ >
314 <include name="obj/inkview.o"/>
315 <include name="libinkscape.a"/>
316 </fileset>
317 <libs>
318 -L${gtk}/lib
319 -lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4
320 -latkmm-1.6 -lpangomm-1.4 -lsigc-2.0
321 -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0
322 -lgdk_pixbuf-2.0
323 -lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0
324 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lcairo
325 <!-- PERL -->
326 -L${gtk}/perl/lib/CORE -lperl58
327 <!-- PYTHON -->
328 -L${gtk}/python/libs -lpython24
329 ${gtk}/bin/libxml2.dll
330 ${gtk}/lib/iconv.lib
331 -lfreetype.dll -lfontconfig.dll
332 -llcms.dll
333 -lssl -lcrypto
334 -lpng -lpopt ${gtk}/lib/zdll.lib
335 -lgc -mwindows -lws2_32 -lintl -lm
336 </libs>
337 </link>
338 </target>
344 <target name="dist" depends="link,i18n"
345 description="generate the distribution" >
346 <!-- Create the distribution directory -->
347 <copy file="${build}/inkscape.exe" todir="${dist}"/>
348 <copy file="${build}/inkscape.dbg" todir="${dist}"/>
349 <copy file="AUTHORS" todir="${dist}"/>
350 <copy file="COPYING" todir="${dist}"/>
351 <copy file="COPYING.LIB" todir="${dist}"/>
352 <copy file="NEWS" todir="${dist}"/>
353 <copy file="README" todir="${dist}"/>
354 <copy file="TRANSLATORS" todir="${dist}"/>
355 <copy file="${gtk}/bin/libatkmm-1.6-1.dll" todir="${dist}"/>
356 <copy file="${gtk}/bin/libglibmm-2.4-1.dll" todir="${dist}"/>
357 <copy file="${gtk}/bin/libgtkmm-2.4-1.dll" todir="${dist}"/>
358 <copy file="${gtk}/bin/libgdkmm-2.4-1.dll" todir="${dist}"/>
359 <copy file="${gtk}/bin/libpangomm-1.4-1.dll" todir="${dist}"/>
360 <copy file="${gtk}/bin/libcairomm-1.0-1.dll" todir="${dist}"/>
361 <copy file="${gtk}/bin/libsigc-2.0-0.dll" todir="${dist}"/>
362 <copy file="${gtk}/bin/freetype6.dll" todir="${dist}"/>
363 <copy file="${gtk}/bin/libatk-1.0-0.dll" todir="${dist}"/>
364 <copy file="${gtk}/bin/libgdk-win32-2.0-0.dll" todir="${dist}"/>
365 <copy file="${gtk}/bin/libgdk_pixbuf-2.0-0.dll" todir="${dist}"/>
366 <copy file="${gtk}/bin/libglib-2.0-0.dll" todir="${dist}"/>
367 <copy file="${gtk}/bin/libgmodule-2.0-0.dll" todir="${dist}"/>
368 <copy file="${gtk}/bin/libgobject-2.0-0.dll" todir="${dist}"/>
369 <copy file="${gtk}/bin/libgtk-win32-2.0-0.dll" todir="${dist}"/>
370 <copy file="${gtk}/bin/libgthread-2.0-0.dll" todir="${dist}"/>
371 <copy file="${gtk}/bin/libcairo-2.dll" todir="${dist}"/>
372 <copy file="${gtk}/bin/libpangocairo-1.0-0.dll" todir="${dist}"/>
373 <copy file="${gtk}/bin/libpango-1.0-0.dll" todir="${dist}"/>
374 <copy file="${gtk}/bin/libpangoft2-1.0-0.dll" todir="${dist}"/>
375 <copy file="${gtk}/bin/libpangowin32-1.0-0.dll" todir="${dist}"/>
376 <copy file="${gtk}/bin/freetype6.dll" todir="${dist}"/>
377 <copy file="${gtk}/bin/libfontconfig-1.dll" todir="${dist}"/>
378 <copy file="${gtk}/bin/libxml2.dll" todir="${dist}"/>
379 <copy file="${gtk}/bin/xmlparse.dll" todir="${dist}"/>
380 <copy file="${gtk}/bin/jpeg62.dll" todir="${dist}"/>
381 <copy file="${gtk}/bin/libpng13.dll" todir="${dist}"/>
382 <copy file="${gtk}/bin/libtiff3.dll" todir="${dist}"/>
383 <copy file="${gtk}/bin/msvcr70.dll" todir="${dist}"/>
384 <copy file="${gtk}/bin/msvcr71.dll" todir="${dist}"/>
385 <copy file="${gtk}/bin/zlib1.dll" todir="${dist}"/>
386 <copy file="${gtk}/bin/iconv.dll" todir="${dist}"/>
387 <copy file="${gtk}/bin/popt1.dll" todir="${dist}"/>
388 <copy file="${gtk}/bin/liblcms-1.dll" todir="${dist}"/>
389 <copy file="${gtk}/bin/intl.dll" todir="${dist}"/>
390 <copy file="${gtk}/bin/intl.dll" tofile="${dist}/libintl-2.dll"/>
392 <!-- MSGFMT files -->
393 <copy todir="${dist}">
394 <fileset dir="${build}/locale">
395 <exclude name=".*\.am"/>
396 </fileset>
397 </copy>
399 <!-- GTK -->
400 <copy todir="${dist}"> <fileset dir="${gtk}/etc"/> </copy>
401 <copy file="${gtk}/share/themes/MS-Windows/gtk-2.0/gtkrc" todir="${dist}/etc/gtk-2.0"/>
402 <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/gtk-2.0"/> </copy>
403 <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/glib-2.0"/> </copy>
404 <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/locale"/> </copy>
405 <copy todir="${dist}">
406 <fileset dir="share">
407 <exclude name=".*\.am"/>
408 </fileset>
409 </copy>
410 <copy todir="${dist}/share"> <fileset dir="${gtk}/share/themes"/> </copy>
411 <mkdir dir="${dist}/data"/>
412 <mkdir dir="${dist}/locale"/>
413 <mkdir dir="${dist}/modules"/>
414 <mkdir dir="${dist}/plugins"/>
415 <copy file="${gtk}/bin/gdb.exe" todir="${dist}"/>
417 <!-- PERL -->
418 <copy file="${gtk}/perl/bin/perl58.dll" todir="${dist}"/>
420 <!-- PYTHON -->
421 <copy file="${gtk}/python/python24.dll" todir="${dist}"/>
422 <copy file="${gtk}/python/python.exe" todir="${dist}/python"/>
423 <copy todir="${dist}/python"> <fileset dir="${gtk}/python/Lib"/> </copy>
424 <copy todir="${dist}/python"> <fileset dir="${gtk}/python/DLLs"/> </copy>
425 <copy todir="${dist}/python"> <fileset dir="${gtk}/python/Scripts"/> </copy>
427 </target>
432 <target name="dist-all" depends="dist,linkinkview"
433 description="generate the distribution, along with inkview" >
434 <copy file="${build}/inkview.exe" todir="${dist}"/>
435 <copy file="${build}/inkview.dbg" todir="${dist}"/>
436 </target>
441 <target name="clean"
442 description="clean up" >
443 <!-- Delete the ${build} and ${dist} directory trees -->
444 <delete dir="${build}"/>
445 <delete dir="${dist}"/>
446 </target>
447 </project>