also match to pid 0x1002 in CUSBCECAdapterDetection
[deb_libcec.git] / project / RPi / build.sh
1 #!/bin/bash
2
3 SCRIPT_PATH=`dirname $0`
4 cd $SCRIPT_PATH
5 SCRIPT_PATH=`pwd`
6 cd -
7
8 if [ -z "$1" ]; then
9 DEST_DIR="/opt/libcec-rpi"
10 else
11 DEST_DIR="$1"
12 fi
13
14 source $SCRIPT_PATH/config
15
16 $SCRIPT_PATH/get-toolchain.sh && \
17 $SCRIPT_PATH/build-deps.sh && \
18 $SCRIPT_PATH/bootstrap.sh $SCRIPT_PATH/toolchain .
19
20 if [ $? -eq 0 ]; then
21 _set_toolchain_path "$SCRIPT_PATH/toolchain"
22 # configure with --enable-rpi-cec-api so we bug out if we can't find Pi support or can't build it
23 ./configure --host=$TARGET_HOST \
24 --build=`cc -dumpmachine` \
25 --prefix=$DEST_DIR \
26 --enable-debug \
27 --enable-rpi \
28 --with-rpi-include-path="${SCRIPT_PATH}/firmware/hardfp/opt/vc/include" \
29 --with-rpi-lib-path="${SCRIPT_PATH}/firmware/hardfp/opt/vc/lib" && \
30 make clean && \
31 make V=0
32
33 exit $?
34 else
35 exit 1
36 fi
37