aboutsummaryrefslogtreecommitdiffstats
path: root/release/build-compat-linux-m32
blob: 0e43c858fffe1edb8be68897895aa4bc46024c82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
# This script wraps build-xorg-7.4 to enable building a version of TigerVNC
# which is compatible across Linux distributions.  It is identical to
# build-compat-linux, except that it adds the necessary arguments to cross-
# compile a 32-bit version of TigerVNC on a 64-bit system.

set -e

if [ "$1" = "" ]; then
	echo USAGE: $0  init \| build \| update
	exit 0
fi

SCRIPTDIR=`dirname $0`
pushd $SCRIPTDIR/../unix
if [ ! -d ./xorg.build/lib ]; then
	mkdir -p ./xorg.build/lib
fi
CFLAGS='-m32 -O3 -static-libgcc'
CXXFLAGS=$CFLAGS
LDFLAGS=$CFLAGS' -L'`pwd`'/xorg.build/lib'
export CFLAGS
export CXXFLAGS
export LDFLAGS
if [ -f ./xorg.build/lib/libstdc++.a ]; then
	rm -f ./xorg.build/lib/libstdc++.a
fi
ln -fs `gcc $CFLAGS -print-file-name=libstdc++.a` ./xorg.build/lib
if [ -f ./xorg.build/lib/libcrypto.a ]; then
	rm -f ./xorg.build/lib/libcrypto.a
fi
ln -fs /usr/lib/libcrypto.a ./xorg.build/lib
. build-xorg-7.4 $1 -static --host i686-pc-linux-gnu
popd