Setup For Linux

This document assumes you have a working knowledge of how to use a Linux command prompt and how to locate and install software. In modern Linux distributions, there is usually a SWEET package management system through which all software can be located and installed through a dependency-tracking package management system such as apt-get or rpm. Additionally, there are equally SAWEET frontends for said package management systems to make the software installation process even cleaner and more user-friendly (for example, synaptic is a good li'l GUI buddy for apt-get).

If you aren't using a package management system, I highly recommend you start doing so, because it makes locating and installing software WAY easier -- much easier even than installing stuff in Winders -- no manual downloading or running installers or anything.

Apart from the Linux-distribution-specific package management details, these instructions should, in theory, suffice for any flavor of Unix, possibly including Mac OS X. Maybe even for Cygwin under Winderps, but just who the hell knows with that retarded operating system.

Instructions for the unwashed masses:

Super-Quick Setup For Those In The Know

If you already know what you're doing, follow these high-level instructions. If these instructions make no sense to you, skip this section and go to Common Unix Development Tools.

Through whatever your preferred means, install the development versions of the SDL, SDL_image and FreeType2 libraries. The specific package names and versions may vary from the following example for your specific package management system.

apt-get install libsdl1.2-dev libsdl-image1.2-dev libfreetype6

Go to a directory appropriate to dump source code and checkout the XuqRijBuh game engine source via Subversion using the following command.

svn co https://svn.sourceforge.net/svnroot/xuqrijbuh xuqrijbuh

Download the XuqRijBuh resources and unzip it (later instructions assume you've squirted it into the xuqrijbuh/trunk directory).

wget http://www.thedods.com/victor/resources.zip && unzip resources.zip -d xuqrijbuh/trunk

Create the configure script. This must be done every time configure.ac is modified.

cd xuqrijbuh/trunk && ./bootstrap.sh

Create a build directory, change directory to it, and Configure. See Configuring A Build if that's what floats your boat.

mkdir debug && cd debug && ../configure --enable-debug --disable-static --enable-nan-sanity-check

Symbolically link the resources directory and then Compile. See Compiling And Build Targets if that's what tickles your pickle.

ln -s ../resources . && make

Your applications are waiting in the build directory, suh. Run them at your leisure.

Common Unix Development Tools

The following tools are required for development using the XuqRijBuh game engine in Linux. They are likely already installed on your system -- what good is a Unix machine without development tools?

Implicitly, a Bourne-compatible shell (e.g. sh or bash) is required for make and the auto-tools to work (though I might be on crack).

SDL

SDL is an abstraction layer for computer hardware designed to make development of portable games simple. It provides low-level facilities for interaction with devices such as the framebuffer (video memory), keyboard/mouse/joystick input, sound, OpenGL, the CD-rom, etc.

If you are not installing packages through a package management system, you can find the necessary source or pre-compiled binary packages here:

http://www.libsdl.org/index.php

Look under "Download" for SDL 1.X (1.2 is the most recent as of August 2006). You'll need both the runtime and development libraries. Choose whichever format packages are appropriate for your system.

SDL_image

The SDL website hosts releases of many different libraries that have been written for use with SDL. One is SDL_image -- a frontend to several libraries to support reading image files (such as JPEG, PNG, etc). As of August 2006, writing images is not supported (which seems stupid, but whatever).

If you are not installing packages through a package management system, you can find the necessary source or pre-compiled binary packages here:

http://www.libsdl.org/projects/SDL_image/

You'll need both the runtime and development libraries. Choose whichever format packages are appropriate for your system. This library requires others, such as libpng, libjpeg, libtiff, and zlib. Uhh, like, it is left as an exercise to the reader on finding and installing these libs. Ha ha. Serves you right for not using apt-get.

FreeType2

FreeType is a handy library which renders scalable fonts (read "makes them letters look real purty"). It supports reading from TrueType and Type 1 formats, and possibly others.

If you are not installing packages through a package management system, you can find the necessary source or pre-compiled binary packages here:

http://download.savannah.gnu.org/releases/freetype/

You want the package of the form ftXXXX.zip (ft221.zip is the most recent as of August 2006) -- the only available format is the source package.

XuqRijBuh Game Engine Source

In order to get this fine mess working, you'll need the game engine source. The source tree can be found at the following Subversion URL:

https://svn.sourceforge.net/svnroot/xuqrijbuh

So if you're using the commandline svn client, you would cd to the directory you want to dump the source tree, and issue this command:

svn co https://svn.sourceforge.net/svnroot/xuqrijbuh xuqrijbuh

A directory containing the full source tree, called xuqrijbuh, will be created in your current working directory.

There are three subdirectories of xuqrijbuh:

For general information on XuqRijBuh, go to the SourceForge homepage:

http://sourceforge.net/projects/xuqrijbuh/

XuqRijBuh Resources

All the example applications (described in Compiling And Build Targets) require file assets in order to function (e.g. fonts, textures, etc). As of August 2006, these are provided in a zip file:

http://www.thedods.com/victor/resources.zip

Download this, and unzip it into xuqrijbuh/trunk.

Bootstrapping The configure Script

All you need to know is that to generate configure, from the xuqrijbuh/trunk directory, you must run the following command.

./bootstrap.sh

This must be run every time configure.ac is modified -- either by you or through svn update.

This uses aclocal, autoheader, libtoolize, automake and autoconf to generate the files necessary for building -- configure and Makefile.in.

The autoconf tool generates the configure script which detects locations and versions of libraries, header files, compilers, tools, etc. in order to make the build process consistent across many platforms (primarily Unices). The file configure.ac is the source file which autoconf reads in order to produce the configure script.

Similarly, automake is a program which automates generation of complicated Makefiles. It uses Makefile.am to generate an analogous instances of Makefile.in, which are in turn used by the configure script to produce Makefile.

Even though the syntax and much of the design detail of these two apps is completely retarded and irrational, they do work very well, and are what facilitate the ubiquitous "configure, make, make install" configuration/compilation/installation commands as used by practically all open-source C/C++ Unix software.

More information on autoconf and automake can be found at http://www.gnu.org/software/autoconf/ and http://www.gnu.org/software/automake/ respectively.

Configuring A Build

The configure script is the central point of control for detecting and specifying system characteristics and other build options. To see what specific options are available, run:

./configure --help

Some useful options include:

The default linking behavior is to produce both dynamic and static libraries, but only dynamically-linked executables.

During the development cycle, it is recommended to use options:

--disable-static --enable-debug --enable-nan-sanity-check

For a (statically-linked) release, use:

--disable-shared --with-debug-level=0 --with-arch=XXX

Where XXX is the name of the target architecture (see your compiler's documentation for specific architecture names).

I recommend not running configure in the source directory (xuqrijbuh/trunk), but rather creating a subdirectory (debug or release or profile etc.), hereafter referred to as the "build directory" and running configure from there. For example:

cd xuqrijbuh/trunk mkdir debug cd debug ../configure --disable-static --enable-debug --enable-nan-sanity-check

This will cause the xuqrijbuh/trunk/debug directory to contain all generated files (object, library and executable). Since it is strictly separated from the source tree, it is easy to delete the directory should the need arise to start completely cleanly.

Running configure will produce a Makefile in the build directory which is used by make to build the libraries and applications. This Makefile defines the build targets (the applications and game engine library)

Compiling And Build Targets

To build everything, simply run:

make

in the build directory. This will build the game engine library (in the lib/ subdir) and all application executables (in the build dir). You can also build one or more of the targets specifically, should you not want to waste time building stuff you're not working on or don't care about. As of August 2006, the build targets are:

Building a target by name is done by specifying it as a parameter to make.

make lib/libxrb.la

Or to build multiple targets,

make disasteroids guidemo

Building an application will cause make to build all its dependencies if necessary (e.g. if the library code has changed, lib/libxrb.la will be rebuilt before linking the application).

For the example applications to run properly, they need access to the resources directory. The easiest way to do this is to create a symlink from the build dir to wherever you unzipped resources.zip. Assuming you unzipped resources.zip into xuqrijbuh/trunk and you're in the build directory -- xuqrijbuh/trunk/debug:

ln -s ../resources .

If you ever run an app, and it fails inexplicably, it's probably because you're a douche bag. Either that or you're missing the resources directory (explained in XuqRijBuh Resources), or you screwed up the above symlink command.

It should be noted that if you made a dynamically-linked build (see configure option --disable-static, the "real" executable is located in the .libs subdirectory of the target, with the prefix lt- and what you thought was the executable is actually a libtool-generated shell script which does some fancy voodoo to set things up for execution of the dynamically-linked binary in the development directory tree. For example, for disasteroids, the binary produced is .libs/lt-disasteroids, and the file disasteroids is the libtool-generated shell script.

Creating Releases Of Your Application

I'm not an expert on this yet, so for now, just link your app statically (see Configuring A Build) and distribute the monolithic binary along with whatever other resources your app needs. Otherwise, if you're cool and you know how to write Makefile.ams, you can use automake's make install facility (see http://www.gnu.org/software/automake/ for more details).

Hosted by SourceForge.net Logo -- Generated on Fri Aug 21 21:46:38 2009 for XuqRijBuh by doxygen 1.5.8