More x86_64 fixes for octave modules.

This commit is contained in:
Erik de Castro Lopo 2007-08-26 12:45:48 +10:00
parent 14504e70fc
commit 511d81cbaf
3 changed files with 63 additions and 7 deletions

View File

@ -8,7 +8,7 @@ CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
EXTRA_DIST = sndfile_load.m sndfile_save.m sndfile_play.m \
octave_test.m $(oct_module_srcs)
octave_test.m octave_test.sh $(oct_module_srcs)
octconfigdir = $(exec_prefix)/share/octave/site/m
octconfig_DATA = sndfile_load.m sndfile_save.m sndfile_play.m
@ -39,16 +39,16 @@ noinst_HEADERS = format.h
# Maybe should create both dynamic and static versions and install
# the dynamic and test the static.
sfread.oct : format.cc sfread.cc
$(CXXLINK) $(OCT_CXXFLAGS) $(INCLUDES) $+ $(OCT_LIB_DIR) $(OCT_LIBS) -static $(SNDFILEDIR)/libsndfile.la
$(CXXLINK) $(OCT_CXXFLAGS) $(INCLUDES) $+ $(OCT_LIB_DIR) $(OCT_LIBS) $(SNDFILEDIR)/libsndfile.la
sfwrite.oct : format.cc sfwrite.cc
$(CXXLINK) $(OCT_CXXFLAGS) $(INCLUDES) $+ $(OCT_LIB_DIR) $(OCT_LIBS) -static $(SNDFILEDIR)/libsndfile.la
$(CXXLINK) $(OCT_CXXFLAGS) $(INCLUDES) $+ $(OCT_LIB_DIR) $(OCT_LIBS) $(SNDFILEDIR)/libsndfile.la
# Allow for the test being run in the build dir, but the test script
# being located in the source dir.
# being located in the source dir.
check :
$(srcdir)/octave_test.m
$(srcdir)/octave_test.sh
# Since the octave modules are installed in a special location, a custom install

2
Octave/octave_test.m Executable file → Normal file
View File

@ -1,5 +1,3 @@
#!/usr/bin/octave -qH
# Copyright (C) 2007 Erik de Castro Lopo <erikd@mega-nerd.com>
#
# This program is free software; you can redistribute it and/or modify

58
Octave/octave_test.sh Executable file
View File

@ -0,0 +1,58 @@
#!/bin/bash
# Check where we're being run from.
if [ -d Octave ]; then
cd Octave
fi
if [ ! -f sfread.cc ]; then
echo "Can't find sfread.cc. Probably being run from incorrect dir."
exit 1
fi
# Find libsndfile shared object.
libsndfile_so_location=""
if [ -f "../src/.libs/libsndfile.so" ]; then
libsndfile_so_location="../src/.libs/"
elif [ -f "../src/libsndfile.so" ]; then
libsndfile_so_location="../src/"
else
echo "Not able to find the libsndfile.so we've just built."
exit 1
fi
libsndfile_so_location=`(cd $libsndfile_so_location && pwd)`
# Find sfread.oct and sfwrite.oct
sfread_write_oct_location=""
if [ -f .libs/sfread.oct ]; then
sfread_write_oct_location=".libs"
elif [ -f sfread.oct ]; then
sfread_write_oct_location="."
else
echo "Not able to find the sfread.oct/sfwrite.oct binaries we've just built."
exit 1
fi
case `file -b $sfread_write_oct_location/sfread.oct` in
ELF*)
;;
*)
echo "Not able to find the sfread.oct/sfwrite.oct binaries we've just built."
exit 1
;;
esac
# echo "libsndfile_so_location : $libsndfile_so_location"
# echo "sfread_write_oct_location : $sfread_write_oct_location"
LD_LIBRARY_PATH="$libsndfile_so_location:$LD_LIBRARY_PATH"
octave_script="`pwd`/octave_test.m"
(cd $sfread_write_oct_location && octave -qH $octave_script)