Setting up GGI on Windows

Author : John Fortin
Author : Peter Ekberg
Author : Neil Pilgrim
Revision : 1.6
Revision date : 2008-01-31

The following instructions describe how to compile GGI from source on windows, under two different environments. If you do not need to compile from source, it is much easier to use the packages available as part of Cygwin.

Installation Guide for MinGW

Software needed

The following should be installed and configured correctly before proceeding:

  • MSYS and MinGW
  • DirectX headers (optional)

    These are strictly optional, but required for building the directx target, which is currently the only recommended target under MSYS/MinGW. Installation instructions are provided inside the tar.gz file.

Installing from CVS

If you have a release of GGI (or a snapshot) you can skip ahead to the next section.

You'll need to somehow generate the configure scripts in each GGI component when installing from CVS. It is not unlikely that the msys-automake and msys-autoconf packages can be used to generate the configure script, but that is untested at the time of this writing. What has been tested is to generate the configure script on Cygwin (or any decent unix). Installation instructions for Cygwin are given in their FAQ.

Compilation

Note that recent versions of GGI contain a number of component packages, which have some inter-dependencies; because of this, it is important to build and normally install some packages before others. The dependencies are shown in this table.

For each component GGI package, change into the containing directory and issue the following commands:

./configure --prefix=/usr
make
make install

The core GGI DLLs will be installed into /usr/bin, import libraries into /usr/lib and headers into /usr/include/ggi. Libraries of GGI targets will be installed into /usr/lib/ggi and the configuration into /usr/etc/ggi.

Note: On MSYS/MinGW, it is a good idea to avoid building GGI in a directory which has spaces in its name. For example, avoid building in a subdirectory of the "documents and settings" directory (e.g. /c/Documents and Settings/username in MSYS).

Post-installation setup

It is important that a number of environment variables are set, in order for GGI to work as expected:

  • PATH should contain (among other things) the windows location of your MSYS /usr/bin. An example command to run might be

    set PATH=C:\msys\1.0\bin;%PATH%
  • GGI_CONFDIR should contain the windows location of your configuration files. An example command to run might be

    set GGI_CONFDIR=C:\msys\1.0\etc\ggi

Details of environment variables understood by GGI components are listed in their main manual pages. See the appropriate documentation for the component and GGI version.

Running/Testing

  • If MSYS was installed in c:\msys\1.0, you need to look in the folders below that to find the generated files. Beware that MSYS by default maps /usr to /. E.g. the core dlls can by default be found in c:\msys\1.0\bin (and not the expected c:\msys\1.0\usr\bin).
  • Run some demos, they are found in the .libs subdirs in the directories under the programs directory.
  • If you are using a unix shell (eg. bash, not the windows command prompt), you can use the generated scripts instead of the .exe files in the .libs subdirs, and the environment variables above should be set with "export", at least for the sane shells.

Notes on using MSYS

  • The file C:\foo can by default be accessed as /c/foo in MSYS.
  • The default MSYS shell (sh in rxvt) does not grab data on standard output from the child process unless it explicitly flushes the file descriptor (it should be enough to write a newline). Demo programs that writes to stdout might appear to not work, when they in fact work perfectly fine. Try to run them at the windows command prompt instead. See MinGW tracker #946191 for details.
  • When building on Windows Vista, the following MinGW Sourceforge tracker items may be applicable: MinGW tracker #1605819 if gcc can't execute cc1 and MinGW tracker #1711379 if /bin/install fails which permission denied.

Installation Guide for Cygwin

Software needed

The following should be installed and configured correctly before proceeding:

  • Cygwin for Win32

    Installing all packages from setup.exe is perhaps overkill, but will work. A minimum set of needed packages has not been determined at the time of this writing. Installation instructions for Cygwin are given in their FAQ.

  • DirectX headers (optional)

    These are optional, but needed for the directx target to work. Installation instructions are provided inside the tar.gz file.

Installing from CVS

If you have a release of GGI (or a snapshot) you can skip ahead to the next section.

You'll need the development series of autotools, i.e. the two packages automake-devel and autoconf-devel. I have installed the autotools wrapper scripts (i.e. the automake and autoconf packages), and this guide assumes the wrapper scripts are present. Install the needed packages from the Cygwin install.

Note, use UNIX style text files in Cygwin and the cvs program provided by Cygwin. If you want use some Win32 native version of cvs (such as wincvs), it is likely to use DOS style text files, in which case Cygwin needs to use that as well. Using DOS style text files in Cygwin might break things in mysterious ways, so you're on your own if you use them.

Now generate the configure script with:

./autogen.sh

Compilation

Note that recent versions of GGI contain a number of component packages, which have some inter-dependencies; because of this, it is important to build and normally install some packages before others. The dependencies are shown in this table.

For each component GGI package, change into the containing directory and issue the following commands:

./configure --prefix=/usr
make
make install

The core GGI DLLs will be installed into /usr/bin, import libraries into /usr/lib and headers into /usr/include/ggi. Libraries of GGI targets will be installed into /usr/lib/ggi and the configuration into /usr/etc/ggi.

Note: On Cygwin, it is a good idea to avoid building GGI in a directory which has spaces in its name. For example, avoid building in a subdirectory of the "documents and settings" directory (e.g. /cygdrive/c/Documents and Settings/username in Cygwin).

Note: The configure script or the build itself sometimes terminates early due to fork failures. Try running it again if you get this or a similar error:

configure: error: invalid package name: extra-includes

The likely cause is sometimes referred to as BLODA interference, and if the problems are severe you better get rid of the interfering software.

Post-installation setup

Details of environment variables understood by GGI components are listed in their main manual pages. See the appropriate documentation for the component and GGI version.

Notes on using Cygwin

  • The file C:\foo can by default be accessed as /cygdrive/c/foo in Cygwin.