Code

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