summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/guile
diff options
context:
space:
mode:
Diffstat (limited to 'gnuradio-core/src/guile')
-rw-r--r--gnuradio-core/src/guile/Makefile.am12
-rw-r--r--gnuradio-core/src/guile/gnuradio/scripts/.gitignore1
-rwxr-xr-xgnuradio-core/src/guile/gnuradio/scripts/gr-run-waveform.in40
-rw-r--r--gnuradio-core/src/guile/gr-run-waveform-script.in51
4 files changed, 61 insertions, 43 deletions
diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am
index b78225f4d..a74037ae7 100644
--- a/gnuradio-core/src/guile/Makefile.am
+++ b/gnuradio-core/src/guile/Makefile.am
@@ -31,6 +31,10 @@ EXTRA_DIST += \
SUBDIRS = example-waveforms
+
+bin_SCRIPTS = \
+ gr-run-waveform-script
+
# These are the hand-coded guile files for gnuradio-core.
#
# Swig/common.scm is glue that's required for the goops wrappers.
@@ -42,10 +46,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 +73,9 @@ 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-hook:
+ -$(RM) $(bindir)/gr-run-waveform
+ (cd $(bindir) && $(LN_S) gr-run-waveform-script 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)))