* modified versions of these libraries are provided in the
svg2swf project.
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 ~/svg2js
> export TOPDIR=~/svg2js
> cd $TOPDIR
Download the svg2js source package from the downloads page:
Download the following sources packages from the svg2swf downloads page:
The version numbers shown in brackets correspond to svg2js version 0.1. Extract the source packages to the $TOPDIR directory. Rename the sub-directories so that they only include the package name: svg2js/, libsvg/ and libcroco/.
Download uriparser version 0.7.4. Extract the source package to the $TOPDIR directory and rename the directory to uriparser/.
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 svg2js.
> cd $TOPDIR/svg2js
> ./configure
> make
root> make install
The end result will be the svg2js executable installed in /usr/local/bin.
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 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
The Visual C++ project files are in the $TOPDIR/svg2js/win32/vc71 directory.
Open the solution file svg2js.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/glib/bin/libglib-2.0-0.dll $INSTALLDIR
> cp $TOPDIR/svg2js/win32/vc71/Release/svg2js/svg2js.exe $INSTALLDIR
Run svg2js.exe in the $INSTALLDIR directory and you should see the usage message appearing.