CvsGraphMingw

How to compile CvsGraph on Windows with Mingw

Building CvsGraph on Windows can be a rather involved process depending on what tools and libraries you've already got installed on your system. If you just need CvsGraph binaries, you can get them from the [WWW] CvsGraph Homepage. But if you need to compile CvsGraph yourself, these instructions will tell you how.

CvsGraph depends on a 2D graphics library called [WWW] gd which in turn depends on the [WWW] freetype2, [WWW] libpng, [WWW] jpeg, and [WWW] gzip libraries. The instructions will walk you through the installation of all of the dependencies. They use the following two placeholders to represent system paths which you should substitute with your own values:

Steps:

1) Download and install [WWW] mingw and [WWW] msys from [WWW] http://www.mingw.org/download.shtml. Both packages have gui installers.

2) Download zlib from [WWW] http://www.gzip.org/zlib/. Install it by running the following commands at the msys bash prompt:

$ tar -xzvf zlib-1.1.4.tar.gz
$ cd zlib-1.1.4
$ ./configure --prefix=<DEST_DIR>
$ make
$ make install

3) Download libpng from [WWW] http://www.libpng.org/pub/png/libpng.html. Install it with these commands.

$ tar -xjvf libpng-1.2.5.tar.bz2 
$ cd libpng-1.2.5
$ cp scripts/makefile.cygwin Makefile  # cygwin makefile seems to work
$ rm INSTALL                           # bug in makefile causes errors when this file is present
$ make install prefix=<DEST_DIR> ZLIBINC=<DEST_DIR>/include ZLIBLIB=<DEST_DIR>/lib

4) Download the jpeg library from [WWW] http://www.ijg.org/. Install with

$ tar -xzvf jpegsrc.v6b.tar.gz 
$ cd jpeg-6b
$ ./configure --prefix=<DEST_DIR>
$ make
$ mkdir <DEST_DIR>/man/man1            # I needed this to prevent errors during install
$ make install install-lib

5) Download Freetype2 from [WWW] http://www.freetype.org/. Install with

$ tar -xjvf freetype-2.1.5.tar.bz2
$ cd freetype-2.1.5
$ ./configure --prefix=<DEST_DIR>
$ make
$ make install

6) Download libgd from [WWW] http://www.boutell.com/gd/. Install with

$ tar -xzvf gd-2.0.15.tar.gz 
$ cd gd-2.0.15
$ LDFLAGS=-L<DEST_DIR>/lib CPPFLAGS=-I<DEST_DIR>/include ./configure --prefix=<DEST_DIR>
$ make
$ make install

7) Download gnu regex from [WWW] http://www.gnu.org/directory/regex.html. Install with

$ tar -xzvf regex-0.12.tar.gz 
$ cd regex-0.12
$ ./configure --prefix=<DEST_DIR>
$ make regex.o
$ cp -p regex.h <DEST_DIR>/include/
$ ar rcs <DEST_DIR>/lib/libregex.a regex.o

8) If you don't have the lex and yacc tools (or their equivalents flex and bison) installed you can download executables from the gnuwin32 project at [WWW] http://gnuwin32.sourceforge.net/packages/flex.htm and [WWW] http://gnuwin32.sourceforge.net/packages/bison.htm. To install the gnuwin32 packages just extract the zip files to a folder like c:/gnuwin32. Then add the bin subdirectory to the path PATH by running

$ export PATH=$PATH:/c/gnuwin32/bin

9) Finally, download cvsgraph from [WWW] http://www.akhphd.au.dk/~bertho/cvsgraph/. Start installing with

$ tar -xzvf cvsgraph-1.4.0.tar.gz
$ cd cvsgraph-1.4.0
$ ./configure --prefix=<DEST_DIR> --with-gd-inc=<DEST_DIR>/include --with-gd-lib=<DEST_DIR>/lib

Then edit cvsgraph.c and remove the line

#include <sys/wait.h>

and edit Makefile changing the assignment of LIBS from

LIBS = -L<DEST_DIR>/lib -lgd -lfreetype -ljpeg -lpng  -lm

to

LIBS = -L<DEST_DIR>/lib -lgd -lfreetype -ljpeg -lpng  -lm -liberty -lregex

Build and install with

$ make
$ cp cvsgraph.exe <DEST_DIR>/bin/

last edited 2003-10-12 19:45:43 by 69