Created
July 18, 2015 14:54
-
-
Save sfan5/ce997a53b5e3cc39dfad to your computer and use it in GitHub Desktop.
Builds CubicSDR (statically linked with liquid-dsp)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
CORES=4 | |
OUTDIR=/tmp/cubicsdr_install | |
CUBICSDR_STABLE=1 # 1 for latest tagged version or 0 for git HEAD | |
[ -d CubicSDR ] && (cd CubicSDR && git pull) || git clone https://github.com/cjcliffe/CubicSDR | |
[ -d liquid-dsp ] && (cd liquid-dsp && git pull) || git clone https://github.com/jgaeddert/liquid-dsp | |
cd liquid-dsp | |
./bootstrap.sh | |
# can't build in seperate dir because build files of liquid-dsp suck | |
[ -e Makefile ] && make distclean | |
./configure | |
make -j$CORES | |
make DESTDIR=`pwd`/_install install | |
# force CubicSDR to link to liquid-dsp statically: | |
rm -f ./_install/usr/local/lib/libliquid.so | |
LQDSP_PATH=`pwd`/_install/usr/local | |
cd .. | |
cd CubicSDR | |
if [ $CUBICSDR_STABLE -eq 1 ]; then | |
git checkout 0.1.3 | |
else | |
git checkout master | |
fi | |
[ -d _bld ] && rm -Rf _bld | |
mkdir _bld | |
cd _bld | |
cmake .. \ | |
-DCMAKE_EXE_LINKER_FLAGS="-L$LQDSP_PATH/lib" \ | |
-DCMAKE_C_FLAGS="-I$LQDSP_PATH/include" \ | |
-DCMAKE_CXX_FLAGS="-I$LQDSP_PATH/include" \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DCMAKE_INSTALL_PREFIX=$OUTDIR \ | |
-DRTLSDR_INCLUDE=/usr/include \ | |
-DRTLSDR_LIB=/usr/lib | |
make -j$CORES | |
DIRNAME=x86 | |
[ -d x64 ] && DIRNAME=x64 | |
mkdir -p $OUTDIR | |
cp -Rv $DIRNAME/* $OUTDIR/ | |
cd ../.. | |
echo "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment