summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--config/grc_gnuradio_core.m48
-rw-r--r--configure.ac3
-rw-r--r--gnuradio-core/src/Makefile.am7
-rw-r--r--gnuradio-core/src/guile/.gitignore3
-rw-r--r--gnuradio-core/src/guile/Makefile.am38
-rw-r--r--gnuradio-core/src/guile/Swig/common.scm (renamed from gnuradio-core/src/lib/swig/Swig/common.scm)0
-rw-r--r--gnuradio-core/src/guile/gnuradio/core.scm (renamed from gnuradio-core/src/lib/swig/gnuradio/core.scm)0
-rw-r--r--gnuradio-core/src/guile/gnuradio/export-safely.scm (renamed from gnuradio-core/src/lib/swig/gnuradio/export-safely.scm)0
-rw-r--r--gnuradio-core/src/guile/gnuradio/runtime-shim.scm (renamed from gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm)0
-rw-r--r--gnuradio-core/src/guile/qa_stub.scm0
-rw-r--r--gnuradio-core/src/guile/run_guile_tests.in12
-rw-r--r--gnuradio-core/src/lib/swig/Makefile.am12
-rw-r--r--run_guile_tests.sh.in97
14 files changed, 165 insertions, 16 deletions
diff --git a/.gitignore b/.gitignore
index f8a8a0873..32f9529d0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,6 +46,7 @@ make.log
/compile
/build
/run_tests.sh
+/run_guile_tests.sh
###
### Put these here until we get this all sorted out
###
diff --git a/config/grc_gnuradio_core.m4 b/config/grc_gnuradio_core.m4
index 269634324..8cbba49ef 100644
--- a/config/grc_gnuradio_core.m4
+++ b/config/grc_gnuradio_core.m4
@@ -81,6 +81,8 @@ AC_DEFUN([GRC_GNURADIO_CORE],[
gnuradio-core/gnuradio-core.pc \
gnuradio-core/src/Makefile \
gnuradio-core/src/gen_interpolator_taps/Makefile \
+ gnuradio-core/src/guile/Makefile \
+ gnuradio-core/src/guile/run_guile_tests \
gnuradio-core/src/lib/Makefile \
gnuradio-core/src/lib/filter/Makefile \
gnuradio-core/src/lib/g72x/Makefile \
@@ -110,6 +112,10 @@ AC_DEFUN([GRC_GNURADIO_CORE],[
GRC_BUILD_CONDITIONAL(gnuradio-core, [
dnl run_tests is created from run_tests.in. Make it executable.
- AC_CONFIG_COMMANDS([run_tests_core],[chmod +x gnuradio-core/src/python/gnuradio/gr/run_tests])
+ AC_CONFIG_COMMANDS([run_tests_core],
+ [
+ chmod +x gnuradio-core/src/python/gnuradio/gr/run_tests
+ chmod +x gnuradio-core/src/guile/run_guile_tests
+ ])
])
])
diff --git a/configure.ac b/configure.ac
index 0dd74a690..d8804a0fa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -429,11 +429,12 @@ AC_SUBST(with_LIBDIRPATH)
AC_CONFIG_FILES([\
Makefile \
run_tests.sh \
+ run_guile_tests.sh \
config/Makefile
])
dnl run_tests.sh is created from run_tests.sh.in . Make it executable.
-AC_CONFIG_COMMANDS([run_tests_build], [chmod +x run_tests.sh])
+AC_CONFIG_COMMANDS([run_tests_build], [chmod +x run_tests.sh run_guile_tests.sh])
AC_OUTPUT
diff --git a/gnuradio-core/src/Makefile.am b/gnuradio-core/src/Makefile.am
index eb979fe58..648fe299e 100644
--- a/gnuradio-core/src/Makefile.am
+++ b/gnuradio-core/src/Makefile.am
@@ -1,5 +1,5 @@
#
-# Copyright 2001,2004,2009 Free Software Foundation, Inc.
+# Copyright 2001,2004,2009,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -25,5 +25,8 @@ SUBDIRS = gen_interpolator_taps lib tests
if PYTHON
SUBDIRS += python
endif
+if GUILE
+SUBDIRS += guile
+endif
-DIST_SUBDIRS = gen_interpolator_taps lib tests python utils
+DIST_SUBDIRS = gen_interpolator_taps lib tests python guile utils
diff --git a/gnuradio-core/src/guile/.gitignore b/gnuradio-core/src/guile/.gitignore
new file mode 100644
index 000000000..6a0410b79
--- /dev/null
+++ b/gnuradio-core/src/guile/.gitignore
@@ -0,0 +1,3 @@
+/Makefile
+/Makefile.in
+/run_guile_tests
diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am
new file mode 100644
index 000000000..3c21373af
--- /dev/null
+++ b/gnuradio-core/src/guile/Makefile.am
@@ -0,0 +1,38 @@
+#
+# 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 <http://www.gnu.org/licenses/>.
+#
+
+include $(top_srcdir)/Makefile.common
+
+TESTS = run_guile_tests
+
+EXTRA_DIST = run_guile_tests.in
+
+# These are the hand-code guile files for gnuradio-core.
+#
+# Swig/common.scm is glue that's required for the goops wrappers.
+# gnuradio/export-safely.scm works around some problems in the goops generated wrappers.
+# gnuradio/core.scm glues the 5 pieces of gnuradio_core_* into a single module.
+# gnuradio/runtime-shim implements "guile friendly" versions of connect & disconnect.
+
+nobase_guile_DATA = \
+ Swig/common.scm \
+ gnuradio/core.scm \
+ gnuradio/export-safely.scm \
+ gnuradio/runtime-shim.scm
+
diff --git a/gnuradio-core/src/lib/swig/Swig/common.scm b/gnuradio-core/src/guile/Swig/common.scm
index a51d3a71d..a51d3a71d 100644
--- a/gnuradio-core/src/lib/swig/Swig/common.scm
+++ b/gnuradio-core/src/guile/Swig/common.scm
diff --git a/gnuradio-core/src/lib/swig/gnuradio/core.scm b/gnuradio-core/src/guile/gnuradio/core.scm
index f13a8fb60..f13a8fb60 100644
--- a/gnuradio-core/src/lib/swig/gnuradio/core.scm
+++ b/gnuradio-core/src/guile/gnuradio/core.scm
diff --git a/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm b/gnuradio-core/src/guile/gnuradio/export-safely.scm
index 664292d2b..664292d2b 100644
--- a/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm
+++ b/gnuradio-core/src/guile/gnuradio/export-safely.scm
diff --git a/gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm b/gnuradio-core/src/guile/gnuradio/runtime-shim.scm
index c08d3947c..c08d3947c 100644
--- a/gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm
+++ b/gnuradio-core/src/guile/gnuradio/runtime-shim.scm
diff --git a/gnuradio-core/src/guile/qa_stub.scm b/gnuradio-core/src/guile/qa_stub.scm
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/gnuradio-core/src/guile/qa_stub.scm
diff --git a/gnuradio-core/src/guile/run_guile_tests.in b/gnuradio-core/src/guile/run_guile_tests.in
new file mode 100644
index 000000000..2ef160397
--- /dev/null
+++ b/gnuradio-core/src/guile/run_guile_tests.in
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# 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
+# 4rd argument is absolute path to component Guile QA test directory
+
+@top_builddir@/run_guile_tests.sh \
+ "" \
+ "" \
+ "" \
+ @abs_top_srcdir@/gnuradio-core/src/guile
diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am
index 54cbebeb1..5e003bdf2 100644
--- a/gnuradio-core/src/lib/swig/Makefile.am
+++ b/gnuradio-core/src/lib/swig/Makefile.am
@@ -56,18 +56,6 @@ nobase_swiginclude_HEADERS = \
guile/std_complex.i
-if GUILE
-# This is the top level guile file, which loads all the other scm files
-# for gnuradio. This has to be installed top level to be found in the
-# default search path.
-nobase_guile_DATA = \
- gnuradio/core.scm \
- gnuradio/export-safely.scm \
- gnuradio/runtime-shim.scm \
- Swig/common.scm
-endif
-
-
if PYTHON
AM_CPPFLAGS = -I$(srcdir) $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \
$(WITH_INCLUDES)
diff --git a/run_guile_tests.sh.in b/run_guile_tests.sh.in
new file mode 100644
index 000000000..d0dc554fe
--- /dev/null
+++ b/run_guile_tests.sh.in
@@ -0,0 +1,97 @@
+#!/bin/sh
+
+# 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
+# 4rd argument is absolute path to component Guile QA test directory
+
+if [ $# -ne 4 ]
+then
+ echo "$0: requires 4 args" 1>&2
+ exit 1
+fi
+
+abs_top_srcdir=@abs_top_srcdir@
+abs_top_builddir=@abs_top_builddir@
+
+# usage: prepend <path> <dir>
+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}
+}
+
+# ------------------------------------------------------------------------
+# For now, 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
+
+# ------------------------------------------------------------------------
+# FIXME add the stuff from the args
+
+echo $0: FIXME add stuff from args 1>&2
+
+# ------------------------------------------------------------------------
+
+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
+
+# Run everything that matches qa_*.scm and return the final result.
+
+ok=yes
+for file in $4/qa_*.scm
+do
+ # echo $file
+ @GUILE@ $file
+ r=$?
+ if [ $r -ne 0 ]
+ then
+ if [ $r -ge 128 ] # killed by a signal
+ then
+ exit $r
+ fi
+ ok=no
+ fi
+done
+
+if [ $ok = yes ]
+then
+ exit 0
+else
+ exit 1
+fi