Skip to content

Commit

Permalink
Merge pull request #38 from sillsdev/UpdateLinuxBuildScripts
Browse files Browse the repository at this point in the history
Update Linux build script and instructions
  • Loading branch information
jasonleenaylor committed Mar 17, 2015
2 parents b1b9b38 + 4ee73cf commit bca932a
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ If developing on windows, unzip the file `lib/Release/mercurial.zip` into `outpu

#### Linux

In order to build and run all the tests on Linux the SIL mono package will need to be installed.
It can be found at http://packages.sil.org/
That version of mono will be used when you run `build/TestBuild.sh`

Open a terminal window, change into the build directory and run the `buildupdate.mono.sh` script:

cd chorus/build
Expand Down
2 changes: 2 additions & 0 deletions build/TestBuild.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash
cd "$(dirname "$0")/.."
build/buildupdate.mono.sh
. environ
root=$PWD
cd build
xbuild "/target:${2:-Clean;Compile}" /property:Configuration="${1:-Debug}Mono" /property:RootDir=$root /property:BUILD_NUMBER="1.5.1.abcd" Chorus.proj
85 changes: 85 additions & 0 deletions environ
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Environment settings for running programs with the SIL version of mono
# Set MONO_ENVIRON to this file's pathname, then run, for example,
# /opt/mono-sil/bin/mono --debug Bloom.exe
# These setting assume that the packaged SIL Mono is installed in /opt/mono-sil.
# This may well change to /opt, simplifying the script to not need to distinguish as much
# between RUNMODE values. (The first if below may still be needed, but not the second?)
# Note that this file is intended to be "sourced", not "executed".

# the sourcing script should cd/pushd to the directory containing this script
BASE="$(pwd)"
[ -z "$BUILD" ] && BUILD=Debug
[ -z "$MONO_PREFIX" ] && MONO_PREFIX=/opt/mono-sil

# Dependency locations
# Search for xulrunner and geckofx, select the best, and add its location to LD_LIBRARY_PATH.
# Also determine the location of the geckofx assemblies and shared object libraries.
. ./environ-xulrunner

GDK_SHARP=/usr/lib/cli/gdk-sharp-2.0

MONO_RUNTIME=v4.0.30319
MONO_PATH="${GDK_SHARP}:${GECKOFX}"
MONO_DEBUG=explicit-null-checks
MONO_ENV_OPTIONS="-O=-gshared"


################################################################################################

if [ "$RUNMODE" = "INSTALLED" ]
then
# Add the installation directory to the library paths
LD_LIBRARY_PATH="${BASE}:${LD_LIBRARY_PATH}"
MONO_PATH="${BASE}:${MONO_PATH}"
else
# Add the build output to paths
PATH="${BASE}/output/${BUILD}:${PATH}"
LD_LIBRARY_PATH="${BASE}/output/${BUILD}:${LD_LIBRARY_PATH}"
MONO_PATH="${BASE}/output/${BUILD}:${MONO_PATH}"
fi

################################################################################################

if [ "$RUNMODE" = "PACKAGE" -o "$RUNMODE" = "INSTALLED" ]
then
# Add packaged mono items to paths
PATH="/opt/mono-sil/bin:${PATH}"
LD_LIBRARY_PATH="/opt/mono-sil/lib:${LD_LIBRARY_PATH}"
PKG_CONFIG_PATH="/opt/mono-sil/lib/pkgconfig:${PKG_CONFIG_PATH}"
MONO_GAC_PREFIX="/opt/mono-sil:/usr"
else
# Add locally-built mono items to paths
# We also add the default values for PKG_CONFIG_PATH - MonoDevelop resets the PKG_CONFIG_PATH
# environment variable if we're running under a different Mono runtime so that some
# packages that got installed in standard locations can't be found otherwise.
PATH="${MONO_PREFIX}/bin:${PATH}"
LD_LIBRARY_PATH="${MONO_PREFIX}/lib:${LD_LIBRARY_PATH}"
PKG_CONFIG_PATH="${MONO_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/lib/pkgconfig:/usr/lib/pkgconfig"
MONO_GAC_PREFIX="${MONO_PREFIX}:/usr"
fi

################################################################################################

MONO_TRACE_LISTENER="Console.Out"
#MONO_IOMAP=case
MONO_MWF_SCALING=disable
# if debugging for performance unset DEBUG_ENABLE_PTR_VALIDATION env var.
#export DEBUG_ENABLE_PTR_VALIDATION=1

export \
PATH LD_LIBRARY_PATH PKG_CONFIG_PATH LD_PRELOAD \
MONO_PATH \
MONO_RUNTIME MONO_PREFIX MONO_GAC_PREFIX \
MONO_TRACE_LISTENER MONO_IOMAP MONO_MWF_SCALING \
MONO_DEBUG MONO_ENV_OPTIONS

# prevent Gecko from printing scary message about "double free or corruption" on shutdown
# (See FWNX-1216.) Tom Hindle suggested this hack as a stopgap.
export MALLOC_CHECK_=0

# set HGRCPATH so that we ignore ~/.hgrc files which might have content that is
# incompatible with our version of Mercurial
export HGRCPATH=

#sets keyboard input method to none
unset XMODIFIERS
24 changes: 24 additions & 0 deletions environ-xulrunner
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# MonoDevelop seems to set PKG_CONFIG_LIBDIR to the empty string, which is bad
# for us because that eliminates most packages, including geckofx29.
# If PKG_CONFIG_LIBDIR is not set at all, then the default paths are searched.
# To be safe, we'll preserve the old value (if it is set) and restore it.
if [ "${PKG_CONFIG_LIBDIR+set}" = set ]; then
OLD_PKG_CONFIG_LIBDIR="${PKG_CONFIG_LIBDIR}"
unset PKG_CONFIG_LIBDIR
fi

if [ -z "$XULRUNNER" ]; then
if [ -d /usr/lib/xulrunner-geckofx-29 ]; then
export XULRUNNER=/usr/lib/xulrunner-geckofx-29
else
export XULRUNNER=/usr/lib/xulrunner-29
fi
fi
LD_LIBRARY_PATH="${XULRUNNER}:${LD_LIBRARY_PATH}"
GECKOFX="$(pkg-config --variable assemblies_dir Geckofx-Core)"
export LD_PRELOAD=${GECKOFX}/geckofix.so

if [ "${OLD_PKG_CONFIG_LIBDIR+set}" = set ]; then
export PKG_CONFIG_LIBDIR="${OLD_PKG_CONFIG_LIBDIR}"
unset OLD_PKG_CONFIG_LIBDIR
fi

0 comments on commit bca932a

Please sign in to comment.