Contents

Compiling Object Icon on Unix systems

Introduction

This page gives generic instructions for compiling Object Icon on Unix-like systems.

Prerequisites

Please note that Object Icon runs from the directory you compile it in (there is no make install step), so please bear that in mind when choosing where you extract the tar file, or checkout the subversion repository from. This directory’s path must not contain any characters with special meaning in bash or make; in particular “$”, backslash and double-quotes should be avoided. Spaces are allowed however.

Debian packages

If you are using a debian-based system, the following may be helpful.

If compiling from the subversion source, rather than the tar file, you need the autoconf package.

To compile a text-only basic system, you need

gcc or clang
make

To compile a graphics system, you also need

pkg-config
libx11-dev
libxrender-dev
libxft-dev
libjpeg-dev

For a graphics system, the package oxygen-icon-theme is also recommended in order to provide some standard icons.

Finally, to compile the optional dynamically loaded libraries (cairo, ssl and mysql), you need

librsvg2-dev
libcairo2-dev
libpango1.0-dev
libssl-dev
libmysqlclient-dev

Compiling from the subversion source repository

Use the following command to checkout a read-only copy of the source code :-

svn co svn://svn.code.sf.net/p/objecticon/code/trunk objecticon

This will create a directory objecticon under the present directory (you can change the last parameter to create a different directory name if you want).

Then cd into that directory and run the command autoconf. This will create a configure script.

Then proceed just the same as if you had downloaded the .tar.gz file, as explained below.

If you later wish to update your copy of the repository, cd into the directory and run the following :-

svn up
make clean

Then run autoconf again, and then configure, and then proceed as before.

Compiling from a tar.gz file

Extract the source code from the .tar.gz file with a command like

tar xfz objecticon-1234.tar.gz

This will create a directory objecticon-1234 under the current directory. The number is the subversion version number from which the .tar.gz was built, and will of course be different. You can rename this directory if you like.

Importantly, please note that there is no “install” phase after compilation, and the extracted directory must be moved to the place you want to keep it, before proceeding further. This is because the compilation process embeds absolute paths into some object files, and they will be wrong if the directory is moved afterwards.

So, after you are happy with the location (and name) of the extracted directory, change to it and run

./configure

This command accepts various options - run

./configure --help

to see them.

If you are using the clang C compiler, specify this with :-

CC=clang ./configure

The configure script prints a summary of features when it finishes. For example.

Summary:-
X11 graphics           : yes
jpeg library           : yes
png library            : yes
zlib compression       : yes
dynamic loading        : yes
mysql lib              : yes
cairo lib              : yes
ssl lib                : yes

The meaning of these various options is as follows.

If you later wish to run configure again, please remember to run make clean afterwards in order to remove any object files built under the previous configuration.

Compilation

After running configure successfully, just run the command

make

to build everything. Note that GNU make is required. Note that sometimes GNU make is installed under the name gmake instead.

Testing

After make has completed successfully, you can optionally run some tests, as follows :-

make test

Various output will follow, which should hopefully end with the message “Testing successful.” If not, the problem with the failed test can be examined by comparing the expected output of a test with the actual output. For example, if the io test failed, run

cd test
diff io.out io.std

to see the problem.

Installing

As mentioned above, there is no installation stage; rather Object Icon runs from the directory it was compiled in. As also mentioned, it is important that this directory is not moved or renamed after compilation, since various embedded paths would then no longer be correct.

Environment variables

Object Icon requires some environment variables to be setup correctly. To make doing this a bit easier, a file named paths.sh is created by configure, which contains appropriate definitions.

Include this file by adding a line like this to your .bashrc file (or equivalent); obviously the actual path may vary, and note the dot at the beginning of the line.

. ~/objecticon/paths.sh

If you are using bash, you can also use the source command instead of the dot syntax; but don’t try to run paths.sh directly, since its contents must be loaded into the current shell environment.

Libref documentation

You might also create a local copy of the auto-generated library documentation. It is not done by default because it is rather large (about 25MB). If you want this, run

make libref

This command will take a couple of minutes to run. A directory libref is created, and contains the top-level file of the documentation, index.html.

Contents