Code

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