3 # we assuem this script is <ardour-src>/tools/x-win/compile.sh
4 pushd "`/usr/bin/dirname \"$0\"`" > /dev/null; this_script_dir="`pwd`"; popd > /dev/null
5 cd $this_script_dir/../..
6 test -f gtk2_ardour/wscript || exit 1
8 : ${XARCH=i686} # or x86_64
12 if test "$XARCH" = "x86_64" -o "$XARCH" = "amd64"; then
13 echo "Target: 64bit Windows (x86_64)"
14 XPREFIX=x86_64-w64-mingw32
16 DEBIANPKGS="mingw-w64"
18 echo "Target: 32 Windows (i686)"
19 XPREFIX=i686-w64-mingw32
21 DEBIANPKGS="gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-tools mingw32"
24 : ${PREFIX=${ROOT}/win-stack-$WARCH}
26 if test -z "${ARDOURCFG}"; then
27 if test -f ${PREFIX}/include/pa_asio.h; then
28 ARDOURCFG="--windows-vst --with-backends=jack,dummy,wavesaudio"
30 ARDOURCFG="--windows-vst --with-backends=jack,dummy"
34 if [ "$(id -u)" = "0" ]; then
35 apt-get -qq -y install build-essential \
37 git autoconf automake libtool pkg-config yasm python
39 #fixup mingw64 ccache for now
40 if test -d /usr/lib/ccache -a -f /usr/bin/ccache; then
41 export PATH="/usr/lib/ccache:${PATH}"
43 test -L ${XPREFIX}-gcc || ln -s ../../bin/ccache ${XPREFIX}-gcc
44 test -L ${XPREFIX}-g++ || ln -s ../../bin/ccache ${XPREFIX}-g++
49 ################################################################################
52 export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
54 export CC=${XPREFIX}-gcc
55 export CXX=${XPREFIX}-g++
56 export CPP=${XPREFIX}-cpp
57 export AR=${XPREFIX}-ar
58 export LD=${XPREFIX}-ld
59 export NM=${XPREFIX}-nm
60 export AS=${XPREFIX}-as
61 export STRIP=${XPREFIX}-strip
62 export WINRC=${XPREFIX}-windres
63 export RANLIB=${XPREFIX}-ranlib
64 export DLLTOOL=${XPREFIX}-dlltool
66 if grep -q optimize <<<"$ARDOURCFG"; then
69 #debug-build luabindings.cc, has > 60k symbols.
70 # -Wa,-mbig-obj has an unreasonable long build-time
75 CFLAGS="-mstackrealign$OPT" \
76 CXXFLAGS="-mstackrealign$OPT" \
77 LDFLAGS="-L${PREFIX}/lib" \
78 DEPSTACK_ROOT="$PREFIX" \
82 --also-include=${PREFIX}/include \
88 if [ "$(id -u)" = "0" ]; then
89 apt-get -qq -y install gettext
91 echo " === build complete, creating translations"