Code

Update python to 2.5. Add lxml and numpy, remove pyxml.
[inkscape.git] / build.xml
1 <!--
2  * Inkscape build file.
3  *
4  * See buildtool.cpp for use.
5  *
6  * Authors:
7  *   Bob Jamison
8  *   Others 
9  *
10  * Copyright (C) 2006-2007 Inkscape.org
11  *
12  *  This library is free software; you can redistribute it and/or
13  *  modify it under the terms of the GNU Lesser General Public
14  *  License as published by the Free Software Foundation; either
15  *  version 2.1 of the License, or (at your option) any later version.
16  *
17  *  This library is distributed in the hope that it will be useful,
18  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  *  Lesser General Public License for more details.
21  *
22  *  You should have received a copy of the GNU Lesser General Public
23  *  License along with this library; if not, write to the Free Software
24  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
25 -->
31 <!--
32 ########################################################################
33 ## P R O J E C T   :   I N K S C A P E
34 ########################################################################
35 -->
36 <project name="Inkscape" default="dist" basedir=".">
37     <description>
38         Build file for the Inkscape SVG editor.  This file
39         was written for GTK-2.10 on Win32, but it should work
40         well for other types of builds with only minor adjustments.
41     </description>
43   <!-- set global properties for this build -->
44   <property name="version"     value="0.46dev"/>
45   <property name="arch"        value="i686-pc-mingw32-"/>
46   <!--<property name="archutil"    value="${arch}"/>-->
47   <property name="archutil"    value=""/>
48   <property name="src"         location="src"/>
49   <property name="gtk"         location="c:/gtk210"/>
50   <property name="lib"         location="lib"/>
51   <property name="build"       location="build"/>
52   <property name="dist"        location="inkscape"/>
58   <!--
59   ########################################################################
60   ## T A R G E T    :    I N I T
61   ########################################################################
62   -->
63   <target name="init"
64       description=
65       "Do all prepatory tasks, like make directories and copy files">
68     <!-- example of the <pkg-config> task
69       query can be cflags, libs, or both
70       prefix overrides the value of prefix="" in the file
71       the result of this entry can be later used as ${gtkmm}
72     -->
73     <!--
74     <pkg-config name="gtkmm-2.4" path="${gtk}/lib/pkgconfig"
75                 query="both" property="gtkmm" prefix="${gtk}"/>
76     -->
78     <mkdir dir="${build}"/>
79     <mkdir dir="${dist}"/>
80     <copy file="${src}/helper/sp-marshal.h.mingw"
81           tofile="${src}/helper/sp-marshal.h"/>
82     <copy file="${src}/helper/sp-marshal.cpp.mingw"
83           tofile="${src}/helper/sp-marshal.cpp"/>
84     <makefile file="inkscape_version.h">
85         #define INKSCAPE_VERSION "${version}+devel"
86     </makefile>
87     <makefile file="config.h">
88         #ifndef _CONFIG_H_
89         #define _CONFIG_H_
91         #ifndef WIN32
92         #define WIN32
93         #endif
95         /*######################################
96         ## This is for require-config.h, whose
97         ## purpose I cannot fathom.
98         ######################################*/
99         
100         #define PACKAGE_TARNAME
102         /*######################################
103         #### RESOURCE DIRECTORIES
104         ######################################*/
106         #define INKSCAPE_DATADIR       "."
107         #define PACKAGE_LOCALE_DIR     "locale"
110         /*######################################
111         #### OTHER DEFINITIONS
112         ######################################*/
114         #define GETTEXT_PACKAGE "inkscape"
116         #define PACKAGE_STRING                VERSION
118         #define HAVE_GETOPT_H                 1
119         #define HAVE_STRING_H                 1
120         #define HAVE_LIBINTL_H                1
121         #define HAVE_MALLOC_H                 1
122         #define HAVE_STDLIB_H                 1
123         #define HAVE_SYS_STAT_H               1
125         #define ENABLE_LCMS                   1
127         #define ENABLE_NLS                    1
128         #define HAVE_BIND_TEXTDOMAIN_CODESET  1
130         /* keep binreloc off */
131         #define BR_PTHREADS 0
132         #undef ENABLE_BINRELOC
134         /* CairoPDF options */
135         #define HAVE_CAIRO_PDF                1
136         #define PANGO_ENABLE_ENGINE           1
137         #define RENDER_WITH_PANGO_CAIRO       1
139         #define HAVE_GTK_WINDOW_FULLSCREEN    1
140         
141         /* internal interpreter */
142         #define WITH_PYTHON                   1
144         /* shared whiteboard */
145         #define WITH_INKBOARD                 1
146         #define HAVE_SSL                      1
148         #endif /* _CONFIG_H_ */
149     </makefile>
150   </target>
154   <!--
155   ########################################################################
156   ## T A R G E T    :    T O U C H A B O U T
157   ########################################################################
158   -->
159   <target name="touchabout"
160       description="update the modification time of aboutdialog.cpp">
161     <!-- not good <touch file="${src}/ui/dialog/aboutdialog.cpp"/> -->
162     <!-- better -->
163     <delete file="${build}/obj/ui/dialog/aboutdialog.o"/>
164   </target>
167   <!--
168   ########################################################################
169   ## T A R G E T    :    C O M P I L E
170   ########################################################################
171   -->
172   <target name="compile" depends="init"
173         description="compile the source to .o" >
175     <!-- Compile from source to build -->
176     <cc cc="${arch}gcc" cxx="${arch}g++"
177              destdir="${build}/obj">
178         <fileset dir="${src}">
179             <!-- THINGS TO EXCLUDE -->
180             <exclude name="ast/.*"/>
181             <exclude name="bonobo/.*"/>
182             <exclude name="deptool.cpp"/>
183             <exclude name="test-all.cpp"/>
184             <exclude name="dialogs/filedialog-win32.cpp"/>
185             <exclude name="display/testnr.cpp"/>
186             <exclude name="display/bezier-utils-test.cpp"/>
187             <exclude name="dom/jsdombind.cpp"/>
188             <exclude name="dom/work/.*"/>
189             <exclude name="dom/odf/SvgOdg.cpp"/>
190             <exclude name="extension/api.cpp"/>
191             <exclude name="extension/dxf2svg/.*"/>
192             <exclude name="extension/internal/gnome.cpp"/>
193             <exclude name="extension/script/bindtest.cpp"/>
194             <exclude name="extension/script/cpptest.cpp"/>
195             <exclude name="extension/plugin/.*"/>
196             <exclude name="extract-uri-test.cpp"/>
197             <exclude name="helper/units-test.cpp"/>
198             <!-- exclude name="inkview.cpp"/-->
199             <exclude name="libnr/test-nr.cpp"/>
200             <exclude name="libnr/test-nr-main.cpp"/>
201             <exclude name="libnr/testnr.cpp"/>
202             <exclude name="libnr/in-svg-plane-test.cpp"/>
203             <exclude name="libnr/nr-compose-reference.cpp"/>
204             <exclude name="libnr/nr-compose-test.cpp"/>
205             <exclude name="libnr/nr-matrix-test.cpp"/>
206             <exclude name="libnr/nr-point-fns-test.cpp"/>
207             <exclude name="libnr/nr-rotate-fns-test.cpp"/>
208             <exclude name="libnr/nr-rotate-test.cpp"/>
209             <exclude name="libnr/nr-scale-test.cpp"/>
210             <exclude name="libnr/nr-translate-test.cpp"/>
211             <exclude name="libnr/nr-types-test.cpp"/>
212             <exclude name="livarot/Path-test.cpp"/>
213             <exclude name="mod360-test.cpp"/>
214             <exclude name="trace/potrace/potest.cpp"/>
215             <exclude name="round-test.cpp"/>
216             <exclude name="sp-gradient-test.cpp"/>
217             <exclude name="svg/ftos.cpp"/>
218             <exclude name="svg/test-svg.cpp"/>
219             <exclude name="svg/test-svg-main.cpp"/>
220             <exclude name="utest/.*"/>
221             <exclude name="widgets/test-widgets.cpp"/>
222             <exclude name="xml/quote-test.cpp"/>
223             <exclude name="xml/repr-action-test.cpp"/>
224             <exclude name="xml/test-xml.cpp"/>
225             <exclude name="xml/test-xml-main.cpp"/>
226             <exclude name="io/streamtest.cpp"/>
227             <!--JABBER-->
228             <exclude name="pedro/pedrogui.cpp"/>
229             <exclude name="pedro/pedrogui.h"/>
230             <exclude name="pedro/work/.*"/>
231             <!--WHITEBOARD-->
232             <exclude name="ui/dialog/session-player.cpp"/>
233             <exclude name="ui/dialog/whiteboard-connect.cpp"/>
234             <exclude name="ui/dialog/whiteboard-sharewithchat.cpp"/>
235             <exclude name="ui/dialog/whiteboard-sharewithuser.cpp"/>
236             <exclude name="dialogs/whiteboard-connect-dialog.cpp"/>
237             <exclude name="dialogs/whiteboard-common-dialog.cpp"/>
238             <exclude name="dialogs/whiteboard-sharewithchat-dialog.cpp"/>
239             <exclude name="dialogs/whiteboard-sharewithuser-dialog.cpp"/>
240             <exclude name="jabber_whiteboard/node-tracker.cpp"/>
241             <exclude name="jabber_whiteboard/node-utilities.cpp"/>
242             <!--WHITEBOARD-->
243             <exclude name="removeoverlap/placement_SolveVPSC.cpp"/>
244             <exclude name="removeoverlap/placement_SolveVPSC.h"/>
245             <exclude name="removeoverlap/test.cpp"/>
246             <exclude name="removeoverlap/remove_rectangle_overlap-test.cpp"/>
247             <exclude name="removeoverlap/remove_rectangle_overlap-test.h"/>
248         </fileset>
249         <flags>
250             -Wall -O3
251             -mms-bitfields
252         </flags>
253         <defines>
254             -DVERSION=\"${version}\"
255             -DHAVE_CONFIG_H
256             -DXP_WIN <!-- for JS -->
257             -D_INTL_REDIRECT_INLINE
258             -DRELAYTOOL_SSL="static const int libssl_is_present=1; static int __attribute__((unused)) libssl_symbol_is_present(char *s){ return 1; }" <!-- inkboard -->
259         </defines>
260         <includes>
261             -I${gtk}/include
262             <!-- GTK / GTKMM -->
263             -I${gtk}/include/glibmm-2.4
264             -I${gtk}/lib/glibmm-2.4/include
265             -I${gtk}/include/gtkmm-2.4
266             -I${gtk}/lib/gtkmm-2.4/include
267             -I${gtk}/include/gdkmm-2.4
268             -I${gtk}/lib/gdkmm-2.4/include
269             -I${gtk}/include/pangomm-1.4
270             -I${gtk}/include/atkmm-1.6
271             -I${gtk}/include/cairomm-1.0
272             -I${gtk}/include/sigc++-2.0
273             -I${gtk}/lib/sigc++-2.0/include
274             -I${gtk}/include/gtk-2.0
275             -I${gtk}/lib/gtk-2.0/include
276             -I${gtk}/include/atk-1.0
277             -I${gtk}/include/pango-1.0
278             -I${gtk}/include/glib-2.0
279             -I${gtk}/lib/glib-2.0/include
280             <!-- OTHER -->
281             -I${gtk}/include/libxml2 
282             -I${gtk}/include/freetype2
283             -I${gtk}/include/cairo
284             <!-- PERL -->
285             -Wno-comment -I${gtk}/perl/lib/CORE
286             <!-- PYTHON -->
287             -I${gtk}/python/include
288         </includes>
289     </cc>
290   </target>
291   
293   <!--
294   ########################################################################
295   ## T A R G E T    :    L I B
296   ########################################################################
297   -->
298   <target name="lib" depends="compile"
299       description="create a static library">
300     <staticlib command="${archutil}ar crsv"
301            file="${build}/libinkscape.a">
302        <fileset dir="${build}/obj">
303            <exclude name="main.o"/>
304            <exclude name="winmain.o"/>
305            <exclude name="inkview.o"/>
306        </fileset>
307     </staticlib>
308   </target>
312   <!--
313   ########################################################################
314   ## T A R G E T    :    I 1 8 N
315   ########################################################################
316   -->
317   <target name="i18n" depends="compile"
318       description="compile gettext .po files to .mo">
320     <msgfmt todir="${build}/locale" owndir="true"
321          out="LC_MESSAGES/inkscape.mo">
322        <fileset dir="po">
323        </fileset>
324     </msgfmt>
325   </target>
331   <!--
332   ########################################################################
333   ## T A R G E T    :    L I N K
334   ########################################################################
335   -->
336   <target name="link" depends="lib"
337       description="link objects and library to create executable">
339     <rc command="${archutil}windres" 
340         file="${src}/inkscape.rc"
341         out="${build}/inkres.o">
342         <flags>
343         --include-dir=${src}
344         </flags>
345     </rc>
346     <link command="${arch}g++" out="${build}/inkscape.exe"
347               strip="true" symfile="${build}/inkscape.dbg"
348               stripcommand="${archutil}strip"
349               objcopycommand="${archutil}objcopy"
350               >
351        <flags>
352        </flags>
353        <fileset dir="${build}">
354            <include name="inkres.o"/>
355            <include name="obj/main.o"/>
356            <include name="obj/winmain.o"/>
357            <include name="libinkscape.a"/>
358        </fileset>
359        <libs>
360            -L${gtk}/lib
361            -lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4
362            -latkmm-1.6 -lpangomm-1.4 -lsigc-2.0
363            -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0
364            -lgdk_pixbuf-2.0
365            -lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0
366            -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lcairo
367            <!-- PERL -->
368            -L${gtk}/perl/lib/CORE -lperl58
369            <!-- PYTHON -->
370            -L${gtk}/python/libs -lpython25
371            ${gtk}/bin/libxml2.dll
372            ${gtk}/lib/iconv.lib
373            -lfreetype.dll -lfontconfig.dll
374            -llcms.dll
375            -lssl -lcrypto
376            -lpng -lpopt ${gtk}/lib/zdll.lib
377            -lgc -mwindows -lws2_32 -lintl -lm
378        </libs>
379     </link>
380   </target>
381   
386   <!--
387   ########################################################################
388   ## T A R G E T    :    L I N K I N K V I E W
389   ########################################################################
390   -->
391   <target name="linkinkview" depends="lib"
392         description="link objects and library to create Inkview executable">
394     <rc command="${archutil}windres" 
395         file="${src}/inkview.rc"
396         out="${build}/inkviewres.o">
397         <flags>
398         --include-dir=${src}
399         </flags>
400     </rc>
401     <link command="${arch}g++" out="${build}/inkview.exe"
402               strip="true" symfile="${build}/inkview.dbg"
403               stripcommand="${archutil}strip"
404               objcopycommand="${archutil}objcopy"
405               >
406        <flags>
407        </flags>
408        <fileset dir="${build}">
409            <include name="inkviewres.o"/>
410            <include name="obj/inkview.o"/>
411            <include name="libinkscape.a"/>
412        </fileset>
413        <libs>
414            -L${gtk}/lib
415            -lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4
416            -latkmm-1.6 -lpangomm-1.4 -lsigc-2.0
417            -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0
418            -lgdk_pixbuf-2.0
419            -lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0
420            -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lcairo
421            <!-- PERL -->
422            -L${gtk}/perl/lib/CORE -lperl58
423            <!-- PYTHON -->
424            -L${gtk}/python/libs -lpython24
425            ${gtk}/bin/libxml2.dll
426            ${gtk}/lib/iconv.lib
427            -lfreetype.dll -lfontconfig.dll
428            -llcms.dll
429            -lssl -lcrypto
430            -lpng -lpopt ${gtk}/lib/zdll.lib
431            -lgc -mwindows -lws2_32 -lintl -lm
432        </libs>
433     </link>
434   </target>
438   <!--
439   ########################################################################
440   ## T A R G E T    :    D I S T
441   ########################################################################
442   -->
443   <target name="dist" depends="link,i18n"
444       description="generate the distribution directory with all needed files">
446     <!-- Create the distribution directory -->
447     <copy file="${build}/inkscape.exe" todir="${dist}"/>
448     <copy file="${build}/inkscape.dbg" todir="${dist}"/>
449     <copy file="AUTHORS" todir="${dist}"/>
450     <copy file="COPYING" todir="${dist}"/>
451     <copy file="COPYING.LIB" todir="${dist}"/>
452     <copy file="NEWS" todir="${dist}"/>
453     <copy file="README" todir="${dist}"/>
454     <copy file="TRANSLATORS" todir="${dist}"/>
455     <copy file="${gtk}/bin/libatkmm-1.6-1.dll" todir="${dist}"/>
456     <copy file="${gtk}/bin/libglibmm-2.4-1.dll" todir="${dist}"/>
457     <copy file="${gtk}/bin/libgtkmm-2.4-1.dll" todir="${dist}"/>
458     <copy file="${gtk}/bin/libgdkmm-2.4-1.dll" todir="${dist}"/>
459     <copy file="${gtk}/bin/libpangomm-1.4-1.dll" todir="${dist}"/>
460     <copy file="${gtk}/bin/libcairomm-1.0-1.dll" todir="${dist}"/>
461     <copy file="${gtk}/bin/libsigc-2.0-0.dll" todir="${dist}"/>
462     <copy file="${gtk}/bin/freetype6.dll" todir="${dist}"/>
463     <copy file="${gtk}/bin/libatk-1.0-0.dll" todir="${dist}"/>
464     <copy file="${gtk}/bin/libgdk-win32-2.0-0.dll" todir="${dist}"/>
465     <copy file="${gtk}/bin/libgdk_pixbuf-2.0-0.dll" todir="${dist}"/>
466     <copy file="${gtk}/bin/libglib-2.0-0.dll" todir="${dist}"/>
467     <copy file="${gtk}/bin/libgmodule-2.0-0.dll" todir="${dist}"/>
468     <copy file="${gtk}/bin/libgobject-2.0-0.dll" todir="${dist}"/>
469     <copy file="${gtk}/bin/libgtk-win32-2.0-0.dll" todir="${dist}"/>
470     <copy file="${gtk}/bin/libgthread-2.0-0.dll" todir="${dist}"/>
471     <copy file="${gtk}/bin/libcairo-2.dll" todir="${dist}"/>
472     <copy file="${gtk}/bin/libpangocairo-1.0-0.dll" todir="${dist}"/>
473     <copy file="${gtk}/bin/libpango-1.0-0.dll" todir="${dist}"/>
474     <copy file="${gtk}/bin/libpangoft2-1.0-0.dll" todir="${dist}"/>
475     <copy file="${gtk}/bin/libpangowin32-1.0-0.dll" todir="${dist}"/>
476     <copy file="${gtk}/bin/freetype6.dll" todir="${dist}"/>
477     <copy file="${gtk}/bin/libfontconfig-1.dll" todir="${dist}"/>
478     <copy file="${gtk}/bin/libxml2.dll" todir="${dist}"/>
479     <copy file="${gtk}/bin/xmlparse.dll" todir="${dist}"/>
480     <copy file="${gtk}/bin/xmlparse.dll" tofile="${dist}/libexpat.dll"/>
481     <copy file="${gtk}/bin/jpeg62.dll" todir="${dist}"/>
482     <copy file="${gtk}/bin/libpng13.dll" todir="${dist}"/>
483     <copy file="${gtk}/bin/libtiff3.dll" todir="${dist}"/>
484     <copy file="${gtk}/bin/msvcr70.dll" todir="${dist}"/>
485     <copy file="${gtk}/bin/msvcr71.dll" todir="${dist}"/>
486     <copy file="${gtk}/bin/zlib1.dll" todir="${dist}"/>
487     <copy file="${gtk}/bin/iconv.dll" todir="${dist}"/>
488     <copy file="${gtk}/bin/popt1.dll" todir="${dist}"/>
489     <copy file="${gtk}/bin/liblcms-1.dll" todir="${dist}"/>
490     <copy file="${gtk}/bin/intl.dll" todir="${dist}"/>
491     <copy file="${gtk}/bin/intl.dll" tofile="${dist}/libintl-2.dll"/>
493     <!-- MSGFMT files -->
494     <copy todir="${dist}">
495         <fileset dir="${build}/locale">
496           <exclude name=".*\.am"/>
497         </fileset>
498     </copy>
500     <!-- GTK -->
501     <copy todir="${dist}"> <fileset dir="${gtk}/etc"/> </copy>
502     <copy file="${gtk}/share/themes/MS-Windows/gtk-2.0/gtkrc" todir="${dist}/etc/gtk-2.0"/>
503     <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/gtk-2.0"/> </copy>
504     <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/glib-2.0"/> </copy>
505     <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/locale"/> </copy>
506     <copy todir="${dist}">
507         <fileset dir="share">
508           <exclude name=".*\.am"/>
509         </fileset>
510     </copy>
511     <copy todir="${dist}/share"> <fileset dir="${gtk}/share/themes"/> </copy>
512     <mkdir dir="${dist}/data"/>
513     <mkdir dir="${dist}/locale"/>
514     <mkdir dir="${dist}/modules"/>
515     <mkdir dir="${dist}/plugins"/>
516     <copy file="${gtk}/bin/gdb.exe" todir="${dist}"/>
518     <!-- PERL -->
519     <copy file="${gtk}/perl/bin/perl58.dll" todir="${dist}"/>
521     <!-- PYTHON -->
522     <copy file="${gtk}/python/python25.dll" todir="${dist}"/>
523     <copy file="${gtk}/python/python.exe" todir="${dist}/python"/>
524     <copy todir="${dist}/python"> <fileset dir="${gtk}/python/Lib"/> </copy>
525     <copy todir="${dist}/python"> <fileset dir="${gtk}/python/DLLs"/> </copy>
526     <copy todir="${dist}/python"> <fileset dir="${gtk}/python/Scripts"/> </copy>
528   </target>
533   <!--
534   ########################################################################
535   ## T A R G E T    :    D I S T - A L L
536   ########################################################################
537   -->
538   <target name="dist-all" depends="dist,linkinkview"
539         description="generate the distribution, along with inkview" >
541     <copy file="${build}/inkview.exe" todir="${dist}"/>
542     <copy file="${build}/inkview.dbg" todir="${dist}"/>
543   </target>
548   <!--
549   ########################################################################
550   ## T A R G E T    :    C L E A N
551   ########################################################################
552   -->
553   <target name="clean"
554         description="clean up.  deleting build and distro dirs" >
556     <delete dir="${build}"/>
557     <delete dir="${dist}"/>
558     <delete file="build.dep"/>
559     <delete file="config.h"/>
561   </target>
565 </project>
566 <!--
567 ########################################################################
568 ## E N D
569 ########################################################################
570 -->