forked from patchstorage/patchstorage-lv2-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local.env
68 lines (48 loc) · 2.34 KB
/
local.env
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
68
#!/bin/bash
#######################################################################################################################
# environment variables
WORKDIR=${WORKDIR:=~/lv2-workdir}
#######################################################################################################################
# check arguments
PLATFORM=$1
if [ -z "${PLATFORM}" ] || [ ! -e "plugins-dep/configs/${PLATFORM}_defconfig" ]; then
echo "Usage: $0 <platform>"
echo " Where platform can be one of: $(echo $(ls plugins-dep/configs | grep _defconfig | sed 's/_defconfig//g' | sort))"
else
#######################################################################################################################
# import defconfig variables
function DOWNLOAD_PATH { echo ""; }
function TOOLCHAIN_PATH { echo ""; }
source plugins-dep/configs/${PLATFORM}_defconfig
#######################################################################################################################
# setup directories
HOST_DIR=${WORKDIR}/${PLATFORM}/host
STAGING_DIR=${WORKDIR}/${PLATFORM}/staging
TARGET_DIR=${WORKDIR}/${PLATFORM}/target
TOOLCHAIN_DIR=${WORKDIR}/${PLATFORM}/toolchain
#######################################################################################################################
# setup compiler variables
export AR="${BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX}-gcc-ar"
export CC="${BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX}-gcc"
export CPP="${BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX}-cpp"
export CXX="${BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX}-g++"
export LD="${BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX}-ld"
export STRIP="${BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX}-strip"
export PATH="${HOST_DIR}/usr/bin":${PATH}
export PKG_CONFIG_PATH="${STAGING_DIR}/usr/lib/pkgconfig"
export CFLAGS="${BR2_TARGET_OPTIMIZATION} -I${STAGING_DIR}/usr/include"
export CXXFLAGS="${BR2_TARGET_OPTIMIZATION} -I${STAGING_DIR}/usr/include"
export LDFLAGS="${BR2_TARGET_LDFLAGS} -L${STAGING_DIR}/usr/lib"
unset CPPFLAGS
export HOST_DIR
export JUCE_TOOLCHAIN_FILE="${HOST_DIR}/usr/lib/cmake/JUCE/toolchainfile.cmake"
alias ar=${AR}
alias cc=${CC}
alias cpp=${CPP}
alias gcc=${CC}
alias g++=${CXX}
alias ld=${ld}
alias strip=${strip}
#######################################################################################################################
echo "Success! Environment is now ready to build stuff"
fi