soxr-code/inst-check-soxr

29 lines
713 B
Bash
Executable File

#!/bin/sh
# SoX Resampler Library Copyright (c) 2007-13 robs@users.sourceforge.net
# Licence for this file: LGPL v2.1 See LICENCE for details.
# Sanity-check of library installed on unix-like system
dir="$(dirname $(readlink -f $0))"
# Find the examples:
src="$1"
test x"$src" = x && src="$dir/examples"
cd $src
# Somewhere to put the binaries:
tmp=`mktemp -d`
# Build the examples:
if [ `basename $0` = inst-check-soxr ]; then
for f in ?-*.[cC]; do cc -I"$dir/src" $f -lsoxr -o $tmp/$f.out || exit 1; done
else
for f in ?a-*.[cC]; do cc -I"$dir/src" $f -lsoxr-lsr -o $tmp/$f.out || exit 1; done
fi
# Run one example:
$tmp/1*out > /dev/null || exit 1
# Tidy up:
rm -rf $tmp