2013-07-11 12:23:50 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
2014-05-13 00:37:27 -04:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
echo "ARCH not set defaulting to win32"
|
|
|
|
ARCH=win32
|
|
|
|
elif [ "$ARCH" == "win32" ]; then
|
|
|
|
echo "ARCH set to win32"
|
|
|
|
elif [ "$ARCH" == "win64" ]; then
|
|
|
|
echo "ARCH set to win64"
|
|
|
|
else
|
|
|
|
echo "ARCH set invalid value aborting..."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$ARCH" == "win32" ]; then
|
|
|
|
HOST=i686-w64-mingw32
|
|
|
|
else
|
|
|
|
HOST=x86_64-w64-mingw32
|
|
|
|
fi
|
2013-07-11 12:23:50 -04:00
|
|
|
|
|
|
|
MINGW_ROOT=/usr/$HOST/sys-root/mingw
|
|
|
|
|
|
|
|
export PKG_CONFIG_PREFIX=$MINGW_ROOT
|
|
|
|
export PKG_CONFIG_LIBDIR=$MINGW_ROOT/lib/pkgconfig
|
2013-07-15 13:44:11 -04:00
|
|
|
export PKGCONFIG=pkg-config
|
2013-07-11 12:23:50 -04:00
|
|
|
export AR=$HOST-ar
|
|
|
|
export RANLIB=$HOST-ranlib
|
|
|
|
export CC=$HOST-gcc
|
|
|
|
export CPP=$HOST-g++
|
|
|
|
export CXX=$HOST-g++
|
|
|
|
export AS=$HOST-as
|
|
|
|
export LINK_CC=$HOST-gcc
|
|
|
|
export LINK_CXX=$HOST-g++
|
|
|
|
export WINRC=$HOST-windres
|
|
|
|
export STRIP=$HOST-strip
|
|
|
|
|
2014-05-13 00:37:27 -04:00
|
|
|
BASE=$(readlink -f $0)
|
|
|
|
BASE=$(dirname $BASE) # up one
|
|
|
|
BASE=$(dirname $BASE) # up one more
|
|
|
|
BASE=$(dirname $BASE) # up one more
|
|
|
|
|
2013-07-11 12:23:50 -04:00
|
|
|
BUILD_DIR=$BASE/build
|
|
|
|
BUILD_CACHE_FILE=$BUILD_DIR/c4che/_cache.py
|
|
|
|
TOOLS_DIR=$BASE/tools/windows_packaging
|
|
|
|
|
|
|
|
APPNAME=`grep -m 1 '^APPNAME' $BASE/wscript | awk '{print $3}' | sed "s/'//g"`
|
|
|
|
|
|
|
|
# These are only relevant after a build
|
|
|
|
if test -f $BUILD_CACHE_FILE
|
|
|
|
then
|
2013-08-14 01:07:37 -04:00
|
|
|
. ../define_versions.sh
|
|
|
|
|
2013-07-11 12:23:50 -04:00
|
|
|
# Figure out the Build Type
|
2013-08-16 05:50:19 -04:00
|
|
|
if [ x$DEBUG = xT ]; then
|
2014-05-13 00:37:27 -04:00
|
|
|
PACKAGE_DIR="$APPNAME-${release_version}-$ARCH-dbg"
|
2013-07-11 12:23:50 -04:00
|
|
|
else
|
2014-05-13 00:37:27 -04:00
|
|
|
PACKAGE_DIR="$APPNAME-${release_version}-$ARCH"
|
2013-07-11 12:23:50 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if grep -q "BUILD_TESTS = True" $BUILD_CACHE_FILE; then
|
|
|
|
WITH_TESTS=1
|
|
|
|
fi
|
|
|
|
|
|
|
|
ARDOUR_DATA_DIR=$PACKAGE_DIR/share/ardour3
|
|
|
|
fi
|