diff --git a/inst-check b/inst-check new file mode 100755 index 0000000..a813aea --- /dev/null +++ b/inst-check @@ -0,0 +1,12 @@ +#!/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 + +# Where are the example source files: +src=$1 +test x$src = x && src=/usr/local/share/doc/libsoxr/examples + +dir="$(dirname $(readlink -f $0))" +$dir/inst-check-soxr $src && $dir/inst-check-soxr-lsr $src diff --git a/inst-check-soxr b/inst-check-soxr new file mode 100755 index 0000000..0975b46 --- /dev/null +++ b/inst-check-soxr @@ -0,0 +1,28 @@ +#!/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 diff --git a/inst-check-soxr-lsr b/inst-check-soxr-lsr new file mode 120000 index 0000000..ec971fb --- /dev/null +++ b/inst-check-soxr-lsr @@ -0,0 +1 @@ +inst-check-soxr \ No newline at end of file