diff options
-rw-r--r-- | config/grc_gnuradio_core.m4 | 4 | ||||
-rw-r--r-- | config/grc_gnuradio_examples.m4 | 1 | ||||
-rw-r--r-- | gnuradio-core/src/guile/Makefile.am | 15 | ||||
-rw-r--r-- | gnuradio-core/src/guile/gnuradio/scripts/.gitignore | 1 | ||||
-rwxr-xr-x | gnuradio-core/src/guile/gnuradio/scripts/gr-run-waveform.in | 40 | ||||
-rw-r--r-- | gnuradio-core/src/guile/gr-run-waveform-script.in | 51 | ||||
-rw-r--r-- | gnuradio-examples/Makefile.am | 3 | ||||
-rw-r--r-- | gnuradio-examples/waveforms/.gitignore (renamed from gnuradio-core/src/guile/example-waveforms/.gitignore) | 0 | ||||
-rw-r--r-- | gnuradio-examples/waveforms/Makefile.am (renamed from gnuradio-core/src/guile/example-waveforms/Makefile.am) | 8 | ||||
-rw-r--r-- | gnuradio-examples/waveforms/README | 23 | ||||
-rw-r--r-- | gnuradio-examples/waveforms/dial-tone.wfd (renamed from gnuradio-core/src/guile/example-waveforms/dial-tone.wfd) | 0 | ||||
-rw-r--r-- | gr-run-waveform/Makefile.am | 19 | ||||
-rw-r--r-- | gr-run-waveform/configure.ac | 3 | ||||
-rw-r--r-- | gr-run-waveform/gr-run-waveform-binary.cc (renamed from gr-run-waveform/gr-run-waveform.cc) | 0 |
14 files changed, 109 insertions, 59 deletions
diff --git a/config/grc_gnuradio_core.m4 b/config/grc_gnuradio_core.m4 index 4585b9ace..15086be0f 100644 --- a/config/grc_gnuradio_core.m4 +++ b/config/grc_gnuradio_core.m4 @@ -83,8 +83,7 @@ AC_DEFUN([GRC_GNURADIO_CORE],[ gnuradio-core/src/gen_interpolator_taps/Makefile \ gnuradio-core/src/guile/Makefile \ gnuradio-core/src/guile/run_guile_tests \ - gnuradio-core/src/guile/gnuradio/scripts/gr-run-waveform \ - gnuradio-core/src/guile/example-waveforms/Makefile \ + gnuradio-core/src/guile/gr-run-waveform-script \ gnuradio-core/src/lib/Makefile \ gnuradio-core/src/lib/filter/Makefile \ gnuradio-core/src/lib/g72x/Makefile \ @@ -118,7 +117,6 @@ AC_DEFUN([GRC_GNURADIO_CORE],[ [ chmod +x gnuradio-core/src/python/gnuradio/gr/run_tests chmod +x gnuradio-core/src/guile/run_guile_tests - chmod +x gnuradio-core/src/guile/gnuradio/scripts/gr-run-waveform ]) ]) ]) diff --git a/config/grc_gnuradio_examples.m4 b/config/grc_gnuradio_examples.m4 index 4d6116c70..0aad0c0da 100644 --- a/config/grc_gnuradio_examples.m4 +++ b/config/grc_gnuradio_examples.m4 @@ -43,6 +43,7 @@ AC_DEFUN([GRC_GNURADIO_EXAMPLES],[ gnuradio-examples/python/pfb/Makefile \ gnuradio-examples/python/usrp/Makefile \ gnuradio-examples/python/usrp2/Makefile \ + gnuradio-examples/waveforms/Makefile \ ]) GRC_BUILD_CONDITIONAL(gnuradio-examples) diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index b78225f4d..122f05d97 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -28,8 +28,8 @@ EXTRA_DIST += \ $(nobase_guile_DATA) \ $(GUILE_TESTS) - -SUBDIRS = example-waveforms +bin_SCRIPTS = \ + gr-run-waveform-script # These are the hand-coded guile files for gnuradio-core. # @@ -42,10 +42,9 @@ nobase_guile_DATA = \ Swig/common.scm \ gnuradio/core.scm \ gnuradio/export-safely.scm \ + gnuradio/run-waveform.scm \ gnuradio/runtime-shim.scm \ gnuradio/waveform.scm \ - gnuradio/run-waveform.scm \ - gnuradio/scripts/gr-run-waveform \ gnuradio/test-suite/guile-test \ gnuradio/test-suite/lib.scm @@ -70,4 +69,12 @@ libguile_gnuradio_dynl_global_la_SOURCES = dynl-global.c libguile_gnuradio_dynl_global_la_CPPFLAGS = $(GUILE_CFLAGS) libguile_gnuradio_dynl_global_la_LIBADD = $(GUILE_LIBS) +# Create a symlink from gr-run-waveform-script to gr-run-waveform +install-exec-local: + -$(RM) $(DESTDIR)$(bindir)/gr-run-waveform + (cd $(DESTDIR)$(bindir) && $(LN_S) gr-run-waveform-script gr-run-waveform) + +uninstall-local: + -$(RM) $(DESTDIR)$(bindir)/gr-run-waveform + endif diff --git a/gnuradio-core/src/guile/gnuradio/scripts/.gitignore b/gnuradio-core/src/guile/gnuradio/scripts/.gitignore deleted file mode 100644 index 64cbdbc0e..000000000 --- a/gnuradio-core/src/guile/gnuradio/scripts/.gitignore +++ /dev/null @@ -1 +0,0 @@ -gr-run-waveform diff --git a/gnuradio-core/src/guile/gnuradio/scripts/gr-run-waveform.in b/gnuradio-core/src/guile/gnuradio/scripts/gr-run-waveform.in deleted file mode 100755 index 8186d2e09..000000000 --- a/gnuradio-core/src/guile/gnuradio/scripts/gr-run-waveform.in +++ /dev/null @@ -1,40 +0,0 @@ -#!@GUILE@ \ --e main -s -!# -;;; -;;; 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/>. -;;; - -;;; Load and run a waveform defined with define-waveform -;;; -;;; usage: gr-run-waveform filename.wfd [args...] - -(load-from-path "gnuradio/run-waveform") - -(define (main args) - (if (not (>= (length args) 2)) - (let ((port (current-error-port))) - (display "usage: " port) - (display (car args) port) - (display " filename.wfd [args...]\n" port) - (exit 1))) - (apply run-waveform (cdr args))) - -;;; Local Variables: -;;; mode: scheme -;;; End: diff --git a/gnuradio-core/src/guile/gr-run-waveform-script.in b/gnuradio-core/src/guile/gr-run-waveform-script.in new file mode 100644 index 000000000..651b387e9 --- /dev/null +++ b/gnuradio-core/src/guile/gr-run-waveform-script.in @@ -0,0 +1,51 @@ +#!/bin/sh + +# usage: prepend <path-varname> <dir> +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" + if [ "$dir" != "" ] + then + if [ "$contents" = "" ] + then + eval "$path=\"$dir\"" + else + eval "$path=\"$dir:$contents\"" + fi + fi + #echo end-of-prepend: $path=${!path} +} + +prefix="@prefix@" +exec_prefix="@exec_prefix@" + +prepend GUILE_LOAD_PATH "${prefix}/share/guile/site" +prepend LTDL_LIBRARY_PATH "@libdir@" +prepend DYLD_LIBRARY_PATH "@libdir@" + +export GUILE_LOAD_PATH LTDL_LIBRARY_PATH DYLD_LIBRARY_PATH + +export GUILE_WARN_DEPRECATED="no" + +exec @GUILE@ -e main -s $0 "$@" +!# + +;;; Load and run a waveform defined with define-waveform +;;; +;;; usage: gr-run-waveform filename.wfd [args...] + +(load-from-path "gnuradio/run-waveform") + +(define (main args) + (if (not (>= (length args) 2)) + (let ((port (current-error-port))) + (display "usage: " port) + (display (car args) port) + (display " filename.wfd [args...]\n" port) + (exit 1))) + (apply run-waveform (cdr args))) diff --git a/gnuradio-examples/Makefile.am b/gnuradio-examples/Makefile.am index 9ea890c12..e0c1b1d15 100644 --- a/gnuradio-examples/Makefile.am +++ b/gnuradio-examples/Makefile.am @@ -25,3 +25,6 @@ SUBDIRS = c++ if PYTHON SUBDIRS += python grc endif +if GUILE +SUBDIRS += waveforms +endif diff --git a/gnuradio-core/src/guile/example-waveforms/.gitignore b/gnuradio-examples/waveforms/.gitignore index 16c984055..16c984055 100644 --- a/gnuradio-core/src/guile/example-waveforms/.gitignore +++ b/gnuradio-examples/waveforms/.gitignore diff --git a/gnuradio-core/src/guile/example-waveforms/Makefile.am b/gnuradio-examples/waveforms/Makefile.am index 277b4ad0b..c07020a5c 100644 --- a/gnuradio-core/src/guile/example-waveforms/Makefile.am +++ b/gnuradio-examples/waveforms/Makefile.am @@ -19,10 +19,8 @@ include $(top_srcdir)/Makefile.common -waveformdir=$(datarootdir)/gnuradio/example-waveforms +ourdatadir = $(exampledir)/waveforms -waveform_DATA = \ - dial-tone.wfd - -EXTRA_DIST += \ +dist_ourdata_DATA = \ + README \ dial-tone.wfd diff --git a/gnuradio-examples/waveforms/README b/gnuradio-examples/waveforms/README new file mode 100644 index 000000000..1f109ef53 --- /dev/null +++ b/gnuradio-examples/waveforms/README @@ -0,0 +1,23 @@ +# +# 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/>. +# + +FIXME explain this stuff :-) + +This directory contains example "Waveform Description Files" that are +designed to be loaded and run using the gr-run-waveform command. diff --git a/gnuradio-core/src/guile/example-waveforms/dial-tone.wfd b/gnuradio-examples/waveforms/dial-tone.wfd index ced3df572..ced3df572 100644 --- a/gnuradio-core/src/guile/example-waveforms/dial-tone.wfd +++ b/gnuradio-examples/waveforms/dial-tone.wfd diff --git a/gr-run-waveform/Makefile.am b/gr-run-waveform/Makefile.am index 3ab7d6fb2..75a05294d 100644 --- a/gr-run-waveform/Makefile.am +++ b/gr-run-waveform/Makefile.am @@ -27,7 +27,7 @@ EXTRA_DIST = gen-xyzzy \ guile/simple.scm # build the standalone waveform application -bin_PROGRAMS = gr-run-waveform +bin_PROGRAMS = gr-run-waveform-binary # Rather than build a library, we just use a variable so the same code # can be used in test cases, as well as the run-waveform application. @@ -64,8 +64,8 @@ test_embed_DEPENDENCIES = $(BUILT_SOURCES) noinst_HEADERS = xyzzy.h # The standalone waveform application -gr_run_waveform_SOURCES = gr-run-waveform.cc $(SRCS) -gr_run_waveform_CPPFLAGS = $(GUILE_CFLAGS) \ +gr_run_waveform_binary_SOURCES = gr-run-waveform-binary.cc $(SRCS) +gr_run_waveform_binary_CPPFLAGS = $(GUILE_CFLAGS) \ -DSRCDIR=\"$(srcdir)\" \ -DPKGLIBDIR=\"$(pkglibdir)\" \ -DDATAROOTDIR=\"$(datarootdir)\" \ @@ -73,8 +73,8 @@ gr_run_waveform_CPPFLAGS = $(GUILE_CFLAGS) \ # Uncommenting this force make to statically link in the guile library. # Note that this will fail to link it you don't have libguile.a. # run_waveform_LDFLAGS = -static -gr_run_waveform_LDADD = $(GUILE_LIBS) -gr_run_waveform_DEPENDENCIES = $(BUILT_SOURCES) +gr_run_waveform_binary_LDADD = $(GUILE_LIBS) +gr_run_waveform_binary_DEPENDENCIES = $(BUILT_SOURCES) DISTCLEANFILES = gr-run-waveform.tar.gz libpath.h filesystem.dat @@ -125,3 +125,12 @@ filesystem.dat: $(PYTHON) $(srcdir)/gen-xyzzy $(GUILE_INSTALL_PATH) $(datarootdir)/guile/site > filesystem.dat CLEANFILES = filesystem.dat + + +# Create a symlink from gr-run-waveform-binary to gr-run-waveform +install-exec-local: + -$(RM) $(DESTDIR)$(bindir)/gr-run-waveform + (cd $(DESTDIR)$(bindir) && $(LN_S) gr-run-waveform-binary gr-run-waveform) + +uninstall-local: + -$(RM) $(DESTDIR)$(bindir)/gr-run-waveform diff --git a/gr-run-waveform/configure.ac b/gr-run-waveform/configure.ac index e0964fa78..288c7bd1d 100644 --- a/gr-run-waveform/configure.ac +++ b/gr-run-waveform/configure.ac @@ -25,7 +25,7 @@ AC_CONFIG_AUX_DIR([.]) AC_CONFIG_HEADERS([grconfig.h]) AC_CONFIG_MACRO_DIR(config) -AC_CONFIG_SRCDIR(gr-run-waveform.cc) +AC_CONFIG_SRCDIR(gr-run-waveform-binary.cc) AM_INIT_AUTOMAKE("gr-run-waveform", "0.1") AC_CANONICAL_BUILD @@ -35,6 +35,7 @@ dnl AC_CANONICAL_TARGET dnl Find the the C++ compiler AC_PROG_CXX AM_PROG_CC_C_O +AC_PROG_LN_S GR_LIB64 dnl check for lib64 suffix after choosing compilers diff --git a/gr-run-waveform/gr-run-waveform.cc b/gr-run-waveform/gr-run-waveform-binary.cc index ac81b0eaa..ac81b0eaa 100644 --- a/gr-run-waveform/gr-run-waveform.cc +++ b/gr-run-waveform/gr-run-waveform-binary.cc |