1#!/bin/sh
2# cross-compile set up for belacsound
3# assumes you have the armhf compilers and build essentials
4# also libc-dev:armhf, linux-libc-dev:armhf and libstdc++-dev:armhf
5export CC=arm-linux-gnueabihf-gcc
6export CXX=arm-linux-gnueabihf-g++
7git clone https://git.xenomai.org/xenomai-3.git
8cd xenomai-3
9scripts/bootstrap
10mkdir build
11cd build
12../configure --with-core=cobalt --enable-pshared --host=arm-linux-gnueabihf --build=arm CFLAGS="-march=armv7-a -mfpu=vfp3" --enable-dlopen-libs
13# this step installs xenomai in /usr/xenomai
14sudo make install
15# build pasm
16cd ../..
17git clone git@github.com:beagleboard/am335x_pru_package.git
18cd am335x_pru_package
19make CC=$CC
20# this step installs pasm in /usr/local
21sudo make install
22# build NE10
23cd ..
24git clone https://github.com/projectNe10/Ne10
25cd Ne10
26mkdir build
27cd build
28cmake -DGNULINUX_PLATFORM=ON ..
29make
30# build seasocks, needs libz1g:armhf
31cd ../..
32git clone https://github.com/mattgodbolt/seasocks.git
33cd seasocks
34mkdir build
35cd build
36cmake ..
37make
38# this step installs libseasocks in /usr/local
39sudo make install
40# build Bela
41cd ../..
42git clone https://github.com/BelaPlatform/Bela
43cd Bela
44cp ../Ne10/build/modules/libNE10.a ./lib/.
45mkdir -p /build/core
46# apply patch to remove offending LDFLAG
47patch Makefile bela-makefile.patch
48make CC=$CC CXX=$CXX CPPFLAGS="-I/usr/local/include" lib
49# now the Bela libs are in the Bela/lib directory
50
51