aboutsummaryrefslogtreecommitdiffstats
path: root/userdata/conf/tools.sh
blob: bf2963f6083ebbad6a47f9f5a6aa1bf071a08837 (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
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Copyright (c) 2014 Cogent Embedded, Inc.

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

# DESCRIPTION
# This script defines (or calls env. setup script) build variables for ${PLATFORM}


function export_tools () {
    AS=$PREFIX-as
    CC=$PREFIX-gcc
    AR=$PREFIX-ar
    RANLIB=$PREFIX-ranlib
    CXX=$PREFIX-g++
    CPP=$PREFIX-cpp
    CXXCPP=$PREFIX-cpp
    LD=$PREFIX-ld
    #LDFLAGS="--sysroot ${SDKROOT} -lm"
}

if [ "${PLATFORM}" = "porter" ];
then
        # SDKROOT=$JTA_ENGINE_PATH/tools/qemu-arm/sysroots/armv5te-osv-linux-gnueabi
        # environment script changes PATH in the way that python uses libs from sysroot which is not what we want, so save it and use later
        ORIG_PATH=$PATH
        PREFIX=arm-poky-linux-gnueabi
        source /userdata/toolchains/poky-agl/environment-setup-cortexa15hf-vfp-neon-poky-linux-gnueabi
        SDKROOT=/userdata/toolchains/poky-agl/sysroots/cortexa15hf-vfp-neon-poky-linux-gnueabi/
        HOST=arm-poky-linux-gnueabi

        unset PYTHONHOME
        env -u PYTHONHOME
elif [ "${PLATFORM}" = "lager" ];
then
        SDKROOT=/userdata/toolchains/lager-poky-toolchain/sysroots/cortexa15hf-vfp-neon-poky-linux-gnueabi
        # environment script changes PATH in the way that python uses libs from sysroot which is not what we want, so save it and use later
        ORIG_PATH=$PATH

        PREFIX=arm-poky-linux-gnueabi
        source /userdata/toolchains/lager-poky-toolchain/environment-setup-cortexa15hf-vfp-neon-poky-linux-gnueabi
        HOST=arm-poky-linux-gnueabi

        unset PYTHONHOME
        env -u PYTHONHOME
elif [ "${PLATFORM}" = "minnow" ];
then
        SDKROOT=/userdata/toolchains/minnow/sysroots/corei7-64-poky-linux
        # environment script changes PATH in the way that python uses libs from sysroot which is not what we want, so save it and use later
        ORIG_PATH=$PATH

        PREFIX=x86_64-poky-linux
        source /userdata/toolchains/minnow/environment-setup-corei7-64-poky-linux
        HOST=x86_64-poky-linux

        unset PYTHONHOME
        env -u PYTHONHOME
elif [ "${PLATFORM}" = "qemu-armv7hf" ];
then
    export CC=arm-linux-gnueabihf-gcc
    export CXX=arm-linux-gnueabihf-g++
    export CXX=arm-linux-gnueabihf-g++
    export CONFIGURE_FLAGS="--target=arm-linux-gnueabihf --host=arm-linux-gnueabihf --build=x86_64-linux"
    export AS=arm-linux-gnueabihf-as
    export LD=arm-linux-gnueabihf-ld
    export ARCH=arm
    export CROSS_COMPILE=arm-linux-gnueabihf-
    export PREFIX=arm-linux-gnueabihf
    HOST=arm-linux

    # environment script changes PATH in the way that python uses libs from sysroot which is not what we want, so save it and use later

    ORIG_PATH=$PATH

    unset PYTHONHOME
    env -u PYTHONHOME
fi