forked from abhishek-kakkar/BeagleLogic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sigrok-build-beaglebone
executable file
·75 lines (59 loc) · 2.14 KB
/
sigrok-build-beaglebone
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
#!/bin/bash
##
## This file is part of the BeagleLogic project
##
## Copyright (C) 2014 Kumar Abhishek <[email protected]>
##
## Based on sigrok-cross-linux in sigrok-utils by Uwe Hermann.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
##
# Stop immediately on make error
set -e
# Toolchain setup (linaro)
TOOLCHAIN_TRIPLET=arm-linux-gnueabihf
C="--host=$TOOLCHAIN_TRIPLET"
# The path where the compiled packages will be installed.
PREFIX="/usr"
# Our package build directory
BUILDDIR=$PWD
# Deployment directory
DEPLOYDIR="$BUILDDIR/deploy"
PREFIXDIR="$BUILDDIR$PREFIX"
# Configure parallel compilation
PARALLEL_BUILD="-j"
# -----------------------------------------------------------------------------
P="$PREFIXDIR/lib/pkgconfig:$PREFIXDIR/lib/arm-linux-gnueabihf/pkgconfig"
C="$C --prefix=$PREFIX"
# Export pkg-config variables
export PKG_CONFIG_LIBDIR=$P
export PKG_CONFIG_SYSROOT_DIR=$BUILDDIR
# CFLAGS and LDFLAGS to be added for linking
export CFLAGS="-I$PREFIXDIR/include"
export LDFLAGS="-Wl,-rpath,$PREFIXDIR/lib \
-Wl,-rpath,$PREFIXDIR/lib/arm-linux-gnueabihf \
-L$PREFIXDIR/lib -L$PREFIXDIR/lib/arm-linux-gnueabihf"
for paths in libserialport libsigrok libsigrokdecode sigrok-cli
do
cd $paths
./autogen.sh
./configure $C
make $PARALLEL_BUILD
# We deploy twice, once into our local sysroot and into the deploy
# directory (subsequently scp'ed to the BeagleBone Black)
make DESTDIR=$DEPLOYDIR install -s
make DESTDIR=$BUILDDIR install -s
cd ..
done