OpenVG-0.7.0: InstallWindows.txt
These instructions assume you have Haskell and OpenGL /
OpenGLRaw packages working and have MinGW/MSYS installed and
are comfortable with them.
I don't use cabal-install - maybe Part 2 can be done with
cabal-install rather than invoking Setup.hs directly. You will
still need t install the C library first as per Part 1.
------------------------------------------------------------------
Part 1. The C library.
Download the ShivaVG C library from Sourceforge (version 0.2.1):
http://sourceforge.net/projects/shivavg/
Unzip ShivaVG-0.2.1.zip somewhere below msys/1.0, I use my home
directory:
C:/msys/1.0/home/stephen
Run msys and go to ShivaVG's src directory:
> cd ShivaVG-0.2.1/src
Compile with gcc directly - this is a hack but the makefile has
problems with MinGW/MSYS:
> gcc -O2 -c *.c -I../include/VG
That should build the *.o files.
> gcc -shared -o openvg32.dll *.o -Wl,--enable-stdcall-fixup,--out-implib,libopenvg32.a -lopengl32 -lglu32 -lgdi32 -lwinmm
That should create `openvg32.dll` and `libopenvg32.a`.
If you want you can put `libopenvg32.a` into your MinGW lib
directory, on my system it is here:
C:\MinGW\lib
... and copy the folder `vg` with the header files from
`shivavg-0.2.0\include` to the MinGW include directory, on my
system it is here:
C:\MinGW\include
If you do copy both that would have been the same outcome as running
`make install`.
You should now be able to build the Haskell binding to Shiva.
------------------------------------------------------------------
Part 2. The bindings.
I dropped the archive into my home directory
C:\msys\1.0\home\stephen
> tar xvfz OpenVGRaw-0.4.X.tar.gz
> cd OpenVGRaw-0.4.X
Run configure with extra options pointing to the vg header files
and the static library. Note you still have to supply these extra
options if you copied the headers and static library into the regular
MSYS locations (`lib` and `include`) - when you build with GHC the
GHC-specific version of GCC will be invoked (not the MinGW/MSYS
version). The GHC-specific GCC needs to know where the headers and
libs are.
On my system this is the configure command (note I haven't copied
the headers and lib into the respective standard MSYS locations).
Because strings represnting file paths are passed between programs
you need to use double-slash as a separator:
> runhaskell Setup.hs configure --extra-include-dirs=c:\\msys\\1.0\\home\\stephen\\ShivaVG-0.2.1\\include --extra-lib-dirs=c:\\msys\\1.0\\home\\stephen\\ShivaVG-0.2.1\\src
> runhaskell Setup.hs build
> runhaskell Setup.hs install
> runhaskell Setup.hs haddock
Do the same with the OpenVG code
> tar xvfz OpenVG-0.7.X.tar.gz
> cd OpenVG-0.7.X
> runhaskell Setup.hs configure
> runhaskell Setup.hs build
> runhaskell Setup.hs install
> runhaskell Setup.hs haddock
Finally try the example:
> cd demo
> runhaskell -lopenvg32 TestVgu.hs
Unfortunately building executables with `ghc --make` doesn't
seem to work.