[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1580
Date       : Thu Jul 27 20:36:01 BST 2006

Changed paths:
   M /Trunk/XaraLX/Makefile.am
   M /Trunk/XaraLX/autogen.sh
   M /Trunk/XaraLX/configure.in
   M /Trunk/XaraLX/filters/SVGFilter/Makefile.am
   M /Trunk/XaraLX/filters/SVGFilter/configure.in
   A /Trunk/XaraLX/xarlib/ExpandXar
   A /Trunk/XaraLX/xarlib/ExpandXar/expandxar.cpp
   M /Trunk/XaraLX/xarlib/Makefile.am
   A /Trunk/XaraLX/xarlib/Xar.pc.in

More work on building SVGFilter in tree


Diff:
Index: Trunk/XaraLX/filters/SVGFilter/configure.in
===================================================================
--- Trunk/XaraLX/filters/SVGFilter/configure.in	(revision 1579)
+++ Trunk/XaraLX/filters/SVGFilter/configure.in	(revision 1580)
@@ -41,6 +41,8 @@
     fi
 ])
 
+LocalXarLibEnable="no"
+
 # -----------------------------------------------------------------------------
 # wxWidgets check
 
@@ -91,7 +93,13 @@
 
 # Set up our XarLib build flags
 # Change this to be hopefully like wxWidgets above
-PKG_CHECK_MODULES(XARLIB, [Xar])
+# Only do this if we are not inside a local build tree
+if test "$LocalXarLibEnable" != "yes"; then
+	PKG_CHECK_MODULES(XARLIB, [Xar])
+else
+	XARLIB_CFLAGS=""
+	XARLIB_LIBS=""
+fi
 
 # Setup our build flags (if not set by user)
 CPPFLAGS="-Wall -Wno-unknown-pragmas -g -fexceptions $DEBUG_FLAGS -DUSE_STD_ALLOC -DUSE_XARLIB"
@@ -162,6 +170,9 @@
 if test `echo $srcdir | cut -c1` != "/"; then
 	TOPDIR="../$srcdir";
 fi
+
+AM_CONDITIONAL(LOCAL_XARLIB_ENABLE, [test "$LocalXarLibEnable" = "yes"])
+
 AC_SUBST(TOPDIR)
 AC_SUBST(XARLIB_CFLAGS)
 AC_SUBST(XARLIB_LIBS)
Index: Trunk/XaraLX/filters/SVGFilter/Makefile.am
===================================================================
--- Trunk/XaraLX/filters/SVGFilter/Makefile.am	(revision 1579)
+++ Trunk/XaraLX/filters/SVGFilter/Makefile.am	(revision 1580)
@@ -1,11 +1,22 @@
 bin_PROGRAMS = svgfilter svgfilterui
 
+# Note TOPDIR seems to have one too many ".."s in to work. So don't use it
+if LOCAL_XARLIB_ENABLE
+XARLIB_CFLAGS2 = -DEXCLUDE_FROM_XARLIB -DUSE_NATIVE_XLONG -DBUILDSHADOWS -DOLD_MATRIX_TRANSFORMATIONS -DVECTOR_STROKING -DEXCLUDE_FROM_XARLIB -DNEW_SHADOW_RENDER -DNO_XARACMS \
+				-DNEW_FEATURES -DSHOWPORTNOTE -DDO_EXPORT \
+				-I$(top_srcdir)/../.. -I$(top_srcdir)/../../xarlib -I$(top_srcdir)/../../PreComp -I$(top_srcdir)/../../Kernel -I$(top_srcdir)/../../wxOil -I$(top_srcdir)/../../GDraw
+XARLIB_LIBS2 = -L../../xarlib/.libs -lXar
+else
+XARLIB_CFLAGS2 =
+XARLIB_LIBS2 =
+endif
+
 # the application source, library search path, and link libraries
 svgfilter_SOURCES = svgfilter.cpp svgfilter.h import.cpp svgimporter.cpp \
 		    svgimporter.h export.cpp utils.cpp utils.h styles.cpp \
 		    styles.h version.h
-svgfilter_CPPFLAGS = $(XARLIB_CFLAGS) $(LIBXML2_CFLAGS)
-svgfilter_LDADD = $(XARLIB_LIBS) $(LIBXML2_LIBS)
+svgfilter_CPPFLAGS = $(XARLIB_CFLAGS) $(XARLIB_CFLAGS2) $(LIBXML2_CFLAGS)
+svgfilter_LDADD = $(XARLIB_LIBS) $(XARLIB_LIBS2) $(LIBXML2_LIBS)
 
 svgfilterui_SOURCES = svgfilterui.cpp svgfilterui.h svgexportdialog.cpp \
 		      svgexportdialog.h version.h
Index: Trunk/XaraLX/autogen.sh
===================================================================
--- Trunk/XaraLX/autogen.sh	(revision 1579)
+++ Trunk/XaraLX/autogen.sh	(revision 1580)
@@ -2,4 +2,5 @@
 
 AUTORECONF=${AUTORECONF:-autoreconf}
 
-${AUTORECONF} -f -i -s
+${AUTORECONF} -f -i
+( cd filters/SVGFilter ; ${AUTORECONF} -f -i )
Index: Trunk/XaraLX/xarlib/Xar.pc.in
===================================================================
--- Trunk/XaraLX/xarlib/Xar.pc.in	(revision 0)
+++ Trunk/XaraLX/xarlib/Xar.pc.in	(revision 1580)
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libXar
+Description: Xara file loading \ saving library
+Version: @VERSION@
+Libs: -L${libdir} -lXar
+Cflags: -DEXCLUDE_FROM_XARLIB -DUSE_NATIVE_XLONG -DBUILDSHADOWS -DOLD_MATRIX_TRANSFORMATIONS -DVECTOR_STROKING -DEXCLUDE_FROM_XARLIB -DNEW_SHADOW_RENDER -DNO_XARACMS -DNEW_FEATURES -DSHOWPORTNOTE -DDO_EXPORT -I${includedir}/@PACKAGE@
Index: Trunk/XaraLX/xarlib/Makefile.am
===================================================================
--- Trunk/XaraLX/xarlib/Makefile.am	(revision 1579)
+++ Trunk/XaraLX/xarlib/Makefile.am	(revision 1580)
@@ -9,11 +9,12 @@
 XARLIBFLAGS = \
 	-DUSE_NATIVE_XLONG -DBUILDSHADOWS -DOLD_MATRIX_TRANSFORMATIONS \
 	-DVECTOR_STROKING -DEXCLUDE_FROM_XARLIB -DNEW_SHADOW_RENDER -DNO_XARACMS \
-	-DNEW_FEATURES -DSHOWPORTNOTE -DDO_EXPORT
+	-DNEW_FEATURES -DSHOWPORTNOTE -DDO_EXPORT \
+	-I$(TOPDIR)/xarlib -I$(TOPDIR)/PreComp -I$(TOPDIR)/Kernel -I$(TOPDIR)/wxOil -I$(TOPDIR)/GDraw 
 
 # make sure this does NOT have our include files in the path
 # xarlib needs to be first
-libXar_la_CXXFLAGS = -I$(TOPDIR)/xarlib -I$(TOPDIR)/PreComp -I$(TOPDIR)/Kernel -I$(TOPDIR)/wxOil -I$(TOPDIR)/GDraw $(XARLIBFLAGS)
+libXar_la_CXXFLAGS = $(XARLIBFLAGS)
 
 #Extra libraries
 #libXar_la_LDFLAGS = @GTK_LIBS@
@@ -70,80 +71,81 @@
 	ensure.cpp \
 	xarlib.cpp
 
-if FALSE
-pkginclude_HEADERS = PreComp/camtypes.h \
-	wxOil/basestr.h \
-	wxOil/camresource.h \
-	wxOil/camstring.h \
-	wxOil/ccobject.h \
-	wxOil/compatdef.h \
-	wxOil/errors.h \
-	wxOil/exception.h \
-	wxOil/fixmem.h \
-	wxOil/fixst128.h \
-	wxOil/fixst256.h \
-	wxOil/fixstr16.h \
-	wxOil/fixstr32.h \
-	wxOil/fixstr64.h \
-	wxOil/fixstr8.h \
-	wxOil/handles.h \
-	wxOil/hardwaremanager.h \
-	wxOil/memblk.h \
-	wxOil/memdebug.h \
-	wxOil/memory.h \
-	wxOil/mfccontainer.h \
-	wxOil/pathname.h \
-	wxOil/stdwx.h \
-	wxOil/unicdman.h \
-	wxOil/varstr.h \
-	Kernel/attr.h \
-	Kernel/ccfile.h \
-	Kernel/ccmaths.h \
-	Kernel/ccpanose.h \
-	Kernel/coord.h \
-	Kernel/cxfarrow.h \
-	Kernel/cxfcols.h \
-	Kernel/cxfdash.h \
-	Kernel/cxfdefs.h \
-	Kernel/cxfile.h \
-	Kernel/cxfmap.h \
-	Kernel/cxfrec.h \
-	Kernel/cxfrech.h \
-	Kernel/cxftags.h \
-	Kernel/doccoord.h \
-	Kernel/docrect.h \
-	Kernel/f16spec.h \
-	Kernel/fixed16.h \
-	Kernel/fixed.h \
-	Kernel/fttyplis.h \
-	Kernel/list.h \
-	Kernel/listitem.h \
-	Kernel/macros.h \
-	Kernel/matrix.h \
-	Kernel/pathproc.h \
-	Kernel/paths.h \
-	Kernel/pathtype.h \
-	Kernel/pathutil.h \
-	Kernel/rechcomp.h \
-	Kernel/taglists.h \
-	Kernel/vector.h \
-	Kernel/xlong.h \
-	Kernel/zdeflate.h \
-	Kernel/zinflate.h \
-	Kernel/zlib.h \
-	Kernel/zstream.h \
-	Kernel/zutil.h \
-	xarlib/camelot.h \
-	xarlib/ensure.h \
-	xarlib/gconsts.h \
-	xarlib/xarlib.h
+pkginclude_HEADERS = \
+	../PreComp/camtypes.h \
+	../wxOil/basestr.h \
+	../wxOil/camresource.h \
+	../wxOil/camstring.h \
+	../wxOil/ccobject.h \
+	../wxOil/compatdef.h \
+	../wxOil/errors.h \
+	../wxOil/exception.h \
+	../wxOil/fixmem.h \
+	../wxOil/fixst128.h \
+	../wxOil/fixst256.h \
+	../wxOil/fixstr16.h \
+	../wxOil/fixstr32.h \
+	../wxOil/fixstr64.h \
+	../wxOil/fixstr8.h \
+	../wxOil/handles.h \
+	../wxOil/hardwaremanager.h \
+	../wxOil/memblk.h \
+	../wxOil/memdebug.h \
+	../wxOil/cammemory.h \
+	../wxOil/mfccontainer.h \
+	../wxOil/pathname.h \
+	../wxOil/stdwx.h \
+	../wxOil/unicdman.h \
+	../wxOil/varstr.h \
+	../GDraw/gconsts.h \
+	../Kernel/attr.h \
+	../Kernel/ccfile.h \
+	../Kernel/ccmaths.h \
+	../Kernel/ccpanose.h \
+	../Kernel/coord.h \
+	../Kernel/cxfarrow.h \
+	../Kernel/cxfcols.h \
+	../Kernel/cxfdash.h \
+	../Kernel/cxfdefs.h \
+	../Kernel/cxfile.h \
+	../Kernel/cxfmap.h \
+	../Kernel/cxfrec.h \
+	../Kernel/cxfrech.h \
+	../Kernel/cxftags.h \
+	../Kernel/doccoord.h \
+	../Kernel/docrect.h \
+	../Kernel/f16spec.h \
+	../Kernel/fixed16.h \
+	../Kernel/fixed.h \
+	../Kernel/fttyplis.h \
+	../Kernel/list.h \
+	../Kernel/listitem.h \
+	../Kernel/macros.h \
+	../Kernel/matrix.h \
+	../Kernel/pathproc.h \
+	../Kernel/paths.h \
+	../Kernel/pathtype.h \
+	../Kernel/pathutil.h \
+	../Kernel/rechcomp.h \
+	../Kernel/taglists.h \
+	../Kernel/vector.h \
+	../Kernel/xlong.h \
+	../Kernel/zdeflate.h \
+	../Kernel/zinflate.h \
+	../Kernel/zlib.h \
+	../Kernel/zstream.h \
+	../Kernel/zutil.h \
+	camelot.h \
+	ensure.h \
+	xarlib.h
 
 bin_PROGRAMS = expandxar
-
 expandxar_SOURCES = ExpandXar/expandxar.cpp
 expandxar_LDADD = libXar.la $(WX_LIBS)
+expandxar_CXXFLAGS = $(XARLIBFLAGS)
 
 pkgconfigdir = $(libdir)/pkgconfig
+#if FALSE
 pkgconfig_DATA = Xar.pc
+#endif
 
-endif
Index: Trunk/XaraLX/xarlib/ExpandXar/expandxar.cpp
===================================================================
--- Trunk/XaraLX/xarlib/ExpandXar/expandxar.cpp	(revision 0)
+++ Trunk/XaraLX/xarlib/ExpandXar/expandxar.cpp	(revision 1580)
@@ -0,0 +1,319 @@
+// ExpandXar.cpp : A console application for uncompressing and fixing Xar format files.
+//
+
+#include <iostream>
+#include "xarlib.h"
+
+/****************************************************************************
+
+ExpandXar Overview
+
+This utility is designed for the diagnosis and fixing of Xar format files. 
+It reads the input file and creates an uncompressed version of the file as 
+the output.  This allows the file to be more easily examined to determine 
+what is wrong.
+
+If the file is incomplete or contains corrupt data (e.g. a record size is 
+larger than the remaining data in the file) then the import is stopped and 
+the output file is terminated correctly.  This involves writing out TAG_UP 
+records to balance the tree depth followed by a TAG_ENDOFFILE.  This should 
+recover the maximum possible from truncated documents.  However it is 
+possible that a document could be truncated at a point where a record is 
+missing that is required for loading (e.g. Having a TAG_CONTOURCONTROLLER 
+record but no TAG_CONTOUR record).  In this case, the output file being 
+uncompressed makes it possible to strip the file back to the last complete 
+object.
+
+Any fractal fill attributes that have coincident control points are changed 
+to avoid the "Spurious Internal Error" message when loaded into XaraX.
+
+This utility will be extended as required to fix other reported problems.
+
+Due to current limitations of the XarLib library, atomic, essential and 
+compression records are not passed to the HandleRecord function.  The code 
+keeps track of the record numbers written so it can replace the skipped 
+over records with dummy ones to ensure that the record references later in 
+the file don't get messed up.
+
+****************************************************************************/
+
+
+// This structure holds the info we need in the HandleRecord function
+typedef struct MyData
+{
+	CXarExport* pExporter;
+	INT32 NextRecord;
+	INT32 Depth;
+} MyData;
+
+/****************************************************************************
+
+>	BOOL FixFractalPoints(CXaraFileRecord* pRecord)
+
+	Author:		Gerry
+	Created:	19/01/2005
+
+	Inputs:		pRecord		- pointer to a CXaraFileRecord
+	Returns:	TRUE if the record is modified, FALSE if left alone
+	Purpose:	Fixes degenerate fractal fill and transparency attributes.
+				Any such attributes that have all three control points 
+				coincident are modified by moving the endpoints slightly
+
+****************************************************************************/
+
+bool FixFractalPoints(CXaraFileRecord* pRecord)
+{
+	DocCoord StartPoint;
+	DocCoord EndPoint;
+	DocCoord EndPoint2;
+
+	BOOL ok = TRUE;
+	
+	if (ok) ok = pRecord->ReadCoord(&StartPoint);
+	if (ok) ok = pRecord->ReadCoord(&EndPoint);
+	if (ok) ok = pRecord->ReadCoord(&EndPoint2);
+
+	if (ok)
+	{
+		if (StartPoint == EndPoint &&
+			StartPoint == EndPoint2)
+		{
+			// We have a degenerate fill mesh that will cause the dreaded 
+			// "Spurious Internal Error" message on loading into XaraX1
+
+			// Fix the EndPoints to not be coincident
+			EndPoint.x++;
+			EndPoint2.y++;
+
+			pRecord->ResetReadPos();	// The read and write pos are the same
+
+			// Write the three points back into the record
+			if (ok) ok = pRecord->WriteCoord(StartPoint);
+			if (ok) ok = pRecord->WriteCoord(EndPoint);
+			if (ok) ok = pRecord->WriteCoord(EndPoint2);
+
+			return(TRUE);				// Indicate we have changed the record (not that anyone cares)
+		}
+	}
+
+	// No changes
+	return(FALSE);
+}
+
+
+
+
+/****************************************************************************
+
+>	HRESULT HandleRecord(void* pMagic, CXaraFileRecord* pRecord)
+
+	Author:		Gerry
+	Created:	21/01/2005
+
+	Inputs:		pMagic		- pointer to our MyData structure
+				pRecord		- pointer to a CXaraFileRecord
+	Returns:	
+	Purpose:	Handles the records from the Xar format import process
+
+****************************************************************************/
+
+BOOL HandleRecord(void* pMagic, CXaraFileRecord* pRecord)
+{
+	// Get our data structure pointer
+	MyData* pData = (MyData*) pMagic;
+
+	INT32 ThisNum = pRecord->GetRecordNumber();
+	INT32 ThisTag = pRecord->GetTag();
+
+	// While this record isn't the one we should be writing
+	while (pData->NextRecord < ThisNum)
+	{
+		// Write a dummy record so the record references don't get screwed
+		pData->pExporter->WriteZeroSizedRecord(9999);
+
+		// And increment the record counter
+		(pData->NextRecord)++;
+	}
+
+	BOOL bDoWrite = TRUE;
+
+	switch (ThisTag)
+	{
+		case TAG_DOWN:
+			(pData->Depth)++;
+			break;
+
+		case TAG_UP:
+			(pData->Depth)--;
+			break;
+
+		case TAG_FRACTALFILL:
+		case TAG_FRACTALTRANSPARENTFILL:
+		case TAG_NOISEFILL:
+		case TAG_NOISETRANSPARENTFILL:
+			FixFractalPoints(pRecord);
+			break;
+	}
+
+	if (bDoWrite)
+	{
+		// Then write out this record
+		pData->pExporter->WriteRecord(pRecord);
+
+		// And increment the record counter
+		(pData->NextRecord)++;
+	}
+
+	return(S_OK);
+}
+
+
+BOOL ProcessFile(TCHAR* pInputFile, TCHAR* pOutputFile)
+{
+	// First we ask the library to create a Xar importer
+	CXarImport* pImporter = XarLibrary::CreateImporter();
+	if (!pImporter)
+	{
+		wxFprintf(stderr, _T("CreateImporter failed
"));
+		return(FALSE);
+	}
+
+	// Call PrepareImport passing the name of the output file
+	BOOL ok = pImporter->PrepareImport(pInputFile);
+	if (!ok)
+	{
+		wxFprintf(stderr, _T("PrepareImport failed
"));
+		return(FALSE);
+	}
+
+	MyData Data;
+	Data.pExporter = NULL;
+	Data.NextRecord = 2;
+	Data.Depth = 0;
+
+	// Ask the library to create a Xar Exporter object
+	Data.pExporter = XarLibrary::CreateExporter();
+	if (!Data.pExporter)
+	{
+		wxFprintf(stderr, _T("CreateExporter failed
"));
+		return(FALSE);
+	}
+
+	// Call StartExport passing the desired filename of the Xar file
+	ok = Data.pExporter->StartExport(pOutputFile);
+	if (!ok)
+	{
+		wxFprintf(stderr, _T("StartExport failed
"));
+		return(FALSE);
+	}
+
+	// Create a CXaraFileRecord object for the document header record
+	CXaraFileRecord Rec(TAG_FILEHEADER);
+	if (ok) ok = Rec.Init();
+	if (ok) ok = Rec.WriteBuffer((BYTE*)"CXN",3);
+	if (ok) ok = Rec.WriteUINT32(1);					// File size (doesn't actually care though zero may cause an error on loading)
+	if (ok) ok = Rec.WriteUINT32(0);					// Native/Web link ID
+	if (ok) ok = Rec.WriteUINT32(0);					// Precompression flags
+	if (ok) ok = Rec.WriteASCII(_T("ExpandXar"));		// Producer
+	if (ok) ok = Rec.WriteASCII(_T("0.01"));			// Producer version
+	if (ok) ok = Rec.WriteASCII(_T(""));				// Producer build
+	if (ok) ok = Data.pExporter->WriteRecord(&Rec);
+
+	// Set up our record handler function
+	ok = pImporter->SetHandler(&Data, ::HandleRecord);
+	if (!ok)
+	{
+		wxFprintf(stderr, _T("SetHandler failed
"));
+		return(FALSE);
+	}
+
+	// Do the import
+	ok = pImporter->DoImport();
+	if (!ok)
+	{
+		wxFprintf(stderr, _T("DoImport failed
"));
+	}
+
+	if (Data.Depth > 0)
+	{
+		wxFprintf(stderr, _T("Fixing tree depth (%d)
"));
+		while (Data.Depth > 0)
+		{
+			ok = Data.pExporter->WriteZeroSizedRecord(TAG_UP);
+			(Data.Depth)--;
+		}
+	}
+
+	// Clean up the importer
+	delete pImporter;
+
+	// Write the end of file record because it doesn't get passed to HandleRecord
+	ok = Data.pExporter->WriteZeroSizedRecord(TAG_ENDOFFILE);
+
+	delete Data.pExporter;
+
+	return(TRUE);
+}
+
+
+/****************************************************************************
+
+>	int main(int argc, char* argv[])
+
+	Author:		Gerry
+	Created:	21/01/2005
+
+	Inputs:		argc		- number of parameters on command line
+				argv[]		- array of parameter strings
+	Returns:	
+	Purpose:	The main entry point of the code.
+
+****************************************************************************/
+
+int main(int argc, char* argv[])
+{
+	if (argc < 2)
+	{
+		wxFprintf(stderr, _T("Usage : ExpandXar <input file> <output file>
"));
+		return 1;
+	}
+
+#if wxUSE_UNICODE
+	wxChar **wxArgv = new wxChar *[argc + 1];
+	
+	{
+		int n;
+
+		for (n = 0; n < argc; n++ )
+		{
+			wxMB2WXbuf warg = wxConvertMB2WX(argv[n]);
+			wxArgv[n] = wxStrdup(warg);
+		}
+
+		wxArgv[n] = NULL;
+	}
+#else // !wxUSE_UNICODE
+	#define wxArgv argv
+#endif // wxUSE_UNICODE/!wxUSE_UNICODE
+
+	int RetVal = 0;
+
+	if (!ProcessFile(wxArgv[1], wxArgv[2]))
+	{
+		RetVal = 1;
+	}
+
+#if wxUSE_UNICODE
+	{
+		for ( int n = 0; n < argc; n++ )
+			free(wxArgv[n]);
+
+		delete [] wxArgv;
+	}
+#endif // wxUSE_UNICODE
+
+	wxUnusedVar(argc);
+	wxUnusedVar(argv);
+	
+	return RetVal;
+}

Property changes on: Trunk/XaraLX/xarlib/ExpandXar/expandxar.cpp
___________________________________________________________________
Name: svn:executable
   + *

Index: Trunk/XaraLX/configure.in
===================================================================
--- Trunk/XaraLX/configure.in	(revision 1579)
+++ Trunk/XaraLX/configure.in	(revision 1580)
@@ -2,6 +2,8 @@
 AC_CANONICAL_TARGET
 AM_INIT_AUTOMAKE(XaraLX, 0.7)
 
+AC_PREFIX_PROGRAM( pkg-config )
+
 # BinReloc sets CFLAGS and CXXFLAGS, so we have to undo this
 inCFLAGS=$CFLAGS
 inCXXFLAGS=$CXXFLAGS
@@ -38,6 +40,13 @@
                              [Enable build of the xarlib filter library]),
               XarLibEnable="$enableval", XarLibEnable="no")
 
+# Note that as each filter is a separate package, if you got your code from svn you will need to
+# do "autoreconf -f -i" in filters/SVGFilter (and all the others); the tarballs should be OK
+AC_ARG_ENABLE(filters,
+              AS_HELP_STRING([--enable-filters],
+                             [Enable build of the filters]),
+              FiltersEnable="$enableval", FiltersEnable="no")
+
 OPT_FLAGS34="-fno-strict-aliasing"
 WARN_FLAGS34="-Wstrict-aliasing=2"
 
@@ -355,12 +364,20 @@
 	BUILDRESFLAGS="-s $BUILDRESFLAGS"
 fi
 
+# Force XarLibEnable on if we are to build the filters
+if test "$FiltersEnable" = "yes"; then
+	XarLibEnable="yes"
+	# Add each filter below here
+	AC_CONFIG_SUBDIRS([filters/SVGFilter])
+fi
+
 AM_CONDITIONAL(PRECOMPILE_ENABLE, [test "$PrecompileEnable" = "yes"])
 AM_CONDITIONAL(STATIC_ENABLE, [test "$StaticEnable" = "yes"])
 AM_CONDITIONAL(DARWIN_LINK, [test "$DarwinLink" = "yes"])
 AM_CONDITIONAL(INTERNATIONAL_ENABLE, [test "$InternationalEnable" = "yes"])
 AM_CONDITIONAL(SVNVERSION_ENABLE, [test "$SvnVersionEnable" = "yes"])
 AM_CONDITIONAL(XARLIB_ENABLE, [test "$XarLibEnable" = "yes"])
+AM_CONDITIONAL(FILTERS_ENABLE, [test "$FiltersEnable" = "yes"])
 
 AC_SUBST(TOPDIR)
 AC_SUBST(WX_LIBS)
@@ -375,4 +392,4 @@
 AC_SUBST(PODIR)
 AC_SUBST(BUILDRESFLAGS)
 
-AC_OUTPUT(Makefile PreComp/Makefile Kernel/Makefile wxOil/Makefile tools/Makefile wxXtra/Makefile xarlib/Makefile po/Makefile.in)
+AC_OUTPUT(Makefile PreComp/Makefile Kernel/Makefile wxOil/Makefile tools/Makefile wxXtra/Makefile xarlib/Makefile xarlib/Xar.pc po/Makefile.in)
Index: Trunk/XaraLX/Makefile.am
===================================================================
--- Trunk/XaraLX/Makefile.am	(revision 1579)
+++ Trunk/XaraLX/Makefile.am	(revision 1580)
@@ -15,12 +15,17 @@
 	XARLIB_DIR = xarlib
 endif
 
+FILTERS_DIRS =
+if FILTERS_ENABLE
+	FILTERS_DIRS = filters/SVGFilter
+endif
+
 # Do not compile po directory if WXRC is broken (gentoo wxWidgets 2.6.3.2)
 # Leave the '#po' on the end to keep automake quiet
 if INTERNATIONAL_ENABLE
-SUBDIRS = $(PRECOMPILE_DIR) wxXtra wxOil Kernel tools $(XARLIB_DIR) po
+SUBDIRS = $(PRECOMPILE_DIR) wxXtra wxOil Kernel tools $(XARLIB_DIR) $(FILTERS_DIRS) po
 else
-SUBDIRS = $(PRECOMPILE_DIR) wxXtra wxOil Kernel tools $(XARLIB_DIR)
+SUBDIRS = $(PRECOMPILE_DIR) wxXtra wxOil Kernel tools $(XARLIB_DIR) $(FILTERS_DIRS)
 endif
 
 # We clean these here not in the wxOil makefile to prevent a loop


Xara