Build

Dependencies

svg2swf uses the following software:

* modified versions of these libraries are provided in the svg2swf CVS.
** svg2swf includes patch files for libming

The list includes libsvg-cairo and cairo because Flash requires bitmaps to be used in patterns and svg2swf uses these libraries to convert SVG pattern content into bitmap image data.

Linux and Windows

The description of the Windows build assumes the user has access to a GNU/Linux development environment or something like cygwin or gnuwin32. If not, then use equivalent tools available on Windows.

Commands that must be run as root will be marked with the prefix root>; commands that can be run as a normal user have the prefix >.

Create a directory for the build. This directory will be referred to using the $TOPDIR environment variable. The Windows build also defines an $INSTALLDIR environment variable which refers to the installation directory for the executables and dlls. For example,

> mkdir ~/svg2swf
> export TOPDIR=~/svg2swf
> cd $TOPDIR

Download the following sources packages from the downloads page:

The version numbers shown in brackets correspond to svg2swf version 0.5. An existing ming v0.4.3 source package can be patched using the 0.4.3.1 patch file. Extract the source packages to the $TOPDIR directory. Rename the sub-directories so that they only include the package name: svg2swf/, libsvg/, libsvg-cairo/, libcroco/ and ming/.

Download uriparser version 0.7.4. Extract the source package to the $TOPDIR directory and rename the directory to uriparser/.

Linux

Install the following packages using your package manager (e.g. YaST2 on SUSE). Make sure that you also have the *-devel packages installed.

Compile and install uriparser

> cd $TOPDIR/uriparser
> ./configure
> make
root> make install

Compile and install libcroco (you may find that you need to install some GNOME build utilities)

> cd $TOPDIR/libcroco
> ./configure
> make
root> make install

Compile and install libsvg.

> cd $TOPDIR/libsvg
> ./configure
> make
root> make install

Compile and install libsvg-cairo.

> cd $TOPDIR/libsvg-cairo
> ./configure
> make
root> make install

Compile and install libming. Check that zlib, png and freetype are enabled when running ./configure.

> cd $TOPDIR/ming
> ./configure
> make
root> make install

Compile and install svg2swf and the utilities.

> cd $TOPDIR/svg2swf
> ./configure
> make
root> make install

The end result will be the svg2swf, svg2png and svg2svg executables installed in /usr/local/bin.

Windows

The Microsoft Visual C++ 7.1 compiler is used to build on Windows.

Start by downloading the dependencies:

Download expat

> cd $TOPDIR
> wget http://downloads.sourceforge.net/expat/expat-2.0.1.tar.gz
> tar xzf expat-2.0.1.tar.gz
> mv expat-2.0.1 expat

Download libpng

> cd $TOPDIR
> wget http://prdownloads.sourceforge.net/libpng/lpng1234.zip?download
> unzip lpng1234.zip
> mv lpng1234 libpng

Download zlib

> cd $TOPDIR
> wget http://downloads.sourceforge.net/libpng/zlib-1.2.3.tar.gz
> tar xzf zlib-1.2.3.tar.gz
> mv zlib-1.2.3 zlib

Download glib

> cd $TOPDIR
> wget http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.18/glib-dev_2.18.4-1_win32.zip
> wget http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.18/glib_2.18.4-1_win32.zip
> mkdir glib
> cd glib
> unzip ../glib-dev_2.18.4-1_win32.zip
> unzip ../glib_2.18.4-1_win32.zip

Download libjpeg and create the config file

> cd $TOPDIR
> wget http://www.ijg.org/files/jpegsrc.v6b.tar.gz
> tar xzf jpegsrc.v6b.tar.gz
> mv jpeg-6b jpeg
> cp jpeg/jconfig.vc jpeg/jconfig.h

Download freetype

> cd $TOPDIR
> wget http://downloads.sourceforge.net/gnuwin32/freetype-2.3.5-1-bin.zip
> mkdir freetype
> cd freetype
> unzip ../freetype-2.3.5-1-bin.zip

Download libcurl

> cd $TOPDIR
> wget http://curl.haxx.se/download/curl-7.19.3.tar.gz
> tar xzf curl-7.19.3.tar.gz
> mv curl-7.19.3 curl

Download cairo and binary dependencies from the GTK+ Windows page.

> cd $TOPDIR
> wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo-dev_1.8.6-1_win32.zip
> wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/cairo_1.8.6-1_win32.zip
> mkdir cairo
> cd cairo
> unzip ../cairo-dev_1.8.6-1_win32.zip
> unzip ../cairo_1.8.6-1_win32.zip
> cd $TOPDIR
> wget http://www.zlib.net/zlib123-dll.zip
> wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/libpng_1.2.34-1_win32.zip
> wget http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/freetype-2.3.6.zip
> mkdir cairo-deps
> cd cairo-deps
> unzip ../zlib123-dll.zip
> unzip ../libpng_1.2.34-1_win32.zip
> unzip ../freetype-2.3.6.zip

The Visual C++ project files are in the $TOPDIR/svg2swf/win32/vc71 directory.

Open the solution file svg2swf.sln

Open the libpng project and remove pngvcrd.c from the sources folder.

Select either the Debug or Release configuration and build the solution.

Copy the binaries to the $INSTALLDIR directory. Replace Release with Debug below if you compiled using the Debug configuration.

> cp $TOPDIR/cairo/bin/libcairo-2.dll $INSTALLDIR
> cp $TOPDIR/cairo-deps/bin/libpng12-0.dll $INSTALLDIR
> cp $TOPDIR/cairo-deps/zlib1.dll $INSTALLDIR
> cp $TOPDIR/freetype/bin/freetype6.dll $INSTALLDIR
> cp $TOPDIR/glib/bin/libglib-2.0-0.dll $INSTALLDIR
> cp $TOPDIR/svg2swf/win32/vc71/Release/svg2swf/svg2swf.exe $INSTALLDIR
> cp $TOPDIR/svg2swf/win32/vc71/Release/svg2png/svg2png.exe $INSTALLDIR
> cp $TOPDIR/svg2swf/win32/vc71/Release/svg2svg/svg2svg.exe $INSTALLDIR

Run svg2swf.exe, svg2png.exe and svg2svg.exe in the $INSTALLDIR directory and you should see the usage message appearing.


Get svg2swf at SourceForge.net. Fast, secure and Free Open Source software downloads Valid XHTML 1.0 Strict