soxr-code/inst-check-soxr

44 lines
1.0 KiB
Plaintext
Raw Normal View History

2013-01-09 20:43:37 +01:00
#!/bin/sh
set -e
2013-01-09 20:43:37 +01:00
# 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`
# Determine library:
2013-01-09 20:43:37 +01:00
if [ `basename $0` = inst-check-soxr ]; then
libs=$(pkg-config --libs soxr)
2013-01-09 20:43:37 +01:00
else
libs=$(pkg-config --libs soxr-lsr)
a=a # Files for soxr-lsr have 'a' suffix on example number.
2013-01-09 20:43:37 +01:00
fi
# Build the examples for this lib, C then C++ (if any):
stat -t ?$a-*.c >/dev/null 2>&1 && for f in ?$a-*.c; do
echo "cc -I\"$src\" $f $libs -o $tmp/$f.out"
cc -I"$src" $f $libs -o $tmp/$f.out
done
stat -t ?$a-*.C >/dev/null 2>&1 && for f in ?$a-*.C; do
echo "c++ -I\"$src\" $f $libs -o $tmp/$f.out"
c++ -I"$src" $f $libs -o $tmp/$f.out
done
2013-01-09 20:43:37 +01:00
# Run one example:
for f in $tmp/1*.out; do
echo $f
$f
done
2013-01-09 20:43:37 +01:00
# Tidy up:
rm -rf $tmp