This repository has been archived by the owner on Aug 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setenv.sh
executable file
·56 lines (44 loc) · 1.84 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
#!/bin/bash
#
# A convenience script that sets environment variables, necessary
# to use the GNU toolchain for the ARM architecture.
#
# This script sets PATH and C_INCLUDE_PATH. If you intend to link
# the toolchain's libraries (e.g. libgcc.a), other variables
# (e.g. LIBRARY_PATH) must be set as well.
#
# Make sure, you set the environment variables appropriately for your
# setup. Typically, setting TOOLCHAIN only should be enough.
#
# IMPORTANT: this script must be run as
# . ./setenv.sh
# or its longer equivalent:
# source ./setenv.sh
#
# otherwise the variables will be discarded immediately after the script completes!
# NOTE:
# Only IA32 version of the toolchain is available. In order to work properly on
# x64 systems, 'ia32-libs' must also be installed.
# toolchain is from: https://launchpad.net/gcc-arm-embedded/+download
TOOLCHAIN=/opt/arm-none-eabi/bin
FLASHER=/opt/lm4tools/lm4flash
# Add a path to gnu-none-eabi-* executables:
export PATH=$PATH:$TOOLCHAIN:$FLASHER
# After the script completes, you may check that output of
# echo $PATH
# includes the desired path. Additionally you may check if arm-none-eabi-gcc
# is found if you attempt to run this executable.
# If you have gcc installed, C_INCLUDE_PATH might be set to its include paths.
# This may be confusing when you build ARM applications, therefore this variable
# (if it exists) will be overwritten:
export C_INCLUDE_PATH=$TOOLCHAIN/arm-none-eabi/include
# After the script completes, check the effect of this variable by executing:
# `arm-none-eabi-gcc -print-prog-name=cc1` -v
#
# More info about this at:
# http://stackoverflow.com/questions/344317/where-does-gcc-look-for-c-and-c-header-files
# Export other environment variables (e.g. LIBRARY_PATH) if necessary.
# Variable TOOLCHAIN not needed anymore, it can be unset
unset CURRENTDIR
unset TOOLCHAIN
unset FLASHER