Bootstrapping/Building

Prerequisites

Linux requires certain packages installed to complete the entire bootstrap process. These packages are not related to JamPlus itself but instead to the LuaPlus subset residing with it. Therefore, they are optional, but their existence enables a more complete environment for JamPlus features. The packages are: libreadline-dev, uuid-dev, and libssl-dev.

Quick Bootstrapping of JamPlus

The directions in the sections below describe the build process in better detail, but if you just need a working copy of JamPlus with its dependencies, run the following:

# If you are on Linux and want a 32-bit build:
./bootstrap-linux32.sh
# If you are on Linux and want a 64-bit build:
./bootstrap-linux64.sh
# If you are on Mac OS X and want a 32-bit build:
./bootstrap-macosx32.sh
# If you are on Mac OS X and want a 64-bit build:
./bootstrap-macosx64.sh
# If you are on Windows and want a 32-bit build:
bootstrap-win32.bat
# If you are on Windows and want a 64-bit build:
bootstrap-win64.bat

Binaries are built into a platform specific directory under the bin/ directory, such as bin/win32/ or bin/macosx32/. All associated scripts and optional Lua binaries are also within this platform directory. Multiple JamPlus platform binaries can be deployed within the same directory tree, making it easy to check into your source control system.

Run the JamPlus Test Suite

It may also be useful to run the JamPlus test suite after the bootstrap is finished. Note that the test suite may fail depending on platform and compiler version and so on, even though JamPlus itself will work fine. The varied combinations of output text and intermediate files are difficult to determine.

cd tests
# If you are on Linux and want to test the 32-bit build:
./runtests-linux32
# If you are on Linux and want to test the 64-bit build:
./runtests-linux64
# If you are on Mac OS X and want to test the 32-bit build:
./runtests-macosx32
# If you are on Mac OS X and want to test the 64-bit build:
./runtests-macosx64
# If you are on Windows and want to test the 32-bit build:
runtests-win32.bat
# If you are on Windows and want to test the 64-bit build:
runtests-win64.bat

Advanced Overview

The instructions below are unnecessary if the bootstrap scripts are used.

JamPlus comes with some simple makefiles to bootstrap the initial build of the JamPlus executable. A good portion of the makefile contents in Makefile.Common are shared between the Visual C++ NMake-based build and the GCC-based make build.

Binaries are built into a platform specific directory under the bin/ directory, such as bin/win32/ or bin/macosx32/. All associated scripts and optional Lua binaries are also within this platform directory. Multiple JamPlus platform binaries can be deployed within the same directory tree, making it easy to check into your source control system.

In order to build a fully working JamPlus directory, certain Lua binaries are required. By setting the environment variable LUA_BIN to the directory containing the appropriate LuaPlus binaries, the build processes described below will automatically populate the JamPlus bin/ directory with the Lua binaries.

Building for Visual C++

The Visual C++ build uses Visual Studio's Link Time Code Generation support to create a highly optimized executable.

In order to build JamPlus for Win32 using the Visual C++ compiler, run the following:

cd src
jmake-win32

To build JamPlus for Win64 using the Visual C++ compiler, run the following:

cd src
jmake-win64

jmake-win32 or jmake-win64 selects the most recent Visual Studio version available and uses that compiler to build the Jam executable. When finished, the Jam executable will have been built as bin/win32/jam.exe or bin/win64/jam.exe.

To clean the Visual C++ build, run:

cd src
clean-win32
clean-win64

Visual Studio 2010, 2012, 2013, and 2015 solutions are maintained for easy debugging of Jam. Open src/jam.VS201?.sln to build within the appropriate IDE. Note: The Release build of the Jam executable built via the IDE is nowhere near as fast as the command-line generated Link Time Code Generated version.

Building for Mac OS X

In order to build JamPlus for Mac OS X 32-bit, run:

cd src
make macosx32

When finished, the Jam executable will have been built as bin/macosx32/jam.

In order to build JamPlus for Mac OS X 64-bit, run:

cd src
make macosx64

When finished, the Jam executable will have been built as bin/macosx64/jam.

Alternatively, an Xcode project for debugging Jam is maintained. Open src/jam.xcodeproj to build within Xcode. Please note that the Release build does not currently work. Build a Release build using the makefile instructions above.

Building for Linux

In order to build JamPlus for Linux 32-bit, run:

cd src
make linux32

When finished, the Jam executable will have been built as bin/linux32/jam.

Alternatively, in order to build JamPlus for Linux 64-bit, run:

cd src
make linux64

When finished, the Jam executable will have been built as bin/linux64/jam.

Building and Copying the LuaPlus Binaries

The JamPlus Git repository has stripped down copy of LuaPlus.

To build the LuaPlus subset necessary for JamPlus' extended feature set, first change directories into src/luaplus/.

cd src
cd luaplus

Build LuaPlus by running one of the following:

# For Windows 32-bit:
..\..\bin\win32\jam.exe
# For Windows 64-bit:
..\..\bin\win64\jam.exe
# For Linux 32-bit:
../../bin/linux32/jam
# For Linux 64-bit:
../../bin/linux64/jam
# For Mac OS X 32-bit:
../../bin/macosx32/jam
# For Mac OS X 64-bit:
../../bin/macosx64/jam

When finished a src/luaplus/.build/PLATFORM/bin/ directory will have been created. Set the LUA_BIN environment variable to point to the directory using one of the following approaches:

# For Windows 32-bit:
set LUA_BIN=c:/jamplus/src/luaplus/.build/win32/bin
# For Windows 64-bit:
set LUA_BIN=c:/jamplus/src/luaplus/.build/win64/bin
# For Linux 32-bit:
export LUA_BIN=~/jamplus/src/luaplus/.build/linux32/bin
# For Linux 64-bit:
export LUA_BIN=~/jamplus/src/luaplus/.build/linux64/bin
# For Mac OS X 32-bit:
export LUA_BIN=~/jamplus/src/luaplus/.build/macosx32/bin
# For Mac OS X 64-bit:
export LUA_BIN=~/jamplus/src/luaplus/.build/macosx64/bin

Change directories back to the jamplus/src/ directory.

cd ..

Run the appropriate jmake/make command again, and the LuaPlus binaries will be copied to the appropriate jamplus/bin/ directory.