diff options
Diffstat (limited to 'win32/setup-env')
-rwxr-xr-x | win32/setup-env | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/win32/setup-env b/win32/setup-env new file mode 100755 index 0000000000..1b0cde5140 --- /dev/null +++ b/win32/setup-env @@ -0,0 +1,76 @@ +#!/bin/bash + +############################################################################## +# +# Setup a build environment. This can take up to two parameters: +# argv[1] - build type, can be 'stable' or 'master'; anything else than +# 'stable' means 'master' build in the ./Makefile, which uses +# relative path for build and if the respective folder is not +# downloaded yet, then it creates a checkout from the master git +# branch (hence the 'master' build name). There can be built +# anything as master, the only condition is that the directory +# with the sources is in place. +# argv[2] - use "debug" to build with debug options; using 'debug' build type +# also uses debug build options +# +############################################################################## + +if [ "$BUILD_ROOT_OVERRIDE" = "" ] ; then + export BUILD_ROOT_BASE=/build/local +else + export BUILD_ROOT_BASE=$BUILD_ROOT_OVERRIDE +fi + +# Optional parameter to compile other than 'master' or 'stable' releases; +# empty value means 'stable', anything else means 'master' type in Makefile +export EVO_BUILD_TYPE=$1 + +export BUILD_ROOT_DEPS=$BUILD_ROOT_BASE/deps +if [ "x$EVO_BUILD_TYPE" != "x" -a "x$EVO_BUILD_TYPE" != "xstable" ] ; then + # Build custom builds like from 'master', aka from relative path checkouts + export EVO_BUILD_SUFFIX="-master" + export BUILD_ROOT_EVO="$BUILD_ROOT_BASE/evo-$EVO_BUILD_TYPE" +else + # Build from tarballs + export EVO_BUILD_SUFFIX="-stable" + export BUILD_ROOT_EVO=$BUILD_ROOT_BASE/evo +fi + +if [ "$PATH_DEFAULT" = "" ] ; then + export PATH_DEFAULT=$PATH +fi + +export PATH=$BUILD_ROOT_DEPS/bin:$BUILD_ROOT_EVO/bin:$PATH_DEFAULT + +# Compile against locally installed software. +export LD_LIBRARY_PATH=$BUILD_ROOT_DEPS/lib:$BUILD_ROOT_EVO/lib:/lib +export PKG_CONFIG_PATH=$BUILD_ROOT_DEPS/lib/pkgconfig:$BUILD_ROOT_EVO/lib/pkgconfig:$BUILD_ROOT_DEPS/share/pkgconfig:$BUILD_ROOT_EVO/share/pkgconfig +export ACLOCAL_FLAGS="-I $BUILD_ROOT_DEPS/share/aclocal -I $BUILD_ROOT_EVO/share/aclocal -I /share/aclocal" +export GSETTINGS_SCHEMA_DIR=$BUILD_ROOT_DEPS/share/glib-2.0/schemas:$BUILD_ROOT_EVO/share/glib-2.0/schemas +if [ "$1" = "debug" -o "$2" = "debug" ] ; then + export CFLAGS="$CFLAGS -g -O0 -Wall -DMSVCRT_VERSION=710" +else + export CFLAGS="$CFLAGS -DMSVCRT_VERSION=710" +fi +export CPPFLAGS="$CPPFLAGS -I$BUILD_ROOT_DEPS/include -I$BUILD_ROOT_EVO/include -I/include" +export LDFLAGS="$LDFLAGS -L$BUILD_ROOT_DEPS/lib -L$BUILD_ROOT_EVO/lib -L/lib" + +mkdir -p $BUILD_ROOT_DEPS/bin 2>/dev/null +mkdir -p $BUILD_ROOT_DEPS/include 2>/dev/null +mkdir -p $BUILD_ROOT_DEPS/lib 2>/dev/null +mkdir -p $BUILD_ROOT_DEPS/share/aclocal 2>/dev/null +mkdir -p $BUILD_ROOT_DEPS/etc/dbus-1/session.d 2>/dev/null +#mkdir -p $BUILD_ROOT_DEPS/share/dbus-1 2>/dev/null + +mkdir -p $BUILD_ROOT_EVO/bin 2>/dev/null +mkdir -p $BUILD_ROOT_EVO/include 2>/dev/null +mkdir -p $BUILD_ROOT_EVO/lib 2>/dev/null +mkdir -p $BUILD_ROOT_EVO/share/aclocal 2>/dev/null +#mkdir -p $BUILD_ROOT_EVO/share/dbus-1 2>/dev/null + +#rm /usr/local/share/dbus-1 2>/dev/null +#ln -s $BUILD_ROOT_DEPS/share/dbus-1 /usr/local/share/dbus-1 + +if [ -f "session-local.conf.in" ] ; then + cat session-local.conf.in | sed 's|@BUILD_ROOT_EVO@|'$BUILD_ROOT_EVO'/share/dbus-1/services|g' >$BUILD_ROOT_DEPS/etc/dbus-1/session.d/session-local.conf +fi |