build.xml revision d8fa3c4faade9a5a8e7f79450544b1925e1ade41
<!--
* Inkscape build file.
*
* See buildtool.cpp for use.
*
* Authors:
* Bob Jamison
* Others
*
* Copyright (C) 2006-2008 Inkscape.org
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-->
<!--
########################################################################
## P R O J E C T : I N K S C A P E
########################################################################
-->
<project name="Inkscape" default="dist" basedir=".">
<description>
Build file for the Inkscape SVG editor. This file
was written for GTK-2.10 on Win32, but it should work
well for other types of builds with only minor adjustments.
</description>
<!-- set global properties for this build -->
<property environment="env"/>
<property name="version" value="0.46+devel"/>
<property name="src" location="src"/>
<property name="lib" location="lib"/>
<property name="build" location="build"/>
<property name="dist" location="inkscape"/>
<!-- Use these settings for the native compiler -->
<!-- -->
<property name="arch" value="mingw32-"/>
<property name="archutil" value=""/>
<property name="gtk" location="c:/devlibs"/>
<!-- -->
<!-- Use these settings for the cross compiler -->
<!--
<property name="arch" value="i686-pc-mingw32-"/>
<property name="archutil" value="${arch}"/>
<property name="gtk" location="/target"/>
-->
<!-- Extra properties -->
<property name="refresh" value="false"/>
<!--
########################################################################
## T A R G E T : I N I T
########################################################################
-->
<target name="init"
description=
"Do all preparatory tasks, like make directories and copy files">
<!-- example of the <pkg-config> task
query can be cflags, libs, or both
prefix overrides the value of prefix="" in the file
the result of this entry can be later used as ${gtkmm}
-->
<!--
query="both" property="gtkmm" prefix="${gtk}"/>
-->
<mkdir dir="${build}"/>
<mkdir dir="${build}/java"/>
<mkdir dir="${build}"/>
<mkdir dir="${dist}"/>
<copy file="${src}/helper/sp-marshal.h.mingw"
tofile="${src}/helper/sp-marshal.h"/>
<copy file="${src}/helper/sp-marshal.cpp.mingw"
tofile="${src}/helper/sp-marshal.cpp"/>
<makefile file="inkscape_version.h">
#define INKSCAPE_VERSION "${version}"
</makefile>
<makefile file="config.h">
#ifndef _CONFIG_H_
#define _CONFIG_H_
#ifndef WIN32
#define WIN32
#endif
/*######################################
## This is for require-config.h, whose
## purpose I cannot fathom.
######################################*/
#define PACKAGE_TARNAME
/*######################################
#### RESOURCE DIRECTORIES
######################################*/
#define INKSCAPE_DATADIR "."
#define PACKAGE_LOCALE_DIR "locale"
/*######################################
#### OTHER DEFINITIONS
######################################*/
#define GETTEXT_PACKAGE "inkscape"
#define PACKAGE_STRING VERSION
#define HAVE_GETOPT_H 1
#define HAVE_STRING_H 1
#define HAVE_LIBINTL_H 1
#define HAVE_MALLOC_H 1
#define HAVE_STDLIB_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_INTTYPES_H 1
#define ENABLE_LCMS 1
#define ENABLE_NLS 1
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
/* keep binreloc off */
#define BR_PTHREADS 0
#undef ENABLE_BINRELOC
/* CairoPDF options */
#define HAVE_CAIRO_PDF 1
#define PANGO_ENABLE_ENGINE 1
#define RENDER_WITH_PANGO_CAIRO 1
#define HAVE_GTK_WINDOW_FULLSCREEN 1
/* internal interpreter */
#define WITH_PYTHON 1
/* shared whiteboard */
#define WITH_INKBOARD 1
#define HAVE_SSL 1
/* use poppler for pdf import? */
#define HAVE_POPPLER 1
#define HAVE_POPPLER_CAIRO 1
/* do we want bitmap manipulation? */
#define WITH_IMAGE_MAGICK 1
/* Allow reading WordPerfect? */
#define WITH_LIBWPG 1
#endif /* _CONFIG_H_ */
</makefile>
</target>
<!--
########################################################################
## T A R G E T : T O U C H A B O U T
########################################################################
-->
<target name="touchabout"
description="update the modification time of aboutdialog.cpp">
<!-- not good <touch file="${src}/ui/dialog/aboutdialog.cpp"/> -->
<!-- better -->
<delete file="${build}/obj/ui/dialog/aboutdialog.o"/>
</target>
<!--
########################################################################
## T A R G E T : C O M P I L E
########################################################################
-->
<target name="compile" depends="init"
description="compile the source to .o" >
<!-- Compile from source to build -->
<cc cc="${arch}gcc" cxx="${arch}g++"
destdir="${build}/obj"
continueOnError="true"
refreshCache="${refresh}">
<fileset dir="${src}">
<!-- THINGS TO EXCLUDE -->
<exclude name="2geom/chebyshev.cpp"/>
<exclude name="ast/.*"/>
<exclude name="bonobo/.*"/>
<exclude name="deptool.cpp"/>
<exclude name="test-all.cpp"/>
<exclude name="display/testnr.cpp"/>
<exclude name="display/bezier-utils-test.cpp"/>
<exclude name="dom/odf/SvgOdg.cpp"/>
<exclude name="extension/implementation/plugin.cpp"/>
<exclude name="extension/script/bindtest.cpp"/>
<exclude name="extension/script/cpptest.cpp"/>
<exclude name="extract-uri-test.cpp"/>
<exclude name="helper/units-test.cpp"/>
<!-- exclude name="inkview.cpp"/-->
<exclude name="libnr/test-nr.cpp"/>
<exclude name="libnr/test-nr-main.cpp"/>
<exclude name="libnr/testnr.cpp"/>
<exclude name="libnr/in-svg-plane-test.cpp"/>
<exclude name="libnr/nr-compose-reference.cpp"/>
<exclude name="libnr/nr-compose-test.cpp"/>
<exclude name="libnr/nr-matrix-test.cpp"/>
<exclude name="libnr/nr-point-fns-test.cpp"/>
<exclude name="libnr/nr-rotate-fns-test.cpp"/>
<exclude name="libnr/nr-rotate-test.cpp"/>
<exclude name="libnr/nr-scale-test.cpp"/>
<exclude name="libnr/nr-translate-test.cpp"/>
<exclude name="libnr/nr-types-test.cpp"/>
<exclude name="livarot/Path-test.cpp"/>
<exclude name="mod360-test.cpp"/>
<exclude name="trace/potrace/potest.cpp"/>
<exclude name="round-test.cpp"/>
<exclude name="sp-gradient-test.cpp"/>
<exclude name="svg/test-svg.cpp"/>
<exclude name="svg/test-svg-main.cpp"/>
<exclude name="utest/.*"/>
<exclude name="widgets/test-widgets.cpp"/>
<exclude name="xml/quote-test.cpp"/>
<exclude name="xml/repr-action-test.cpp"/>
<exclude name="xml/test-xml.cpp"/>
<exclude name="xml/test-xml-main.cpp"/>
<exclude name="io/streamtest.cpp"/>
<!--JABBER-->
<exclude name="pedro/pedrogui.cpp"/>
<exclude name="pedro/pedrogui.h"/>
<!--WHITEBOARD-->
<exclude name="ui/dialog/session-player.cpp"/>
<exclude name="ui/dialog/whiteboard-connect.cpp"/>
<exclude name="ui/dialog/whiteboard-sharewithchat.cpp"/>
<exclude name="ui/dialog/whiteboard-sharewithuser.cpp"/>
<exclude name="dialogs/whiteboard-connect-dialog.cpp"/>
<exclude name="dialogs/whiteboard-common-dialog.cpp"/>
<exclude name="dialogs/whiteboard-sharewithchat-dialog.cpp"/>
<exclude name="dialogs/whiteboard-sharewithuser-dialog.cpp"/>
<exclude name="jabber_whiteboard/node-tracker.cpp"/>
<exclude name="jabber_whiteboard/node-utilities.cpp"/>
<!--OVERLAP-->
<exclude name="removeoverlap/placement_SolveVPSC.cpp"/>
<exclude name="removeoverlap/placement_SolveVPSC.h"/>
<exclude name="removeoverlap/test.cpp"/>
<exclude name="removeoverlap/remove_rectangle_overlap-test.cpp"/>
<exclude name="removeoverlap/remove_rectangle_overlap-test.h"/>
</fileset>
<excludeinc dir="${src}">
</excludeinc>
<flags>
-Wall -Wformat -Werror=format-security -W -Wpointer-arith -Wcast-align -Wsign-compare -Woverloaded-virtual -Wswitch
-O2
-mms-bitfields
</flags>
<defines>
-DVERSION=\"${version}\"
-DHAVE_CONFIG_H
-D_INTL_REDIRECT_INLINE
-DHAVE_SSL
-DRELAYTOOL_SSL="static const int libssl_is_present=1; static int __attribute__((unused)) libssl_symbol_is_present(char *s){ return 1; }" <!-- inkboard -->
</defines>
<includes>
-I${gtk}/include
<!-- GTK / GTKMM -->
-I${gtk}/include/glibmm-2.4
-I${gtk}/include/pangomm-1.4
-I${gtk}/include/cairomm-1.0
<!-- OTHER -->
-I${gtk}/include/libwpg-0.1
-I${gtk}/include/libwpd-0.8
<!-- PERL -->
<!-- PYTHON -->
<!-- JAVA -->
</includes>
</cc>
</target>
<!--
########################################################################
## T A R G E T : L I B
########################################################################
-->
<!-- set depends to "compile,java" if you want to test that -->
<target name="lib" depends="compile"
description="create a static library">
<staticlib command="${archutil}ar crsv"
file="${build}/libinkscape.a">
<fileset dir="${build}/obj">
<exclude name="main.o"/>
<exclude name="winmain.o"/>
<exclude name="inkview.o"/>
</fileset>
</staticlib>
</target>
<!--
########################################################################
## T A R G E T : I 1 8 N
########################################################################
-->
<target name="i18n" depends="compile"
description="compile gettext .po files to .mo">
<msgfmt todir="${build}/locale" owndir="true"
out="LC_MESSAGES/inkscape.mo">
<fileset dir="po">
</fileset>
</msgfmt>
</target>
<!--
########################################################################
## T A R G E T : L I N K
########################################################################
-->
<target name="link" depends="lib"
description="link objects and library to create executable">
<rc command="${archutil}windres"
file="${src}/inkscape.rc"
out="${build}/inkres.o">
<flags>
--include-dir=${src}
</flags>
</rc>
strip="true" symfile="${build}/inkscape.dbg"
stripcommand="${archutil}strip"
objcopycommand="${archutil}objcopy">
<flags>
-mwindows
</flags>
<fileset dir="${build}">
<include name="inkres.o"/>
<include name="libinkscape.a"/>
</fileset>
<libs>
-L${gtk}/lib
-lpoppler-cairo -lpoppler-glib -lpoppler.dll
-lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4
-latkmm-1.6 -lpangomm-1.4 -lsigc-2.0
-lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0
-lgdk_pixbuf-2.0
-lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0
-lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0
-lgsl
<!-- PERL -->
<!-- PYTHON -->
${gtk}/bin/libxml2.dll
${gtk}/bin/libxslt.dll
-lMagick++ -lWand -lMagick
-lssl -lcrypto
-lgc
-lws2_32 -lintl -lgdi32 -lcomdlg32 -lm
<!-- 2geom -->
<!-- -l2geom -->
</libs>
</link>
</target>
<!--
########################################################################
## T A R G E T : L I N K I N K V I E W
########################################################################
-->
<target name="linkinkview" depends="lib"
description="link objects and library to create Inkview executable">
<rc command="${archutil}windres"
file="${src}/inkview.rc"
out="${build}/inkviewres.o">
<flags>
--include-dir=${src}
</flags>
</rc>
strip="true" symfile="${build}/inkview.dbg"
stripcommand="${archutil}strip"
objcopycommand="${archutil}objcopy">
<flags>
</flags>
<fileset dir="${build}">
<include name="inkviewres.o"/>
<include name="libinkscape.a"/>
</fileset>
<libs>
-L${gtk}/lib
-lpoppler-cairo -lpoppler-glib -lpoppler.dll
-lgtkmm-2.4 -lgdkmm-2.4 -lglibmm-2.4
-latkmm-1.6 -lpangomm-1.4 -lsigc-2.0
-lgtk-win32-2.0 -lgdk-win32-2.0 -latk-1.0
-lgdk_pixbuf-2.0
-lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lpango-1.0
-lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -lcairo -lcairomm-1.0
<!-- PERL -->
<!-- PYTHON -->
${gtk}/bin/libxml2.dll
${gtk}/bin/libxslt.dll
-lMagick++ -lWand -lMagick
-lssl -lcrypto
-lgc -mwindows
-lws2_32 -lintl -lgdi32 -lcomdlg32 -lm
</libs>
</link>
</target>
<!--
########################################################################
## T A R G E T : D I S T
########################################################################
-->
<target name="dist" depends="link,i18n"
description="generate the distribution directory with all needed files">
<!-- Create the distribution directory -->
<copy file="AUTHORS" todir="${dist}"/>
<copy file="COPYING" todir="${dist}"/>
<copy file="NEWS" todir="${dist}"/>
<copy file="README" todir="${dist}"/>
<copy file="TRANSLATORS" todir="${dist}"/>
<!--<copy file="${gtk}/bin/libexpat.dll" tofile="${dist}/xmlparse.dll"/>-->
<!-- MSGFMT files -->
<copy todir="${dist}">
<fileset dir="${build}/locale">
<exclude name=".*\.am"/>
</fileset>
</copy>
<!-- GTK -->
<copy todir="${dist}"> <fileset dir="${gtk}/etc"/> </copy>
<copy todir="${dist}">
<fileset dir="share">
<exclude name=".*\.am"/>
</fileset>
</copy>
<mkdir dir="${dist}/data"/>
<mkdir dir="${dist}/locale"/>
<mkdir dir="${dist}/modules"/>
<mkdir dir="${dist}/plugins"/>
<!-- Necessary to run extensions on windows if it is not in the path -->
<!-- PERL -->
<!-- PYTHON -->
gtk-icon-sizes = "gtk-menu=16,16:gtk-small-toolbar=16,16:gtk-large-toolbar=24,24:gtk-dnd=32,32:inkscape-decoration=16,16"
gtk-toolbar-icon-size = small-toolbar
# disable images in buttons. i've only seen ugly delphi apps use this feature.
gtk-button-images = 0
# the office apps use them heavily, though.
gtk-menu-images = 1
# use the win32 button ordering instead of the GNOME HIG one, where applicable
gtk-alternative-button-order = 1
style "msw-default"
{
GtkWidget::interior-focus = 1
GtkOptionMenu::indicator-size = { 9, 5 }
GtkOptionMenu::indicator-spacing = { 7, 5, 2, 2 }
GtkSpinButton::shadow-type = in
# Owen and I disagree that these should be themable
#GtkUIManager::add-tearoffs = 0
#GtkComboBox::add-tearoffs = 0
GtkComboBox::appears-as-list = 1
GtkComboBox::focus-on-click = 0
GOComboBox::add_tearoffs = 0
GtkTreeView::allow-rules = 0
GtkTreeView::expander-size = 12
GtkExpander::expander-size = 12
GtkScrolledWindow::scrollbar_spacing = 1
GtkSeparatorMenuItem::horizontal-padding = 2
engine "wimp"
{
}
}
class "*" style "msw-default"
</makefile>
</target>
<!--
########################################################################
## T A R G E T : JAVAC
########################################################################
-->
<target name="javac" depends="init"
description="compile java binding classes">
</target>
<!--
########################################################################
## T A R G E T : JAR
########################################################################
-->
<target name="jar" depends="javac"
description="pack java classes and resources into a jar file">
</target>
<!--
########################################################################
## T A R G E T : BINDDIST
########################################################################
-->
<target name="binddist" depends="jar"
description="pack java classes and resources into a jar file">
</target>
<!--
########################################################################
## T A R G E T : BINDCLEAN
########################################################################
-->
<target name="bindclean" depends=""
description="clean up java binding classes">
<delete dir="${build}/java"/>
</target>
<!--
########################################################################
## T A R G E T : D I S T - A L L
########################################################################
-->
<target name="dist-all" depends="dist"
description="generate the distribution, along with inkview" >
</target>
<!--
########################################################################
## T A R G E T : C L E A N
########################################################################
-->
<target name="clean" depends="bindclean"
description="clean up. deleting build and distro dirs" >
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete file="build.dep"/>
<delete file="config.h"/>
</target>
</project>
<!--
########################################################################
## E N D
########################################################################
-->