From d1d804742ac2cfcc31240c6d74d764e5784831d4 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 7 Nov 2010 17:46:36 -0800 Subject: Make check works again, now using guile's native test-suite code. The srfi-64 code wouldn't pass it's own test code under guile... --- setup_guile_test_env.in | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 setup_guile_test_env.in (limited to 'setup_guile_test_env.in') diff --git a/setup_guile_test_env.in b/setup_guile_test_env.in new file mode 100644 index 000000000..4878a4413 --- /dev/null +++ b/setup_guile_test_env.in @@ -0,0 +1,81 @@ +#!/bin/sh + +# This is sourced by run_guile_tests to establish the environment +# variables required to run the tests in the build tree. + +abs_top_srcdir=@abs_top_srcdir@ +abs_top_builddir=@abs_top_builddir@ + + +# FIXME add in OS/X DYLD_LIBRARY_PATH +# FIXME add in cywin*/win*/mingw* PATH +# FIXME add in withdirs + + +# 1st argument is absolute path to component C++ shared library build directory +# 2nd argument is absolute path to hand coded guile source directory +# 3nd argument is absolute path to component SWIG build directory + +function add_local_paths(){ + if [ $# -ne 3 ] + then + echo "$0: requires 3 args" 1>&2 + exit 1 + fi + echo FIXME: $0: implement add_local_paths + # [ -n "$1" ] && prepend LTDL_LIBRARY_PATH "$1/.libs" + # [ -n "$2" ] && prepend GUILE_LOAD_PATH "$2" + # [ -n "$3" ] && prepend LTDL_LIBRARY_PATH "$3/.libs" + # [ -n "$3" ] && prepend GUILE_LOAD_PATH "$3/guile" +} + +# usage: prepend +function prepend(){ + if [ $# -ne 2 ] + then + echo "$0: prepend needs 2 args" 1>&2 + exit 1 + fi + local path="$1" dir="$2" contents="" + eval "contents=\$$path" + #echo "path = $path" + #echo "dir = $dir" + #echo "contents = $contents" + if [ "$dir" != "" ] + then + if [ "$contents" = "" ] + then + eval "$path=\"$dir\"" + else + eval "$path=\"$dir:$contents\"" + fi + fi + + #echo end-of-prepend: $path=${!path} +} + +# ------------------------------------------------------------------------ +# Everybody gets gruel and gnuradio-core for free. +# FIXME Eventually this should be gruel and gnuradio-runtime. +# ------------------------------------------------------------------------ + +# Where to search for not yet installed C++ shared libraries +prepend mylibdir $abs_top_builddir/gruel/src/lib/.libs +prepend mylibdir $abs_top_builddir/gnuradio-core/src/lib/.libs + +# Where to search for not yet installed swig generated guile libs +prepend mylibdir $abs_top_builddir/gnuradio-core/src/lib/swig/.libs + +# Where to seach for guile code. +prepend guile_load_path $abs_top_srcdir/gnuradio-core/src/guile +prepend guile_load_path $abs_top_builddir/gnuradio-core/src/lib/swig + +#echo "mylibdir = $mylibdir" +#echo "guile_load_path = $guile_load_path" + +prepend LTDL_LIBRARY_PATH "$mylibdir" +prepend GUILE_LOAD_PATH "$guile_load_path" + +export LTDL_LIBRARY_PATH +export GUILE_LOAD_PATH +export GUILE_WARN_DEPRECATED=no -- cgit From 76e2fa796a42df7951f05f73428e178c84879b79 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 12 Nov 2010 15:04:10 -0800 Subject: make check in gr-audio-alsa now confirms ability to load guile bindings. --- setup_guile_test_env.in | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'setup_guile_test_env.in') diff --git a/setup_guile_test_env.in b/setup_guile_test_env.in index 4878a4413..23456f31d 100644 --- a/setup_guile_test_env.in +++ b/setup_guile_test_env.in @@ -12,8 +12,8 @@ abs_top_builddir=@abs_top_builddir@ # FIXME add in withdirs -# 1st argument is absolute path to component C++ shared library build directory -# 2nd argument is absolute path to hand coded guile source directory +# 1st argument is absolute path to hand coded guile source directory +# 2nd argument is absolute path to component C++ shared library build directory # 3nd argument is absolute path to component SWIG build directory function add_local_paths(){ @@ -22,11 +22,10 @@ function add_local_paths(){ echo "$0: requires 3 args" 1>&2 exit 1 fi - echo FIXME: $0: implement add_local_paths - # [ -n "$1" ] && prepend LTDL_LIBRARY_PATH "$1/.libs" - # [ -n "$2" ] && prepend GUILE_LOAD_PATH "$2" - # [ -n "$3" ] && prepend LTDL_LIBRARY_PATH "$3/.libs" - # [ -n "$3" ] && prepend GUILE_LOAD_PATH "$3/guile" + [ -n "$1" ] && prepend GUILE_LOAD_PATH "$1" + [ -n "$2" ] && prepend LTDL_LIBRARY_PATH "$2/.libs" + [ -n "$3" ] && prepend LTDL_LIBRARY_PATH "$3/.libs" + [ -n "$3" ] && prepend GUILE_LOAD_PATH "$3" } # usage: prepend -- cgit From d0bb24f6dd4c50569ea40fc41768ba35a4509415 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 12 Nov 2010 15:27:29 -0800 Subject: Avoid entering duplicate directory into LTDL_LIBRARY_PATH --- setup_guile_test_env.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup_guile_test_env.in') diff --git a/setup_guile_test_env.in b/setup_guile_test_env.in index 23456f31d..ee7e9ea46 100644 --- a/setup_guile_test_env.in +++ b/setup_guile_test_env.in @@ -24,7 +24,7 @@ function add_local_paths(){ fi [ -n "$1" ] && prepend GUILE_LOAD_PATH "$1" [ -n "$2" ] && prepend LTDL_LIBRARY_PATH "$2/.libs" - [ -n "$3" ] && prepend LTDL_LIBRARY_PATH "$3/.libs" + [ -n "$3" -a "$2" != "$3" ] && prepend LTDL_LIBRARY_PATH "$3/.libs" [ -n "$3" ] && prepend GUILE_LOAD_PATH "$3" } -- cgit From ff62557a42b6ce89a711f9d0603c0fe52a891ed8 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 21 Nov 2010 16:01:48 -0800 Subject: Make Guile bindings work with --with-gnuradio-core et al. --- setup_guile_test_env.in | 129 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 100 insertions(+), 29 deletions(-) (limited to 'setup_guile_test_env.in') diff --git a/setup_guile_test_env.in b/setup_guile_test_env.in index ee7e9ea46..f143685c0 100644 --- a/setup_guile_test_env.in +++ b/setup_guile_test_env.in @@ -1,16 +1,26 @@ -#!/bin/sh +# +# Copyright 2010 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# # This is sourced by run_guile_tests to establish the environment # variables required to run the tests in the build tree. -abs_top_srcdir=@abs_top_srcdir@ -abs_top_builddir=@abs_top_builddir@ - - -# FIXME add in OS/X DYLD_LIBRARY_PATH -# FIXME add in cywin*/win*/mingw* PATH -# FIXME add in withdirs - +# add_local_paths is the only "public" function in this file # 1st argument is absolute path to hand coded guile source directory # 2nd argument is absolute path to component C++ shared library build directory @@ -22,12 +32,23 @@ function add_local_paths(){ echo "$0: requires 3 args" 1>&2 exit 1 fi - [ -n "$1" ] && prepend GUILE_LOAD_PATH "$1" - [ -n "$2" ] && prepend LTDL_LIBRARY_PATH "$2/.libs" - [ -n "$3" -a "$2" != "$3" ] && prepend LTDL_LIBRARY_PATH "$3/.libs" - [ -n "$3" ] && prepend GUILE_LOAD_PATH "$3" + + # Add local dirs to the front + prepend_to_guile_load_path "$1" + prepend_to_libpath "$2/.libs" + [ "$2" != "$3" ] && prepend_to_libpath "$3/.libs" + prepend_to_guile_load_path "$3" + + # Add withdirs to the end + append_to_guile_load_path "@with_GUILE_LOAD_PATH@" + append_to_libpath "@with_LIBDIRPATH@" } +# ------------------------------------------------------------------------ + +abs_top_srcdir=@abs_top_srcdir@ +abs_top_builddir=@abs_top_builddir@ + # usage: prepend function prepend(){ if [ $# -ne 2 ] @@ -37,9 +58,6 @@ function prepend(){ fi local path="$1" dir="$2" contents="" eval "contents=\$$path" - #echo "path = $path" - #echo "dir = $dir" - #echo "contents = $contents" if [ "$dir" != "" ] then if [ "$contents" = "" ] @@ -49,32 +67,85 @@ function prepend(){ eval "$path=\"$dir:$contents\"" fi fi - #echo end-of-prepend: $path=${!path} } +# usage: append +function append(){ + if [ $# -ne 2 ] + then + echo "$0: append needs 2 args" 1>&2 + exit 1 + fi + local path="$1" dir="$2" contents="" + eval "contents=\$$path" + if [ "$dir" != "" ] + then + if [ "$contents" = "" ] + then + eval "$path=\"$dir\"" + else + eval "$path=\"$contents:$dir\"" + fi + fi + #echo end-of-append: $path=${!path} +} + +function prepend_to_guile_load_path(){ + prepend GUILE_LOAD_PATH "$1" + export GUILE_LOAD_PATH +} + +function append_to_guile_load_path(){ + append GUILE_LOAD_PATH "$1" + export GUILE_LOAD_PATH +} + +function prepend_to_libpath(){ + prepend LTDL_LIBRARY_PATH "$1" + export LTDL_LIBRARY_PATH + case "@host_os@" in + darwin*) + prepend DYLD_LIBRARY_PATH "$1" + export DYLD_LIBRARY_PATH + ;; + cygwin*|win*|mingw*) + prepend PATH "$1" + export PATH + ;; + esac +} + +function append_to_libpath(){ + append LTDL_LIBRARY_PATH "$1" + export LTDL_LIBRARY_PATH + case "@host_os@" in + darwin*) + append DYLD_LIBRARY_PATH "$1" + export DYLD_LIBRARY_PATH + ;; + cygwin*|win*|mingw*) + append PATH "$1" + export PATH + ;; + esac +} + # ------------------------------------------------------------------------ # Everybody gets gruel and gnuradio-core for free. # FIXME Eventually this should be gruel and gnuradio-runtime. # ------------------------------------------------------------------------ # Where to search for not yet installed C++ shared libraries -prepend mylibdir $abs_top_builddir/gruel/src/lib/.libs -prepend mylibdir $abs_top_builddir/gnuradio-core/src/lib/.libs +prepend_to_libpath $abs_top_builddir/gruel/src/lib/.libs +prepend_to_libpath $abs_top_builddir/gnuradio-core/src/lib/.libs # Where to search for not yet installed swig generated guile libs -prepend mylibdir $abs_top_builddir/gnuradio-core/src/lib/swig/.libs +prepend_to_libpath $abs_top_builddir/gnuradio-core/src/lib/swig/.libs # Where to seach for guile code. -prepend guile_load_path $abs_top_srcdir/gnuradio-core/src/guile -prepend guile_load_path $abs_top_builddir/gnuradio-core/src/lib/swig - -#echo "mylibdir = $mylibdir" -#echo "guile_load_path = $guile_load_path" +prepend_to_guile_load_path $abs_top_srcdir/gnuradio-core/src/guile +prepend_to_guile_load_path $abs_top_builddir/gnuradio-core/src/lib/swig -prepend LTDL_LIBRARY_PATH "$mylibdir" -prepend GUILE_LOAD_PATH "$guile_load_path" -export LTDL_LIBRARY_PATH -export GUILE_LOAD_PATH export GUILE_WARN_DEPRECATED=no -- cgit From c69cf50c8c553377d1ad9d353b207d57f5d3a47d Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Tue, 7 Dec 2010 13:19:06 -0800 Subject: Change shell function definitions to use POSIX syntax --- setup_guile_test_env.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'setup_guile_test_env.in') diff --git a/setup_guile_test_env.in b/setup_guile_test_env.in index f143685c0..a95d54e74 100644 --- a/setup_guile_test_env.in +++ b/setup_guile_test_env.in @@ -26,7 +26,7 @@ # 2nd argument is absolute path to component C++ shared library build directory # 3nd argument is absolute path to component SWIG build directory -function add_local_paths(){ +add_local_paths() { if [ $# -ne 3 ] then echo "$0: requires 3 args" 1>&2 @@ -50,7 +50,7 @@ abs_top_srcdir=@abs_top_srcdir@ abs_top_builddir=@abs_top_builddir@ # usage: prepend -function prepend(){ +prepend() { if [ $# -ne 2 ] then echo "$0: prepend needs 2 args" 1>&2 @@ -71,7 +71,7 @@ function prepend(){ } # usage: append -function append(){ +append() { if [ $# -ne 2 ] then echo "$0: append needs 2 args" 1>&2 @@ -91,17 +91,17 @@ function append(){ #echo end-of-append: $path=${!path} } -function prepend_to_guile_load_path(){ +prepend_to_guile_load_path() { prepend GUILE_LOAD_PATH "$1" export GUILE_LOAD_PATH } -function append_to_guile_load_path(){ +append_to_guile_load_path() { append GUILE_LOAD_PATH "$1" export GUILE_LOAD_PATH } -function prepend_to_libpath(){ +prepend_to_libpath() { prepend LTDL_LIBRARY_PATH "$1" export LTDL_LIBRARY_PATH case "@host_os@" in @@ -116,7 +116,7 @@ function prepend_to_libpath(){ esac } -function append_to_libpath(){ +append_to_libpath() { append LTDL_LIBRARY_PATH "$1" export LTDL_LIBRARY_PATH case "@host_os@" in -- cgit From 2ceb37ef2f80289c4126c48c7cf05fde85fda019 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 10 Dec 2010 16:38:57 -0800 Subject: Add guile/.libs to libpath --- setup_guile_test_env.in | 1 + 1 file changed, 1 insertion(+) (limited to 'setup_guile_test_env.in') diff --git a/setup_guile_test_env.in b/setup_guile_test_env.in index a95d54e74..1a73d337d 100644 --- a/setup_guile_test_env.in +++ b/setup_guile_test_env.in @@ -139,6 +139,7 @@ append_to_libpath() { # Where to search for not yet installed C++ shared libraries prepend_to_libpath $abs_top_builddir/gruel/src/lib/.libs prepend_to_libpath $abs_top_builddir/gnuradio-core/src/lib/.libs +prepend_to_libpath $abs_top_builddir/gnuradio-core/src/guile/.libs # Where to search for not yet installed swig generated guile libs prepend_to_libpath $abs_top_builddir/gnuradio-core/src/lib/swig/.libs -- cgit