Skip to content

Instantly share code, notes, and snippets.

@sfan5
Created July 18, 2015 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sfan5/ce997a53b5e3cc39dfad to your computer and use it in GitHub Desktop.
Save sfan5/ce997a53b5e3cc39dfad to your computer and use it in GitHub Desktop.
Builds CubicSDR (statically linked with liquid-dsp)
#!/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