-
Notifications
You must be signed in to change notification settings - Fork 1
/
autogen-cross-rpi.sh
executable file
·80 lines (63 loc) · 1.83 KB
/
autogen-cross-rpi.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#! /bin/bash
TARGET=ggrasp
SYSROOT=/mnt/ggrasp
echo -n "*** checking cross gcc..."
if `arm-linux-gnueabihf-gcc -v > /dev/null 2>&1`; then
echo "ok"
else
echo "fail"
echo "Please install or check cross-compiler path"
echo "HINT: "
echo " mkdir -p /opt/rpi-sdk"
echo " cd /opt/rpi-sdk"
echo " git clone https://github.com/raspberrypi/tools"
echo ' echo "PATH=$PATH:/opt/rpi-sdk/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin" > ~/.profile'
echo "FATAL ERROR"
exit 1
fi
echo -n "*** checking sysroot..."
if [ ! -d ${SYSROOT} ]; then
echo "created ${SYSROOT}"
mkdir -p ${SYSROOT}
else
echo "ok"
fi
echo -n "*** mounting ${SYSROOT}..."
if [ ! -e ${SYSROOT}/usr/bin ]; then
sudo mount $TARGET:/ $SYSROOT
echo "ok"
else
echo "already mounted"
fi
echo "*** maintainer cleaning..."
make maintainer-clean
echo -n "*** other cleaning..."
rm -rf Makefile.in autom4te.cache config.* compile configure depcomp install-sh ltmain missing test-driver aclocal.m4
echo "ok"
if [ -e setup-environment.local ]; then
echo "*** setting local environment..."
source setup-environment.local
fi
echo "*** libtolizing..."
libtoolize --automake
echo "*** aclocaling..."
aclocal ${OECORE_ACLOCAL_OPTS}
echo "*** autoconfing..."
autoconf
echo "*** autoheadering..."
autoheader
echo "*** automaking..."
automake -a
export PKG_CONFIG_DIR=
export PKG_CONFIG_LIBDIR=${SYSROOT}/usr/lib/pkgconfig:${SYSROOT}/usr/local/lib/pkgconfig:${SYSROOT}/usr/share/pkgconfig:${SYSROOT}/usr/local/share/pkgconfig:${SYSROOT}/usr/lib/arm-linux-gnueabihf/pkgconfig:${SYSROOT}/usr/local/lib/arm-linux-gnueabihf/pkgconfig
export PKG_CONFIG_SYSROOT_DIR=${SYSROOT}
export PKG_CONFIG_PATH=${PKG_CONFIG_LIBDIR}
echo "*** configuring..."
./configure \
--host=arm-linux-gnueabihf \
--with-sysroot=${SYSROOT} \
CFLAGS="--sysroot=${SYSROOT} ${CFLAGS}" \
$@
echo ""
echo "done."
exit