Project import
diff --git a/build_opus.sh b/build_opus.sh
new file mode 100755
index 0000000..e4651b9
--- /dev/null
+++ b/build_opus.sh
@@ -0,0 +1,84 @@
+#!/bin/bash
+
+set -e
+
+INSTALL_CMD=install-strip
+if [[ $# -gt 0 ]]; then
+ INSTALL_CMD=$1
+fi
+
+OPUS_CFLAGS='-O2 -march=armv6k -mtune=arm1136j-s'
+OPUS_LDFLAGS='-O2'
+
+OPUS=opus-1.1
+OPUS_SOURCE=$OPUS.tar.gz
+OPUS_TOOLS=opus-tools-0.1.9
+OPUS_TOOLS_SOURCE=$OPUS_TOOLS.tar.gz
+
+source ../../a5s_linux_sdk/ambarella/build/env/CodeSourcery.env
+PATH=$PATH:$ARM_LINUX_TOOLCHAIN_DIR/bin
+
+TOP=`pwd`
+
+rm -rf dist
+mkdir dist
+rm -rf build
+mkdir build
+
+# BUILD OPUS
+cd build
+tar zxfv ../$OPUS_SOURCE
+cd $OPUS
+
+./configure --enable-fixed-point \
+ --host=arm-none-linux-gnueabi \
+ -prefix=$TOP/dist \
+ CFLAGS="$OPUS_CFLAGS" \
+ LDFLAGS="$OPUS_LDFLAGS"
+make V=1
+make $INSTALL_CMD
+
+cd ../..
+
+# BUILD OPUS-TOOLS
+cd build
+tar zxfv ../$OPUS_TOOLS_SOURCE
+cd $OPUS_TOOLS
+
+(
+ PKG_CONFIG_LIBDIR=$TOP/dist/lib/pkgconfig
+ PKG_CONFIG_PATH=$TOP/../speex/dist/lib/pkgconfig
+
+ # Check if ogg is installed
+ if pkg-config --exists ogg; then
+ echo "libogg found! Starting opus-tools build"
+
+ ./configure \
+ --host=arm-none-linux-gnueabi \
+ -prefix=$TOP/dist \
+ --without-flac \
+ --with-ogg=$TOP/../speex/dist \
+ --with-opus=$TOP/dist \
+ CFLAGS="$OPUS_CFLAGS" \
+ LDFLAGS="$OPUS_LDFLAGS"
+ make V=1
+ make $INSTALL_CMD
+ else
+ echo "libogg not found; to build opus-tools, first build speex package for libogg"
+ fi
+)
+
+cd ../..
+
+# CLEANUP
+rm -rf fakeroot
+mkdir -p fakeroot/usr/lib
+cp -d dist/lib/libopus.so* fakeroot/usr/lib/
+tar cjfv opus.tar.bz2 fakeroot
+cp opus.tar.bz2 ../../a5s_linux_sdk/ambarella/boards/dropcam/rootfs
+
+rm -rf build_dist
+mkdir build_dist
+cp -d -r dist/include build_dist/
+cp -d -r dist/lib build_dist/
+tar cjfv opus-build-dist.tar.bz2 build_dist/*
diff --git a/opus-1.1.tar.gz b/opus-1.1.tar.gz
new file mode 100644
index 0000000..0a72315
--- /dev/null
+++ b/opus-1.1.tar.gz
Binary files differ
diff --git a/opus-tools-0.1.9.tar.gz b/opus-tools-0.1.9.tar.gz
new file mode 100644
index 0000000..3a13a67
--- /dev/null
+++ b/opus-tools-0.1.9.tar.gz
Binary files differ