blob: f3a0169ea80e94b9ec7845deb79dede6116db76c [file] [log] [blame]
Kévin Redon69b92d92019-01-24 16:39:20 +01001#!/bin/bash
Eric Wild4cfa9ca2019-11-28 13:50:12 +01002
Harald Welte271d4872019-06-13 18:15:38 +02003if ! [ -x "$(command -v osmo-deps.sh)" ]; then
4 echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !"
5 exit 2
6fi
7
8set -ex
9
Kévin Redon69b92d92019-01-24 16:39:20 +010010TOPDIR=`pwd`
11
Harald Welte271d4872019-06-13 18:15:38 +020012deps="$TOPDIR/deps"
13inst="$TOPDIR/install"
14export deps inst
15
Eric Wilddb9e89d2019-11-28 17:30:44 +010016
Harald Welte6312b442019-10-09 14:30:41 +020017echo
18echo "=============== libosmocore hostt build ==========="
19osmo-build-dep.sh libosmocore "" --disable-doxygen
20export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
21export LD_LIBRARY_PATH="$inst/lib"
22export PATH="$inst/bin:$PATH"
23
24echo
25echo "=============== CCID usb_gadget build ==========="
26cd $TOPDIR/ccid_host
27make clean
28make $PARALLEL_MAKE
29make clean
Eric Wilddb9e89d2019-11-28 17:30:44 +010030
Harald Welte271d4872019-06-13 18:15:38 +020031# adapted from
32echo
33echo "=============== libosmocore cross-build ==========="
34mkdir -p "$deps"
35cd "$deps"
36osmo-deps.sh libosmocore master
37cd libosmocore
38
39mkdir -p "$inst/stow"
40autoreconf --install --force
Harald Welte9db9d2e2019-11-12 12:07:53 +010041./configure --enable-static --prefix="$inst/stow/libosmocore" --host=arm-none-eabi \
42 --enable-embedded --disable-doxygen --disable-shared --disable-pseudotalloc \
43 --disable-libsctp --enable-external-tests \
44 CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror -Wno-error=deprecated -Wno-error=deprecated-declarations -Wno-error=cpp -mthumb -Os -mlong-calls -g3 -mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -I /home/laforge/projects/git/osmo-ccid-firmware/sysmoOCTSIM -Wno-error=format"
Harald Welte271d4872019-06-13 18:15:38 +020045make $PARALLEL_MAKE install
46make clean
47STOW_DIR="$inst/stow" stow --restow libosmocore
48
49export PKG_CONFIG_PATH="$inst/lib/pkgconfig"
50export LD_LIBRARY_PATH="$inst/lib"
Kévin Redon69b92d92019-01-24 16:39:20 +010051
52echo
53echo "=============== sysmoOCTSIM firmware build ==========="
54cd $TOPDIR/sysmoOCTSIM
55cd gcc
56make clean
Harald Welte271d4872019-06-13 18:15:38 +020057make SYSTEM_PREFIX="$inst" $PARALLEL_MAKE
Kévin Redon69b92d92019-01-24 16:39:20 +010058make clean