Code

compile fixes for the release system, excluded test files
[inkscape.git] / build.xml
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         ######################################*/
42         
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="test-all.cpp"/>
101                 <exclude name="dialogs/filedialog-win32.cpp"/>
102                 <exclude name="display/testnr.cpp"/>
103                 <exclude name="display/bezier-utils-test.cpp"/>
104                 <exclude name="dom/jsdombind.cpp"/>
105                 <exclude name="dom/work/.*"/>
106                 <exclude name="dom/odf/SvgOdg.cpp"/>
107                 <exclude name="extension/api.cpp"/>
108                 <exclude name="extension/dxf2svg/.*"/>
109                 <exclude name="extension/internal/gnome.cpp"/>
110                 <exclude name="extension/script/bindtest.cpp"/>
111                 <exclude name="extension/script/cpptest.cpp"/>
112                 <exclude name="extension/plugin/.*"/>
113                 <exclude name="extract-uri-test.cpp"/>
114                 <exclude name="helper/units-test.cpp"/>
115                 <!-- exclude name="inkview.cpp"/-->
116                 <exclude name="libnr/test-nr.cpp"/>
117                 <exclude name="libnr/test-nr-main.cpp"/>
118                 <exclude name="libnr/testnr.cpp"/>
119                 <exclude name="libnr/in-svg-plane-test.cpp"/>
120                 <exclude name="libnr/nr-compose-reference.cpp"/>
121                 <exclude name="libnr/nr-compose-test.cpp"/>
122                 <exclude name="libnr/nr-matrix-test.cpp"/>
123                 <exclude name="libnr/nr-point-fns-test.cpp"/>
124                 <exclude name="libnr/nr-rotate-fns-test.cpp"/>
125                 <exclude name="libnr/nr-rotate-test.cpp"/>
126                 <exclude name="libnr/nr-scale-test.cpp"/>
127                 <exclude name="libnr/nr-translate-test.cpp"/>
128                 <exclude name="libnr/nr-types-test.cpp"/>
129                 <exclude name="livarot/Path-test.cpp"/>
130                 <exclude name="mod360-test.cpp"/>
131                 <exclude name="trace/potrace/potest.cpp"/>
132                 <exclude name="round-test.cpp"/>
133                 <exclude name="sp-gradient-test.cpp"/>
134                 <exclude name="svg/ftos.cpp"/>
135                 <exclude name="svg/test-svg.cpp"/>
136                 <exclude name="svg/test-svg-main.cpp"/>
137                 <exclude name="utest/.*"/>
138                 <exclude name="widgets/test-widgets.cpp"/>
139                 <exclude name="xml/quote-test.cpp"/>
140                 <exclude name="xml/repr-action-test.cpp"/>
141                 <exclude name="xml/test-xml.cpp"/>
142                 <exclude name="xml/test-xml-main.cpp"/>
143                 <exclude name="io/streamtest.cpp"/>
144             <!--JABBER-->
145                 <exclude name="pedro/pedrogui.cpp"/>
146                 <exclude name="pedro/pedrogui.h"/>
147                 <exclude name="pedro/work/.*"/>
148             <!--WHITEBOARD-->
149                 <exclude name="ui/dialog/session-player.cpp"/>
150                 <exclude name="ui/dialog/whiteboard-connect.cpp"/>
151                 <exclude name="ui/dialog/whiteboard-sharewithchat.cpp"/>
152                 <exclude name="ui/dialog/whiteboard-sharewithuser.cpp"/>
153                 <exclude name="dialogs/whiteboard-connect-dialog.cpp"/>
154                 <exclude name="dialogs/whiteboard-common-dialog.cpp"/>
155                 <exclude name="dialogs/whiteboard-sharewithchat-dialog.cpp"/>
156                 <exclude name="dialogs/whiteboard-sharewithuser-dialog.cpp"/>
157                 <exclude name="jabber_whiteboard/node-tracker.cpp"/>
158                 <exclude name="jabber_whiteboard/node-utilities.cpp"/>
159             <!--WHITEBOARD-->
160                 <exclude name="removeoverlap/placement_SolveVPSC.cpp"/>
161                 <exclude name="removeoverlap/placement_SolveVPSC.h"/>
162                 <exclude name="removeoverlap/test.cpp"/>
163                 <exclude name="removeoverlap/remove_rectangle_overlap-test.cpp"/>
164                 <exclude name="removeoverlap/remove_rectangle_overlap-test.h"/>
165             </fileset>
166         <flags>
167             -Wall -O3
168             -mms-bitfields
169         </flags>
170         <defines>
171             -DVERSION=\"${version}\"
172             -DHAVE_CONFIG_H
173             -DXP_WIN <!-- for JS -->
174                         -D_INTL_REDIRECT_INLINE
175             -DRELAYTOOL_SSL="static const int libssl_is_present=1; static int __attribute__((unused)) libssl_symbol_is_present(char *s){ return 1; }" <!-- inkboard -->
176             -DWITH_INKBOARD -DHAVE_SSL <!-- inkboard -->
177         </defines>
178         <includes>
179             -I${gtk}/include
180                         <!-- GTK / GTKMM -->
181             -I${gtk}/include/glibmm-2.4
182                     -I${gtk}/lib/glibmm-2.4/include
183             -I${gtk}/include/gtkmm-2.4
184                     -I${gtk}/lib/gtkmm-2.4/include
185             -I${gtk}/include/gdkmm-2.4
186                     -I${gtk}/lib/gdkmm-2.4/include
187             -I${gtk}/include/pangomm-1.4
188             -I${gtk}/include/atkmm-1.6
189             -I${gtk}/include/cairomm-1.0
190             -I${gtk}/include/sigc++-2.0
191                     -I${gtk}/lib/sigc++-2.0/include
192             -I${gtk}/include/gtk-2.0
193                     -I${gtk}/lib/gtk-2.0/include
194             -I${gtk}/include/atk-1.0
195                     -I${gtk}/include/pango-1.0
196             -I${gtk}/include/glib-2.0
197                     -I${gtk}/lib/glib-2.0/include
198                     <!-- OTHER -->
199             -I${gtk}/include/libxml2 
200                         -I${gtk}/include/freetype2
201                     -I${gtk}/include/cairo
202                     <!-- PERL -->
203                     -Wno-comment -I${gtk}/perl/lib/CORE
204                     <!-- PYTHON -->
205                     -I${gtk}/python/include
206         </includes>
207         </cc>
208   </target>
209   
210   <target name="lib" depends="compile">
211     <staticlib command="${archutil}ar crsv"
212            file="${build}/libinkscape.a">
213            <fileset dir="${build}/obj">
214                <exclude name="main,o"/>
215                <exclude name="winmain,o"/>
216                <exclude name="inkview,o"/>
217            </fileset>
218         </staticlib>
219   </target>
221   <target name="i18n" depends="compile">
222     <msgfmt todir="${build}/locale" owndir="true"
223          out="LC_MESSAGES/inkscape.mo">
224            <fileset dir="po">
225            </fileset>
226         </msgfmt>
227   </target>
229   <target name="link" depends="lib">
230     <rc command="${archutil}windres" 
231             file="${src}/inkscape.rc"
232             out="${build}/inkres.o">
233                 <flags>
234                 --include-dir=${src}
235                 </flags>
236         </rc>
237     <link command="${arch}g++" out="${build}/inkscape.exe"
238               strip="true" symfile="${build}/inkscape.dbg"
239               stripcommand="${archutil}strip"
240               objcopycommand="${archutil}objcopy"
241               >
242        <flags>
243        </flags>
244            <fileset dir="${build}">
245                <include name="inkres.o"/>
246                <include name="obj/main.o"/>
247                <include name="obj/winmain.o"/>
248                <include name="libinkscape.a"/>
249            </fileset>
250            <libs>
251                -L${gtk}/lib
252            -lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4
253            -latkmm-1.6 -lpangomm-1.4 -lsigc-2.0
254            -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0
255            -lgdk_pixbuf-2.0
256            -lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0
257            -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lcairo
258            <!-- PERL -->
259                    -L${gtk}/perl/lib/CORE -lperl58
260            <!-- PYTHON -->
261            -L${gtk}/python/libs -lpython24
262            ${gtk}/bin/libxml2.dll
263            ${gtk}/lib/iconv.lib
264            -lfreetype.dll -lfontconfig.dll
265            -llcms.dll
266            -lssl -lcrypto
267            -lpng -lpopt ${gtk}/lib/zdll.lib
268            -lgc -mwindows -lws2_32 -lintl -lm
269            </libs>
270         </link>
271   </target>
272   
273   <target name="linkinkview" depends="lib">
274     <rc command="${archutil}windres" 
275             file="${src}/inkview.rc"
276             out="${build}/inkviewres.o">
277                 <flags>
278                 --include-dir=${src}
279                 </flags>
280         </rc>
281     <link command="${arch}g++" out="${build}/inkview.exe"
282               strip="true" symfile="${build}/inkview.dbg"
283               stripcommand="${archutil}strip"
284               objcopycommand="${archutil}objcopy"
285               >
286        <flags>
287        </flags>
288            <fileset dir="${build}">
289                < include name="inkviewres.o"/ >
290                <include name="obj/inkview.o"/>
291                <include name="libinkscape.a"/>
292            </fileset>
293            <libs>
294                -L${gtk}/lib
295            -lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4
296            -latkmm-1.6 -lpangomm-1.4 -lsigc-2.0
297            -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0
298            -lgdk_pixbuf-2.0
299            -lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0
300            -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lcairo
301            <!-- PERL -->
302                    -L${gtk}/perl/lib/CORE -lperl58
303            <!-- PYTHON -->
304            -L${gtk}/python/libs -lpython24
305            ${gtk}/bin/libxml2.dll
306            ${gtk}/lib/iconv.lib
307            -lfreetype.dll -lfontconfig.dll
308            -llcms.dll
309            -lssl -lcrypto
310            -lpng -lpopt ${gtk}/lib/zdll.lib
311            -lgc -mwindows -lws2_32 -lintl -lm
312            </libs>
313         </link>
314   </target>
316   <target name="dist" depends="link,i18n,linkinkview"
317         description="generate the distribution" >
318     <!-- Create the distribution directory -->
319     <copy file="${build}/inkscape.exe" todir="${dist}"/>
320     <copy file="${build}/inkscape.dbg" todir="${dist}"/>
321     <copy file="${build}/inkview.exe" todir="${dist}"/>
322     <copy file="${build}/inkview.dbg" todir="${dist}"/>
323     <copy file="AUTHORS" todir="${dist}"/>
324     <copy file="COPYING" todir="${dist}"/>
325     <copy file="COPYING.LIB" todir="${dist}"/>
326     <copy file="NEWS" todir="${dist}"/>
327     <copy file="README" todir="${dist}"/>
328     <copy file="TRANSLATORS" todir="${dist}"/>
329     <copy file="${gtk}/bin/libatkmm-1.6-1.dll" todir="${dist}"/>
330     <copy file="${gtk}/bin/libglibmm-2.4-1.dll" todir="${dist}"/>
331     <copy file="${gtk}/bin/libgtkmm-2.4-1.dll" todir="${dist}"/>
332     <copy file="${gtk}/bin/libgdkmm-2.4-1.dll" todir="${dist}"/>
333     <copy file="${gtk}/bin/libpangomm-1.4-1.dll" todir="${dist}"/>
334     <copy file="${gtk}/bin/libcairomm-1.0-1.dll" todir="${dist}"/>
335     <copy file="${gtk}/bin/libsigc-2.0-0.dll" todir="${dist}"/>
336     <copy file="${gtk}/bin/freetype6.dll" todir="${dist}"/>
337     <copy file="${gtk}/bin/libatk-1.0-0.dll" todir="${dist}"/>
338     <copy file="${gtk}/bin/libgdk-win32-2.0-0.dll" todir="${dist}"/>
339     <copy file="${gtk}/bin/libgdk_pixbuf-2.0-0.dll" todir="${dist}"/>
340     <copy file="${gtk}/bin/libglib-2.0-0.dll" todir="${dist}"/>
341     <copy file="${gtk}/bin/libgmodule-2.0-0.dll" todir="${dist}"/>
342     <copy file="${gtk}/bin/libgobject-2.0-0.dll" todir="${dist}"/>
343     <copy file="${gtk}/bin/libgtk-win32-2.0-0.dll" todir="${dist}"/>
344     <copy file="${gtk}/bin/libgthread-2.0-0.dll" todir="${dist}"/>
345     <copy file="${gtk}/bin/libcairo-2.dll" todir="${dist}"/>
346     <copy file="${gtk}/bin/libpangocairo-1.0-0.dll" todir="${dist}"/>
347     <copy file="${gtk}/bin/libpango-1.0-0.dll" todir="${dist}"/>
348     <copy file="${gtk}/bin/libpangoft2-1.0-0.dll" todir="${dist}"/>
349     <copy file="${gtk}/bin/libpangowin32-1.0-0.dll" todir="${dist}"/>
350     <copy file="${gtk}/bin/freetype6.dll" todir="${dist}"/>
351     <copy file="${gtk}/bin/libfontconfig-1.dll" todir="${dist}"/>
352     <copy file="${gtk}/bin/libxml2.dll" todir="${dist}"/>
353     <copy file="${gtk}/bin/xmlparse.dll" todir="${dist}"/>
354     <copy file="${gtk}/bin/jpeg62.dll" todir="${dist}"/>
355     <copy file="${gtk}/bin/libpng13.dll" todir="${dist}"/>
356     <copy file="${gtk}/bin/msvcr70.dll" todir="${dist}"/>
357     <copy file="${gtk}/bin/msvcr71.dll" todir="${dist}"/>
358     <copy file="${gtk}/bin/zlib1.dll" todir="${dist}"/>
359     <copy file="${gtk}/bin/iconv.dll" todir="${dist}"/>
360     <copy file="${gtk}/bin/popt1.dll" todir="${dist}"/>
361     <copy file="${gtk}/bin/liblcms-1.dll" todir="${dist}"/>
362     <copy file="${gtk}/bin/intl.dll" todir="${dist}"/>
363     <copy file="${gtk}/bin/intl.dll" tofile="${dist}/libintl-2.dll"/>
365     <!-- MSGFMT files -->
366     <copy todir="${dist}">
367             <fileset dir="${build}/locale">
368                   <exclude name=".*\.am"/>
369                 </fileset>
370         </copy>
372     <!-- GTK -->
373     <copy todir="${dist}"> <fileset dir="${gtk}/etc"/> </copy>
374     <copy file="${gtk}/share/themes/MS-Windows/gtk-2.0/gtkrc" todir="${dist}/etc/gtk-2.0"/>
375     <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/gtk-2.0"/> </copy>
376     <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/glib-2.0"/> </copy>
377     <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/locale"/> </copy>
378     <copy todir="${dist}">
379             <fileset dir="share">
380                   <exclude name=".*\.am"/>
381                 </fileset>
382         </copy>
383     <copy todir="${dist}/share"> <fileset dir="${gtk}/share/themes"/> </copy>
384     <mkdir dir="${dist}/data"/>
385     <mkdir dir="${dist}/locale"/>
386     <mkdir dir="${dist}/modules"/>
387     <mkdir dir="${dist}/plugins"/>
388     <copy file="${gtk}/bin/gdb.exe" todir="${dist}"/>
390     <!-- PERL -->
391     <copy file="${gtk}/perl/bin/perl58.dll" todir="${dist}"/>
393     <!-- PYTHON -->
394     <copy file="${gtk}/python/python24.dll" todir="${dist}"/>
395     <copy file="${gtk}/python/python.exe" todir="${dist}/python"/>
396     <copy todir="${dist}/python"> <fileset dir="${gtk}/python/Lib"/> </copy>
397     <copy todir="${dist}/python"> <fileset dir="${gtk}/python/DLLs"/> </copy>
398     <copy todir="${dist}/python"> <fileset dir="${gtk}/python/Scripts"/> </copy>
401   </target>
403   <target name="clean"
404         description="clean up" >
405     <!-- Delete the ${build} and ${dist} directory trees -->
406     <delete dir="${build}"/>
407     <delete dir="${dist}"/>
408   </target>
409 </project>