Agar

   <-- Back to Documentation

Installing Agar on other Unix-like platforms

This guide describes how to compile and install the Agar library under Unix-like platforms other than Linux and *BSD. Before compiling, you might want to search the ports/packages collection for an Agar package. However, if an available package is outdated compared to the most recent release of Agar, we recommend installing from source instead.

Prerequisites

Agar works best with OpenGL and the FreeType font engine installed. Provided that you have a modern X.org installation, those components should be already installed on your system.

Agar uses the native X.org API by default, but Agar applications can be made to work over SDL 1.2 as well.

Some optional Agar features also make use of the jpeg, png and iconv libraries if they are available.

Compilation under SGI IRIX

Under the SGI IRIX platform, we recommend compiling Agar using gcc3 or SGI cc (there are varargs-related problems with gcc 2.95). You can download .tardist packages gcc3 (as well as SDL, freetype, etc.) from nekochan.net.

Installation Procedure

First download the Agar source package and unpack it to a temporary location:

  $ wget http://stable.hypertriton.com/agar/agar-1.5.0.tar.gz
  $ tar -xzf agar-1.5.0.tar.gz
  $ cd agar-1.5.0.tar.gz

Then configure and compile the sources. There are a number of build options available (see ./configure --help), but the defaults should be fine unless you have specific requirements. The --enable-debug option is recommended for developers, since it enables assertions and type safety checking in event handler arguments.

  $ ./configure --prefix=$HOME		# Install to some alternate location
  $ ./configure --enable-debug		# For developers
  $ ./configure --enable-nls		# Enable native language support
  $ make depend all

Finally, install the library. This will install under the /usr/local by default (you can use the configure option --prefix to install to an alternate location).

  # make install

On some platforms, installing shared libraries requires that you refresh the dynamic linker cache. Refer to your operating system's documentation on how to do this.

Testing Agar

You can test that Agar is working using a simple hello.c program like so:

  #include <agar/core.h>
  #include <agar/gui.h>
  
  int
  main(int argc, char *argv)
  {
          AG_Window *win;
          
          if (AG_InitCore(NULL, 0) == -1 ||
              AG_InitGraphics(0) == -1) {
		fprintf(stderr, "Init failed: %s\n", AG_GetError());
		return (1);
	  }
          win = AG_WindowNew(0);
          AG_LabelNew(win, 0, "Hello, world!");
          AG_WindowShow(win);
          AG_EventLoop();
          return (0);
  }

Compile this example using:

  $ cc -o hello `agar-config --cflags` hello.c `agar-config --libs`

Csoft.net ElectronTubeStore.com