Code

Warning cleanup
[inkscape.git] / build.xml
index 21c996d1842cee7040b2d5978de7c109ad69c884..e76307b2c8520c3d538f798bd2753a6da6972432 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -31,7 +31,7 @@
 ## P R O J E C T   :   I N K S C A P E
 ########################################################################
 -->
-<project name="Inkscape" default="dist" basedir=".">
+<project name="Inkscape" default="dist-inkscape" basedir=".">
     <description>
         Build file for the Inkscape SVG editor.  This file
         was written for GTK-2.10 on Win32, but it should work
@@ -52,7 +52,8 @@
   <!-- -->
   <property name="arch"          value="mingw32-"/>
   <property name="archutil"      value=""/>
-  <property name="devlibs"       location="c:/devlibs"/>
+  <property name="devlibs"       location="${env.DEVLIBS_PATH}"/>
+  <property name="cxxtest"       location="cxxtest"/>
   <!-- -->
 
   <!-- Use these settings for the cross compiler -->  
     <mkdir dir="${build}/java"/>
     <mkdir dir="${build}/java/classes"/>
     <mkdir dir="${build}/java/lib"/>
-
-    <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>
         /* Allow reading WordPerfect? */
         #define WITH_LIBWPG                   1
 
+        /* Do we support SVG Fonts? */
+        #define ENABLE_SVG_FONTS              1
+
         #endif /* _CONFIG_H_ */
     </makefile>
   </target>
   </target>
 
 
+  <!--
+  ########################################################################
+  ## T A R G E T    :    C X X T E S T
+  ########################################################################
+  -->
+  <target name="cxxtest" depends="init"
+        description="generate test files" >
+
+    <!-- Generate CxxTest files -->
+    <cxxtestpart command="python ${cxxtest}/cxxtestgen.py --have-eh"
+                 out="${src}/test-src.cpp">
+        <fileset dir="${src}">
+            <include name="attributes-test.h"/>
+            <include name="color-profile-test.h"/>
+            <include name="dir-util-test.h"/>
+            <include name="extract-uri-test.h"/>
+            <include name="mod360-test.h"/>
+            <include name="round-test.h"/>
+            <include name="sp-gradient-test.h"/>
+            <include name="sp-style-elem-test.h"/>
+            <include name="syle-test.h"/>
+            <include name="test-helpers.h"/>
+            <include name="verbs-test.h"/>
+        </fileset>
+    </cxxtestpart>
+    <cxxtestpart command="python ${cxxtest}/cxxtestgen.py --have-eh"
+                 out="${src}/display/test-display.cpp">
+        <fileset dir="${src}/display">
+            <include name="bezier-utils-test.h"/>
+            <include name="curve-test.h"/>
+        </fileset>
+    </cxxtestpart>
+    <cxxtestpart command="python ${cxxtest}/cxxtestgen.py --have-eh"
+                 out="${src}/helper/test-helper.cpp">
+        <fileset dir="${src}/helper">
+            <include name="units-test.h"/>
+        </fileset>
+    </cxxtestpart>
+    <cxxtestpart command="python ${cxxtest}/cxxtestgen.py --have-eh"
+                 out="${src}/libnr/test-nr.cpp">
+        <fileset dir="${src}/libnr">
+            <include name="nr-compose-test.h"/>
+            <include name="nr-types-test.h"/>
+            <include name="nr-translate-test.h"/>
+            <include name="nr-rotate-test.h"/>
+            <include name="nr-scale-test.h"/>
+            <include name="nr-point-fns-test.h"/>
+            <include name="nr-rotate-fns-test.h"/>
+            <include name="in-svg-plane-test.h"/>
+            <include name="nr-matrix-test.h"/>
+        </fileset>
+    </cxxtestpart>
+    <cxxtestpart command="python ${cxxtest}/cxxtestgen.py --have-eh"
+                 out="${src}/svg/test-svg.cpp">
+        <fileset dir="${src}/svg">
+            <include name="css-ostringstream-test.h"/>
+            <include name="stringstream-test.h"/>
+            <include name="svg-affine-test.h"/>
+            <include name="svg-color-test.h"/>
+            <include name="svg-length-test.h"/>
+            <include name="svg-path-geom-test.h"/>
+            <include name="svg-path-nr-test.h"/>
+        </fileset>
+    </cxxtestpart>
+    <cxxtestpart command="python ${cxxtest}/cxxtestgen.py --have-eh"
+                 out="${src}/util/test-util.cpp">
+        <fileset dir="${src}/util">
+            <include name="list-container-test.h"/>
+        </fileset>
+    </cxxtestpart>
+    <cxxtestpart command="python ${cxxtest}/cxxtestgen.py --have-eh"
+                 out="${src}/xml/test-xml.cpp">
+        <fileset dir="${src}/xml">
+            <include name="repr-action-test.h"/>
+            <include name="quote-test.h"/>
+        </fileset>
+    </cxxtestpart>
+    <cxxtestroot command="python ${cxxtest}/cxxtestgen.py" 
+                 out="${src}/test-main.cpp"
+                 template="${src}/selfname.tpl">
+        <fileset dir="${src}">
+            <include name="MultiPrinter.h"/>
+            <include name="PylogFormatter.h"/>
+            <include name="TRPIFormatter.h"/>
+        </fileset>
+    </cxxtestroot>
+  </target>
+
+
   <!--
   ########################################################################
   ## T A R G E T    :    C O M P I L E
   ########################################################################
   -->
-  <target name="compile" depends="init"
+  <target name="compile" depends="cxxtest"
         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}">
+             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="test-main.cpp"/>-->
+            <!--<exclude name="test-src.cpp"/>-->
             <exclude name="display/testnr.cpp"/>
             <exclude name="display/bezier-utils-test.cpp"/>
             <exclude name="dom/work/.*"/>
             <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.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="trace/potrace/potest.cpp"/>
             <exclude name="round-test.cpp"/>
             <exclude name="sp-gradient-test.cpp"/>
+            <exclude name="style-test.cpp"/>
             <exclude name="svg/ftos.cpp"/>
-            <exclude name="svg/test-svg.cpp"/>
+            <!--<exclude name="svg/test-svg.cpp"/>-->
             <exclude name="svg/test-svg-main.cpp"/>
+            <exclude name="svg/test-stubs.cpp"/>
             <exclude name="utest/.*"/>
+            <exclude name="util/list-container-test.cpp"/>
             <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.cpp"/>-->
             <exclude name="xml/test-xml-main.cpp"/>
             <exclude name="io/streamtest.cpp"/>
             <!--JABBER-->
             -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 -->
+            -DPOPPLER_NEW_GFXFONT <!-- poppler changed the api for 0.8.3 -->
         </defines>
         <includes>
             -I${devlibs}/include
             ${pcc.poppler}
             -I${devlibs}/include/gc
             ${pcc.libwpg-0.1} ${pcc.libwpg-stream-0.1}
+            -I${cxxtest}
             <!-- PERL -->
             <!-- -Wno-comment -I${devlibs}/perl/lib/CORE -->
             <!-- PYTHON -->
            <exclude name="main.o"/>
            <exclude name="winmain.o"/>
            <exclude name="inkview.o"/>
+           <!-- CxxTest -->
+           <exclude name="test-main.o"/>
+           <exclude name="test-src.o"/>
+           <exclude name="display/test-display.o"/>
+           <exclude name="helper/test-helper.o"/>
+           <exclude name="libnr/nr-compose-reference.o"/>
+           <exclude name="libnr/test-nr.o"/>
+           <exclude name="svg/test-svg.o"/>
+           <exclude name="util/test-util.o"/>
+           <exclude name="xml/test-xml.o"/>
        </fileset>
     </staticlib>
   </target>
            ${devlibs}/bin/libxml2.dll
            ${devlibs}/bin/libxslt.dll
            ${pcl.cairo} ${pcl.cairomm-1.0}
-                  ${pcl.libwpg-0.1} ${pcl.libwpg-stream-0.1}
+           ${pcl.libwpg-0.1} ${pcl.libwpg-stream-0.1}
            ${devlibs}/lib/iconv.lib
            ${pcl.ImageMagick++}
            ${pcl.fontconfig} ${pcl.freetype2}
            ${pcl.gsl}
            -lpng -ljpeg.dll -ltiff.dll -lpopt ${devlibs}/lib/zdll.lib
            -lgc
-                  -lws2_32 -lintl -lgdi32 -lcomdlg32 -lm
+           -lws2_32 -lintl -lgdi32 -lcomdlg32 -lm
        </libs>
     </link>
   </target>
               stripcommand="${archutil}strip"
               objcopycommand="${archutil}objcopy">
        <flags>
+           -mwindows
        </flags>
        <fileset dir="${build}">
            <include name="inkviewres.o"/>
        </fileset>
        <libs>
            -L${devlibs}/lib
-           -lpoppler-cairo -lpoppler-glib -lpoppler.dll 
-           ${pcl.gtkmm-2.4}
-           <!-- PERL -->
-           -L${devlibs}/perl/lib/CORE -lperl58
-           <!-- PYTHON -->
-           -L${devlibs}/python/libs -lpython25
+           ${pcl.poppler-cairo} ${pcl.poppler-glib} ${pcl.poppler} 
+           ${pcl.gtkmm-2.4}  ${pcl.pangoft2} ${pcl.gthread-2.0}
            ${devlibs}/bin/libxml2.dll
            ${devlibs}/bin/libxslt.dll
+           ${pcl.cairo} ${pcl.cairomm-1.0}
+           ${pcl.libwpg-0.1} ${pcl.libwpg-stream-0.1}
            ${devlibs}/lib/iconv.lib
-                  -lcairo.dll -lcairomm-1.0.dll
-           -lwpg-0.1.dll -lwpg-stream-0.1.dll
-           -lMagick++ -lWand -lMagick
-           -lfreetype.dll -lfontconfig.dll
-           -llcms.dll
+           ${pcl.ImageMagick++}
+           ${pcl.fontconfig} ${pcl.freetype2}
            -lssl -lcrypto
+           ${pcl.lcms}
+           ${pcl.gsl}
            -lpng -ljpeg.dll -ltiff.dll -lpopt ${devlibs}/lib/zdll.lib
-           -lgc -mwindows
-                  -lws2_32 -lintl -lgdi32 -lcomdlg32 -lm
+           -lgc
+           -lws2_32 -lintl -lgdi32 -lcomdlg32 -lm
        </libs>
     </link>
   </target>
 
   <!--
   ########################################################################
-  ## T A R G E T    :    D I S T
+  ## T A R G E T    :    L I N K C X X T E S T S
   ########################################################################
   -->
-  <target name="dist" depends="link,i18n"
+  <target name="linkcxxtests" depends="lib"
+      description="link objects and library to create executable">
+
+    <link command="${arch}g++" out="${build}/cxxtests.exe"
+              strip="true" symfile="${build}/cxxtests.dbg"
+              stripcommand="${archutil}strip"
+              objcopycommand="${archutil}objcopy">
+       <flags>
+       </flags>
+       <fileset dir="${build}">
+           <include name="obj/test-main.o"/>
+           <include name="obj/test-src.o"/>
+           <include name="obj/display/test-display.o"/>
+           <include name="obj/helper/test-helper.o"/>
+           <include name="obj/libnr/nr-compose-reference.o"/>
+           <include name="obj/libnr/test-nr.o"/>
+           <include name="obj/svg/test-svg.o"/>
+           <include name="obj/util/test-util.o"/>
+           <include name="obj/xml/test-xml.o"/>
+           <include name="libinkscape.a"/>
+       </fileset>
+       <libs>
+           -L${devlibs}/lib
+           ${pcl.poppler-cairo} ${pcl.poppler-glib} ${pcl.poppler} 
+           ${pcl.gtkmm-2.4}  ${pcl.pangoft2} ${pcl.gthread-2.0}
+           ${devlibs}/bin/libxml2.dll
+           ${devlibs}/bin/libxslt.dll
+           ${pcl.cairo} ${pcl.cairomm-1.0}
+           ${pcl.libwpg-0.1} ${pcl.libwpg-stream-0.1}
+           ${devlibs}/lib/iconv.lib
+           ${pcl.ImageMagick++}
+           ${pcl.fontconfig} ${pcl.freetype2}
+           -lssl -lcrypto
+           ${pcl.lcms}
+           ${pcl.gsl}
+           -lpng -ljpeg.dll -ltiff.dll -lpopt ${devlibs}/lib/zdll.lib
+           -lgc
+           -lws2_32 -lintl -lgdi32 -lcomdlg32 -lm
+       </libs>
+    </link>
+  </target>
+
+
+  <!--
+  ########################################################################
+  ## T A R G E T    :    D I S T B A S E
+  ########################################################################
+  -->
+  <target name="distbase" depends="i18n"
       description="generate the distribution directory with all needed files">
 
     <!-- Create the distribution directory -->
-    <copy todir="${dist}" file="${build}/inkscape.exe"/>
-       <copy todir="${dist}" file="${build}/inkscape.dbg"/>
     <copy todir="${dist}" file="AUTHORS"/>
     <copy todir="${dist}" file="COPYING"/>
     <copy todir="${dist}" file="COPYING.LIB"/>
     <copy todir="${dist}" file="${devlibs}/bin/libgobject-2.0-0.dll"/>
     <copy todir="${dist}" file="${devlibs}/bin/libgtk-win32-2.0-0.dll"/>
     <copy todir="${dist}" file="${devlibs}/bin/libgthread-2.0-0.dll"/>
+    <copy todir="${dist}" file="${devlibs}/bin/libgio-2.0-0.dll"/>
     <copy todir="${dist}" file="${devlibs}/bin/libcairo-2.dll"/>
     <copy todir="${dist}" file="${devlibs}/bin/libpoppler-3.dll"/>
     <copy todir="${dist}" file="${devlibs}/bin/libpangocairo-1.0-0.dll"/>
 
     # disable images in buttons. i've only seen ugly delphi apps use this feature.
     gtk-button-images = 0
+    
+    # disable the annoying beep in editable controls
+    gtk-error-bell = 0
 
     # enable/disable images in menus. most "stock" microsoft apps don't use these, except sparingly.
     # the office apps use them heavily, though.
   </target>
 
 
+  <!--
+  ########################################################################
+  ## T A R G E T    :    D I S T - I N K S C A P E
+  ########################################################################
+  -->
+  <target name="dist-inkscape" depends="link,distbase"
+      description="copy inkscape to the distribution directory">
+
+    <!-- Create the distribution directory -->
+    <copy todir="${dist}" file="${build}/inkscape.exe"/>
+    <copy todir="${dist}" file="${build}/inkscape.dbg"/>
+  </target>
+
+
+  <!--
+  ########################################################################
+  ## T A R G E T    :    D I S T - I N K V I E W
+  ########################################################################
+  -->
+  <target name="dist-inkview" depends="linkinkview,distbase"
+      description="copy inkview to the distribution directory">
+
+    <!-- Create the distribution directory -->
+    <copy todir="${dist}" file="${build}/inkview.exe"/>
+    <copy todir="${dist}" file="${build}/inkview.dbg"/>
+  </target>
+
+
+  <!--
+  ########################################################################
+  ## T A R G E T    :    C H E C K
+  ########################################################################
+  -->
+  <target name="check" depends="linkcxxtests,distbase"
+      description="perform unit tests">
+    <cxxtestrun command="${build}/cxxtests" workingdir="${dist}" />
+  </target>
+
+
   <!--
   ########################################################################
   ## T A R G E T    :    JAVAC
   ## T A R G E T    :    D I S T - A L L
   ########################################################################
   -->
-  <target name="dist-all" depends="dist"
+  <target name="dist-all" depends="dist-inkscape,dist-inkview"
         description="generate the distribution, along with inkview" >
+  </target>
+
+
 
-    <copy file="${build}/inkview.exe" todir="${dist}"/>
-    <copy file="${build}/inkview.dbg" todir="${dist}"/>
+
+  <!--
+  ########################################################################
+  ## T A R G E T    :    D I S T - A L L - C H E C K
+  ########################################################################
+  -->
+  <target name="dist-all-check" depends="dist-all,check"
+        description="generate the distribution, along with inkview and run cxxtests" >
   </target>
 
 
     <delete file="build.dep"/>
     <delete file="config.h"/>
 
+    <delete file="${src}/test-main.cpp"/>
+    <delete file="${src}/test-src.cpp"/>
+    <delete file="${src}/display/test-display.cpp"/>
+    <delete file="${src}/helper/test-helper.cpp"/>
+    <delete file="${src}/libnr/test-nr.cpp"/>
+    <delete file="${src}/svg/test-svg.cpp"/>
+    <delete file="${src}/util/test-util.cpp"/>
+    <delete file="${src}/xml/test-xml.cpp"/>
+
   </target>