OpenPave.org

Section Navigation

Building OpenPave.org Code

Building OpenPave.org projects require little more than just downloading and building them, expect on Windows, where you will need to get a working building environment up and running first. OpenPave.org's build system is based on that used by Mozilla.

Setting up a Windows build environment

The build system makes use of a number of Unix utilities, and the best way to install these is with Cygwin. Download setup.exe and run it. Make sure to install the make, diffutils, patchutils and cvs packages, along with the normal defaults.

If you don't already have a working Visual C++ installation, then first, download and install Visual C++ Express Edition (after selling your soul for a Microsoft Passport). At the moment the code does not work with Visual C++ 6.0, although this will be fixed at some point.

Setting up a Unix build environment

Openpave.org builds have been tested on FreeBSD, Linux and Mac OS X. These all come with the tools needed (except FreeBSD where you'll need the gmake port installed - cd /usr/ports/devel/gmake && make install clean).

Doing an initial checkout of the source code

Once you have a working build environment then you can start. First, check out the makefile which controls the entire process, using CVS:

cvs -d:pserver:anonymous@cvs.openpave.org:/home/cvs co openpave/openpave.mk 

At this point you could download all projects and build them by just running:

cd openpave && gmake -f openpave.mk

Setting up an OPCONFIG file

If you are planning on doing anything more serious than but browsing the code, you should create an opconfig file. Particularly, this allows you to control which of the projects are checkout and built. You can copy and paste the example below, saving it either in the directory where you run the checkout command above, the openpave directory it created, or in your home directory. The file should be named "opconfig". If you wish to name it something else set the environment variable OPCONFIG to the full path and filename of the file.

# Options for openpave.mk.
mk_add_options OP_PROJECTS=test,libop,fem3d
mk_add_options OP_MAKE_ARGS="--no-print-directory"
mk_add_options OP_OBJDIR=@TOPSRCDIR@/op-dbg

# Options for 'configure' (same as command-line options).
ac_add_options --disable-debug
ac_add_options --enable-optimize="-O3 -march=pentium3"

The following mk_add_options are available:

OP_PROJECTS
Comma separated list of projects to build. See the top of openpave.mk for options.
OP_CVS_ARGS
Additional arguments for CVS.
OP_CO_ARGS
Additional arguments for CVS checkout (default is -P).
OP_CO_DATE
Check out at a particular date.
OP_CO_TAG
Check out files with a particular tag.
OP_OBJDIR
A directory to build in rather than muck up the source tree.
OP_AUTOCONF
If set, run autoconf locally. For when you're planning on editing configure.in
OP_MAKE_ARGS
Additional arguments to pass to make.

The following ac_add_options are available, along with a number of options normally available for a autoconf build (see configure --help):

--enable-debug=flags / --disable-debug
Enable or disable debug, or set special debug compiler flags.
--enable-debug-rtl
Enable linking with Microsoft debug runtime libraries (for easier debugging on Windows).
--enable-optimize=flags / --disable-debug
Enable or disable optimization, or set special compiler flags.

In addition, the following environment variables affect the build:

OPCONFIG
Controls the path and filename used for opconfig.
CVSROOT
Controls the CVS root used for checkouts. If you have an OpenPave.org account you can set this to :ext:reg@cvs.openpave.org:/home/cvs once you have set up SSH access.
AUTOCONF
Sets the name of autoconf. OpenPave.org requires autoconf 2.13, which is called autoconf-2.13 on FreeBSD and Cygwin. This is only used if OP_AUTOCONF is set.
CC and CXX
Set the names of the C and C++ compilers respectively.

Building projects

Finally, the commands to checkout the source code and build it are:

cd openpave && gmake -f openpave.mk checkout

cd openpave && gmake -f openpave.mk build

These will automatically pick up the options you set, and should result in working output. At the moment, the build system does not support installing the built projects, but will soon.

Example scripts

Below are some example scripts and batch files which might help. The first two are for Unix, and the second two for Windows.

#!/bin/sh
# save me as op-checkout.sh and chmod +x me.
export CVSROOT=:ext:reg@cvs.openpave.org:/home/cvs
export OPCONFIG=$PWD/opconfig
if [ ! -f openpave/openpave.mk ]; then
	cvs co openpave/openpave.mk
fi;
cd openpave
gmake -f openpave.mk checkout
#!/bin/sh
# save me as op-build.sh and chmod +x me.
export OPCONFIG=$PWD/opconfig
cd openpave
gmake -f openpave.mk build
rem save me as op-co.bat
cd C:\source

"c:\Program Files\PuTTY\pageant.exe" "C:\Documents and Settings\Jeremy Lea\.ssh\id_dsa.ppk"

set CVSROOT=:ext:reg@cvs.openpave.org:/home/cvs
set HOME=C:\source
set PATH=C:\source\cygwin\bin;
set OPCONFIG=C:\source\opconfig

cvs checkout openpave/openpave.mk
cd openpave
make -f openpave.mk checkout
cd ..
rem save me as op-build.bat
cd C:\Source

set HOME=C:\source
set PATH=C:\source\cygwin\bin;
set OPCONFIG=C:\source\opconfig
set AUTOCONF=autoconf-2.13
rem call "C:\Program Files\Microsoft Visual Studio\VC98\Bin\vcvars32.bat"
call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86

cd openpave
make -f openpave.mk build
cd ..