2014-12-14 16:50:18 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2014-12-17 08:50:28 +08:00
|
|
|
if [ -z $1 ]; then
|
|
|
|
SOURCE_DIR="filter_audio/"
|
|
|
|
else
|
|
|
|
SOURCE_DIR="$1/"
|
|
|
|
fi
|
2014-12-14 16:50:18 +08:00
|
|
|
|
2014-12-17 08:50:28 +08:00
|
|
|
if [ -z "$2" ]; then
|
|
|
|
LIB_DIR="/usr/local/lib/"
|
|
|
|
INCLUDE_DIR="/usr/local/include/"
|
|
|
|
else
|
|
|
|
LIB_DIR="$2/lib/"
|
|
|
|
INCLUDE_DIR="$2/include/"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Cloning filter_audio from GitHub.com"
|
|
|
|
git clone https://github.com/irungentoo/filter_audio.git $SOURCE_DIR
|
|
|
|
|
|
|
|
echo "Compiling filter_audio"
|
2014-12-14 16:50:18 +08:00
|
|
|
cd $SOURCE_DIR
|
|
|
|
gcc -c -fPIC filter_audio.c aec/*.c agc/*.c ns/*.c other/*.c -lm -lpthread
|
|
|
|
|
2014-12-17 08:50:28 +08:00
|
|
|
echo "Creating shared object file"
|
2014-12-14 16:50:18 +08:00
|
|
|
gcc *.o -shared -o libfilteraudio.so
|
|
|
|
|
2014-12-17 08:50:28 +08:00
|
|
|
echo "Cleaning up"
|
2014-12-14 16:50:18 +08:00
|
|
|
rm *.o
|
|
|
|
|
2014-12-17 08:50:28 +08:00
|
|
|
muhcmd="cp libfilteraudio.so $LIB_DIR"
|
|
|
|
[ -z "$2" ] && muhcmd="sudo $muhcmd"
|
|
|
|
echo "Installing libfilteraudio.so with $muhcmd"
|
|
|
|
$muhcmd
|
2014-12-14 16:50:18 +08:00
|
|
|
|
2014-12-17 08:50:28 +08:00
|
|
|
muhcmd="cp *.h $INCLUDE_DIR"
|
|
|
|
[ -z "$2" ] && muhcmd="sudo $muhcmd"
|
|
|
|
echo "Installing include files with $muhcmd"
|
|
|
|
$muhcmd
|
2014-12-14 16:50:18 +08:00
|
|
|
|
|
|
|
echo "Finished."
|