Code

added comments. updated version
[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 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="Create the build directory structure used by compile">
66     <mkdir dir="${build}"/>
67     <mkdir dir="${dist}"/>
68     <copy file="${src}/helper/sp-marshal.h.mingw"
69           tofile="${src}/helper/sp-marshal.h"/>
70     <copy file="${src}/helper/sp-marshal.cpp.mingw"
71           tofile="${src}/helper/sp-marshal.cpp"/>
72     <makefile file="inkscape_version.h">
73     #define INKSCAPE_VERSION "${version}+devel"
74     </makefile>
75     <makefile file="config.h">
76         #ifndef _CONFIG_H_
77         #define _CONFIG_H_
79         #ifndef WIN32
80         #define WIN32
81         #endif
83         /*######################################
84         ## This is for require-config.h, whose
85         ## purpose I cannot fathom.
86         ######################################*/
87         
88         #define PACKAGE_TARNAME
90         /*######################################
91         #### RESOURCE DIRECTORIES
92         ######################################*/
94         #define INKSCAPE_DATADIR       "."
95         #define PACKAGE_LOCALE_DIR     "locale"
98         /*######################################
99         #### OTHER DEFINITIONS
100         ######################################*/
102         #define GETTEXT_PACKAGE "inkscape"
104         #define PACKAGE_STRING                VERSION
106         #define HAVE_GETOPT_H                 1
107         #define HAVE_STRING_H                 1
108         #define HAVE_LIBINTL_H                1
109         #define HAVE_MALLOC_H                 1
110         #define HAVE_STDLIB_H                 1
111         #define HAVE_SYS_STAT_H               1
113         #define ENABLE_LCMS                   1
115         #define ENABLE_NLS                    1
116         #define HAVE_BIND_TEXTDOMAIN_CODESET  1
118         /* keep binreloc off */
119         #define BR_PTHREADS 0
120         #undef ENABLE_BINRELOC
122         /* CairoPDF options */
123         #define HAVE_CAIRO_PDF                1
124         #define PANGO_ENABLE_ENGINE           1
125         #define RENDER_WITH_PANGO_CAIRO       1
127         #define HAVE_GTK_WINDOW_FULLSCREEN    1
129         #define g_ascii_strtod fixed_g_ascii_strtod
131         #endif /* _CONFIG_H_ */
132     </makefile>
133   </target>
139   <!--
140   ########################################################################
141   ## T A R G E T    :    C O M P I L E
142   ########################################################################
143   -->
144   <target name="compile" depends="init"
145         description="compile the source to .o" >
147     <!-- Compile from source to build -->
148     <cc cc="${arch}gcc" cxx="${arch}g++"
149              destdir="${build}/obj">
150             <fileset dir="${src}">
151             <!-- THINGS TO EXCLUDE -->
152                 <exclude name="ast/.*"/>
153                 <exclude name="bonobo/.*"/>
154                 <exclude name="deptool.cpp"/>
155                 <exclude name="test-all.cpp"/>
156                 <exclude name="dialogs/filedialog-win32.cpp"/>
157                 <exclude name="display/testnr.cpp"/>
158                 <exclude name="display/bezier-utils-test.cpp"/>
159                 <exclude name="dom/jsdombind.cpp"/>
160                 <exclude name="dom/work/.*"/>
161                 <exclude name="dom/odf/SvgOdg.cpp"/>
162                 <exclude name="extension/api.cpp"/>
163                 <exclude name="extension/dxf2svg/.*"/>
164                 <exclude name="extension/internal/gnome.cpp"/>
165                 <exclude name="extension/script/bindtest.cpp"/>
166                 <exclude name="extension/script/cpptest.cpp"/>
167                 <exclude name="extension/plugin/.*"/>
168                 <exclude name="extract-uri-test.cpp"/>
169                 <exclude name="helper/units-test.cpp"/>
170                 <!-- exclude name="inkview.cpp"/-->
171                 <exclude name="libnr/test-nr.cpp"/>
172                 <exclude name="libnr/test-nr-main.cpp"/>
173                 <exclude name="libnr/testnr.cpp"/>
174                 <exclude name="libnr/in-svg-plane-test.cpp"/>
175                 <exclude name="libnr/nr-compose-reference.cpp"/>
176                 <exclude name="libnr/nr-compose-test.cpp"/>
177                 <exclude name="libnr/nr-matrix-test.cpp"/>
178                 <exclude name="libnr/nr-point-fns-test.cpp"/>
179                 <exclude name="libnr/nr-rotate-fns-test.cpp"/>
180                 <exclude name="libnr/nr-rotate-test.cpp"/>
181                 <exclude name="libnr/nr-scale-test.cpp"/>
182                 <exclude name="libnr/nr-translate-test.cpp"/>
183                 <exclude name="libnr/nr-types-test.cpp"/>
184                 <exclude name="livarot/Path-test.cpp"/>
185                 <exclude name="mod360-test.cpp"/>
186                 <exclude name="trace/potrace/potest.cpp"/>
187                 <exclude name="round-test.cpp"/>
188                 <exclude name="sp-gradient-test.cpp"/>
189                 <exclude name="svg/ftos.cpp"/>
190                 <exclude name="svg/test-svg.cpp"/>
191                 <exclude name="svg/test-svg-main.cpp"/>
192                 <exclude name="utest/.*"/>
193                 <exclude name="widgets/test-widgets.cpp"/>
194                 <exclude name="xml/quote-test.cpp"/>
195                 <exclude name="xml/repr-action-test.cpp"/>
196                 <exclude name="xml/test-xml.cpp"/>
197                 <exclude name="xml/test-xml-main.cpp"/>
198                 <exclude name="io/streamtest.cpp"/>
199             <!--JABBER-->
200                 <exclude name="pedro/pedrogui.cpp"/>
201                 <exclude name="pedro/pedrogui.h"/>
202                 <exclude name="pedro/work/.*"/>
203             <!--WHITEBOARD-->
204                 <exclude name="ui/dialog/session-player.cpp"/>
205                 <exclude name="ui/dialog/whiteboard-connect.cpp"/>
206                 <exclude name="ui/dialog/whiteboard-sharewithchat.cpp"/>
207                 <exclude name="ui/dialog/whiteboard-sharewithuser.cpp"/>
208                 <exclude name="dialogs/whiteboard-connect-dialog.cpp"/>
209                 <exclude name="dialogs/whiteboard-common-dialog.cpp"/>
210                 <exclude name="dialogs/whiteboard-sharewithchat-dialog.cpp"/>
211                 <exclude name="dialogs/whiteboard-sharewithuser-dialog.cpp"/>
212                 <exclude name="jabber_whiteboard/node-tracker.cpp"/>
213                 <exclude name="jabber_whiteboard/node-utilities.cpp"/>
214             <!--WHITEBOARD-->
215                 <exclude name="removeoverlap/placement_SolveVPSC.cpp"/>
216                 <exclude name="removeoverlap/placement_SolveVPSC.h"/>
217                 <exclude name="removeoverlap/test.cpp"/>
218                 <exclude name="removeoverlap/remove_rectangle_overlap-test.cpp"/>
219                 <exclude name="removeoverlap/remove_rectangle_overlap-test.h"/>
220             </fileset>
221         <flags>
222             -Wall -O3
223             -mms-bitfields
224         </flags>
225         <defines>
226             -DVERSION=\"${version}\"
227             -DHAVE_CONFIG_H
228             -DXP_WIN <!-- for JS -->
229                         -D_INTL_REDIRECT_INLINE
230             -DRELAYTOOL_SSL="static const int libssl_is_present=1; static int __attribute__((unused)) libssl_symbol_is_present(char *s){ return 1; }" <!-- inkboard -->
231             -DWITH_INKBOARD -DHAVE_SSL <!-- inkboard -->
232         </defines>
233         <includes>
234             -I${gtk}/include
235                         <!-- GTK / GTKMM -->
236             -I${gtk}/include/glibmm-2.4
237                     -I${gtk}/lib/glibmm-2.4/include
238             -I${gtk}/include/gtkmm-2.4
239                     -I${gtk}/lib/gtkmm-2.4/include
240             -I${gtk}/include/gdkmm-2.4
241                     -I${gtk}/lib/gdkmm-2.4/include
242             -I${gtk}/include/pangomm-1.4
243             -I${gtk}/include/atkmm-1.6
244             -I${gtk}/include/cairomm-1.0
245             -I${gtk}/include/sigc++-2.0
246                     -I${gtk}/lib/sigc++-2.0/include
247             -I${gtk}/include/gtk-2.0
248                     -I${gtk}/lib/gtk-2.0/include
249             -I${gtk}/include/atk-1.0
250                     -I${gtk}/include/pango-1.0
251             -I${gtk}/include/glib-2.0
252                     -I${gtk}/lib/glib-2.0/include
253                     <!-- OTHER -->
254             -I${gtk}/include/libxml2 
255                         -I${gtk}/include/freetype2
256                     -I${gtk}/include/cairo
257                     <!-- PERL -->
258                     -Wno-comment -I${gtk}/perl/lib/CORE
259                     <!-- PYTHON -->
260                     -I${gtk}/python/include
261         </includes>
262         </cc>
263   </target>
264   
266   <!--
267   ########################################################################
268   ## T A R G E T    :    L I B
269   ########################################################################
270   -->
271   <target name="lib" depends="compile"
272       description="create a static library">
273     <staticlib command="${archutil}ar crsv"
274            file="${build}/libinkscape.a">
275            <fileset dir="${build}/obj">
276                <exclude name="main,o"/>
277                <exclude name="winmain,o"/>
278                <exclude name="inkview,o"/>
279            </fileset>
280         </staticlib>
281   </target>
285   <!--
286   ########################################################################
287   ## T A R G E T    :    I 1 8 N
288   ########################################################################
289   -->
290   <target name="i18n" depends="compile"
291       description="compile gettext .po files to .mo">
293     <msgfmt todir="${build}/locale" owndir="true"
294          out="LC_MESSAGES/inkscape.mo">
295            <fileset dir="po">
296            </fileset>
297         </msgfmt>
298   </target>
304   <!--
305   ########################################################################
306   ## T A R G E T    :    L I N K
307   ########################################################################
308   -->
309   <target name="link" depends="lib"
310       description="link objects and library to create executable">
312     <rc command="${archutil}windres" 
313             file="${src}/inkscape.rc"
314             out="${build}/inkres.o">
315                 <flags>
316                 --include-dir=${src}
317                 </flags>
318         </rc>
319     <link command="${arch}g++" out="${build}/inkscape.exe"
320               strip="true" symfile="${build}/inkscape.dbg"
321               stripcommand="${archutil}strip"
322               objcopycommand="${archutil}objcopy"
323               >
324        <flags>
325        </flags>
326            <fileset dir="${build}">
327                <include name="inkres.o"/>
328                <include name="obj/main.o"/>
329                <include name="obj/winmain.o"/>
330                <include name="libinkscape.a"/>
331            </fileset>
332            <libs>
333                -L${gtk}/lib
334            -lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4
335            -latkmm-1.6 -lpangomm-1.4 -lsigc-2.0
336            -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0
337            -lgdk_pixbuf-2.0
338            -lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0
339            -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lcairo
340            <!-- PERL -->
341                    -L${gtk}/perl/lib/CORE -lperl58
342            <!-- PYTHON -->
343            -L${gtk}/python/libs -lpython24
344            ${gtk}/bin/libxml2.dll
345            ${gtk}/lib/iconv.lib
346            -lfreetype.dll -lfontconfig.dll
347            -llcms.dll
348            -lssl -lcrypto
349            -lpng -lpopt ${gtk}/lib/zdll.lib
350            -lgc -mwindows -lws2_32 -lintl -lm
351            </libs>
352         </link>
353   </target>
354   
359   <!--
360   ########################################################################
361   ## T A R G E T    :    L I N K I N K V I E W
362   ########################################################################
363   -->
364   <target name="linkinkview" depends="lib"
365         description="link objects and library to create Inkview executable">
367     <rc command="${archutil}windres" 
368             file="${src}/inkview.rc"
369             out="${build}/inkviewres.o">
370                 <flags>
371                 --include-dir=${src}
372                 </flags>
373         </rc>
374     <link command="${arch}g++" out="${build}/inkview.exe"
375               strip="true" symfile="${build}/inkview.dbg"
376               stripcommand="${archutil}strip"
377               objcopycommand="${archutil}objcopy"
378               >
379        <flags>
380        </flags>
381            <fileset dir="${build}">
382                < include name="inkviewres.o"/ >
383                <include name="obj/inkview.o"/>
384                <include name="libinkscape.a"/>
385            </fileset>
386            <libs>
387                -L${gtk}/lib
388            -lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4
389            -latkmm-1.6 -lpangomm-1.4 -lsigc-2.0
390            -lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0
391            -lgdk_pixbuf-2.0
392            -lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0
393            -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lcairo
394            <!-- PERL -->
395                    -L${gtk}/perl/lib/CORE -lperl58
396            <!-- PYTHON -->
397            -L${gtk}/python/libs -lpython24
398            ${gtk}/bin/libxml2.dll
399            ${gtk}/lib/iconv.lib
400            -lfreetype.dll -lfontconfig.dll
401            -llcms.dll
402            -lssl -lcrypto
403            -lpng -lpopt ${gtk}/lib/zdll.lib
404            -lgc -mwindows -lws2_32 -lintl -lm
405            </libs>
406         </link>
407   </target>
411   <!--
412   ########################################################################
413   ## T A R G E T    :    D I S T
414   ########################################################################
415   -->
416   <target name="dist" depends="link,i18n"
417       description="generate the distribution directory with all needed files">
419     <!-- Create the distribution directory -->
420     <copy file="${build}/inkscape.exe" todir="${dist}"/>
421     <copy file="${build}/inkscape.dbg" todir="${dist}"/>
422     <copy file="AUTHORS" todir="${dist}"/>
423     <copy file="COPYING" todir="${dist}"/>
424     <copy file="COPYING.LIB" todir="${dist}"/>
425     <copy file="NEWS" todir="${dist}"/>
426     <copy file="README" todir="${dist}"/>
427     <copy file="TRANSLATORS" todir="${dist}"/>
428     <copy file="${gtk}/bin/libatkmm-1.6-1.dll" todir="${dist}"/>
429     <copy file="${gtk}/bin/libglibmm-2.4-1.dll" todir="${dist}"/>
430     <copy file="${gtk}/bin/libgtkmm-2.4-1.dll" todir="${dist}"/>
431     <copy file="${gtk}/bin/libgdkmm-2.4-1.dll" todir="${dist}"/>
432     <copy file="${gtk}/bin/libpangomm-1.4-1.dll" todir="${dist}"/>
433     <copy file="${gtk}/bin/libcairomm-1.0-1.dll" todir="${dist}"/>
434     <copy file="${gtk}/bin/libsigc-2.0-0.dll" todir="${dist}"/>
435     <copy file="${gtk}/bin/freetype6.dll" todir="${dist}"/>
436     <copy file="${gtk}/bin/libatk-1.0-0.dll" todir="${dist}"/>
437     <copy file="${gtk}/bin/libgdk-win32-2.0-0.dll" todir="${dist}"/>
438     <copy file="${gtk}/bin/libgdk_pixbuf-2.0-0.dll" todir="${dist}"/>
439     <copy file="${gtk}/bin/libglib-2.0-0.dll" todir="${dist}"/>
440     <copy file="${gtk}/bin/libgmodule-2.0-0.dll" todir="${dist}"/>
441     <copy file="${gtk}/bin/libgobject-2.0-0.dll" todir="${dist}"/>
442     <copy file="${gtk}/bin/libgtk-win32-2.0-0.dll" todir="${dist}"/>
443     <copy file="${gtk}/bin/libgthread-2.0-0.dll" todir="${dist}"/>
444     <copy file="${gtk}/bin/libcairo-2.dll" todir="${dist}"/>
445     <copy file="${gtk}/bin/libpangocairo-1.0-0.dll" todir="${dist}"/>
446     <copy file="${gtk}/bin/libpango-1.0-0.dll" todir="${dist}"/>
447     <copy file="${gtk}/bin/libpangoft2-1.0-0.dll" todir="${dist}"/>
448     <copy file="${gtk}/bin/libpangowin32-1.0-0.dll" todir="${dist}"/>
449     <copy file="${gtk}/bin/freetype6.dll" todir="${dist}"/>
450     <copy file="${gtk}/bin/libfontconfig-1.dll" todir="${dist}"/>
451     <copy file="${gtk}/bin/libxml2.dll" todir="${dist}"/>
452     <copy file="${gtk}/bin/xmlparse.dll" todir="${dist}"/>
453     <copy file="${gtk}/bin/jpeg62.dll" todir="${dist}"/>
454     <copy file="${gtk}/bin/libpng13.dll" todir="${dist}"/>
455     <copy file="${gtk}/bin/libtiff3.dll" todir="${dist}"/>
456     <copy file="${gtk}/bin/msvcr70.dll" todir="${dist}"/>
457     <copy file="${gtk}/bin/msvcr71.dll" todir="${dist}"/>
458     <copy file="${gtk}/bin/zlib1.dll" todir="${dist}"/>
459     <copy file="${gtk}/bin/iconv.dll" todir="${dist}"/>
460     <copy file="${gtk}/bin/popt1.dll" todir="${dist}"/>
461     <copy file="${gtk}/bin/liblcms-1.dll" todir="${dist}"/>
462     <copy file="${gtk}/bin/intl.dll" todir="${dist}"/>
463     <copy file="${gtk}/bin/intl.dll" tofile="${dist}/libintl-2.dll"/>
465     <!-- MSGFMT files -->
466     <copy todir="${dist}">
467             <fileset dir="${build}/locale">
468                   <exclude name=".*\.am"/>
469                 </fileset>
470         </copy>
472     <!-- GTK -->
473     <copy todir="${dist}"> <fileset dir="${gtk}/etc"/> </copy>
474     <copy file="${gtk}/share/themes/MS-Windows/gtk-2.0/gtkrc" todir="${dist}/etc/gtk-2.0"/>
475     <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/gtk-2.0"/> </copy>
476     <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/glib-2.0"/> </copy>
477     <copy todir="${dist}/lib"> <fileset dir="${gtk}/lib/locale"/> </copy>
478     <copy todir="${dist}">
479             <fileset dir="share">
480                   <exclude name=".*\.am"/>
481                 </fileset>
482         </copy>
483     <copy todir="${dist}/share"> <fileset dir="${gtk}/share/themes"/> </copy>
484     <mkdir dir="${dist}/data"/>
485     <mkdir dir="${dist}/locale"/>
486     <mkdir dir="${dist}/modules"/>
487     <mkdir dir="${dist}/plugins"/>
488     <copy file="${gtk}/bin/gdb.exe" todir="${dist}"/>
490     <!-- PERL -->
491     <copy file="${gtk}/perl/bin/perl58.dll" todir="${dist}"/>
493     <!-- PYTHON -->
494     <copy file="${gtk}/python/python24.dll" todir="${dist}"/>
495     <copy file="${gtk}/python/python.exe" todir="${dist}/python"/>
496     <copy todir="${dist}/python"> <fileset dir="${gtk}/python/Lib"/> </copy>
497     <copy todir="${dist}/python"> <fileset dir="${gtk}/python/DLLs"/> </copy>
498     <copy todir="${dist}/python"> <fileset dir="${gtk}/python/Scripts"/> </copy>
500   </target>
505   <!--
506   ########################################################################
507   ## T A R G E T    :    D I S T - A L L
508   ########################################################################
509   -->
510   <target name="dist-all" depends="dist,linkinkview"
511         description="generate the distribution, along with inkview" >
513     <copy file="${build}/inkview.exe" todir="${dist}"/>
514     <copy file="${build}/inkview.dbg" todir="${dist}"/>
515   </target>
520   <!--
521   ########################################################################
522   ## T A R G E T    :    C L E A N
523   ########################################################################
524   -->
525   <target name="clean"
526         description="clean up.  deleting build and distro dirs" >
528     <delete dir="${build}"/>
529     <delete dir="${dist}"/>
530   </target>
534 </project>
535 <!--
536 ########################################################################
537 ## E N D
538 ########################################################################
539 -->