-
Notifications
You must be signed in to change notification settings - Fork 119
/
setenv.sh
67 lines (53 loc) · 1.68 KB
/
setenv.sh
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
absolute_path=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
export MARVELL_SDK_PATH=$absolute_path
export MARVELL_ROOTFS=$MARVELL_SDK_PATH/rootfs
# Sanity check
if [ ! -d $MARVELL_ROOTFS ]; then
echo "$MARVELL_ROOTFS does not exist!"
return 1
fi
# Set up Qt environment
QT_HOST_PREFIX=$MARVELL_SDK_PATH/external/qt-everywhere-opensource-src-5.4.1/build/host
QT_HOST_BINS=$QT_HOST_PREFIX/bin
cat <<__EOF__ >$QT_HOST_BINS/qt.conf
[Paths]
Sysroot = $MARVELL_ROOTFS
Prefix = /usr/local/Qt-5.4.1
HostPrefix = $QT_HOST_PREFIX
__EOF__
export PATH=$QT_HOST_BINS:$PATH
TOOLCHAIN_PATH=$MARVELL_SDK_PATH/toolchain/bin
export PATH=$TOOLCHAIN_PATH:$PATH
export CROSS=armv7a-cros-linux-gnueabi-
export CROSS_COMPILE=${CROSS}
export AS=${CROSS}as
export CC="${CROSS}gcc --sysroot=$MARVELL_ROOTFS -marm -mfloat-abi=hard"
export CPP="${CROSS}cpp --sysroot=$MARVELL_ROOTFS -marm -mfloat-abi=hard"
export CXX="${CROSS}g++ --sysroot=$MARVELL_ROOTFS -marm -mfloat-abi=hard"
export STRIP=${CROSS}strip
export LDFLAGS="-static-libgcc -static-libstdc++"
path_to_executable=$(which $(basename ${CROSS}gcc))
if [ ! -n "${path_to_executable}" ]; then
echo "warning: ${path_to_executable} was not found in your PATH"
fi
unset path_to_executable
export SOC_BUILD=armv7a-cros-linux-gnueabi
export PKG_CONFIG_PATH=$MARVELL_ROOTFS/usr/lib/pkgconfig
export PKG_CONFIG_SYSROOT_DIR=$MARVELL_ROOTFS
export VALVE_CONFIGURE_OPTS="--host=$SOC_BUILD \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--with-sysroot=$MARVELL_ROOTFS"
valve_make_clean() {
make clean
}
valve_make() {
make $MAKE_J
}
valve_make_install() {
DESTDIR=$MARVELL_ROOTFS make install
}
valve_make_uninstall() {
DESTDIR=$MARVELL_ROOTFS make uninstall
}