--- config_office/configure.in        7 May 2007 09:28:02 -0000       1.189.2.5
+++ config_office/configure.in        18 Jun 2007 19:34:47 -0000
@@ -434,6 +434,9 @@
 AC_ARG_WITH(system-altlinuxhyph,
 [  --with-system-altlinuxhyph    Use ALTLinuxhyph already on system
 ],,)
+AC_ARG_WITH(system-libsvg,
+[  --with-system-libsvg   Use libsvg already on system
+],,)
 AC_ARG_WITH(system-mozilla,
 [  --with-system-mozilla   Use mozilla already on system. Note that some
                           components cannot be built against a contemporary
@@ -3061,6 +3085,24 @@
 AC_SUBST(LIBXML_LIBS)

 dnl ===================================================================
+dnl Check for system libsvg
+dnl ===================================================================
+AC_MSG_CHECKING([which libsvg to use])
+if test -n "$with_system_libsvg" -o -n "$with_system_libs" && \
+        test "$with_system_libsvg" != "no"; then
+    AC_MSG_RESULT([external])
+    SYSTEM_LIBSVG=YES
+    PKG_CHECK_MODULES( LIBSVG, libsvg )
+else
+    AC_MSG_RESULT([internal])
+    SYSTEM_LIBSVG=NO
+    BUILD_TYPE="$BUILD_TYPE LIBSVG"
+fi
+AC_SUBST(SYSTEM_LIBSVG)
+AC_SUBST(LIBSVG_CFLAGS)
+AC_SUBST(LIBSVG_LIBS)
+
+dnl ===================================================================
 dnl Check for system python
 dnl ===================================================================
 if test "$_os" = "Darwin" && test "$with_system_python" != "no"; then
--- config_office/set_soenv.in        7 May 2007 09:28:12 -0000       1.127.2.5
+++ config_office/set_soenv.in        18 Jun 2007 19:34:51 -0000
@@ -1825,6 +1825,9 @@
 ToFile( "LIBXML_CFLAGS",     "@LIBXML_CFLAGS@",    "e" );
 ToFile( "LIBXML_LIBS",       "@LIBXML_LIBS@",      "e" );
 ToFile( "SYSTEM_EXPAT",      "@SYSTEM_EXPAT@",     "e" );
+ToFile( "SYSTEM_LIBSVG",     "@SYSTEM_LIBSVG@",    "e" );
+ToFile( "LIBSVG_CFLAGS",     "@LIBSVG_CFLAGS@",    "e" );
+ToFile( "LIBSVG_LIBS",       "@LIBSVG_LIBS@",      "e" );
 ToFile( "SYSTEM_DB",         "@SYSTEM_DB@",        "e" );
 ToFile( "DB_VERSION",        "@DB_VERSION@",       "e" );
 ToFile( "DB_INCLUDES",       "@DB_INCLUDES@",      "e" );
--- /dev/null	Mon Jun 25 17:19:05 2007
+++ libsvg/makefile.mk	Sat Jun 23 08:36:38 2007
@@ -0,0 +1,76 @@
+#*************************************************************************
+#
+#   OpenOffice.org - a multi-platform office productivity suite
+#
+#   $RCSfile$
+#
+#   $Revision$
+#
+#   last change: $Author$ $Date$
+#
+#   The Contents of this file are made available subject to
+#   the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+#     GNU Lesser General Public License Version 2.1
+#     =============================================
+#     Copyright 2005 by Sun Microsystems, Inc.
+#     901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+#     This library is free software; you can redistribute it and/or
+#     modify it under the terms of the GNU Lesser General Public
+#     License version 2.1, as published by the Free Software Foundation.
+#
+#     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., 59 Temple Place, Suite 330, Boston,
+#     MA  02111-1307  USA
+#
+#*************************************************************************
+
+PRJ=.
+
+PRJNAME=libsvg
+TARGET=libsvg
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE :	settings.mk
+
+# --- Files --------------------------------------------------------
+
+.IF "$(SYSTEM_LIBSVG)" == "YES"
+@all:
+	@echo "Using system libsvg..."
+.ENDIF
+
+.IF "$(SYSTEM_JPEG)" != "YES"
+INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/external
+.ENDIF
+
+.IF "$(SYSTEM_LIBXML)" == "YES"
+INCPRE+=$(LIBXML_CFLAGS)
+.ELSE
+INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/external
+.ENDIF
+
+INCPRE+=`pkg-config --cflags libpng`
+
+TARFILE_NAME=libsvg-0.1.4
+PATCH_FILE_NAME=$(TARFILE_NAME).diff
+BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS)
+BUILD_DIR=src
+ADDITIONAL_FILES=    \
+	src$/makefile.mk
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : set_ext.mk
+.INCLUDE :	target.mk
+.INCLUDE :	tg_ext.mk
+
--- /dev/null	Mon Jun 25 17:19:05 2007
+++ libsvg/prj/build.lst	Sat Jun 23 08:33:11 2007
@@ -0,0 +1,3 @@
+lsvg	libsvg	: soltools LIBXML2:libxml2 JPEG:jpeg NULL
+lsvg	libsvg	usr1	-	all	lsvg_mkout NULL
+lsvg	libsvg	nmake	-	all	lsvg_libsvg NULL
--- /dev/null	Mon Jun 25 17:19:05 2007
+++ libsvg/prj/d.lst	Thu Jun 21 13:55:52 2007
@@ -0,0 +1,4 @@
+mkdir: %_DEST%\inc%_EXT%\libsvg
+..\%__SRC%\misc\build\libsvg*\src\svg.h %_DEST%\inc%_EXT%\libsvg
+..\%__SRC%\lib\*.a %_DEST%\lib%_EXT%\*.a
+..\%__SRC%\slb\*.lib %_DEST%\lib%_EXT%\*.lib
--- /dev/null	2007-05-04 12:54:36.000000000 +0200
+++ libsvg/libsvg-0.1.4.diff	2007-07-13 16:28:39.000000000 +0200
@@ -0,0 +1,111 @@
+*** misc/libsvg-0.1.4/src/makefile.mk	Fri Jul 13 16:28:39 2007
+--- misc/build/libsvg-0.1.4/src/makefile.mk	Fri Jul 13 16:28:30 2007
+***************
+*** 1 ****
+! dummy
+--- 1,50 ----
+! EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
+! 
+! PRJ=..$/..$/..$/..$/..
+! 
+! PRJNAME=libsvg
+! TARGET=svglib
+! ENABLE_EXCEPTIONS=TRUE
+! LIBTARGET=NO
+! 
+! .INCLUDE :  settings.mk
+! 
+! SLOFILES= \
+! 	$(SLO)$/svg_ascii.obj \
+! 	$(SLO)$/svg_attribute.obj \
+! 	$(SLO)$/svg.obj \
+! 	$(SLO)$/svg_color.obj \
+! 	$(SLO)$/svg_element.obj \
+! 	$(SLO)$/svg_gradient.obj \
+! 	$(SLO)$/svg_group.obj \
+! 	$(SLO)$/svg_hash.obj \
+! 	$(SLO)$/svg_image.obj \
+! 	$(SLO)$/svg_length.obj \
+! 	$(SLO)$/svg_paint.obj \
+! 	$(SLO)$/svg_parser.obj \
+! 	$(SLO)$/svg_parser_libxml.obj \
+! 	$(SLO)$/svg_path.obj \
+! 	$(SLO)$/svg_pattern.obj \
+! 	$(SLO)$/svg_str.obj \
+! 	$(SLO)$/svg_style.obj \
+! 	$(SLO)$/svg_text.obj \
+! 	$(SLO)$/svg_transform.obj
+! 
+! .IF "$(SYSTEM_JPEG)" != "YES"
+! INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/external
+! .ENDIF
+! 
+! .IF "$(SYSTEM_LIBXML)" == "YES"
+! INCPRE+=$(LIBXML_CFLAGS)
+! .ELSE
+! INCPRE+=$(SOLARVER)$/$(UPD)$/$(INPATH)$/inc$/external
+! .ENDIF
+! 
+! INCPRE+=`pkg-config --cflags libpng`
+! 
+! 
+! LIB1ARCHIV=$(LB)$/lib$(TARGET).a
+! LIB1TARGET=$(SLB)$/$(TARGET).lib
+! LIB1OBJFILES= $(SLOFILES)
+! 
+! .INCLUDE :  target.mk
+*** misc/libsvg-0.1.4/src/svg_ascii.c	Mon Apr 11 17:32:10 2005
+--- misc/build/libsvg-0.1.4/src/svg_ascii.c	Fri Jul 13 16:28:30 2007
+***************
+*** 32,38 ****
+   * MT safe
+   */
+  
+! #ifdef HAVE_CONFIG_H
+  #include <config.h>
+  #endif
+  
+--- 32,38 ----
+   * MT safe
+   */
+  
+! #if 0
+  #include <config.h>
+  #endif
+  
+*** misc/libsvg-0.1.4/src/svgint.h	Fri Jun  3 18:17:59 2005
+--- misc/build/libsvg-0.1.4/src/svgint.h	Fri Jul 13 16:28:30 2007
+***************
+*** 23,29 ****
+  #ifndef SVGINT_H
+  #define SVGINT_H
+  
+! #ifdef LIBSVG_EXPAT
+  
+  #include <expat.h>
+  #include "svg_hash.h"
+--- 23,29 ----
+  #ifndef SVGINT_H
+  #define SVGINT_H
+  
+! #if 0
+  
+  #include <expat.h>
+  #include "svg_hash.h"
+***************
+*** 47,53 ****
+  
+  #endif
+  
+! #include "config.h"
+  #include "svg_version.h"
+  #include "svg.h"
+  #include "svg_ascii.h"
+--- 47,53 ----
+  
+  #endif
+  
+! // #include "config.h"
+  #include "svg_version.h"
+  #include "svg.h"
+  #include "svg_ascii.h"
