diff options
Diffstat (limited to 'gnuradio-core/src')
7 files changed, 62 insertions, 119 deletions
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/example-waveforms/.gitignore b/gnuradio-core/src/guile/example-waveforms/.gitignore deleted file mode 100644 index 16c984055..000000000 --- a/gnuradio-core/src/guile/example-waveforms/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/Makefile -/Makefile.in -/.deps -/.libs -/*.la -/*.lo diff --git a/gnuradio-core/src/guile/example-waveforms/Makefile.am b/gnuradio-core/src/guile/example-waveforms/Makefile.am deleted file mode 100644 index 277b4ad0b..000000000 --- a/gnuradio-core/src/guile/example-waveforms/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -# -# 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 - -waveformdir=$(datarootdir)/gnuradio/example-waveforms - -waveform_DATA = \ - dial-tone.wfd - -EXTRA_DIST += \ - dial-tone.wfd diff --git a/gnuradio-core/src/guile/example-waveforms/dial-tone.wfd b/gnuradio-core/src/guile/example-waveforms/dial-tone.wfd deleted file mode 100644 index ced3df572..000000000 --- a/gnuradio-core/src/guile/example-waveforms/dial-tone.wfd +++ /dev/null @@ -1,40 +0,0 @@ -;;; Emacs, format this using -*-scheme-*- mode. -;;; -;;; 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/>. -;;; - -;;; This example waveform outputs a signal to an audio_alsa_sink -;;; that sounds like North American dial tone. - -(use-modules (gnuradio audio_alsa)) - - -(define-waveform (dial-tone cmd-line-args) - (vars - (sample-rate 48000) - (ampl 0.1)) - - (blocks - (src0 (gr:sig-source-f sample-rate (gr:GR-SIN-WAVE) 350 ampl)) - (src1 (gr:sig-source-f sample-rate (gr:GR-SIN-WAVE) 440 ampl)) - (sink (gr:audio-alsa-sink sample-rate "plughw:0,0")) - ) - - (connections - (src0 (list sink 0)) ; src0 to left input - (src1 (list sink 1)))) ; src1 to right input 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))) |