forked from mod-audio/mod-plugin-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local.env
68 lines (48 loc) · 2.57 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:=~/mod-workdir}
#######################################################################################################################
# check arguments
PLATFORM=$1
if [ -z "${PLATFORM}" ]; then
echo "Usage: $0 <platform>"
echo " Where platform can be modduo[-static], modduox[-static], moddwarf or x86_64"
#######################################################################################################################
elif [ "${PLATFORM}" != "modduo" ] && [ "${PLATFORM}" != "modduo-static" ] && [ "${PLATFORM}" != "modduox" ] && [ "${PLATFORM}" != "modduox-static" ] && [ "${PLATFORM}" != "moddwarf" ] && [ "${PLATFORM}" != "x86_64" ]; then
echo -e "\e[0;31mPlease provide either modduo, modduox, moddwarf or x86_64 as an argument to this env file\e[0m"
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="-O3 ${BR2_TARGET_OPTIMIZATION} -isystem ${STAGING_DIR}/usr/include"
export CXXFLAGS="-O3 ${BR2_TARGET_OPTIMIZATION} -isystem ${STAGING_DIR}/usr/include"
export LDFLAGS="${BR2_TARGET_LDFLAGS} -isystem ${STAGING_DIR}/usr/lib"
unset CPPFLAGS
alias ar=${AR}
alias cc=${CC}
alias cpp=${CPP}
alias gcc=${CC}
alias g++=${CXX}
alias ld=${ld}
alias strip=${strip}
#######################################################################################################################
fi