-
Notifications
You must be signed in to change notification settings - Fork 2
/
04_newlib
executable file
·64 lines (56 loc) · 1.15 KB
/
04_newlib
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
#!/bin/bash
#
# 04_newlib
#
# Rob Laswick
# May 2 2013
#
# Script to configure, build, and install newlib.
if [ $# -ne 3 ]; then
echo
echo
echo *** RUNNING SCRIPT STAND ALONE ***
echo
echo
WORKING_DIR=/home/rlaswick/engineering/arm-toolchain-build
PREFIX=/home/rlaswick/opt/arm-toolchain
NUM_CORES=1
else
WORKING_DIR=$1
PREFIX=$2
NUM_CORES=$3
fi
PATH=${PREFIX}/bin:$PATH
cd ${PREFIX}/bin
ln -fs arm-none-eabi-gcc arm-none-eabi-cc
cd ${WORKING_DIR}/build/newlib
rm -rf build
mkdir build
cd build
../configure \
--target=arm-none-eabi \
--prefix=${PREFIX} \
--enable-interwork \
--enable-multilib \
--disable-nls \
--disable-libssp \
--with-gcc \
--with-gnu-as \
--with-gnu-ld \
--with-system-zlib \
--disable-shared \
--disable-threads \
--disable-newlib-suplied-syscalls \
--enable-target-optspace \
--enable-lto \
--enable-newlib-reent-small \
--enable-newlib-multithread \
CFLAGS="-Os -D__DYNAMIC_REENT__ -DPREFER_SIZE_OVER_SPEED -D__BUFSIZ__=256" \
--disable-libitm || exit 1
make -j${NUM_CORES} || exit 1
make install || exit 1
echo
echo
echo
echo newlib built and installed successfully!
echo