Octave/ : Fix 'make distcheck'.

This commit is contained in:
Erik de Castro Lopo 2012-11-30 21:44:02 +11:00
parent 5ff2328935
commit 1a6293bdc7
2 changed files with 25 additions and 13 deletions

View File

@ -76,3 +76,4 @@ uninstall-local :
clean-local :
rm -f sndfile.o sndfile.oct
@if test $(abs_builddir) != $(abs_srcdir) ; then rm -f PKG_ADD ; fi

View File

@ -2,20 +2,28 @@
# Check where we're being run from.
if [ -d Octave ]; then
if test -d Octave ; then
cd Octave
octave_src_dir=$(pwd)
elif test -z "$octave_src_dir" ; then
echo
echo "Error : \$octave_src_dir is undefined."
echo
exit 1
else
octave_src_dir=$(cd $octave_src_dir && pwd)
fi
# Find libsndfile shared object.
libsndfile_lib_location=""
if [ -f "../src/.libs/libsndfile.so" ]; then
if test -f "../src/.libs/libsndfile.so" ; then
libsndfile_lib_location="../src/.libs/"
elif [ -f "../src/libsndfile.so" ]; then
elif test -f "../src/libsndfile.so" ; then
libsndfile_lib_location="../src/"
elif [ -f "../src/.libs/libsndfile.dylib" ]; then
elif test -f "../src/.libs/libsndfile.dylib" ; then
libsndfile_lib_location="../src/.libs/"
elif [ -f "../src/libsndfile.dylib" ]; then
elif test -f "../src/libsndfile.dylib" ; then
libsndfile_lib_location="../src/"
else
echo
@ -30,9 +38,9 @@ libsndfile_lib_location=`(cd $libsndfile_lib_location && pwd)`
# Find sndfile.oct
sndfile_oct_location=""
if [ -f .libs/sndfile.oct ]; then
if test -f .libs/sndfile.oct ; then
sndfile_oct_location=".libs"
elif [ -f sndfile.oct ]; then
elif test -f sndfile.oct ; then
sndfile_oct_location="."
else
echo "Not able to find the sndfile.oct binaries we've just built."
@ -47,7 +55,7 @@ case `file -b $sndfile_oct_location/sndfile.oct` in
exit 0
;;
*)
echo "Not able to find the sndfile.oct binaries we've just built."
echo "Not able to find the sndfile.oct binary we just built."
exit 1
;;
esac
@ -55,16 +63,19 @@ case `file -b $sndfile_oct_location/sndfile.oct` in
# Make sure the TERM environment variable doesn't contain anything wrong.
unset TERM
# echo "octave_src_dir : $octave_src_dir"
# echo "libsndfile_lib_location : $libsndfile_lib_location"
# echo "sndfile_oct_location : $sndfile_oct_location"
export LD_LIBRARY_PATH="$libsndfile_lib_location:$LD_LIBRARY_PATH"
if test ! -f PKG_ADD ; then
cp $octave_src_dir/PKG_ADD .
fi
octave_src_dir=`(cd $octave_src_dir && pwd)`
export LD_LIBRARY_PATH="$libsndfile_lib_location:$LD_LIBRARY_PATH"
octave_script="$octave_src_dir/octave_test.m"
(cd $sndfile_oct_location && octave -qH $octave_script)
res=$?
echo
exit $res