2014-10-21 14:16:10 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# we assuem this script is <ardour-src>/tools/x-win/compile.sh
|
|
|
|
pushd "`/usr/bin/dirname \"$0\"`" > /dev/null; this_script_dir="`pwd`"; popd > /dev/null
|
2021-04-21 14:37:06 -04:00
|
|
|
cd "$this_script_dir/../.."
|
2014-10-21 14:16:10 -04:00
|
|
|
test -f gtk2_ardour/wscript || exit 1
|
|
|
|
|
|
|
|
: ${XARCH=i686} # or x86_64
|
|
|
|
: ${ROOT=/home/ardour}
|
|
|
|
: ${MAKEFLAGS=-j4}
|
|
|
|
|
|
|
|
if test "$XARCH" = "x86_64" -o "$XARCH" = "amd64"; then
|
|
|
|
echo "Target: 64bit Windows (x86_64)"
|
|
|
|
XPREFIX=x86_64-w64-mingw32
|
|
|
|
WARCH=w64
|
|
|
|
DEBIANPKGS="mingw-w64"
|
|
|
|
else
|
|
|
|
echo "Target: 32 Windows (i686)"
|
|
|
|
XPREFIX=i686-w64-mingw32
|
|
|
|
WARCH=w32
|
|
|
|
DEBIANPKGS="gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-tools mingw32"
|
|
|
|
fi
|
|
|
|
|
|
|
|
: ${PREFIX=${ROOT}/win-stack-$WARCH}
|
|
|
|
|
|
|
|
if test -z "${ARDOURCFG}"; then
|
|
|
|
if test -f ${PREFIX}/include/pa_asio.h; then
|
2023-10-10 18:51:00 -04:00
|
|
|
ARDOURCFG="--with-backends=jack,dummy,portaudio"
|
2014-12-23 20:31:16 -05:00
|
|
|
else
|
2023-10-10 18:51:00 -04:00
|
|
|
ARDOURCFG="--with-backends=jack,dummy"
|
2014-10-21 14:16:10 -04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$(id -u)" = "0" ]; then
|
2014-12-20 21:04:09 -05:00
|
|
|
apt-get -qq -y install build-essential \
|
2014-10-21 14:16:10 -04:00
|
|
|
${DEBIANPKGS} \
|
|
|
|
git autoconf automake libtool pkg-config yasm python
|
|
|
|
|
|
|
|
#fixup mingw64 ccache for now
|
|
|
|
if test -d /usr/lib/ccache -a -f /usr/bin/ccache; then
|
|
|
|
export PATH="/usr/lib/ccache:${PATH}"
|
|
|
|
cd /usr/lib/ccache
|
|
|
|
test -L ${XPREFIX}-gcc || ln -s ../../bin/ccache ${XPREFIX}-gcc
|
|
|
|
test -L ${XPREFIX}-g++ || ln -s ../../bin/ccache ${XPREFIX}-g++
|
|
|
|
cd - > /dev/null
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
set -e
|
|
|
|
unset PKG_CONFIG_PATH
|
|
|
|
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
|
|
|
|
|
|
|
|
export CC=${XPREFIX}-gcc
|
|
|
|
export CXX=${XPREFIX}-g++
|
|
|
|
export CPP=${XPREFIX}-cpp
|
|
|
|
export AR=${XPREFIX}-ar
|
|
|
|
export LD=${XPREFIX}-ld
|
|
|
|
export NM=${XPREFIX}-nm
|
|
|
|
export AS=${XPREFIX}-as
|
|
|
|
export STRIP=${XPREFIX}-strip
|
|
|
|
export WINRC=${XPREFIX}-windres
|
|
|
|
export RANLIB=${XPREFIX}-ranlib
|
|
|
|
export DLLTOOL=${XPREFIX}-dlltool
|
|
|
|
|
2023-04-21 20:53:50 -04:00
|
|
|
if grep -q optimize <<<"$ARDOURCFG"; then
|
|
|
|
OPT=""
|
|
|
|
else
|
|
|
|
# debug-build luabindings.cc, has > 60k symbols.
|
|
|
|
# -Wa,-mbig-obj has an unreasonable long build-time
|
|
|
|
# so libs/ardour/wscript only uses it for luabindings.cc.
|
|
|
|
# session.cc is also big, -Og to the rescue.
|
|
|
|
OPT=" -Og"
|
|
|
|
fi
|
|
|
|
|
|
|
|
CFLAGS="-mstackrealign$OPT" \
|
|
|
|
CXXFLAGS="-mstackrealign$OPT" \
|
2017-09-20 08:15:27 -04:00
|
|
|
LDFLAGS="-L${PREFIX}/lib" \
|
2017-09-20 08:06:04 -04:00
|
|
|
DEPSTACK_ROOT="$PREFIX" \
|
2017-09-20 08:15:27 -04:00
|
|
|
./waf configure \
|
2017-02-19 10:01:25 -05:00
|
|
|
--keepflags \
|
2014-10-21 14:16:10 -04:00
|
|
|
--dist-target=mingw \
|
|
|
|
--also-include=${PREFIX}/include \
|
|
|
|
$ARDOURCFG \
|
2020-01-21 18:47:33 -05:00
|
|
|
--prefix=${PREFIX} \
|
|
|
|
--libdir=${PREFIX}/lib
|
2017-09-20 08:15:27 -04:00
|
|
|
|
2014-11-21 17:12:17 -05:00
|
|
|
./waf ${CONCURRENCY}
|
2015-03-11 21:36:01 -04:00
|
|
|
|
2015-03-11 22:52:10 -04:00
|
|
|
if [ "$(id -u)" = "0" ]; then
|
|
|
|
apt-get -qq -y install gettext
|
|
|
|
fi
|
2015-03-11 21:36:01 -04:00
|
|
|
echo " === build complete, creating translations"
|
|
|
|
./waf i18n
|
|
|
|
echo " === done"
|