From b47b9ca40ecf49afa44c993b8da9af4ff876c9ba Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Wed, 13 Oct 2010 22:25:16 -0600 Subject: regenerated from template --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 210 ++++++++++++++++++++------- 1 file changed, 156 insertions(+), 54 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index e24ba5a96..fab8afd62 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -72,7 +72,7 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime.cc +swig_built_sources += gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime-python.cc ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -86,7 +86,7 @@ gnuradio_swig_py_runtime_pylib_LTLIBRARIES = \ _gnuradio_swig_py_runtime.la _gnuradio_swig_py_runtime_la_SOURCES = \ - gnuradio_swig_py_runtime.cc \ + gnuradio_swig_py_runtime-python.cc \ $(gnuradio_swig_py_runtime_la_swig_sources) _gnuradio_swig_py_runtime_la_LIBADD = \ @@ -107,7 +107,7 @@ gnuradio_swig_py_runtime_python_PYTHON = \ ## Entry rule for running SWIG -gnuradio_swig_py_runtime.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime.cc: gnuradio_swig_py_runtime.i +gnuradio_swig_py_runtime.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime-python.cc: gnuradio_swig_py_runtime.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -159,11 +159,12 @@ gnuradio_swig_py_runtime.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime. ## ## Remove the stamp associated with this filename. ## - rm -f $(DEPDIR)/gnuradio_swig_py_runtime-generate-stamp; \ + rm -f $(DEPDIR)/gnuradio_swig_py_runtime-generate-*stamp; \ ## ## Tell MAKE to run the rule for creating this stamp. ## - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_runtime-generate-stamp WHAT=$<; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp WHAT=$<; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp WHAT=$<; \ ## ## Now that the .cc, .h, and .py files have been (re)created from the ## .i file, future checking of this rule during the same MAKE @@ -187,11 +188,27 @@ gnuradio_swig_py_runtime.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime. ## Succeed if and only if the first process succeeded; exit this ## process returning the status of the generated stamp. ## - test -f $(DEPDIR)/gnuradio_swig_py_runtime-generate-stamp; \ + test -f $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp; \ exit $$?; \ fi; -$(DEPDIR)/gnuradio_swig_py_runtime-generate-stamp: +$(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp: + if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_runtime_swig_args) \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_runtime.Std \ + -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime-guile.cc $(WHAT); then \ + if test $(host_os) = mingw32; then \ + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_runtime.Std \ + > $(DEPDIR)/gnuradio_swig_py_runtime.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_runtime.Sd $(DEPDIR)/gnuradio_swig_py_runtime.Std; \ + fi; \ + else \ + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.S*; exit 1; \ + fi; + touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp + +$(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp: ## This rule will be called only by the first process issuing the ## above rule to succeed in creating the lock directory, after ## removing the actual stamp file in order to guarantee that MAKE will @@ -202,7 +219,7 @@ $(DEPDIR)/gnuradio_swig_py_runtime-generate-stamp: ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_runtime_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_runtime.Std \ - -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime.cc $(WHAT); then \ + -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime-python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_runtime.Std \ @@ -249,7 +266,7 @@ $(DEPDIR)/gnuradio_swig_py_runtime-generate-stamp: ## executing this rule; allows other threads waiting on this process ## to continue. ## - touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-stamp + touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp # KLUDGE: Force runtime include of a SWIG dependency file. This is # not guaranteed to be portable, but will probably work. If it works, @@ -331,7 +348,7 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_general.py gnuradio_swig_py_general.cc +swig_built_sources += gnuradio_swig_py_general.py gnuradio_swig_py_general-python.cc ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -345,7 +362,7 @@ gnuradio_swig_py_general_pylib_LTLIBRARIES = \ _gnuradio_swig_py_general.la _gnuradio_swig_py_general_la_SOURCES = \ - gnuradio_swig_py_general.cc \ + gnuradio_swig_py_general-python.cc \ $(gnuradio_swig_py_general_la_swig_sources) _gnuradio_swig_py_general_la_LIBADD = \ @@ -366,7 +383,7 @@ gnuradio_swig_py_general_python_PYTHON = \ ## Entry rule for running SWIG -gnuradio_swig_py_general.h gnuradio_swig_py_general.py gnuradio_swig_py_general.cc: gnuradio_swig_py_general.i +gnuradio_swig_py_general.h gnuradio_swig_py_general.py gnuradio_swig_py_general-python.cc: gnuradio_swig_py_general.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -418,11 +435,12 @@ gnuradio_swig_py_general.h gnuradio_swig_py_general.py gnuradio_swig_py_general. ## ## Remove the stamp associated with this filename. ## - rm -f $(DEPDIR)/gnuradio_swig_py_general-generate-stamp; \ + rm -f $(DEPDIR)/gnuradio_swig_py_general-generate-*stamp; \ ## ## Tell MAKE to run the rule for creating this stamp. ## - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_general-generate-stamp WHAT=$<; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp WHAT=$<; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp WHAT=$<; \ ## ## Now that the .cc, .h, and .py files have been (re)created from the ## .i file, future checking of this rule during the same MAKE @@ -446,11 +464,27 @@ gnuradio_swig_py_general.h gnuradio_swig_py_general.py gnuradio_swig_py_general. ## Succeed if and only if the first process succeeded; exit this ## process returning the status of the generated stamp. ## - test -f $(DEPDIR)/gnuradio_swig_py_general-generate-stamp; \ + test -f $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp; \ exit $$?; \ fi; -$(DEPDIR)/gnuradio_swig_py_general-generate-stamp: +$(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp: + if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_general_swig_args) \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_general.Std \ + -module gnuradio_swig_py_general -o gnuradio_swig_py_general-guile.cc $(WHAT); then \ + if test $(host_os) = mingw32; then \ + $(RM) $(DEPDIR)/gnuradio_swig_py_general.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_general.Std \ + > $(DEPDIR)/gnuradio_swig_py_general.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_general.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_general.Sd $(DEPDIR)/gnuradio_swig_py_general.Std; \ + fi; \ + else \ + $(RM) $(DEPDIR)/gnuradio_swig_py_general.S*; exit 1; \ + fi; + touch $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp + +$(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp: ## This rule will be called only by the first process issuing the ## above rule to succeed in creating the lock directory, after ## removing the actual stamp file in order to guarantee that MAKE will @@ -461,7 +495,7 @@ $(DEPDIR)/gnuradio_swig_py_general-generate-stamp: ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_general_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_general.Std \ - -module gnuradio_swig_py_general -o gnuradio_swig_py_general.cc $(WHAT); then \ + -module gnuradio_swig_py_general -o gnuradio_swig_py_general-python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_general.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_general.Std \ @@ -508,7 +542,7 @@ $(DEPDIR)/gnuradio_swig_py_general-generate-stamp: ## executing this rule; allows other threads waiting on this process ## to continue. ## - touch $(DEPDIR)/gnuradio_swig_py_general-generate-stamp + touch $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp # KLUDGE: Force runtime include of a SWIG dependency file. This is # not guaranteed to be portable, but will probably work. If it works, @@ -590,7 +624,7 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen.cc +swig_built_sources += gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen-python.cc ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -604,7 +638,7 @@ gnuradio_swig_py_gengen_pylib_LTLIBRARIES = \ _gnuradio_swig_py_gengen.la _gnuradio_swig_py_gengen_la_SOURCES = \ - gnuradio_swig_py_gengen.cc \ + gnuradio_swig_py_gengen-python.cc \ $(gnuradio_swig_py_gengen_la_swig_sources) _gnuradio_swig_py_gengen_la_LIBADD = \ @@ -625,7 +659,7 @@ gnuradio_swig_py_gengen_python_PYTHON = \ ## Entry rule for running SWIG -gnuradio_swig_py_gengen.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen.cc: gnuradio_swig_py_gengen.i +gnuradio_swig_py_gengen.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen-python.cc: gnuradio_swig_py_gengen.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -677,11 +711,12 @@ gnuradio_swig_py_gengen.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen.cc: ## ## Remove the stamp associated with this filename. ## - rm -f $(DEPDIR)/gnuradio_swig_py_gengen-generate-stamp; \ + rm -f $(DEPDIR)/gnuradio_swig_py_gengen-generate-*stamp; \ ## ## Tell MAKE to run the rule for creating this stamp. ## - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_gengen-generate-stamp WHAT=$<; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp WHAT=$<; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp WHAT=$<; \ ## ## Now that the .cc, .h, and .py files have been (re)created from the ## .i file, future checking of this rule during the same MAKE @@ -705,11 +740,27 @@ gnuradio_swig_py_gengen.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen.cc: ## Succeed if and only if the first process succeeded; exit this ## process returning the status of the generated stamp. ## - test -f $(DEPDIR)/gnuradio_swig_py_gengen-generate-stamp; \ + test -f $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp; \ exit $$?; \ fi; -$(DEPDIR)/gnuradio_swig_py_gengen-generate-stamp: +$(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp: + if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_gengen_swig_args) \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_gengen.Std \ + -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen-guile.cc $(WHAT); then \ + if test $(host_os) = mingw32; then \ + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_gengen.Std \ + > $(DEPDIR)/gnuradio_swig_py_gengen.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_gengen.Sd $(DEPDIR)/gnuradio_swig_py_gengen.Std; \ + fi; \ + else \ + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.S*; exit 1; \ + fi; + touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp + +$(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp: ## This rule will be called only by the first process issuing the ## above rule to succeed in creating the lock directory, after ## removing the actual stamp file in order to guarantee that MAKE will @@ -720,7 +771,7 @@ $(DEPDIR)/gnuradio_swig_py_gengen-generate-stamp: ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_gengen_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_gengen.Std \ - -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen.cc $(WHAT); then \ + -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen-python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_gengen.Std \ @@ -767,7 +818,7 @@ $(DEPDIR)/gnuradio_swig_py_gengen-generate-stamp: ## executing this rule; allows other threads waiting on this process ## to continue. ## - touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-stamp + touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp # KLUDGE: Force runtime include of a SWIG dependency file. This is # not guaranteed to be portable, but will probably work. If it works, @@ -849,7 +900,7 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_filter.py gnuradio_swig_py_filter.cc +swig_built_sources += gnuradio_swig_py_filter.py gnuradio_swig_py_filter-python.cc ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -863,7 +914,7 @@ gnuradio_swig_py_filter_pylib_LTLIBRARIES = \ _gnuradio_swig_py_filter.la _gnuradio_swig_py_filter_la_SOURCES = \ - gnuradio_swig_py_filter.cc \ + gnuradio_swig_py_filter-python.cc \ $(gnuradio_swig_py_filter_la_swig_sources) _gnuradio_swig_py_filter_la_LIBADD = \ @@ -884,7 +935,7 @@ gnuradio_swig_py_filter_python_PYTHON = \ ## Entry rule for running SWIG -gnuradio_swig_py_filter.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter.cc: gnuradio_swig_py_filter.i +gnuradio_swig_py_filter.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter-python.cc: gnuradio_swig_py_filter.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -936,11 +987,12 @@ gnuradio_swig_py_filter.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter.cc: ## ## Remove the stamp associated with this filename. ## - rm -f $(DEPDIR)/gnuradio_swig_py_filter-generate-stamp; \ + rm -f $(DEPDIR)/gnuradio_swig_py_filter-generate-*stamp; \ ## ## Tell MAKE to run the rule for creating this stamp. ## - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_filter-generate-stamp WHAT=$<; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp WHAT=$<; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp WHAT=$<; \ ## ## Now that the .cc, .h, and .py files have been (re)created from the ## .i file, future checking of this rule during the same MAKE @@ -964,11 +1016,27 @@ gnuradio_swig_py_filter.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter.cc: ## Succeed if and only if the first process succeeded; exit this ## process returning the status of the generated stamp. ## - test -f $(DEPDIR)/gnuradio_swig_py_filter-generate-stamp; \ + test -f $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp; \ exit $$?; \ fi; -$(DEPDIR)/gnuradio_swig_py_filter-generate-stamp: +$(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp: + if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_filter_swig_args) \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_filter.Std \ + -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter-guile.cc $(WHAT); then \ + if test $(host_os) = mingw32; then \ + $(RM) $(DEPDIR)/gnuradio_swig_py_filter.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_filter.Std \ + > $(DEPDIR)/gnuradio_swig_py_filter.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_filter.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_filter.Sd $(DEPDIR)/gnuradio_swig_py_filter.Std; \ + fi; \ + else \ + $(RM) $(DEPDIR)/gnuradio_swig_py_filter.S*; exit 1; \ + fi; + touch $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp + +$(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp: ## This rule will be called only by the first process issuing the ## above rule to succeed in creating the lock directory, after ## removing the actual stamp file in order to guarantee that MAKE will @@ -979,7 +1047,7 @@ $(DEPDIR)/gnuradio_swig_py_filter-generate-stamp: ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_filter_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_filter.Std \ - -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter.cc $(WHAT); then \ + -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter-python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_filter.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_filter.Std \ @@ -1026,7 +1094,7 @@ $(DEPDIR)/gnuradio_swig_py_filter-generate-stamp: ## executing this rule; allows other threads waiting on this process ## to continue. ## - touch $(DEPDIR)/gnuradio_swig_py_filter-generate-stamp + touch $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp # KLUDGE: Force runtime include of a SWIG dependency file. This is # not guaranteed to be portable, but will probably work. If it works, @@ -1108,7 +1176,7 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_io.py gnuradio_swig_py_io.cc +swig_built_sources += gnuradio_swig_py_io.py gnuradio_swig_py_io-python.cc ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -1122,7 +1190,7 @@ gnuradio_swig_py_io_pylib_LTLIBRARIES = \ _gnuradio_swig_py_io.la _gnuradio_swig_py_io_la_SOURCES = \ - gnuradio_swig_py_io.cc \ + gnuradio_swig_py_io-python.cc \ $(gnuradio_swig_py_io_la_swig_sources) _gnuradio_swig_py_io_la_LIBADD = \ @@ -1143,7 +1211,7 @@ gnuradio_swig_py_io_python_PYTHON = \ ## Entry rule for running SWIG -gnuradio_swig_py_io.h gnuradio_swig_py_io.py gnuradio_swig_py_io.cc: gnuradio_swig_py_io.i +gnuradio_swig_py_io.h gnuradio_swig_py_io.py gnuradio_swig_py_io-python.cc: gnuradio_swig_py_io.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -1195,11 +1263,12 @@ gnuradio_swig_py_io.h gnuradio_swig_py_io.py gnuradio_swig_py_io.cc: gnuradio_sw ## ## Remove the stamp associated with this filename. ## - rm -f $(DEPDIR)/gnuradio_swig_py_io-generate-stamp; \ + rm -f $(DEPDIR)/gnuradio_swig_py_io-generate-*stamp; \ ## ## Tell MAKE to run the rule for creating this stamp. ## - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_io-generate-stamp WHAT=$<; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp WHAT=$<; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp WHAT=$<; \ ## ## Now that the .cc, .h, and .py files have been (re)created from the ## .i file, future checking of this rule during the same MAKE @@ -1223,11 +1292,27 @@ gnuradio_swig_py_io.h gnuradio_swig_py_io.py gnuradio_swig_py_io.cc: gnuradio_sw ## Succeed if and only if the first process succeeded; exit this ## process returning the status of the generated stamp. ## - test -f $(DEPDIR)/gnuradio_swig_py_io-generate-stamp; \ + test -f $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp; \ exit $$?; \ fi; -$(DEPDIR)/gnuradio_swig_py_io-generate-stamp: +$(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp: + if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_io_swig_args) \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_io.Std \ + -module gnuradio_swig_py_io -o gnuradio_swig_py_io-guile.cc $(WHAT); then \ + if test $(host_os) = mingw32; then \ + $(RM) $(DEPDIR)/gnuradio_swig_py_io.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_io.Std \ + > $(DEPDIR)/gnuradio_swig_py_io.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_io.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_io.Sd $(DEPDIR)/gnuradio_swig_py_io.Std; \ + fi; \ + else \ + $(RM) $(DEPDIR)/gnuradio_swig_py_io.S*; exit 1; \ + fi; + touch $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp + +$(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp: ## This rule will be called only by the first process issuing the ## above rule to succeed in creating the lock directory, after ## removing the actual stamp file in order to guarantee that MAKE will @@ -1238,7 +1323,7 @@ $(DEPDIR)/gnuradio_swig_py_io-generate-stamp: ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_io_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_io.Std \ - -module gnuradio_swig_py_io -o gnuradio_swig_py_io.cc $(WHAT); then \ + -module gnuradio_swig_py_io -o gnuradio_swig_py_io-python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_io.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_io.Std \ @@ -1285,7 +1370,7 @@ $(DEPDIR)/gnuradio_swig_py_io-generate-stamp: ## executing this rule; allows other threads waiting on this process ## to continue. ## - touch $(DEPDIR)/gnuradio_swig_py_io-generate-stamp + touch $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp # KLUDGE: Force runtime include of a SWIG dependency file. This is # not guaranteed to be portable, but will probably work. If it works, @@ -1367,7 +1452,7 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_hier.py gnuradio_swig_py_hier.cc +swig_built_sources += gnuradio_swig_py_hier.py gnuradio_swig_py_hier-python.cc ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -1381,7 +1466,7 @@ gnuradio_swig_py_hier_pylib_LTLIBRARIES = \ _gnuradio_swig_py_hier.la _gnuradio_swig_py_hier_la_SOURCES = \ - gnuradio_swig_py_hier.cc \ + gnuradio_swig_py_hier-python.cc \ $(gnuradio_swig_py_hier_la_swig_sources) _gnuradio_swig_py_hier_la_LIBADD = \ @@ -1402,7 +1487,7 @@ gnuradio_swig_py_hier_python_PYTHON = \ ## Entry rule for running SWIG -gnuradio_swig_py_hier.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier.cc: gnuradio_swig_py_hier.i +gnuradio_swig_py_hier.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier-python.cc: gnuradio_swig_py_hier.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -1454,11 +1539,12 @@ gnuradio_swig_py_hier.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier.cc: gnura ## ## Remove the stamp associated with this filename. ## - rm -f $(DEPDIR)/gnuradio_swig_py_hier-generate-stamp; \ + rm -f $(DEPDIR)/gnuradio_swig_py_hier-generate-*stamp; \ ## ## Tell MAKE to run the rule for creating this stamp. ## - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_hier-generate-stamp WHAT=$<; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp WHAT=$<; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp WHAT=$<; \ ## ## Now that the .cc, .h, and .py files have been (re)created from the ## .i file, future checking of this rule during the same MAKE @@ -1482,11 +1568,27 @@ gnuradio_swig_py_hier.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier.cc: gnura ## Succeed if and only if the first process succeeded; exit this ## process returning the status of the generated stamp. ## - test -f $(DEPDIR)/gnuradio_swig_py_hier-generate-stamp; \ + test -f $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp; \ exit $$?; \ fi; -$(DEPDIR)/gnuradio_swig_py_hier-generate-stamp: +$(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp: + if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_hier_swig_args) \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_hier.Std \ + -module gnuradio_swig_py_hier -o gnuradio_swig_py_hier-guile.cc $(WHAT); then \ + if test $(host_os) = mingw32; then \ + $(RM) $(DEPDIR)/gnuradio_swig_py_hier.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_hier.Std \ + > $(DEPDIR)/gnuradio_swig_py_hier.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_hier.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_hier.Sd $(DEPDIR)/gnuradio_swig_py_hier.Std; \ + fi; \ + else \ + $(RM) $(DEPDIR)/gnuradio_swig_py_hier.S*; exit 1; \ + fi; + touch $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp + +$(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp: ## This rule will be called only by the first process issuing the ## above rule to succeed in creating the lock directory, after ## removing the actual stamp file in order to guarantee that MAKE will @@ -1497,7 +1599,7 @@ $(DEPDIR)/gnuradio_swig_py_hier-generate-stamp: ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_hier_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_hier.Std \ - -module gnuradio_swig_py_hier -o gnuradio_swig_py_hier.cc $(WHAT); then \ + -module gnuradio_swig_py_hier -o gnuradio_swig_py_hier-python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_hier.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_hier.Std \ @@ -1544,7 +1646,7 @@ $(DEPDIR)/gnuradio_swig_py_hier-generate-stamp: ## executing this rule; allows other threads waiting on this process ## to continue. ## - touch $(DEPDIR)/gnuradio_swig_py_hier-generate-stamp + touch $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp # KLUDGE: Force runtime include of a SWIG dependency file. This is # not guaranteed to be portable, but will probably work. If it works, -- cgit From 29fef37cdee9eced2ff7c6ff44da2e8e8fa88aa7 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Wed, 13 Oct 2010 22:27:08 -0600 Subject: split out _SOURCES into separate values for the different scripting languages. --- gnuradio-core/src/lib/swig/Makefile.am | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 1a50b8c8e..afd6ef268 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -32,6 +32,7 @@ swiginclude_HEADERS = \ gnuradio.i \ gr_swig_block_magic.i \ gr_shared_ptr.i +# std_complex.i # special install for this top-level Python script which includes all # of the split Python libraries. @@ -88,7 +89,7 @@ include $(top_srcdir)/Makefile.swig # include the SWIG-generated .h files in the BUILT SOURCES, since they # aren't by default when using Makefile.swig; order doesn't matter. -BUILT_SOURCES = \ +PYTHON_GEN = \ gnuradio_swig_py_runtime.h \ gnuradio_swig_py_general.h \ gnuradio_swig_py_gengen.h \ @@ -98,6 +99,15 @@ BUILT_SOURCES = \ $(grinclude_HEADERS) \ $(swig_built_sources) +BUILT_GUILE = \ + $(grinclude_HEADERS) \ + $(swig_built_sources) + +BUILT_SOURCES = $(PYTHON_GEN) +if GUILE +BUILT_SOURCES += $(BUILT_GUILE) +endif + # Do not distribute the output of SWIG no_dist_files = $(swig_built_sources) -endif +endif # end of if python -- cgit From ed4094208c501e91838ccc333059e4731e8ae908 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Thu, 14 Oct 2010 12:34:08 -0600 Subject: regenerated after changes to the template --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 216 +++++++++++++++++++-------- 1 file changed, 156 insertions(+), 60 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index fab8afd62..9d7112169 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -72,7 +72,7 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime-python.cc +swig_built_sources += gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime_python.cc ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -83,21 +83,21 @@ gnuradio_swig_py_runtime_swiginclude_HEADERS = \ $(gnuradio_swig_py_runtime_swiginclude_headers) gnuradio_swig_py_runtime_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_runtime.la + _gnuradio_swig_py_runtime_python.la -_gnuradio_swig_py_runtime_la_SOURCES = \ - gnuradio_swig_py_runtime-python.cc \ +_gnuradio_swig_py_runtime_python_la_SOURCES = \ + gnuradio_swig_py_runtime_python.cc \ $(gnuradio_swig_py_runtime_la_swig_sources) -_gnuradio_swig_py_runtime_la_LIBADD = \ +_gnuradio_swig_py_runtime_python_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_runtime_la_swig_libadd) -_gnuradio_swig_py_runtime_la_LDFLAGS = \ +_gnuradio_swig_py_runtime_python_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_runtime_la_swig_ldflags) -_gnuradio_swig_py_runtime_la_CXXFLAGS = \ +_gnuradio_swig_py_runtime_python_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ $(gnuradio_swig_py_runtime_la_swig_cxxflags) @@ -105,9 +105,23 @@ gnuradio_swig_py_runtime_python_PYTHON = \ gnuradio_swig_py_runtime.py \ $(gnuradio_swig_py_runtime_python) +if GUILE +gnuradio_swig_py_runtime_pylib_LTLIBRARIES += _gnuradio_swig_py_runtime_guile.la + +_gnuradio_swig_py_runtime_guile_la_SOURCES = \ + gnuradio_swig_py_runtime_guile.cc \ + $(gnuradio_swig_py_runtime_la_swig_sources) + +# Guile can use the same flags as python does +_gnuradio_swig_py_runtime_guile_la_LIBADD = $(_gnuradio_swig_py_runtime_python_la_LIBADD) +_gnuradio_swig_py_runtime_guile_la_LDFLAGS = $(_gnuradio_swig_py_runtime_python_la_LDFLAGS) +_gnuradio_swig_py_runtime_guile_la_CXXFLAGS = $(_gnuradio_swig_py_runtime_python_la_CXXFLAGS) + +endif # end of GUILE + ## Entry rule for running SWIG -gnuradio_swig_py_runtime.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime-python.cc: gnuradio_swig_py_runtime.i +gnuradio_swig_py_runtime.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime_python.cc: gnuradio_swig_py_runtime.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -193,9 +207,10 @@ gnuradio_swig_py_runtime.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime- fi; $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp: +if GUILE if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_runtime_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_runtime.Std \ - -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime-guile.cc $(WHAT); then \ + -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime_guile.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_runtime.Std \ @@ -207,6 +222,7 @@ $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp: $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.S*; exit 1; \ fi; touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp +endif $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp: ## This rule will be called only by the first process issuing the @@ -219,7 +235,7 @@ $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp: ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_runtime_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_runtime.Std \ - -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime-python.cc $(WHAT); then \ + -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime_python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_runtime.Std \ @@ -348,7 +364,7 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_general.py gnuradio_swig_py_general-python.cc +swig_built_sources += gnuradio_swig_py_general.py gnuradio_swig_py_general_python.cc ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -359,21 +375,21 @@ gnuradio_swig_py_general_swiginclude_HEADERS = \ $(gnuradio_swig_py_general_swiginclude_headers) gnuradio_swig_py_general_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_general.la + _gnuradio_swig_py_general_python.la -_gnuradio_swig_py_general_la_SOURCES = \ - gnuradio_swig_py_general-python.cc \ +_gnuradio_swig_py_general_python_la_SOURCES = \ + gnuradio_swig_py_general_python.cc \ $(gnuradio_swig_py_general_la_swig_sources) -_gnuradio_swig_py_general_la_LIBADD = \ +_gnuradio_swig_py_general_python_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_general_la_swig_libadd) -_gnuradio_swig_py_general_la_LDFLAGS = \ +_gnuradio_swig_py_general_python_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_general_la_swig_ldflags) -_gnuradio_swig_py_general_la_CXXFLAGS = \ +_gnuradio_swig_py_general_python_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ $(gnuradio_swig_py_general_la_swig_cxxflags) @@ -381,9 +397,23 @@ gnuradio_swig_py_general_python_PYTHON = \ gnuradio_swig_py_general.py \ $(gnuradio_swig_py_general_python) +if GUILE +gnuradio_swig_py_general_pylib_LTLIBRARIES += _gnuradio_swig_py_general_guile.la + +_gnuradio_swig_py_general_guile_la_SOURCES = \ + gnuradio_swig_py_general_guile.cc \ + $(gnuradio_swig_py_general_la_swig_sources) + +# Guile can use the same flags as python does +_gnuradio_swig_py_general_guile_la_LIBADD = $(_gnuradio_swig_py_general_python_la_LIBADD) +_gnuradio_swig_py_general_guile_la_LDFLAGS = $(_gnuradio_swig_py_general_python_la_LDFLAGS) +_gnuradio_swig_py_general_guile_la_CXXFLAGS = $(_gnuradio_swig_py_general_python_la_CXXFLAGS) + +endif # end of GUILE + ## Entry rule for running SWIG -gnuradio_swig_py_general.h gnuradio_swig_py_general.py gnuradio_swig_py_general-python.cc: gnuradio_swig_py_general.i +gnuradio_swig_py_general.h gnuradio_swig_py_general.py gnuradio_swig_py_general_python.cc: gnuradio_swig_py_general.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -469,9 +499,10 @@ gnuradio_swig_py_general.h gnuradio_swig_py_general.py gnuradio_swig_py_general- fi; $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp: +if GUILE if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_general_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_general.Std \ - -module gnuradio_swig_py_general -o gnuradio_swig_py_general-guile.cc $(WHAT); then \ + -module gnuradio_swig_py_general -o gnuradio_swig_py_general_guile.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_general.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_general.Std \ @@ -483,6 +514,7 @@ $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp: $(RM) $(DEPDIR)/gnuradio_swig_py_general.S*; exit 1; \ fi; touch $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp +endif $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp: ## This rule will be called only by the first process issuing the @@ -495,7 +527,7 @@ $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp: ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_general_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_general.Std \ - -module gnuradio_swig_py_general -o gnuradio_swig_py_general-python.cc $(WHAT); then \ + -module gnuradio_swig_py_general -o gnuradio_swig_py_general_python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_general.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_general.Std \ @@ -624,7 +656,7 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen-python.cc +swig_built_sources += gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen_python.cc ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -635,21 +667,21 @@ gnuradio_swig_py_gengen_swiginclude_HEADERS = \ $(gnuradio_swig_py_gengen_swiginclude_headers) gnuradio_swig_py_gengen_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_gengen.la + _gnuradio_swig_py_gengen_python.la -_gnuradio_swig_py_gengen_la_SOURCES = \ - gnuradio_swig_py_gengen-python.cc \ +_gnuradio_swig_py_gengen_python_la_SOURCES = \ + gnuradio_swig_py_gengen_python.cc \ $(gnuradio_swig_py_gengen_la_swig_sources) -_gnuradio_swig_py_gengen_la_LIBADD = \ +_gnuradio_swig_py_gengen_python_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_gengen_la_swig_libadd) -_gnuradio_swig_py_gengen_la_LDFLAGS = \ +_gnuradio_swig_py_gengen_python_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_gengen_la_swig_ldflags) -_gnuradio_swig_py_gengen_la_CXXFLAGS = \ +_gnuradio_swig_py_gengen_python_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ $(gnuradio_swig_py_gengen_la_swig_cxxflags) @@ -657,9 +689,23 @@ gnuradio_swig_py_gengen_python_PYTHON = \ gnuradio_swig_py_gengen.py \ $(gnuradio_swig_py_gengen_python) +if GUILE +gnuradio_swig_py_gengen_pylib_LTLIBRARIES += _gnuradio_swig_py_gengen_guile.la + +_gnuradio_swig_py_gengen_guile_la_SOURCES = \ + gnuradio_swig_py_gengen_guile.cc \ + $(gnuradio_swig_py_gengen_la_swig_sources) + +# Guile can use the same flags as python does +_gnuradio_swig_py_gengen_guile_la_LIBADD = $(_gnuradio_swig_py_gengen_python_la_LIBADD) +_gnuradio_swig_py_gengen_guile_la_LDFLAGS = $(_gnuradio_swig_py_gengen_python_la_LDFLAGS) +_gnuradio_swig_py_gengen_guile_la_CXXFLAGS = $(_gnuradio_swig_py_gengen_python_la_CXXFLAGS) + +endif # end of GUILE + ## Entry rule for running SWIG -gnuradio_swig_py_gengen.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen-python.cc: gnuradio_swig_py_gengen.i +gnuradio_swig_py_gengen.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen_python.cc: gnuradio_swig_py_gengen.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -745,9 +791,10 @@ gnuradio_swig_py_gengen.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen-pyt fi; $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp: +if GUILE if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_gengen_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_gengen.Std \ - -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen-guile.cc $(WHAT); then \ + -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen_guile.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_gengen.Std \ @@ -759,6 +806,7 @@ $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp: $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.S*; exit 1; \ fi; touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp +endif $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp: ## This rule will be called only by the first process issuing the @@ -771,7 +819,7 @@ $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp: ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_gengen_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_gengen.Std \ - -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen-python.cc $(WHAT); then \ + -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen_python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_gengen.Std \ @@ -900,7 +948,7 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_filter.py gnuradio_swig_py_filter-python.cc +swig_built_sources += gnuradio_swig_py_filter.py gnuradio_swig_py_filter_python.cc ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -911,21 +959,21 @@ gnuradio_swig_py_filter_swiginclude_HEADERS = \ $(gnuradio_swig_py_filter_swiginclude_headers) gnuradio_swig_py_filter_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_filter.la + _gnuradio_swig_py_filter_python.la -_gnuradio_swig_py_filter_la_SOURCES = \ - gnuradio_swig_py_filter-python.cc \ +_gnuradio_swig_py_filter_python_la_SOURCES = \ + gnuradio_swig_py_filter_python.cc \ $(gnuradio_swig_py_filter_la_swig_sources) -_gnuradio_swig_py_filter_la_LIBADD = \ +_gnuradio_swig_py_filter_python_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_filter_la_swig_libadd) -_gnuradio_swig_py_filter_la_LDFLAGS = \ +_gnuradio_swig_py_filter_python_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_filter_la_swig_ldflags) -_gnuradio_swig_py_filter_la_CXXFLAGS = \ +_gnuradio_swig_py_filter_python_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ $(gnuradio_swig_py_filter_la_swig_cxxflags) @@ -933,9 +981,23 @@ gnuradio_swig_py_filter_python_PYTHON = \ gnuradio_swig_py_filter.py \ $(gnuradio_swig_py_filter_python) +if GUILE +gnuradio_swig_py_filter_pylib_LTLIBRARIES += _gnuradio_swig_py_filter_guile.la + +_gnuradio_swig_py_filter_guile_la_SOURCES = \ + gnuradio_swig_py_filter_guile.cc \ + $(gnuradio_swig_py_filter_la_swig_sources) + +# Guile can use the same flags as python does +_gnuradio_swig_py_filter_guile_la_LIBADD = $(_gnuradio_swig_py_filter_python_la_LIBADD) +_gnuradio_swig_py_filter_guile_la_LDFLAGS = $(_gnuradio_swig_py_filter_python_la_LDFLAGS) +_gnuradio_swig_py_filter_guile_la_CXXFLAGS = $(_gnuradio_swig_py_filter_python_la_CXXFLAGS) + +endif # end of GUILE + ## Entry rule for running SWIG -gnuradio_swig_py_filter.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter-python.cc: gnuradio_swig_py_filter.i +gnuradio_swig_py_filter.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter_python.cc: gnuradio_swig_py_filter.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -1021,9 +1083,10 @@ gnuradio_swig_py_filter.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter-pyt fi; $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp: +if GUILE if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_filter_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_filter.Std \ - -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter-guile.cc $(WHAT); then \ + -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter_guile.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_filter.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_filter.Std \ @@ -1035,6 +1098,7 @@ $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp: $(RM) $(DEPDIR)/gnuradio_swig_py_filter.S*; exit 1; \ fi; touch $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp +endif $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp: ## This rule will be called only by the first process issuing the @@ -1047,7 +1111,7 @@ $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp: ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_filter_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_filter.Std \ - -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter-python.cc $(WHAT); then \ + -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter_python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_filter.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_filter.Std \ @@ -1176,7 +1240,7 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_io.py gnuradio_swig_py_io-python.cc +swig_built_sources += gnuradio_swig_py_io.py gnuradio_swig_py_io_python.cc ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -1187,21 +1251,21 @@ gnuradio_swig_py_io_swiginclude_HEADERS = \ $(gnuradio_swig_py_io_swiginclude_headers) gnuradio_swig_py_io_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_io.la + _gnuradio_swig_py_io_python.la -_gnuradio_swig_py_io_la_SOURCES = \ - gnuradio_swig_py_io-python.cc \ +_gnuradio_swig_py_io_python_la_SOURCES = \ + gnuradio_swig_py_io_python.cc \ $(gnuradio_swig_py_io_la_swig_sources) -_gnuradio_swig_py_io_la_LIBADD = \ +_gnuradio_swig_py_io_python_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_io_la_swig_libadd) -_gnuradio_swig_py_io_la_LDFLAGS = \ +_gnuradio_swig_py_io_python_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_io_la_swig_ldflags) -_gnuradio_swig_py_io_la_CXXFLAGS = \ +_gnuradio_swig_py_io_python_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ $(gnuradio_swig_py_io_la_swig_cxxflags) @@ -1209,9 +1273,23 @@ gnuradio_swig_py_io_python_PYTHON = \ gnuradio_swig_py_io.py \ $(gnuradio_swig_py_io_python) +if GUILE +gnuradio_swig_py_io_pylib_LTLIBRARIES += _gnuradio_swig_py_io_guile.la + +_gnuradio_swig_py_io_guile_la_SOURCES = \ + gnuradio_swig_py_io_guile.cc \ + $(gnuradio_swig_py_io_la_swig_sources) + +# Guile can use the same flags as python does +_gnuradio_swig_py_io_guile_la_LIBADD = $(_gnuradio_swig_py_io_python_la_LIBADD) +_gnuradio_swig_py_io_guile_la_LDFLAGS = $(_gnuradio_swig_py_io_python_la_LDFLAGS) +_gnuradio_swig_py_io_guile_la_CXXFLAGS = $(_gnuradio_swig_py_io_python_la_CXXFLAGS) + +endif # end of GUILE + ## Entry rule for running SWIG -gnuradio_swig_py_io.h gnuradio_swig_py_io.py gnuradio_swig_py_io-python.cc: gnuradio_swig_py_io.i +gnuradio_swig_py_io.h gnuradio_swig_py_io.py gnuradio_swig_py_io_python.cc: gnuradio_swig_py_io.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -1297,9 +1375,10 @@ gnuradio_swig_py_io.h gnuradio_swig_py_io.py gnuradio_swig_py_io-python.cc: gnur fi; $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp: +if GUILE if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_io_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_io.Std \ - -module gnuradio_swig_py_io -o gnuradio_swig_py_io-guile.cc $(WHAT); then \ + -module gnuradio_swig_py_io -o gnuradio_swig_py_io_guile.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_io.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_io.Std \ @@ -1311,6 +1390,7 @@ $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp: $(RM) $(DEPDIR)/gnuradio_swig_py_io.S*; exit 1; \ fi; touch $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp +endif $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp: ## This rule will be called only by the first process issuing the @@ -1323,7 +1403,7 @@ $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp: ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_io_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_io.Std \ - -module gnuradio_swig_py_io -o gnuradio_swig_py_io-python.cc $(WHAT); then \ + -module gnuradio_swig_py_io -o gnuradio_swig_py_io_python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_io.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_io.Std \ @@ -1452,7 +1532,7 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_hier.py gnuradio_swig_py_hier-python.cc +swig_built_sources += gnuradio_swig_py_hier.py gnuradio_swig_py_hier_python.cc ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -1463,21 +1543,21 @@ gnuradio_swig_py_hier_swiginclude_HEADERS = \ $(gnuradio_swig_py_hier_swiginclude_headers) gnuradio_swig_py_hier_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_hier.la + _gnuradio_swig_py_hier_python.la -_gnuradio_swig_py_hier_la_SOURCES = \ - gnuradio_swig_py_hier-python.cc \ +_gnuradio_swig_py_hier_python_la_SOURCES = \ + gnuradio_swig_py_hier_python.cc \ $(gnuradio_swig_py_hier_la_swig_sources) -_gnuradio_swig_py_hier_la_LIBADD = \ +_gnuradio_swig_py_hier_python_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_hier_la_swig_libadd) -_gnuradio_swig_py_hier_la_LDFLAGS = \ +_gnuradio_swig_py_hier_python_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_hier_la_swig_ldflags) -_gnuradio_swig_py_hier_la_CXXFLAGS = \ +_gnuradio_swig_py_hier_python_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ $(gnuradio_swig_py_hier_la_swig_cxxflags) @@ -1485,9 +1565,23 @@ gnuradio_swig_py_hier_python_PYTHON = \ gnuradio_swig_py_hier.py \ $(gnuradio_swig_py_hier_python) +if GUILE +gnuradio_swig_py_hier_pylib_LTLIBRARIES += _gnuradio_swig_py_hier_guile.la + +_gnuradio_swig_py_hier_guile_la_SOURCES = \ + gnuradio_swig_py_hier_guile.cc \ + $(gnuradio_swig_py_hier_la_swig_sources) + +# Guile can use the same flags as python does +_gnuradio_swig_py_hier_guile_la_LIBADD = $(_gnuradio_swig_py_hier_python_la_LIBADD) +_gnuradio_swig_py_hier_guile_la_LDFLAGS = $(_gnuradio_swig_py_hier_python_la_LDFLAGS) +_gnuradio_swig_py_hier_guile_la_CXXFLAGS = $(_gnuradio_swig_py_hier_python_la_CXXFLAGS) + +endif # end of GUILE + ## Entry rule for running SWIG -gnuradio_swig_py_hier.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier-python.cc: gnuradio_swig_py_hier.i +gnuradio_swig_py_hier.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier_python.cc: gnuradio_swig_py_hier.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -1573,9 +1667,10 @@ gnuradio_swig_py_hier.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier-python.cc fi; $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp: +if GUILE if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_hier_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_hier.Std \ - -module gnuradio_swig_py_hier -o gnuradio_swig_py_hier-guile.cc $(WHAT); then \ + -module gnuradio_swig_py_hier -o gnuradio_swig_py_hier_guile.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_hier.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_hier.Std \ @@ -1587,6 +1682,7 @@ $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp: $(RM) $(DEPDIR)/gnuradio_swig_py_hier.S*; exit 1; \ fi; touch $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp +endif $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp: ## This rule will be called only by the first process issuing the @@ -1599,7 +1695,7 @@ $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp: ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_hier_swig_args) \ -MD -MF $(DEPDIR)/gnuradio_swig_py_hier.Std \ - -module gnuradio_swig_py_hier -o gnuradio_swig_py_hier-python.cc $(WHAT); then \ + -module gnuradio_swig_py_hier -o gnuradio_swig_py_hier_python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ $(RM) $(DEPDIR)/gnuradio_swig_py_hier.Sd; \ $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_hier.Std \ -- cgit From 07272e97741fa028101e09b09ced24804f562852 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Thu, 14 Oct 2010 12:35:14 -0600 Subject: look for the python name in the dependency for gnuradio_swig_bug_workaround.h --- gnuradio-core/src/lib/swig/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index afd6ef268..3ae6a5386 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -42,8 +42,8 @@ ourpython_PYTHON = gnuradio_swig_python.py # ---------------------------------------------------------------- # FIXME As of swig 1.3.31, this still seems to be required... -gnuradio_swig_bug_workaround.h : gnuradio_swig_py_runtime.cc $(srcdir)/gen-swig-bug-fix - $(PYTHON) $(srcdir)/gen-swig-bug-fix gnuradio_swig_py_runtime.cc $@ +gnuradio_swig_bug_workaround.h : gnuradio_swig_py_runtime_python.cc $(srcdir)/gen-swig-bug-fix + $(PYTHON) $(srcdir)/gen-swig-bug-fix gnuradio_swig_py_runtime_python.cc $@ # C/C++ headers get installed in ${prefix}/include/gnuradio grinclude_HEADERS = \ -- cgit From ae3875c7116fa910da0b4d407550265852d0c94f Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Thu, 14 Oct 2010 19:00:35 -0600 Subject: guile doesn't seem to need the header files --- gnuradio-core/src/lib/swig/Makefile.am | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 3ae6a5386..391182616 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -32,7 +32,6 @@ swiginclude_HEADERS = \ gnuradio.i \ gr_swig_block_magic.i \ gr_shared_ptr.i -# std_complex.i # special install for this top-level Python script which includes all # of the split Python libraries. @@ -42,8 +41,12 @@ ourpython_PYTHON = gnuradio_swig_python.py # ---------------------------------------------------------------- # FIXME As of swig 1.3.31, this still seems to be required... -gnuradio_swig_bug_workaround.h : gnuradio_swig_py_runtime_python.cc $(srcdir)/gen-swig-bug-fix - $(PYTHON) $(srcdir)/gen-swig-bug-fix gnuradio_swig_py_runtime_python.cc $@ +workarounds = gnuradio_swig_py_runtime_python.cc +# if GUILE +# workarounds += gnuradio_swig_py_runtime_guile.cc +# endif +gnuradio_swig_bug_workaround.h : $(workarounds) $(srcdir)/gen-swig-bug-fix + $(PYTHON) $(srcdir)/gen-swig-bug-fix $(workarounds) $@ # C/C++ headers get installed in ${prefix}/include/gnuradio grinclude_HEADERS = \ @@ -90,13 +93,13 @@ include $(top_srcdir)/Makefile.swig # include the SWIG-generated .h files in the BUILT SOURCES, since they # aren't by default when using Makefile.swig; order doesn't matter. PYTHON_GEN = \ - gnuradio_swig_py_runtime.h \ - gnuradio_swig_py_general.h \ - gnuradio_swig_py_gengen.h \ - gnuradio_swig_py_filter.h \ - gnuradio_swig_py_io.h \ - gnuradio_swig_py_hier.h \ - $(grinclude_HEADERS) \ + gnuradio_swig_py_runtime_python.h \ + gnuradio_swig_py_general_python.h \ + gnuradio_swig_py_gengen_python.h \ + gnuradio_swig_py_filter_python.h \ + gnuradio_swig_py_io_python.h \ + gnuradio_swig_py_hier_python.h \ + $(grinclude_HEADERS) \ $(swig_built_sources) BUILT_GUILE = \ @@ -104,9 +107,9 @@ BUILT_GUILE = \ $(swig_built_sources) BUILT_SOURCES = $(PYTHON_GEN) -if GUILE -BUILT_SOURCES += $(BUILT_GUILE) -endif +# if GUILE +# BUILT_SOURCES += $(BUILT_GUILE) +# endif # Do not distribute the output of SWIG no_dist_files = $(swig_built_sources) -- cgit From 826869b666094bba2349e725e90878cc7e0aad8b Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Thu, 14 Oct 2010 20:15:42 -0600 Subject: regenerated --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 318 ++++++++++++++++----------- 1 file changed, 186 insertions(+), 132 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index 9d7112169..42c431204 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -121,7 +121,7 @@ endif # end of GUILE ## Entry rule for running SWIG -gnuradio_swig_py_runtime.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime_python.cc: gnuradio_swig_py_runtime.i +gnuradio_swig_py_runtime_python.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime_python.cc gnuradio_swig_py_runtime_guile.cc gnuradio_swig_py_runtime_guile.h: gnuradio_swig_py_runtime.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -209,19 +209,28 @@ gnuradio_swig_py_runtime.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime_ $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp: if GUILE if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_runtime_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_runtime.Std \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std \ -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime_guile.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_runtime.Std \ - > $(DEPDIR)/gnuradio_swig_py_runtime.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_runtime.Sd $(DEPDIR)/gnuradio_swig_py_runtime.Std; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std \ + > $(DEPDIR)/gnuradio_swig_py_runtime_guile.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Sd $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std; \ fi; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.S*; exit 1; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.S*; exit 1; \ fi; touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.d + cp $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std $(DEPDIR)/gnuradio_swig_py_runtime_guile.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_runtime_guile.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_runtime_guile.d + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std + touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp + +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_runtime_guile.d@am__quote@ endif $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp: @@ -234,17 +243,17 @@ $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp: ## post-processing on 'mingw32' host OS for the dependency file. ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_runtime_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_runtime.Std \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_runtime_python.Std \ -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime_python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_runtime.Std \ - > $(DEPDIR)/gnuradio_swig_py_runtime.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_runtime.Sd $(DEPDIR)/gnuradio_swig_py_runtime.Std; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_python.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_runtime_python.Std \ + > $(DEPDIR)/gnuradio_swig_py_runtime_python.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_python.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_runtime_python.Sd $(DEPDIR)/gnuradio_swig_py_runtime_python.Std; \ fi; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.S*; exit 1; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_python.S*; exit 1; \ fi; ## ## Mess with the SWIG output .Std dependency file, to create a @@ -256,27 +265,27 @@ $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp: ## ## (1) remove the current dependency file ## - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.d + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_python.d ## ## (2) Copy the whole SWIG file: ## - cp $(DEPDIR)/gnuradio_swig_py_runtime.Std $(DEPDIR)/gnuradio_swig_py_runtime.d + cp $(DEPDIR)/gnuradio_swig_py_runtime_python.Std $(DEPDIR)/gnuradio_swig_py_runtime_python.d ## ## (3) all a carriage return to the end of the dependency file. ## - echo "" >> $(DEPDIR)/gnuradio_swig_py_runtime.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_runtime_python.d ## ## (4) from the SWIG file, remove the first line (the target); remove ## trailing " \" and " " from each line. Append ":" to each line, ## followed by 2 carriage returns, then append this to the end of ## the dependency file. ## - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_runtime.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_runtime.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_runtime_python.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_runtime_python.d ## ## (5) remove the SWIG-generated file ## - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime.Std + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_python.Std ## ## Create the stamp for this filename generation, to signal success in ## executing this rule; allows other threads waiting on this process @@ -288,7 +297,7 @@ $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp: # not guaranteed to be portable, but will probably work. If it works, # we have accurate dependencies for our swig stuff, which is good. -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_runtime.d@am__quote@ +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_runtime_python.d@am__quote@ # -*- Makefile -*- # @@ -413,7 +422,7 @@ endif # end of GUILE ## Entry rule for running SWIG -gnuradio_swig_py_general.h gnuradio_swig_py_general.py gnuradio_swig_py_general_python.cc: gnuradio_swig_py_general.i +gnuradio_swig_py_general_python.h gnuradio_swig_py_general.py gnuradio_swig_py_general_python.cc gnuradio_swig_py_general_guile.cc gnuradio_swig_py_general_guile.h: gnuradio_swig_py_general.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -501,19 +510,28 @@ gnuradio_swig_py_general.h gnuradio_swig_py_general.py gnuradio_swig_py_general_ $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp: if GUILE if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_general_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_general.Std \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_general_guile.Std \ -module gnuradio_swig_py_general -o gnuradio_swig_py_general_guile.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_general.Std \ - > $(DEPDIR)/gnuradio_swig_py_general.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_general.Sd $(DEPDIR)/gnuradio_swig_py_general.Std; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_general_guile.Std \ + > $(DEPDIR)/gnuradio_swig_py_general_guile.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_general_guile.Sd $(DEPDIR)/gnuradio_swig_py_general_guile.Std; \ fi; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general.S*; exit 1; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.S*; exit 1; \ fi; touch $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp + $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.d + cp $(DEPDIR)/gnuradio_swig_py_general_guile.Std $(DEPDIR)/gnuradio_swig_py_general_guile.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_general_guile.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_general_guile.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_general_guile.d + $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.Std + touch $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp + +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_general_guile.d@am__quote@ endif $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp: @@ -526,17 +544,17 @@ $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp: ## post-processing on 'mingw32' host OS for the dependency file. ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_general_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_general.Std \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_general_python.Std \ -module gnuradio_swig_py_general -o gnuradio_swig_py_general_python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_general.Std \ - > $(DEPDIR)/gnuradio_swig_py_general.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_general.Sd $(DEPDIR)/gnuradio_swig_py_general.Std; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_general_python.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_general_python.Std \ + > $(DEPDIR)/gnuradio_swig_py_general_python.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_general_python.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_general_python.Sd $(DEPDIR)/gnuradio_swig_py_general_python.Std; \ fi; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general.S*; exit 1; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_general_python.S*; exit 1; \ fi; ## ## Mess with the SWIG output .Std dependency file, to create a @@ -548,27 +566,27 @@ $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp: ## ## (1) remove the current dependency file ## - $(RM) $(DEPDIR)/gnuradio_swig_py_general.d + $(RM) $(DEPDIR)/gnuradio_swig_py_general_python.d ## ## (2) Copy the whole SWIG file: ## - cp $(DEPDIR)/gnuradio_swig_py_general.Std $(DEPDIR)/gnuradio_swig_py_general.d + cp $(DEPDIR)/gnuradio_swig_py_general_python.Std $(DEPDIR)/gnuradio_swig_py_general_python.d ## ## (3) all a carriage return to the end of the dependency file. ## - echo "" >> $(DEPDIR)/gnuradio_swig_py_general.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_general_python.d ## ## (4) from the SWIG file, remove the first line (the target); remove ## trailing " \" and " " from each line. Append ":" to each line, ## followed by 2 carriage returns, then append this to the end of ## the dependency file. ## - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_general.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_general.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_general_python.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_general_python.d ## ## (5) remove the SWIG-generated file ## - $(RM) $(DEPDIR)/gnuradio_swig_py_general.Std + $(RM) $(DEPDIR)/gnuradio_swig_py_general_python.Std ## ## Create the stamp for this filename generation, to signal success in ## executing this rule; allows other threads waiting on this process @@ -580,7 +598,7 @@ $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp: # not guaranteed to be portable, but will probably work. If it works, # we have accurate dependencies for our swig stuff, which is good. -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_general.d@am__quote@ +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_general_python.d@am__quote@ # -*- Makefile -*- # @@ -705,7 +723,7 @@ endif # end of GUILE ## Entry rule for running SWIG -gnuradio_swig_py_gengen.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen_python.cc: gnuradio_swig_py_gengen.i +gnuradio_swig_py_gengen_python.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen_python.cc gnuradio_swig_py_gengen_guile.cc gnuradio_swig_py_gengen_guile.h: gnuradio_swig_py_gengen.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -793,19 +811,28 @@ gnuradio_swig_py_gengen.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen_pyt $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp: if GUILE if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_gengen_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_gengen.Std \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std \ -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen_guile.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_gengen.Std \ - > $(DEPDIR)/gnuradio_swig_py_gengen.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_gengen.Sd $(DEPDIR)/gnuradio_swig_py_gengen.Std; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std \ + > $(DEPDIR)/gnuradio_swig_py_gengen_guile.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Sd $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std; \ fi; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.S*; exit 1; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.S*; exit 1; \ fi; touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.d + cp $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std $(DEPDIR)/gnuradio_swig_py_gengen_guile.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_gengen_guile.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_gengen_guile.d + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std + touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp + +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_gengen_guile.d@am__quote@ endif $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp: @@ -818,17 +845,17 @@ $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp: ## post-processing on 'mingw32' host OS for the dependency file. ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_gengen_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_gengen.Std \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_gengen_python.Std \ -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen_python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_gengen.Std \ - > $(DEPDIR)/gnuradio_swig_py_gengen.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_gengen.Sd $(DEPDIR)/gnuradio_swig_py_gengen.Std; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_python.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_gengen_python.Std \ + > $(DEPDIR)/gnuradio_swig_py_gengen_python.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_python.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_gengen_python.Sd $(DEPDIR)/gnuradio_swig_py_gengen_python.Std; \ fi; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.S*; exit 1; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_python.S*; exit 1; \ fi; ## ## Mess with the SWIG output .Std dependency file, to create a @@ -840,27 +867,27 @@ $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp: ## ## (1) remove the current dependency file ## - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.d + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_python.d ## ## (2) Copy the whole SWIG file: ## - cp $(DEPDIR)/gnuradio_swig_py_gengen.Std $(DEPDIR)/gnuradio_swig_py_gengen.d + cp $(DEPDIR)/gnuradio_swig_py_gengen_python.Std $(DEPDIR)/gnuradio_swig_py_gengen_python.d ## ## (3) all a carriage return to the end of the dependency file. ## - echo "" >> $(DEPDIR)/gnuradio_swig_py_gengen.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_gengen_python.d ## ## (4) from the SWIG file, remove the first line (the target); remove ## trailing " \" and " " from each line. Append ":" to each line, ## followed by 2 carriage returns, then append this to the end of ## the dependency file. ## - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_gengen.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_gengen.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_gengen_python.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_gengen_python.d ## ## (5) remove the SWIG-generated file ## - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen.Std + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_python.Std ## ## Create the stamp for this filename generation, to signal success in ## executing this rule; allows other threads waiting on this process @@ -872,7 +899,7 @@ $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp: # not guaranteed to be portable, but will probably work. If it works, # we have accurate dependencies for our swig stuff, which is good. -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_gengen.d@am__quote@ +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_gengen_python.d@am__quote@ # -*- Makefile -*- # @@ -997,7 +1024,7 @@ endif # end of GUILE ## Entry rule for running SWIG -gnuradio_swig_py_filter.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter_python.cc: gnuradio_swig_py_filter.i +gnuradio_swig_py_filter_python.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter_python.cc gnuradio_swig_py_filter_guile.cc gnuradio_swig_py_filter_guile.h: gnuradio_swig_py_filter.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -1085,19 +1112,28 @@ gnuradio_swig_py_filter.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter_pyt $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp: if GUILE if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_filter_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_filter.Std \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_filter_guile.Std \ -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter_guile.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_filter.Std \ - > $(DEPDIR)/gnuradio_swig_py_filter.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_filter.Sd $(DEPDIR)/gnuradio_swig_py_filter.Std; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_filter_guile.Std \ + > $(DEPDIR)/gnuradio_swig_py_filter_guile.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_filter_guile.Sd $(DEPDIR)/gnuradio_swig_py_filter_guile.Std; \ fi; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter.S*; exit 1; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.S*; exit 1; \ fi; touch $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.d + cp $(DEPDIR)/gnuradio_swig_py_filter_guile.Std $(DEPDIR)/gnuradio_swig_py_filter_guile.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_filter_guile.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_filter_guile.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_filter_guile.d + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.Std + touch $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp + +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_filter_guile.d@am__quote@ endif $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp: @@ -1110,17 +1146,17 @@ $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp: ## post-processing on 'mingw32' host OS for the dependency file. ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_filter_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_filter.Std \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_filter_python.Std \ -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter_python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_filter.Std \ - > $(DEPDIR)/gnuradio_swig_py_filter.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_filter.Sd $(DEPDIR)/gnuradio_swig_py_filter.Std; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_python.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_filter_python.Std \ + > $(DEPDIR)/gnuradio_swig_py_filter_python.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_python.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_filter_python.Sd $(DEPDIR)/gnuradio_swig_py_filter_python.Std; \ fi; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter.S*; exit 1; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_python.S*; exit 1; \ fi; ## ## Mess with the SWIG output .Std dependency file, to create a @@ -1132,27 +1168,27 @@ $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp: ## ## (1) remove the current dependency file ## - $(RM) $(DEPDIR)/gnuradio_swig_py_filter.d + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_python.d ## ## (2) Copy the whole SWIG file: ## - cp $(DEPDIR)/gnuradio_swig_py_filter.Std $(DEPDIR)/gnuradio_swig_py_filter.d + cp $(DEPDIR)/gnuradio_swig_py_filter_python.Std $(DEPDIR)/gnuradio_swig_py_filter_python.d ## ## (3) all a carriage return to the end of the dependency file. ## - echo "" >> $(DEPDIR)/gnuradio_swig_py_filter.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_filter_python.d ## ## (4) from the SWIG file, remove the first line (the target); remove ## trailing " \" and " " from each line. Append ":" to each line, ## followed by 2 carriage returns, then append this to the end of ## the dependency file. ## - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_filter.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_filter.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_filter_python.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_filter_python.d ## ## (5) remove the SWIG-generated file ## - $(RM) $(DEPDIR)/gnuradio_swig_py_filter.Std + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_python.Std ## ## Create the stamp for this filename generation, to signal success in ## executing this rule; allows other threads waiting on this process @@ -1164,7 +1200,7 @@ $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp: # not guaranteed to be portable, but will probably work. If it works, # we have accurate dependencies for our swig stuff, which is good. -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_filter.d@am__quote@ +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_filter_python.d@am__quote@ # -*- Makefile -*- # @@ -1289,7 +1325,7 @@ endif # end of GUILE ## Entry rule for running SWIG -gnuradio_swig_py_io.h gnuradio_swig_py_io.py gnuradio_swig_py_io_python.cc: gnuradio_swig_py_io.i +gnuradio_swig_py_io_python.h gnuradio_swig_py_io.py gnuradio_swig_py_io_python.cc gnuradio_swig_py_io_guile.cc gnuradio_swig_py_io_guile.h: gnuradio_swig_py_io.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -1377,19 +1413,28 @@ gnuradio_swig_py_io.h gnuradio_swig_py_io.py gnuradio_swig_py_io_python.cc: gnur $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp: if GUILE if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_io_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_io.Std \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_io_guile.Std \ -module gnuradio_swig_py_io -o gnuradio_swig_py_io_guile.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_io.Std \ - > $(DEPDIR)/gnuradio_swig_py_io.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_io.Sd $(DEPDIR)/gnuradio_swig_py_io.Std; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_io_guile.Std \ + > $(DEPDIR)/gnuradio_swig_py_io_guile.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_io_guile.Sd $(DEPDIR)/gnuradio_swig_py_io_guile.Std; \ fi; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io.S*; exit 1; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.S*; exit 1; \ fi; touch $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp + $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.d + cp $(DEPDIR)/gnuradio_swig_py_io_guile.Std $(DEPDIR)/gnuradio_swig_py_io_guile.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_io_guile.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_io_guile.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_io_guile.d + $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.Std + touch $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp + +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_io_guile.d@am__quote@ endif $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp: @@ -1402,17 +1447,17 @@ $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp: ## post-processing on 'mingw32' host OS for the dependency file. ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_io_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_io.Std \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_io_python.Std \ -module gnuradio_swig_py_io -o gnuradio_swig_py_io_python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_io.Std \ - > $(DEPDIR)/gnuradio_swig_py_io.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_io.Sd $(DEPDIR)/gnuradio_swig_py_io.Std; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_io_python.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_io_python.Std \ + > $(DEPDIR)/gnuradio_swig_py_io_python.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_io_python.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_io_python.Sd $(DEPDIR)/gnuradio_swig_py_io_python.Std; \ fi; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io.S*; exit 1; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_io_python.S*; exit 1; \ fi; ## ## Mess with the SWIG output .Std dependency file, to create a @@ -1424,27 +1469,27 @@ $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp: ## ## (1) remove the current dependency file ## - $(RM) $(DEPDIR)/gnuradio_swig_py_io.d + $(RM) $(DEPDIR)/gnuradio_swig_py_io_python.d ## ## (2) Copy the whole SWIG file: ## - cp $(DEPDIR)/gnuradio_swig_py_io.Std $(DEPDIR)/gnuradio_swig_py_io.d + cp $(DEPDIR)/gnuradio_swig_py_io_python.Std $(DEPDIR)/gnuradio_swig_py_io_python.d ## ## (3) all a carriage return to the end of the dependency file. ## - echo "" >> $(DEPDIR)/gnuradio_swig_py_io.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_io_python.d ## ## (4) from the SWIG file, remove the first line (the target); remove ## trailing " \" and " " from each line. Append ":" to each line, ## followed by 2 carriage returns, then append this to the end of ## the dependency file. ## - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_io.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_io.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_io_python.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_io_python.d ## ## (5) remove the SWIG-generated file ## - $(RM) $(DEPDIR)/gnuradio_swig_py_io.Std + $(RM) $(DEPDIR)/gnuradio_swig_py_io_python.Std ## ## Create the stamp for this filename generation, to signal success in ## executing this rule; allows other threads waiting on this process @@ -1456,7 +1501,7 @@ $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp: # not guaranteed to be portable, but will probably work. If it works, # we have accurate dependencies for our swig stuff, which is good. -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_io.d@am__quote@ +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_io_python.d@am__quote@ # -*- Makefile -*- # @@ -1581,7 +1626,7 @@ endif # end of GUILE ## Entry rule for running SWIG -gnuradio_swig_py_hier.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier_python.cc: gnuradio_swig_py_hier.i +gnuradio_swig_py_hier_python.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier_python.cc gnuradio_swig_py_hier_guile.cc gnuradio_swig_py_hier_guile.h: gnuradio_swig_py_hier.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -1669,19 +1714,28 @@ gnuradio_swig_py_hier.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier_python.cc $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp: if GUILE if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_hier_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_hier.Std \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_hier_guile.Std \ -module gnuradio_swig_py_hier -o gnuradio_swig_py_hier_guile.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_hier.Std \ - > $(DEPDIR)/gnuradio_swig_py_hier.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_hier.Sd $(DEPDIR)/gnuradio_swig_py_hier.Std; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_hier_guile.Std \ + > $(DEPDIR)/gnuradio_swig_py_hier_guile.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_hier_guile.Sd $(DEPDIR)/gnuradio_swig_py_hier_guile.Std; \ fi; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier.S*; exit 1; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.S*; exit 1; \ fi; touch $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.d + cp $(DEPDIR)/gnuradio_swig_py_hier_guile.Std $(DEPDIR)/gnuradio_swig_py_hier_guile.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_hier_guile.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_hier_guile.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_hier_guile.d + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.Std + touch $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp + +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_hier_guile.d@am__quote@ endif $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp: @@ -1694,17 +1748,17 @@ $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp: ## post-processing on 'mingw32' host OS for the dependency file. ## if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_hier_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_hier.Std \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_hier_python.Std \ -module gnuradio_swig_py_hier -o gnuradio_swig_py_hier_python.cc $(WHAT); then \ if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_hier.Std \ - > $(DEPDIR)/gnuradio_swig_py_hier.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_hier.Sd $(DEPDIR)/gnuradio_swig_py_hier.Std; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_python.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_hier_python.Std \ + > $(DEPDIR)/gnuradio_swig_py_hier_python.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_python.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_hier_python.Sd $(DEPDIR)/gnuradio_swig_py_hier_python.Std; \ fi; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier.S*; exit 1; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_python.S*; exit 1; \ fi; ## ## Mess with the SWIG output .Std dependency file, to create a @@ -1716,27 +1770,27 @@ $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp: ## ## (1) remove the current dependency file ## - $(RM) $(DEPDIR)/gnuradio_swig_py_hier.d + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_python.d ## ## (2) Copy the whole SWIG file: ## - cp $(DEPDIR)/gnuradio_swig_py_hier.Std $(DEPDIR)/gnuradio_swig_py_hier.d + cp $(DEPDIR)/gnuradio_swig_py_hier_python.Std $(DEPDIR)/gnuradio_swig_py_hier_python.d ## ## (3) all a carriage return to the end of the dependency file. ## - echo "" >> $(DEPDIR)/gnuradio_swig_py_hier.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_hier_python.d ## ## (4) from the SWIG file, remove the first line (the target); remove ## trailing " \" and " " from each line. Append ":" to each line, ## followed by 2 carriage returns, then append this to the end of ## the dependency file. ## - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_hier.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_hier.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_hier_python.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_hier_python.d ## ## (5) remove the SWIG-generated file ## - $(RM) $(DEPDIR)/gnuradio_swig_py_hier.Std + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_python.Std ## ## Create the stamp for this filename generation, to signal success in ## executing this rule; allows other threads waiting on this process @@ -1748,5 +1802,5 @@ $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp: # not guaranteed to be portable, but will probably work. If it works, # we have accurate dependencies for our swig stuff, which is good. -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_hier.d@am__quote@ +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_hier_python.d@am__quote@ -- cgit From 1caa7d707377d093cf7d9b7e65176848a93bba5c Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sat, 16 Oct 2010 08:51:47 -0600 Subject: wrap all %pythoncode in SWIGPYTHON so they don't get inserted into other languages --- gnuradio-core/src/lib/runtime/gr_basic_block.i | 6 ++++++ gnuradio-core/src/lib/runtime/gr_block.i | 5 +++++ gnuradio-core/src/lib/runtime/gr_msg_queue.i | 5 +++++ gnuradio-core/src/lib/swig/gr_swig_block_magic.i | 5 +++++ 4 files changed, 21 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_basic_block.i b/gnuradio-core/src/lib/runtime/gr_basic_block.i index 60e08aac3..847ef3689 100644 --- a/gnuradio-core/src/lib/runtime/gr_basic_block.i +++ b/gnuradio-core/src/lib/runtime/gr_basic_block.i @@ -47,6 +47,12 @@ public: %rename(block_ncurrently_allocated) gr_basic_block_ncurrently_allocated; long gr_basic_block_ncurrently_allocated(); +#ifdef SWIGPYTHON %pythoncode %{ gr_basic_block_sptr.__repr__ = lambda self: "" % (self.name(), self.unique_id ()) %} +#endif + +#ifdef SWIGGUILE +#endif + diff --git a/gnuradio-core/src/lib/runtime/gr_block.i b/gnuradio-core/src/lib/runtime/gr_block.i index c2e2aa4b8..d89e638b2 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.i +++ b/gnuradio-core/src/lib/runtime/gr_block.i @@ -54,7 +54,12 @@ class gr_block : public gr_basic_block { void set_detail (gr_block_detail_sptr detail) { d_detail = detail; } }; +#ifdef SWIGPYTHON %pythoncode %{ gr_block_sptr.__repr__ = lambda self: "" % (self.name(), self.unique_id ()) gr_block_sptr.block = lambda self: self %} +#endif + +#ifdef SWIGGUILE +#endif diff --git a/gnuradio-core/src/lib/runtime/gr_msg_queue.i b/gnuradio-core/src/lib/runtime/gr_msg_queue.i index 9ca92b6ec..64aea602a 100644 --- a/gnuradio-core/src/lib/runtime/gr_msg_queue.i +++ b/gnuradio-core/src/lib/runtime/gr_msg_queue.i @@ -97,9 +97,14 @@ public: } %} +#ifdef SWIGPYTHON // smash in new python delete_head and insert_tail methods... %pythoncode %{ gr_msg_queue_sptr.delete_head = gr_py_msg_queue__delete_head gr_msg_queue_sptr.insert_tail = gr_py_msg_queue__insert_tail gr_msg_queue_sptr.handle = gr_py_msg_queue__insert_tail %} +#endif + +#ifdef SWIGGUILE +#endif diff --git a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i index 78e838012..e25afbdb5 100644 --- a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i +++ b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i @@ -30,10 +30,15 @@ typedef boost::shared_ptr NAME ## _sptr; %template(NAME ## _sptr) boost::shared_ptr; %rename(BASE_NAME) PKG ## _make_ ## BASE_NAME; +#ifdef SWIGPYTHON %pythoncode %{ NAME ## _sptr.block = lambda self: NAME ## _block (self) NAME ## _sptr.__repr__ = lambda self: "" % (self.name(), self.unique_id ()) %} +#endif %ignore NAME; %enddef + +#ifdef SWIGGUILE +#endif -- cgit From 422d912f685b412bdfd91f088628da6f5f8196ba Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sat, 16 Oct 2010 08:53:40 -0600 Subject: wrap pyrun python code in SWIGPYTHON ifdef so it doesn't appear in other languages --- gnuradio-core/src/lib/runtime/gr_single_threaded_scheduler.i | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_single_threaded_scheduler.i b/gnuradio-core/src/lib/runtime/gr_single_threaded_scheduler.i index 5e9032449..2378a1880 100644 --- a/gnuradio-core/src/lib/runtime/gr_single_threaded_scheduler.i +++ b/gnuradio-core/src/lib/runtime/gr_single_threaded_scheduler.i @@ -42,6 +42,7 @@ class gr_single_threaded_scheduler { gr_single_threaded_scheduler (const std::vector &modules); }; +#ifdef SWIGPYTHON %inline %{ void sts_pyrun (gr_single_threaded_scheduler_sptr s) { Py_BEGIN_ALLOW_THREADS; // release global interpreter lock @@ -49,3 +50,5 @@ class gr_single_threaded_scheduler { Py_END_ALLOW_THREADS; // acquire global interpreter lock } %} +#endif + -- cgit From b72fd746010bc724acfb6a7c5ae2be82e6b828c2 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sat, 16 Oct 2010 08:54:32 -0600 Subject: include complex too for std::complex --- gnuradio-core/src/lib/swig/gnuradio.i | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio.i b/gnuradio-core/src/lib/swig/gnuradio.i index 7d0241f1c..ec0264107 100644 --- a/gnuradio-core/src/lib/swig/gnuradio.i +++ b/gnuradio-core/src/lib/swig/gnuradio.i @@ -32,6 +32,7 @@ #include "gnuradio_swig_bug_workaround.h" // mandatory bug fix #include #include // size_t +#include %} %feature("autodoc","1"); @@ -57,6 +58,7 @@ namespace std { %template() vector; %template() vector; %template() vector; + // %template() std::complex; %template() vector< std::complex >; %template() vector< std::vector< unsigned char > >; -- cgit From 54bfe42875fc8625b193b63dc8a4d7327e89edc2 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sat, 16 Oct 2010 09:47:39 -0600 Subject: add #warning for missing guile support --- gnuradio-core/src/lib/runtime/gr_basic_block.i | 1 + gnuradio-core/src/lib/runtime/gr_block.i | 1 + gnuradio-core/src/lib/runtime/gr_msg_queue.i | 3 ++- gnuradio-core/src/lib/runtime/gr_top_block.i | 8 ++++++++ gnuradio-core/src/lib/swig/gr_swig_block_magic.i | 1 + 5 files changed, 13 insertions(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_basic_block.i b/gnuradio-core/src/lib/runtime/gr_basic_block.i index 847ef3689..f1de9e08a 100644 --- a/gnuradio-core/src/lib/runtime/gr_basic_block.i +++ b/gnuradio-core/src/lib/runtime/gr_basic_block.i @@ -54,5 +54,6 @@ gr_basic_block_sptr.__repr__ = lambda self: "" % (self.n #endif #ifdef SWIGGUILE +#warning "gr_basic_block.i: gr_block_sptr needs to be implemented!" #endif diff --git a/gnuradio-core/src/lib/runtime/gr_block.i b/gnuradio-core/src/lib/runtime/gr_block.i index d89e638b2..d13c268ca 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.i +++ b/gnuradio-core/src/lib/runtime/gr_block.i @@ -62,4 +62,5 @@ gr_block_sptr.block = lambda self: self #endif #ifdef SWIGGUILE +#warning "gr_block.i: gr_block_sptr needs to be implemented!" #endif diff --git a/gnuradio-core/src/lib/runtime/gr_msg_queue.i b/gnuradio-core/src/lib/runtime/gr_msg_queue.i index 64aea602a..5b8fea49f 100644 --- a/gnuradio-core/src/lib/runtime/gr_msg_queue.i +++ b/gnuradio-core/src/lib/runtime/gr_msg_queue.i @@ -81,6 +81,7 @@ public: * functions into the gr.msg_queue wrapper class, so that everything * appears normal. (An evil laugh is heard in the distance...) */ +#ifdef SWIGPYTHON %inline %{ gr_message_sptr gr_py_msg_queue__delete_head(gr_msg_queue_sptr q) { gr_message_sptr msg; @@ -97,7 +98,6 @@ public: } %} -#ifdef SWIGPYTHON // smash in new python delete_head and insert_tail methods... %pythoncode %{ gr_msg_queue_sptr.delete_head = gr_py_msg_queue__delete_head @@ -107,4 +107,5 @@ gr_msg_queue_sptr.handle = gr_py_msg_queue__insert_tail #endif #ifdef SWIGGUILE +#warning "gr_msg_queue.i: gr_msg_queue_sptr needs to be implemented!" #endif diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.i b/gnuradio-core/src/lib/runtime/gr_top_block.i index 670e5b5e5..579ef8f70 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block.i +++ b/gnuradio-core/src/lib/runtime/gr_top_block.i @@ -49,6 +49,8 @@ public: void dump(); }; +#ifdef SWIGPYTHON + %inline %{ void top_block_run_unlocked(gr_top_block_sptr r) throw (std::runtime_error) { @@ -64,3 +66,9 @@ void top_block_wait_unlocked(gr_top_block_sptr r) throw (std::runtime_error) Py_END_ALLOW_THREADS; // acquire global interpreter lock } %} + +#endif + +#ifdef SWIG_GUILE +#warning "gr_top_block.i: top_block_run_unlocked needs to be implemented!" +#endif diff --git a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i index e25afbdb5..99e01b0ef 100644 --- a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i +++ b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i @@ -41,4 +41,5 @@ NAME ## _sptr.__repr__ = lambda self: "" % (self.name(), self. %enddef #ifdef SWIGGUILE +#warning "gr_block_sptr needs to be implemented!" #endif -- cgit From d97eacbf2444393d2698b1627ef7e6219ae32a3e Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sat, 16 Oct 2010 09:48:27 -0600 Subject: don't use ensure_py_gil_state for guile --- gnuradio-core/src/lib/general/gr_feval.i | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/general/gr_feval.i b/gnuradio-core/src/lib/general/gr_feval.i index 8594a6fa1..9a1269375 100644 --- a/gnuradio-core/src/lib/general/gr_feval.i +++ b/gnuradio-core/src/lib/general/gr_feval.i @@ -65,8 +65,8 @@ // catch (Swig::DirectorException &e) { std::cerr << e.getMessage(); SWIG_fail; } //} +#ifdef SWIGPYTHON %{ - // class that ensures we acquire and release the Python GIL class ensure_py_gil_state { @@ -77,6 +77,18 @@ public: }; %} +#endif + +#ifdef SWIGGUILE +// FIXME: this is a bogus stub, just here so things build +class ensure_py_gil_state { +public: + ensure_py_gil_state() { } + ~ensure_py_gil_state() { } +}; + +#warning "class ensure_py_gil_state needs to be implemented!" +#endif /* * These are the real C++ base classes, however we don't want these exposed. -- cgit From 1366ce59314bb24825715a1a041b63081b5181e2 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 18 Oct 2010 12:48:54 -0600 Subject: add the load-extension command for guile --- gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i | 6 ++++++ gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i | 6 ++++++ gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i | 6 ++++++ gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i | 6 ++++++ gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i | 6 ++++++ gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i | 7 +++++++ 6 files changed, 37 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i index 6396a97d0..42e46d444 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i @@ -28,3 +28,9 @@ %include "gnuradio.i" // the common stuff %include "filter.i" + +#if SWIGGUILE +%scheme %{ +(load-extension "_gnuradio_swig_py_filter_guile" "SWIG_init") +%} + #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i index 3ab1b056a..dcf284ab3 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i @@ -28,3 +28,9 @@ %include "gnuradio.i" // the common stuff %include "general.i" + +#if SWIGGUILE +%scheme %{ +(load-extension "_gnuradio_swig_py_general_guile" "SWIG_init") +%} +#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i index 95e85cf6b..ee18abc18 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i @@ -28,3 +28,9 @@ %include "gnuradio.i" // the common stuff %include "gengen.i" + +#if SWIGGUILE +%scheme %{ +(load-extension "_gnuradio_swig_py_gengen_guile" "SWIG_init") +%} +#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i index a82b5ae41..36ee3c40d 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i @@ -28,3 +28,9 @@ %include "gnuradio.i" // the common stuff %include "hier.i" + +#if SWIGGUILE +%scheme %{ +(load-extension "_gnuradio_swig_py_heir_guile" "SWIG_init") +%} +#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i index 9318f5d86..cb8509b10 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i @@ -28,3 +28,9 @@ %include "gnuradio.i" // the common stuff %include "io.i" + +#if SWIGGUILE +%scheme %{ +(load-extension "_gnuradio_swig_py_io_guile" "SWIG_init") +%} +#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i index 8f444f9c5..a3ab8d012 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i @@ -30,3 +30,10 @@ %include "gnuradio.i" // the common stuff %include "runtime.i" + + +#if SWIGGUILE +%scheme %{ +(load-extension "_gnuradio_swig_py_runtime_guile" "SWIG_init") +%} +#endif -- cgit From bf1f10e1fefa2b342c1f10ccc8863e800eb1870b Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 18 Oct 2010 12:50:21 -0600 Subject: don't stub out ensure_py_gil_state, ifdef it out as it's python specific --- gnuradio-core/src/lib/general/gr_feval.i | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/general/gr_feval.i b/gnuradio-core/src/lib/general/gr_feval.i index 9a1269375..843ca3f2a 100644 --- a/gnuradio-core/src/lib/general/gr_feval.i +++ b/gnuradio-core/src/lib/general/gr_feval.i @@ -80,13 +80,14 @@ public: #endif #ifdef SWIGGUILE +#if 0 // FIXME: this is a bogus stub, just here so things build class ensure_py_gil_state { public: ensure_py_gil_state() { } ~ensure_py_gil_state() { } }; - +#endif #warning "class ensure_py_gil_state needs to be implemented!" #endif @@ -157,7 +158,9 @@ class gr_py_feval_dd : public gr_feval_dd public: double calleval(double x) { +#ifdef PYTHON ensure_py_gil_state _lock; +#endif return eval(x); } }; @@ -167,7 +170,9 @@ class gr_py_feval_cc : public gr_feval_cc public: gr_complex calleval(gr_complex x) { +#ifdef PYTHON ensure_py_gil_state _lock; +#endif return eval(x); } }; @@ -177,7 +182,9 @@ class gr_py_feval_ll : public gr_feval_ll public: long calleval(long x) { +#ifdef PYTHON ensure_py_gil_state _lock; +#endif return eval(x); } }; @@ -187,7 +194,9 @@ class gr_py_feval : public gr_feval public: void calleval() { +#ifdef PYTHON ensure_py_gil_state _lock; +#endif eval(); } }; -- cgit From 2038e0981a95ac2093843cdc8c82e5fa0bdeadfa Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 18 Oct 2010 12:52:26 -0600 Subject: use foreach...subst to make a list of generated files instead of cut & paste for BUILT_SOURCES --- gnuradio-core/src/lib/swig/Makefile.am | 45 ++++++++++++---------------------- 1 file changed, 16 insertions(+), 29 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 391182616..cbb2a80a5 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -20,6 +20,9 @@ # include $(top_srcdir)/Makefile.common +include $(top_srcdir)/Makefile.swig + +BUILT_SOURCES = $(grinclude_HEADERS) $(swig_built_sources) if PYTHON AM_CPPFLAGS = -I$(srcdir) $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \ @@ -41,16 +44,11 @@ ourpython_PYTHON = gnuradio_swig_python.py # ---------------------------------------------------------------- # FIXME As of swig 1.3.31, this still seems to be required... -workarounds = gnuradio_swig_py_runtime_python.cc -# if GUILE -# workarounds += gnuradio_swig_py_runtime_guile.cc -# endif -gnuradio_swig_bug_workaround.h : $(workarounds) $(srcdir)/gen-swig-bug-fix - $(PYTHON) $(srcdir)/gen-swig-bug-fix $(workarounds) $@ +gnuradio_swig_bug_workaround.h : gnuradio_swig_py_runtime_python.cc $(srcdir)/gen-swig-bug-fix + $(PYTHON) $(srcdir)/gen-swig-bug-fix gnuradio_swig_py_runtime_python.cc $@ # C/C++ headers get installed in ${prefix}/include/gnuradio -grinclude_HEADERS = \ - gnuradio_swig_bug_workaround.h +grinclude_HEADERS = gnuradio_swig_bug_workaround.h # ---------------------------------------------------------------- # We've split the previously monstrous gnuradio_swig_python into 6 @@ -86,31 +84,20 @@ gnuradio_swig_py_filter_la_swig_libadd = $(GNURADIO_CORE_LA) gnuradio_swig_py_io_la_swig_libadd = $(GNURADIO_CORE_LA) gnuradio_swig_py_hier_la_swig_libadd = $(GNURADIO_CORE_LA) -include $(top_srcdir)/Makefile.swig - # add some of the variables generated inside the Makefile.swig # include the SWIG-generated .h files in the BUILT SOURCES, since they # aren't by default when using Makefile.swig; order doesn't matter. -PYTHON_GEN = \ - gnuradio_swig_py_runtime_python.h \ - gnuradio_swig_py_general_python.h \ - gnuradio_swig_py_gengen_python.h \ - gnuradio_swig_py_filter_python.h \ - gnuradio_swig_py_io_python.h \ - gnuradio_swig_py_hier_python.h \ - $(grinclude_HEADERS) \ - $(swig_built_sources) - -BUILT_GUILE = \ - $(grinclude_HEADERS) \ - $(swig_built_sources) - -BUILT_SOURCES = $(PYTHON_GEN) -# if GUILE -# BUILT_SOURCES += $(BUILT_GUILE) -# endif +PYTHON_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(subst .i,_python.h,$(HFILE))) +BUILT_SOURCES += $(PYTHON_GEN) + +endif # end of if python + +if GUILE +GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(subst .i,_guile.h,$(HFILE))) +BUILT_SOURCES += $(GUILE_GEN) +endif # Do not distribute the output of SWIG no_dist_files = $(swig_built_sources) -endif # end of if python + -- cgit From c4f8aab885d6a188591cebc9683cc297b60b445c Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 18 Oct 2010 17:26:04 -0600 Subject: add top level guile file --- gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm b/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm new file mode 100644 index 000000000..f57cd1982 --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm @@ -0,0 +1,31 @@ +;;; +;;; Copyright 2006,2009 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, write to the Free Software Foundation, Inc., +;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +;;; + +(set! %load-path (append %load-path '("/usr/lib/guile/gnuradio"))) + +;;; %load-path() +;;; (list (%site-dir) (%library-dir) (%package-data-dir) "."), + +;; (load "gnuradio/gnuradio_swig_py_filter.scm") +;; (load "gnuradio/gnuradio_swig_py_general.scm") +;; (load "gnuradio/gnuradio_swig_py_gengen.scm") +;; (load "gnuradio/gnuradio_swig_py_heir.scm") +(load "gnuradio/gnuradio_swig_py_io.scm") +(load "gnuradio/gnuradio_swig_py_runtime.scm") -- cgit From 2ecda7ddb8dc062caa2e87fa1a53c09ca483af4c Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 18 Oct 2010 18:15:04 -0600 Subject: load what'll load for now --- gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm b/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm index f57cd1982..687f7f1f5 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm @@ -18,14 +18,17 @@ ;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ;;; -(set! %load-path (append %load-path '("/usr/lib/guile/gnuradio"))) +;; Only use these if load-* fails t find a .scm or .so. If you can't +;; find a .so. try running ldconfig. guile seems to only load modules +;; that are in the ldconfig paths. +;; (set! %load-path (append %load-path '("/usr/lib/guile/gnuradio"))) +;; (set! %load-path (append %load-path '("/usr/share/gnuradio"))) -;;; %load-path() -;;; (list (%site-dir) (%library-dir) (%package-data-dir) "."), +(load "gnuradio/gnuradio_swig_py_filter.scm") +(load "gnuradio/gnuradio_swig_py_io.scm") +(load "gnuradio/gnuradio_swig_py_runtime.scm") -;; (load "gnuradio/gnuradio_swig_py_filter.scm") +;; FIXME: these don't load for sme reason ;; (load "gnuradio/gnuradio_swig_py_general.scm") ;; (load "gnuradio/gnuradio_swig_py_gengen.scm") ;; (load "gnuradio/gnuradio_swig_py_heir.scm") -(load "gnuradio/gnuradio_swig_py_io.scm") -(load "gnuradio/gnuradio_swig_py_runtime.scm") -- cgit From 0876f100362f6275e9d16bfed0fc389d082f86b9 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 18 Oct 2010 18:15:41 -0600 Subject: install the scm files for guile too --- gnuradio-core/src/lib/swig/Makefile.am | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index cbb2a80a5..73ba23b84 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -41,6 +41,12 @@ swiginclude_HEADERS = \ ourpythondir = $(grpythondir)/gr ourpython_PYTHON = gnuradio_swig_python.py +# 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. +guiledir = @GUILE_PKDATADIR@ +guile_DATA = gnuradio_swig_guile.scm + # ---------------------------------------------------------------- # FIXME As of swig 1.3.31, this still seems to be required... @@ -94,10 +100,17 @@ BUILT_SOURCES += $(PYTHON_GEN) endif # end of if python if GUILE -GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(subst .i,_guile.h,$(HFILE))) +GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(subst .i,.scm,$(HFILE))) BUILT_SOURCES += $(GUILE_GEN) endif # Do not distribute the output of SWIG no_dist_files = $(swig_built_sources) +#gnuradio_swig_py_runtime.scm: gnuradio_swig_py_runtime.i +# gnuradio_swig_py_runtime_python.cc: gnuradio_swig_py_runtime.i +# .cc..i: +# @echo "FIXME1: $(BUILT_SOURCES) $<" + +# .scm..i: +# @echo "FIXME2: $(BUILT_SOURCES) $<" -- cgit From 5ea1059c943a8a6dcb67c2a151f27b84b653f549 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 18 Oct 2010 18:15:58 -0600 Subject: regenerated --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 558 +++++++++++++++++++-------- 1 file changed, 390 insertions(+), 168 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index 42c431204..091cdf82b 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -38,6 +38,16 @@ gnuradio_swig_py_runtime_pylibdir_category ?= $(gnuradio_swig_py_runtime_pythond gnuradio_swig_py_runtime_pythondir = $(pythondir)/$(gnuradio_swig_py_runtime_pythondir_category) gnuradio_swig_py_runtime_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_runtime_pylibdir_category) +# The .so libraries for the guile modules get installed whereever guile +# is installed, usually /usr/lib/guile/gnuradio/ +# FIXME: determince whether these should be installed with gnuradio. +gnuradio_swig_py_runtime_scmlibdir = @GUILE_PKLIBDIR@/gnuradio + +# The scm files for the guile modules get installed where ever guile +# is installed, usually /usr/share/guile/site/gnuradio_swig_py_runtime +# FIXME: determince whether these should be installed with gnuradio. +gnuradio_swig_py_runtime_scmdir = @GUILE_PKDATADIR@/gnuradio + ## SWIG headers are always installed into the same directory. gnuradio_swig_py_runtime_swigincludedir = $(swigincludedir) @@ -73,6 +83,9 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## be added manually by the including Makefile.am . swig_built_sources += gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime_python.cc +if GUILE +swig_built_sources += gnuradio_swig_py_runtime.scm gnuradio_swig_py_runtime_guile.cc +endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -106,11 +119,11 @@ gnuradio_swig_py_runtime_python_PYTHON = \ $(gnuradio_swig_py_runtime_python) if GUILE -gnuradio_swig_py_runtime_pylib_LTLIBRARIES += _gnuradio_swig_py_runtime_guile.la - +gnuradio_swig_py_runtime_scmlib_LTLIBRARIES = _gnuradio_swig_py_runtime_guile.la _gnuradio_swig_py_runtime_guile_la_SOURCES = \ - gnuradio_swig_py_runtime_guile.cc \ + gnuradio_swig_py_runtime_guile.cc \ $(gnuradio_swig_py_runtime_la_swig_sources) +gnuradio_swig_py_runtime_scm_DATA = gnuradio_swig_py_runtime.scm # Guile can use the same flags as python does _gnuradio_swig_py_runtime_guile_la_LIBADD = $(_gnuradio_swig_py_runtime_python_la_LIBADD) @@ -121,7 +134,8 @@ endif # end of GUILE ## Entry rule for running SWIG -gnuradio_swig_py_runtime_python.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime_python.cc gnuradio_swig_py_runtime_guile.cc gnuradio_swig_py_runtime_guile.h: gnuradio_swig_py_runtime.i +# $(python_deps) $(guile_deps): gnuradio_swig_py_runtime.i +gnuradio_swig_py_runtime_python.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime_python.cc: gnuradio_swig_py_runtime.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -178,7 +192,6 @@ gnuradio_swig_py_runtime_python.h gnuradio_swig_py_runtime.py gnuradio_swig_py_r ## Tell MAKE to run the rule for creating this stamp. ## $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp WHAT=$<; \ - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp WHAT=$<; \ ## ## Now that the .cc, .h, and .py files have been (re)created from the ## .i file, future checking of this rule during the same MAKE @@ -206,32 +219,23 @@ gnuradio_swig_py_runtime_python.h gnuradio_swig_py_runtime.py gnuradio_swig_py_r exit $$?; \ fi; -$(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp: +# the comments for the target above apply to this target as well, but it seemed +# silly to include them twice. The only main change is for guile. +gnuradio_swig_py_runtime_guile.h gnuradio_swig_py_runtime.scm gnuradio_swig_py_runtime_guile.cc: gnuradio_swig_py_runtime.i if GUILE - if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_runtime_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std \ - -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime_guile.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std \ - > $(DEPDIR)/gnuradio_swig_py_runtime_guile.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Sd $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std; \ - fi; \ + trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_runtime-generate-*' 1 2 13 15; \ + if mkdir $(DEPDIR)/gnuradio_swig_py_runtime-generate-lock 2>/dev/null; then \ + rm -f $(DEPDIR)/gnuradio_swig_py_runtime-generate-*stamp; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp WHAT=$<; \ + rmdir $(DEPDIR)/gnuradio_swig_py_runtime-generate-lock; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.S*; exit 1; \ + while test -d $(DEPDIR)/gnuradio_swig_py_runtime-generate-lock; do \ + sleep 1; \ + done; \ + test -f $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp; \ + exit $$?; \ fi; - touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.d - cp $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std $(DEPDIR)/gnuradio_swig_py_runtime_guile.d - echo "" >> $(DEPDIR)/gnuradio_swig_py_runtime_guile.d - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_runtime_guile.d - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std - touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_runtime_guile.d@am__quote@ -endif +endif # end of GUILE $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp: ## This rule will be called only by the first process issuing the @@ -299,6 +303,39 @@ $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp: @am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_runtime_python.d@am__quote@ +if GUILE +$(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp: +# the comments for the target above apply to this target as well, but it seemed +# silly to include them twice. The only main change is for guile. + if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_runtime_swig_args) \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std \ + -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime_guile.cc $(WHAT); then \ + if test $(host_os) = mingw32; then \ + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std \ + > $(DEPDIR)/gnuradio_swig_py_runtime_guile.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Sd $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std; \ + fi; \ + else \ + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.S*; exit 1; \ + fi; + touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.d + cp $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std $(DEPDIR)/gnuradio_swig_py_runtime_guile.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_runtime_guile.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_runtime_guile.d + $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std + touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp +else + touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp +endif + +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_runtime_guile.d@am__quote@ + +#gnuradio_swig_py_runtime_python.h: gnuradio_swig_py_runtime.i + # -*- Makefile -*- # # Copyright 2009 Free Software Foundation, Inc. @@ -339,6 +376,16 @@ gnuradio_swig_py_general_pylibdir_category ?= $(gnuradio_swig_py_general_pythond gnuradio_swig_py_general_pythondir = $(pythondir)/$(gnuradio_swig_py_general_pythondir_category) gnuradio_swig_py_general_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_general_pylibdir_category) +# The .so libraries for the guile modules get installed whereever guile +# is installed, usually /usr/lib/guile/gnuradio/ +# FIXME: determince whether these should be installed with gnuradio. +gnuradio_swig_py_general_scmlibdir = @GUILE_PKLIBDIR@/gnuradio + +# The scm files for the guile modules get installed where ever guile +# is installed, usually /usr/share/guile/site/gnuradio_swig_py_general +# FIXME: determince whether these should be installed with gnuradio. +gnuradio_swig_py_general_scmdir = @GUILE_PKDATADIR@/gnuradio + ## SWIG headers are always installed into the same directory. gnuradio_swig_py_general_swigincludedir = $(swigincludedir) @@ -374,6 +421,9 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## be added manually by the including Makefile.am . swig_built_sources += gnuradio_swig_py_general.py gnuradio_swig_py_general_python.cc +if GUILE +swig_built_sources += gnuradio_swig_py_general.scm gnuradio_swig_py_general_guile.cc +endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -407,11 +457,11 @@ gnuradio_swig_py_general_python_PYTHON = \ $(gnuradio_swig_py_general_python) if GUILE -gnuradio_swig_py_general_pylib_LTLIBRARIES += _gnuradio_swig_py_general_guile.la - +gnuradio_swig_py_general_scmlib_LTLIBRARIES = _gnuradio_swig_py_general_guile.la _gnuradio_swig_py_general_guile_la_SOURCES = \ - gnuradio_swig_py_general_guile.cc \ + gnuradio_swig_py_general_guile.cc \ $(gnuradio_swig_py_general_la_swig_sources) +gnuradio_swig_py_general_scm_DATA = gnuradio_swig_py_general.scm # Guile can use the same flags as python does _gnuradio_swig_py_general_guile_la_LIBADD = $(_gnuradio_swig_py_general_python_la_LIBADD) @@ -422,7 +472,8 @@ endif # end of GUILE ## Entry rule for running SWIG -gnuradio_swig_py_general_python.h gnuradio_swig_py_general.py gnuradio_swig_py_general_python.cc gnuradio_swig_py_general_guile.cc gnuradio_swig_py_general_guile.h: gnuradio_swig_py_general.i +# $(python_deps) $(guile_deps): gnuradio_swig_py_general.i +gnuradio_swig_py_general_python.h gnuradio_swig_py_general.py gnuradio_swig_py_general_python.cc: gnuradio_swig_py_general.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -479,7 +530,6 @@ gnuradio_swig_py_general_python.h gnuradio_swig_py_general.py gnuradio_swig_py_g ## Tell MAKE to run the rule for creating this stamp. ## $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp WHAT=$<; \ - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp WHAT=$<; \ ## ## Now that the .cc, .h, and .py files have been (re)created from the ## .i file, future checking of this rule during the same MAKE @@ -507,32 +557,23 @@ gnuradio_swig_py_general_python.h gnuradio_swig_py_general.py gnuradio_swig_py_g exit $$?; \ fi; -$(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp: +# the comments for the target above apply to this target as well, but it seemed +# silly to include them twice. The only main change is for guile. +gnuradio_swig_py_general_guile.h gnuradio_swig_py_general.scm gnuradio_swig_py_general_guile.cc: gnuradio_swig_py_general.i if GUILE - if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_general_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_general_guile.Std \ - -module gnuradio_swig_py_general -o gnuradio_swig_py_general_guile.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_general_guile.Std \ - > $(DEPDIR)/gnuradio_swig_py_general_guile.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_general_guile.Sd $(DEPDIR)/gnuradio_swig_py_general_guile.Std; \ - fi; \ + trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_general-generate-*' 1 2 13 15; \ + if mkdir $(DEPDIR)/gnuradio_swig_py_general-generate-lock 2>/dev/null; then \ + rm -f $(DEPDIR)/gnuradio_swig_py_general-generate-*stamp; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp WHAT=$<; \ + rmdir $(DEPDIR)/gnuradio_swig_py_general-generate-lock; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.S*; exit 1; \ + while test -d $(DEPDIR)/gnuradio_swig_py_general-generate-lock; do \ + sleep 1; \ + done; \ + test -f $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp; \ + exit $$?; \ fi; - touch $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp - $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.d - cp $(DEPDIR)/gnuradio_swig_py_general_guile.Std $(DEPDIR)/gnuradio_swig_py_general_guile.d - echo "" >> $(DEPDIR)/gnuradio_swig_py_general_guile.d - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_general_guile.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_general_guile.d - $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.Std - touch $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_general_guile.d@am__quote@ -endif +endif # end of GUILE $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp: ## This rule will be called only by the first process issuing the @@ -600,6 +641,39 @@ $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp: @am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_general_python.d@am__quote@ +if GUILE +$(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp: +# the comments for the target above apply to this target as well, but it seemed +# silly to include them twice. The only main change is for guile. + if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_general_swig_args) \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_general_guile.Std \ + -module gnuradio_swig_py_general -o gnuradio_swig_py_general_guile.cc $(WHAT); then \ + if test $(host_os) = mingw32; then \ + $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_general_guile.Std \ + > $(DEPDIR)/gnuradio_swig_py_general_guile.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_general_guile.Sd $(DEPDIR)/gnuradio_swig_py_general_guile.Std; \ + fi; \ + else \ + $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.S*; exit 1; \ + fi; + touch $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp + $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.d + cp $(DEPDIR)/gnuradio_swig_py_general_guile.Std $(DEPDIR)/gnuradio_swig_py_general_guile.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_general_guile.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_general_guile.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_general_guile.d + $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.Std + touch $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp +else + touch $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp +endif + +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_general_guile.d@am__quote@ + +#gnuradio_swig_py_runtime_python.h: gnuradio_swig_py_runtime.i + # -*- Makefile -*- # # Copyright 2009 Free Software Foundation, Inc. @@ -640,6 +714,16 @@ gnuradio_swig_py_gengen_pylibdir_category ?= $(gnuradio_swig_py_gengen_pythondir gnuradio_swig_py_gengen_pythondir = $(pythondir)/$(gnuradio_swig_py_gengen_pythondir_category) gnuradio_swig_py_gengen_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_gengen_pylibdir_category) +# The .so libraries for the guile modules get installed whereever guile +# is installed, usually /usr/lib/guile/gnuradio/ +# FIXME: determince whether these should be installed with gnuradio. +gnuradio_swig_py_gengen_scmlibdir = @GUILE_PKLIBDIR@/gnuradio + +# The scm files for the guile modules get installed where ever guile +# is installed, usually /usr/share/guile/site/gnuradio_swig_py_gengen +# FIXME: determince whether these should be installed with gnuradio. +gnuradio_swig_py_gengen_scmdir = @GUILE_PKDATADIR@/gnuradio + ## SWIG headers are always installed into the same directory. gnuradio_swig_py_gengen_swigincludedir = $(swigincludedir) @@ -675,6 +759,9 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## be added manually by the including Makefile.am . swig_built_sources += gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen_python.cc +if GUILE +swig_built_sources += gnuradio_swig_py_gengen.scm gnuradio_swig_py_gengen_guile.cc +endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -708,11 +795,11 @@ gnuradio_swig_py_gengen_python_PYTHON = \ $(gnuradio_swig_py_gengen_python) if GUILE -gnuradio_swig_py_gengen_pylib_LTLIBRARIES += _gnuradio_swig_py_gengen_guile.la - +gnuradio_swig_py_gengen_scmlib_LTLIBRARIES = _gnuradio_swig_py_gengen_guile.la _gnuradio_swig_py_gengen_guile_la_SOURCES = \ - gnuradio_swig_py_gengen_guile.cc \ + gnuradio_swig_py_gengen_guile.cc \ $(gnuradio_swig_py_gengen_la_swig_sources) +gnuradio_swig_py_gengen_scm_DATA = gnuradio_swig_py_gengen.scm # Guile can use the same flags as python does _gnuradio_swig_py_gengen_guile_la_LIBADD = $(_gnuradio_swig_py_gengen_python_la_LIBADD) @@ -723,7 +810,8 @@ endif # end of GUILE ## Entry rule for running SWIG -gnuradio_swig_py_gengen_python.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen_python.cc gnuradio_swig_py_gengen_guile.cc gnuradio_swig_py_gengen_guile.h: gnuradio_swig_py_gengen.i +# $(python_deps) $(guile_deps): gnuradio_swig_py_gengen.i +gnuradio_swig_py_gengen_python.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen_python.cc: gnuradio_swig_py_gengen.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -780,7 +868,6 @@ gnuradio_swig_py_gengen_python.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gen ## Tell MAKE to run the rule for creating this stamp. ## $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp WHAT=$<; \ - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp WHAT=$<; \ ## ## Now that the .cc, .h, and .py files have been (re)created from the ## .i file, future checking of this rule during the same MAKE @@ -808,32 +895,23 @@ gnuradio_swig_py_gengen_python.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gen exit $$?; \ fi; -$(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp: +# the comments for the target above apply to this target as well, but it seemed +# silly to include them twice. The only main change is for guile. +gnuradio_swig_py_gengen_guile.h gnuradio_swig_py_gengen.scm gnuradio_swig_py_gengen_guile.cc: gnuradio_swig_py_gengen.i if GUILE - if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_gengen_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std \ - -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen_guile.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std \ - > $(DEPDIR)/gnuradio_swig_py_gengen_guile.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Sd $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std; \ - fi; \ + trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_gengen-generate-*' 1 2 13 15; \ + if mkdir $(DEPDIR)/gnuradio_swig_py_gengen-generate-lock 2>/dev/null; then \ + rm -f $(DEPDIR)/gnuradio_swig_py_gengen-generate-*stamp; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp WHAT=$<; \ + rmdir $(DEPDIR)/gnuradio_swig_py_gengen-generate-lock; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.S*; exit 1; \ + while test -d $(DEPDIR)/gnuradio_swig_py_gengen-generate-lock; do \ + sleep 1; \ + done; \ + test -f $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp; \ + exit $$?; \ fi; - touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.d - cp $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std $(DEPDIR)/gnuradio_swig_py_gengen_guile.d - echo "" >> $(DEPDIR)/gnuradio_swig_py_gengen_guile.d - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_gengen_guile.d - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std - touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_gengen_guile.d@am__quote@ -endif +endif # end of GUILE $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp: ## This rule will be called only by the first process issuing the @@ -901,6 +979,39 @@ $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp: @am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_gengen_python.d@am__quote@ +if GUILE +$(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp: +# the comments for the target above apply to this target as well, but it seemed +# silly to include them twice. The only main change is for guile. + if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_gengen_swig_args) \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std \ + -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen_guile.cc $(WHAT); then \ + if test $(host_os) = mingw32; then \ + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std \ + > $(DEPDIR)/gnuradio_swig_py_gengen_guile.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Sd $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std; \ + fi; \ + else \ + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.S*; exit 1; \ + fi; + touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.d + cp $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std $(DEPDIR)/gnuradio_swig_py_gengen_guile.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_gengen_guile.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_gengen_guile.d + $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std + touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp +else + touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp +endif + +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_gengen_guile.d@am__quote@ + +#gnuradio_swig_py_runtime_python.h: gnuradio_swig_py_runtime.i + # -*- Makefile -*- # # Copyright 2009 Free Software Foundation, Inc. @@ -941,6 +1052,16 @@ gnuradio_swig_py_filter_pylibdir_category ?= $(gnuradio_swig_py_filter_pythondir gnuradio_swig_py_filter_pythondir = $(pythondir)/$(gnuradio_swig_py_filter_pythondir_category) gnuradio_swig_py_filter_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_filter_pylibdir_category) +# The .so libraries for the guile modules get installed whereever guile +# is installed, usually /usr/lib/guile/gnuradio/ +# FIXME: determince whether these should be installed with gnuradio. +gnuradio_swig_py_filter_scmlibdir = @GUILE_PKLIBDIR@/gnuradio + +# The scm files for the guile modules get installed where ever guile +# is installed, usually /usr/share/guile/site/gnuradio_swig_py_filter +# FIXME: determince whether these should be installed with gnuradio. +gnuradio_swig_py_filter_scmdir = @GUILE_PKDATADIR@/gnuradio + ## SWIG headers are always installed into the same directory. gnuradio_swig_py_filter_swigincludedir = $(swigincludedir) @@ -976,6 +1097,9 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## be added manually by the including Makefile.am . swig_built_sources += gnuradio_swig_py_filter.py gnuradio_swig_py_filter_python.cc +if GUILE +swig_built_sources += gnuradio_swig_py_filter.scm gnuradio_swig_py_filter_guile.cc +endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -1009,11 +1133,11 @@ gnuradio_swig_py_filter_python_PYTHON = \ $(gnuradio_swig_py_filter_python) if GUILE -gnuradio_swig_py_filter_pylib_LTLIBRARIES += _gnuradio_swig_py_filter_guile.la - +gnuradio_swig_py_filter_scmlib_LTLIBRARIES = _gnuradio_swig_py_filter_guile.la _gnuradio_swig_py_filter_guile_la_SOURCES = \ - gnuradio_swig_py_filter_guile.cc \ + gnuradio_swig_py_filter_guile.cc \ $(gnuradio_swig_py_filter_la_swig_sources) +gnuradio_swig_py_filter_scm_DATA = gnuradio_swig_py_filter.scm # Guile can use the same flags as python does _gnuradio_swig_py_filter_guile_la_LIBADD = $(_gnuradio_swig_py_filter_python_la_LIBADD) @@ -1024,7 +1148,8 @@ endif # end of GUILE ## Entry rule for running SWIG -gnuradio_swig_py_filter_python.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter_python.cc gnuradio_swig_py_filter_guile.cc gnuradio_swig_py_filter_guile.h: gnuradio_swig_py_filter.i +# $(python_deps) $(guile_deps): gnuradio_swig_py_filter.i +gnuradio_swig_py_filter_python.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter_python.cc: gnuradio_swig_py_filter.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -1081,7 +1206,6 @@ gnuradio_swig_py_filter_python.h gnuradio_swig_py_filter.py gnuradio_swig_py_fil ## Tell MAKE to run the rule for creating this stamp. ## $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp WHAT=$<; \ - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp WHAT=$<; \ ## ## Now that the .cc, .h, and .py files have been (re)created from the ## .i file, future checking of this rule during the same MAKE @@ -1109,32 +1233,23 @@ gnuradio_swig_py_filter_python.h gnuradio_swig_py_filter.py gnuradio_swig_py_fil exit $$?; \ fi; -$(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp: +# the comments for the target above apply to this target as well, but it seemed +# silly to include them twice. The only main change is for guile. +gnuradio_swig_py_filter_guile.h gnuradio_swig_py_filter.scm gnuradio_swig_py_filter_guile.cc: gnuradio_swig_py_filter.i if GUILE - if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_filter_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_filter_guile.Std \ - -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter_guile.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_filter_guile.Std \ - > $(DEPDIR)/gnuradio_swig_py_filter_guile.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_filter_guile.Sd $(DEPDIR)/gnuradio_swig_py_filter_guile.Std; \ - fi; \ + trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_filter-generate-*' 1 2 13 15; \ + if mkdir $(DEPDIR)/gnuradio_swig_py_filter-generate-lock 2>/dev/null; then \ + rm -f $(DEPDIR)/gnuradio_swig_py_filter-generate-*stamp; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp WHAT=$<; \ + rmdir $(DEPDIR)/gnuradio_swig_py_filter-generate-lock; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.S*; exit 1; \ + while test -d $(DEPDIR)/gnuradio_swig_py_filter-generate-lock; do \ + sleep 1; \ + done; \ + test -f $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp; \ + exit $$?; \ fi; - touch $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.d - cp $(DEPDIR)/gnuradio_swig_py_filter_guile.Std $(DEPDIR)/gnuradio_swig_py_filter_guile.d - echo "" >> $(DEPDIR)/gnuradio_swig_py_filter_guile.d - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_filter_guile.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_filter_guile.d - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.Std - touch $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_filter_guile.d@am__quote@ -endif +endif # end of GUILE $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp: ## This rule will be called only by the first process issuing the @@ -1202,6 +1317,39 @@ $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp: @am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_filter_python.d@am__quote@ +if GUILE +$(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp: +# the comments for the target above apply to this target as well, but it seemed +# silly to include them twice. The only main change is for guile. + if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_filter_swig_args) \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_filter_guile.Std \ + -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter_guile.cc $(WHAT); then \ + if test $(host_os) = mingw32; then \ + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_filter_guile.Std \ + > $(DEPDIR)/gnuradio_swig_py_filter_guile.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_filter_guile.Sd $(DEPDIR)/gnuradio_swig_py_filter_guile.Std; \ + fi; \ + else \ + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.S*; exit 1; \ + fi; + touch $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.d + cp $(DEPDIR)/gnuradio_swig_py_filter_guile.Std $(DEPDIR)/gnuradio_swig_py_filter_guile.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_filter_guile.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_filter_guile.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_filter_guile.d + $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.Std + touch $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp +else + touch $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp +endif + +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_filter_guile.d@am__quote@ + +#gnuradio_swig_py_runtime_python.h: gnuradio_swig_py_runtime.i + # -*- Makefile -*- # # Copyright 2009 Free Software Foundation, Inc. @@ -1242,6 +1390,16 @@ gnuradio_swig_py_io_pylibdir_category ?= $(gnuradio_swig_py_io_pythondir_categor gnuradio_swig_py_io_pythondir = $(pythondir)/$(gnuradio_swig_py_io_pythondir_category) gnuradio_swig_py_io_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_io_pylibdir_category) +# The .so libraries for the guile modules get installed whereever guile +# is installed, usually /usr/lib/guile/gnuradio/ +# FIXME: determince whether these should be installed with gnuradio. +gnuradio_swig_py_io_scmlibdir = @GUILE_PKLIBDIR@/gnuradio + +# The scm files for the guile modules get installed where ever guile +# is installed, usually /usr/share/guile/site/gnuradio_swig_py_io +# FIXME: determince whether these should be installed with gnuradio. +gnuradio_swig_py_io_scmdir = @GUILE_PKDATADIR@/gnuradio + ## SWIG headers are always installed into the same directory. gnuradio_swig_py_io_swigincludedir = $(swigincludedir) @@ -1277,6 +1435,9 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## be added manually by the including Makefile.am . swig_built_sources += gnuradio_swig_py_io.py gnuradio_swig_py_io_python.cc +if GUILE +swig_built_sources += gnuradio_swig_py_io.scm gnuradio_swig_py_io_guile.cc +endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -1310,11 +1471,11 @@ gnuradio_swig_py_io_python_PYTHON = \ $(gnuradio_swig_py_io_python) if GUILE -gnuradio_swig_py_io_pylib_LTLIBRARIES += _gnuradio_swig_py_io_guile.la - +gnuradio_swig_py_io_scmlib_LTLIBRARIES = _gnuradio_swig_py_io_guile.la _gnuradio_swig_py_io_guile_la_SOURCES = \ - gnuradio_swig_py_io_guile.cc \ + gnuradio_swig_py_io_guile.cc \ $(gnuradio_swig_py_io_la_swig_sources) +gnuradio_swig_py_io_scm_DATA = gnuradio_swig_py_io.scm # Guile can use the same flags as python does _gnuradio_swig_py_io_guile_la_LIBADD = $(_gnuradio_swig_py_io_python_la_LIBADD) @@ -1325,7 +1486,8 @@ endif # end of GUILE ## Entry rule for running SWIG -gnuradio_swig_py_io_python.h gnuradio_swig_py_io.py gnuradio_swig_py_io_python.cc gnuradio_swig_py_io_guile.cc gnuradio_swig_py_io_guile.h: gnuradio_swig_py_io.i +# $(python_deps) $(guile_deps): gnuradio_swig_py_io.i +gnuradio_swig_py_io_python.h gnuradio_swig_py_io.py gnuradio_swig_py_io_python.cc: gnuradio_swig_py_io.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -1382,7 +1544,6 @@ gnuradio_swig_py_io_python.h gnuradio_swig_py_io.py gnuradio_swig_py_io_python.c ## Tell MAKE to run the rule for creating this stamp. ## $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp WHAT=$<; \ - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp WHAT=$<; \ ## ## Now that the .cc, .h, and .py files have been (re)created from the ## .i file, future checking of this rule during the same MAKE @@ -1410,32 +1571,23 @@ gnuradio_swig_py_io_python.h gnuradio_swig_py_io.py gnuradio_swig_py_io_python.c exit $$?; \ fi; -$(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp: +# the comments for the target above apply to this target as well, but it seemed +# silly to include them twice. The only main change is for guile. +gnuradio_swig_py_io_guile.h gnuradio_swig_py_io.scm gnuradio_swig_py_io_guile.cc: gnuradio_swig_py_io.i if GUILE - if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_io_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_io_guile.Std \ - -module gnuradio_swig_py_io -o gnuradio_swig_py_io_guile.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_io_guile.Std \ - > $(DEPDIR)/gnuradio_swig_py_io_guile.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_io_guile.Sd $(DEPDIR)/gnuradio_swig_py_io_guile.Std; \ - fi; \ + trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_io-generate-*' 1 2 13 15; \ + if mkdir $(DEPDIR)/gnuradio_swig_py_io-generate-lock 2>/dev/null; then \ + rm -f $(DEPDIR)/gnuradio_swig_py_io-generate-*stamp; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp WHAT=$<; \ + rmdir $(DEPDIR)/gnuradio_swig_py_io-generate-lock; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.S*; exit 1; \ + while test -d $(DEPDIR)/gnuradio_swig_py_io-generate-lock; do \ + sleep 1; \ + done; \ + test -f $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp; \ + exit $$?; \ fi; - touch $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp - $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.d - cp $(DEPDIR)/gnuradio_swig_py_io_guile.Std $(DEPDIR)/gnuradio_swig_py_io_guile.d - echo "" >> $(DEPDIR)/gnuradio_swig_py_io_guile.d - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_io_guile.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_io_guile.d - $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.Std - touch $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_io_guile.d@am__quote@ -endif +endif # end of GUILE $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp: ## This rule will be called only by the first process issuing the @@ -1503,6 +1655,39 @@ $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp: @am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_io_python.d@am__quote@ +if GUILE +$(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp: +# the comments for the target above apply to this target as well, but it seemed +# silly to include them twice. The only main change is for guile. + if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_io_swig_args) \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_io_guile.Std \ + -module gnuradio_swig_py_io -o gnuradio_swig_py_io_guile.cc $(WHAT); then \ + if test $(host_os) = mingw32; then \ + $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_io_guile.Std \ + > $(DEPDIR)/gnuradio_swig_py_io_guile.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_io_guile.Sd $(DEPDIR)/gnuradio_swig_py_io_guile.Std; \ + fi; \ + else \ + $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.S*; exit 1; \ + fi; + touch $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp + $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.d + cp $(DEPDIR)/gnuradio_swig_py_io_guile.Std $(DEPDIR)/gnuradio_swig_py_io_guile.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_io_guile.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_io_guile.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_io_guile.d + $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.Std + touch $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp +else + touch $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp +endif + +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_io_guile.d@am__quote@ + +#gnuradio_swig_py_runtime_python.h: gnuradio_swig_py_runtime.i + # -*- Makefile -*- # # Copyright 2009 Free Software Foundation, Inc. @@ -1543,6 +1728,16 @@ gnuradio_swig_py_hier_pylibdir_category ?= $(gnuradio_swig_py_hier_pythondir_cat gnuradio_swig_py_hier_pythondir = $(pythondir)/$(gnuradio_swig_py_hier_pythondir_category) gnuradio_swig_py_hier_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_hier_pylibdir_category) +# The .so libraries for the guile modules get installed whereever guile +# is installed, usually /usr/lib/guile/gnuradio/ +# FIXME: determince whether these should be installed with gnuradio. +gnuradio_swig_py_hier_scmlibdir = @GUILE_PKLIBDIR@/gnuradio + +# The scm files for the guile modules get installed where ever guile +# is installed, usually /usr/share/guile/site/gnuradio_swig_py_hier +# FIXME: determince whether these should be installed with gnuradio. +gnuradio_swig_py_hier_scmdir = @GUILE_PKDATADIR@/gnuradio + ## SWIG headers are always installed into the same directory. gnuradio_swig_py_hier_swigincludedir = $(swigincludedir) @@ -1578,6 +1773,9 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## be added manually by the including Makefile.am . swig_built_sources += gnuradio_swig_py_hier.py gnuradio_swig_py_hier_python.cc +if GUILE +swig_built_sources += gnuradio_swig_py_hier.scm gnuradio_swig_py_hier_guile.cc +endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -1611,11 +1809,11 @@ gnuradio_swig_py_hier_python_PYTHON = \ $(gnuradio_swig_py_hier_python) if GUILE -gnuradio_swig_py_hier_pylib_LTLIBRARIES += _gnuradio_swig_py_hier_guile.la - +gnuradio_swig_py_hier_scmlib_LTLIBRARIES = _gnuradio_swig_py_hier_guile.la _gnuradio_swig_py_hier_guile_la_SOURCES = \ - gnuradio_swig_py_hier_guile.cc \ + gnuradio_swig_py_hier_guile.cc \ $(gnuradio_swig_py_hier_la_swig_sources) +gnuradio_swig_py_hier_scm_DATA = gnuradio_swig_py_hier.scm # Guile can use the same flags as python does _gnuradio_swig_py_hier_guile_la_LIBADD = $(_gnuradio_swig_py_hier_python_la_LIBADD) @@ -1626,7 +1824,8 @@ endif # end of GUILE ## Entry rule for running SWIG -gnuradio_swig_py_hier_python.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier_python.cc gnuradio_swig_py_hier_guile.cc gnuradio_swig_py_hier_guile.h: gnuradio_swig_py_hier.i +# $(python_deps) $(guile_deps): gnuradio_swig_py_hier.i +gnuradio_swig_py_hier_python.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier_python.cc: gnuradio_swig_py_hier.i ## This rule will get called only when MAKE decides that one of the ## targets needs to be created or re-created, because: ## @@ -1683,7 +1882,6 @@ gnuradio_swig_py_hier_python.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier_py ## Tell MAKE to run the rule for creating this stamp. ## $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp WHAT=$<; \ - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp WHAT=$<; \ ## ## Now that the .cc, .h, and .py files have been (re)created from the ## .i file, future checking of this rule during the same MAKE @@ -1711,32 +1909,23 @@ gnuradio_swig_py_hier_python.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier_py exit $$?; \ fi; -$(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp: +# the comments for the target above apply to this target as well, but it seemed +# silly to include them twice. The only main change is for guile. +gnuradio_swig_py_hier_guile.h gnuradio_swig_py_hier.scm gnuradio_swig_py_hier_guile.cc: gnuradio_swig_py_hier.i if GUILE - if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_hier_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_hier_guile.Std \ - -module gnuradio_swig_py_hier -o gnuradio_swig_py_hier_guile.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_hier_guile.Std \ - > $(DEPDIR)/gnuradio_swig_py_hier_guile.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_hier_guile.Sd $(DEPDIR)/gnuradio_swig_py_hier_guile.Std; \ - fi; \ + trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_hier-generate-*' 1 2 13 15; \ + if mkdir $(DEPDIR)/gnuradio_swig_py_hier-generate-lock 2>/dev/null; then \ + rm -f $(DEPDIR)/gnuradio_swig_py_hier-generate-*stamp; \ + $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp WHAT=$<; \ + rmdir $(DEPDIR)/gnuradio_swig_py_hier-generate-lock; \ else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.S*; exit 1; \ + while test -d $(DEPDIR)/gnuradio_swig_py_hier-generate-lock; do \ + sleep 1; \ + done; \ + test -f $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp; \ + exit $$?; \ fi; - touch $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.d - cp $(DEPDIR)/gnuradio_swig_py_hier_guile.Std $(DEPDIR)/gnuradio_swig_py_hier_guile.d - echo "" >> $(DEPDIR)/gnuradio_swig_py_hier_guile.d - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_hier_guile.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_hier_guile.d - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.Std - touch $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_hier_guile.d@am__quote@ -endif +endif # end of GUILE $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp: ## This rule will be called only by the first process issuing the @@ -1804,3 +1993,36 @@ $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp: @am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_hier_python.d@am__quote@ +if GUILE +$(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp: +# the comments for the target above apply to this target as well, but it seemed +# silly to include them twice. The only main change is for guile. + if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_hier_swig_args) \ + -MD -MF $(DEPDIR)/gnuradio_swig_py_hier_guile.Std \ + -module gnuradio_swig_py_hier -o gnuradio_swig_py_hier_guile.cc $(WHAT); then \ + if test $(host_os) = mingw32; then \ + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.Sd; \ + $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_hier_guile.Std \ + > $(DEPDIR)/gnuradio_swig_py_hier_guile.Sd; \ + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.Std; \ + $(MV) $(DEPDIR)/gnuradio_swig_py_hier_guile.Sd $(DEPDIR)/gnuradio_swig_py_hier_guile.Std; \ + fi; \ + else \ + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.S*; exit 1; \ + fi; + touch $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.d + cp $(DEPDIR)/gnuradio_swig_py_hier_guile.Std $(DEPDIR)/gnuradio_swig_py_hier_guile.d + echo "" >> $(DEPDIR)/gnuradio_swig_py_hier_guile.d + $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_hier_guile.Std | \ + awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_hier_guile.d + $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.Std + touch $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp +else + touch $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp +endif + +@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_hier_guile.d@am__quote@ + +#gnuradio_swig_py_runtime_python.h: gnuradio_swig_py_runtime.i + -- cgit From d3d187f1beb6525977079a6f9c822f971cced8da Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 18 Oct 2010 18:21:09 -0600 Subject: improve comment --- gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm b/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm index 687f7f1f5..c653a04b0 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm @@ -18,8 +18,8 @@ ;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ;;; -;; Only use these if load-* fails t find a .scm or .so. If you can't -;; find a .so. try running ldconfig. guile seems to only load modules +;; Only use these if load-* fails to find a .scm or .so. If you can't +;; find a .so, try running ldconfig. guile seems to only load modules ;; that are in the ldconfig paths. ;; (set! %load-path (append %load-path '("/usr/lib/guile/gnuradio"))) ;; (set! %load-path (append %load-path '("/usr/share/gnuradio"))) @@ -28,7 +28,7 @@ (load "gnuradio/gnuradio_swig_py_io.scm") (load "gnuradio/gnuradio_swig_py_runtime.scm") -;; FIXME: these don't load for sme reason +;; FIXME: these don't load for sme reason cause of issues with the .so files ;; (load "gnuradio/gnuradio_swig_py_general.scm") ;; (load "gnuradio/gnuradio_swig_py_gengen.scm") ;; (load "gnuradio/gnuradio_swig_py_heir.scm") -- cgit From bb04443e9299a2eebf44a6aef5633091b0135f1f Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 18 Oct 2010 18:43:33 -0600 Subject: correct copyright date --- gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm b/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm index c653a04b0..64f6f1415 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm @@ -1,5 +1,5 @@ ;;; -;;; Copyright 2006,2009 Free Software Foundation, Inc. +;;; Copyright 2010 Free Software Foundation, Inc. ;;; ;;; This file is part of GNU Radio ;;; -- cgit From f64af4b3b4221bbe9480791b3e863aa05c6aad06 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Mon, 18 Oct 2010 19:28:25 -0700 Subject: gitignore swig generated files --- gnuradio-core/src/lib/swig/.gitignore | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/.gitignore b/gnuradio-core/src/lib/swig/.gitignore index 9d7d01056..0f7b58d51 100644 --- a/gnuradio-core/src/lib/swig/.gitignore +++ b/gnuradio-core/src/lib/swig/.gitignore @@ -34,3 +34,15 @@ /gnuradio_swig_py_hier.cc /gnuradio_swig_py_hier.h /gnuradio_swig_py_hier.py +/gnuradio_swig_py_filter_python.cc +/gnuradio_swig_py_filter_python.h +/gnuradio_swig_py_general_python.cc +/gnuradio_swig_py_general_python.h +/gnuradio_swig_py_gengen_python.cc +/gnuradio_swig_py_gengen_python.h +/gnuradio_swig_py_hier_python.cc +/gnuradio_swig_py_hier_python.h +/gnuradio_swig_py_io_python.cc +/gnuradio_swig_py_io_python.h +/gnuradio_swig_py_runtime_python.cc +/gnuradio_swig_py_runtime_python.h -- cgit From 3e5e68383e0b1283ad1a40216ef11e777c245824 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Mon, 18 Oct 2010 19:56:02 -0700 Subject: gitignore more swig generated files --- gnuradio-core/src/lib/swig/.gitignore | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/.gitignore b/gnuradio-core/src/lib/swig/.gitignore index 0f7b58d51..5c514650d 100644 --- a/gnuradio-core/src/lib/swig/.gitignore +++ b/gnuradio-core/src/lib/swig/.gitignore @@ -46,3 +46,15 @@ /gnuradio_swig_py_io_python.h /gnuradio_swig_py_runtime_python.cc /gnuradio_swig_py_runtime_python.h +/gnuradio_swig_py_filter.scm +/gnuradio_swig_py_filter_guile.cc +/gnuradio_swig_py_general.scm +/gnuradio_swig_py_general_guile.cc +/gnuradio_swig_py_gengen.scm +/gnuradio_swig_py_gengen_guile.cc +/gnuradio_swig_py_hier.scm +/gnuradio_swig_py_hier_guile.cc +/gnuradio_swig_py_io.scm +/gnuradio_swig_py_io_guile.cc +/gnuradio_swig_py_runtime.scm +/gnuradio_swig_py_runtime_guile.cc -- cgit From 3d55841ec05f1a09eb2de304f9ad30b9ed068986 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Mon, 18 Oct 2010 20:14:26 -0700 Subject: Make fft window parameter a const vector ref to ease swigging. --- gnuradio-core/src/lib/general/gr_fft_vcc.i | 4 ++-- gnuradio-core/src/lib/general/gr_fft_vfc.cc | 6 +++--- gnuradio-core/src/lib/general/gr_fft_vfc.h | 10 +++++----- gnuradio-core/src/lib/general/gr_fft_vfc.i | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/general/gr_fft_vcc.i b/gnuradio-core/src/lib/general/gr_fft_vcc.i index 247571374..f35316e70 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vcc.i +++ b/gnuradio-core/src/lib/general/gr_fft_vcc.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2007,2008 Free Software Foundation, Inc. + * Copyright 2004,2007,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,7 +23,7 @@ GR_SWIG_BLOCK_MAGIC(gr, fft_vcc) gr_fft_vcc_sptr -gr_make_fft_vcc (int fft_size, bool forward, const std::vector window, bool shift=false); +gr_make_fft_vcc (int fft_size, bool forward, const std::vector &window, bool shift=false); class gr_fft_vcc : public gr_sync_block { diff --git a/gnuradio-core/src/lib/general/gr_fft_vfc.cc b/gnuradio-core/src/lib/general/gr_fft_vfc.cc index 608161efe..561c63740 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vfc.cc +++ b/gnuradio-core/src/lib/general/gr_fft_vfc.cc @@ -40,12 +40,12 @@ gr_fft_vfc_sptr -gr_make_fft_vfc (int fft_size, bool forward, const std::vector window) +gr_make_fft_vfc (int fft_size, bool forward, const std::vector &window) { return gnuradio::get_initial_sptr(new gr_fft_vfc (fft_size, forward, window)); } -gr_fft_vfc::gr_fft_vfc (int fft_size, bool forward, const std::vector window) +gr_fft_vfc::gr_fft_vfc (int fft_size, bool forward, const std::vector &window) : gr_sync_block ("fft_vfc", gr_make_io_signature (1, 1, fft_size * sizeof (float)), gr_make_io_signature (1, 1, fft_size * sizeof (gr_complex))), @@ -107,7 +107,7 @@ gr_fft_vfc::work (int noutput_items, } bool -gr_fft_vfc::set_window(const std::vector window) +gr_fft_vfc::set_window(const std::vector &window) { if(window.size()==0 || window.size()==d_fft_size) { d_window=window; diff --git a/gnuradio-core/src/lib/general/gr_fft_vfc.h b/gnuradio-core/src/lib/general/gr_fft_vfc.h index 054a383ef..074574477 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vfc.h +++ b/gnuradio-core/src/lib/general/gr_fft_vfc.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -31,7 +31,7 @@ class gr_fft_vfc; typedef boost::shared_ptr gr_fft_vfc_sptr; gr_fft_vfc_sptr -gr_make_fft_vfc (int fft_size, bool forward, const std::vector); +gr_make_fft_vfc (int fft_size, bool forward, const std::vector &window); /*! * \brief Compute forward FFT. float vector in / complex vector out. @@ -41,13 +41,13 @@ gr_make_fft_vfc (int fft_size, bool forward, const std::vector); class gr_fft_vfc : public gr_sync_block { friend gr_fft_vfc_sptr - gr_make_fft_vfc (int fft_size, bool forward, const std::vector window); + gr_make_fft_vfc (int fft_size, bool forward, const std::vector &window); unsigned int d_fft_size; std::vector d_window; gri_fft_complex *d_fft; - gr_fft_vfc (int fft_size, bool forward, const std::vector window); + gr_fft_vfc (int fft_size, bool forward, const std::vector &window); public: ~gr_fft_vfc (); @@ -55,7 +55,7 @@ class gr_fft_vfc : public gr_sync_block int work (int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); - bool set_window(const std::vector window); + bool set_window(const std::vector &window); }; diff --git a/gnuradio-core/src/lib/general/gr_fft_vfc.i b/gnuradio-core/src/lib/general/gr_fft_vfc.i index 90c368fe6..f680c4022 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vfc.i +++ b/gnuradio-core/src/lib/general/gr_fft_vfc.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -23,13 +23,13 @@ GR_SWIG_BLOCK_MAGIC(gr, fft_vfc) gr_fft_vfc_sptr -gr_make_fft_vfc (int fft_size, bool forward, const std::vector window); +gr_make_fft_vfc (int fft_size, bool forward, const std::vector &window); class gr_fft_vfc : public gr_sync_block { protected: - gr_fft_vfc (int fft_size, bool forward, const std::vector window); + gr_fft_vfc (int fft_size, bool forward, const std::vector &window); public: - bool set_window(const std::vector window); + bool set_window(const std::vector &window); }; -- cgit From 221ad7b19e370fab816fbfb8fae3b947f77151fc Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 18 Oct 2010 21:58:28 -0600 Subject: put the ifdef in the right place --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index 091cdf82b..f847e7b28 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -303,8 +303,8 @@ $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp: @am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_runtime_python.d@am__quote@ -if GUILE $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp: +if GUILE # the comments for the target above apply to this target as well, but it seemed # silly to include them twice. The only main change is for guile. if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_runtime_swig_args) \ @@ -641,8 +641,8 @@ $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp: @am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_general_python.d@am__quote@ -if GUILE $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp: +if GUILE # the comments for the target above apply to this target as well, but it seemed # silly to include them twice. The only main change is for guile. if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_general_swig_args) \ @@ -979,8 +979,8 @@ $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp: @am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_gengen_python.d@am__quote@ -if GUILE $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp: +if GUILE # the comments for the target above apply to this target as well, but it seemed # silly to include them twice. The only main change is for guile. if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_gengen_swig_args) \ @@ -1317,8 +1317,8 @@ $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp: @am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_filter_python.d@am__quote@ -if GUILE $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp: +if GUILE # the comments for the target above apply to this target as well, but it seemed # silly to include them twice. The only main change is for guile. if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_filter_swig_args) \ @@ -1655,8 +1655,8 @@ $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp: @am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_io_python.d@am__quote@ -if GUILE $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp: +if GUILE # the comments for the target above apply to this target as well, but it seemed # silly to include them twice. The only main change is for guile. if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_io_swig_args) \ @@ -1993,8 +1993,8 @@ $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp: @am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_hier_python.d@am__quote@ -if GUILE $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp: +if GUILE # the comments for the target above apply to this target as well, but it seemed # silly to include them twice. The only main change is for guile. if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_hier_swig_args) \ -- cgit From 31661e655660a77c28cf14fcb5f648ea05505450 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Mon, 18 Oct 2010 20:58:22 -0700 Subject: Change const vector to const vector ref to ease swigging. --- gnuradio-core/src/lib/gengen/gr_add_const_vXX.cc.t | 4 ++-- gnuradio-core/src/lib/gengen/gr_add_const_vXX.h.t | 10 +++++----- gnuradio-core/src/lib/gengen/gr_add_const_vXX.i.t | 8 ++++---- gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.cc.t | 4 ++-- gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.h.t | 10 +++++----- gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.i.t | 8 ++++---- 6 files changed, 22 insertions(+), 22 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/gengen/gr_add_const_vXX.cc.t b/gnuradio-core/src/lib/gengen/gr_add_const_vXX.cc.t index 2a0a3ba3f..f49be062e 100755 --- a/gnuradio-core/src/lib/gengen/gr_add_const_vXX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_add_const_vXX.cc.t @@ -30,12 +30,12 @@ #include @SPTR_NAME@ -gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> k) +gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> &k) { return gnuradio::get_initial_sptr (new @NAME@ (k)); } -@NAME@::@NAME@ (const std::vector<@I_TYPE@> k) +@NAME@::@NAME@ (const std::vector<@I_TYPE@> &k) : gr_sync_block ("@BASE_NAME@", gr_make_io_signature (1, 1, sizeof(@I_TYPE@)*k.size()), gr_make_io_signature (1, 1, sizeof(@O_TYPE@)*k.size())) diff --git a/gnuradio-core/src/lib/gengen/gr_add_const_vXX.h.t b/gnuradio-core/src/lib/gengen/gr_add_const_vXX.h.t index 33b6fc396..574fc686c 100755 --- a/gnuradio-core/src/lib/gengen/gr_add_const_vXX.h.t +++ b/gnuradio-core/src/lib/gengen/gr_add_const_vXX.h.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ class @NAME@; typedef boost::shared_ptr<@NAME@> @SPTR_NAME@; -@SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> k); +@SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> &k); /*! * \brief output vector = input vector + constant vector @@ -38,14 +38,14 @@ typedef boost::shared_ptr<@NAME@> @SPTR_NAME@; */ class @NAME@ : public gr_sync_block { - friend @SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> k); + friend @SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> &k); std::vector<@I_TYPE@> d_k; // the constant - @NAME@ (const std::vector<@I_TYPE@> k); + @NAME@ (const std::vector<@I_TYPE@> &k); public: const std::vector<@I_TYPE@> k () const { return d_k; } - void set_k (const std::vector<@I_TYPE@> k) { d_k = k; } + void set_k (const std::vector<@I_TYPE@> &k) { d_k = k; } int work (int noutput_items, gr_vector_const_void_star &input_items, diff --git a/gnuradio-core/src/lib/gengen/gr_add_const_vXX.i.t b/gnuradio-core/src/lib/gengen/gr_add_const_vXX.i.t index a2e7dd70b..ad1643a7e 100755 --- a/gnuradio-core/src/lib/gengen/gr_add_const_vXX.i.t +++ b/gnuradio-core/src/lib/gengen/gr_add_const_vXX.i.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,14 +24,14 @@ GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@) -@SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> k); +@SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> &k); class @NAME@ : public gr_sync_block { private: - @NAME@ (const std::vector<@I_TYPE@> k); + @NAME@ (const std::vector<@I_TYPE@> &k); public: std::vector<@I_TYPE@> k () const { return d_k; } - void set_k (const std::vector<@I_TYPE@> k) { d_k = k; } + void set_k (const std::vector<@I_TYPE@> &k) { d_k = k; } }; diff --git a/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.cc.t b/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.cc.t index 8286453f1..5725c1c46 100755 --- a/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.cc.t +++ b/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.cc.t @@ -30,12 +30,12 @@ #include @SPTR_NAME@ -gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> k) +gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> &k) { return gnuradio::get_initial_sptr (new @NAME@ (k)); } -@NAME@::@NAME@ (const std::vector<@I_TYPE@> k) +@NAME@::@NAME@ (const std::vector<@I_TYPE@> &k) : gr_sync_block ("@BASE_NAME@", gr_make_io_signature (1, 1, sizeof(@I_TYPE@)*k.size()), gr_make_io_signature (1, 1, sizeof(@O_TYPE@)*k.size())) diff --git a/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.h.t b/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.h.t index 22334505a..81e781895 100755 --- a/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.h.t +++ b/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.h.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -30,7 +30,7 @@ class @NAME@; typedef boost::shared_ptr<@NAME@> @SPTR_NAME@; -@SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> k); +@SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> &k); /*! * \brief output vector = input vector * constant vector (element-wise) @@ -38,14 +38,14 @@ typedef boost::shared_ptr<@NAME@> @SPTR_NAME@; */ class @NAME@ : public gr_sync_block { - friend @SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> k); + friend @SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> &k); std::vector<@I_TYPE@> d_k; // the constant - @NAME@ (const std::vector<@I_TYPE@> k); + @NAME@ (const std::vector<@I_TYPE@> &k); public: const std::vector<@I_TYPE@> k () const { return d_k; } - void set_k (const std::vector<@I_TYPE@> k) { d_k = k; } + void set_k (const std::vector<@I_TYPE@> &k) { d_k = k; } int work (int noutput_items, gr_vector_const_void_star &input_items, diff --git a/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.i.t b/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.i.t index a2e7dd70b..ad1643a7e 100755 --- a/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.i.t +++ b/gnuradio-core/src/lib/gengen/gr_multiply_const_vXX.i.t @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004,2006 Free Software Foundation, Inc. + * Copyright 2004,2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -24,14 +24,14 @@ GR_SWIG_BLOCK_MAGIC(gr,@BASE_NAME@) -@SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> k); +@SPTR_NAME@ gr_make_@BASE_NAME@ (const std::vector<@I_TYPE@> &k); class @NAME@ : public gr_sync_block { private: - @NAME@ (const std::vector<@I_TYPE@> k); + @NAME@ (const std::vector<@I_TYPE@> &k); public: std::vector<@I_TYPE@> k () const { return d_k; } - void set_k (const std::vector<@I_TYPE@> k) { d_k = k; } + void set_k (const std::vector<@I_TYPE@> &k) { d_k = k; } }; -- cgit From 1812c93c7c282bd4b5ff7bd602f9f88d7f1dd97c Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 18 Oct 2010 22:30:05 -0600 Subject: load the general and gengen files, now that they compile. --- gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm b/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm index 64f6f1415..89c4a0e09 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm @@ -29,6 +29,6 @@ (load "gnuradio/gnuradio_swig_py_runtime.scm") ;; FIXME: these don't load for sme reason cause of issues with the .so files -;; (load "gnuradio/gnuradio_swig_py_general.scm") -;; (load "gnuradio/gnuradio_swig_py_gengen.scm") +(load "gnuradio/gnuradio_swig_py_general.scm") +(load "gnuradio/gnuradio_swig_py_gengen.scm") ;; (load "gnuradio/gnuradio_swig_py_heir.scm") -- cgit From 9cc65810f63623a7132656005495dfd3ebbc84ed Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Tue, 19 Oct 2010 10:56:04 -0600 Subject: correct which lines are under comment --- gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm b/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm index 89c4a0e09..d08840071 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm @@ -27,8 +27,8 @@ (load "gnuradio/gnuradio_swig_py_filter.scm") (load "gnuradio/gnuradio_swig_py_io.scm") (load "gnuradio/gnuradio_swig_py_runtime.scm") - -;; FIXME: these don't load for sme reason cause of issues with the .so files (load "gnuradio/gnuradio_swig_py_general.scm") (load "gnuradio/gnuradio_swig_py_gengen.scm") + +;; FIXME: this don't load for some reason cause of issues with the .so files ;; (load "gnuradio/gnuradio_swig_py_heir.scm") -- cgit From 05c1f489753af80453182243475110586eb0b242 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Tue, 19 Oct 2010 22:00:55 -0600 Subject: use suffixes to build scm and py files --- gnuradio-core/src/lib/swig/Makefile.am | 37 +++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 12 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 73ba23b84..5f55e63b5 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -22,7 +22,13 @@ include $(top_srcdir)/Makefile.common include $(top_srcdir)/Makefile.swig +# VPATH += python guile + BUILT_SOURCES = $(grinclude_HEADERS) $(swig_built_sources) +CLEANFILES = python/gnuradio* +if GUILE +CLEANFILES += guile/gnuradio* +endif if PYTHON AM_CPPFLAGS = -I$(srcdir) $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \ @@ -39,19 +45,19 @@ swiginclude_HEADERS = \ # special install for this top-level Python script which includes all # of the split Python libraries. ourpythondir = $(grpythondir)/gr -ourpython_PYTHON = gnuradio_swig_python.py +ourpython_PYTHON = gnuradio_swig.py # 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. guiledir = @GUILE_PKDATADIR@ -guile_DATA = gnuradio_swig_guile.scm +guile_DATA = gnuradio_swig.scm # ---------------------------------------------------------------- # FIXME As of swig 1.3.31, this still seems to be required... -gnuradio_swig_bug_workaround.h : gnuradio_swig_py_runtime_python.cc $(srcdir)/gen-swig-bug-fix - $(PYTHON) $(srcdir)/gen-swig-bug-fix gnuradio_swig_py_runtime_python.cc $@ +gnuradio_swig_bug_workaround.h : gnuradio_swig_py_runtime.py $(srcdir)/gen-swig-bug-fix + $(PYTHON) $(srcdir)/gen-swig-bug-fix python/gnuradio_swig_py_runtime.cc $@ # C/C++ headers get installed in ${prefix}/include/gnuradio grinclude_HEADERS = gnuradio_swig_bug_workaround.h @@ -94,23 +100,30 @@ gnuradio_swig_py_hier_la_swig_libadd = $(GNURADIO_CORE_LA) # include the SWIG-generated .h files in the BUILT SOURCES, since they # aren't by default when using Makefile.swig; order doesn't matter. -PYTHON_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(subst .i,_python.h,$(HFILE))) +PYTHON_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(subst .i,.py,$(HFILE))) +#BUILT_SOURCES += $(foreach HFILE,$(PYTHON_GEN), $(subst gnuradio,python/gnuradio,$(HFILE))) BUILT_SOURCES += $(PYTHON_GEN) - endif # end of if python if GUILE GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(subst .i,.scm,$(HFILE))) +# BUILT_SOURCES += $(foreach HFILE,$(GUILE_GEN), $(subst gnuradio,guile/gnuradio,$(HFILE))) BUILT_SOURCES += $(GUILE_GEN) endif # Do not distribute the output of SWIG no_dist_files = $(swig_built_sources) -#gnuradio_swig_py_runtime.scm: gnuradio_swig_py_runtime.i -# gnuradio_swig_py_runtime_python.cc: gnuradio_swig_py_runtime.i -# .cc..i: -# @echo "FIXME1: $(BUILT_SOURCES) $<" +# Compile a .i to what guile needs +.i.scm: + @test -d "guile" || $(mkinstalldirs) "guile" + $(SWIG) $(STD_SWIG_GUILE_ARGS) $($*_swig_args) \ + -module $* -o guile/$*.cc $< + +# Compile a .i file to what python needs +.i.py: + @test -d "python" || $(mkinstalldirs) "python" + $(SWIG) $(STD_SWIG_PYTHON_ARGS) $($*_swig_args) \ + -MD -MF python/$(DEPDIR)/$*.Std \ + -module $* -o python/$*.cc -oh python/$*.h $< -# .scm..i: -# @echo "FIXME2: $(BUILT_SOURCES) $<" -- cgit From 03418fed87089ce9ea3e354632d5f151a1b33ebd Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Tue, 19 Oct 2010 22:02:29 -0600 Subject: regenerated --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 1386 +++----------------------- 1 file changed, 114 insertions(+), 1272 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index f847e7b28..77127e462 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -82,9 +82,9 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime_python.cc +swig_built_sources += gnuradio_swig_py_runtime.py #gnuradio_swig_py_runtime.cc if GUILE -swig_built_sources += gnuradio_swig_py_runtime.scm gnuradio_swig_py_runtime_guile.cc +swig_built_sources += gnuradio_swig_py_runtime.scm #gnuradio_swig_py_runtime.cc endif ## Various SWIG variables. These can be overloaded in the including @@ -96,245 +96,52 @@ gnuradio_swig_py_runtime_swiginclude_HEADERS = \ $(gnuradio_swig_py_runtime_swiginclude_headers) gnuradio_swig_py_runtime_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_runtime_python.la + _gnuradio_swig_py_runtime.la -_gnuradio_swig_py_runtime_python_la_SOURCES = \ - gnuradio_swig_py_runtime_python.cc \ +_gnuradio_swig_py_runtime_la_SOURCES = \ + python/gnuradio_swig_py_runtime.cc \ $(gnuradio_swig_py_runtime_la_swig_sources) -_gnuradio_swig_py_runtime_python_la_LIBADD = \ +_gnuradio_swig_py_runtime_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_runtime_la_swig_libadd) -_gnuradio_swig_py_runtime_python_la_LDFLAGS = \ +_gnuradio_swig_py_runtime_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_runtime_la_swig_ldflags) -_gnuradio_swig_py_runtime_python_la_CXXFLAGS = \ +_gnuradio_swig_py_runtime_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ $(gnuradio_swig_py_runtime_la_swig_cxxflags) gnuradio_swig_py_runtime_python_PYTHON = \ - gnuradio_swig_py_runtime.py \ - $(gnuradio_swig_py_runtime_python) + python/gnuradio_swig_py_runtime.py \ + $(gnuradio_swig_py_runtime) if GUILE -gnuradio_swig_py_runtime_scmlib_LTLIBRARIES = _gnuradio_swig_py_runtime_guile.la -_gnuradio_swig_py_runtime_guile_la_SOURCES = \ - gnuradio_swig_py_runtime_guile.cc \ +gnuradio_swig_py_runtime_scmlib_LTLIBRARIES = gnuradio_swig_py_runtime_guile.la +gnuradio_swig_py_runtime_guile_la_SOURCES = \ + guile/gnuradio_swig_py_runtime.cc \ $(gnuradio_swig_py_runtime_la_swig_sources) gnuradio_swig_py_runtime_scm_DATA = gnuradio_swig_py_runtime.scm # Guile can use the same flags as python does -_gnuradio_swig_py_runtime_guile_la_LIBADD = $(_gnuradio_swig_py_runtime_python_la_LIBADD) -_gnuradio_swig_py_runtime_guile_la_LDFLAGS = $(_gnuradio_swig_py_runtime_python_la_LDFLAGS) -_gnuradio_swig_py_runtime_guile_la_CXXFLAGS = $(_gnuradio_swig_py_runtime_python_la_CXXFLAGS) +gnuradio_swig_py_runtime_guile_la_LIBADD = $(_gnuradio_swig_py_runtime_la_LIBADD) +gnuradio_swig_py_runtime_guile_la_LDFLAGS = $(_gnuradio_swig_py_runtime_la_LDFLAGS) +gnuradio_swig_py_runtime_guile_la_CXXFLAGS = $(_gnuradio_swig_py_runtime_la_CXXFLAGS) endif # end of GUILE ## Entry rule for running SWIG # $(python_deps) $(guile_deps): gnuradio_swig_py_runtime.i -gnuradio_swig_py_runtime_python.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime_python.cc: gnuradio_swig_py_runtime.i -## This rule will get called only when MAKE decides that one of the -## targets needs to be created or re-created, because: -## -## * The .i file is newer than any or all of the generated files; -## -## * Any or all of the .cc, .h, or .py files does not exist and is -## needed (in the case this file is not needed, the rule for it is -## ignored); or -## -## * Some SWIG-based dependecy of the .cc file isn't met and hence the -## .cc file needs be be regenerated. Explanation: Because MAKE -## knows how to handle dependencies for .cc files (regardless of -## their name or extension), then the .cc file is used as a target -## instead of the .i file -- but with the dependencies of the .i -## file. It is this last reason why the line: -## -## if test -f $@; then :; else -## -## cannot be used in this case: If a .i file dependecy is not met, -## then the .cc file needs to be rebuilt. But if the stamp is newer -## than the .cc file, and the .cc file exists, then in the original -## version (with the 'test' above) the internal MAKE call will not -## be issued and hence the .cc file will not be rebuilt. -## -## Once execution gets to here, it should always proceed no matter the -## state of a stamp (as discussed in link above). The -## $(DEPDIR)/gnuradio_swig_py_runtime-generate stuff is used to allow for parallel -## builds to "do the right thing". The stamp has no relationship with -## either the target files or dependency file; it is used solely for -## the protection of multiple builds during a given call to MAKE. -## -## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM -## (15). At a caught signal, the quoted command will be issued before -## exiting. In this case, remove any stamp, whether temporary of not. -## The trap is valid until the process exits; the process includes all -## commands appended via "\"s. -## - trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_runtime-generate-*' 1 2 13 15; \ -## -## Create a temporary directory, which acts as a lock. The first -## process to create the directory will succeed and issue the MAKE -## command to do the actual work, while all subsequent processes will -## fail -- leading them to wait for the first process to finish. -## - if mkdir $(DEPDIR)/gnuradio_swig_py_runtime-generate-lock 2>/dev/null; then \ -## -## This code is being executed by the first process to succeed in -## creating the directory lock. -## -## Remove the stamp associated with this filename. -## - rm -f $(DEPDIR)/gnuradio_swig_py_runtime-generate-*stamp; \ -## -## Tell MAKE to run the rule for creating this stamp. -## - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp WHAT=$<; \ -## -## Now that the .cc, .h, and .py files have been (re)created from the -## .i file, future checking of this rule during the same MAKE -## execution will come back that the rule doesn't need to be executed -## because none of the conditions mentioned at the start of this rule -## will be positive. Remove the the directory lock, which frees up -## any waiting process(es) to continue. -## - rmdir $(DEPDIR)/gnuradio_swig_py_runtime-generate-lock; \ - else \ -## -## This code is being executed by any follower processes while the -## directory lock is in place. -## -## Wait until the first process is done, testing once per second. -## - while test -d $(DEPDIR)/gnuradio_swig_py_runtime-generate-lock; do \ - sleep 1; \ - done; \ -## -## Succeed if and only if the first process succeeded; exit this -## process returning the status of the generated stamp. -## - test -f $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp; \ - exit $$?; \ - fi; - -# the comments for the target above apply to this target as well, but it seemed -# silly to include them twice. The only main change is for guile. -gnuradio_swig_py_runtime_guile.h gnuradio_swig_py_runtime.scm gnuradio_swig_py_runtime_guile.cc: gnuradio_swig_py_runtime.i -if GUILE - trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_runtime-generate-*' 1 2 13 15; \ - if mkdir $(DEPDIR)/gnuradio_swig_py_runtime-generate-lock 2>/dev/null; then \ - rm -f $(DEPDIR)/gnuradio_swig_py_runtime-generate-*stamp; \ - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp WHAT=$<; \ - rmdir $(DEPDIR)/gnuradio_swig_py_runtime-generate-lock; \ - else \ - while test -d $(DEPDIR)/gnuradio_swig_py_runtime-generate-lock; do \ - sleep 1; \ - done; \ - test -f $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp; \ - exit $$?; \ - fi; -endif # end of GUILE +# gnuradio_swig_py_runtime.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime.cc: gnuradio_swig_py_runtime.i +guile/gnuradio_swig_py_runtime.scm gnuradio_swig_py_runtime.scm: gnuradio_swig_py_runtime.i +python/gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime.py: gnuradio_swig_py_runtime.i $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp: -## This rule will be called only by the first process issuing the -## above rule to succeed in creating the lock directory, after -## removing the actual stamp file in order to guarantee that MAKE will -## execute this rule. -## -## Call SWIG to generate the various output files; special -## post-processing on 'mingw32' host OS for the dependency file. -## - if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_runtime_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_runtime_python.Std \ - -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime_python.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_python.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_runtime_python.Std \ - > $(DEPDIR)/gnuradio_swig_py_runtime_python.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_python.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_runtime_python.Sd $(DEPDIR)/gnuradio_swig_py_runtime_python.Std; \ - fi; \ - else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_python.S*; exit 1; \ - fi; -## -## Mess with the SWIG output .Std dependency file, to create a -## dependecy file valid for the input .i file: Basically, simulate the -## dependency file created for libraries by GNU's libtool for C++, -## where all of the dependencies for the target are first listed, then -## each individual dependency is listed as a target with no further -## dependencies. -## -## (1) remove the current dependency file -## - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_python.d -## -## (2) Copy the whole SWIG file: -## - cp $(DEPDIR)/gnuradio_swig_py_runtime_python.Std $(DEPDIR)/gnuradio_swig_py_runtime_python.d -## -## (3) all a carriage return to the end of the dependency file. -## - echo "" >> $(DEPDIR)/gnuradio_swig_py_runtime_python.d -## -## (4) from the SWIG file, remove the first line (the target); remove -## trailing " \" and " " from each line. Append ":" to each line, -## followed by 2 carriage returns, then append this to the end of -## the dependency file. -## - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_runtime_python.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_runtime_python.d -## -## (5) remove the SWIG-generated file -## - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_python.Std -## -## Create the stamp for this filename generation, to signal success in -## executing this rule; allows other threads waiting on this process -## to continue. -## - touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp - -# KLUDGE: Force runtime include of a SWIG dependency file. This is -# not guaranteed to be portable, but will probably work. If it works, -# we have accurate dependencies for our swig stuff, which is good. - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_runtime_python.d@am__quote@ $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp: -if GUILE -# the comments for the target above apply to this target as well, but it seemed -# silly to include them twice. The only main change is for guile. - if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_runtime_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std \ - -module gnuradio_swig_py_runtime -o gnuradio_swig_py_runtime_guile.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std \ - > $(DEPDIR)/gnuradio_swig_py_runtime_guile.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Sd $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std; \ - fi; \ - else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.S*; exit 1; \ - fi; - touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.d - cp $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std $(DEPDIR)/gnuradio_swig_py_runtime_guile.d - echo "" >> $(DEPDIR)/gnuradio_swig_py_runtime_guile.d - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_runtime_guile.d - $(RM) $(DEPDIR)/gnuradio_swig_py_runtime_guile.Std - touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp -else - touch $(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp -endif - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_runtime_guile.d@am__quote@ - -#gnuradio_swig_py_runtime_python.h: gnuradio_swig_py_runtime.i # -*- Makefile -*- # @@ -420,9 +227,9 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_general.py gnuradio_swig_py_general_python.cc +swig_built_sources += gnuradio_swig_py_general.py #gnuradio_swig_py_general.cc if GUILE -swig_built_sources += gnuradio_swig_py_general.scm gnuradio_swig_py_general_guile.cc +swig_built_sources += gnuradio_swig_py_general.scm #gnuradio_swig_py_general.cc endif ## Various SWIG variables. These can be overloaded in the including @@ -434,245 +241,52 @@ gnuradio_swig_py_general_swiginclude_HEADERS = \ $(gnuradio_swig_py_general_swiginclude_headers) gnuradio_swig_py_general_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_general_python.la + _gnuradio_swig_py_general.la -_gnuradio_swig_py_general_python_la_SOURCES = \ - gnuradio_swig_py_general_python.cc \ +_gnuradio_swig_py_general_la_SOURCES = \ + python/gnuradio_swig_py_general.cc \ $(gnuradio_swig_py_general_la_swig_sources) -_gnuradio_swig_py_general_python_la_LIBADD = \ +_gnuradio_swig_py_general_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_general_la_swig_libadd) -_gnuradio_swig_py_general_python_la_LDFLAGS = \ +_gnuradio_swig_py_general_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_general_la_swig_ldflags) -_gnuradio_swig_py_general_python_la_CXXFLAGS = \ +_gnuradio_swig_py_general_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ $(gnuradio_swig_py_general_la_swig_cxxflags) gnuradio_swig_py_general_python_PYTHON = \ - gnuradio_swig_py_general.py \ - $(gnuradio_swig_py_general_python) + python/gnuradio_swig_py_general.py \ + $(gnuradio_swig_py_general) if GUILE -gnuradio_swig_py_general_scmlib_LTLIBRARIES = _gnuradio_swig_py_general_guile.la -_gnuradio_swig_py_general_guile_la_SOURCES = \ - gnuradio_swig_py_general_guile.cc \ +gnuradio_swig_py_general_scmlib_LTLIBRARIES = gnuradio_swig_py_general_guile.la +gnuradio_swig_py_general_guile_la_SOURCES = \ + guile/gnuradio_swig_py_general.cc \ $(gnuradio_swig_py_general_la_swig_sources) gnuradio_swig_py_general_scm_DATA = gnuradio_swig_py_general.scm # Guile can use the same flags as python does -_gnuradio_swig_py_general_guile_la_LIBADD = $(_gnuradio_swig_py_general_python_la_LIBADD) -_gnuradio_swig_py_general_guile_la_LDFLAGS = $(_gnuradio_swig_py_general_python_la_LDFLAGS) -_gnuradio_swig_py_general_guile_la_CXXFLAGS = $(_gnuradio_swig_py_general_python_la_CXXFLAGS) +gnuradio_swig_py_general_guile_la_LIBADD = $(_gnuradio_swig_py_general_la_LIBADD) +gnuradio_swig_py_general_guile_la_LDFLAGS = $(_gnuradio_swig_py_general_la_LDFLAGS) +gnuradio_swig_py_general_guile_la_CXXFLAGS = $(_gnuradio_swig_py_general_la_CXXFLAGS) endif # end of GUILE ## Entry rule for running SWIG # $(python_deps) $(guile_deps): gnuradio_swig_py_general.i -gnuradio_swig_py_general_python.h gnuradio_swig_py_general.py gnuradio_swig_py_general_python.cc: gnuradio_swig_py_general.i -## This rule will get called only when MAKE decides that one of the -## targets needs to be created or re-created, because: -## -## * The .i file is newer than any or all of the generated files; -## -## * Any or all of the .cc, .h, or .py files does not exist and is -## needed (in the case this file is not needed, the rule for it is -## ignored); or -## -## * Some SWIG-based dependecy of the .cc file isn't met and hence the -## .cc file needs be be regenerated. Explanation: Because MAKE -## knows how to handle dependencies for .cc files (regardless of -## their name or extension), then the .cc file is used as a target -## instead of the .i file -- but with the dependencies of the .i -## file. It is this last reason why the line: -## -## if test -f $@; then :; else -## -## cannot be used in this case: If a .i file dependecy is not met, -## then the .cc file needs to be rebuilt. But if the stamp is newer -## than the .cc file, and the .cc file exists, then in the original -## version (with the 'test' above) the internal MAKE call will not -## be issued and hence the .cc file will not be rebuilt. -## -## Once execution gets to here, it should always proceed no matter the -## state of a stamp (as discussed in link above). The -## $(DEPDIR)/gnuradio_swig_py_general-generate stuff is used to allow for parallel -## builds to "do the right thing". The stamp has no relationship with -## either the target files or dependency file; it is used solely for -## the protection of multiple builds during a given call to MAKE. -## -## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM -## (15). At a caught signal, the quoted command will be issued before -## exiting. In this case, remove any stamp, whether temporary of not. -## The trap is valid until the process exits; the process includes all -## commands appended via "\"s. -## - trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_general-generate-*' 1 2 13 15; \ -## -## Create a temporary directory, which acts as a lock. The first -## process to create the directory will succeed and issue the MAKE -## command to do the actual work, while all subsequent processes will -## fail -- leading them to wait for the first process to finish. -## - if mkdir $(DEPDIR)/gnuradio_swig_py_general-generate-lock 2>/dev/null; then \ -## -## This code is being executed by the first process to succeed in -## creating the directory lock. -## -## Remove the stamp associated with this filename. -## - rm -f $(DEPDIR)/gnuradio_swig_py_general-generate-*stamp; \ -## -## Tell MAKE to run the rule for creating this stamp. -## - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp WHAT=$<; \ -## -## Now that the .cc, .h, and .py files have been (re)created from the -## .i file, future checking of this rule during the same MAKE -## execution will come back that the rule doesn't need to be executed -## because none of the conditions mentioned at the start of this rule -## will be positive. Remove the the directory lock, which frees up -## any waiting process(es) to continue. -## - rmdir $(DEPDIR)/gnuradio_swig_py_general-generate-lock; \ - else \ -## -## This code is being executed by any follower processes while the -## directory lock is in place. -## -## Wait until the first process is done, testing once per second. -## - while test -d $(DEPDIR)/gnuradio_swig_py_general-generate-lock; do \ - sleep 1; \ - done; \ -## -## Succeed if and only if the first process succeeded; exit this -## process returning the status of the generated stamp. -## - test -f $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp; \ - exit $$?; \ - fi; - -# the comments for the target above apply to this target as well, but it seemed -# silly to include them twice. The only main change is for guile. -gnuradio_swig_py_general_guile.h gnuradio_swig_py_general.scm gnuradio_swig_py_general_guile.cc: gnuradio_swig_py_general.i -if GUILE - trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_general-generate-*' 1 2 13 15; \ - if mkdir $(DEPDIR)/gnuradio_swig_py_general-generate-lock 2>/dev/null; then \ - rm -f $(DEPDIR)/gnuradio_swig_py_general-generate-*stamp; \ - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp WHAT=$<; \ - rmdir $(DEPDIR)/gnuradio_swig_py_general-generate-lock; \ - else \ - while test -d $(DEPDIR)/gnuradio_swig_py_general-generate-lock; do \ - sleep 1; \ - done; \ - test -f $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp; \ - exit $$?; \ - fi; -endif # end of GUILE +# gnuradio_swig_py_general.h gnuradio_swig_py_general.py gnuradio_swig_py_general.cc: gnuradio_swig_py_general.i +guile/gnuradio_swig_py_general.scm gnuradio_swig_py_general.scm: gnuradio_swig_py_general.i +python/gnuradio_swig_py_general.py gnuradio_swig_py_general.py: gnuradio_swig_py_general.i $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp: -## This rule will be called only by the first process issuing the -## above rule to succeed in creating the lock directory, after -## removing the actual stamp file in order to guarantee that MAKE will -## execute this rule. -## -## Call SWIG to generate the various output files; special -## post-processing on 'mingw32' host OS for the dependency file. -## - if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_general_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_general_python.Std \ - -module gnuradio_swig_py_general -o gnuradio_swig_py_general_python.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general_python.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_general_python.Std \ - > $(DEPDIR)/gnuradio_swig_py_general_python.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general_python.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_general_python.Sd $(DEPDIR)/gnuradio_swig_py_general_python.Std; \ - fi; \ - else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general_python.S*; exit 1; \ - fi; -## -## Mess with the SWIG output .Std dependency file, to create a -## dependecy file valid for the input .i file: Basically, simulate the -## dependency file created for libraries by GNU's libtool for C++, -## where all of the dependencies for the target are first listed, then -## each individual dependency is listed as a target with no further -## dependencies. -## -## (1) remove the current dependency file -## - $(RM) $(DEPDIR)/gnuradio_swig_py_general_python.d -## -## (2) Copy the whole SWIG file: -## - cp $(DEPDIR)/gnuradio_swig_py_general_python.Std $(DEPDIR)/gnuradio_swig_py_general_python.d -## -## (3) all a carriage return to the end of the dependency file. -## - echo "" >> $(DEPDIR)/gnuradio_swig_py_general_python.d -## -## (4) from the SWIG file, remove the first line (the target); remove -## trailing " \" and " " from each line. Append ":" to each line, -## followed by 2 carriage returns, then append this to the end of -## the dependency file. -## - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_general_python.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_general_python.d -## -## (5) remove the SWIG-generated file -## - $(RM) $(DEPDIR)/gnuradio_swig_py_general_python.Std -## -## Create the stamp for this filename generation, to signal success in -## executing this rule; allows other threads waiting on this process -## to continue. -## - touch $(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp - -# KLUDGE: Force runtime include of a SWIG dependency file. This is -# not guaranteed to be portable, but will probably work. If it works, -# we have accurate dependencies for our swig stuff, which is good. - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_general_python.d@am__quote@ $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp: -if GUILE -# the comments for the target above apply to this target as well, but it seemed -# silly to include them twice. The only main change is for guile. - if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_general_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_general_guile.Std \ - -module gnuradio_swig_py_general -o gnuradio_swig_py_general_guile.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_general_guile.Std \ - > $(DEPDIR)/gnuradio_swig_py_general_guile.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_general_guile.Sd $(DEPDIR)/gnuradio_swig_py_general_guile.Std; \ - fi; \ - else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.S*; exit 1; \ - fi; - touch $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp - $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.d - cp $(DEPDIR)/gnuradio_swig_py_general_guile.Std $(DEPDIR)/gnuradio_swig_py_general_guile.d - echo "" >> $(DEPDIR)/gnuradio_swig_py_general_guile.d - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_general_guile.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_general_guile.d - $(RM) $(DEPDIR)/gnuradio_swig_py_general_guile.Std - touch $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp -else - touch $(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp -endif - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_general_guile.d@am__quote@ - -#gnuradio_swig_py_runtime_python.h: gnuradio_swig_py_runtime.i # -*- Makefile -*- # @@ -758,9 +372,9 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen_python.cc +swig_built_sources += gnuradio_swig_py_gengen.py #gnuradio_swig_py_gengen.cc if GUILE -swig_built_sources += gnuradio_swig_py_gengen.scm gnuradio_swig_py_gengen_guile.cc +swig_built_sources += gnuradio_swig_py_gengen.scm #gnuradio_swig_py_gengen.cc endif ## Various SWIG variables. These can be overloaded in the including @@ -772,245 +386,52 @@ gnuradio_swig_py_gengen_swiginclude_HEADERS = \ $(gnuradio_swig_py_gengen_swiginclude_headers) gnuradio_swig_py_gengen_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_gengen_python.la + _gnuradio_swig_py_gengen.la -_gnuradio_swig_py_gengen_python_la_SOURCES = \ - gnuradio_swig_py_gengen_python.cc \ +_gnuradio_swig_py_gengen_la_SOURCES = \ + python/gnuradio_swig_py_gengen.cc \ $(gnuradio_swig_py_gengen_la_swig_sources) -_gnuradio_swig_py_gengen_python_la_LIBADD = \ +_gnuradio_swig_py_gengen_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_gengen_la_swig_libadd) -_gnuradio_swig_py_gengen_python_la_LDFLAGS = \ +_gnuradio_swig_py_gengen_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_gengen_la_swig_ldflags) -_gnuradio_swig_py_gengen_python_la_CXXFLAGS = \ +_gnuradio_swig_py_gengen_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ $(gnuradio_swig_py_gengen_la_swig_cxxflags) gnuradio_swig_py_gengen_python_PYTHON = \ - gnuradio_swig_py_gengen.py \ - $(gnuradio_swig_py_gengen_python) + python/gnuradio_swig_py_gengen.py \ + $(gnuradio_swig_py_gengen) if GUILE -gnuradio_swig_py_gengen_scmlib_LTLIBRARIES = _gnuradio_swig_py_gengen_guile.la -_gnuradio_swig_py_gengen_guile_la_SOURCES = \ - gnuradio_swig_py_gengen_guile.cc \ +gnuradio_swig_py_gengen_scmlib_LTLIBRARIES = gnuradio_swig_py_gengen_guile.la +gnuradio_swig_py_gengen_guile_la_SOURCES = \ + guile/gnuradio_swig_py_gengen.cc \ $(gnuradio_swig_py_gengen_la_swig_sources) gnuradio_swig_py_gengen_scm_DATA = gnuradio_swig_py_gengen.scm # Guile can use the same flags as python does -_gnuradio_swig_py_gengen_guile_la_LIBADD = $(_gnuradio_swig_py_gengen_python_la_LIBADD) -_gnuradio_swig_py_gengen_guile_la_LDFLAGS = $(_gnuradio_swig_py_gengen_python_la_LDFLAGS) -_gnuradio_swig_py_gengen_guile_la_CXXFLAGS = $(_gnuradio_swig_py_gengen_python_la_CXXFLAGS) +gnuradio_swig_py_gengen_guile_la_LIBADD = $(_gnuradio_swig_py_gengen_la_LIBADD) +gnuradio_swig_py_gengen_guile_la_LDFLAGS = $(_gnuradio_swig_py_gengen_la_LDFLAGS) +gnuradio_swig_py_gengen_guile_la_CXXFLAGS = $(_gnuradio_swig_py_gengen_la_CXXFLAGS) endif # end of GUILE ## Entry rule for running SWIG # $(python_deps) $(guile_deps): gnuradio_swig_py_gengen.i -gnuradio_swig_py_gengen_python.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen_python.cc: gnuradio_swig_py_gengen.i -## This rule will get called only when MAKE decides that one of the -## targets needs to be created or re-created, because: -## -## * The .i file is newer than any or all of the generated files; -## -## * Any or all of the .cc, .h, or .py files does not exist and is -## needed (in the case this file is not needed, the rule for it is -## ignored); or -## -## * Some SWIG-based dependecy of the .cc file isn't met and hence the -## .cc file needs be be regenerated. Explanation: Because MAKE -## knows how to handle dependencies for .cc files (regardless of -## their name or extension), then the .cc file is used as a target -## instead of the .i file -- but with the dependencies of the .i -## file. It is this last reason why the line: -## -## if test -f $@; then :; else -## -## cannot be used in this case: If a .i file dependecy is not met, -## then the .cc file needs to be rebuilt. But if the stamp is newer -## than the .cc file, and the .cc file exists, then in the original -## version (with the 'test' above) the internal MAKE call will not -## be issued and hence the .cc file will not be rebuilt. -## -## Once execution gets to here, it should always proceed no matter the -## state of a stamp (as discussed in link above). The -## $(DEPDIR)/gnuradio_swig_py_gengen-generate stuff is used to allow for parallel -## builds to "do the right thing". The stamp has no relationship with -## either the target files or dependency file; it is used solely for -## the protection of multiple builds during a given call to MAKE. -## -## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM -## (15). At a caught signal, the quoted command will be issued before -## exiting. In this case, remove any stamp, whether temporary of not. -## The trap is valid until the process exits; the process includes all -## commands appended via "\"s. -## - trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_gengen-generate-*' 1 2 13 15; \ -## -## Create a temporary directory, which acts as a lock. The first -## process to create the directory will succeed and issue the MAKE -## command to do the actual work, while all subsequent processes will -## fail -- leading them to wait for the first process to finish. -## - if mkdir $(DEPDIR)/gnuradio_swig_py_gengen-generate-lock 2>/dev/null; then \ -## -## This code is being executed by the first process to succeed in -## creating the directory lock. -## -## Remove the stamp associated with this filename. -## - rm -f $(DEPDIR)/gnuradio_swig_py_gengen-generate-*stamp; \ -## -## Tell MAKE to run the rule for creating this stamp. -## - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp WHAT=$<; \ -## -## Now that the .cc, .h, and .py files have been (re)created from the -## .i file, future checking of this rule during the same MAKE -## execution will come back that the rule doesn't need to be executed -## because none of the conditions mentioned at the start of this rule -## will be positive. Remove the the directory lock, which frees up -## any waiting process(es) to continue. -## - rmdir $(DEPDIR)/gnuradio_swig_py_gengen-generate-lock; \ - else \ -## -## This code is being executed by any follower processes while the -## directory lock is in place. -## -## Wait until the first process is done, testing once per second. -## - while test -d $(DEPDIR)/gnuradio_swig_py_gengen-generate-lock; do \ - sleep 1; \ - done; \ -## -## Succeed if and only if the first process succeeded; exit this -## process returning the status of the generated stamp. -## - test -f $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp; \ - exit $$?; \ - fi; - -# the comments for the target above apply to this target as well, but it seemed -# silly to include them twice. The only main change is for guile. -gnuradio_swig_py_gengen_guile.h gnuradio_swig_py_gengen.scm gnuradio_swig_py_gengen_guile.cc: gnuradio_swig_py_gengen.i -if GUILE - trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_gengen-generate-*' 1 2 13 15; \ - if mkdir $(DEPDIR)/gnuradio_swig_py_gengen-generate-lock 2>/dev/null; then \ - rm -f $(DEPDIR)/gnuradio_swig_py_gengen-generate-*stamp; \ - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp WHAT=$<; \ - rmdir $(DEPDIR)/gnuradio_swig_py_gengen-generate-lock; \ - else \ - while test -d $(DEPDIR)/gnuradio_swig_py_gengen-generate-lock; do \ - sleep 1; \ - done; \ - test -f $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp; \ - exit $$?; \ - fi; -endif # end of GUILE +# gnuradio_swig_py_gengen.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen.cc: gnuradio_swig_py_gengen.i +guile/gnuradio_swig_py_gengen.scm gnuradio_swig_py_gengen.scm: gnuradio_swig_py_gengen.i +python/gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen.py: gnuradio_swig_py_gengen.i $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp: -## This rule will be called only by the first process issuing the -## above rule to succeed in creating the lock directory, after -## removing the actual stamp file in order to guarantee that MAKE will -## execute this rule. -## -## Call SWIG to generate the various output files; special -## post-processing on 'mingw32' host OS for the dependency file. -## - if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_gengen_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_gengen_python.Std \ - -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen_python.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_python.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_gengen_python.Std \ - > $(DEPDIR)/gnuradio_swig_py_gengen_python.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_python.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_gengen_python.Sd $(DEPDIR)/gnuradio_swig_py_gengen_python.Std; \ - fi; \ - else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_python.S*; exit 1; \ - fi; -## -## Mess with the SWIG output .Std dependency file, to create a -## dependecy file valid for the input .i file: Basically, simulate the -## dependency file created for libraries by GNU's libtool for C++, -## where all of the dependencies for the target are first listed, then -## each individual dependency is listed as a target with no further -## dependencies. -## -## (1) remove the current dependency file -## - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_python.d -## -## (2) Copy the whole SWIG file: -## - cp $(DEPDIR)/gnuradio_swig_py_gengen_python.Std $(DEPDIR)/gnuradio_swig_py_gengen_python.d -## -## (3) all a carriage return to the end of the dependency file. -## - echo "" >> $(DEPDIR)/gnuradio_swig_py_gengen_python.d -## -## (4) from the SWIG file, remove the first line (the target); remove -## trailing " \" and " " from each line. Append ":" to each line, -## followed by 2 carriage returns, then append this to the end of -## the dependency file. -## - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_gengen_python.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_gengen_python.d -## -## (5) remove the SWIG-generated file -## - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_python.Std -## -## Create the stamp for this filename generation, to signal success in -## executing this rule; allows other threads waiting on this process -## to continue. -## - touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp - -# KLUDGE: Force runtime include of a SWIG dependency file. This is -# not guaranteed to be portable, but will probably work. If it works, -# we have accurate dependencies for our swig stuff, which is good. - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_gengen_python.d@am__quote@ $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp: -if GUILE -# the comments for the target above apply to this target as well, but it seemed -# silly to include them twice. The only main change is for guile. - if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_gengen_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std \ - -module gnuradio_swig_py_gengen -o gnuradio_swig_py_gengen_guile.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std \ - > $(DEPDIR)/gnuradio_swig_py_gengen_guile.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Sd $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std; \ - fi; \ - else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.S*; exit 1; \ - fi; - touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.d - cp $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std $(DEPDIR)/gnuradio_swig_py_gengen_guile.d - echo "" >> $(DEPDIR)/gnuradio_swig_py_gengen_guile.d - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_gengen_guile.d - $(RM) $(DEPDIR)/gnuradio_swig_py_gengen_guile.Std - touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp -else - touch $(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp -endif - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_gengen_guile.d@am__quote@ - -#gnuradio_swig_py_runtime_python.h: gnuradio_swig_py_runtime.i # -*- Makefile -*- # @@ -1096,9 +517,9 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_filter.py gnuradio_swig_py_filter_python.cc +swig_built_sources += gnuradio_swig_py_filter.py #gnuradio_swig_py_filter.cc if GUILE -swig_built_sources += gnuradio_swig_py_filter.scm gnuradio_swig_py_filter_guile.cc +swig_built_sources += gnuradio_swig_py_filter.scm #gnuradio_swig_py_filter.cc endif ## Various SWIG variables. These can be overloaded in the including @@ -1110,245 +531,52 @@ gnuradio_swig_py_filter_swiginclude_HEADERS = \ $(gnuradio_swig_py_filter_swiginclude_headers) gnuradio_swig_py_filter_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_filter_python.la + _gnuradio_swig_py_filter.la -_gnuradio_swig_py_filter_python_la_SOURCES = \ - gnuradio_swig_py_filter_python.cc \ +_gnuradio_swig_py_filter_la_SOURCES = \ + python/gnuradio_swig_py_filter.cc \ $(gnuradio_swig_py_filter_la_swig_sources) -_gnuradio_swig_py_filter_python_la_LIBADD = \ +_gnuradio_swig_py_filter_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_filter_la_swig_libadd) -_gnuradio_swig_py_filter_python_la_LDFLAGS = \ +_gnuradio_swig_py_filter_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_filter_la_swig_ldflags) -_gnuradio_swig_py_filter_python_la_CXXFLAGS = \ +_gnuradio_swig_py_filter_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ $(gnuradio_swig_py_filter_la_swig_cxxflags) gnuradio_swig_py_filter_python_PYTHON = \ - gnuradio_swig_py_filter.py \ - $(gnuradio_swig_py_filter_python) + python/gnuradio_swig_py_filter.py \ + $(gnuradio_swig_py_filter) if GUILE -gnuradio_swig_py_filter_scmlib_LTLIBRARIES = _gnuradio_swig_py_filter_guile.la -_gnuradio_swig_py_filter_guile_la_SOURCES = \ - gnuradio_swig_py_filter_guile.cc \ +gnuradio_swig_py_filter_scmlib_LTLIBRARIES = gnuradio_swig_py_filter_guile.la +gnuradio_swig_py_filter_guile_la_SOURCES = \ + guile/gnuradio_swig_py_filter.cc \ $(gnuradio_swig_py_filter_la_swig_sources) gnuradio_swig_py_filter_scm_DATA = gnuradio_swig_py_filter.scm # Guile can use the same flags as python does -_gnuradio_swig_py_filter_guile_la_LIBADD = $(_gnuradio_swig_py_filter_python_la_LIBADD) -_gnuradio_swig_py_filter_guile_la_LDFLAGS = $(_gnuradio_swig_py_filter_python_la_LDFLAGS) -_gnuradio_swig_py_filter_guile_la_CXXFLAGS = $(_gnuradio_swig_py_filter_python_la_CXXFLAGS) +gnuradio_swig_py_filter_guile_la_LIBADD = $(_gnuradio_swig_py_filter_la_LIBADD) +gnuradio_swig_py_filter_guile_la_LDFLAGS = $(_gnuradio_swig_py_filter_la_LDFLAGS) +gnuradio_swig_py_filter_guile_la_CXXFLAGS = $(_gnuradio_swig_py_filter_la_CXXFLAGS) endif # end of GUILE ## Entry rule for running SWIG # $(python_deps) $(guile_deps): gnuradio_swig_py_filter.i -gnuradio_swig_py_filter_python.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter_python.cc: gnuradio_swig_py_filter.i -## This rule will get called only when MAKE decides that one of the -## targets needs to be created or re-created, because: -## -## * The .i file is newer than any or all of the generated files; -## -## * Any or all of the .cc, .h, or .py files does not exist and is -## needed (in the case this file is not needed, the rule for it is -## ignored); or -## -## * Some SWIG-based dependecy of the .cc file isn't met and hence the -## .cc file needs be be regenerated. Explanation: Because MAKE -## knows how to handle dependencies for .cc files (regardless of -## their name or extension), then the .cc file is used as a target -## instead of the .i file -- but with the dependencies of the .i -## file. It is this last reason why the line: -## -## if test -f $@; then :; else -## -## cannot be used in this case: If a .i file dependecy is not met, -## then the .cc file needs to be rebuilt. But if the stamp is newer -## than the .cc file, and the .cc file exists, then in the original -## version (with the 'test' above) the internal MAKE call will not -## be issued and hence the .cc file will not be rebuilt. -## -## Once execution gets to here, it should always proceed no matter the -## state of a stamp (as discussed in link above). The -## $(DEPDIR)/gnuradio_swig_py_filter-generate stuff is used to allow for parallel -## builds to "do the right thing". The stamp has no relationship with -## either the target files or dependency file; it is used solely for -## the protection of multiple builds during a given call to MAKE. -## -## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM -## (15). At a caught signal, the quoted command will be issued before -## exiting. In this case, remove any stamp, whether temporary of not. -## The trap is valid until the process exits; the process includes all -## commands appended via "\"s. -## - trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_filter-generate-*' 1 2 13 15; \ -## -## Create a temporary directory, which acts as a lock. The first -## process to create the directory will succeed and issue the MAKE -## command to do the actual work, while all subsequent processes will -## fail -- leading them to wait for the first process to finish. -## - if mkdir $(DEPDIR)/gnuradio_swig_py_filter-generate-lock 2>/dev/null; then \ -## -## This code is being executed by the first process to succeed in -## creating the directory lock. -## -## Remove the stamp associated with this filename. -## - rm -f $(DEPDIR)/gnuradio_swig_py_filter-generate-*stamp; \ -## -## Tell MAKE to run the rule for creating this stamp. -## - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp WHAT=$<; \ -## -## Now that the .cc, .h, and .py files have been (re)created from the -## .i file, future checking of this rule during the same MAKE -## execution will come back that the rule doesn't need to be executed -## because none of the conditions mentioned at the start of this rule -## will be positive. Remove the the directory lock, which frees up -## any waiting process(es) to continue. -## - rmdir $(DEPDIR)/gnuradio_swig_py_filter-generate-lock; \ - else \ -## -## This code is being executed by any follower processes while the -## directory lock is in place. -## -## Wait until the first process is done, testing once per second. -## - while test -d $(DEPDIR)/gnuradio_swig_py_filter-generate-lock; do \ - sleep 1; \ - done; \ -## -## Succeed if and only if the first process succeeded; exit this -## process returning the status of the generated stamp. -## - test -f $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp; \ - exit $$?; \ - fi; - -# the comments for the target above apply to this target as well, but it seemed -# silly to include them twice. The only main change is for guile. -gnuradio_swig_py_filter_guile.h gnuradio_swig_py_filter.scm gnuradio_swig_py_filter_guile.cc: gnuradio_swig_py_filter.i -if GUILE - trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_filter-generate-*' 1 2 13 15; \ - if mkdir $(DEPDIR)/gnuradio_swig_py_filter-generate-lock 2>/dev/null; then \ - rm -f $(DEPDIR)/gnuradio_swig_py_filter-generate-*stamp; \ - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp WHAT=$<; \ - rmdir $(DEPDIR)/gnuradio_swig_py_filter-generate-lock; \ - else \ - while test -d $(DEPDIR)/gnuradio_swig_py_filter-generate-lock; do \ - sleep 1; \ - done; \ - test -f $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp; \ - exit $$?; \ - fi; -endif # end of GUILE +# gnuradio_swig_py_filter.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter.cc: gnuradio_swig_py_filter.i +guile/gnuradio_swig_py_filter.scm gnuradio_swig_py_filter.scm: gnuradio_swig_py_filter.i +python/gnuradio_swig_py_filter.py gnuradio_swig_py_filter.py: gnuradio_swig_py_filter.i $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp: -## This rule will be called only by the first process issuing the -## above rule to succeed in creating the lock directory, after -## removing the actual stamp file in order to guarantee that MAKE will -## execute this rule. -## -## Call SWIG to generate the various output files; special -## post-processing on 'mingw32' host OS for the dependency file. -## - if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_filter_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_filter_python.Std \ - -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter_python.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_python.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_filter_python.Std \ - > $(DEPDIR)/gnuradio_swig_py_filter_python.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_python.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_filter_python.Sd $(DEPDIR)/gnuradio_swig_py_filter_python.Std; \ - fi; \ - else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_python.S*; exit 1; \ - fi; -## -## Mess with the SWIG output .Std dependency file, to create a -## dependecy file valid for the input .i file: Basically, simulate the -## dependency file created for libraries by GNU's libtool for C++, -## where all of the dependencies for the target are first listed, then -## each individual dependency is listed as a target with no further -## dependencies. -## -## (1) remove the current dependency file -## - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_python.d -## -## (2) Copy the whole SWIG file: -## - cp $(DEPDIR)/gnuradio_swig_py_filter_python.Std $(DEPDIR)/gnuradio_swig_py_filter_python.d -## -## (3) all a carriage return to the end of the dependency file. -## - echo "" >> $(DEPDIR)/gnuradio_swig_py_filter_python.d -## -## (4) from the SWIG file, remove the first line (the target); remove -## trailing " \" and " " from each line. Append ":" to each line, -## followed by 2 carriage returns, then append this to the end of -## the dependency file. -## - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_filter_python.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_filter_python.d -## -## (5) remove the SWIG-generated file -## - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_python.Std -## -## Create the stamp for this filename generation, to signal success in -## executing this rule; allows other threads waiting on this process -## to continue. -## - touch $(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp - -# KLUDGE: Force runtime include of a SWIG dependency file. This is -# not guaranteed to be portable, but will probably work. If it works, -# we have accurate dependencies for our swig stuff, which is good. - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_filter_python.d@am__quote@ $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp: -if GUILE -# the comments for the target above apply to this target as well, but it seemed -# silly to include them twice. The only main change is for guile. - if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_filter_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_filter_guile.Std \ - -module gnuradio_swig_py_filter -o gnuradio_swig_py_filter_guile.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_filter_guile.Std \ - > $(DEPDIR)/gnuradio_swig_py_filter_guile.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_filter_guile.Sd $(DEPDIR)/gnuradio_swig_py_filter_guile.Std; \ - fi; \ - else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.S*; exit 1; \ - fi; - touch $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.d - cp $(DEPDIR)/gnuradio_swig_py_filter_guile.Std $(DEPDIR)/gnuradio_swig_py_filter_guile.d - echo "" >> $(DEPDIR)/gnuradio_swig_py_filter_guile.d - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_filter_guile.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_filter_guile.d - $(RM) $(DEPDIR)/gnuradio_swig_py_filter_guile.Std - touch $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp -else - touch $(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp -endif - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_filter_guile.d@am__quote@ - -#gnuradio_swig_py_runtime_python.h: gnuradio_swig_py_runtime.i # -*- Makefile -*- # @@ -1434,9 +662,9 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_io.py gnuradio_swig_py_io_python.cc +swig_built_sources += gnuradio_swig_py_io.py #gnuradio_swig_py_io.cc if GUILE -swig_built_sources += gnuradio_swig_py_io.scm gnuradio_swig_py_io_guile.cc +swig_built_sources += gnuradio_swig_py_io.scm #gnuradio_swig_py_io.cc endif ## Various SWIG variables. These can be overloaded in the including @@ -1448,245 +676,52 @@ gnuradio_swig_py_io_swiginclude_HEADERS = \ $(gnuradio_swig_py_io_swiginclude_headers) gnuradio_swig_py_io_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_io_python.la + _gnuradio_swig_py_io.la -_gnuradio_swig_py_io_python_la_SOURCES = \ - gnuradio_swig_py_io_python.cc \ +_gnuradio_swig_py_io_la_SOURCES = \ + python/gnuradio_swig_py_io.cc \ $(gnuradio_swig_py_io_la_swig_sources) -_gnuradio_swig_py_io_python_la_LIBADD = \ +_gnuradio_swig_py_io_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_io_la_swig_libadd) -_gnuradio_swig_py_io_python_la_LDFLAGS = \ +_gnuradio_swig_py_io_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_io_la_swig_ldflags) -_gnuradio_swig_py_io_python_la_CXXFLAGS = \ +_gnuradio_swig_py_io_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ $(gnuradio_swig_py_io_la_swig_cxxflags) gnuradio_swig_py_io_python_PYTHON = \ - gnuradio_swig_py_io.py \ - $(gnuradio_swig_py_io_python) + python/gnuradio_swig_py_io.py \ + $(gnuradio_swig_py_io) if GUILE -gnuradio_swig_py_io_scmlib_LTLIBRARIES = _gnuradio_swig_py_io_guile.la -_gnuradio_swig_py_io_guile_la_SOURCES = \ - gnuradio_swig_py_io_guile.cc \ +gnuradio_swig_py_io_scmlib_LTLIBRARIES = gnuradio_swig_py_io_guile.la +gnuradio_swig_py_io_guile_la_SOURCES = \ + guile/gnuradio_swig_py_io.cc \ $(gnuradio_swig_py_io_la_swig_sources) gnuradio_swig_py_io_scm_DATA = gnuradio_swig_py_io.scm # Guile can use the same flags as python does -_gnuradio_swig_py_io_guile_la_LIBADD = $(_gnuradio_swig_py_io_python_la_LIBADD) -_gnuradio_swig_py_io_guile_la_LDFLAGS = $(_gnuradio_swig_py_io_python_la_LDFLAGS) -_gnuradio_swig_py_io_guile_la_CXXFLAGS = $(_gnuradio_swig_py_io_python_la_CXXFLAGS) +gnuradio_swig_py_io_guile_la_LIBADD = $(_gnuradio_swig_py_io_la_LIBADD) +gnuradio_swig_py_io_guile_la_LDFLAGS = $(_gnuradio_swig_py_io_la_LDFLAGS) +gnuradio_swig_py_io_guile_la_CXXFLAGS = $(_gnuradio_swig_py_io_la_CXXFLAGS) endif # end of GUILE ## Entry rule for running SWIG # $(python_deps) $(guile_deps): gnuradio_swig_py_io.i -gnuradio_swig_py_io_python.h gnuradio_swig_py_io.py gnuradio_swig_py_io_python.cc: gnuradio_swig_py_io.i -## This rule will get called only when MAKE decides that one of the -## targets needs to be created or re-created, because: -## -## * The .i file is newer than any or all of the generated files; -## -## * Any or all of the .cc, .h, or .py files does not exist and is -## needed (in the case this file is not needed, the rule for it is -## ignored); or -## -## * Some SWIG-based dependecy of the .cc file isn't met and hence the -## .cc file needs be be regenerated. Explanation: Because MAKE -## knows how to handle dependencies for .cc files (regardless of -## their name or extension), then the .cc file is used as a target -## instead of the .i file -- but with the dependencies of the .i -## file. It is this last reason why the line: -## -## if test -f $@; then :; else -## -## cannot be used in this case: If a .i file dependecy is not met, -## then the .cc file needs to be rebuilt. But if the stamp is newer -## than the .cc file, and the .cc file exists, then in the original -## version (with the 'test' above) the internal MAKE call will not -## be issued and hence the .cc file will not be rebuilt. -## -## Once execution gets to here, it should always proceed no matter the -## state of a stamp (as discussed in link above). The -## $(DEPDIR)/gnuradio_swig_py_io-generate stuff is used to allow for parallel -## builds to "do the right thing". The stamp has no relationship with -## either the target files or dependency file; it is used solely for -## the protection of multiple builds during a given call to MAKE. -## -## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM -## (15). At a caught signal, the quoted command will be issued before -## exiting. In this case, remove any stamp, whether temporary of not. -## The trap is valid until the process exits; the process includes all -## commands appended via "\"s. -## - trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_io-generate-*' 1 2 13 15; \ -## -## Create a temporary directory, which acts as a lock. The first -## process to create the directory will succeed and issue the MAKE -## command to do the actual work, while all subsequent processes will -## fail -- leading them to wait for the first process to finish. -## - if mkdir $(DEPDIR)/gnuradio_swig_py_io-generate-lock 2>/dev/null; then \ -## -## This code is being executed by the first process to succeed in -## creating the directory lock. -## -## Remove the stamp associated with this filename. -## - rm -f $(DEPDIR)/gnuradio_swig_py_io-generate-*stamp; \ -## -## Tell MAKE to run the rule for creating this stamp. -## - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp WHAT=$<; \ -## -## Now that the .cc, .h, and .py files have been (re)created from the -## .i file, future checking of this rule during the same MAKE -## execution will come back that the rule doesn't need to be executed -## because none of the conditions mentioned at the start of this rule -## will be positive. Remove the the directory lock, which frees up -## any waiting process(es) to continue. -## - rmdir $(DEPDIR)/gnuradio_swig_py_io-generate-lock; \ - else \ -## -## This code is being executed by any follower processes while the -## directory lock is in place. -## -## Wait until the first process is done, testing once per second. -## - while test -d $(DEPDIR)/gnuradio_swig_py_io-generate-lock; do \ - sleep 1; \ - done; \ -## -## Succeed if and only if the first process succeeded; exit this -## process returning the status of the generated stamp. -## - test -f $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp; \ - exit $$?; \ - fi; - -# the comments for the target above apply to this target as well, but it seemed -# silly to include them twice. The only main change is for guile. -gnuradio_swig_py_io_guile.h gnuradio_swig_py_io.scm gnuradio_swig_py_io_guile.cc: gnuradio_swig_py_io.i -if GUILE - trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_io-generate-*' 1 2 13 15; \ - if mkdir $(DEPDIR)/gnuradio_swig_py_io-generate-lock 2>/dev/null; then \ - rm -f $(DEPDIR)/gnuradio_swig_py_io-generate-*stamp; \ - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp WHAT=$<; \ - rmdir $(DEPDIR)/gnuradio_swig_py_io-generate-lock; \ - else \ - while test -d $(DEPDIR)/gnuradio_swig_py_io-generate-lock; do \ - sleep 1; \ - done; \ - test -f $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp; \ - exit $$?; \ - fi; -endif # end of GUILE +# gnuradio_swig_py_io.h gnuradio_swig_py_io.py gnuradio_swig_py_io.cc: gnuradio_swig_py_io.i +guile/gnuradio_swig_py_io.scm gnuradio_swig_py_io.scm: gnuradio_swig_py_io.i +python/gnuradio_swig_py_io.py gnuradio_swig_py_io.py: gnuradio_swig_py_io.i $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp: -## This rule will be called only by the first process issuing the -## above rule to succeed in creating the lock directory, after -## removing the actual stamp file in order to guarantee that MAKE will -## execute this rule. -## -## Call SWIG to generate the various output files; special -## post-processing on 'mingw32' host OS for the dependency file. -## - if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_io_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_io_python.Std \ - -module gnuradio_swig_py_io -o gnuradio_swig_py_io_python.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io_python.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_io_python.Std \ - > $(DEPDIR)/gnuradio_swig_py_io_python.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io_python.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_io_python.Sd $(DEPDIR)/gnuradio_swig_py_io_python.Std; \ - fi; \ - else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io_python.S*; exit 1; \ - fi; -## -## Mess with the SWIG output .Std dependency file, to create a -## dependecy file valid for the input .i file: Basically, simulate the -## dependency file created for libraries by GNU's libtool for C++, -## where all of the dependencies for the target are first listed, then -## each individual dependency is listed as a target with no further -## dependencies. -## -## (1) remove the current dependency file -## - $(RM) $(DEPDIR)/gnuradio_swig_py_io_python.d -## -## (2) Copy the whole SWIG file: -## - cp $(DEPDIR)/gnuradio_swig_py_io_python.Std $(DEPDIR)/gnuradio_swig_py_io_python.d -## -## (3) all a carriage return to the end of the dependency file. -## - echo "" >> $(DEPDIR)/gnuradio_swig_py_io_python.d -## -## (4) from the SWIG file, remove the first line (the target); remove -## trailing " \" and " " from each line. Append ":" to each line, -## followed by 2 carriage returns, then append this to the end of -## the dependency file. -## - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_io_python.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_io_python.d -## -## (5) remove the SWIG-generated file -## - $(RM) $(DEPDIR)/gnuradio_swig_py_io_python.Std -## -## Create the stamp for this filename generation, to signal success in -## executing this rule; allows other threads waiting on this process -## to continue. -## - touch $(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp - -# KLUDGE: Force runtime include of a SWIG dependency file. This is -# not guaranteed to be portable, but will probably work. If it works, -# we have accurate dependencies for our swig stuff, which is good. - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_io_python.d@am__quote@ $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp: -if GUILE -# the comments for the target above apply to this target as well, but it seemed -# silly to include them twice. The only main change is for guile. - if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_io_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_io_guile.Std \ - -module gnuradio_swig_py_io -o gnuradio_swig_py_io_guile.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_io_guile.Std \ - > $(DEPDIR)/gnuradio_swig_py_io_guile.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_io_guile.Sd $(DEPDIR)/gnuradio_swig_py_io_guile.Std; \ - fi; \ - else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.S*; exit 1; \ - fi; - touch $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp - $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.d - cp $(DEPDIR)/gnuradio_swig_py_io_guile.Std $(DEPDIR)/gnuradio_swig_py_io_guile.d - echo "" >> $(DEPDIR)/gnuradio_swig_py_io_guile.d - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_io_guile.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_io_guile.d - $(RM) $(DEPDIR)/gnuradio_swig_py_io_guile.Std - touch $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp -else - touch $(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp -endif - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_io_guile.d@am__quote@ - -#gnuradio_swig_py_runtime_python.h: gnuradio_swig_py_runtime.i # -*- Makefile -*- # @@ -1772,9 +807,9 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_hier.py gnuradio_swig_py_hier_python.cc +swig_built_sources += gnuradio_swig_py_hier.py #gnuradio_swig_py_hier.cc if GUILE -swig_built_sources += gnuradio_swig_py_hier.scm gnuradio_swig_py_hier_guile.cc +swig_built_sources += gnuradio_swig_py_hier.scm #gnuradio_swig_py_hier.cc endif ## Various SWIG variables. These can be overloaded in the including @@ -1786,243 +821,50 @@ gnuradio_swig_py_hier_swiginclude_HEADERS = \ $(gnuradio_swig_py_hier_swiginclude_headers) gnuradio_swig_py_hier_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_hier_python.la + _gnuradio_swig_py_hier.la -_gnuradio_swig_py_hier_python_la_SOURCES = \ - gnuradio_swig_py_hier_python.cc \ +_gnuradio_swig_py_hier_la_SOURCES = \ + python/gnuradio_swig_py_hier.cc \ $(gnuradio_swig_py_hier_la_swig_sources) -_gnuradio_swig_py_hier_python_la_LIBADD = \ +_gnuradio_swig_py_hier_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_hier_la_swig_libadd) -_gnuradio_swig_py_hier_python_la_LDFLAGS = \ +_gnuradio_swig_py_hier_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_hier_la_swig_ldflags) -_gnuradio_swig_py_hier_python_la_CXXFLAGS = \ +_gnuradio_swig_py_hier_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ $(gnuradio_swig_py_hier_la_swig_cxxflags) gnuradio_swig_py_hier_python_PYTHON = \ - gnuradio_swig_py_hier.py \ - $(gnuradio_swig_py_hier_python) + python/gnuradio_swig_py_hier.py \ + $(gnuradio_swig_py_hier) if GUILE -gnuradio_swig_py_hier_scmlib_LTLIBRARIES = _gnuradio_swig_py_hier_guile.la -_gnuradio_swig_py_hier_guile_la_SOURCES = \ - gnuradio_swig_py_hier_guile.cc \ +gnuradio_swig_py_hier_scmlib_LTLIBRARIES = gnuradio_swig_py_hier_guile.la +gnuradio_swig_py_hier_guile_la_SOURCES = \ + guile/gnuradio_swig_py_hier.cc \ $(gnuradio_swig_py_hier_la_swig_sources) gnuradio_swig_py_hier_scm_DATA = gnuradio_swig_py_hier.scm # Guile can use the same flags as python does -_gnuradio_swig_py_hier_guile_la_LIBADD = $(_gnuradio_swig_py_hier_python_la_LIBADD) -_gnuradio_swig_py_hier_guile_la_LDFLAGS = $(_gnuradio_swig_py_hier_python_la_LDFLAGS) -_gnuradio_swig_py_hier_guile_la_CXXFLAGS = $(_gnuradio_swig_py_hier_python_la_CXXFLAGS) +gnuradio_swig_py_hier_guile_la_LIBADD = $(_gnuradio_swig_py_hier_la_LIBADD) +gnuradio_swig_py_hier_guile_la_LDFLAGS = $(_gnuradio_swig_py_hier_la_LDFLAGS) +gnuradio_swig_py_hier_guile_la_CXXFLAGS = $(_gnuradio_swig_py_hier_la_CXXFLAGS) endif # end of GUILE ## Entry rule for running SWIG # $(python_deps) $(guile_deps): gnuradio_swig_py_hier.i -gnuradio_swig_py_hier_python.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier_python.cc: gnuradio_swig_py_hier.i -## This rule will get called only when MAKE decides that one of the -## targets needs to be created or re-created, because: -## -## * The .i file is newer than any or all of the generated files; -## -## * Any or all of the .cc, .h, or .py files does not exist and is -## needed (in the case this file is not needed, the rule for it is -## ignored); or -## -## * Some SWIG-based dependecy of the .cc file isn't met and hence the -## .cc file needs be be regenerated. Explanation: Because MAKE -## knows how to handle dependencies for .cc files (regardless of -## their name or extension), then the .cc file is used as a target -## instead of the .i file -- but with the dependencies of the .i -## file. It is this last reason why the line: -## -## if test -f $@; then :; else -## -## cannot be used in this case: If a .i file dependecy is not met, -## then the .cc file needs to be rebuilt. But if the stamp is newer -## than the .cc file, and the .cc file exists, then in the original -## version (with the 'test' above) the internal MAKE call will not -## be issued and hence the .cc file will not be rebuilt. -## -## Once execution gets to here, it should always proceed no matter the -## state of a stamp (as discussed in link above). The -## $(DEPDIR)/gnuradio_swig_py_hier-generate stuff is used to allow for parallel -## builds to "do the right thing". The stamp has no relationship with -## either the target files or dependency file; it is used solely for -## the protection of multiple builds during a given call to MAKE. -## -## Catch signals SIGHUP (1), SIGINT (2), SIGPIPE (13), and SIGTERM -## (15). At a caught signal, the quoted command will be issued before -## exiting. In this case, remove any stamp, whether temporary of not. -## The trap is valid until the process exits; the process includes all -## commands appended via "\"s. -## - trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_hier-generate-*' 1 2 13 15; \ -## -## Create a temporary directory, which acts as a lock. The first -## process to create the directory will succeed and issue the MAKE -## command to do the actual work, while all subsequent processes will -## fail -- leading them to wait for the first process to finish. -## - if mkdir $(DEPDIR)/gnuradio_swig_py_hier-generate-lock 2>/dev/null; then \ -## -## This code is being executed by the first process to succeed in -## creating the directory lock. -## -## Remove the stamp associated with this filename. -## - rm -f $(DEPDIR)/gnuradio_swig_py_hier-generate-*stamp; \ -## -## Tell MAKE to run the rule for creating this stamp. -## - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp WHAT=$<; \ -## -## Now that the .cc, .h, and .py files have been (re)created from the -## .i file, future checking of this rule during the same MAKE -## execution will come back that the rule doesn't need to be executed -## because none of the conditions mentioned at the start of this rule -## will be positive. Remove the the directory lock, which frees up -## any waiting process(es) to continue. -## - rmdir $(DEPDIR)/gnuradio_swig_py_hier-generate-lock; \ - else \ -## -## This code is being executed by any follower processes while the -## directory lock is in place. -## -## Wait until the first process is done, testing once per second. -## - while test -d $(DEPDIR)/gnuradio_swig_py_hier-generate-lock; do \ - sleep 1; \ - done; \ -## -## Succeed if and only if the first process succeeded; exit this -## process returning the status of the generated stamp. -## - test -f $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp; \ - exit $$?; \ - fi; - -# the comments for the target above apply to this target as well, but it seemed -# silly to include them twice. The only main change is for guile. -gnuradio_swig_py_hier_guile.h gnuradio_swig_py_hier.scm gnuradio_swig_py_hier_guile.cc: gnuradio_swig_py_hier.i -if GUILE - trap 'rm -rf $(DEPDIR)/gnuradio_swig_py_hier-generate-*' 1 2 13 15; \ - if mkdir $(DEPDIR)/gnuradio_swig_py_hier-generate-lock 2>/dev/null; then \ - rm -f $(DEPDIR)/gnuradio_swig_py_hier-generate-*stamp; \ - $(MAKE) $(AM_MAKEFLAGS) $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp WHAT=$<; \ - rmdir $(DEPDIR)/gnuradio_swig_py_hier-generate-lock; \ - else \ - while test -d $(DEPDIR)/gnuradio_swig_py_hier-generate-lock; do \ - sleep 1; \ - done; \ - test -f $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp; \ - exit $$?; \ - fi; -endif # end of GUILE +# gnuradio_swig_py_hier.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier.cc: gnuradio_swig_py_hier.i +guile/gnuradio_swig_py_hier.scm gnuradio_swig_py_hier.scm: gnuradio_swig_py_hier.i +python/gnuradio_swig_py_hier.py gnuradio_swig_py_hier.py: gnuradio_swig_py_hier.i $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp: -## This rule will be called only by the first process issuing the -## above rule to succeed in creating the lock directory, after -## removing the actual stamp file in order to guarantee that MAKE will -## execute this rule. -## -## Call SWIG to generate the various output files; special -## post-processing on 'mingw32' host OS for the dependency file. -## - if $(SWIG) $(STD_SWIG_PYTHON_ARGS) $(gnuradio_swig_py_hier_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_hier_python.Std \ - -module gnuradio_swig_py_hier -o gnuradio_swig_py_hier_python.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_python.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_hier_python.Std \ - > $(DEPDIR)/gnuradio_swig_py_hier_python.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_python.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_hier_python.Sd $(DEPDIR)/gnuradio_swig_py_hier_python.Std; \ - fi; \ - else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_python.S*; exit 1; \ - fi; -## -## Mess with the SWIG output .Std dependency file, to create a -## dependecy file valid for the input .i file: Basically, simulate the -## dependency file created for libraries by GNU's libtool for C++, -## where all of the dependencies for the target are first listed, then -## each individual dependency is listed as a target with no further -## dependencies. -## -## (1) remove the current dependency file -## - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_python.d -## -## (2) Copy the whole SWIG file: -## - cp $(DEPDIR)/gnuradio_swig_py_hier_python.Std $(DEPDIR)/gnuradio_swig_py_hier_python.d -## -## (3) all a carriage return to the end of the dependency file. -## - echo "" >> $(DEPDIR)/gnuradio_swig_py_hier_python.d -## -## (4) from the SWIG file, remove the first line (the target); remove -## trailing " \" and " " from each line. Append ":" to each line, -## followed by 2 carriage returns, then append this to the end of -## the dependency file. -## - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_hier_python.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_hier_python.d -## -## (5) remove the SWIG-generated file -## - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_python.Std -## -## Create the stamp for this filename generation, to signal success in -## executing this rule; allows other threads waiting on this process -## to continue. -## - touch $(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp - -# KLUDGE: Force runtime include of a SWIG dependency file. This is -# not guaranteed to be portable, but will probably work. If it works, -# we have accurate dependencies for our swig stuff, which is good. - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_hier_python.d@am__quote@ $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp: -if GUILE -# the comments for the target above apply to this target as well, but it seemed -# silly to include them twice. The only main change is for guile. - if $(SWIG) $(STD_SWIG_GUILE_ARGS) $(gnuradio_swig_py_hier_swig_args) \ - -MD -MF $(DEPDIR)/gnuradio_swig_py_hier_guile.Std \ - -module gnuradio_swig_py_hier -o gnuradio_swig_py_hier_guile.cc $(WHAT); then \ - if test $(host_os) = mingw32; then \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.Sd; \ - $(SED) 's,\\\\,/,g' < $(DEPDIR)/gnuradio_swig_py_hier_guile.Std \ - > $(DEPDIR)/gnuradio_swig_py_hier_guile.Sd; \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.Std; \ - $(MV) $(DEPDIR)/gnuradio_swig_py_hier_guile.Sd $(DEPDIR)/gnuradio_swig_py_hier_guile.Std; \ - fi; \ - else \ - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.S*; exit 1; \ - fi; - touch $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.d - cp $(DEPDIR)/gnuradio_swig_py_hier_guile.Std $(DEPDIR)/gnuradio_swig_py_hier_guile.d - echo "" >> $(DEPDIR)/gnuradio_swig_py_hier_guile.d - $(SED) -e '1d;s, \\,,g;s, ,,g' < $(DEPDIR)/gnuradio_swig_py_hier_guile.Std | \ - awk '{ printf "%s:\n\n", $$0 }' >> $(DEPDIR)/gnuradio_swig_py_hier_guile.d - $(RM) $(DEPDIR)/gnuradio_swig_py_hier_guile.Std - touch $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp -else - touch $(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp -endif - -@am__include@ @am__quote@./$(DEPDIR)/gnuradio_swig_py_hier_guile.d@am__quote@ - -#gnuradio_swig_py_runtime_python.h: gnuradio_swig_py_runtime.i -- cgit From 5650ee3c123dcd819542fbba1719e89a09ece399 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Thu, 21 Oct 2010 11:32:40 -0600 Subject: regenerated --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 174 +++++++++++++++------------ 1 file changed, 96 insertions(+), 78 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index 77127e462..54938187a 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -82,9 +82,11 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_runtime.py #gnuradio_swig_py_runtime.cc +# generating the py or scm file also generates the .cc or .h files, +# but dependencies work better without the .cc ort .h files listed. +swig_built_sources += gnuradio_swig_py_runtime.py if GUILE -swig_built_sources += gnuradio_swig_py_runtime.scm #gnuradio_swig_py_runtime.cc +swig_built_sources += gnuradio_swig_py_runtime.scm endif ## Various SWIG variables. These can be overloaded in the including @@ -106,22 +108,25 @@ _gnuradio_swig_py_runtime_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_runtime_la_swig_libadd) +# _gnuradio_swig_py_runtime_la_DEPENDENCIES = python/gnuradio_swig_py_runtime.lo + _gnuradio_swig_py_runtime_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_runtime_la_swig_ldflags) _gnuradio_swig_py_runtime_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ + -I$(top_builddir) \ $(gnuradio_swig_py_runtime_la_swig_cxxflags) gnuradio_swig_py_runtime_python_PYTHON = \ - python/gnuradio_swig_py_runtime.py \ + gnuradio_swig_py_runtime.py \ $(gnuradio_swig_py_runtime) if GUILE gnuradio_swig_py_runtime_scmlib_LTLIBRARIES = gnuradio_swig_py_runtime_guile.la gnuradio_swig_py_runtime_guile_la_SOURCES = \ - guile/gnuradio_swig_py_runtime.cc \ + guile/gnuradio_swig_py_runtime.cc \ $(gnuradio_swig_py_runtime_la_swig_sources) gnuradio_swig_py_runtime_scm_DATA = gnuradio_swig_py_runtime.scm @@ -130,18 +135,16 @@ gnuradio_swig_py_runtime_guile_la_LIBADD = $(_gnuradio_swig_py_runtime_la_LIBADD gnuradio_swig_py_runtime_guile_la_LDFLAGS = $(_gnuradio_swig_py_runtime_la_LDFLAGS) gnuradio_swig_py_runtime_guile_la_CXXFLAGS = $(_gnuradio_swig_py_runtime_la_CXXFLAGS) -endif # end of GUILE - -## Entry rule for running SWIG +guile/gnuradio_swig_py_runtime.lo: gnuradio_swig_py_runtime.lo +#gnuradio_swig_py_runtime.lo: gnuradio_swig_py_runtime.scm +gnuradio_swig_py_runtime.scm: gnuradio_swig_py_runtime.i -# $(python_deps) $(guile_deps): gnuradio_swig_py_runtime.i -# gnuradio_swig_py_runtime.h gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime.cc: gnuradio_swig_py_runtime.i -guile/gnuradio_swig_py_runtime.scm gnuradio_swig_py_runtime.scm: gnuradio_swig_py_runtime.i -python/gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime.py: gnuradio_swig_py_runtime.i +endif # end of GUILE -$(DEPDIR)/gnuradio_swig_py_runtime-generate-python-stamp: +python/gnuradio_swig_py_runtime.lo: +gnuradio_swig_py_runtime.lo: gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime.scm +gnuradio_swig_py_runtime.py: gnuradio_swig_py_runtime.i -$(DEPDIR)/gnuradio_swig_py_runtime-generate-guile-stamp: # -*- Makefile -*- # @@ -227,9 +230,11 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_general.py #gnuradio_swig_py_general.cc +# generating the py or scm file also generates the .cc or .h files, +# but dependencies work better without the .cc ort .h files listed. +swig_built_sources += gnuradio_swig_py_general.py if GUILE -swig_built_sources += gnuradio_swig_py_general.scm #gnuradio_swig_py_general.cc +swig_built_sources += gnuradio_swig_py_general.scm endif ## Various SWIG variables. These can be overloaded in the including @@ -251,22 +256,25 @@ _gnuradio_swig_py_general_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_general_la_swig_libadd) +# _gnuradio_swig_py_general_la_DEPENDENCIES = python/gnuradio_swig_py_general.lo + _gnuradio_swig_py_general_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_general_la_swig_ldflags) _gnuradio_swig_py_general_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ + -I$(top_builddir) \ $(gnuradio_swig_py_general_la_swig_cxxflags) gnuradio_swig_py_general_python_PYTHON = \ - python/gnuradio_swig_py_general.py \ + gnuradio_swig_py_general.py \ $(gnuradio_swig_py_general) if GUILE gnuradio_swig_py_general_scmlib_LTLIBRARIES = gnuradio_swig_py_general_guile.la gnuradio_swig_py_general_guile_la_SOURCES = \ - guile/gnuradio_swig_py_general.cc \ + guile/gnuradio_swig_py_general.cc \ $(gnuradio_swig_py_general_la_swig_sources) gnuradio_swig_py_general_scm_DATA = gnuradio_swig_py_general.scm @@ -275,18 +283,16 @@ gnuradio_swig_py_general_guile_la_LIBADD = $(_gnuradio_swig_py_general_la_LIBADD gnuradio_swig_py_general_guile_la_LDFLAGS = $(_gnuradio_swig_py_general_la_LDFLAGS) gnuradio_swig_py_general_guile_la_CXXFLAGS = $(_gnuradio_swig_py_general_la_CXXFLAGS) -endif # end of GUILE - -## Entry rule for running SWIG +guile/gnuradio_swig_py_general.lo: gnuradio_swig_py_general.lo +#gnuradio_swig_py_general.lo: gnuradio_swig_py_general.scm +gnuradio_swig_py_general.scm: gnuradio_swig_py_general.i -# $(python_deps) $(guile_deps): gnuradio_swig_py_general.i -# gnuradio_swig_py_general.h gnuradio_swig_py_general.py gnuradio_swig_py_general.cc: gnuradio_swig_py_general.i -guile/gnuradio_swig_py_general.scm gnuradio_swig_py_general.scm: gnuradio_swig_py_general.i -python/gnuradio_swig_py_general.py gnuradio_swig_py_general.py: gnuradio_swig_py_general.i +endif # end of GUILE -$(DEPDIR)/gnuradio_swig_py_general-generate-python-stamp: +python/gnuradio_swig_py_general.lo: +gnuradio_swig_py_general.lo: gnuradio_swig_py_general.py gnuradio_swig_py_general.scm +gnuradio_swig_py_general.py: gnuradio_swig_py_general.i -$(DEPDIR)/gnuradio_swig_py_general-generate-guile-stamp: # -*- Makefile -*- # @@ -372,9 +378,11 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_gengen.py #gnuradio_swig_py_gengen.cc +# generating the py or scm file also generates the .cc or .h files, +# but dependencies work better without the .cc ort .h files listed. +swig_built_sources += gnuradio_swig_py_gengen.py if GUILE -swig_built_sources += gnuradio_swig_py_gengen.scm #gnuradio_swig_py_gengen.cc +swig_built_sources += gnuradio_swig_py_gengen.scm endif ## Various SWIG variables. These can be overloaded in the including @@ -396,22 +404,25 @@ _gnuradio_swig_py_gengen_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_gengen_la_swig_libadd) +# _gnuradio_swig_py_gengen_la_DEPENDENCIES = python/gnuradio_swig_py_gengen.lo + _gnuradio_swig_py_gengen_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_gengen_la_swig_ldflags) _gnuradio_swig_py_gengen_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ + -I$(top_builddir) \ $(gnuradio_swig_py_gengen_la_swig_cxxflags) gnuradio_swig_py_gengen_python_PYTHON = \ - python/gnuradio_swig_py_gengen.py \ + gnuradio_swig_py_gengen.py \ $(gnuradio_swig_py_gengen) if GUILE gnuradio_swig_py_gengen_scmlib_LTLIBRARIES = gnuradio_swig_py_gengen_guile.la gnuradio_swig_py_gengen_guile_la_SOURCES = \ - guile/gnuradio_swig_py_gengen.cc \ + guile/gnuradio_swig_py_gengen.cc \ $(gnuradio_swig_py_gengen_la_swig_sources) gnuradio_swig_py_gengen_scm_DATA = gnuradio_swig_py_gengen.scm @@ -420,18 +431,16 @@ gnuradio_swig_py_gengen_guile_la_LIBADD = $(_gnuradio_swig_py_gengen_la_LIBADD) gnuradio_swig_py_gengen_guile_la_LDFLAGS = $(_gnuradio_swig_py_gengen_la_LDFLAGS) gnuradio_swig_py_gengen_guile_la_CXXFLAGS = $(_gnuradio_swig_py_gengen_la_CXXFLAGS) -endif # end of GUILE - -## Entry rule for running SWIG +guile/gnuradio_swig_py_gengen.lo: gnuradio_swig_py_gengen.lo +#gnuradio_swig_py_gengen.lo: gnuradio_swig_py_gengen.scm +gnuradio_swig_py_gengen.scm: gnuradio_swig_py_gengen.i -# $(python_deps) $(guile_deps): gnuradio_swig_py_gengen.i -# gnuradio_swig_py_gengen.h gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen.cc: gnuradio_swig_py_gengen.i -guile/gnuradio_swig_py_gengen.scm gnuradio_swig_py_gengen.scm: gnuradio_swig_py_gengen.i -python/gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen.py: gnuradio_swig_py_gengen.i +endif # end of GUILE -$(DEPDIR)/gnuradio_swig_py_gengen-generate-python-stamp: +python/gnuradio_swig_py_gengen.lo: +gnuradio_swig_py_gengen.lo: gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen.scm +gnuradio_swig_py_gengen.py: gnuradio_swig_py_gengen.i -$(DEPDIR)/gnuradio_swig_py_gengen-generate-guile-stamp: # -*- Makefile -*- # @@ -517,9 +526,11 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_filter.py #gnuradio_swig_py_filter.cc +# generating the py or scm file also generates the .cc or .h files, +# but dependencies work better without the .cc ort .h files listed. +swig_built_sources += gnuradio_swig_py_filter.py if GUILE -swig_built_sources += gnuradio_swig_py_filter.scm #gnuradio_swig_py_filter.cc +swig_built_sources += gnuradio_swig_py_filter.scm endif ## Various SWIG variables. These can be overloaded in the including @@ -541,22 +552,25 @@ _gnuradio_swig_py_filter_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_filter_la_swig_libadd) +# _gnuradio_swig_py_filter_la_DEPENDENCIES = python/gnuradio_swig_py_filter.lo + _gnuradio_swig_py_filter_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_filter_la_swig_ldflags) _gnuradio_swig_py_filter_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ + -I$(top_builddir) \ $(gnuradio_swig_py_filter_la_swig_cxxflags) gnuradio_swig_py_filter_python_PYTHON = \ - python/gnuradio_swig_py_filter.py \ + gnuradio_swig_py_filter.py \ $(gnuradio_swig_py_filter) if GUILE gnuradio_swig_py_filter_scmlib_LTLIBRARIES = gnuradio_swig_py_filter_guile.la gnuradio_swig_py_filter_guile_la_SOURCES = \ - guile/gnuradio_swig_py_filter.cc \ + guile/gnuradio_swig_py_filter.cc \ $(gnuradio_swig_py_filter_la_swig_sources) gnuradio_swig_py_filter_scm_DATA = gnuradio_swig_py_filter.scm @@ -565,18 +579,16 @@ gnuradio_swig_py_filter_guile_la_LIBADD = $(_gnuradio_swig_py_filter_la_LIBADD) gnuradio_swig_py_filter_guile_la_LDFLAGS = $(_gnuradio_swig_py_filter_la_LDFLAGS) gnuradio_swig_py_filter_guile_la_CXXFLAGS = $(_gnuradio_swig_py_filter_la_CXXFLAGS) -endif # end of GUILE - -## Entry rule for running SWIG +guile/gnuradio_swig_py_filter.lo: gnuradio_swig_py_filter.lo +#gnuradio_swig_py_filter.lo: gnuradio_swig_py_filter.scm +gnuradio_swig_py_filter.scm: gnuradio_swig_py_filter.i -# $(python_deps) $(guile_deps): gnuradio_swig_py_filter.i -# gnuradio_swig_py_filter.h gnuradio_swig_py_filter.py gnuradio_swig_py_filter.cc: gnuradio_swig_py_filter.i -guile/gnuradio_swig_py_filter.scm gnuradio_swig_py_filter.scm: gnuradio_swig_py_filter.i -python/gnuradio_swig_py_filter.py gnuradio_swig_py_filter.py: gnuradio_swig_py_filter.i +endif # end of GUILE -$(DEPDIR)/gnuradio_swig_py_filter-generate-python-stamp: +python/gnuradio_swig_py_filter.lo: +gnuradio_swig_py_filter.lo: gnuradio_swig_py_filter.py gnuradio_swig_py_filter.scm +gnuradio_swig_py_filter.py: gnuradio_swig_py_filter.i -$(DEPDIR)/gnuradio_swig_py_filter-generate-guile-stamp: # -*- Makefile -*- # @@ -662,9 +674,11 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_io.py #gnuradio_swig_py_io.cc +# generating the py or scm file also generates the .cc or .h files, +# but dependencies work better without the .cc ort .h files listed. +swig_built_sources += gnuradio_swig_py_io.py if GUILE -swig_built_sources += gnuradio_swig_py_io.scm #gnuradio_swig_py_io.cc +swig_built_sources += gnuradio_swig_py_io.scm endif ## Various SWIG variables. These can be overloaded in the including @@ -686,22 +700,25 @@ _gnuradio_swig_py_io_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_io_la_swig_libadd) +# _gnuradio_swig_py_io_la_DEPENDENCIES = python/gnuradio_swig_py_io.lo + _gnuradio_swig_py_io_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_io_la_swig_ldflags) _gnuradio_swig_py_io_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ + -I$(top_builddir) \ $(gnuradio_swig_py_io_la_swig_cxxflags) gnuradio_swig_py_io_python_PYTHON = \ - python/gnuradio_swig_py_io.py \ + gnuradio_swig_py_io.py \ $(gnuradio_swig_py_io) if GUILE gnuradio_swig_py_io_scmlib_LTLIBRARIES = gnuradio_swig_py_io_guile.la gnuradio_swig_py_io_guile_la_SOURCES = \ - guile/gnuradio_swig_py_io.cc \ + guile/gnuradio_swig_py_io.cc \ $(gnuradio_swig_py_io_la_swig_sources) gnuradio_swig_py_io_scm_DATA = gnuradio_swig_py_io.scm @@ -710,18 +727,16 @@ gnuradio_swig_py_io_guile_la_LIBADD = $(_gnuradio_swig_py_io_la_LIBADD) gnuradio_swig_py_io_guile_la_LDFLAGS = $(_gnuradio_swig_py_io_la_LDFLAGS) gnuradio_swig_py_io_guile_la_CXXFLAGS = $(_gnuradio_swig_py_io_la_CXXFLAGS) -endif # end of GUILE - -## Entry rule for running SWIG +guile/gnuradio_swig_py_io.lo: gnuradio_swig_py_io.lo +#gnuradio_swig_py_io.lo: gnuradio_swig_py_io.scm +gnuradio_swig_py_io.scm: gnuradio_swig_py_io.i -# $(python_deps) $(guile_deps): gnuradio_swig_py_io.i -# gnuradio_swig_py_io.h gnuradio_swig_py_io.py gnuradio_swig_py_io.cc: gnuradio_swig_py_io.i -guile/gnuradio_swig_py_io.scm gnuradio_swig_py_io.scm: gnuradio_swig_py_io.i -python/gnuradio_swig_py_io.py gnuradio_swig_py_io.py: gnuradio_swig_py_io.i +endif # end of GUILE -$(DEPDIR)/gnuradio_swig_py_io-generate-python-stamp: +python/gnuradio_swig_py_io.lo: +gnuradio_swig_py_io.lo: gnuradio_swig_py_io.py gnuradio_swig_py_io.scm +gnuradio_swig_py_io.py: gnuradio_swig_py_io.i -$(DEPDIR)/gnuradio_swig_py_io-generate-guile-stamp: # -*- Makefile -*- # @@ -807,9 +822,11 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* ## .h file is sometimes built, but not always ... so that one has to ## be added manually by the including Makefile.am . -swig_built_sources += gnuradio_swig_py_hier.py #gnuradio_swig_py_hier.cc +# generating the py or scm file also generates the .cc or .h files, +# but dependencies work better without the .cc ort .h files listed. +swig_built_sources += gnuradio_swig_py_hier.py if GUILE -swig_built_sources += gnuradio_swig_py_hier.scm #gnuradio_swig_py_hier.cc +swig_built_sources += gnuradio_swig_py_hier.scm endif ## Various SWIG variables. These can be overloaded in the including @@ -831,22 +848,25 @@ _gnuradio_swig_py_hier_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_swig_py_hier_la_swig_libadd) +# _gnuradio_swig_py_hier_la_DEPENDENCIES = python/gnuradio_swig_py_hier.lo + _gnuradio_swig_py_hier_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_swig_py_hier_la_swig_ldflags) _gnuradio_swig_py_hier_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ + -I$(top_builddir) \ $(gnuradio_swig_py_hier_la_swig_cxxflags) gnuradio_swig_py_hier_python_PYTHON = \ - python/gnuradio_swig_py_hier.py \ + gnuradio_swig_py_hier.py \ $(gnuradio_swig_py_hier) if GUILE gnuradio_swig_py_hier_scmlib_LTLIBRARIES = gnuradio_swig_py_hier_guile.la gnuradio_swig_py_hier_guile_la_SOURCES = \ - guile/gnuradio_swig_py_hier.cc \ + guile/gnuradio_swig_py_hier.cc \ $(gnuradio_swig_py_hier_la_swig_sources) gnuradio_swig_py_hier_scm_DATA = gnuradio_swig_py_hier.scm @@ -855,16 +875,14 @@ gnuradio_swig_py_hier_guile_la_LIBADD = $(_gnuradio_swig_py_hier_la_LIBADD) gnuradio_swig_py_hier_guile_la_LDFLAGS = $(_gnuradio_swig_py_hier_la_LDFLAGS) gnuradio_swig_py_hier_guile_la_CXXFLAGS = $(_gnuradio_swig_py_hier_la_CXXFLAGS) -endif # end of GUILE - -## Entry rule for running SWIG +guile/gnuradio_swig_py_hier.lo: gnuradio_swig_py_hier.lo +#gnuradio_swig_py_hier.lo: gnuradio_swig_py_hier.scm +gnuradio_swig_py_hier.scm: gnuradio_swig_py_hier.i -# $(python_deps) $(guile_deps): gnuradio_swig_py_hier.i -# gnuradio_swig_py_hier.h gnuradio_swig_py_hier.py gnuradio_swig_py_hier.cc: gnuradio_swig_py_hier.i -guile/gnuradio_swig_py_hier.scm gnuradio_swig_py_hier.scm: gnuradio_swig_py_hier.i -python/gnuradio_swig_py_hier.py gnuradio_swig_py_hier.py: gnuradio_swig_py_hier.i +endif # end of GUILE -$(DEPDIR)/gnuradio_swig_py_hier-generate-python-stamp: +python/gnuradio_swig_py_hier.lo: +gnuradio_swig_py_hier.lo: gnuradio_swig_py_hier.py gnuradio_swig_py_hier.scm +gnuradio_swig_py_hier.py: gnuradio_swig_py_hier.i -$(DEPDIR)/gnuradio_swig_py_hier-generate-guile-stamp: -- cgit From 75aed9281e0f918fe11a3c040e6b46387dd676c5 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Thu, 21 Oct 2010 11:33:04 -0600 Subject: add comments --- gnuradio-core/src/lib/swig/Makefile.am | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 5f55e63b5..21bfe6761 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -22,8 +22,6 @@ include $(top_srcdir)/Makefile.common include $(top_srcdir)/Makefile.swig -# VPATH += python guile - BUILT_SOURCES = $(grinclude_HEADERS) $(swig_built_sources) CLEANFILES = python/gnuradio* if GUILE @@ -114,16 +112,25 @@ endif # Do not distribute the output of SWIG no_dist_files = $(swig_built_sources) -# Compile a .i to what guile needs +# Compile a .i to what guile needs. We use -o to set the output file name, +# or even with -outdir guile in SWIG_GUILE_ARGS, swig keeps putting a +# gnuradio_swig_py_*_wrap.cxx in the source directory. + +## SWIG suffixes for automake to know about +SUFFIXES = .i .scm .pyvi + +if GUILE .i.scm: + @echo "Compile .i to .scm" @test -d "guile" || $(mkinstalldirs) "guile" $(SWIG) $(STD_SWIG_GUILE_ARGS) $($*_swig_args) \ -module $* -o guile/$*.cc $< +# -MD -MF guile/$(DEPDIR)/$*.Std +endif # Compile a .i file to what python needs .i.py: + @echo "Compile .i to .py" @test -d "python" || $(mkinstalldirs) "python" $(SWIG) $(STD_SWIG_PYTHON_ARGS) $($*_swig_args) \ - -MD -MF python/$(DEPDIR)/$*.Std \ -module $* -o python/$*.cc -oh python/$*.h $< - -- cgit From cf8f2a00c886b7c6980f7d1e3eac25eb37a12d3a Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Thu, 21 Oct 2010 12:13:48 -0600 Subject: move new suffix rules to common Makefile so everything can use them. --- gnuradio-core/src/lib/swig/Makefile.am | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 21bfe6761..5f5a12eb2 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -116,21 +116,3 @@ no_dist_files = $(swig_built_sources) # or even with -outdir guile in SWIG_GUILE_ARGS, swig keeps putting a # gnuradio_swig_py_*_wrap.cxx in the source directory. -## SWIG suffixes for automake to know about -SUFFIXES = .i .scm .pyvi - -if GUILE -.i.scm: - @echo "Compile .i to .scm" - @test -d "guile" || $(mkinstalldirs) "guile" - $(SWIG) $(STD_SWIG_GUILE_ARGS) $($*_swig_args) \ - -module $* -o guile/$*.cc $< -# -MD -MF guile/$(DEPDIR)/$*.Std -endif - -# Compile a .i file to what python needs -.i.py: - @echo "Compile .i to .py" - @test -d "python" || $(mkinstalldirs) "python" - $(SWIG) $(STD_SWIG_PYTHON_ARGS) $($*_swig_args) \ - -module $* -o python/$*.cc -oh python/$*.h $< -- cgit From aa162012cc25cf080ee744a2cb795a6154fcca86 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Thu, 21 Oct 2010 13:16:05 -0600 Subject: regenerated --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 6 ------ 1 file changed, 6 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index 54938187a..5846134a9 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -136,7 +136,6 @@ gnuradio_swig_py_runtime_guile_la_LDFLAGS = $(_gnuradio_swig_py_runtime_la_LDFLA gnuradio_swig_py_runtime_guile_la_CXXFLAGS = $(_gnuradio_swig_py_runtime_la_CXXFLAGS) guile/gnuradio_swig_py_runtime.lo: gnuradio_swig_py_runtime.lo -#gnuradio_swig_py_runtime.lo: gnuradio_swig_py_runtime.scm gnuradio_swig_py_runtime.scm: gnuradio_swig_py_runtime.i endif # end of GUILE @@ -284,7 +283,6 @@ gnuradio_swig_py_general_guile_la_LDFLAGS = $(_gnuradio_swig_py_general_la_LDFLA gnuradio_swig_py_general_guile_la_CXXFLAGS = $(_gnuradio_swig_py_general_la_CXXFLAGS) guile/gnuradio_swig_py_general.lo: gnuradio_swig_py_general.lo -#gnuradio_swig_py_general.lo: gnuradio_swig_py_general.scm gnuradio_swig_py_general.scm: gnuradio_swig_py_general.i endif # end of GUILE @@ -432,7 +430,6 @@ gnuradio_swig_py_gengen_guile_la_LDFLAGS = $(_gnuradio_swig_py_gengen_la_LDFLAGS gnuradio_swig_py_gengen_guile_la_CXXFLAGS = $(_gnuradio_swig_py_gengen_la_CXXFLAGS) guile/gnuradio_swig_py_gengen.lo: gnuradio_swig_py_gengen.lo -#gnuradio_swig_py_gengen.lo: gnuradio_swig_py_gengen.scm gnuradio_swig_py_gengen.scm: gnuradio_swig_py_gengen.i endif # end of GUILE @@ -580,7 +577,6 @@ gnuradio_swig_py_filter_guile_la_LDFLAGS = $(_gnuradio_swig_py_filter_la_LDFLAGS gnuradio_swig_py_filter_guile_la_CXXFLAGS = $(_gnuradio_swig_py_filter_la_CXXFLAGS) guile/gnuradio_swig_py_filter.lo: gnuradio_swig_py_filter.lo -#gnuradio_swig_py_filter.lo: gnuradio_swig_py_filter.scm gnuradio_swig_py_filter.scm: gnuradio_swig_py_filter.i endif # end of GUILE @@ -728,7 +724,6 @@ gnuradio_swig_py_io_guile_la_LDFLAGS = $(_gnuradio_swig_py_io_la_LDFLAGS) gnuradio_swig_py_io_guile_la_CXXFLAGS = $(_gnuradio_swig_py_io_la_CXXFLAGS) guile/gnuradio_swig_py_io.lo: gnuradio_swig_py_io.lo -#gnuradio_swig_py_io.lo: gnuradio_swig_py_io.scm gnuradio_swig_py_io.scm: gnuradio_swig_py_io.i endif # end of GUILE @@ -876,7 +871,6 @@ gnuradio_swig_py_hier_guile_la_LDFLAGS = $(_gnuradio_swig_py_hier_la_LDFLAGS) gnuradio_swig_py_hier_guile_la_CXXFLAGS = $(_gnuradio_swig_py_hier_la_CXXFLAGS) guile/gnuradio_swig_py_hier.lo: gnuradio_swig_py_hier.lo -#gnuradio_swig_py_hier.lo: gnuradio_swig_py_hier.scm gnuradio_swig_py_hier.scm: gnuradio_swig_py_hier.i endif # end of GUILE -- cgit From cba092c9daa285236cc2b5c4f61898f15ef0a589 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Thu, 21 Oct 2010 16:14:58 -0600 Subject: correct typo in script name --- gnuradio-core/src/lib/swig/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 5f5a12eb2..83d733f3e 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -43,7 +43,7 @@ swiginclude_HEADERS = \ # special install for this top-level Python script which includes all # of the split Python libraries. ourpythondir = $(grpythondir)/gr -ourpython_PYTHON = gnuradio_swig.py +ourpython_PYTHON = gnuradio_swig_python.py # 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 -- cgit From 827f95ce49fadfaeec1ee09185d1502074eb0bbb Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 22 Oct 2010 13:56:05 -0700 Subject: Add stub for gnuradio_swig.scm to get make to work --- gnuradio-core/src/lib/swig/gnuradio_swig.scm | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 gnuradio-core/src/lib/swig/gnuradio_swig.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig.scm b/gnuradio-core/src/lib/swig/gnuradio_swig.scm new file mode 100644 index 000000000..961564d68 --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio_swig.scm @@ -0,0 +1,13 @@ +;;; +;;; Not sure that we need this for guile or not. +;;; We'll need to assemble the (gnuradio gr) module somewhere... +;;; + +;; # This file implements the old gnuradio_swig_python namespace +;; +;; from gnuradio_swig_py_runtime import * +;; from gnuradio_swig_py_general import * +;; from gnuradio_swig_py_gengen import * +;; from gnuradio_swig_py_filter import * +;; from gnuradio_swig_py_io import * +;; from gnuradio_swig_py_hier import * -- cgit From e3ea18ee8732f17151bb00896f982f7859c0e228 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 22 Oct 2010 14:01:49 -0700 Subject: Move TOP_SWIG_IFILES outside of if PYTHON --- gnuradio-core/src/lib/swig/Makefile.am | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 83d733f3e..4c15b7e61 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -28,6 +28,22 @@ if GUILE CLEANFILES += guile/gnuradio* endif +# ---------------------------------------------------------------- +# We've split the previously monstrous gnuradio_swig_python into 6 +# smaller pieces. This reduces compile time coupling and creates +# smaller pieces for the compiler to digest. prior to this change, on +# X86_64, g++'s resident set size was 650MB! +# ---------------------------------------------------------------- + +TOP_SWIG_IFILES = \ + gnuradio_swig_py_runtime.i \ + gnuradio_swig_py_general.i \ + gnuradio_swig_py_gengen.i \ + gnuradio_swig_py_filter.i \ + gnuradio_swig_py_io.i \ + gnuradio_swig_py_hier.i + + if PYTHON AM_CPPFLAGS = -I$(srcdir) $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \ $(WITH_INCLUDES) @@ -60,21 +76,6 @@ gnuradio_swig_bug_workaround.h : gnuradio_swig_py_runtime.py $(srcdir)/gen-swig- # C/C++ headers get installed in ${prefix}/include/gnuradio grinclude_HEADERS = gnuradio_swig_bug_workaround.h -# ---------------------------------------------------------------- -# We've split the previously monstrous gnuradio_swig_python into 6 -# smaller pieces. This reduces compile time coupling and creates -# smaller pieces for the compiler to digest. prior to this change, on -# X86_64, g++'s resident set size was 650MB! -# ---------------------------------------------------------------- - -TOP_SWIG_IFILES = \ - gnuradio_swig_py_runtime.i \ - gnuradio_swig_py_general.i \ - gnuradio_swig_py_gengen.i \ - gnuradio_swig_py_filter.i \ - gnuradio_swig_py_io.i \ - gnuradio_swig_py_hier.i - # Install so that they end up available as: # import gnuradio.gr # This ends up at: -- cgit From b61a156d4d3125882bfa3563ebd4a992ba00a6f7 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 22 Oct 2010 15:14:44 -0700 Subject: Move common stuff outside of if PYTHON --- gnuradio-core/src/lib/swig/Makefile.am | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 4c15b7e61..f96352d1a 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -44,28 +44,32 @@ TOP_SWIG_IFILES = \ gnuradio_swig_py_hier.i -if PYTHON -AM_CPPFLAGS = -I$(srcdir) $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \ - $(WITH_INCLUDES) - -EXTRA_DIST = gen-swig-bug-fix - # SWIG headers get installed in ${prefix}/include/gnuradio/swig swiginclude_HEADERS = \ gnuradio.i \ gr_swig_block_magic.i \ gr_shared_ptr.i -# special install for this top-level Python script which includes all -# of the split Python libraries. -ourpythondir = $(grpythondir)/gr -ourpython_PYTHON = gnuradio_swig_python.py +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. guiledir = @GUILE_PKDATADIR@ guile_DATA = gnuradio_swig.scm +endif + + +if PYTHON +AM_CPPFLAGS = -I$(srcdir) $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \ + $(WITH_INCLUDES) + +EXTRA_DIST = gen-swig-bug-fix + +# special install for this top-level Python script which includes all +# of the split Python libraries. +ourpythondir = $(grpythondir)/gr +ourpython_PYTHON = gnuradio_swig_python.py # ---------------------------------------------------------------- # FIXME As of swig 1.3.31, this still seems to be required... -- cgit From 00ba420478fb0e328fa93e795ea0c80e7de63534 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 22 Oct 2010 15:14:57 -0700 Subject: Move #ifdef SWIGPYTHON outside of %define There's apparently a time-of-evaluation issue here. The docs say they reevaluate the contents of %define at expansion time. Apparently SWIGPYTHON et al. aren't defined in whatever scope that may be. --- gnuradio-core/src/lib/swig/gr_swig_block_magic.i | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i index 99e01b0ef..e2ddaeedd 100644 --- a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i +++ b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i @@ -24,22 +24,27 @@ _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, PKG ## _ ## BASE_NAME, BASE_NAME) %enddef -%define _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, NAME, BASE_NAME) +%define _GR_SWIG_BLOCK_MAGIC_HELPER_COMMON(PKG, NAME, BASE_NAME) class NAME; typedef boost::shared_ptr NAME ## _sptr; %template(NAME ## _sptr) boost::shared_ptr; %rename(BASE_NAME) PKG ## _make_ ## BASE_NAME; +%ignore NAME; +%enddef #ifdef SWIGPYTHON +%define _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, NAME, BASE_NAME) +_GR_SWIG_BLOCK_MAGIC_HELPER_COMMON(PKG, NAME, BASE_NAME) %pythoncode %{ NAME ## _sptr.block = lambda self: NAME ## _block (self) NAME ## _sptr.__repr__ = lambda self: "" % (self.name(), self.unique_id ()) %} -#endif - -%ignore NAME; %enddef +#endif #ifdef SWIGGUILE +%define _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, NAME, BASE_NAME) +_GR_SWIG_BLOCK_MAGIC_HELPER_COMMON(PKG, NAME, BASE_NAME) #warning "gr_block_sptr needs to be implemented!" +%enddef #endif -- cgit From 0b80f3a41fa4ef358d0294f4b9fcae411611ec12 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 22 Oct 2010 15:16:46 -0700 Subject: Remove dead and broken code from GR_SWIG_BLOCK_MAGIC. Looks like this hasn't been used since we converted the hier_block stuff to C++, and it's been broken since then. --- gnuradio-core/src/lib/swig/gr_swig_block_magic.i | 1 - 1 file changed, 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i index e2ddaeedd..7adccf28a 100644 --- a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i +++ b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i @@ -36,7 +36,6 @@ typedef boost::shared_ptr NAME ## _sptr; %define _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, NAME, BASE_NAME) _GR_SWIG_BLOCK_MAGIC_HELPER_COMMON(PKG, NAME, BASE_NAME) %pythoncode %{ -NAME ## _sptr.block = lambda self: NAME ## _block (self) NAME ## _sptr.__repr__ = lambda self: "" % (self.name(), self.unique_id ()) %} %enddef -- cgit From 1b95d66c179048b086ee8aa6a75a23d1edc006dc Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 22 Oct 2010 21:56:51 -0700 Subject: Set new install locations for guile scm code and libraries. I think we may want to rename the guile .so's and install them into libdir instead... --- gnuradio-core/src/lib/swig/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index f96352d1a..67d188957 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -55,8 +55,7 @@ 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. -guiledir = @GUILE_PKDATADIR@ -guile_DATA = gnuradio_swig.scm +grguile_DATA = gnuradio_swig.scm endif -- cgit From 98c246e264092c306c276b639d8c839b83fd64ec Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 22 Oct 2010 21:59:45 -0700 Subject: Remove leading _ from guile library names coded into .i files --- gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i index 42e46d444..cb9eb35a7 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i @@ -31,6 +31,6 @@ #if SWIGGUILE %scheme %{ -(load-extension "_gnuradio_swig_py_filter_guile" "SWIG_init") +(load-extension "gnuradio_swig_py_filter_guile" "SWIG_init") %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i index dcf284ab3..05ed69d31 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i @@ -31,6 +31,6 @@ #if SWIGGUILE %scheme %{ -(load-extension "_gnuradio_swig_py_general_guile" "SWIG_init") +(load-extension "gnuradio_swig_py_general_guile" "SWIG_init") %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i index ee18abc18..64b9c804d 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i @@ -31,6 +31,6 @@ #if SWIGGUILE %scheme %{ -(load-extension "_gnuradio_swig_py_gengen_guile" "SWIG_init") +(load-extension "gnuradio_swig_py_gengen_guile" "SWIG_init") %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i index 36ee3c40d..c3bf32d6a 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i @@ -31,6 +31,6 @@ #if SWIGGUILE %scheme %{ -(load-extension "_gnuradio_swig_py_heir_guile" "SWIG_init") +(load-extension "gnuradio_swig_py_heir_guile" "SWIG_init") %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i index cb8509b10..c3ed7c6ba 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i @@ -31,6 +31,6 @@ #if SWIGGUILE %scheme %{ -(load-extension "_gnuradio_swig_py_io_guile" "SWIG_init") +(load-extension "gnuradio_swig_py_io_guile" "SWIG_init") %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i index a3ab8d012..f8eff1189 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i @@ -34,6 +34,6 @@ #if SWIGGUILE %scheme %{ -(load-extension "_gnuradio_swig_py_runtime_guile" "SWIG_init") +(load-extension "gnuradio_swig_py_runtime_guile" "SWIG_init") %} #endif -- cgit From 1e34972f4433cbfef3500fc73a285c7c436cfd6b Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 22 Oct 2010 22:00:09 -0700 Subject: Rengenerate Makefile.swig.gen's --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 30 +++++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index 5846134a9..032d13857 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -41,12 +41,12 @@ gnuradio_swig_py_runtime_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_runtime_pyli # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_runtime_scmlibdir = @GUILE_PKLIBDIR@/gnuradio +gnuradio_swig_py_runtime_scmlibdir = $(libdir)/guile/gnuradio # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_swig_py_runtime # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_runtime_scmdir = @GUILE_PKDATADIR@/gnuradio +gnuradio_swig_py_runtime_scmdir = $(guiledir)/gnuradio ## SWIG headers are always installed into the same directory. @@ -144,6 +144,7 @@ python/gnuradio_swig_py_runtime.lo: gnuradio_swig_py_runtime.lo: gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime.scm gnuradio_swig_py_runtime.py: gnuradio_swig_py_runtime.i +-include python/gnuradio_swig_py_runtime.d # -*- Makefile -*- # @@ -188,12 +189,12 @@ gnuradio_swig_py_general_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_general_pyli # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_general_scmlibdir = @GUILE_PKLIBDIR@/gnuradio +gnuradio_swig_py_general_scmlibdir = $(libdir)/guile/gnuradio # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_swig_py_general # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_general_scmdir = @GUILE_PKDATADIR@/gnuradio +gnuradio_swig_py_general_scmdir = $(guiledir)/gnuradio ## SWIG headers are always installed into the same directory. @@ -291,6 +292,7 @@ python/gnuradio_swig_py_general.lo: gnuradio_swig_py_general.lo: gnuradio_swig_py_general.py gnuradio_swig_py_general.scm gnuradio_swig_py_general.py: gnuradio_swig_py_general.i +-include python/gnuradio_swig_py_general.d # -*- Makefile -*- # @@ -335,12 +337,12 @@ gnuradio_swig_py_gengen_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_gengen_pylibd # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_gengen_scmlibdir = @GUILE_PKLIBDIR@/gnuradio +gnuradio_swig_py_gengen_scmlibdir = $(libdir)/guile/gnuradio # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_swig_py_gengen # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_gengen_scmdir = @GUILE_PKDATADIR@/gnuradio +gnuradio_swig_py_gengen_scmdir = $(guiledir)/gnuradio ## SWIG headers are always installed into the same directory. @@ -438,6 +440,7 @@ python/gnuradio_swig_py_gengen.lo: gnuradio_swig_py_gengen.lo: gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen.scm gnuradio_swig_py_gengen.py: gnuradio_swig_py_gengen.i +-include python/gnuradio_swig_py_gengen.d # -*- Makefile -*- # @@ -482,12 +485,12 @@ gnuradio_swig_py_filter_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_filter_pylibd # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_filter_scmlibdir = @GUILE_PKLIBDIR@/gnuradio +gnuradio_swig_py_filter_scmlibdir = $(libdir)/guile/gnuradio # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_swig_py_filter # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_filter_scmdir = @GUILE_PKDATADIR@/gnuradio +gnuradio_swig_py_filter_scmdir = $(guiledir)/gnuradio ## SWIG headers are always installed into the same directory. @@ -585,6 +588,7 @@ python/gnuradio_swig_py_filter.lo: gnuradio_swig_py_filter.lo: gnuradio_swig_py_filter.py gnuradio_swig_py_filter.scm gnuradio_swig_py_filter.py: gnuradio_swig_py_filter.i +-include python/gnuradio_swig_py_filter.d # -*- Makefile -*- # @@ -629,12 +633,12 @@ gnuradio_swig_py_io_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_io_pylibdir_categ # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_io_scmlibdir = @GUILE_PKLIBDIR@/gnuradio +gnuradio_swig_py_io_scmlibdir = $(libdir)/guile/gnuradio # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_swig_py_io # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_io_scmdir = @GUILE_PKDATADIR@/gnuradio +gnuradio_swig_py_io_scmdir = $(guiledir)/gnuradio ## SWIG headers are always installed into the same directory. @@ -732,6 +736,7 @@ python/gnuradio_swig_py_io.lo: gnuradio_swig_py_io.lo: gnuradio_swig_py_io.py gnuradio_swig_py_io.scm gnuradio_swig_py_io.py: gnuradio_swig_py_io.i +-include python/gnuradio_swig_py_io.d # -*- Makefile -*- # @@ -776,12 +781,12 @@ gnuradio_swig_py_hier_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_hier_pylibdir_c # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_hier_scmlibdir = @GUILE_PKLIBDIR@/gnuradio +gnuradio_swig_py_hier_scmlibdir = $(libdir)/guile/gnuradio # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_swig_py_hier # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_hier_scmdir = @GUILE_PKDATADIR@/gnuradio +gnuradio_swig_py_hier_scmdir = $(guiledir)/gnuradio ## SWIG headers are always installed into the same directory. @@ -879,4 +884,5 @@ python/gnuradio_swig_py_hier.lo: gnuradio_swig_py_hier.lo: gnuradio_swig_py_hier.py gnuradio_swig_py_hier.scm gnuradio_swig_py_hier.py: gnuradio_swig_py_hier.i +-include python/gnuradio_swig_py_hier.d -- cgit From 6b5c73eb36bb45fc214616104c0a6c675dbce538 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 22 Oct 2010 22:20:26 -0700 Subject: Remove #warning from gr_swig_block_magic.i --- gnuradio-core/src/lib/swig/gr_swig_block_magic.i | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i index 7adccf28a..ea6368fd4 100644 --- a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i +++ b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i @@ -44,6 +44,6 @@ NAME ## _sptr.__repr__ = lambda self: "" % (self.name(), self. #ifdef SWIGGUILE %define _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, NAME, BASE_NAME) _GR_SWIG_BLOCK_MAGIC_HELPER_COMMON(PKG, NAME, BASE_NAME) -#warning "gr_block_sptr needs to be implemented!" +/* FIXME May want to add something here to get a friendlier printed representation */ %enddef #endif -- cgit From fba8a45e81a718280e9364d30d4224d589ff171d Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 22 Oct 2010 23:25:21 -0700 Subject: Rename guile libs to libguile-* and install them in $(libdir). This follows the Guile recommendations and should remove the need for adding an additional directory to LD_LIBRARY_PATH. --- gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i index cb9eb35a7..e40af08ca 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i @@ -31,6 +31,6 @@ #if SWIGGUILE %scheme %{ -(load-extension "gnuradio_swig_py_filter_guile" "SWIG_init") +(load-extension "libguile-gnuradio_swig_py_filter" "SWIG_init") %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i index 05ed69d31..c4e9c070d 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i @@ -31,6 +31,6 @@ #if SWIGGUILE %scheme %{ -(load-extension "gnuradio_swig_py_general_guile" "SWIG_init") +(load-extension "libguile-gnuradio_swig_py_general" "SWIG_init") %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i index 64b9c804d..54e1b0944 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i @@ -31,6 +31,6 @@ #if SWIGGUILE %scheme %{ -(load-extension "gnuradio_swig_py_gengen_guile" "SWIG_init") +(load-extension "libguile-gnuradio_swig_py_gengen" "SWIG_init") %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i index c3bf32d6a..61029b120 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i @@ -31,6 +31,6 @@ #if SWIGGUILE %scheme %{ -(load-extension "gnuradio_swig_py_heir_guile" "SWIG_init") +(load-extension "libguile-gnuradio_swig_py_heir" "SWIG_init") %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i index c3ed7c6ba..d7d206ef8 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i @@ -31,6 +31,6 @@ #if SWIGGUILE %scheme %{ -(load-extension "gnuradio_swig_py_io_guile" "SWIG_init") +(load-extension "libguile-gnuradio_swig_py_io" "SWIG_init") %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i index f8eff1189..088ae4cf8 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i @@ -34,6 +34,6 @@ #if SWIGGUILE %scheme %{ -(load-extension "gnuradio_swig_py_runtime_guile" "SWIG_init") +(load-extension "libguile-gnuradio_swig_py_runtime" "SWIG_init") %} #endif -- cgit From 6421d47062f4bf5abbdf26142616a5965f1edfa0 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 22 Oct 2010 23:28:06 -0700 Subject: regenerate --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 72 ++++++++++++++-------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index 032d13857..39afc8973 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -41,7 +41,7 @@ gnuradio_swig_py_runtime_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_runtime_pyli # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_runtime_scmlibdir = $(libdir)/guile/gnuradio +gnuradio_swig_py_runtime_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_swig_py_runtime @@ -124,16 +124,16 @@ gnuradio_swig_py_runtime_python_PYTHON = \ $(gnuradio_swig_py_runtime) if GUILE -gnuradio_swig_py_runtime_scmlib_LTLIBRARIES = gnuradio_swig_py_runtime_guile.la -gnuradio_swig_py_runtime_guile_la_SOURCES = \ +gnuradio_swig_py_runtime_scmlib_LTLIBRARIES = libguile-gnuradio_swig_py_runtime.la +libguile_gnuradio_swig_py_runtime_la_SOURCES = \ guile/gnuradio_swig_py_runtime.cc \ $(gnuradio_swig_py_runtime_la_swig_sources) gnuradio_swig_py_runtime_scm_DATA = gnuradio_swig_py_runtime.scm # Guile can use the same flags as python does -gnuradio_swig_py_runtime_guile_la_LIBADD = $(_gnuradio_swig_py_runtime_la_LIBADD) -gnuradio_swig_py_runtime_guile_la_LDFLAGS = $(_gnuradio_swig_py_runtime_la_LDFLAGS) -gnuradio_swig_py_runtime_guile_la_CXXFLAGS = $(_gnuradio_swig_py_runtime_la_CXXFLAGS) +libguile_gnuradio_swig_py_runtime_la_LIBADD = $(_gnuradio_swig_py_runtime_la_LIBADD) +libguile_gnuradio_swig_py_runtime_la_LDFLAGS = $(_gnuradio_swig_py_runtime_la_LDFLAGS) +libguile_gnuradio_swig_py_runtime_la_CXXFLAGS = $(_gnuradio_swig_py_runtime_la_CXXFLAGS) guile/gnuradio_swig_py_runtime.lo: gnuradio_swig_py_runtime.lo gnuradio_swig_py_runtime.scm: gnuradio_swig_py_runtime.i @@ -189,7 +189,7 @@ gnuradio_swig_py_general_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_general_pyli # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_general_scmlibdir = $(libdir)/guile/gnuradio +gnuradio_swig_py_general_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_swig_py_general @@ -272,16 +272,16 @@ gnuradio_swig_py_general_python_PYTHON = \ $(gnuradio_swig_py_general) if GUILE -gnuradio_swig_py_general_scmlib_LTLIBRARIES = gnuradio_swig_py_general_guile.la -gnuradio_swig_py_general_guile_la_SOURCES = \ +gnuradio_swig_py_general_scmlib_LTLIBRARIES = libguile-gnuradio_swig_py_general.la +libguile_gnuradio_swig_py_general_la_SOURCES = \ guile/gnuradio_swig_py_general.cc \ $(gnuradio_swig_py_general_la_swig_sources) gnuradio_swig_py_general_scm_DATA = gnuradio_swig_py_general.scm # Guile can use the same flags as python does -gnuradio_swig_py_general_guile_la_LIBADD = $(_gnuradio_swig_py_general_la_LIBADD) -gnuradio_swig_py_general_guile_la_LDFLAGS = $(_gnuradio_swig_py_general_la_LDFLAGS) -gnuradio_swig_py_general_guile_la_CXXFLAGS = $(_gnuradio_swig_py_general_la_CXXFLAGS) +libguile_gnuradio_swig_py_general_la_LIBADD = $(_gnuradio_swig_py_general_la_LIBADD) +libguile_gnuradio_swig_py_general_la_LDFLAGS = $(_gnuradio_swig_py_general_la_LDFLAGS) +libguile_gnuradio_swig_py_general_la_CXXFLAGS = $(_gnuradio_swig_py_general_la_CXXFLAGS) guile/gnuradio_swig_py_general.lo: gnuradio_swig_py_general.lo gnuradio_swig_py_general.scm: gnuradio_swig_py_general.i @@ -337,7 +337,7 @@ gnuradio_swig_py_gengen_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_gengen_pylibd # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_gengen_scmlibdir = $(libdir)/guile/gnuradio +gnuradio_swig_py_gengen_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_swig_py_gengen @@ -420,16 +420,16 @@ gnuradio_swig_py_gengen_python_PYTHON = \ $(gnuradio_swig_py_gengen) if GUILE -gnuradio_swig_py_gengen_scmlib_LTLIBRARIES = gnuradio_swig_py_gengen_guile.la -gnuradio_swig_py_gengen_guile_la_SOURCES = \ +gnuradio_swig_py_gengen_scmlib_LTLIBRARIES = libguile-gnuradio_swig_py_gengen.la +libguile_gnuradio_swig_py_gengen_la_SOURCES = \ guile/gnuradio_swig_py_gengen.cc \ $(gnuradio_swig_py_gengen_la_swig_sources) gnuradio_swig_py_gengen_scm_DATA = gnuradio_swig_py_gengen.scm # Guile can use the same flags as python does -gnuradio_swig_py_gengen_guile_la_LIBADD = $(_gnuradio_swig_py_gengen_la_LIBADD) -gnuradio_swig_py_gengen_guile_la_LDFLAGS = $(_gnuradio_swig_py_gengen_la_LDFLAGS) -gnuradio_swig_py_gengen_guile_la_CXXFLAGS = $(_gnuradio_swig_py_gengen_la_CXXFLAGS) +libguile_gnuradio_swig_py_gengen_la_LIBADD = $(_gnuradio_swig_py_gengen_la_LIBADD) +libguile_gnuradio_swig_py_gengen_la_LDFLAGS = $(_gnuradio_swig_py_gengen_la_LDFLAGS) +libguile_gnuradio_swig_py_gengen_la_CXXFLAGS = $(_gnuradio_swig_py_gengen_la_CXXFLAGS) guile/gnuradio_swig_py_gengen.lo: gnuradio_swig_py_gengen.lo gnuradio_swig_py_gengen.scm: gnuradio_swig_py_gengen.i @@ -485,7 +485,7 @@ gnuradio_swig_py_filter_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_filter_pylibd # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_filter_scmlibdir = $(libdir)/guile/gnuradio +gnuradio_swig_py_filter_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_swig_py_filter @@ -568,16 +568,16 @@ gnuradio_swig_py_filter_python_PYTHON = \ $(gnuradio_swig_py_filter) if GUILE -gnuradio_swig_py_filter_scmlib_LTLIBRARIES = gnuradio_swig_py_filter_guile.la -gnuradio_swig_py_filter_guile_la_SOURCES = \ +gnuradio_swig_py_filter_scmlib_LTLIBRARIES = libguile-gnuradio_swig_py_filter.la +libguile_gnuradio_swig_py_filter_la_SOURCES = \ guile/gnuradio_swig_py_filter.cc \ $(gnuradio_swig_py_filter_la_swig_sources) gnuradio_swig_py_filter_scm_DATA = gnuradio_swig_py_filter.scm # Guile can use the same flags as python does -gnuradio_swig_py_filter_guile_la_LIBADD = $(_gnuradio_swig_py_filter_la_LIBADD) -gnuradio_swig_py_filter_guile_la_LDFLAGS = $(_gnuradio_swig_py_filter_la_LDFLAGS) -gnuradio_swig_py_filter_guile_la_CXXFLAGS = $(_gnuradio_swig_py_filter_la_CXXFLAGS) +libguile_gnuradio_swig_py_filter_la_LIBADD = $(_gnuradio_swig_py_filter_la_LIBADD) +libguile_gnuradio_swig_py_filter_la_LDFLAGS = $(_gnuradio_swig_py_filter_la_LDFLAGS) +libguile_gnuradio_swig_py_filter_la_CXXFLAGS = $(_gnuradio_swig_py_filter_la_CXXFLAGS) guile/gnuradio_swig_py_filter.lo: gnuradio_swig_py_filter.lo gnuradio_swig_py_filter.scm: gnuradio_swig_py_filter.i @@ -633,7 +633,7 @@ gnuradio_swig_py_io_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_io_pylibdir_categ # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_io_scmlibdir = $(libdir)/guile/gnuradio +gnuradio_swig_py_io_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_swig_py_io @@ -716,16 +716,16 @@ gnuradio_swig_py_io_python_PYTHON = \ $(gnuradio_swig_py_io) if GUILE -gnuradio_swig_py_io_scmlib_LTLIBRARIES = gnuradio_swig_py_io_guile.la -gnuradio_swig_py_io_guile_la_SOURCES = \ +gnuradio_swig_py_io_scmlib_LTLIBRARIES = libguile-gnuradio_swig_py_io.la +libguile_gnuradio_swig_py_io_la_SOURCES = \ guile/gnuradio_swig_py_io.cc \ $(gnuradio_swig_py_io_la_swig_sources) gnuradio_swig_py_io_scm_DATA = gnuradio_swig_py_io.scm # Guile can use the same flags as python does -gnuradio_swig_py_io_guile_la_LIBADD = $(_gnuradio_swig_py_io_la_LIBADD) -gnuradio_swig_py_io_guile_la_LDFLAGS = $(_gnuradio_swig_py_io_la_LDFLAGS) -gnuradio_swig_py_io_guile_la_CXXFLAGS = $(_gnuradio_swig_py_io_la_CXXFLAGS) +libguile_gnuradio_swig_py_io_la_LIBADD = $(_gnuradio_swig_py_io_la_LIBADD) +libguile_gnuradio_swig_py_io_la_LDFLAGS = $(_gnuradio_swig_py_io_la_LDFLAGS) +libguile_gnuradio_swig_py_io_la_CXXFLAGS = $(_gnuradio_swig_py_io_la_CXXFLAGS) guile/gnuradio_swig_py_io.lo: gnuradio_swig_py_io.lo gnuradio_swig_py_io.scm: gnuradio_swig_py_io.i @@ -781,7 +781,7 @@ gnuradio_swig_py_hier_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_hier_pylibdir_c # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_hier_scmlibdir = $(libdir)/guile/gnuradio +gnuradio_swig_py_hier_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_swig_py_hier @@ -864,16 +864,16 @@ gnuradio_swig_py_hier_python_PYTHON = \ $(gnuradio_swig_py_hier) if GUILE -gnuradio_swig_py_hier_scmlib_LTLIBRARIES = gnuradio_swig_py_hier_guile.la -gnuradio_swig_py_hier_guile_la_SOURCES = \ +gnuradio_swig_py_hier_scmlib_LTLIBRARIES = libguile-gnuradio_swig_py_hier.la +libguile_gnuradio_swig_py_hier_la_SOURCES = \ guile/gnuradio_swig_py_hier.cc \ $(gnuradio_swig_py_hier_la_swig_sources) gnuradio_swig_py_hier_scm_DATA = gnuradio_swig_py_hier.scm # Guile can use the same flags as python does -gnuradio_swig_py_hier_guile_la_LIBADD = $(_gnuradio_swig_py_hier_la_LIBADD) -gnuradio_swig_py_hier_guile_la_LDFLAGS = $(_gnuradio_swig_py_hier_la_LDFLAGS) -gnuradio_swig_py_hier_guile_la_CXXFLAGS = $(_gnuradio_swig_py_hier_la_CXXFLAGS) +libguile_gnuradio_swig_py_hier_la_LIBADD = $(_gnuradio_swig_py_hier_la_LIBADD) +libguile_gnuradio_swig_py_hier_la_LDFLAGS = $(_gnuradio_swig_py_hier_la_LDFLAGS) +libguile_gnuradio_swig_py_hier_la_CXXFLAGS = $(_gnuradio_swig_py_hier_la_CXXFLAGS) guile/gnuradio_swig_py_hier.lo: gnuradio_swig_py_hier.lo gnuradio_swig_py_hier.scm: gnuradio_swig_py_hier.i -- cgit From c8e09b545e84194867e971163c899ab0992430fb Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 23 Oct 2010 11:02:01 -0700 Subject: s/_swig_py_/_core_/g --- gnuradio-core/src/lib/swig/.gitignore | 94 +++++++++++----------- gnuradio-core/src/lib/swig/Makefile.am | 44 +++++----- gnuradio-core/src/lib/swig/gnuradio_core_filter.i | 36 +++++++++ gnuradio-core/src/lib/swig/gnuradio_core_general.i | 36 +++++++++ gnuradio-core/src/lib/swig/gnuradio_core_gengen.i | 36 +++++++++ gnuradio-core/src/lib/swig/gnuradio_core_hier.i | 36 +++++++++ gnuradio-core/src/lib/swig/gnuradio_core_io.i | 36 +++++++++ gnuradio-core/src/lib/swig/gnuradio_core_runtime.i | 39 +++++++++ .../src/lib/swig/gnuradio_swig_py_filter.i | 36 --------- .../src/lib/swig/gnuradio_swig_py_general.i | 36 --------- .../src/lib/swig/gnuradio_swig_py_gengen.i | 36 --------- gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i | 36 --------- gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i | 36 --------- .../src/lib/swig/gnuradio_swig_py_runtime.i | 39 --------- gnuradio-core/src/lib/swig/gnuradio_swig_python.py | 14 ++-- 15 files changed, 295 insertions(+), 295 deletions(-) create mode 100644 gnuradio-core/src/lib/swig/gnuradio_core_filter.i create mode 100644 gnuradio-core/src/lib/swig/gnuradio_core_general.i create mode 100644 gnuradio-core/src/lib/swig/gnuradio_core_gengen.i create mode 100644 gnuradio-core/src/lib/swig/gnuradio_core_hier.i create mode 100644 gnuradio-core/src/lib/swig/gnuradio_core_io.i create mode 100644 gnuradio-core/src/lib/swig/gnuradio_core_runtime.i delete mode 100644 gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i delete mode 100644 gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i delete mode 100644 gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i delete mode 100644 gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i delete mode 100644 gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i delete mode 100644 gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/.gitignore b/gnuradio-core/src/lib/swig/.gitignore index 5c514650d..0018a2a54 100644 --- a/gnuradio-core/src/lib/swig/.gitignore +++ b/gnuradio-core/src/lib/swig/.gitignore @@ -10,51 +10,51 @@ /swigrun.py /swigrun_wrap.c /Makefile.swigdeps.new -/gnuradio_swig_py_runtime.d -/gnuradio_swig_py_general.d -/gnuradio_swig_py_gengen.d -/gnuradio_swig_py_filter.d -/gnuradio_swig_py_io.d +/gnuradio_core_runtime.d +/gnuradio_core_general.d +/gnuradio_core_gengen.d +/gnuradio_core_filter.d +/gnuradio_core_io.d /gnuradio_swig_bug_workaround.h -/gnuradio_swig_py_runtime.cc -/gnuradio_swig_py_runtime.h -/gnuradio_swig_py_runtime.py -/gnuradio_swig_py_general.cc -/gnuradio_swig_py_general.h -/gnuradio_swig_py_general.py -/gnuradio_swig_py_gengen.cc -/gnuradio_swig_py_gengen.h -/gnuradio_swig_py_gengen.py -/gnuradio_swig_py_filter.cc -/gnuradio_swig_py_filter.h -/gnuradio_swig_py_filter.py -/gnuradio_swig_py_io.cc -/gnuradio_swig_py_io.h -/gnuradio_swig_py_io.py -/gnuradio_swig_py_hier.cc -/gnuradio_swig_py_hier.h -/gnuradio_swig_py_hier.py -/gnuradio_swig_py_filter_python.cc -/gnuradio_swig_py_filter_python.h -/gnuradio_swig_py_general_python.cc -/gnuradio_swig_py_general_python.h -/gnuradio_swig_py_gengen_python.cc -/gnuradio_swig_py_gengen_python.h -/gnuradio_swig_py_hier_python.cc -/gnuradio_swig_py_hier_python.h -/gnuradio_swig_py_io_python.cc -/gnuradio_swig_py_io_python.h -/gnuradio_swig_py_runtime_python.cc -/gnuradio_swig_py_runtime_python.h -/gnuradio_swig_py_filter.scm -/gnuradio_swig_py_filter_guile.cc -/gnuradio_swig_py_general.scm -/gnuradio_swig_py_general_guile.cc -/gnuradio_swig_py_gengen.scm -/gnuradio_swig_py_gengen_guile.cc -/gnuradio_swig_py_hier.scm -/gnuradio_swig_py_hier_guile.cc -/gnuradio_swig_py_io.scm -/gnuradio_swig_py_io_guile.cc -/gnuradio_swig_py_runtime.scm -/gnuradio_swig_py_runtime_guile.cc +/gnuradio_core_runtime.cc +/gnuradio_core_runtime.h +/gnuradio_core_runtime.py +/gnuradio_core_general.cc +/gnuradio_core_general.h +/gnuradio_core_general.py +/gnuradio_core_gengen.cc +/gnuradio_core_gengen.h +/gnuradio_core_gengen.py +/gnuradio_core_filter.cc +/gnuradio_core_filter.h +/gnuradio_core_filter.py +/gnuradio_core_io.cc +/gnuradio_core_io.h +/gnuradio_core_io.py +/gnuradio_core_hier.cc +/gnuradio_core_hier.h +/gnuradio_core_hier.py +/gnuradio_core_filter_python.cc +/gnuradio_core_filter_python.h +/gnuradio_core_general_python.cc +/gnuradio_core_general_python.h +/gnuradio_core_gengen_python.cc +/gnuradio_core_gengen_python.h +/gnuradio_core_hier_python.cc +/gnuradio_core_hier_python.h +/gnuradio_core_io_python.cc +/gnuradio_core_io_python.h +/gnuradio_core_runtime_python.cc +/gnuradio_core_runtime_python.h +/gnuradio_core_filter.scm +/gnuradio_core_filter_guile.cc +/gnuradio_core_general.scm +/gnuradio_core_general_guile.cc +/gnuradio_core_gengen.scm +/gnuradio_core_gengen_guile.cc +/gnuradio_core_hier.scm +/gnuradio_core_hier_guile.cc +/gnuradio_core_io.scm +/gnuradio_core_io_guile.cc +/gnuradio_core_runtime.scm +/gnuradio_core_runtime_guile.cc diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 67d188957..f354efe0b 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -35,13 +35,13 @@ endif # X86_64, g++'s resident set size was 650MB! # ---------------------------------------------------------------- -TOP_SWIG_IFILES = \ - gnuradio_swig_py_runtime.i \ - gnuradio_swig_py_general.i \ - gnuradio_swig_py_gengen.i \ - gnuradio_swig_py_filter.i \ - gnuradio_swig_py_io.i \ - gnuradio_swig_py_hier.i +TOP_SWIG_IFILES = \ + gnuradio_core_runtime.i \ + gnuradio_core_general.i \ + gnuradio_core_gengen.i \ + gnuradio_core_filter.i \ + gnuradio_core_io.i \ + gnuradio_core_hier.i # SWIG headers get installed in ${prefix}/include/gnuradio/swig @@ -73,8 +73,8 @@ ourpython_PYTHON = gnuradio_swig_python.py # ---------------------------------------------------------------- # FIXME As of swig 1.3.31, this still seems to be required... -gnuradio_swig_bug_workaround.h : gnuradio_swig_py_runtime.py $(srcdir)/gen-swig-bug-fix - $(PYTHON) $(srcdir)/gen-swig-bug-fix python/gnuradio_swig_py_runtime.cc $@ +gnuradio_swig_bug_workaround.h : gnuradio_core_runtime.py $(srcdir)/gen-swig-bug-fix + $(PYTHON) $(srcdir)/gen-swig-bug-fix python/gnuradio_core_runtime.cc $@ # C/C++ headers get installed in ${prefix}/include/gnuradio grinclude_HEADERS = gnuradio_swig_bug_workaround.h @@ -83,20 +83,20 @@ grinclude_HEADERS = gnuradio_swig_bug_workaround.h # import gnuradio.gr # This ends up at: # ${prefix}/lib/python${python_version}/site-packages/gnuradio/gr -gnuradio_swig_py_runtime_pythondir_category = gnuradio/gr -gnuradio_swig_py_general_pythondir_category = gnuradio/gr -gnuradio_swig_py_gengen_pythondir_category = gnuradio/gr -gnuradio_swig_py_filter_pythondir_category = gnuradio/gr -gnuradio_swig_py_io_pythondir_category = gnuradio/gr -gnuradio_swig_py_hier_pythondir_category = gnuradio/gr +gnuradio_core_runtime_pythondir_category = gnuradio/gr +gnuradio_core_general_pythondir_category = gnuradio/gr +gnuradio_core_gengen_pythondir_category = gnuradio/gr +gnuradio_core_filter_pythondir_category = gnuradio/gr +gnuradio_core_io_pythondir_category = gnuradio/gr +gnuradio_core_hier_pythondir_category = gnuradio/gr # additional libraries for linking with each SWIG-generated library -gnuradio_swig_py_runtime_la_swig_libadd = $(GNURADIO_CORE_LA) -gnuradio_swig_py_general_la_swig_libadd = $(GNURADIO_CORE_LA) -gnuradio_swig_py_gengen_la_swig_libadd = $(GNURADIO_CORE_LA) -gnuradio_swig_py_filter_la_swig_libadd = $(GNURADIO_CORE_LA) -gnuradio_swig_py_io_la_swig_libadd = $(GNURADIO_CORE_LA) -gnuradio_swig_py_hier_la_swig_libadd = $(GNURADIO_CORE_LA) +gnuradio_core_runtime_la_swig_libadd = $(GNURADIO_CORE_LA) +gnuradio_core_general_la_swig_libadd = $(GNURADIO_CORE_LA) +gnuradio_core_gengen_la_swig_libadd = $(GNURADIO_CORE_LA) +gnuradio_core_filter_la_swig_libadd = $(GNURADIO_CORE_LA) +gnuradio_core_io_la_swig_libadd = $(GNURADIO_CORE_LA) +gnuradio_core_hier_la_swig_libadd = $(GNURADIO_CORE_LA) # add some of the variables generated inside the Makefile.swig @@ -118,5 +118,5 @@ no_dist_files = $(swig_built_sources) # Compile a .i to what guile needs. We use -o to set the output file name, # or even with -outdir guile in SWIG_GUILE_ARGS, swig keeps putting a -# gnuradio_swig_py_*_wrap.cxx in the source directory. +# gnuradio_core_*_wrap.cxx in the source directory. diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_filter.i b/gnuradio-core/src/lib/swig/gnuradio_core_filter.i new file mode 100644 index 000000000..d9751d0f1 --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio_core_filter.i @@ -0,0 +1,36 @@ +/* -*- c++ -*- */ +/* + * Copyright 2006,2009,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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef SWIGIMPORTED +%module(directors="1") gnuradio_swig_py_filter +#endif + + //%feature("autodoc", "1"); // generate python docstrings + +%include "gnuradio.i" // the common stuff + +%include "filter.i" + +#if SWIGGUILE +%scheme %{ +(load-extension "libguile-gnuradio_core_filter" "SWIG_init") +%} + #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_general.i b/gnuradio-core/src/lib/swig/gnuradio_core_general.i new file mode 100644 index 000000000..07ef90e34 --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio_core_general.i @@ -0,0 +1,36 @@ +/* -*- c++ -*- */ +/* + * Copyright 2006,2009,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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef SWIGIMPORTED +%module(directors="1") gnuradio_swig_py_general +#endif + + //%feature("autodoc", "1"); // generate python docstrings + +%include "gnuradio.i" // the common stuff + +%include "general.i" + +#if SWIGGUILE +%scheme %{ +(load-extension "libguile-gnuradio_core_general" "SWIG_init") +%} +#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i b/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i new file mode 100644 index 000000000..ea78d8af6 --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i @@ -0,0 +1,36 @@ +/* -*- c++ -*- */ +/* + * Copyright 2006,2009,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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef SWIGIMPORTED +%module(directors="1") gnuradio_swig_py_gengen +#endif + + //%feature("autodoc", "1"); // generate python docstrings + +%include "gnuradio.i" // the common stuff + +%include "gengen.i" + +#if SWIGGUILE +%scheme %{ +(load-extension "libguile-gnuradio_core_gengen" "SWIG_init") +%} +#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_hier.i b/gnuradio-core/src/lib/swig/gnuradio_core_hier.i new file mode 100644 index 000000000..f69b80334 --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio_core_hier.i @@ -0,0 +1,36 @@ +/* -*- c++ -*- */ +/* + * Copyright 2009,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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef SWIGIMPORTED +%module(directors="1") gnuradio_swig_py_hier +#endif + + //%feature("autodoc", "1"); // generate python docstrings + +%include "gnuradio.i" // the common stuff + +%include "hier.i" + +#if SWIGGUILE +%scheme %{ +(load-extension "libguile-gnuradio_core_heir" "SWIG_init") +%} +#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_io.i b/gnuradio-core/src/lib/swig/gnuradio_core_io.i new file mode 100644 index 000000000..82acae747 --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio_core_io.i @@ -0,0 +1,36 @@ +/* -*- c++ -*- */ +/* + * Copyright 2006,2009,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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef SWIGIMPORTED +%module(directors="1") gnuradio_swig_py_io +#endif + + //%feature("autodoc", "1"); // generate python docstrings + +%include "gnuradio.i" // the common stuff + +%include "io.i" + +#if SWIGGUILE +%scheme %{ +(load-extension "libguile-gnuradio_core_io" "SWIG_init") +%} +#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i b/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i new file mode 100644 index 000000000..3cc0a053d --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i @@ -0,0 +1,39 @@ +/* -*- c++ -*- */ +/* + * Copyright 2009,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 GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef SWIGIMPORTED +%module(directors="1") gnuradio_swig_py_runtime +#endif + + //%feature("autodoc", "1"); // generate python docstrings + +#define SW_RUNTIME +%include "gnuradio.i" // the common stuff + +%include "runtime.i" + + +#if SWIGGUILE +%scheme %{ +(load-extension "libguile-gnuradio_core_runtime" "SWIG_init") +%} +#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i deleted file mode 100644 index e40af08ca..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_filter.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009 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, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef SWIGIMPORTED -%module(directors="1") gnuradio_swig_py_filter -#endif - - //%feature("autodoc", "1"); // generate python docstrings - -%include "gnuradio.i" // the common stuff - -%include "filter.i" - -#if SWIGGUILE -%scheme %{ -(load-extension "libguile-gnuradio_swig_py_filter" "SWIG_init") -%} - #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i deleted file mode 100644 index c4e9c070d..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_general.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009 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, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef SWIGIMPORTED -%module(directors="1") gnuradio_swig_py_general -#endif - - //%feature("autodoc", "1"); // generate python docstrings - -%include "gnuradio.i" // the common stuff - -%include "general.i" - -#if SWIGGUILE -%scheme %{ -(load-extension "libguile-gnuradio_swig_py_general" "SWIG_init") -%} -#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i deleted file mode 100644 index 54e1b0944..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_gengen.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009 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, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef SWIGIMPORTED -%module(directors="1") gnuradio_swig_py_gengen -#endif - - //%feature("autodoc", "1"); // generate python docstrings - -%include "gnuradio.i" // the common stuff - -%include "gengen.i" - -#if SWIGGUILE -%scheme %{ -(load-extension "libguile-gnuradio_swig_py_gengen" "SWIG_init") -%} -#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i deleted file mode 100644 index 61029b120..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_hier.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009 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, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef SWIGIMPORTED -%module(directors="1") gnuradio_swig_py_hier -#endif - - //%feature("autodoc", "1"); // generate python docstrings - -%include "gnuradio.i" // the common stuff - -%include "hier.i" - -#if SWIGGUILE -%scheme %{ -(load-extension "libguile-gnuradio_swig_py_heir" "SWIG_init") -%} -#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i deleted file mode 100644 index d7d206ef8..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_io.i +++ /dev/null @@ -1,36 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2006,2009 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, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef SWIGIMPORTED -%module(directors="1") gnuradio_swig_py_io -#endif - - //%feature("autodoc", "1"); // generate python docstrings - -%include "gnuradio.i" // the common stuff - -%include "io.i" - -#if SWIGGUILE -%scheme %{ -(load-extension "libguile-gnuradio_swig_py_io" "SWIG_init") -%} -#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i b/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i deleted file mode 100644 index 088ae4cf8..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_py_runtime.i +++ /dev/null @@ -1,39 +0,0 @@ -/* -*- c++ -*- */ -/* - * Copyright 2009 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 GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -#ifndef SWIGIMPORTED -%module(directors="1") gnuradio_swig_py_runtime -#endif - - //%feature("autodoc", "1"); // generate python docstrings - -#define SW_RUNTIME -%include "gnuradio.i" // the common stuff - -%include "runtime.i" - - -#if SWIGGUILE -%scheme %{ -(load-extension "libguile-gnuradio_swig_py_runtime" "SWIG_init") -%} -#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_python.py b/gnuradio-core/src/lib/swig/gnuradio_swig_python.py index 5324b2309..8f9fffd5c 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_python.py +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_python.py @@ -1,5 +1,5 @@ # -# Copyright 2006,2009 Free Software Foundation, Inc. +# Copyright 2006,2009,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -20,9 +20,9 @@ # This file implements the old gnuradio_swig_python namespace -from gnuradio_swig_py_runtime import * -from gnuradio_swig_py_general import * -from gnuradio_swig_py_gengen import * -from gnuradio_swig_py_filter import * -from gnuradio_swig_py_io import * -from gnuradio_swig_py_hier import * +from gnuradio_core_runtime import * +from gnuradio_core_general import * +from gnuradio_core_gengen import * +from gnuradio_core_filter import * +from gnuradio_core_io import * +from gnuradio_core_hier import * -- cgit From 412a00434139ffa53469545bd878e24eec5bb61d Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 23 Oct 2010 11:02:13 -0700 Subject: regenerate --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 552 +++++++++++++-------------- 1 file changed, 276 insertions(+), 276 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index 39afc8973..f6e3fa1b1 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -20,37 +20,37 @@ # Boston, MA 02110-1301, USA. # -# Makefile.swig.gen for gnuradio_swig_py_runtime.i +# Makefile.swig.gen for gnuradio_core_runtime.i ## Default install locations for these files: ## ## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_runtime +## ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_runtime ## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_runtime +## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_runtime ## ## The following can be overloaded to change the install location, but ## this has to be done in the including Makefile.am -before- ## Makefile.swig is included. -gnuradio_swig_py_runtime_pythondir_category ?= gnuradio/gnuradio_swig_py_runtime -gnuradio_swig_py_runtime_pylibdir_category ?= $(gnuradio_swig_py_runtime_pythondir_category) -gnuradio_swig_py_runtime_pythondir = $(pythondir)/$(gnuradio_swig_py_runtime_pythondir_category) -gnuradio_swig_py_runtime_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_runtime_pylibdir_category) +gnuradio_core_runtime_pythondir_category ?= gnuradio/gnuradio_core_runtime +gnuradio_core_runtime_pylibdir_category ?= $(gnuradio_core_runtime_pythondir_category) +gnuradio_core_runtime_pythondir = $(pythondir)/$(gnuradio_core_runtime_pythondir_category) +gnuradio_core_runtime_pylibdir = $(pyexecdir)/$(gnuradio_core_runtime_pylibdir_category) # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_runtime_scmlibdir = $(libdir) +gnuradio_core_runtime_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/gnuradio_swig_py_runtime +# is installed, usually /usr/share/guile/site/gnuradio_core_runtime # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_runtime_scmdir = $(guiledir)/gnuradio +gnuradio_core_runtime_scmdir = $(guiledir)/gnuradio ## SWIG headers are always installed into the same directory. -gnuradio_swig_py_runtime_swigincludedir = $(swigincludedir) +gnuradio_core_runtime_swigincludedir = $(swigincludedir) ## This is a template file for a "generated" Makefile addition (in ## this case, "Makefile.swig.gen"). By including the top-level @@ -72,7 +72,7 @@ gnuradio_swig_py_runtime_swigincludedir = $(swigincludedir) ## parallel built. These will not be included in a tarball, because ## the SWIG-generated files will be removed from the distribution. -STAMPS += $(DEPDIR)/gnuradio_swig_py_runtime-generate-* +STAMPS += $(DEPDIR)/gnuradio_core_runtime-generate-* ## Other cleaned files: dependency files generated by SWIG or this Makefile @@ -84,67 +84,67 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* # generating the py or scm file also generates the .cc or .h files, # but dependencies work better without the .cc ort .h files listed. -swig_built_sources += gnuradio_swig_py_runtime.py +swig_built_sources += gnuradio_core_runtime.py if GUILE -swig_built_sources += gnuradio_swig_py_runtime.scm +swig_built_sources += gnuradio_core_runtime.scm endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including ## Makefile.swig . -gnuradio_swig_py_runtime_swiginclude_HEADERS = \ - gnuradio_swig_py_runtime.i \ - $(gnuradio_swig_py_runtime_swiginclude_headers) +gnuradio_core_runtime_swiginclude_HEADERS = \ + gnuradio_core_runtime.i \ + $(gnuradio_core_runtime_swiginclude_headers) -gnuradio_swig_py_runtime_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_runtime.la +gnuradio_core_runtime_pylib_LTLIBRARIES = \ + _gnuradio_core_runtime.la -_gnuradio_swig_py_runtime_la_SOURCES = \ - python/gnuradio_swig_py_runtime.cc \ - $(gnuradio_swig_py_runtime_la_swig_sources) +_gnuradio_core_runtime_la_SOURCES = \ + python/gnuradio_core_runtime.cc \ + $(gnuradio_core_runtime_la_swig_sources) -_gnuradio_swig_py_runtime_la_LIBADD = \ +_gnuradio_core_runtime_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ - $(gnuradio_swig_py_runtime_la_swig_libadd) + $(gnuradio_core_runtime_la_swig_libadd) -# _gnuradio_swig_py_runtime_la_DEPENDENCIES = python/gnuradio_swig_py_runtime.lo +# _gnuradio_core_runtime_la_DEPENDENCIES = python/gnuradio_core_runtime.lo -_gnuradio_swig_py_runtime_la_LDFLAGS = \ +_gnuradio_core_runtime_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ - $(gnuradio_swig_py_runtime_la_swig_ldflags) + $(gnuradio_core_runtime_la_swig_ldflags) -_gnuradio_swig_py_runtime_la_CXXFLAGS = \ +_gnuradio_core_runtime_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ - $(gnuradio_swig_py_runtime_la_swig_cxxflags) + $(gnuradio_core_runtime_la_swig_cxxflags) -gnuradio_swig_py_runtime_python_PYTHON = \ - gnuradio_swig_py_runtime.py \ - $(gnuradio_swig_py_runtime) +gnuradio_core_runtime_python_PYTHON = \ + gnuradio_core_runtime.py \ + $(gnuradio_core_runtime) if GUILE -gnuradio_swig_py_runtime_scmlib_LTLIBRARIES = libguile-gnuradio_swig_py_runtime.la -libguile_gnuradio_swig_py_runtime_la_SOURCES = \ - guile/gnuradio_swig_py_runtime.cc \ - $(gnuradio_swig_py_runtime_la_swig_sources) -gnuradio_swig_py_runtime_scm_DATA = gnuradio_swig_py_runtime.scm +gnuradio_core_runtime_scmlib_LTLIBRARIES = libguile-gnuradio_core_runtime.la +libguile_gnuradio_core_runtime_la_SOURCES = \ + guile/gnuradio_core_runtime.cc \ + $(gnuradio_core_runtime_la_swig_sources) +gnuradio_core_runtime_scm_DATA = gnuradio_core_runtime.scm # Guile can use the same flags as python does -libguile_gnuradio_swig_py_runtime_la_LIBADD = $(_gnuradio_swig_py_runtime_la_LIBADD) -libguile_gnuradio_swig_py_runtime_la_LDFLAGS = $(_gnuradio_swig_py_runtime_la_LDFLAGS) -libguile_gnuradio_swig_py_runtime_la_CXXFLAGS = $(_gnuradio_swig_py_runtime_la_CXXFLAGS) +libguile_gnuradio_core_runtime_la_LIBADD = $(_gnuradio_core_runtime_la_LIBADD) +libguile_gnuradio_core_runtime_la_LDFLAGS = $(_gnuradio_core_runtime_la_LDFLAGS) +libguile_gnuradio_core_runtime_la_CXXFLAGS = $(_gnuradio_core_runtime_la_CXXFLAGS) -guile/gnuradio_swig_py_runtime.lo: gnuradio_swig_py_runtime.lo -gnuradio_swig_py_runtime.scm: gnuradio_swig_py_runtime.i +guile/gnuradio_core_runtime.lo: gnuradio_core_runtime.lo +gnuradio_core_runtime.scm: gnuradio_core_runtime.i endif # end of GUILE -python/gnuradio_swig_py_runtime.lo: -gnuradio_swig_py_runtime.lo: gnuradio_swig_py_runtime.py gnuradio_swig_py_runtime.scm -gnuradio_swig_py_runtime.py: gnuradio_swig_py_runtime.i +python/gnuradio_core_runtime.lo: +gnuradio_core_runtime.lo: gnuradio_core_runtime.py gnuradio_core_runtime.scm +gnuradio_core_runtime.py: gnuradio_core_runtime.i --include python/gnuradio_swig_py_runtime.d +-include python/gnuradio_core_runtime.d # -*- Makefile -*- # @@ -168,37 +168,37 @@ gnuradio_swig_py_runtime.py: gnuradio_swig_py_runtime.i # Boston, MA 02110-1301, USA. # -# Makefile.swig.gen for gnuradio_swig_py_general.i +# Makefile.swig.gen for gnuradio_core_general.i ## Default install locations for these files: ## ## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_general +## ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_general ## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_general +## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_general ## ## The following can be overloaded to change the install location, but ## this has to be done in the including Makefile.am -before- ## Makefile.swig is included. -gnuradio_swig_py_general_pythondir_category ?= gnuradio/gnuradio_swig_py_general -gnuradio_swig_py_general_pylibdir_category ?= $(gnuradio_swig_py_general_pythondir_category) -gnuradio_swig_py_general_pythondir = $(pythondir)/$(gnuradio_swig_py_general_pythondir_category) -gnuradio_swig_py_general_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_general_pylibdir_category) +gnuradio_core_general_pythondir_category ?= gnuradio/gnuradio_core_general +gnuradio_core_general_pylibdir_category ?= $(gnuradio_core_general_pythondir_category) +gnuradio_core_general_pythondir = $(pythondir)/$(gnuradio_core_general_pythondir_category) +gnuradio_core_general_pylibdir = $(pyexecdir)/$(gnuradio_core_general_pylibdir_category) # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_general_scmlibdir = $(libdir) +gnuradio_core_general_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/gnuradio_swig_py_general +# is installed, usually /usr/share/guile/site/gnuradio_core_general # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_general_scmdir = $(guiledir)/gnuradio +gnuradio_core_general_scmdir = $(guiledir)/gnuradio ## SWIG headers are always installed into the same directory. -gnuradio_swig_py_general_swigincludedir = $(swigincludedir) +gnuradio_core_general_swigincludedir = $(swigincludedir) ## This is a template file for a "generated" Makefile addition (in ## this case, "Makefile.swig.gen"). By including the top-level @@ -220,7 +220,7 @@ gnuradio_swig_py_general_swigincludedir = $(swigincludedir) ## parallel built. These will not be included in a tarball, because ## the SWIG-generated files will be removed from the distribution. -STAMPS += $(DEPDIR)/gnuradio_swig_py_general-generate-* +STAMPS += $(DEPDIR)/gnuradio_core_general-generate-* ## Other cleaned files: dependency files generated by SWIG or this Makefile @@ -232,67 +232,67 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* # generating the py or scm file also generates the .cc or .h files, # but dependencies work better without the .cc ort .h files listed. -swig_built_sources += gnuradio_swig_py_general.py +swig_built_sources += gnuradio_core_general.py if GUILE -swig_built_sources += gnuradio_swig_py_general.scm +swig_built_sources += gnuradio_core_general.scm endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including ## Makefile.swig . -gnuradio_swig_py_general_swiginclude_HEADERS = \ - gnuradio_swig_py_general.i \ - $(gnuradio_swig_py_general_swiginclude_headers) +gnuradio_core_general_swiginclude_HEADERS = \ + gnuradio_core_general.i \ + $(gnuradio_core_general_swiginclude_headers) -gnuradio_swig_py_general_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_general.la +gnuradio_core_general_pylib_LTLIBRARIES = \ + _gnuradio_core_general.la -_gnuradio_swig_py_general_la_SOURCES = \ - python/gnuradio_swig_py_general.cc \ - $(gnuradio_swig_py_general_la_swig_sources) +_gnuradio_core_general_la_SOURCES = \ + python/gnuradio_core_general.cc \ + $(gnuradio_core_general_la_swig_sources) -_gnuradio_swig_py_general_la_LIBADD = \ +_gnuradio_core_general_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ - $(gnuradio_swig_py_general_la_swig_libadd) + $(gnuradio_core_general_la_swig_libadd) -# _gnuradio_swig_py_general_la_DEPENDENCIES = python/gnuradio_swig_py_general.lo +# _gnuradio_core_general_la_DEPENDENCIES = python/gnuradio_core_general.lo -_gnuradio_swig_py_general_la_LDFLAGS = \ +_gnuradio_core_general_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ - $(gnuradio_swig_py_general_la_swig_ldflags) + $(gnuradio_core_general_la_swig_ldflags) -_gnuradio_swig_py_general_la_CXXFLAGS = \ +_gnuradio_core_general_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ - $(gnuradio_swig_py_general_la_swig_cxxflags) + $(gnuradio_core_general_la_swig_cxxflags) -gnuradio_swig_py_general_python_PYTHON = \ - gnuradio_swig_py_general.py \ - $(gnuradio_swig_py_general) +gnuradio_core_general_python_PYTHON = \ + gnuradio_core_general.py \ + $(gnuradio_core_general) if GUILE -gnuradio_swig_py_general_scmlib_LTLIBRARIES = libguile-gnuradio_swig_py_general.la -libguile_gnuradio_swig_py_general_la_SOURCES = \ - guile/gnuradio_swig_py_general.cc \ - $(gnuradio_swig_py_general_la_swig_sources) -gnuradio_swig_py_general_scm_DATA = gnuradio_swig_py_general.scm +gnuradio_core_general_scmlib_LTLIBRARIES = libguile-gnuradio_core_general.la +libguile_gnuradio_core_general_la_SOURCES = \ + guile/gnuradio_core_general.cc \ + $(gnuradio_core_general_la_swig_sources) +gnuradio_core_general_scm_DATA = gnuradio_core_general.scm # Guile can use the same flags as python does -libguile_gnuradio_swig_py_general_la_LIBADD = $(_gnuradio_swig_py_general_la_LIBADD) -libguile_gnuradio_swig_py_general_la_LDFLAGS = $(_gnuradio_swig_py_general_la_LDFLAGS) -libguile_gnuradio_swig_py_general_la_CXXFLAGS = $(_gnuradio_swig_py_general_la_CXXFLAGS) +libguile_gnuradio_core_general_la_LIBADD = $(_gnuradio_core_general_la_LIBADD) +libguile_gnuradio_core_general_la_LDFLAGS = $(_gnuradio_core_general_la_LDFLAGS) +libguile_gnuradio_core_general_la_CXXFLAGS = $(_gnuradio_core_general_la_CXXFLAGS) -guile/gnuradio_swig_py_general.lo: gnuradio_swig_py_general.lo -gnuradio_swig_py_general.scm: gnuradio_swig_py_general.i +guile/gnuradio_core_general.lo: gnuradio_core_general.lo +gnuradio_core_general.scm: gnuradio_core_general.i endif # end of GUILE -python/gnuradio_swig_py_general.lo: -gnuradio_swig_py_general.lo: gnuradio_swig_py_general.py gnuradio_swig_py_general.scm -gnuradio_swig_py_general.py: gnuradio_swig_py_general.i +python/gnuradio_core_general.lo: +gnuradio_core_general.lo: gnuradio_core_general.py gnuradio_core_general.scm +gnuradio_core_general.py: gnuradio_core_general.i --include python/gnuradio_swig_py_general.d +-include python/gnuradio_core_general.d # -*- Makefile -*- # @@ -316,37 +316,37 @@ gnuradio_swig_py_general.py: gnuradio_swig_py_general.i # Boston, MA 02110-1301, USA. # -# Makefile.swig.gen for gnuradio_swig_py_gengen.i +# Makefile.swig.gen for gnuradio_core_gengen.i ## Default install locations for these files: ## ## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_gengen +## ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_gengen ## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_gengen +## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_gengen ## ## The following can be overloaded to change the install location, but ## this has to be done in the including Makefile.am -before- ## Makefile.swig is included. -gnuradio_swig_py_gengen_pythondir_category ?= gnuradio/gnuradio_swig_py_gengen -gnuradio_swig_py_gengen_pylibdir_category ?= $(gnuradio_swig_py_gengen_pythondir_category) -gnuradio_swig_py_gengen_pythondir = $(pythondir)/$(gnuradio_swig_py_gengen_pythondir_category) -gnuradio_swig_py_gengen_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_gengen_pylibdir_category) +gnuradio_core_gengen_pythondir_category ?= gnuradio/gnuradio_core_gengen +gnuradio_core_gengen_pylibdir_category ?= $(gnuradio_core_gengen_pythondir_category) +gnuradio_core_gengen_pythondir = $(pythondir)/$(gnuradio_core_gengen_pythondir_category) +gnuradio_core_gengen_pylibdir = $(pyexecdir)/$(gnuradio_core_gengen_pylibdir_category) # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_gengen_scmlibdir = $(libdir) +gnuradio_core_gengen_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/gnuradio_swig_py_gengen +# is installed, usually /usr/share/guile/site/gnuradio_core_gengen # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_gengen_scmdir = $(guiledir)/gnuradio +gnuradio_core_gengen_scmdir = $(guiledir)/gnuradio ## SWIG headers are always installed into the same directory. -gnuradio_swig_py_gengen_swigincludedir = $(swigincludedir) +gnuradio_core_gengen_swigincludedir = $(swigincludedir) ## This is a template file for a "generated" Makefile addition (in ## this case, "Makefile.swig.gen"). By including the top-level @@ -368,7 +368,7 @@ gnuradio_swig_py_gengen_swigincludedir = $(swigincludedir) ## parallel built. These will not be included in a tarball, because ## the SWIG-generated files will be removed from the distribution. -STAMPS += $(DEPDIR)/gnuradio_swig_py_gengen-generate-* +STAMPS += $(DEPDIR)/gnuradio_core_gengen-generate-* ## Other cleaned files: dependency files generated by SWIG or this Makefile @@ -380,67 +380,67 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* # generating the py or scm file also generates the .cc or .h files, # but dependencies work better without the .cc ort .h files listed. -swig_built_sources += gnuradio_swig_py_gengen.py +swig_built_sources += gnuradio_core_gengen.py if GUILE -swig_built_sources += gnuradio_swig_py_gengen.scm +swig_built_sources += gnuradio_core_gengen.scm endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including ## Makefile.swig . -gnuradio_swig_py_gengen_swiginclude_HEADERS = \ - gnuradio_swig_py_gengen.i \ - $(gnuradio_swig_py_gengen_swiginclude_headers) +gnuradio_core_gengen_swiginclude_HEADERS = \ + gnuradio_core_gengen.i \ + $(gnuradio_core_gengen_swiginclude_headers) -gnuradio_swig_py_gengen_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_gengen.la +gnuradio_core_gengen_pylib_LTLIBRARIES = \ + _gnuradio_core_gengen.la -_gnuradio_swig_py_gengen_la_SOURCES = \ - python/gnuradio_swig_py_gengen.cc \ - $(gnuradio_swig_py_gengen_la_swig_sources) +_gnuradio_core_gengen_la_SOURCES = \ + python/gnuradio_core_gengen.cc \ + $(gnuradio_core_gengen_la_swig_sources) -_gnuradio_swig_py_gengen_la_LIBADD = \ +_gnuradio_core_gengen_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ - $(gnuradio_swig_py_gengen_la_swig_libadd) + $(gnuradio_core_gengen_la_swig_libadd) -# _gnuradio_swig_py_gengen_la_DEPENDENCIES = python/gnuradio_swig_py_gengen.lo +# _gnuradio_core_gengen_la_DEPENDENCIES = python/gnuradio_core_gengen.lo -_gnuradio_swig_py_gengen_la_LDFLAGS = \ +_gnuradio_core_gengen_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ - $(gnuradio_swig_py_gengen_la_swig_ldflags) + $(gnuradio_core_gengen_la_swig_ldflags) -_gnuradio_swig_py_gengen_la_CXXFLAGS = \ +_gnuradio_core_gengen_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ - $(gnuradio_swig_py_gengen_la_swig_cxxflags) + $(gnuradio_core_gengen_la_swig_cxxflags) -gnuradio_swig_py_gengen_python_PYTHON = \ - gnuradio_swig_py_gengen.py \ - $(gnuradio_swig_py_gengen) +gnuradio_core_gengen_python_PYTHON = \ + gnuradio_core_gengen.py \ + $(gnuradio_core_gengen) if GUILE -gnuradio_swig_py_gengen_scmlib_LTLIBRARIES = libguile-gnuradio_swig_py_gengen.la -libguile_gnuradio_swig_py_gengen_la_SOURCES = \ - guile/gnuradio_swig_py_gengen.cc \ - $(gnuradio_swig_py_gengen_la_swig_sources) -gnuradio_swig_py_gengen_scm_DATA = gnuradio_swig_py_gengen.scm +gnuradio_core_gengen_scmlib_LTLIBRARIES = libguile-gnuradio_core_gengen.la +libguile_gnuradio_core_gengen_la_SOURCES = \ + guile/gnuradio_core_gengen.cc \ + $(gnuradio_core_gengen_la_swig_sources) +gnuradio_core_gengen_scm_DATA = gnuradio_core_gengen.scm # Guile can use the same flags as python does -libguile_gnuradio_swig_py_gengen_la_LIBADD = $(_gnuradio_swig_py_gengen_la_LIBADD) -libguile_gnuradio_swig_py_gengen_la_LDFLAGS = $(_gnuradio_swig_py_gengen_la_LDFLAGS) -libguile_gnuradio_swig_py_gengen_la_CXXFLAGS = $(_gnuradio_swig_py_gengen_la_CXXFLAGS) +libguile_gnuradio_core_gengen_la_LIBADD = $(_gnuradio_core_gengen_la_LIBADD) +libguile_gnuradio_core_gengen_la_LDFLAGS = $(_gnuradio_core_gengen_la_LDFLAGS) +libguile_gnuradio_core_gengen_la_CXXFLAGS = $(_gnuradio_core_gengen_la_CXXFLAGS) -guile/gnuradio_swig_py_gengen.lo: gnuradio_swig_py_gengen.lo -gnuradio_swig_py_gengen.scm: gnuradio_swig_py_gengen.i +guile/gnuradio_core_gengen.lo: gnuradio_core_gengen.lo +gnuradio_core_gengen.scm: gnuradio_core_gengen.i endif # end of GUILE -python/gnuradio_swig_py_gengen.lo: -gnuradio_swig_py_gengen.lo: gnuradio_swig_py_gengen.py gnuradio_swig_py_gengen.scm -gnuradio_swig_py_gengen.py: gnuradio_swig_py_gengen.i +python/gnuradio_core_gengen.lo: +gnuradio_core_gengen.lo: gnuradio_core_gengen.py gnuradio_core_gengen.scm +gnuradio_core_gengen.py: gnuradio_core_gengen.i --include python/gnuradio_swig_py_gengen.d +-include python/gnuradio_core_gengen.d # -*- Makefile -*- # @@ -464,37 +464,37 @@ gnuradio_swig_py_gengen.py: gnuradio_swig_py_gengen.i # Boston, MA 02110-1301, USA. # -# Makefile.swig.gen for gnuradio_swig_py_filter.i +# Makefile.swig.gen for gnuradio_core_filter.i ## Default install locations for these files: ## ## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_filter +## ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_filter ## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_filter +## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_filter ## ## The following can be overloaded to change the install location, but ## this has to be done in the including Makefile.am -before- ## Makefile.swig is included. -gnuradio_swig_py_filter_pythondir_category ?= gnuradio/gnuradio_swig_py_filter -gnuradio_swig_py_filter_pylibdir_category ?= $(gnuradio_swig_py_filter_pythondir_category) -gnuradio_swig_py_filter_pythondir = $(pythondir)/$(gnuradio_swig_py_filter_pythondir_category) -gnuradio_swig_py_filter_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_filter_pylibdir_category) +gnuradio_core_filter_pythondir_category ?= gnuradio/gnuradio_core_filter +gnuradio_core_filter_pylibdir_category ?= $(gnuradio_core_filter_pythondir_category) +gnuradio_core_filter_pythondir = $(pythondir)/$(gnuradio_core_filter_pythondir_category) +gnuradio_core_filter_pylibdir = $(pyexecdir)/$(gnuradio_core_filter_pylibdir_category) # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_filter_scmlibdir = $(libdir) +gnuradio_core_filter_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/gnuradio_swig_py_filter +# is installed, usually /usr/share/guile/site/gnuradio_core_filter # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_filter_scmdir = $(guiledir)/gnuradio +gnuradio_core_filter_scmdir = $(guiledir)/gnuradio ## SWIG headers are always installed into the same directory. -gnuradio_swig_py_filter_swigincludedir = $(swigincludedir) +gnuradio_core_filter_swigincludedir = $(swigincludedir) ## This is a template file for a "generated" Makefile addition (in ## this case, "Makefile.swig.gen"). By including the top-level @@ -516,7 +516,7 @@ gnuradio_swig_py_filter_swigincludedir = $(swigincludedir) ## parallel built. These will not be included in a tarball, because ## the SWIG-generated files will be removed from the distribution. -STAMPS += $(DEPDIR)/gnuradio_swig_py_filter-generate-* +STAMPS += $(DEPDIR)/gnuradio_core_filter-generate-* ## Other cleaned files: dependency files generated by SWIG or this Makefile @@ -528,67 +528,67 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* # generating the py or scm file also generates the .cc or .h files, # but dependencies work better without the .cc ort .h files listed. -swig_built_sources += gnuradio_swig_py_filter.py +swig_built_sources += gnuradio_core_filter.py if GUILE -swig_built_sources += gnuradio_swig_py_filter.scm +swig_built_sources += gnuradio_core_filter.scm endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including ## Makefile.swig . -gnuradio_swig_py_filter_swiginclude_HEADERS = \ - gnuradio_swig_py_filter.i \ - $(gnuradio_swig_py_filter_swiginclude_headers) +gnuradio_core_filter_swiginclude_HEADERS = \ + gnuradio_core_filter.i \ + $(gnuradio_core_filter_swiginclude_headers) -gnuradio_swig_py_filter_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_filter.la +gnuradio_core_filter_pylib_LTLIBRARIES = \ + _gnuradio_core_filter.la -_gnuradio_swig_py_filter_la_SOURCES = \ - python/gnuradio_swig_py_filter.cc \ - $(gnuradio_swig_py_filter_la_swig_sources) +_gnuradio_core_filter_la_SOURCES = \ + python/gnuradio_core_filter.cc \ + $(gnuradio_core_filter_la_swig_sources) -_gnuradio_swig_py_filter_la_LIBADD = \ +_gnuradio_core_filter_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ - $(gnuradio_swig_py_filter_la_swig_libadd) + $(gnuradio_core_filter_la_swig_libadd) -# _gnuradio_swig_py_filter_la_DEPENDENCIES = python/gnuradio_swig_py_filter.lo +# _gnuradio_core_filter_la_DEPENDENCIES = python/gnuradio_core_filter.lo -_gnuradio_swig_py_filter_la_LDFLAGS = \ +_gnuradio_core_filter_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ - $(gnuradio_swig_py_filter_la_swig_ldflags) + $(gnuradio_core_filter_la_swig_ldflags) -_gnuradio_swig_py_filter_la_CXXFLAGS = \ +_gnuradio_core_filter_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ - $(gnuradio_swig_py_filter_la_swig_cxxflags) + $(gnuradio_core_filter_la_swig_cxxflags) -gnuradio_swig_py_filter_python_PYTHON = \ - gnuradio_swig_py_filter.py \ - $(gnuradio_swig_py_filter) +gnuradio_core_filter_python_PYTHON = \ + gnuradio_core_filter.py \ + $(gnuradio_core_filter) if GUILE -gnuradio_swig_py_filter_scmlib_LTLIBRARIES = libguile-gnuradio_swig_py_filter.la -libguile_gnuradio_swig_py_filter_la_SOURCES = \ - guile/gnuradio_swig_py_filter.cc \ - $(gnuradio_swig_py_filter_la_swig_sources) -gnuradio_swig_py_filter_scm_DATA = gnuradio_swig_py_filter.scm +gnuradio_core_filter_scmlib_LTLIBRARIES = libguile-gnuradio_core_filter.la +libguile_gnuradio_core_filter_la_SOURCES = \ + guile/gnuradio_core_filter.cc \ + $(gnuradio_core_filter_la_swig_sources) +gnuradio_core_filter_scm_DATA = gnuradio_core_filter.scm # Guile can use the same flags as python does -libguile_gnuradio_swig_py_filter_la_LIBADD = $(_gnuradio_swig_py_filter_la_LIBADD) -libguile_gnuradio_swig_py_filter_la_LDFLAGS = $(_gnuradio_swig_py_filter_la_LDFLAGS) -libguile_gnuradio_swig_py_filter_la_CXXFLAGS = $(_gnuradio_swig_py_filter_la_CXXFLAGS) +libguile_gnuradio_core_filter_la_LIBADD = $(_gnuradio_core_filter_la_LIBADD) +libguile_gnuradio_core_filter_la_LDFLAGS = $(_gnuradio_core_filter_la_LDFLAGS) +libguile_gnuradio_core_filter_la_CXXFLAGS = $(_gnuradio_core_filter_la_CXXFLAGS) -guile/gnuradio_swig_py_filter.lo: gnuradio_swig_py_filter.lo -gnuradio_swig_py_filter.scm: gnuradio_swig_py_filter.i +guile/gnuradio_core_filter.lo: gnuradio_core_filter.lo +gnuradio_core_filter.scm: gnuradio_core_filter.i endif # end of GUILE -python/gnuradio_swig_py_filter.lo: -gnuradio_swig_py_filter.lo: gnuradio_swig_py_filter.py gnuradio_swig_py_filter.scm -gnuradio_swig_py_filter.py: gnuradio_swig_py_filter.i +python/gnuradio_core_filter.lo: +gnuradio_core_filter.lo: gnuradio_core_filter.py gnuradio_core_filter.scm +gnuradio_core_filter.py: gnuradio_core_filter.i --include python/gnuradio_swig_py_filter.d +-include python/gnuradio_core_filter.d # -*- Makefile -*- # @@ -612,37 +612,37 @@ gnuradio_swig_py_filter.py: gnuradio_swig_py_filter.i # Boston, MA 02110-1301, USA. # -# Makefile.swig.gen for gnuradio_swig_py_io.i +# Makefile.swig.gen for gnuradio_core_io.i ## Default install locations for these files: ## ## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_io +## ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_io ## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_io +## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_io ## ## The following can be overloaded to change the install location, but ## this has to be done in the including Makefile.am -before- ## Makefile.swig is included. -gnuradio_swig_py_io_pythondir_category ?= gnuradio/gnuradio_swig_py_io -gnuradio_swig_py_io_pylibdir_category ?= $(gnuradio_swig_py_io_pythondir_category) -gnuradio_swig_py_io_pythondir = $(pythondir)/$(gnuradio_swig_py_io_pythondir_category) -gnuradio_swig_py_io_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_io_pylibdir_category) +gnuradio_core_io_pythondir_category ?= gnuradio/gnuradio_core_io +gnuradio_core_io_pylibdir_category ?= $(gnuradio_core_io_pythondir_category) +gnuradio_core_io_pythondir = $(pythondir)/$(gnuradio_core_io_pythondir_category) +gnuradio_core_io_pylibdir = $(pyexecdir)/$(gnuradio_core_io_pylibdir_category) # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_io_scmlibdir = $(libdir) +gnuradio_core_io_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/gnuradio_swig_py_io +# is installed, usually /usr/share/guile/site/gnuradio_core_io # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_io_scmdir = $(guiledir)/gnuradio +gnuradio_core_io_scmdir = $(guiledir)/gnuradio ## SWIG headers are always installed into the same directory. -gnuradio_swig_py_io_swigincludedir = $(swigincludedir) +gnuradio_core_io_swigincludedir = $(swigincludedir) ## This is a template file for a "generated" Makefile addition (in ## this case, "Makefile.swig.gen"). By including the top-level @@ -664,7 +664,7 @@ gnuradio_swig_py_io_swigincludedir = $(swigincludedir) ## parallel built. These will not be included in a tarball, because ## the SWIG-generated files will be removed from the distribution. -STAMPS += $(DEPDIR)/gnuradio_swig_py_io-generate-* +STAMPS += $(DEPDIR)/gnuradio_core_io-generate-* ## Other cleaned files: dependency files generated by SWIG or this Makefile @@ -676,67 +676,67 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* # generating the py or scm file also generates the .cc or .h files, # but dependencies work better without the .cc ort .h files listed. -swig_built_sources += gnuradio_swig_py_io.py +swig_built_sources += gnuradio_core_io.py if GUILE -swig_built_sources += gnuradio_swig_py_io.scm +swig_built_sources += gnuradio_core_io.scm endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including ## Makefile.swig . -gnuradio_swig_py_io_swiginclude_HEADERS = \ - gnuradio_swig_py_io.i \ - $(gnuradio_swig_py_io_swiginclude_headers) +gnuradio_core_io_swiginclude_HEADERS = \ + gnuradio_core_io.i \ + $(gnuradio_core_io_swiginclude_headers) -gnuradio_swig_py_io_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_io.la +gnuradio_core_io_pylib_LTLIBRARIES = \ + _gnuradio_core_io.la -_gnuradio_swig_py_io_la_SOURCES = \ - python/gnuradio_swig_py_io.cc \ - $(gnuradio_swig_py_io_la_swig_sources) +_gnuradio_core_io_la_SOURCES = \ + python/gnuradio_core_io.cc \ + $(gnuradio_core_io_la_swig_sources) -_gnuradio_swig_py_io_la_LIBADD = \ +_gnuradio_core_io_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ - $(gnuradio_swig_py_io_la_swig_libadd) + $(gnuradio_core_io_la_swig_libadd) -# _gnuradio_swig_py_io_la_DEPENDENCIES = python/gnuradio_swig_py_io.lo +# _gnuradio_core_io_la_DEPENDENCIES = python/gnuradio_core_io.lo -_gnuradio_swig_py_io_la_LDFLAGS = \ +_gnuradio_core_io_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ - $(gnuradio_swig_py_io_la_swig_ldflags) + $(gnuradio_core_io_la_swig_ldflags) -_gnuradio_swig_py_io_la_CXXFLAGS = \ +_gnuradio_core_io_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ - $(gnuradio_swig_py_io_la_swig_cxxflags) + $(gnuradio_core_io_la_swig_cxxflags) -gnuradio_swig_py_io_python_PYTHON = \ - gnuradio_swig_py_io.py \ - $(gnuradio_swig_py_io) +gnuradio_core_io_python_PYTHON = \ + gnuradio_core_io.py \ + $(gnuradio_core_io) if GUILE -gnuradio_swig_py_io_scmlib_LTLIBRARIES = libguile-gnuradio_swig_py_io.la -libguile_gnuradio_swig_py_io_la_SOURCES = \ - guile/gnuradio_swig_py_io.cc \ - $(gnuradio_swig_py_io_la_swig_sources) -gnuradio_swig_py_io_scm_DATA = gnuradio_swig_py_io.scm +gnuradio_core_io_scmlib_LTLIBRARIES = libguile-gnuradio_core_io.la +libguile_gnuradio_core_io_la_SOURCES = \ + guile/gnuradio_core_io.cc \ + $(gnuradio_core_io_la_swig_sources) +gnuradio_core_io_scm_DATA = gnuradio_core_io.scm # Guile can use the same flags as python does -libguile_gnuradio_swig_py_io_la_LIBADD = $(_gnuradio_swig_py_io_la_LIBADD) -libguile_gnuradio_swig_py_io_la_LDFLAGS = $(_gnuradio_swig_py_io_la_LDFLAGS) -libguile_gnuradio_swig_py_io_la_CXXFLAGS = $(_gnuradio_swig_py_io_la_CXXFLAGS) +libguile_gnuradio_core_io_la_LIBADD = $(_gnuradio_core_io_la_LIBADD) +libguile_gnuradio_core_io_la_LDFLAGS = $(_gnuradio_core_io_la_LDFLAGS) +libguile_gnuradio_core_io_la_CXXFLAGS = $(_gnuradio_core_io_la_CXXFLAGS) -guile/gnuradio_swig_py_io.lo: gnuradio_swig_py_io.lo -gnuradio_swig_py_io.scm: gnuradio_swig_py_io.i +guile/gnuradio_core_io.lo: gnuradio_core_io.lo +gnuradio_core_io.scm: gnuradio_core_io.i endif # end of GUILE -python/gnuradio_swig_py_io.lo: -gnuradio_swig_py_io.lo: gnuradio_swig_py_io.py gnuradio_swig_py_io.scm -gnuradio_swig_py_io.py: gnuradio_swig_py_io.i +python/gnuradio_core_io.lo: +gnuradio_core_io.lo: gnuradio_core_io.py gnuradio_core_io.scm +gnuradio_core_io.py: gnuradio_core_io.i --include python/gnuradio_swig_py_io.d +-include python/gnuradio_core_io.d # -*- Makefile -*- # @@ -760,37 +760,37 @@ gnuradio_swig_py_io.py: gnuradio_swig_py_io.i # Boston, MA 02110-1301, USA. # -# Makefile.swig.gen for gnuradio_swig_py_hier.i +# Makefile.swig.gen for gnuradio_core_hier.i ## Default install locations for these files: ## ## Default location for the Python directory is: -## ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_hier +## ${prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_hier ## Default location for the Python exec directory is: -## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_swig_py_hier +## ${exec_prefix}/lib/python${python_version}/site-packages/[category]/gnuradio_core_hier ## ## The following can be overloaded to change the install location, but ## this has to be done in the including Makefile.am -before- ## Makefile.swig is included. -gnuradio_swig_py_hier_pythondir_category ?= gnuradio/gnuradio_swig_py_hier -gnuradio_swig_py_hier_pylibdir_category ?= $(gnuradio_swig_py_hier_pythondir_category) -gnuradio_swig_py_hier_pythondir = $(pythondir)/$(gnuradio_swig_py_hier_pythondir_category) -gnuradio_swig_py_hier_pylibdir = $(pyexecdir)/$(gnuradio_swig_py_hier_pylibdir_category) +gnuradio_core_hier_pythondir_category ?= gnuradio/gnuradio_core_hier +gnuradio_core_hier_pylibdir_category ?= $(gnuradio_core_hier_pythondir_category) +gnuradio_core_hier_pythondir = $(pythondir)/$(gnuradio_core_hier_pythondir_category) +gnuradio_core_hier_pylibdir = $(pyexecdir)/$(gnuradio_core_hier_pylibdir_category) # The .so libraries for the guile modules get installed whereever guile # is installed, usually /usr/lib/guile/gnuradio/ # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_hier_scmlibdir = $(libdir) +gnuradio_core_hier_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile -# is installed, usually /usr/share/guile/site/gnuradio_swig_py_hier +# is installed, usually /usr/share/guile/site/gnuradio_core_hier # FIXME: determince whether these should be installed with gnuradio. -gnuradio_swig_py_hier_scmdir = $(guiledir)/gnuradio +gnuradio_core_hier_scmdir = $(guiledir)/gnuradio ## SWIG headers are always installed into the same directory. -gnuradio_swig_py_hier_swigincludedir = $(swigincludedir) +gnuradio_core_hier_swigincludedir = $(swigincludedir) ## This is a template file for a "generated" Makefile addition (in ## this case, "Makefile.swig.gen"). By including the top-level @@ -812,7 +812,7 @@ gnuradio_swig_py_hier_swigincludedir = $(swigincludedir) ## parallel built. These will not be included in a tarball, because ## the SWIG-generated files will be removed from the distribution. -STAMPS += $(DEPDIR)/gnuradio_swig_py_hier-generate-* +STAMPS += $(DEPDIR)/gnuradio_core_hier-generate-* ## Other cleaned files: dependency files generated by SWIG or this Makefile @@ -824,65 +824,65 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* # generating the py or scm file also generates the .cc or .h files, # but dependencies work better without the .cc ort .h files listed. -swig_built_sources += gnuradio_swig_py_hier.py +swig_built_sources += gnuradio_core_hier.py if GUILE -swig_built_sources += gnuradio_swig_py_hier.scm +swig_built_sources += gnuradio_core_hier.scm endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including ## Makefile.swig . -gnuradio_swig_py_hier_swiginclude_HEADERS = \ - gnuradio_swig_py_hier.i \ - $(gnuradio_swig_py_hier_swiginclude_headers) +gnuradio_core_hier_swiginclude_HEADERS = \ + gnuradio_core_hier.i \ + $(gnuradio_core_hier_swiginclude_headers) -gnuradio_swig_py_hier_pylib_LTLIBRARIES = \ - _gnuradio_swig_py_hier.la +gnuradio_core_hier_pylib_LTLIBRARIES = \ + _gnuradio_core_hier.la -_gnuradio_swig_py_hier_la_SOURCES = \ - python/gnuradio_swig_py_hier.cc \ - $(gnuradio_swig_py_hier_la_swig_sources) +_gnuradio_core_hier_la_SOURCES = \ + python/gnuradio_core_hier.cc \ + $(gnuradio_core_hier_la_swig_sources) -_gnuradio_swig_py_hier_la_LIBADD = \ +_gnuradio_core_hier_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ - $(gnuradio_swig_py_hier_la_swig_libadd) + $(gnuradio_core_hier_la_swig_libadd) -# _gnuradio_swig_py_hier_la_DEPENDENCIES = python/gnuradio_swig_py_hier.lo +# _gnuradio_core_hier_la_DEPENDENCIES = python/gnuradio_core_hier.lo -_gnuradio_swig_py_hier_la_LDFLAGS = \ +_gnuradio_core_hier_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ - $(gnuradio_swig_py_hier_la_swig_ldflags) + $(gnuradio_core_hier_la_swig_ldflags) -_gnuradio_swig_py_hier_la_CXXFLAGS = \ +_gnuradio_core_hier_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ - $(gnuradio_swig_py_hier_la_swig_cxxflags) + $(gnuradio_core_hier_la_swig_cxxflags) -gnuradio_swig_py_hier_python_PYTHON = \ - gnuradio_swig_py_hier.py \ - $(gnuradio_swig_py_hier) +gnuradio_core_hier_python_PYTHON = \ + gnuradio_core_hier.py \ + $(gnuradio_core_hier) if GUILE -gnuradio_swig_py_hier_scmlib_LTLIBRARIES = libguile-gnuradio_swig_py_hier.la -libguile_gnuradio_swig_py_hier_la_SOURCES = \ - guile/gnuradio_swig_py_hier.cc \ - $(gnuradio_swig_py_hier_la_swig_sources) -gnuradio_swig_py_hier_scm_DATA = gnuradio_swig_py_hier.scm +gnuradio_core_hier_scmlib_LTLIBRARIES = libguile-gnuradio_core_hier.la +libguile_gnuradio_core_hier_la_SOURCES = \ + guile/gnuradio_core_hier.cc \ + $(gnuradio_core_hier_la_swig_sources) +gnuradio_core_hier_scm_DATA = gnuradio_core_hier.scm # Guile can use the same flags as python does -libguile_gnuradio_swig_py_hier_la_LIBADD = $(_gnuradio_swig_py_hier_la_LIBADD) -libguile_gnuradio_swig_py_hier_la_LDFLAGS = $(_gnuradio_swig_py_hier_la_LDFLAGS) -libguile_gnuradio_swig_py_hier_la_CXXFLAGS = $(_gnuradio_swig_py_hier_la_CXXFLAGS) +libguile_gnuradio_core_hier_la_LIBADD = $(_gnuradio_core_hier_la_LIBADD) +libguile_gnuradio_core_hier_la_LDFLAGS = $(_gnuradio_core_hier_la_LDFLAGS) +libguile_gnuradio_core_hier_la_CXXFLAGS = $(_gnuradio_core_hier_la_CXXFLAGS) -guile/gnuradio_swig_py_hier.lo: gnuradio_swig_py_hier.lo -gnuradio_swig_py_hier.scm: gnuradio_swig_py_hier.i +guile/gnuradio_core_hier.lo: gnuradio_core_hier.lo +gnuradio_core_hier.scm: gnuradio_core_hier.i endif # end of GUILE -python/gnuradio_swig_py_hier.lo: -gnuradio_swig_py_hier.lo: gnuradio_swig_py_hier.py gnuradio_swig_py_hier.scm -gnuradio_swig_py_hier.py: gnuradio_swig_py_hier.i +python/gnuradio_core_hier.lo: +gnuradio_core_hier.lo: gnuradio_core_hier.py gnuradio_core_hier.scm +gnuradio_core_hier.py: gnuradio_core_hier.i --include python/gnuradio_swig_py_hier.d +-include python/gnuradio_core_hier.d -- cgit From 70dd1dc6610135a1967de554189be38af8f3b080 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 23 Oct 2010 11:20:09 -0700 Subject: rename s/gnuradio_swig_python/gnuradio_core/g --- gnuradio-core/src/lib/swig/Makefile.am | 4 ++-- gnuradio-core/src/lib/swig/gnuradio_core.py | 28 ++++++++++++++++++++++ gnuradio-core/src/lib/swig/gnuradio_swig.scm | 2 +- gnuradio-core/src/lib/swig/gnuradio_swig_python.py | 28 ---------------------- gnuradio-core/src/python/gnuradio/gr/__init__.py | 4 ++-- .../src/python/gnuradio/gr/hier_block2.py | 2 +- gnuradio-core/src/python/gnuradio/gr/prefs.py | 2 +- gnuradio-core/src/python/gnuradio/gr/scheduler.py | 2 +- gnuradio-core/src/python/gnuradio/gr/top_block.py | 2 +- 9 files changed, 37 insertions(+), 37 deletions(-) create mode 100644 gnuradio-core/src/lib/swig/gnuradio_core.py delete mode 100644 gnuradio-core/src/lib/swig/gnuradio_swig_python.py (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index f354efe0b..9e0d2f69e 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -29,7 +29,7 @@ CLEANFILES += guile/gnuradio* endif # ---------------------------------------------------------------- -# We've split the previously monstrous gnuradio_swig_python into 6 +# We've split the previously monstrous gnuradio_core into 6 # smaller pieces. This reduces compile time coupling and creates # smaller pieces for the compiler to digest. prior to this change, on # X86_64, g++'s resident set size was 650MB! @@ -68,7 +68,7 @@ EXTRA_DIST = gen-swig-bug-fix # special install for this top-level Python script which includes all # of the split Python libraries. ourpythondir = $(grpythondir)/gr -ourpython_PYTHON = gnuradio_swig_python.py +ourpython_PYTHON = gnuradio_core.py # ---------------------------------------------------------------- # FIXME As of swig 1.3.31, this still seems to be required... diff --git a/gnuradio-core/src/lib/swig/gnuradio_core.py b/gnuradio-core/src/lib/swig/gnuradio_core.py new file mode 100644 index 000000000..172051013 --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio_core.py @@ -0,0 +1,28 @@ +# +# Copyright 2006,2009,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, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# + +# This file implements the old gnuradio_core namespace + +from gnuradio_core_runtime import * +from gnuradio_core_general import * +from gnuradio_core_gengen import * +from gnuradio_core_filter import * +from gnuradio_core_io import * +from gnuradio_core_hier import * diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig.scm b/gnuradio-core/src/lib/swig/gnuradio_swig.scm index 961564d68..c07d46a64 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_swig.scm +++ b/gnuradio-core/src/lib/swig/gnuradio_swig.scm @@ -3,7 +3,7 @@ ;;; We'll need to assemble the (gnuradio gr) module somewhere... ;;; -;; # This file implements the old gnuradio_swig_python namespace +;; # This file implements the old gnuradio_core namespace ;; ;; from gnuradio_swig_py_runtime import * ;; from gnuradio_swig_py_general import * diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_python.py b/gnuradio-core/src/lib/swig/gnuradio_swig_python.py deleted file mode 100644 index 8f9fffd5c..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_python.py +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright 2006,2009,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, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# - -# This file implements the old gnuradio_swig_python namespace - -from gnuradio_core_runtime import * -from gnuradio_core_general import * -from gnuradio_core_gengen import * -from gnuradio_core_filter import * -from gnuradio_core_io import * -from gnuradio_core_hier import * diff --git a/gnuradio-core/src/python/gnuradio/gr/__init__.py b/gnuradio-core/src/python/gnuradio/gr/__init__.py index 6f939c470..73ca8e08f 100644 --- a/gnuradio-core/src/python/gnuradio/gr/__init__.py +++ b/gnuradio-core/src/python/gnuradio/gr/__init__.py @@ -1,5 +1,5 @@ # -# Copyright 2003,2004,2006,2008,2009 Free Software Foundation, Inc. +# Copyright 2003,2004,2006,2008,2009,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -40,7 +40,7 @@ if _RTLD_GLOBAL != 0: _dlopenflags = sys.getdlopenflags() sys.setdlopenflags(_dlopenflags|_RTLD_GLOBAL) -from gnuradio_swig_python import * +from gnuradio_core import * from exceptions import * from hier_block2 import * from top_block import * diff --git a/gnuradio-core/src/python/gnuradio/gr/hier_block2.py b/gnuradio-core/src/python/gnuradio/gr/hier_block2.py index b43c5feda..f2256da1b 100644 --- a/gnuradio-core/src/python/gnuradio/gr/hier_block2.py +++ b/gnuradio-core/src/python/gnuradio/gr/hier_block2.py @@ -19,7 +19,7 @@ # Boston, MA 02110-1301, USA. # -from gnuradio_swig_python import hier_block2_swig +from gnuradio_core import hier_block2_swig # # This hack forces a 'has-a' relationship to look like an 'is-a' one. diff --git a/gnuradio-core/src/python/gnuradio/gr/prefs.py b/gnuradio-core/src/python/gnuradio/gr/prefs.py index 9b31b772b..40347a2f4 100644 --- a/gnuradio-core/src/python/gnuradio/gr/prefs.py +++ b/gnuradio-core/src/python/gnuradio/gr/prefs.py @@ -19,7 +19,7 @@ # Boston, MA 02110-1301, USA. # -import gnuradio_swig_python as gsp +import gnuradio_core as gsp _prefs_base = gsp.gr_prefs diff --git a/gnuradio-core/src/python/gnuradio/gr/scheduler.py b/gnuradio-core/src/python/gnuradio/gr/scheduler.py index 4694d48b2..67f79ab77 100644 --- a/gnuradio-core/src/python/gnuradio/gr/scheduler.py +++ b/gnuradio-core/src/python/gnuradio/gr/scheduler.py @@ -20,7 +20,7 @@ # from gnuradio.gr.exceptions import * -from gnuradio_swig_python import single_threaded_scheduler, sts_pyrun +from gnuradio_core import single_threaded_scheduler, sts_pyrun import gr_threading as _threading #import threading as _threading diff --git a/gnuradio-core/src/python/gnuradio/gr/top_block.py b/gnuradio-core/src/python/gnuradio/gr/top_block.py index 71e401424..59bb0438f 100644 --- a/gnuradio-core/src/python/gnuradio/gr/top_block.py +++ b/gnuradio-core/src/python/gnuradio/gr/top_block.py @@ -19,7 +19,7 @@ # Boston, MA 02110-1301, USA. # -from gnuradio_swig_python import top_block_swig, \ +from gnuradio_core import top_block_swig, \ top_block_wait_unlocked, top_block_run_unlocked #import gnuradio.gr.gr_threading as _threading -- cgit From 52da23e0c42298a1cba07546259037c92db8c588 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 23 Oct 2010 11:47:36 -0700 Subject: Remove dead code --- gnuradio-core/src/python/gnuradio/gr/Makefile.am | 1 - gnuradio-core/src/python/gnuradio/gr/scheduler.py | 70 ----------------------- 2 files changed, 71 deletions(-) delete mode 100644 gnuradio-core/src/python/gnuradio/gr/scheduler.py (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/python/gnuradio/gr/Makefile.am b/gnuradio-core/src/python/gnuradio/gr/Makefile.am index 341f58812..c3017adcc 100644 --- a/gnuradio-core/src/python/gnuradio/gr/Makefile.am +++ b/gnuradio-core/src/python/gnuradio/gr/Makefile.am @@ -39,7 +39,6 @@ grgrpython_PYTHON = \ gr_threading_24.py \ hier_block2.py \ prefs.py \ - scheduler.py \ top_block.py \ pubsub.py diff --git a/gnuradio-core/src/python/gnuradio/gr/scheduler.py b/gnuradio-core/src/python/gnuradio/gr/scheduler.py deleted file mode 100644 index 67f79ab77..000000000 --- a/gnuradio-core/src/python/gnuradio/gr/scheduler.py +++ /dev/null @@ -1,70 +0,0 @@ -# -# Copyright 2004 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 GNU Radio; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, -# Boston, MA 02110-1301, USA. -# - -from gnuradio.gr.exceptions import * -from gnuradio_core import single_threaded_scheduler, sts_pyrun -import gr_threading as _threading -#import threading as _threading - -class scheduler_thread(_threading.Thread): - def __init__(self, sts): - _threading.Thread.__init__(self) - self.sts = sts - def run(self): - # Invoke the single threaded scheduler's run method - # - # Note that we're in a new thread, and that sts_pyrun - # releases the global interpreter lock. This has the - # effect of evaluating the graph in parallel to the - # main line control code. - sts_pyrun(self.sts) - self.sts = None - -class scheduler(object): - def __init__(self, fg): - graphs = fg.partition_graph(fg.blocks) - # print "@@@ # graphs = %d" % (len(graphs)) - - self.state = [] - - for g in graphs: - list_of_blocks = [x.block() for x in g] - sts = single_threaded_scheduler(list_of_blocks) - thread = scheduler_thread(sts) - thread.setDaemon(1) - self.state.append((sts, thread)) - - def start(self): - for (sts, thread) in self.state: - thread.start() - - def stop(self): - for (sts, thread) in self.state: - sts.stop() - self.wait() - - def wait(self): - for (sts, thread) in self.state: - timeout = 0.100 - while True: - thread.join(timeout) - if not thread.isAlive(): - break -- cgit From d1685679788103a280f4c7b373051b9e1779571f Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 23 Oct 2010 11:49:35 -0700 Subject: Missed a few: s/_swig_py_/_/ --- gnuradio-core/src/lib/swig/Makefile.am | 2 +- gnuradio-core/src/lib/swig/gnuradio_core.scm | 32 ++++++++++++++++++++ gnuradio-core/src/lib/swig/gnuradio_core_filter.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_general.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_gengen.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_hier.i | 4 +-- gnuradio-core/src/lib/swig/gnuradio_core_io.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_runtime.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm | 34 ---------------------- 9 files changed, 40 insertions(+), 42 deletions(-) create mode 100644 gnuradio-core/src/lib/swig/gnuradio_core.scm delete mode 100644 gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 9e0d2f69e..fb8577f72 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -55,7 +55,7 @@ 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. -grguile_DATA = gnuradio_swig.scm +grguile_DATA = gnuradio_core.scm endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_core.scm b/gnuradio-core/src/lib/swig/gnuradio_core.scm new file mode 100644 index 000000000..2aae2d1d8 --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio_core.scm @@ -0,0 +1,32 @@ +;;; +;;; 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, write to the Free Software Foundation, Inc., +;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +;;; + +;; Only use these if load-* fails to find a .scm or .so. If you can't +;; find a .so, try running ldconfig. guile seems to only load modules +;; that are in the ldconfig paths. +;; (set! %load-path (append %load-path '("/usr/lib/guile/gnuradio"))) +;; (set! %load-path (append %load-path '("/usr/share/gnuradio"))) + +(load "gnuradio/gnuradio_core_filter.scm") +(load "gnuradio/gnuradio_core_io.scm") +(load "gnuradio/gnuradio_core_runtime.scm") +(load "gnuradio/gnuradio_core_general.scm") +(load "gnuradio/gnuradio_core_gengen.scm") +(load "gnuradio/gnuradio_core_hier.scm") diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_filter.i b/gnuradio-core/src/lib/swig/gnuradio_core_filter.i index d9751d0f1..b03996b76 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_filter.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_filter.i @@ -20,7 +20,7 @@ */ #ifndef SWIGIMPORTED -%module(directors="1") gnuradio_swig_py_filter +%module(directors="1") gnuradio_core_filter #endif //%feature("autodoc", "1"); // generate python docstrings diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_general.i b/gnuradio-core/src/lib/swig/gnuradio_core_general.i index 07ef90e34..a82f1f5b3 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_general.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_general.i @@ -20,7 +20,7 @@ */ #ifndef SWIGIMPORTED -%module(directors="1") gnuradio_swig_py_general +%module(directors="1") gnuradio_core_general #endif //%feature("autodoc", "1"); // generate python docstrings diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i b/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i index ea78d8af6..e6f9ebcf4 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i @@ -20,7 +20,7 @@ */ #ifndef SWIGIMPORTED -%module(directors="1") gnuradio_swig_py_gengen +%module(directors="1") gnuradio_core_gengen #endif //%feature("autodoc", "1"); // generate python docstrings diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_hier.i b/gnuradio-core/src/lib/swig/gnuradio_core_hier.i index f69b80334..0da432ce0 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_hier.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_hier.i @@ -20,7 +20,7 @@ */ #ifndef SWIGIMPORTED -%module(directors="1") gnuradio_swig_py_hier +%module(directors="1") gnuradio_hier_hier #endif //%feature("autodoc", "1"); // generate python docstrings @@ -31,6 +31,6 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio_core_heir" "SWIG_init") +(load-extension "libguile-gnuradio_core_hier" "SWIG_init") %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_io.i b/gnuradio-core/src/lib/swig/gnuradio_core_io.i index 82acae747..b1dcfaf21 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_io.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_io.i @@ -20,7 +20,7 @@ */ #ifndef SWIGIMPORTED -%module(directors="1") gnuradio_swig_py_io +%module(directors="1") gnuradio_core_io #endif //%feature("autodoc", "1"); // generate python docstrings diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i b/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i index 3cc0a053d..4372b993d 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i @@ -21,7 +21,7 @@ */ #ifndef SWIGIMPORTED -%module(directors="1") gnuradio_swig_py_runtime +%module(directors="1") gnuradio_core_runtime #endif //%feature("autodoc", "1"); // generate python docstrings diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm b/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm deleted file mode 100644 index d08840071..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio_swig_guile.scm +++ /dev/null @@ -1,34 +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, write to the Free Software Foundation, Inc., -;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -;;; - -;; Only use these if load-* fails to find a .scm or .so. If you can't -;; find a .so, try running ldconfig. guile seems to only load modules -;; that are in the ldconfig paths. -;; (set! %load-path (append %load-path '("/usr/lib/guile/gnuradio"))) -;; (set! %load-path (append %load-path '("/usr/share/gnuradio"))) - -(load "gnuradio/gnuradio_swig_py_filter.scm") -(load "gnuradio/gnuradio_swig_py_io.scm") -(load "gnuradio/gnuradio_swig_py_runtime.scm") -(load "gnuradio/gnuradio_swig_py_general.scm") -(load "gnuradio/gnuradio_swig_py_gengen.scm") - -;; FIXME: this don't load for some reason cause of issues with the .so files -;; (load "gnuradio/gnuradio_swig_py_heir.scm") -- cgit From 0a81b7d48de58cd83f7076fb9bd45cf30595c9ec Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 23 Oct 2010 12:04:42 -0700 Subject: rm gnuradio_swig.scm. Got turned into gnuradio_core.scm --- gnuradio-core/src/lib/swig/gnuradio_swig.scm | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 gnuradio-core/src/lib/swig/gnuradio_swig.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig.scm b/gnuradio-core/src/lib/swig/gnuradio_swig.scm deleted file mode 100644 index c07d46a64..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio_swig.scm +++ /dev/null @@ -1,13 +0,0 @@ -;;; -;;; Not sure that we need this for guile or not. -;;; We'll need to assemble the (gnuradio gr) module somewhere... -;;; - -;; # This file implements the old gnuradio_core namespace -;; -;; from gnuradio_swig_py_runtime import * -;; from gnuradio_swig_py_general import * -;; from gnuradio_swig_py_gengen import * -;; from gnuradio_swig_py_filter import * -;; from gnuradio_swig_py_io import * -;; from gnuradio_swig_py_hier import * -- cgit From 5939ce6971607b83b33c2ac0ede627a83670113a Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 23 Oct 2010 19:53:03 -0700 Subject: Move std_complex.i to gnuradio-core/src/lib/swig/guile. Seems to basically work. There's some simple test code inline in gnuradio_core_general.i. --- gnuradio-core/src/lib/swig/.gitignore | 77 +++++++++------------- gnuradio-core/src/lib/swig/Makefile.am | 4 ++ gnuradio-core/src/lib/swig/gnuradio.i | 6 +- gnuradio-core/src/lib/swig/gnuradio_core_general.i | 20 ++++++ gnuradio-core/src/lib/swig/guile/std_complex.i | 30 +++++++++ 5 files changed, 89 insertions(+), 48 deletions(-) create mode 100644 gnuradio-core/src/lib/swig/guile/std_complex.i (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/.gitignore b/gnuradio-core/src/lib/swig/.gitignore index 0018a2a54..75d6ce5b7 100644 --- a/gnuradio-core/src/lib/swig/.gitignore +++ b/gnuradio-core/src/lib/swig/.gitignore @@ -10,51 +10,34 @@ /swigrun.py /swigrun_wrap.c /Makefile.swigdeps.new -/gnuradio_core_runtime.d -/gnuradio_core_general.d -/gnuradio_core_gengen.d -/gnuradio_core_filter.d -/gnuradio_core_io.d /gnuradio_swig_bug_workaround.h -/gnuradio_core_runtime.cc -/gnuradio_core_runtime.h -/gnuradio_core_runtime.py -/gnuradio_core_general.cc -/gnuradio_core_general.h -/gnuradio_core_general.py -/gnuradio_core_gengen.cc -/gnuradio_core_gengen.h -/gnuradio_core_gengen.py -/gnuradio_core_filter.cc -/gnuradio_core_filter.h -/gnuradio_core_filter.py -/gnuradio_core_io.cc -/gnuradio_core_io.h -/gnuradio_core_io.py -/gnuradio_core_hier.cc -/gnuradio_core_hier.h -/gnuradio_core_hier.py -/gnuradio_core_filter_python.cc -/gnuradio_core_filter_python.h -/gnuradio_core_general_python.cc -/gnuradio_core_general_python.h -/gnuradio_core_gengen_python.cc -/gnuradio_core_gengen_python.h -/gnuradio_core_hier_python.cc -/gnuradio_core_hier_python.h -/gnuradio_core_io_python.cc -/gnuradio_core_io_python.h -/gnuradio_core_runtime_python.cc -/gnuradio_core_runtime_python.h -/gnuradio_core_filter.scm -/gnuradio_core_filter_guile.cc -/gnuradio_core_general.scm -/gnuradio_core_general_guile.cc -/gnuradio_core_gengen.scm -/gnuradio_core_gengen_guile.cc -/gnuradio_core_hier.scm -/gnuradio_core_hier_guile.cc -/gnuradio_core_io.scm -/gnuradio_core_io_guile.cc -/gnuradio_core_runtime.scm -/gnuradio_core_runtime_guile.cc +gnuradio_core_filter.cc +gnuradio_core_filter.d +gnuradio_core_filter.h +gnuradio_core_filter.py +gnuradio_core_filter.scm +gnuradio_core_general.cc +gnuradio_core_general.d +gnuradio_core_general.h +gnuradio_core_general.py +gnuradio_core_general.scm +gnuradio_core_gengen.cc +gnuradio_core_gengen.d +gnuradio_core_gengen.h +gnuradio_core_gengen.py +gnuradio_core_gengen.scm +gnuradio_core_hier.cc +gnuradio_core_hier.d +gnuradio_core_hier.h +gnuradio_core_hier.py +gnuradio_core_hier.scm +gnuradio_core_io.cc +gnuradio_core_io.d +gnuradio_core_io.h +gnuradio_core_io.py +gnuradio_core_io.scm +gnuradio_core_runtime.cc +gnuradio_core_runtime.d +gnuradio_core_runtime.h +gnuradio_core_runtime.py +gnuradio_core_runtime.scm diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index fb8577f72..f30b877a1 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -50,6 +50,10 @@ swiginclude_HEADERS = \ gr_swig_block_magic.i \ gr_shared_ptr.i +# SWIG headers that get installed in ${prefix}/include/gnuradio/swig/... +nobase_swiginclude_HEADERS = \ + guile/std_complex.i + if GUILE # This is the top level guile file, which loads all the other scm files diff --git a/gnuradio-core/src/lib/swig/gnuradio.i b/gnuradio-core/src/lib/swig/gnuradio.i index ec0264107..a30655f45 100644 --- a/gnuradio-core/src/lib/swig/gnuradio.i +++ b/gnuradio-core/src/lib/swig/gnuradio.i @@ -42,8 +42,12 @@ // non-local SWIG files %include -%include %include +#ifdef SWIGGUILE +%include +#else +%include +#endif typedef std::complex gr_complex; typedef std::complex gr_complexd; diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_general.i b/gnuradio-core/src/lib/swig/gnuradio_core_general.i index a82f1f5b3..3edca69ef 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_general.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_general.i @@ -29,6 +29,26 @@ %include "general.i" + // Simple test case for complex input and output +%inline +%{ + std::complex complexf_add_2j(std::complex x) + { + return std::complex(x.real(), x.imag() + 2); + } + + std::complex complexd_add_2j(std::complex x) + { + return std::complex(x.real(), x.imag() + 2); + } + + std::complex complexf_add_x_2j(float x, std::complex y) + { + return std::complex(x + y.real(), y.imag() + 2); + } + +%} + #if SWIGGUILE %scheme %{ (load-extension "libguile-gnuradio_core_general" "SWIG_init") diff --git a/gnuradio-core/src/lib/swig/guile/std_complex.i b/gnuradio-core/src/lib/swig/guile/std_complex.i new file mode 100644 index 000000000..cafcfeae3 --- /dev/null +++ b/gnuradio-core/src/lib/swig/guile/std_complex.i @@ -0,0 +1,30 @@ +%{ +#include +%} + +// To the target language, complex number conversion +%typemap(out) complex, complex, std::complex { + $result = scm_make_rectangular( gh_double2scm ($1.real ()), + gh_double2scm ($1.imag ()) ); +} + +// To the target language, complex number conversion +%typemap(out) complex, complex, std::complex { + $result = scm_make_rectangular( gh_double2scm ($1.real ()), + gh_double2scm ($1.imag ()) ); +} + +// From the target language, complex number conversion +%typemap(in) complex, complex, std::complex { + $1 = std::complex( gh_scm2double (scm_real_part ($input)), + gh_scm2double (scm_imag_part ($input)) ); +} + +// From the target language, complex number conversion +%typemap(in) complex, complex, std::complex { + $1 = std::complex( gh_scm2double (scm_real_part ($input)), + gh_scm2double (scm_imag_part ($input)) ); +} + +%typemaps_primitive(%checkcode(CPLXDBL), std::complex); +%typemaps_primitive(%checkcode(CPLXFLT), std::complex); -- cgit From 27d1af7c7511addac638856bc2ffd3cda5e7ab0c Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 23 Oct 2010 20:59:54 -0700 Subject: Add %typecheck for complex. Fixes problem with moving-average-cc. --- gnuradio-core/src/lib/swig/guile/std_complex.i | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/guile/std_complex.i b/gnuradio-core/src/lib/swig/guile/std_complex.i index cafcfeae3..2a5c72aa2 100644 --- a/gnuradio-core/src/lib/swig/guile/std_complex.i +++ b/gnuradio-core/src/lib/swig/guile/std_complex.i @@ -28,3 +28,10 @@ %typemaps_primitive(%checkcode(CPLXDBL), std::complex); %typemaps_primitive(%checkcode(CPLXFLT), std::complex); + +%typecheck(SWIG_TYPECHECK_COMPLEX) + std::complex, std::complex, + const std::complex &, const std::complex & +{ + $1 = scm_is_complex($input) ? 1 : 0; +} -- cgit From 299aba578b76e1f07cb3e4e5ff59ee6b306afb5a Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 28 Oct 2010 15:05:52 -0700 Subject: Version that builds guile goops bindings, but dependencies are hosed. Doesn't compile cleanly, but does enough to allow experimentation with goops wrappers. We're currently seeing the nasty interaction between the package system, the "export" syntax, and generic-functions. See thread here: http://lists.gnu.org/archive/html/guile-user/2006-05/msg00007.html for background. --- gnuradio-core/src/lib/swig/Makefile.am | 7 +- gnuradio-core/src/lib/swig/Makefile.swig.gen | 24 +++---- gnuradio-core/src/lib/swig/Swig/common.scm | 76 ++++++++++++++++++++++ gnuradio-core/src/lib/swig/gnuradio/.gitignore | 12 ++++ gnuradio-core/src/lib/swig/gnuradio/core.scm | 11 ++++ gnuradio-core/src/lib/swig/gnuradio_core.scm | 32 --------- gnuradio-core/src/lib/swig/gnuradio_core_filter.i | 8 ++- gnuradio-core/src/lib/swig/gnuradio_core_general.i | 6 +- gnuradio-core/src/lib/swig/gnuradio_core_gengen.i | 6 +- gnuradio-core/src/lib/swig/gnuradio_core_hier.i | 6 +- gnuradio-core/src/lib/swig/gnuradio_core_io.i | 6 +- gnuradio-core/src/lib/swig/gnuradio_core_runtime.i | 2 +- 12 files changed, 143 insertions(+), 53 deletions(-) create mode 100644 gnuradio-core/src/lib/swig/Swig/common.scm create mode 100644 gnuradio-core/src/lib/swig/gnuradio/.gitignore create mode 100644 gnuradio-core/src/lib/swig/gnuradio/core.scm delete mode 100644 gnuradio-core/src/lib/swig/gnuradio_core.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index f30b877a1..60a1d952e 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -59,7 +59,9 @@ 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. -grguile_DATA = gnuradio_core.scm +nobase_guile_DATA = \ + gnuradio/core.scm \ + Swig/common.scm endif @@ -112,7 +114,8 @@ BUILT_SOURCES += $(PYTHON_GEN) endif # end of if python if GUILE -GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(subst .i,.scm,$(HFILE))) +GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(patsubst %.i,%.scm,$(HFILE))) +#GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(patsubst %.i,gnuradio/%.scm,$(HFILE))) # BUILT_SOURCES += $(foreach HFILE,$(GUILE_GEN), $(subst gnuradio,guile/gnuradio,$(HFILE))) BUILT_SOURCES += $(GUILE_GEN) endif diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index f6e3fa1b1..67cefe7d0 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -46,7 +46,7 @@ gnuradio_core_runtime_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_core_runtime # FIXME: determince whether these should be installed with gnuradio. -gnuradio_core_runtime_scmdir = $(guiledir)/gnuradio +gnuradio_core_runtime_scmdir = $(guiledir) ## SWIG headers are always installed into the same directory. @@ -128,7 +128,7 @@ gnuradio_core_runtime_scmlib_LTLIBRARIES = libguile-gnuradio_core_runtime.la libguile_gnuradio_core_runtime_la_SOURCES = \ guile/gnuradio_core_runtime.cc \ $(gnuradio_core_runtime_la_swig_sources) -gnuradio_core_runtime_scm_DATA = gnuradio_core_runtime.scm +nobase_gnuradio_core_runtime_scm_DATA = gnuradio/gnuradio_core_runtime.scm gnuradio/gnuradio_core_runtime-primtive.scm # Guile can use the same flags as python does libguile_gnuradio_core_runtime_la_LIBADD = $(_gnuradio_core_runtime_la_LIBADD) @@ -194,7 +194,7 @@ gnuradio_core_general_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_core_general # FIXME: determince whether these should be installed with gnuradio. -gnuradio_core_general_scmdir = $(guiledir)/gnuradio +gnuradio_core_general_scmdir = $(guiledir) ## SWIG headers are always installed into the same directory. @@ -276,7 +276,7 @@ gnuradio_core_general_scmlib_LTLIBRARIES = libguile-gnuradio_core_general.la libguile_gnuradio_core_general_la_SOURCES = \ guile/gnuradio_core_general.cc \ $(gnuradio_core_general_la_swig_sources) -gnuradio_core_general_scm_DATA = gnuradio_core_general.scm +nobase_gnuradio_core_general_scm_DATA = gnuradio/gnuradio_core_general.scm gnuradio/gnuradio_core_general-primtive.scm # Guile can use the same flags as python does libguile_gnuradio_core_general_la_LIBADD = $(_gnuradio_core_general_la_LIBADD) @@ -342,7 +342,7 @@ gnuradio_core_gengen_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_core_gengen # FIXME: determince whether these should be installed with gnuradio. -gnuradio_core_gengen_scmdir = $(guiledir)/gnuradio +gnuradio_core_gengen_scmdir = $(guiledir) ## SWIG headers are always installed into the same directory. @@ -424,7 +424,7 @@ gnuradio_core_gengen_scmlib_LTLIBRARIES = libguile-gnuradio_core_gengen.la libguile_gnuradio_core_gengen_la_SOURCES = \ guile/gnuradio_core_gengen.cc \ $(gnuradio_core_gengen_la_swig_sources) -gnuradio_core_gengen_scm_DATA = gnuradio_core_gengen.scm +nobase_gnuradio_core_gengen_scm_DATA = gnuradio/gnuradio_core_gengen.scm gnuradio/gnuradio_core_gengen-primtive.scm # Guile can use the same flags as python does libguile_gnuradio_core_gengen_la_LIBADD = $(_gnuradio_core_gengen_la_LIBADD) @@ -490,7 +490,7 @@ gnuradio_core_filter_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_core_filter # FIXME: determince whether these should be installed with gnuradio. -gnuradio_core_filter_scmdir = $(guiledir)/gnuradio +gnuradio_core_filter_scmdir = $(guiledir) ## SWIG headers are always installed into the same directory. @@ -572,7 +572,7 @@ gnuradio_core_filter_scmlib_LTLIBRARIES = libguile-gnuradio_core_filter.la libguile_gnuradio_core_filter_la_SOURCES = \ guile/gnuradio_core_filter.cc \ $(gnuradio_core_filter_la_swig_sources) -gnuradio_core_filter_scm_DATA = gnuradio_core_filter.scm +nobase_gnuradio_core_filter_scm_DATA = gnuradio/gnuradio_core_filter.scm gnuradio/gnuradio_core_filter-primtive.scm # Guile can use the same flags as python does libguile_gnuradio_core_filter_la_LIBADD = $(_gnuradio_core_filter_la_LIBADD) @@ -638,7 +638,7 @@ gnuradio_core_io_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_core_io # FIXME: determince whether these should be installed with gnuradio. -gnuradio_core_io_scmdir = $(guiledir)/gnuradio +gnuradio_core_io_scmdir = $(guiledir) ## SWIG headers are always installed into the same directory. @@ -720,7 +720,7 @@ gnuradio_core_io_scmlib_LTLIBRARIES = libguile-gnuradio_core_io.la libguile_gnuradio_core_io_la_SOURCES = \ guile/gnuradio_core_io.cc \ $(gnuradio_core_io_la_swig_sources) -gnuradio_core_io_scm_DATA = gnuradio_core_io.scm +nobase_gnuradio_core_io_scm_DATA = gnuradio/gnuradio_core_io.scm gnuradio/gnuradio_core_io-primtive.scm # Guile can use the same flags as python does libguile_gnuradio_core_io_la_LIBADD = $(_gnuradio_core_io_la_LIBADD) @@ -786,7 +786,7 @@ gnuradio_core_hier_scmlibdir = $(libdir) # The scm files for the guile modules get installed where ever guile # is installed, usually /usr/share/guile/site/gnuradio_core_hier # FIXME: determince whether these should be installed with gnuradio. -gnuradio_core_hier_scmdir = $(guiledir)/gnuradio +gnuradio_core_hier_scmdir = $(guiledir) ## SWIG headers are always installed into the same directory. @@ -868,7 +868,7 @@ gnuradio_core_hier_scmlib_LTLIBRARIES = libguile-gnuradio_core_hier.la libguile_gnuradio_core_hier_la_SOURCES = \ guile/gnuradio_core_hier.cc \ $(gnuradio_core_hier_la_swig_sources) -gnuradio_core_hier_scm_DATA = gnuradio_core_hier.scm +nobase_gnuradio_core_hier_scm_DATA = gnuradio/gnuradio_core_hier.scm gnuradio/gnuradio_core_hier-primtive.scm # Guile can use the same flags as python does libguile_gnuradio_core_hier_la_LIBADD = $(_gnuradio_core_hier_la_LIBADD) diff --git a/gnuradio-core/src/lib/swig/Swig/common.scm b/gnuradio-core/src/lib/swig/Swig/common.scm new file mode 100644 index 000000000..a51d3a71d --- /dev/null +++ b/gnuradio-core/src/lib/swig/Swig/common.scm @@ -0,0 +1,76 @@ +;;;************************************************************************ +;;;*common.scm +;;;* +;;;* This file contains generic SWIG GOOPS classes for generated +;;;* GOOPS file support +;;;* +;;;* Copyright (C) 2003 John Lenz (jelenz@wisc.edu) +;;;* Copyright (C) 2004 Matthias Koeppe (mkoeppe@mail.math.uni-magdeburg.de) +;;;* +;;;* This file may be freely redistributed without license or fee provided +;;;* this copyright message remains intact. +;;;************************************************************************ + +(define-module (Swig swigrun)) + +(define-module (Swig common) + #:use-module (oop goops) + #:use-module (Swig swigrun)) + +(define-class () + (new-function #:init-value #f)) + +(define-method (initialize (class ) initargs) + (slot-set! class 'new-function (get-keyword #:new-function initargs #f)) + (next-method)) + +(define-class () + (swig-smob #:init-value #f) + #:metaclass +) + +(define-method (initialize (obj ) initargs) + (next-method) + (slot-set! obj 'swig-smob + (let ((arg (get-keyword #:init-smob initargs #f))) + (if arg + arg + (let ((ret (apply (slot-ref (class-of obj) 'new-function) (get-keyword #:args initargs '())))) + ;; if the class is registered with runtime environment, + ;; new-Function will return a goops class. In that case, extract the smob + ;; from that goops class and set it as the current smob. + (if (slot-exists? ret 'swig-smob) + (slot-ref ret 'swig-smob) + ret)))))) + +(define (display-address o file) + (display (number->string (object-address o) 16) file)) + +(define (display-pointer-address o file) + ;; Don't fail if the function SWIG-PointerAddress is not present. + (let ((address (false-if-exception (SWIG-PointerAddress o)))) + (if address + (begin + (display " @ " file) + (display (number->string address 16) file))))) + +(define-method (write (o ) file) + ;; We display _two_ addresses to show the object's identity: + ;; * first the address of the GOOPS proxy object, + ;; * second the pointer address. + ;; The reason is that proxy objects are created and discarded on the + ;; fly, so different proxy objects for the same C object will appear. + (let ((class (class-of o))) + (if (slot-bound? class 'name) + (begin + (display "#<" file) + (display (class-name class) file) + (display #\space file) + (display-address o file) + (display-pointer-address o file) + (display ">" file)) + (next-method)))) + +(export ) + +;;; common.scm ends here diff --git a/gnuradio-core/src/lib/swig/gnuradio/.gitignore b/gnuradio-core/src/lib/swig/gnuradio/.gitignore new file mode 100644 index 000000000..20ce65795 --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio/.gitignore @@ -0,0 +1,12 @@ +/gnuradio_core_filter.scm +/gnuradio_core_filter-primitive.scm +/gnuradio_core_general.scm +/gnuradio_core_general-primitive.scm +/gnuradio_core_gengen.scm +/gnuradio_core_gengen-primitive.scm +/gnuradio_core_hier.scm +/gnuradio_core_hier-primitive.scm +/gnuradio_core_io.scm +/gnuradio_core_io-primitive.scm +/gnuradio_core_runtime.scm +/gnuradio_core_runtime-primitive.scm diff --git a/gnuradio-core/src/lib/swig/gnuradio/core.scm b/gnuradio-core/src/lib/swig/gnuradio/core.scm new file mode 100644 index 000000000..3b12d4025 --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio/core.scm @@ -0,0 +1,11 @@ +(define-module (gnuradio core) + #:use-module (gnuradio gnuradio_core_runtime) + #:use-module (gnuradio gnuradio_core_filter) + #:use-module (gnuradio gnuradio_core_io) + #:use-module (gnuradio gnuradio_core_general) + #:use-module (gnuradio gnuradio_core_gengen) + #:use-module (gnuradio gnuradio_core_hier) + #:duplicates (merge-generics replace warn-override-core warn last)) + +;; re-export everything... + diff --git a/gnuradio-core/src/lib/swig/gnuradio_core.scm b/gnuradio-core/src/lib/swig/gnuradio_core.scm deleted file mode 100644 index 2aae2d1d8..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio_core.scm +++ /dev/null @@ -1,32 +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, write to the Free Software Foundation, Inc., -;;; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -;;; - -;; Only use these if load-* fails to find a .scm or .so. If you can't -;; find a .so, try running ldconfig. guile seems to only load modules -;; that are in the ldconfig paths. -;; (set! %load-path (append %load-path '("/usr/lib/guile/gnuradio"))) -;; (set! %load-path (append %load-path '("/usr/share/gnuradio"))) - -(load "gnuradio/gnuradio_core_filter.scm") -(load "gnuradio/gnuradio_core_io.scm") -(load "gnuradio/gnuradio_core_runtime.scm") -(load "gnuradio/gnuradio_core_general.scm") -(load "gnuradio/gnuradio_core_gengen.scm") -(load "gnuradio/gnuradio_core_hier.scm") diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_filter.i b/gnuradio-core/src/lib/swig/gnuradio_core_filter.i index b03996b76..0acbfa3a6 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_filter.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_filter.i @@ -31,6 +31,10 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio_core_filter" "SWIG_init") +(load-extension "libguile-gnuradio_core_filter" "scm_init_gnuradio_gnuradio_core_filter_module") %} - #endif + +%goops %{ + (use-modules (gnuradio gnuradio_core_runtime)) +%} +#endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_general.i b/gnuradio-core/src/lib/swig/gnuradio_core_general.i index 3edca69ef..8b3bf971b 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_general.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_general.i @@ -51,6 +51,10 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio_core_general" "SWIG_init") +(load-extension "libguile-gnuradio_core_general" "scm_init_gnuradio_gnuradio_core_general_module") +%} + +%goops %{ + (use-modules (gnuradio gnuradio_core_runtime)) %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i b/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i index e6f9ebcf4..c08109173 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i @@ -31,6 +31,10 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio_core_gengen" "SWIG_init") +(load-extension "libguile-gnuradio_core_gengen" "scm_init_gnuradio_gnuradio_core_gengen_module") +%} + +%goops %{ + (use-modules (gnuradio gnuradio_core_runtime)) %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_hier.i b/gnuradio-core/src/lib/swig/gnuradio_core_hier.i index 0da432ce0..6d7a38321 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_hier.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_hier.i @@ -31,6 +31,10 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio_core_hier" "SWIG_init") +(load-extension "libguile-gnuradio_core_hier" "scm_init_gnuradio_gnuradio_core_hier_module") +%} + +%goops %{ + (use-modules (gnuradio gnuradio_core_runtime)) %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_io.i b/gnuradio-core/src/lib/swig/gnuradio_core_io.i index b1dcfaf21..936522ada 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_io.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_io.i @@ -31,6 +31,10 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio_core_io" "SWIG_init") +(load-extension "libguile-gnuradio_core_io" "scm_init_gnuradio_gnuradio_core_io_module") +%} + +%goops %{ + (use-modules (gnuradio gnuradio_core_runtime)) %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i b/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i index 4372b993d..2f6ca8227 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i @@ -34,6 +34,6 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio_core_runtime" "SWIG_init") +(load-extension "libguile-gnuradio_core_runtime" "scm_init_gnuradio_gnuradio_core_runtime_module") %} #endif -- cgit From cbfffe4100daff91746db0b6ea66cec9f7b2ceed Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 29 Oct 2010 02:20:32 -0700 Subject: Move sizeof_* from gnuradio.i to runtime.i to avoid multiple definitions --- gnuradio-core/src/lib/runtime/runtime.i | 7 +++++++ gnuradio-core/src/lib/swig/gnuradio.i | 9 --------- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/runtime.i b/gnuradio-core/src/lib/runtime/runtime.i index 20cf68a03..ca89b8fbd 100644 --- a/gnuradio-core/src/lib/runtime/runtime.i +++ b/gnuradio-core/src/lib/runtime/runtime.i @@ -40,6 +40,13 @@ #include %} +%constant int sizeof_char = sizeof(char); +%constant int sizeof_short = sizeof(short); +%constant int sizeof_int = sizeof(int); +%constant int sizeof_float = sizeof(float); +%constant int sizeof_double = sizeof(double); +%constant int sizeof_gr_complex = sizeof(gr_complex); + %include %include %include diff --git a/gnuradio-core/src/lib/swig/gnuradio.i b/gnuradio-core/src/lib/swig/gnuradio.i index a30655f45..6eb44cbe9 100644 --- a/gnuradio-core/src/lib/swig/gnuradio.i +++ b/gnuradio-core/src/lib/swig/gnuradio.i @@ -76,15 +76,6 @@ namespace std { //////////////////////////////////////////////////////////////////////// -%constant int sizeof_char = sizeof(char); -%constant int sizeof_short = sizeof(short); -%constant int sizeof_int = sizeof(int); -%constant int sizeof_float = sizeof(float); -%constant int sizeof_double = sizeof(double); -%constant int sizeof_gr_complex = sizeof(gr_complex); - -//////////////////////////////////////////////////////////////////////// - #ifndef SW_RUNTIME // import runtime.i for all but sw_runtime, since it needs to %include %import -- cgit From da69e1c1f910cf6ab4fd54dea25255e266b2918e Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 29 Oct 2010 03:54:07 -0700 Subject: gnuradio-core modules are almost loading cleanly. --- gnuradio-core/src/lib/swig/Makefile.am | 1 + gnuradio-core/src/lib/swig/gnuradio/core.scm | 6 ++- .../src/lib/swig/gnuradio/export-safely.scm | 45 ++++++++++++++++++++++ gnuradio-core/src/lib/swig/gnuradio_core_general.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_runtime.i | 7 ++++ 5 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 gnuradio-core/src/lib/swig/gnuradio/export-safely.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 60a1d952e..b9bc75348 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -60,6 +60,7 @@ if GUILE # for gnuradio. This has to be installed top level to be found in the # default search path. nobase_guile_DATA = \ + gnuradio/export-safely.scm \ gnuradio/core.scm \ Swig/common.scm endif diff --git a/gnuradio-core/src/lib/swig/gnuradio/core.scm b/gnuradio-core/src/lib/swig/gnuradio/core.scm index 3b12d4025..294881146 100644 --- a/gnuradio-core/src/lib/swig/gnuradio/core.scm +++ b/gnuradio-core/src/lib/swig/gnuradio/core.scm @@ -1,3 +1,5 @@ +;;; Glue the separate pieces of gnuradio-core into a single module + (define-module (gnuradio core) #:use-module (gnuradio gnuradio_core_runtime) #:use-module (gnuradio gnuradio_core_filter) @@ -5,7 +7,7 @@ #:use-module (gnuradio gnuradio_core_general) #:use-module (gnuradio gnuradio_core_gengen) #:use-module (gnuradio gnuradio_core_hier) - #:duplicates (merge-generics replace warn-override-core warn last)) + #:duplicates (merge-generics check)) ;; re-export everything... - +(re-export-all (current-module)) diff --git a/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm b/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm new file mode 100644 index 000000000..52530abc9 --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm @@ -0,0 +1,45 @@ +(define-module (gnuradio export-safely) + #:use-module (oop goops) + #:use-module (srfi srfi-1) + #:export-syntax (export-safely)) + +(define-public (generics-in-module module) + (let ((lst '())) + (module-for-each (lambda (sym var) + (if (variable-bound? var) + (let ((v (variable-ref var))) + (cond ((is-a? v ) + (set! lst (cons v lst))))))) + module) + lst)) + +(define-public (generic-function-names-in-module module) + (map generic-function-name (generics-in-module module))) + +(define-public (generic-function-names-in-imported-modules module) + (concatenate (map generic-function-names-in-module (module-uses module)))) + +(define-public (export-syms-if-not-imported-gf list-of-syms) + (let ((gf-names (generic-function-names-in-imported-modules (current-module)))) + (let ((to-export (filter (lambda (sym) + (not (memq sym gf-names))) + list-of-syms))) + (module-export! (current-module) to-export)))) + +(defmacro export-safely names + `(export-syms-if-not-imported-gf ',names)) + + +(define-public (names-in-module module) + (let ((lst '())) + (module-for-each (lambda (sym var) + (if (variable-bound? var) + (set! lst (cons sym lst)))) + module) + lst)) + +(define-public (names-in-imported-modules module) + (concatenate (map names-in-module (module-uses module)))) + +(define-public (re-export-all module) + (module-re-export! module (names-in-imported-modules module))) diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_general.i b/gnuradio-core/src/lib/swig/gnuradio_core_general.i index 8b3bf971b..759a65459 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_general.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_general.i @@ -55,6 +55,6 @@ %} %goops %{ - (use-modules (gnuradio gnuradio_core_runtime)) +(use-modules (gnuradio gnuradio_core_runtime)) %} #endif diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i b/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i index 2f6ca8227..bb10b36b2 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i @@ -36,4 +36,11 @@ %scheme %{ (load-extension "libguile-gnuradio_core_runtime" "scm_init_gnuradio_gnuradio_core_runtime_module") %} + +%goops %{ +(use-modules (gnuradio export-safely)) +(re-export export-syms-if-not-imported-gf) +(re-export-syntax export-safely) +(re-export re-export-all) +%} #endif -- cgit From 8579841a28eb07fdfc72cb9bb594f76e71465902 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 29 Oct 2010 03:56:17 -0700 Subject: Remove duplicate include of gr_endianness.i from general.i --- gnuradio-core/src/lib/general/general.i | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index 68cafce2e..3ad40b218 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -53,7 +53,7 @@ #include #include #include -#include +//#include #include #include #include @@ -173,7 +173,7 @@ %include "gr_align_on_samplenumbers_ss.i" %include "gr_complex_to_xxx.i" %include "gr_complex_to_interleaved_short.i" -%include "gr_endianness.i" +//%include "gr_endianness.i" %include "gr_interleaved_short_to_complex.i" %include "gr_firdes.i" %include "gr_interleave.i" -- cgit From 2a6649f9eafd467dbb5467e2a4d46affffc1afbd Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 29 Oct 2010 03:56:48 -0700 Subject: Disable gr_message_source until later... --- gnuradio-core/src/lib/io/gr_message_source.i | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/io/gr_message_source.i b/gnuradio-core/src/lib/io/gr_message_source.i index 8a9c762d0..3566ee5a7 100644 --- a/gnuradio-core/src/lib/io/gr_message_source.i +++ b/gnuradio-core/src/lib/io/gr_message_source.i @@ -20,6 +20,10 @@ * Boston, MA 02110-1301, USA. */ +#ifdef SWIGGUILE +#warning "gr_message_source.i: FIXME being ignored by swig/guile for now" +#else + GR_SWIG_BLOCK_MAGIC(gr,message_source); gr_message_source_sptr gr_make_message_source (size_t itemsize, int msgq_limit=0); @@ -36,3 +40,4 @@ class gr_message_source : public gr_sync_block gr_msg_queue_sptr msgq() const; }; +#endif -- cgit From 589f7bfacff26a373c88a11b507d9d58ce2cf55b Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 29 Oct 2010 04:50:13 -0700 Subject: Modules now load cleanly! --- .../src/lib/swig/gnuradio/export-safely.scm | 48 ++++++++++++++++++++-- 1 file changed, 45 insertions(+), 3 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm b/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm index 52530abc9..2da7e633e 100644 --- a/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm +++ b/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm @@ -1,3 +1,37 @@ +;;; +;;; 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 module implements a macro, export-safely, that avoids +;;; exporting symbols that are actually generic-functions imported +;;; (explicity or implicitly) from elsewhere. +;;; +;;; This hackery is required so that the swig generated goops wrappers +;;; don't stomp on each other. For background on what this is about +;;; see this thread: +;;; +;;; http://lists.gnu.org/archive/html/guile-user/2006-05/msg00007.html +;;; +;;; Don't expect to understand what's going on here without looking at +;;; the guts of the module system (implemented in ice-9/boot-9.scm) and +;;; having a pretty good understanding of goops and generic-functions. + + (define-module (gnuradio export-safely) #:use-module (oop goops) #:use-module (srfi srfi-1) @@ -23,7 +57,7 @@ (let ((gf-names (generic-function-names-in-imported-modules (current-module)))) (let ((to-export (filter (lambda (sym) (not (memq sym gf-names))) - list-of-syms))) + (delete-duplicates list-of-syms)))) (module-export! (current-module) to-export)))) (defmacro export-safely names @@ -39,7 +73,15 @@ lst)) (define-public (names-in-imported-modules module) - (concatenate (map names-in-module (module-uses module)))) + (delete-duplicates (concatenate (map names-in-module (module-uses module))))) (define-public (re-export-all module) - (module-re-export! module (names-in-imported-modules module))) + (define (ok-to-re-export? name) + (let ((var (module-variable module name))) + (cond ((not var) #f) ; Undefined var + ((eq? var (module-local-variable module name)) #f) ; local var + (else #t)))) ; OK + + (module-re-export! module + (filter ok-to-re-export? + (names-in-imported-modules module)))) -- cgit From 40fac3c4a2f5f1f6dde79e96be8f40535e11343b Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sat, 30 Oct 2010 12:14:16 -0600 Subject: regenerated --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 30 ++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index 67cefe7d0..69042f84e 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -128,7 +128,7 @@ gnuradio_core_runtime_scmlib_LTLIBRARIES = libguile-gnuradio_core_runtime.la libguile_gnuradio_core_runtime_la_SOURCES = \ guile/gnuradio_core_runtime.cc \ $(gnuradio_core_runtime_la_swig_sources) -nobase_gnuradio_core_runtime_scm_DATA = gnuradio/gnuradio_core_runtime.scm gnuradio/gnuradio_core_runtime-primtive.scm +nobase_gnuradio_core_runtime_scm_DATA = gnuradio/gnuradio_core_runtime.scm gnuradio/gnuradio_core_runtime-primitive.scm # Guile can use the same flags as python does libguile_gnuradio_core_runtime_la_LIBADD = $(_gnuradio_core_runtime_la_LIBADD) @@ -137,6 +137,9 @@ libguile_gnuradio_core_runtime_la_CXXFLAGS = $(_gnuradio_core_runtime_la_CXXFLAG guile/gnuradio_core_runtime.lo: gnuradio_core_runtime.lo gnuradio_core_runtime.scm: gnuradio_core_runtime.i +gnuradio/gnuradio_core_runtime-primitive.scm: gnuradio_core_runtime.scm + +-include guile/gnuradio_core_runtime.d endif # end of GUILE @@ -276,7 +279,7 @@ gnuradio_core_general_scmlib_LTLIBRARIES = libguile-gnuradio_core_general.la libguile_gnuradio_core_general_la_SOURCES = \ guile/gnuradio_core_general.cc \ $(gnuradio_core_general_la_swig_sources) -nobase_gnuradio_core_general_scm_DATA = gnuradio/gnuradio_core_general.scm gnuradio/gnuradio_core_general-primtive.scm +nobase_gnuradio_core_general_scm_DATA = gnuradio/gnuradio_core_general.scm gnuradio/gnuradio_core_general-primitive.scm # Guile can use the same flags as python does libguile_gnuradio_core_general_la_LIBADD = $(_gnuradio_core_general_la_LIBADD) @@ -285,6 +288,9 @@ libguile_gnuradio_core_general_la_CXXFLAGS = $(_gnuradio_core_general_la_CXXFLAG guile/gnuradio_core_general.lo: gnuradio_core_general.lo gnuradio_core_general.scm: gnuradio_core_general.i +gnuradio/gnuradio_core_general-primitive.scm: gnuradio_core_general.scm + +-include guile/gnuradio_core_general.d endif # end of GUILE @@ -424,7 +430,7 @@ gnuradio_core_gengen_scmlib_LTLIBRARIES = libguile-gnuradio_core_gengen.la libguile_gnuradio_core_gengen_la_SOURCES = \ guile/gnuradio_core_gengen.cc \ $(gnuradio_core_gengen_la_swig_sources) -nobase_gnuradio_core_gengen_scm_DATA = gnuradio/gnuradio_core_gengen.scm gnuradio/gnuradio_core_gengen-primtive.scm +nobase_gnuradio_core_gengen_scm_DATA = gnuradio/gnuradio_core_gengen.scm gnuradio/gnuradio_core_gengen-primitive.scm # Guile can use the same flags as python does libguile_gnuradio_core_gengen_la_LIBADD = $(_gnuradio_core_gengen_la_LIBADD) @@ -433,6 +439,9 @@ libguile_gnuradio_core_gengen_la_CXXFLAGS = $(_gnuradio_core_gengen_la_CXXFLAGS) guile/gnuradio_core_gengen.lo: gnuradio_core_gengen.lo gnuradio_core_gengen.scm: gnuradio_core_gengen.i +gnuradio/gnuradio_core_gengen-primitive.scm: gnuradio_core_gengen.scm + +-include guile/gnuradio_core_gengen.d endif # end of GUILE @@ -572,7 +581,7 @@ gnuradio_core_filter_scmlib_LTLIBRARIES = libguile-gnuradio_core_filter.la libguile_gnuradio_core_filter_la_SOURCES = \ guile/gnuradio_core_filter.cc \ $(gnuradio_core_filter_la_swig_sources) -nobase_gnuradio_core_filter_scm_DATA = gnuradio/gnuradio_core_filter.scm gnuradio/gnuradio_core_filter-primtive.scm +nobase_gnuradio_core_filter_scm_DATA = gnuradio/gnuradio_core_filter.scm gnuradio/gnuradio_core_filter-primitive.scm # Guile can use the same flags as python does libguile_gnuradio_core_filter_la_LIBADD = $(_gnuradio_core_filter_la_LIBADD) @@ -581,6 +590,9 @@ libguile_gnuradio_core_filter_la_CXXFLAGS = $(_gnuradio_core_filter_la_CXXFLAGS) guile/gnuradio_core_filter.lo: gnuradio_core_filter.lo gnuradio_core_filter.scm: gnuradio_core_filter.i +gnuradio/gnuradio_core_filter-primitive.scm: gnuradio_core_filter.scm + +-include guile/gnuradio_core_filter.d endif # end of GUILE @@ -720,7 +732,7 @@ gnuradio_core_io_scmlib_LTLIBRARIES = libguile-gnuradio_core_io.la libguile_gnuradio_core_io_la_SOURCES = \ guile/gnuradio_core_io.cc \ $(gnuradio_core_io_la_swig_sources) -nobase_gnuradio_core_io_scm_DATA = gnuradio/gnuradio_core_io.scm gnuradio/gnuradio_core_io-primtive.scm +nobase_gnuradio_core_io_scm_DATA = gnuradio/gnuradio_core_io.scm gnuradio/gnuradio_core_io-primitive.scm # Guile can use the same flags as python does libguile_gnuradio_core_io_la_LIBADD = $(_gnuradio_core_io_la_LIBADD) @@ -729,6 +741,9 @@ libguile_gnuradio_core_io_la_CXXFLAGS = $(_gnuradio_core_io_la_CXXFLAGS) guile/gnuradio_core_io.lo: gnuradio_core_io.lo gnuradio_core_io.scm: gnuradio_core_io.i +gnuradio/gnuradio_core_io-primitive.scm: gnuradio_core_io.scm + +-include guile/gnuradio_core_io.d endif # end of GUILE @@ -868,7 +883,7 @@ gnuradio_core_hier_scmlib_LTLIBRARIES = libguile-gnuradio_core_hier.la libguile_gnuradio_core_hier_la_SOURCES = \ guile/gnuradio_core_hier.cc \ $(gnuradio_core_hier_la_swig_sources) -nobase_gnuradio_core_hier_scm_DATA = gnuradio/gnuradio_core_hier.scm gnuradio/gnuradio_core_hier-primtive.scm +nobase_gnuradio_core_hier_scm_DATA = gnuradio/gnuradio_core_hier.scm gnuradio/gnuradio_core_hier-primitive.scm # Guile can use the same flags as python does libguile_gnuradio_core_hier_la_LIBADD = $(_gnuradio_core_hier_la_LIBADD) @@ -877,6 +892,9 @@ libguile_gnuradio_core_hier_la_CXXFLAGS = $(_gnuradio_core_hier_la_CXXFLAGS) guile/gnuradio_core_hier.lo: gnuradio_core_hier.lo gnuradio_core_hier.scm: gnuradio_core_hier.i +gnuradio/gnuradio_core_hier-primitive.scm: gnuradio_core_hier.scm + +-include guile/gnuradio_core_hier.d endif # end of GUILE -- cgit From f7d9be06a59c30e3e964456d2f6c95e64d8ec05f Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sat, 30 Oct 2010 12:15:49 -0600 Subject: move good comment to here where it belongs --- gnuradio-core/src/lib/swig/Makefile.am | 4 ---- 1 file changed, 4 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index b9bc75348..2b763d94c 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -124,7 +124,3 @@ endif # Do not distribute the output of SWIG no_dist_files = $(swig_built_sources) -# Compile a .i to what guile needs. We use -o to set the output file name, -# or even with -outdir guile in SWIG_GUILE_ARGS, swig keeps putting a -# gnuradio_core_*_wrap.cxx in the source directory. - -- cgit From c34cf20f501dea19385cb42bf31e92ad889e7040 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 30 Oct 2010 18:17:12 -0700 Subject: Rename basic_block coersion method to to_basic_block. Add to_hier_block2 and to_top_block. basic_block was renamed because the number of guile generic methods on basic_block was getting large and confusing. to_hier_block2 and to_top_block were added to support coercion to those types in guile (and python). This change simplifies the handling of "connect" in guile. --- gnuradio-core/src/lib/runtime/gr_basic_block.cc | 2 +- gnuradio-core/src/lib/runtime/gr_basic_block.h | 2 +- gnuradio-core/src/lib/runtime/gr_basic_block.i | 2 +- gnuradio-core/src/lib/runtime/gr_hier_block2.cc | 5 +++++ gnuradio-core/src/lib/runtime/gr_hier_block2.h | 2 ++ gnuradio-core/src/lib/runtime/gr_hier_block2.i | 2 ++ gnuradio-core/src/lib/runtime/gr_top_block.cc | 6 ++++++ gnuradio-core/src/lib/runtime/gr_top_block.h | 7 +++++++ gnuradio-core/src/lib/runtime/gr_top_block.i | 2 ++ gnuradio-core/src/python/gnuradio/gr/hier_block2.py | 14 +++++++------- gnuradio-core/src/python/gnuradio/gr/top_block.py | 14 +++++++------- 11 files changed, 41 insertions(+), 17 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_basic_block.cc b/gnuradio-core/src/lib/runtime/gr_basic_block.cc index 2fa1066cb..0e0dad16b 100644 --- a/gnuradio-core/src/lib/runtime/gr_basic_block.cc +++ b/gnuradio-core/src/lib/runtime/gr_basic_block.cc @@ -56,7 +56,7 @@ gr_basic_block::~gr_basic_block() } gr_basic_block_sptr -gr_basic_block::basic_block() +gr_basic_block::to_basic_block() { return shared_from_this(); } diff --git a/gnuradio-core/src/lib/runtime/gr_basic_block.h b/gnuradio-core/src/lib/runtime/gr_basic_block.h index b8797fdc6..d059a4bd3 100644 --- a/gnuradio-core/src/lib/runtime/gr_basic_block.h +++ b/gnuradio-core/src/lib/runtime/gr_basic_block.h @@ -81,7 +81,7 @@ public: std::string name() const { return d_name; } gr_io_signature_sptr input_signature() const { return d_input_signature; } gr_io_signature_sptr output_signature() const { return d_output_signature; } - gr_basic_block_sptr basic_block(); // Needed for Python type coercion + gr_basic_block_sptr to_basic_block(); // Needed for Python/Guile type coercion /*! * \brief Confirm that ninputs and noutputs is an acceptable combination. diff --git a/gnuradio-core/src/lib/runtime/gr_basic_block.i b/gnuradio-core/src/lib/runtime/gr_basic_block.i index f1de9e08a..9b360e5ab 100644 --- a/gnuradio-core/src/lib/runtime/gr_basic_block.i +++ b/gnuradio-core/src/lib/runtime/gr_basic_block.i @@ -40,7 +40,7 @@ public: gr_io_signature_sptr input_signature() const; gr_io_signature_sptr output_signature() const; long unique_id() const; - gr_basic_block_sptr basic_block(); + gr_basic_block_sptr to_basic_block(); bool check_topology (int ninputs, int noutputs); }; diff --git a/gnuradio-core/src/lib/runtime/gr_hier_block2.cc b/gnuradio-core/src/lib/runtime/gr_hier_block2.cc index e3a25e1a8..d6e317136 100644 --- a/gnuradio-core/src/lib/runtime/gr_hier_block2.cc +++ b/gnuradio-core/src/lib/runtime/gr_hier_block2.cc @@ -61,6 +61,11 @@ gr_hier_block2::self() return shared_from_this(); } +gr_hier_block2_sptr +gr_hier_block2::to_hier_block2() +{ + return cast_to_hier_block2_sptr(shared_from_this()); +} void gr_hier_block2::connect(gr_basic_block_sptr block) diff --git a/gnuradio-core/src/lib/runtime/gr_hier_block2.h b/gnuradio-core/src/lib/runtime/gr_hier_block2.h index f50b1cb94..0a40c36b7 100644 --- a/gnuradio-core/src/lib/runtime/gr_hier_block2.h +++ b/gnuradio-core/src/lib/runtime/gr_hier_block2.h @@ -147,6 +147,8 @@ public: // This is a public method for ease of code organization, but should be // ignored by the user. gr_flat_flowgraph_sptr flatten() const; + + gr_hier_block2_sptr to_hier_block2(); // Needed for Python/Guile type coercion }; inline gr_hier_block2_sptr cast_to_hier_block2_sptr(gr_basic_block_sptr block) { diff --git a/gnuradio-core/src/lib/runtime/gr_hier_block2.i b/gnuradio-core/src/lib/runtime/gr_hier_block2.i index a62f50e84..1b974fd6b 100644 --- a/gnuradio-core/src/lib/runtime/gr_hier_block2.i +++ b/gnuradio-core/src/lib/runtime/gr_hier_block2.i @@ -57,4 +57,6 @@ public: void disconnect_all(); void lock(); void unlock(); + + gr_hier_block2_sptr to_hier_block2(); // Needed for Python/Guile type coercion }; diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.cc b/gnuradio-core/src/lib/runtime/gr_top_block.cc index 09e46dfbb..f341525c0 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block.cc +++ b/gnuradio-core/src/lib/runtime/gr_top_block.cc @@ -95,3 +95,9 @@ gr_top_block::dump() { d_impl->dump(); } + +gr_top_block_sptr +gr_top_block::to_top_block() +{ + return cast_to_top_block_sptr(shared_from_this()); +} diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.h b/gnuradio-core/src/lib/runtime/gr_top_block.h index 8052954e3..ed244cb7c 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block.h +++ b/gnuradio-core/src/lib/runtime/gr_top_block.h @@ -105,6 +105,13 @@ public: * Displays flattened flowgraph edges and block connectivity */ void dump(); + + gr_top_block_sptr to_top_block(); // Needed for Python/Guile type coercion }; +inline gr_top_block_sptr cast_to_top_block_sptr(gr_basic_block_sptr block) { + return boost::dynamic_pointer_cast(block); +} + + #endif /* INCLUDED_GR_TOP_BLOCK_H */ diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.i b/gnuradio-core/src/lib/runtime/gr_top_block.i index 579ef8f70..d9adf1e18 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block.i +++ b/gnuradio-core/src/lib/runtime/gr_top_block.i @@ -47,6 +47,8 @@ public: void lock(); void unlock() throw (std::runtime_error); void dump(); + + gr_top_block_sptr to_top_block(); // Needed for Python/Guile type coercion }; #ifdef SWIGPYTHON diff --git a/gnuradio-core/src/python/gnuradio/gr/hier_block2.py b/gnuradio-core/src/python/gnuradio/gr/hier_block2.py index f2256da1b..370f8a9d9 100644 --- a/gnuradio-core/src/python/gnuradio/gr/hier_block2.py +++ b/gnuradio-core/src/python/gnuradio/gr/hier_block2.py @@ -66,7 +66,7 @@ class hier_block2(object): raise ValueError, ("connect requires at least one endpoint; %d provided." % (len (points),)) else: if len(points) == 1: - self._hb.connect(points[0].basic_block()) + self._hb.connect(points[0].to_basic_block()) else: for i in range (1, len (points)): self._connect(points[i-1], points[i]) @@ -74,11 +74,11 @@ class hier_block2(object): def _connect(self, src, dst): (src_block, src_port) = self._coerce_endpoint(src) (dst_block, dst_port) = self._coerce_endpoint(dst) - self._hb.connect(src_block.basic_block(), src_port, - dst_block.basic_block(), dst_port) + self._hb.connect(src_block.to_basic_block(), src_port, + dst_block.to_basic_block(), dst_port) def _coerce_endpoint(self, endp): - if hasattr(endp, 'basic_block'): + if hasattr(endp, 'to_basic_block'): return (endp, 0) else: if hasattr(endp, "__getitem__") and len(endp) == 2: @@ -100,7 +100,7 @@ class hier_block2(object): raise ValueError, ("disconnect requires at least two endpoints; %d provided." % (len (points),)) else: if len (points) == 1: - self._hb.disconnect(points[0].basic_block()) + self._hb.disconnect(points[0].to_basic_block()) else: for i in range (1, len (points)): self._disconnect(points[i-1], points[i]) @@ -108,6 +108,6 @@ class hier_block2(object): def _disconnect(self, src, dst): (src_block, src_port) = self._coerce_endpoint(src) (dst_block, dst_port) = self._coerce_endpoint(dst) - self._hb.disconnect(src_block.basic_block(), src_port, - dst_block.basic_block(), dst_port) + self._hb.disconnect(src_block.to_basic_block(), src_port, + dst_block.to_basic_block(), dst_port) diff --git a/gnuradio-core/src/python/gnuradio/gr/top_block.py b/gnuradio-core/src/python/gnuradio/gr/top_block.py index 59bb0438f..8fe5303c8 100644 --- a/gnuradio-core/src/python/gnuradio/gr/top_block.py +++ b/gnuradio-core/src/python/gnuradio/gr/top_block.py @@ -118,7 +118,7 @@ class top_block(object): raise ValueError, ("connect requires at least one endpoint; %d provided." % (len (points),)) else: if len(points) == 1: - self._tb.connect(points[0].basic_block()) + self._tb.connect(points[0].to_basic_block()) else: for i in range (1, len (points)): self._connect(points[i-1], points[i]) @@ -126,11 +126,11 @@ class top_block(object): def _connect(self, src, dst): (src_block, src_port) = self._coerce_endpoint(src) (dst_block, dst_port) = self._coerce_endpoint(dst) - self._tb.connect(src_block.basic_block(), src_port, - dst_block.basic_block(), dst_port) + self._tb.connect(src_block.to_basic_block(), src_port, + dst_block.to_basic_block(), dst_port) def _coerce_endpoint(self, endp): - if hasattr(endp, 'basic_block'): + if hasattr(endp, 'to_basic_block'): return (endp, 0) else: if hasattr(endp, "__getitem__") and len(endp) == 2: @@ -146,7 +146,7 @@ class top_block(object): raise ValueError, ("disconnect requires at least two endpoints; %d provided." % (len (points),)) else: if len(points) == 1: - self._tb.disconnect(points[0].basic_block()) + self._tb.disconnect(points[0].to_basic_block()) else: for i in range (1, len (points)): self._disconnect(points[i-1], points[i]) @@ -154,6 +154,6 @@ class top_block(object): def _disconnect(self, src, dst): (src_block, src_port) = self._coerce_endpoint(src) (dst_block, dst_port) = self._coerce_endpoint(dst) - self._tb.disconnect(src_block.basic_block(), src_port, - dst_block.basic_block(), dst_port) + self._tb.disconnect(src_block.to_basic_block(), src_port, + dst_block.to_basic_block(), dst_port) -- cgit From df6f365b6b703971efc9f29471e0cf1660938fbf Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 30 Oct 2010 20:22:54 -0700 Subject: Routines to coerce blocks and connect them --- gnuradio-core/src/lib/swig/gnuradio/coerce.scm | 88 ++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 gnuradio-core/src/lib/swig/gnuradio/coerce.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio/coerce.scm b/gnuradio-core/src/lib/swig/gnuradio/coerce.scm new file mode 100644 index 000000000..2c508c6a4 --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio/coerce.scm @@ -0,0 +1,88 @@ +;;; +;;; 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 . +;;; + +(define-class () + (block #:accessor block #:init-keyword #:block) + (port #:init-value 0 #:accessor port #:init-keyword #:port)) + +(define (gr:ep block port) + (make + #:block (coerce-to-basic-block block) #:port port)) + +(define (coerce-to-endpoint ep) + (cond ((is-a? ep ) ep) + ((false-if-exception (gr:to-basic-block ep)) + => (lambda (x) (gr:ep x 0))) + ((and (pair? ep) (= 2 (length ep)) + (false-if-exception (gr:to-basic-block (car ep)))) + => (lambda (x) (gr:ep x (cadr ep)))) + (else (error "Cannot coerce to an endpoint: " ep)))) + +(define (coerce-to-basic-block block) + (cond ((is-a? block ) block) + ((false-if-exception (gr:to-basic-block block)) => (lambda (x) x)) + (else (error "Cannot coerce to a gr_basic_block: " block)))) + +(define (coerce-to-top-block block) + (cond ((is-a? block ) block) + ((false-if-exception (gr:to-top-block block)) => (lambda (x) x)) + (else (error "Cannot coerce to a gr_top_block: " block)))) + +(define (coerce-to-hier-block2 block) + (cond ((is-a? block ) block) + ((false-if-exception (gr:to-hier-block2 block)) => (lambda (x) x)) + (else (error "Cannot coerce to a gr_hier_block2: " block)))) + +;;; The gr:connect variants +;;; These work for anything derived from gr_hier_block2 +(define-method (gr:connect hb block) + (let ((hb (coerce-to-hier-block2 hb)) + (bb (coerce-to-basic-block block))) + (gr:connect hb bb))) + +(define-method (gr:connect hb (src ) (dst )) + (let ((hb (coerce-to-hier-block2 hb))) + (gr:connect hb (block src) (port src) (block dst) (port dst)))) + +(define-method (gr:connect hb src dst) + (let ((hb (coerce-to-hier-block2 hb)) + (src (coerce-to-endpoint src)) + (dst (coerce-to-endpoint dst))) + (gr:connect hb src dst))) + +;;; The gr:disconnect variants +;;; These work for anything derived from gr_hier_block2 +(define-method (gr:disconnect-all hb) + (let ((hb (coerce-to-hier-block2 hb))) + (gr:disconnect-all hb))) + +(define-method (gr:disconnect hb block) + (let ((hb (coerce-to-hier-block2 hb)) + (bb (coerce-to-basic-block block))) + (gr:disconnect hb bb))) + +(define-method (gr:disconnect hb (src ) (dst )) + (let ((hb (coerce-to-hier-block2 hb))) + (gr:disconnect hb (block src) (port src) (block dst) (port dst)))) + +(define-method (gr:disconnect hb src dst) + (let ((hb (coerce-to-hier-block2 hb)) + (src (coerce-to-endpoint src)) + (dst (coerce-to-endpoint dst))) + (gr:disconnect hb src dst))) -- cgit From 8fe7f0fe5fe89f6ec32732dd802608060e973f0d Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 31 Oct 2010 20:03:35 -0700 Subject: Cleanup gr:connect and gr:disconnect for Guile. Rename {dis,}connect to {dis,}primitive_connect in .i file. Update python code to reflect change. --- gnuradio-core/src/lib/runtime/gr_hier_block2.i | 5 ++ gnuradio-core/src/lib/swig/gnuradio/coerce.scm | 56 ++++++++++------------ .../src/python/gnuradio/gr/hier_block2.py | 14 +++--- gnuradio-core/src/python/gnuradio/gr/top_block.py | 16 +++---- 4 files changed, 46 insertions(+), 45 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_hier_block2.i b/gnuradio-core/src/lib/runtime/gr_hier_block2.i index 1b974fd6b..32b656e24 100644 --- a/gnuradio-core/src/lib/runtime/gr_hier_block2.i +++ b/gnuradio-core/src/lib/runtime/gr_hier_block2.i @@ -34,6 +34,11 @@ gr_hier_block2_sptr gr_make_hier_block2(const std::string name, gr_io_signature_sptr output_signature) throw (std::runtime_error); +// Rename connect and disconnect so that we can more easily build a +// better interface in scripting land. +%rename(primitive_connect) gr_hier_block2::connect; +%rename(primitive_disconnect) gr_hier_block2::disconnect; + class gr_hier_block2 : public gr_basic_block { private: diff --git a/gnuradio-core/src/lib/swig/gnuradio/coerce.scm b/gnuradio-core/src/lib/swig/gnuradio/coerce.scm index 2c508c6a4..81bc187a6 100644 --- a/gnuradio-core/src/lib/swig/gnuradio/coerce.scm +++ b/gnuradio-core/src/lib/swig/gnuradio/coerce.scm @@ -49,40 +49,36 @@ ((false-if-exception (gr:to-hier-block2 block)) => (lambda (x) x)) (else (error "Cannot coerce to a gr_hier_block2: " block)))) -;;; The gr:connect variants -;;; These work for anything derived from gr_hier_block2 -(define-method (gr:connect hb block) - (let ((hb (coerce-to-hier-block2 hb)) - (bb (coerce-to-basic-block block))) - (gr:connect hb bb))) -(define-method (gr:connect hb (src ) (dst )) - (let ((hb (coerce-to-hier-block2 hb))) - (gr:connect hb (block src) (port src) (block dst) (port dst)))) +;;; Connect one or more block endpoints. An endpoint is either a , +;;; a 2-list (block port), or a block instance. In the latter case, the port number +;;; is assumed to be zero. +;;; +;;; If multiple arguments are provided, connect will attempt to wire them in series, +;;; interpreting the endpoints as inputs or outputs as appropriate. +(define-method (gr:connect hb . points) + (dis/connect "connect" gr:primitive-connect hb points)) + +;;; Disconnect one or more block endpoints... +(define-method (gr:disconnect hb . points) + (dis/connect "disconnect" gr:primitive-disconnect hb points)) -(define-method (gr:connect hb src dst) +(define (dis/connect name gf hb points) (let ((hb (coerce-to-hier-block2 hb)) - (src (coerce-to-endpoint src)) - (dst (coerce-to-endpoint dst))) - (gr:connect hb src dst))) + (points (list->vector (map coerce-to-endpoint points)))) -;;; The gr:disconnect variants -;;; These work for anything derived from gr_hier_block2 -(define-method (gr:disconnect-all hb) - (let ((hb (coerce-to-hier-block2 hb))) - (gr:disconnect-all hb))) + (define (op2 p0 p1) + (gf hb (block p0) (port p0) (block p1) (port p1))) -(define-method (gr:disconnect hb block) - (let ((hb (coerce-to-hier-block2 hb)) - (bb (coerce-to-basic-block block))) - (gr:disconnect hb bb))) + (let ((len (vector-length points))) + (case len + ((0) (error (string-append name " requires at least 1 endpoint; None provided."))) + ((1) (gf hb (vector-ref points 0))) + (else + (let loop ((n 1)) + (cond ((< n len) + (op2 (vector-ref points (1- n)) (vector-ref points n)) + (loop (1+ n)))))))))) -(define-method (gr:disconnect hb (src ) (dst )) - (let ((hb (coerce-to-hier-block2 hb))) - (gr:disconnect hb (block src) (port src) (block dst) (port dst)))) -(define-method (gr:disconnect hb src dst) - (let ((hb (coerce-to-hier-block2 hb)) - (src (coerce-to-endpoint src)) - (dst (coerce-to-endpoint dst))) - (gr:disconnect hb src dst))) +(export-safely gr:connect gr:disconnect) diff --git a/gnuradio-core/src/python/gnuradio/gr/hier_block2.py b/gnuradio-core/src/python/gnuradio/gr/hier_block2.py index 370f8a9d9..debb65d91 100644 --- a/gnuradio-core/src/python/gnuradio/gr/hier_block2.py +++ b/gnuradio-core/src/python/gnuradio/gr/hier_block2.py @@ -66,7 +66,7 @@ class hier_block2(object): raise ValueError, ("connect requires at least one endpoint; %d provided." % (len (points),)) else: if len(points) == 1: - self._hb.connect(points[0].to_basic_block()) + self._hb.primitive_connect(points[0].to_basic_block()) else: for i in range (1, len (points)): self._connect(points[i-1], points[i]) @@ -74,8 +74,8 @@ class hier_block2(object): def _connect(self, src, dst): (src_block, src_port) = self._coerce_endpoint(src) (dst_block, dst_port) = self._coerce_endpoint(dst) - self._hb.connect(src_block.to_basic_block(), src_port, - dst_block.to_basic_block(), dst_port) + self._hb.primitive_connect(src_block.to_basic_block(), src_port, + dst_block.to_basic_block(), dst_port) def _coerce_endpoint(self, endp): if hasattr(endp, 'to_basic_block'): @@ -97,10 +97,10 @@ class hier_block2(object): """ if len (points) < 1: - raise ValueError, ("disconnect requires at least two endpoints; %d provided." % (len (points),)) + raise ValueError, ("disconnect requires at least one endpoint; %d provided." % (len (points),)) else: if len (points) == 1: - self._hb.disconnect(points[0].to_basic_block()) + self._hb.primitive_disconnect(points[0].to_basic_block()) else: for i in range (1, len (points)): self._disconnect(points[i-1], points[i]) @@ -108,6 +108,6 @@ class hier_block2(object): def _disconnect(self, src, dst): (src_block, src_port) = self._coerce_endpoint(src) (dst_block, dst_port) = self._coerce_endpoint(dst) - self._hb.disconnect(src_block.to_basic_block(), src_port, - dst_block.to_basic_block(), dst_port) + self._hb.primitive_disconnect(src_block.to_basic_block(), src_port, + dst_block.to_basic_block(), dst_port) diff --git a/gnuradio-core/src/python/gnuradio/gr/top_block.py b/gnuradio-core/src/python/gnuradio/gr/top_block.py index 8fe5303c8..1e36d3b48 100644 --- a/gnuradio-core/src/python/gnuradio/gr/top_block.py +++ b/gnuradio-core/src/python/gnuradio/gr/top_block.py @@ -118,7 +118,7 @@ class top_block(object): raise ValueError, ("connect requires at least one endpoint; %d provided." % (len (points),)) else: if len(points) == 1: - self._tb.connect(points[0].to_basic_block()) + self._tb.primitive_connect(points[0].to_basic_block()) else: for i in range (1, len (points)): self._connect(points[i-1], points[i]) @@ -126,8 +126,8 @@ class top_block(object): def _connect(self, src, dst): (src_block, src_port) = self._coerce_endpoint(src) (dst_block, dst_port) = self._coerce_endpoint(dst) - self._tb.connect(src_block.to_basic_block(), src_port, - dst_block.to_basic_block(), dst_port) + self._tb.primitive_connect(src_block.to_basic_block(), src_port, + dst_block.to_basic_block(), dst_port) def _coerce_endpoint(self, endp): if hasattr(endp, 'to_basic_block'): @@ -139,14 +139,14 @@ class top_block(object): raise ValueError("unable to coerce endpoint") def disconnect(self, *points): - '''connect requires one or more arguments that can be coerced to endpoints. + '''disconnect requires one or more arguments that can be coerced to endpoints. If more than two arguments are provided, they are disconnected successively. ''' if len (points) < 1: - raise ValueError, ("disconnect requires at least two endpoints; %d provided." % (len (points),)) + raise ValueError, ("disconnect requires at least one endpoint; %d provided." % (len (points),)) else: if len(points) == 1: - self._tb.disconnect(points[0].to_basic_block()) + self._tb.primitive_disconnect(points[0].to_basic_block()) else: for i in range (1, len (points)): self._disconnect(points[i-1], points[i]) @@ -154,6 +154,6 @@ class top_block(object): def _disconnect(self, src, dst): (src_block, src_port) = self._coerce_endpoint(src) (dst_block, dst_port) = self._coerce_endpoint(dst) - self._tb.disconnect(src_block.to_basic_block(), src_port, - dst_block.to_basic_block(), dst_port) + self._tb.primitive_disconnect(src_block.to_basic_block(), src_port, + dst_block.to_basic_block(), dst_port) -- cgit From 76c90f91c5bf06f61f927e002053e397b8f4a706 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 31 Oct 2010 20:06:52 -0700 Subject: Export a few more items --- gnuradio-core/src/lib/swig/gnuradio/coerce.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio/coerce.scm b/gnuradio-core/src/lib/swig/gnuradio/coerce.scm index 81bc187a6..4654ad6f8 100644 --- a/gnuradio-core/src/lib/swig/gnuradio/coerce.scm +++ b/gnuradio-core/src/lib/swig/gnuradio/coerce.scm @@ -81,4 +81,4 @@ (loop (1+ n)))))))))) -(export-safely gr:connect gr:disconnect) +(export-safely gr:ep gr:connect gr:disconnect) -- cgit From f2f013ecb94c5e5781952c67496fec09aff7da2c Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 31 Oct 2010 20:51:24 -0700 Subject: Rename coerce.scm to runtime-shim.scm. Modify core.scm to use runtime-shim. --- gnuradio-core/src/lib/swig/Makefile.am | 3 +- gnuradio-core/src/lib/swig/gnuradio/coerce.scm | 84 -------------------- gnuradio-core/src/lib/swig/gnuradio/core.scm | 1 + .../src/lib/swig/gnuradio/runtime-shim.scm | 89 ++++++++++++++++++++++ 4 files changed, 92 insertions(+), 85 deletions(-) delete mode 100644 gnuradio-core/src/lib/swig/gnuradio/coerce.scm create mode 100644 gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 2b763d94c..01a5318ec 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -60,8 +60,9 @@ if GUILE # for gnuradio. This has to be installed top level to be found in the # default search path. nobase_guile_DATA = \ - gnuradio/export-safely.scm \ gnuradio/core.scm \ + gnuradio/export-safely.scm \ + gnuradio/runtime-shim.scm \ Swig/common.scm endif diff --git a/gnuradio-core/src/lib/swig/gnuradio/coerce.scm b/gnuradio-core/src/lib/swig/gnuradio/coerce.scm deleted file mode 100644 index 4654ad6f8..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio/coerce.scm +++ /dev/null @@ -1,84 +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 . -;;; - -(define-class () - (block #:accessor block #:init-keyword #:block) - (port #:init-value 0 #:accessor port #:init-keyword #:port)) - -(define (gr:ep block port) - (make - #:block (coerce-to-basic-block block) #:port port)) - -(define (coerce-to-endpoint ep) - (cond ((is-a? ep ) ep) - ((false-if-exception (gr:to-basic-block ep)) - => (lambda (x) (gr:ep x 0))) - ((and (pair? ep) (= 2 (length ep)) - (false-if-exception (gr:to-basic-block (car ep)))) - => (lambda (x) (gr:ep x (cadr ep)))) - (else (error "Cannot coerce to an endpoint: " ep)))) - -(define (coerce-to-basic-block block) - (cond ((is-a? block ) block) - ((false-if-exception (gr:to-basic-block block)) => (lambda (x) x)) - (else (error "Cannot coerce to a gr_basic_block: " block)))) - -(define (coerce-to-top-block block) - (cond ((is-a? block ) block) - ((false-if-exception (gr:to-top-block block)) => (lambda (x) x)) - (else (error "Cannot coerce to a gr_top_block: " block)))) - -(define (coerce-to-hier-block2 block) - (cond ((is-a? block ) block) - ((false-if-exception (gr:to-hier-block2 block)) => (lambda (x) x)) - (else (error "Cannot coerce to a gr_hier_block2: " block)))) - - -;;; Connect one or more block endpoints. An endpoint is either a , -;;; a 2-list (block port), or a block instance. In the latter case, the port number -;;; is assumed to be zero. -;;; -;;; If multiple arguments are provided, connect will attempt to wire them in series, -;;; interpreting the endpoints as inputs or outputs as appropriate. -(define-method (gr:connect hb . points) - (dis/connect "connect" gr:primitive-connect hb points)) - -;;; Disconnect one or more block endpoints... -(define-method (gr:disconnect hb . points) - (dis/connect "disconnect" gr:primitive-disconnect hb points)) - -(define (dis/connect name gf hb points) - (let ((hb (coerce-to-hier-block2 hb)) - (points (list->vector (map coerce-to-endpoint points)))) - - (define (op2 p0 p1) - (gf hb (block p0) (port p0) (block p1) (port p1))) - - (let ((len (vector-length points))) - (case len - ((0) (error (string-append name " requires at least 1 endpoint; None provided."))) - ((1) (gf hb (vector-ref points 0))) - (else - (let loop ((n 1)) - (cond ((< n len) - (op2 (vector-ref points (1- n)) (vector-ref points n)) - (loop (1+ n)))))))))) - - -(export-safely gr:ep gr:connect gr:disconnect) diff --git a/gnuradio-core/src/lib/swig/gnuradio/core.scm b/gnuradio-core/src/lib/swig/gnuradio/core.scm index 294881146..08daeeb34 100644 --- a/gnuradio-core/src/lib/swig/gnuradio/core.scm +++ b/gnuradio-core/src/lib/swig/gnuradio/core.scm @@ -2,6 +2,7 @@ (define-module (gnuradio core) #:use-module (gnuradio gnuradio_core_runtime) + #:use-module (gnuradio runtime-shim) #:use-module (gnuradio gnuradio_core_filter) #:use-module (gnuradio gnuradio_core_io) #:use-module (gnuradio gnuradio_core_general) diff --git a/gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm b/gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm new file mode 100644 index 000000000..c08d3947c --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm @@ -0,0 +1,89 @@ +;;; +;;; 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 . +;;; + +(define-module (gnuradio runtime-shim) + #:use-module (oop goops) + #:use-module (gnuradio gnuradio_core_runtime) + #:duplicates (merge-generics replace check)) + +(define-class () + (block #:accessor block #:init-keyword #:block) + (port #:init-value 0 #:accessor port #:init-keyword #:port)) + +(define (gr:ep block port) + (make + #:block (coerce-to-basic-block block) #:port port)) + +(define (coerce-to-endpoint ep) + (cond ((is-a? ep ) ep) + ((false-if-exception (gr:to-basic-block ep)) + => (lambda (x) (gr:ep x 0))) + ((and (pair? ep) (= 2 (length ep)) + (false-if-exception (gr:to-basic-block (car ep)))) + => (lambda (x) (gr:ep x (cadr ep)))) + (else (error "Cannot coerce to an endpoint: " ep)))) + +(define (coerce-to-basic-block block) + (cond ((is-a? block ) block) + ((false-if-exception (gr:to-basic-block block)) => (lambda (x) x)) + (else (error "Cannot coerce to a gr_basic_block: " block)))) + +(define (coerce-to-top-block block) + (cond ((is-a? block ) block) + ((false-if-exception (gr:to-top-block block)) => (lambda (x) x)) + (else (error "Cannot coerce to a gr_top_block: " block)))) + +(define (coerce-to-hier-block2 block) + (cond ((is-a? block ) block) + ((false-if-exception (gr:to-hier-block2 block)) => (lambda (x) x)) + (else (error "Cannot coerce to a gr_hier_block2: " block)))) + + +;;; Connect one or more block endpoints. An endpoint is either a , +;;; a 2-list (block port), or a block instance. In the latter case, the port number +;;; is assumed to be zero. +;;; +;;; If multiple arguments are provided, connect will attempt to wire them in series, +;;; interpreting the endpoints as inputs or outputs as appropriate. +(define-method (gr:connect hb . points) + (dis/connect "connect" gr:primitive-connect hb points)) + +;;; Disconnect one or more block endpoints... +(define-method (gr:disconnect hb . points) + (dis/connect "disconnect" gr:primitive-disconnect hb points)) + +(define (dis/connect name gf hb points) + (let ((hb (coerce-to-hier-block2 hb)) + (points (list->vector (map coerce-to-endpoint points)))) + + (define (op2 p0 p1) + (gf hb (block p0) (port p0) (block p1) (port p1))) + + (let ((len (vector-length points))) + (case len + ((0) (error (string-append name " requires at least 1 endpoint; None provided."))) + ((1) (gf hb (vector-ref points 0))) + (else + (let loop ((n 1)) + (cond ((< n len) + (op2 (vector-ref points (1- n)) (vector-ref points n)) + (loop (1+ n)))))))))) + + +(export-safely gr:ep gr:connect gr:disconnect) -- cgit From f81c5677a40cc538ee7631d02aa24602d571ffb8 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 1 Nov 2010 16:05:08 -0600 Subject: add script names to swig_built_sources, not BUILT_SOURCES. Clean the generated files than now live in subdirectories. --- gnuradio-core/src/lib/swig/Makefile.am | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 01a5318ec..54cbebeb1 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -23,9 +23,10 @@ include $(top_srcdir)/Makefile.common include $(top_srcdir)/Makefile.swig BUILT_SOURCES = $(grinclude_HEADERS) $(swig_built_sources) -CLEANFILES = python/gnuradio* + +CLEANFILES = python/*.cc python/*.h if GUILE -CLEANFILES += guile/gnuradio* +CLEANFILES += guile/*.cc gnuradio/*.scm endif # ---------------------------------------------------------------- @@ -111,15 +112,14 @@ gnuradio_core_hier_la_swig_libadd = $(GNURADIO_CORE_LA) # include the SWIG-generated .h files in the BUILT SOURCES, since they # aren't by default when using Makefile.swig; order doesn't matter. PYTHON_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(subst .i,.py,$(HFILE))) -#BUILT_SOURCES += $(foreach HFILE,$(PYTHON_GEN), $(subst gnuradio,python/gnuradio,$(HFILE))) -BUILT_SOURCES += $(PYTHON_GEN) +swig_built_sources += $(PYTHON_GEN) endif # end of if python if GUILE -GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(patsubst %.i,%.scm,$(HFILE))) -#GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(patsubst %.i,gnuradio/%.scm,$(HFILE))) -# BUILT_SOURCES += $(foreach HFILE,$(GUILE_GEN), $(subst gnuradio,guile/gnuradio,$(HFILE))) -BUILT_SOURCES += $(GUILE_GEN) +#GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(patsubst %.i,%.scm,$(HFILE))) +GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(patsubst %.i,gnuradio/%.scm,$(HFILE))) +# GUILE_GEN_STAMPS = $(filter %.scm,$(TOP_SWIG_IFILES)) +swig_built_sources += $(GUILE_GEN) endif # Do not distribute the output of SWIG -- cgit From 2b11c904da6799b6a7240d64d2ba37ddcaf1e479 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 1 Nov 2010 16:06:37 -0600 Subject: regenerated --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 90 +++++++++++++--------------- 1 file changed, 42 insertions(+), 48 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index 69042f84e..a92ff2231 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -84,10 +84,10 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* # generating the py or scm file also generates the .cc or .h files, # but dependencies work better without the .cc ort .h files listed. -swig_built_sources += gnuradio_core_runtime.py -if GUILE -swig_built_sources += gnuradio_core_runtime.scm -endif +# swig_built_sources += gnuradio_core_runtime.py +# if GUILE +# swig_built_sources += gnuradio/gnuradio_core_runtime.scm +# endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -135,15 +135,14 @@ libguile_gnuradio_core_runtime_la_LIBADD = $(_gnuradio_core_runtime_la_LIBADD) libguile_gnuradio_core_runtime_la_LDFLAGS = $(_gnuradio_core_runtime_la_LDFLAGS) libguile_gnuradio_core_runtime_la_CXXFLAGS = $(_gnuradio_core_runtime_la_CXXFLAGS) -guile/gnuradio_core_runtime.lo: gnuradio_core_runtime.lo -gnuradio_core_runtime.scm: gnuradio_core_runtime.i -gnuradio/gnuradio_core_runtime-primitive.scm: gnuradio_core_runtime.scm +guile/gnuradio_core_runtime.cc: gnuradio/gnuradio_core_runtime.scm +gnuradio/gnuradio_core_runtime.scm: gnuradio_core_runtime.i +gnuradio/gnuradio_core_runtime-primitive.scm: gnuradio/gnuradio_core_runtime.scm -include guile/gnuradio_core_runtime.d endif # end of GUILE -python/gnuradio_core_runtime.lo: gnuradio_core_runtime.lo: gnuradio_core_runtime.py gnuradio_core_runtime.scm gnuradio_core_runtime.py: gnuradio_core_runtime.i @@ -235,10 +234,10 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* # generating the py or scm file also generates the .cc or .h files, # but dependencies work better without the .cc ort .h files listed. -swig_built_sources += gnuradio_core_general.py -if GUILE -swig_built_sources += gnuradio_core_general.scm -endif +# swig_built_sources += gnuradio_core_general.py +# if GUILE +# swig_built_sources += gnuradio/gnuradio_core_general.scm +# endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -286,15 +285,14 @@ libguile_gnuradio_core_general_la_LIBADD = $(_gnuradio_core_general_la_LIBADD) libguile_gnuradio_core_general_la_LDFLAGS = $(_gnuradio_core_general_la_LDFLAGS) libguile_gnuradio_core_general_la_CXXFLAGS = $(_gnuradio_core_general_la_CXXFLAGS) -guile/gnuradio_core_general.lo: gnuradio_core_general.lo -gnuradio_core_general.scm: gnuradio_core_general.i -gnuradio/gnuradio_core_general-primitive.scm: gnuradio_core_general.scm +guile/gnuradio_core_general.cc: gnuradio/gnuradio_core_general.scm +gnuradio/gnuradio_core_general.scm: gnuradio_core_general.i +gnuradio/gnuradio_core_general-primitive.scm: gnuradio/gnuradio_core_general.scm -include guile/gnuradio_core_general.d endif # end of GUILE -python/gnuradio_core_general.lo: gnuradio_core_general.lo: gnuradio_core_general.py gnuradio_core_general.scm gnuradio_core_general.py: gnuradio_core_general.i @@ -386,10 +384,10 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* # generating the py or scm file also generates the .cc or .h files, # but dependencies work better without the .cc ort .h files listed. -swig_built_sources += gnuradio_core_gengen.py -if GUILE -swig_built_sources += gnuradio_core_gengen.scm -endif +# swig_built_sources += gnuradio_core_gengen.py +# if GUILE +# swig_built_sources += gnuradio/gnuradio_core_gengen.scm +# endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -437,15 +435,14 @@ libguile_gnuradio_core_gengen_la_LIBADD = $(_gnuradio_core_gengen_la_LIBADD) libguile_gnuradio_core_gengen_la_LDFLAGS = $(_gnuradio_core_gengen_la_LDFLAGS) libguile_gnuradio_core_gengen_la_CXXFLAGS = $(_gnuradio_core_gengen_la_CXXFLAGS) -guile/gnuradio_core_gengen.lo: gnuradio_core_gengen.lo -gnuradio_core_gengen.scm: gnuradio_core_gengen.i -gnuradio/gnuradio_core_gengen-primitive.scm: gnuradio_core_gengen.scm +guile/gnuradio_core_gengen.cc: gnuradio/gnuradio_core_gengen.scm +gnuradio/gnuradio_core_gengen.scm: gnuradio_core_gengen.i +gnuradio/gnuradio_core_gengen-primitive.scm: gnuradio/gnuradio_core_gengen.scm -include guile/gnuradio_core_gengen.d endif # end of GUILE -python/gnuradio_core_gengen.lo: gnuradio_core_gengen.lo: gnuradio_core_gengen.py gnuradio_core_gengen.scm gnuradio_core_gengen.py: gnuradio_core_gengen.i @@ -537,10 +534,10 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* # generating the py or scm file also generates the .cc or .h files, # but dependencies work better without the .cc ort .h files listed. -swig_built_sources += gnuradio_core_filter.py -if GUILE -swig_built_sources += gnuradio_core_filter.scm -endif +# swig_built_sources += gnuradio_core_filter.py +# if GUILE +# swig_built_sources += gnuradio/gnuradio_core_filter.scm +# endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -588,15 +585,14 @@ libguile_gnuradio_core_filter_la_LIBADD = $(_gnuradio_core_filter_la_LIBADD) libguile_gnuradio_core_filter_la_LDFLAGS = $(_gnuradio_core_filter_la_LDFLAGS) libguile_gnuradio_core_filter_la_CXXFLAGS = $(_gnuradio_core_filter_la_CXXFLAGS) -guile/gnuradio_core_filter.lo: gnuradio_core_filter.lo -gnuradio_core_filter.scm: gnuradio_core_filter.i -gnuradio/gnuradio_core_filter-primitive.scm: gnuradio_core_filter.scm +guile/gnuradio_core_filter.cc: gnuradio/gnuradio_core_filter.scm +gnuradio/gnuradio_core_filter.scm: gnuradio_core_filter.i +gnuradio/gnuradio_core_filter-primitive.scm: gnuradio/gnuradio_core_filter.scm -include guile/gnuradio_core_filter.d endif # end of GUILE -python/gnuradio_core_filter.lo: gnuradio_core_filter.lo: gnuradio_core_filter.py gnuradio_core_filter.scm gnuradio_core_filter.py: gnuradio_core_filter.i @@ -688,10 +684,10 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* # generating the py or scm file also generates the .cc or .h files, # but dependencies work better without the .cc ort .h files listed. -swig_built_sources += gnuradio_core_io.py -if GUILE -swig_built_sources += gnuradio_core_io.scm -endif +# swig_built_sources += gnuradio_core_io.py +# if GUILE +# swig_built_sources += gnuradio/gnuradio_core_io.scm +# endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -739,15 +735,14 @@ libguile_gnuradio_core_io_la_LIBADD = $(_gnuradio_core_io_la_LIBADD) libguile_gnuradio_core_io_la_LDFLAGS = $(_gnuradio_core_io_la_LDFLAGS) libguile_gnuradio_core_io_la_CXXFLAGS = $(_gnuradio_core_io_la_CXXFLAGS) -guile/gnuradio_core_io.lo: gnuradio_core_io.lo -gnuradio_core_io.scm: gnuradio_core_io.i -gnuradio/gnuradio_core_io-primitive.scm: gnuradio_core_io.scm +guile/gnuradio_core_io.cc: gnuradio/gnuradio_core_io.scm +gnuradio/gnuradio_core_io.scm: gnuradio_core_io.i +gnuradio/gnuradio_core_io-primitive.scm: gnuradio/gnuradio_core_io.scm -include guile/gnuradio_core_io.d endif # end of GUILE -python/gnuradio_core_io.lo: gnuradio_core_io.lo: gnuradio_core_io.py gnuradio_core_io.scm gnuradio_core_io.py: gnuradio_core_io.i @@ -839,10 +834,10 @@ MOSTLYCLEANFILES += $(DEPDIR)/*.S* # generating the py or scm file also generates the .cc or .h files, # but dependencies work better without the .cc ort .h files listed. -swig_built_sources += gnuradio_core_hier.py -if GUILE -swig_built_sources += gnuradio_core_hier.scm -endif +# swig_built_sources += gnuradio_core_hier.py +# if GUILE +# swig_built_sources += gnuradio/gnuradio_core_hier.scm +# endif ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including @@ -890,15 +885,14 @@ libguile_gnuradio_core_hier_la_LIBADD = $(_gnuradio_core_hier_la_LIBADD) libguile_gnuradio_core_hier_la_LDFLAGS = $(_gnuradio_core_hier_la_LDFLAGS) libguile_gnuradio_core_hier_la_CXXFLAGS = $(_gnuradio_core_hier_la_CXXFLAGS) -guile/gnuradio_core_hier.lo: gnuradio_core_hier.lo -gnuradio_core_hier.scm: gnuradio_core_hier.i -gnuradio/gnuradio_core_hier-primitive.scm: gnuradio_core_hier.scm +guile/gnuradio_core_hier.cc: gnuradio/gnuradio_core_hier.scm +gnuradio/gnuradio_core_hier.scm: gnuradio_core_hier.i +gnuradio/gnuradio_core_hier-primitive.scm: gnuradio/gnuradio_core_hier.scm -include guile/gnuradio_core_hier.d endif # end of GUILE -python/gnuradio_core_hier.lo: gnuradio_core_hier.lo: gnuradio_core_hier.py gnuradio_core_hier.scm gnuradio_core_hier.py: gnuradio_core_hier.i -- cgit From 0939607d0b4a3ae047ceff60fab300000c7d2069 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Mon, 1 Nov 2010 19:02:55 -0600 Subject: regenerated --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 222 ++++++++------------------- 1 file changed, 60 insertions(+), 162 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index a92ff2231..0803cbfee 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -67,28 +67,10 @@ gnuradio_core_runtime_swigincludedir = $(swigincludedir) ## right thing. For more info, see < ## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > -## Stamps used to ensure parallel make does the right thing. These -## are removed by "make clean", but otherwise unused except during the -## parallel built. These will not be included in a tarball, because -## the SWIG-generated files will be removed from the distribution. - -STAMPS += $(DEPDIR)/gnuradio_core_runtime-generate-* - ## Other cleaned files: dependency files generated by SWIG or this Makefile MOSTLYCLEANFILES += $(DEPDIR)/*.S* -## Add the .py and .cc files to the list of SWIG built sources. The -## .h file is sometimes built, but not always ... so that one has to -## be added manually by the including Makefile.am . - -# generating the py or scm file also generates the .cc or .h files, -# but dependencies work better without the .cc ort .h files listed. -# swig_built_sources += gnuradio_core_runtime.py -# if GUILE -# swig_built_sources += gnuradio/gnuradio_core_runtime.scm -# endif - ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including ## Makefile.swig . @@ -108,8 +90,6 @@ _gnuradio_core_runtime_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_runtime_la_swig_libadd) -# _gnuradio_core_runtime_la_DEPENDENCIES = python/gnuradio_core_runtime.lo - _gnuradio_core_runtime_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_core_runtime_la_swig_ldflags) @@ -123,14 +103,20 @@ gnuradio_core_runtime_python_PYTHON = \ gnuradio_core_runtime.py \ $(gnuradio_core_runtime) +python/gnuradio_core_runtime.cc: gnuradio_core_runtime.py +gnuradio_core_runtime.py: gnuradio_core_runtime.i + +# Include the python dependencies for this file +-include python/gnuradio_core_runtime.d +# end of PYTHON + if GUILE gnuradio_core_runtime_scmlib_LTLIBRARIES = libguile-gnuradio_core_runtime.la -libguile_gnuradio_core_runtime_la_SOURCES = \ - guile/gnuradio_core_runtime.cc \ +libguile_gnuradio_core_runtime_la_SOURCES = \ + guile/gnuradio_core_runtime.cc \ $(gnuradio_core_runtime_la_swig_sources) nobase_gnuradio_core_runtime_scm_DATA = gnuradio/gnuradio_core_runtime.scm gnuradio/gnuradio_core_runtime-primitive.scm -# Guile can use the same flags as python does libguile_gnuradio_core_runtime_la_LIBADD = $(_gnuradio_core_runtime_la_LIBADD) libguile_gnuradio_core_runtime_la_LDFLAGS = $(_gnuradio_core_runtime_la_LDFLAGS) libguile_gnuradio_core_runtime_la_CXXFLAGS = $(_gnuradio_core_runtime_la_CXXFLAGS) @@ -139,14 +125,11 @@ guile/gnuradio_core_runtime.cc: gnuradio/gnuradio_core_runtime.scm gnuradio/gnuradio_core_runtime.scm: gnuradio_core_runtime.i gnuradio/gnuradio_core_runtime-primitive.scm: gnuradio/gnuradio_core_runtime.scm +# Include the guile dependencies for this file -include guile/gnuradio_core_runtime.d endif # end of GUILE -gnuradio_core_runtime.lo: gnuradio_core_runtime.py gnuradio_core_runtime.scm -gnuradio_core_runtime.py: gnuradio_core_runtime.i - --include python/gnuradio_core_runtime.d # -*- Makefile -*- # @@ -217,28 +200,10 @@ gnuradio_core_general_swigincludedir = $(swigincludedir) ## right thing. For more info, see < ## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > -## Stamps used to ensure parallel make does the right thing. These -## are removed by "make clean", but otherwise unused except during the -## parallel built. These will not be included in a tarball, because -## the SWIG-generated files will be removed from the distribution. - -STAMPS += $(DEPDIR)/gnuradio_core_general-generate-* - ## Other cleaned files: dependency files generated by SWIG or this Makefile MOSTLYCLEANFILES += $(DEPDIR)/*.S* -## Add the .py and .cc files to the list of SWIG built sources. The -## .h file is sometimes built, but not always ... so that one has to -## be added manually by the including Makefile.am . - -# generating the py or scm file also generates the .cc or .h files, -# but dependencies work better without the .cc ort .h files listed. -# swig_built_sources += gnuradio_core_general.py -# if GUILE -# swig_built_sources += gnuradio/gnuradio_core_general.scm -# endif - ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including ## Makefile.swig . @@ -258,8 +223,6 @@ _gnuradio_core_general_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_general_la_swig_libadd) -# _gnuradio_core_general_la_DEPENDENCIES = python/gnuradio_core_general.lo - _gnuradio_core_general_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_core_general_la_swig_ldflags) @@ -273,14 +236,20 @@ gnuradio_core_general_python_PYTHON = \ gnuradio_core_general.py \ $(gnuradio_core_general) +python/gnuradio_core_general.cc: gnuradio_core_general.py +gnuradio_core_general.py: gnuradio_core_general.i + +# Include the python dependencies for this file +-include python/gnuradio_core_general.d +# end of PYTHON + if GUILE gnuradio_core_general_scmlib_LTLIBRARIES = libguile-gnuradio_core_general.la -libguile_gnuradio_core_general_la_SOURCES = \ - guile/gnuradio_core_general.cc \ +libguile_gnuradio_core_general_la_SOURCES = \ + guile/gnuradio_core_general.cc \ $(gnuradio_core_general_la_swig_sources) nobase_gnuradio_core_general_scm_DATA = gnuradio/gnuradio_core_general.scm gnuradio/gnuradio_core_general-primitive.scm -# Guile can use the same flags as python does libguile_gnuradio_core_general_la_LIBADD = $(_gnuradio_core_general_la_LIBADD) libguile_gnuradio_core_general_la_LDFLAGS = $(_gnuradio_core_general_la_LDFLAGS) libguile_gnuradio_core_general_la_CXXFLAGS = $(_gnuradio_core_general_la_CXXFLAGS) @@ -289,14 +258,11 @@ guile/gnuradio_core_general.cc: gnuradio/gnuradio_core_general.scm gnuradio/gnuradio_core_general.scm: gnuradio_core_general.i gnuradio/gnuradio_core_general-primitive.scm: gnuradio/gnuradio_core_general.scm +# Include the guile dependencies for this file -include guile/gnuradio_core_general.d endif # end of GUILE -gnuradio_core_general.lo: gnuradio_core_general.py gnuradio_core_general.scm -gnuradio_core_general.py: gnuradio_core_general.i - --include python/gnuradio_core_general.d # -*- Makefile -*- # @@ -367,28 +333,10 @@ gnuradio_core_gengen_swigincludedir = $(swigincludedir) ## right thing. For more info, see < ## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > -## Stamps used to ensure parallel make does the right thing. These -## are removed by "make clean", but otherwise unused except during the -## parallel built. These will not be included in a tarball, because -## the SWIG-generated files will be removed from the distribution. - -STAMPS += $(DEPDIR)/gnuradio_core_gengen-generate-* - ## Other cleaned files: dependency files generated by SWIG or this Makefile MOSTLYCLEANFILES += $(DEPDIR)/*.S* -## Add the .py and .cc files to the list of SWIG built sources. The -## .h file is sometimes built, but not always ... so that one has to -## be added manually by the including Makefile.am . - -# generating the py or scm file also generates the .cc or .h files, -# but dependencies work better without the .cc ort .h files listed. -# swig_built_sources += gnuradio_core_gengen.py -# if GUILE -# swig_built_sources += gnuradio/gnuradio_core_gengen.scm -# endif - ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including ## Makefile.swig . @@ -408,8 +356,6 @@ _gnuradio_core_gengen_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_gengen_la_swig_libadd) -# _gnuradio_core_gengen_la_DEPENDENCIES = python/gnuradio_core_gengen.lo - _gnuradio_core_gengen_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_core_gengen_la_swig_ldflags) @@ -423,14 +369,20 @@ gnuradio_core_gengen_python_PYTHON = \ gnuradio_core_gengen.py \ $(gnuradio_core_gengen) +python/gnuradio_core_gengen.cc: gnuradio_core_gengen.py +gnuradio_core_gengen.py: gnuradio_core_gengen.i + +# Include the python dependencies for this file +-include python/gnuradio_core_gengen.d +# end of PYTHON + if GUILE gnuradio_core_gengen_scmlib_LTLIBRARIES = libguile-gnuradio_core_gengen.la -libguile_gnuradio_core_gengen_la_SOURCES = \ - guile/gnuradio_core_gengen.cc \ +libguile_gnuradio_core_gengen_la_SOURCES = \ + guile/gnuradio_core_gengen.cc \ $(gnuradio_core_gengen_la_swig_sources) nobase_gnuradio_core_gengen_scm_DATA = gnuradio/gnuradio_core_gengen.scm gnuradio/gnuradio_core_gengen-primitive.scm -# Guile can use the same flags as python does libguile_gnuradio_core_gengen_la_LIBADD = $(_gnuradio_core_gengen_la_LIBADD) libguile_gnuradio_core_gengen_la_LDFLAGS = $(_gnuradio_core_gengen_la_LDFLAGS) libguile_gnuradio_core_gengen_la_CXXFLAGS = $(_gnuradio_core_gengen_la_CXXFLAGS) @@ -439,14 +391,11 @@ guile/gnuradio_core_gengen.cc: gnuradio/gnuradio_core_gengen.scm gnuradio/gnuradio_core_gengen.scm: gnuradio_core_gengen.i gnuradio/gnuradio_core_gengen-primitive.scm: gnuradio/gnuradio_core_gengen.scm +# Include the guile dependencies for this file -include guile/gnuradio_core_gengen.d endif # end of GUILE -gnuradio_core_gengen.lo: gnuradio_core_gengen.py gnuradio_core_gengen.scm -gnuradio_core_gengen.py: gnuradio_core_gengen.i - --include python/gnuradio_core_gengen.d # -*- Makefile -*- # @@ -517,28 +466,10 @@ gnuradio_core_filter_swigincludedir = $(swigincludedir) ## right thing. For more info, see < ## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > -## Stamps used to ensure parallel make does the right thing. These -## are removed by "make clean", but otherwise unused except during the -## parallel built. These will not be included in a tarball, because -## the SWIG-generated files will be removed from the distribution. - -STAMPS += $(DEPDIR)/gnuradio_core_filter-generate-* - ## Other cleaned files: dependency files generated by SWIG or this Makefile MOSTLYCLEANFILES += $(DEPDIR)/*.S* -## Add the .py and .cc files to the list of SWIG built sources. The -## .h file is sometimes built, but not always ... so that one has to -## be added manually by the including Makefile.am . - -# generating the py or scm file also generates the .cc or .h files, -# but dependencies work better without the .cc ort .h files listed. -# swig_built_sources += gnuradio_core_filter.py -# if GUILE -# swig_built_sources += gnuradio/gnuradio_core_filter.scm -# endif - ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including ## Makefile.swig . @@ -558,8 +489,6 @@ _gnuradio_core_filter_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_filter_la_swig_libadd) -# _gnuradio_core_filter_la_DEPENDENCIES = python/gnuradio_core_filter.lo - _gnuradio_core_filter_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_core_filter_la_swig_ldflags) @@ -573,14 +502,20 @@ gnuradio_core_filter_python_PYTHON = \ gnuradio_core_filter.py \ $(gnuradio_core_filter) +python/gnuradio_core_filter.cc: gnuradio_core_filter.py +gnuradio_core_filter.py: gnuradio_core_filter.i + +# Include the python dependencies for this file +-include python/gnuradio_core_filter.d +# end of PYTHON + if GUILE gnuradio_core_filter_scmlib_LTLIBRARIES = libguile-gnuradio_core_filter.la -libguile_gnuradio_core_filter_la_SOURCES = \ - guile/gnuradio_core_filter.cc \ +libguile_gnuradio_core_filter_la_SOURCES = \ + guile/gnuradio_core_filter.cc \ $(gnuradio_core_filter_la_swig_sources) nobase_gnuradio_core_filter_scm_DATA = gnuradio/gnuradio_core_filter.scm gnuradio/gnuradio_core_filter-primitive.scm -# Guile can use the same flags as python does libguile_gnuradio_core_filter_la_LIBADD = $(_gnuradio_core_filter_la_LIBADD) libguile_gnuradio_core_filter_la_LDFLAGS = $(_gnuradio_core_filter_la_LDFLAGS) libguile_gnuradio_core_filter_la_CXXFLAGS = $(_gnuradio_core_filter_la_CXXFLAGS) @@ -589,14 +524,11 @@ guile/gnuradio_core_filter.cc: gnuradio/gnuradio_core_filter.scm gnuradio/gnuradio_core_filter.scm: gnuradio_core_filter.i gnuradio/gnuradio_core_filter-primitive.scm: gnuradio/gnuradio_core_filter.scm +# Include the guile dependencies for this file -include guile/gnuradio_core_filter.d endif # end of GUILE -gnuradio_core_filter.lo: gnuradio_core_filter.py gnuradio_core_filter.scm -gnuradio_core_filter.py: gnuradio_core_filter.i - --include python/gnuradio_core_filter.d # -*- Makefile -*- # @@ -667,28 +599,10 @@ gnuradio_core_io_swigincludedir = $(swigincludedir) ## right thing. For more info, see < ## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > -## Stamps used to ensure parallel make does the right thing. These -## are removed by "make clean", but otherwise unused except during the -## parallel built. These will not be included in a tarball, because -## the SWIG-generated files will be removed from the distribution. - -STAMPS += $(DEPDIR)/gnuradio_core_io-generate-* - ## Other cleaned files: dependency files generated by SWIG or this Makefile MOSTLYCLEANFILES += $(DEPDIR)/*.S* -## Add the .py and .cc files to the list of SWIG built sources. The -## .h file is sometimes built, but not always ... so that one has to -## be added manually by the including Makefile.am . - -# generating the py or scm file also generates the .cc or .h files, -# but dependencies work better without the .cc ort .h files listed. -# swig_built_sources += gnuradio_core_io.py -# if GUILE -# swig_built_sources += gnuradio/gnuradio_core_io.scm -# endif - ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including ## Makefile.swig . @@ -708,8 +622,6 @@ _gnuradio_core_io_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_io_la_swig_libadd) -# _gnuradio_core_io_la_DEPENDENCIES = python/gnuradio_core_io.lo - _gnuradio_core_io_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_core_io_la_swig_ldflags) @@ -723,14 +635,20 @@ gnuradio_core_io_python_PYTHON = \ gnuradio_core_io.py \ $(gnuradio_core_io) +python/gnuradio_core_io.cc: gnuradio_core_io.py +gnuradio_core_io.py: gnuradio_core_io.i + +# Include the python dependencies for this file +-include python/gnuradio_core_io.d +# end of PYTHON + if GUILE gnuradio_core_io_scmlib_LTLIBRARIES = libguile-gnuradio_core_io.la -libguile_gnuradio_core_io_la_SOURCES = \ - guile/gnuradio_core_io.cc \ +libguile_gnuradio_core_io_la_SOURCES = \ + guile/gnuradio_core_io.cc \ $(gnuradio_core_io_la_swig_sources) nobase_gnuradio_core_io_scm_DATA = gnuradio/gnuradio_core_io.scm gnuradio/gnuradio_core_io-primitive.scm -# Guile can use the same flags as python does libguile_gnuradio_core_io_la_LIBADD = $(_gnuradio_core_io_la_LIBADD) libguile_gnuradio_core_io_la_LDFLAGS = $(_gnuradio_core_io_la_LDFLAGS) libguile_gnuradio_core_io_la_CXXFLAGS = $(_gnuradio_core_io_la_CXXFLAGS) @@ -739,14 +657,11 @@ guile/gnuradio_core_io.cc: gnuradio/gnuradio_core_io.scm gnuradio/gnuradio_core_io.scm: gnuradio_core_io.i gnuradio/gnuradio_core_io-primitive.scm: gnuradio/gnuradio_core_io.scm +# Include the guile dependencies for this file -include guile/gnuradio_core_io.d endif # end of GUILE -gnuradio_core_io.lo: gnuradio_core_io.py gnuradio_core_io.scm -gnuradio_core_io.py: gnuradio_core_io.i - --include python/gnuradio_core_io.d # -*- Makefile -*- # @@ -817,28 +732,10 @@ gnuradio_core_hier_swigincludedir = $(swigincludedir) ## right thing. For more info, see < ## http://sources.redhat.com/automake/automake.html#Multiple-Outputs > -## Stamps used to ensure parallel make does the right thing. These -## are removed by "make clean", but otherwise unused except during the -## parallel built. These will not be included in a tarball, because -## the SWIG-generated files will be removed from the distribution. - -STAMPS += $(DEPDIR)/gnuradio_core_hier-generate-* - ## Other cleaned files: dependency files generated by SWIG or this Makefile MOSTLYCLEANFILES += $(DEPDIR)/*.S* -## Add the .py and .cc files to the list of SWIG built sources. The -## .h file is sometimes built, but not always ... so that one has to -## be added manually by the including Makefile.am . - -# generating the py or scm file also generates the .cc or .h files, -# but dependencies work better without the .cc ort .h files listed. -# swig_built_sources += gnuradio_core_hier.py -# if GUILE -# swig_built_sources += gnuradio/gnuradio_core_hier.scm -# endif - ## Various SWIG variables. These can be overloaded in the including ## Makefile.am by setting the variable value there, then including ## Makefile.swig . @@ -858,8 +755,6 @@ _gnuradio_core_hier_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_hier_la_swig_libadd) -# _gnuradio_core_hier_la_DEPENDENCIES = python/gnuradio_core_hier.lo - _gnuradio_core_hier_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_core_hier_la_swig_ldflags) @@ -873,14 +768,20 @@ gnuradio_core_hier_python_PYTHON = \ gnuradio_core_hier.py \ $(gnuradio_core_hier) +python/gnuradio_core_hier.cc: gnuradio_core_hier.py +gnuradio_core_hier.py: gnuradio_core_hier.i + +# Include the python dependencies for this file +-include python/gnuradio_core_hier.d +# end of PYTHON + if GUILE gnuradio_core_hier_scmlib_LTLIBRARIES = libguile-gnuradio_core_hier.la -libguile_gnuradio_core_hier_la_SOURCES = \ - guile/gnuradio_core_hier.cc \ +libguile_gnuradio_core_hier_la_SOURCES = \ + guile/gnuradio_core_hier.cc \ $(gnuradio_core_hier_la_swig_sources) nobase_gnuradio_core_hier_scm_DATA = gnuradio/gnuradio_core_hier.scm gnuradio/gnuradio_core_hier-primitive.scm -# Guile can use the same flags as python does libguile_gnuradio_core_hier_la_LIBADD = $(_gnuradio_core_hier_la_LIBADD) libguile_gnuradio_core_hier_la_LDFLAGS = $(_gnuradio_core_hier_la_LDFLAGS) libguile_gnuradio_core_hier_la_CXXFLAGS = $(_gnuradio_core_hier_la_CXXFLAGS) @@ -889,12 +790,9 @@ guile/gnuradio_core_hier.cc: gnuradio/gnuradio_core_hier.scm gnuradio/gnuradio_core_hier.scm: gnuradio_core_hier.i gnuradio/gnuradio_core_hier-primitive.scm: gnuradio/gnuradio_core_hier.scm +# Include the guile dependencies for this file -include guile/gnuradio_core_hier.d endif # end of GUILE -gnuradio_core_hier.lo: gnuradio_core_hier.py gnuradio_core_hier.scm -gnuradio_core_hier.py: gnuradio_core_hier.i - --include python/gnuradio_core_hier.d -- cgit From 406bd9d6725b58736959eb705235bb50fe48d48d Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Mon, 1 Nov 2010 21:20:05 -0700 Subject: Reduce guile load time from 4.5 to 1.2 seconds. Rewrite re-export-all to only export symbols from the module name supplied. --- gnuradio-core/src/lib/swig/gnuradio/core.scm | 9 +++++++-- .../src/lib/swig/gnuradio/export-safely.scm | 21 ++++++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio/core.scm b/gnuradio-core/src/lib/swig/gnuradio/core.scm index 08daeeb34..f13a8fb60 100644 --- a/gnuradio-core/src/lib/swig/gnuradio/core.scm +++ b/gnuradio-core/src/lib/swig/gnuradio/core.scm @@ -10,5 +10,10 @@ #:use-module (gnuradio gnuradio_core_hier) #:duplicates (merge-generics check)) -;; re-export everything... -(re-export-all (current-module)) +(re-export-all '(gnuradio gnuradio_core_runtime)) +(re-export-all '(gnuradio runtime-shim)) +(re-export-all '(gnuradio gnuradio_core_filter)) +(re-export-all '(gnuradio gnuradio_core_io)) +(re-export-all '(gnuradio gnuradio_core_general)) +(re-export-all '(gnuradio gnuradio_core_gengen)) +(re-export-all '(gnuradio gnuradio_core_hier)) diff --git a/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm b/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm index 2da7e633e..664292d2b 100644 --- a/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm +++ b/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm @@ -75,13 +75,16 @@ (define-public (names-in-imported-modules module) (delete-duplicates (concatenate (map names-in-module (module-uses module))))) -(define-public (re-export-all module) - (define (ok-to-re-export? name) - (let ((var (module-variable module name))) - (cond ((not var) #f) ; Undefined var - ((eq? var (module-local-variable module name)) #f) ; local var - (else #t)))) ; OK +(define-public (re-export-all src-module-name) + (let ((current (current-module)) + (src-module (resolve-interface src-module-name))) - (module-re-export! module - (filter ok-to-re-export? - (names-in-imported-modules module)))) + (define (ok-to-re-export? name) + (let ((var (module-variable current name))) + (cond ((not var) #f) ; Undefined var + ((eq? var (module-local-variable current name)) #f) ; local var + (else #t)))) ; OK + + (module-re-export! current + (filter ok-to-re-export? + (names-in-module src-module))))) -- cgit From 81867e5dfd939d8afdacbe22c6e2d41d4bc4b37e Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 5 Nov 2010 19:43:33 -0700 Subject: Create guile QA framework. Also moves hand coded files out of gnuradio-core/src/lib/swig/gnuradio that were getting nuked by make clean. --- gnuradio-core/src/Makefile.am | 7 +- gnuradio-core/src/guile/.gitignore | 3 + gnuradio-core/src/guile/Makefile.am | 38 +++++++++ gnuradio-core/src/guile/Swig/common.scm | 76 ++++++++++++++++++ gnuradio-core/src/guile/gnuradio/core.scm | 19 +++++ gnuradio-core/src/guile/gnuradio/export-safely.scm | 90 ++++++++++++++++++++++ gnuradio-core/src/guile/gnuradio/runtime-shim.scm | 89 +++++++++++++++++++++ gnuradio-core/src/guile/qa_stub.scm | 0 gnuradio-core/src/guile/run_guile_tests.in | 12 +++ gnuradio-core/src/lib/swig/Makefile.am | 12 --- gnuradio-core/src/lib/swig/Swig/common.scm | 76 ------------------ gnuradio-core/src/lib/swig/gnuradio/core.scm | 19 ----- .../src/lib/swig/gnuradio/export-safely.scm | 90 ---------------------- .../src/lib/swig/gnuradio/runtime-shim.scm | 89 --------------------- 14 files changed, 332 insertions(+), 288 deletions(-) create mode 100644 gnuradio-core/src/guile/.gitignore create mode 100644 gnuradio-core/src/guile/Makefile.am create mode 100644 gnuradio-core/src/guile/Swig/common.scm create mode 100644 gnuradio-core/src/guile/gnuradio/core.scm create mode 100644 gnuradio-core/src/guile/gnuradio/export-safely.scm create mode 100644 gnuradio-core/src/guile/gnuradio/runtime-shim.scm create mode 100644 gnuradio-core/src/guile/qa_stub.scm create mode 100644 gnuradio-core/src/guile/run_guile_tests.in delete mode 100644 gnuradio-core/src/lib/swig/Swig/common.scm delete mode 100644 gnuradio-core/src/lib/swig/gnuradio/core.scm delete mode 100644 gnuradio-core/src/lib/swig/gnuradio/export-safely.scm delete mode 100644 gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm (limited to 'gnuradio-core') 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 . +# + +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/guile/Swig/common.scm b/gnuradio-core/src/guile/Swig/common.scm new file mode 100644 index 000000000..a51d3a71d --- /dev/null +++ b/gnuradio-core/src/guile/Swig/common.scm @@ -0,0 +1,76 @@ +;;;************************************************************************ +;;;*common.scm +;;;* +;;;* This file contains generic SWIG GOOPS classes for generated +;;;* GOOPS file support +;;;* +;;;* Copyright (C) 2003 John Lenz (jelenz@wisc.edu) +;;;* Copyright (C) 2004 Matthias Koeppe (mkoeppe@mail.math.uni-magdeburg.de) +;;;* +;;;* This file may be freely redistributed without license or fee provided +;;;* this copyright message remains intact. +;;;************************************************************************ + +(define-module (Swig swigrun)) + +(define-module (Swig common) + #:use-module (oop goops) + #:use-module (Swig swigrun)) + +(define-class () + (new-function #:init-value #f)) + +(define-method (initialize (class ) initargs) + (slot-set! class 'new-function (get-keyword #:new-function initargs #f)) + (next-method)) + +(define-class () + (swig-smob #:init-value #f) + #:metaclass +) + +(define-method (initialize (obj ) initargs) + (next-method) + (slot-set! obj 'swig-smob + (let ((arg (get-keyword #:init-smob initargs #f))) + (if arg + arg + (let ((ret (apply (slot-ref (class-of obj) 'new-function) (get-keyword #:args initargs '())))) + ;; if the class is registered with runtime environment, + ;; new-Function will return a goops class. In that case, extract the smob + ;; from that goops class and set it as the current smob. + (if (slot-exists? ret 'swig-smob) + (slot-ref ret 'swig-smob) + ret)))))) + +(define (display-address o file) + (display (number->string (object-address o) 16) file)) + +(define (display-pointer-address o file) + ;; Don't fail if the function SWIG-PointerAddress is not present. + (let ((address (false-if-exception (SWIG-PointerAddress o)))) + (if address + (begin + (display " @ " file) + (display (number->string address 16) file))))) + +(define-method (write (o ) file) + ;; We display _two_ addresses to show the object's identity: + ;; * first the address of the GOOPS proxy object, + ;; * second the pointer address. + ;; The reason is that proxy objects are created and discarded on the + ;; fly, so different proxy objects for the same C object will appear. + (let ((class (class-of o))) + (if (slot-bound? class 'name) + (begin + (display "#<" file) + (display (class-name class) file) + (display #\space file) + (display-address o file) + (display-pointer-address o file) + (display ">" file)) + (next-method)))) + +(export ) + +;;; common.scm ends here diff --git a/gnuradio-core/src/guile/gnuradio/core.scm b/gnuradio-core/src/guile/gnuradio/core.scm new file mode 100644 index 000000000..f13a8fb60 --- /dev/null +++ b/gnuradio-core/src/guile/gnuradio/core.scm @@ -0,0 +1,19 @@ +;;; Glue the separate pieces of gnuradio-core into a single module + +(define-module (gnuradio core) + #:use-module (gnuradio gnuradio_core_runtime) + #:use-module (gnuradio runtime-shim) + #:use-module (gnuradio gnuradio_core_filter) + #:use-module (gnuradio gnuradio_core_io) + #:use-module (gnuradio gnuradio_core_general) + #:use-module (gnuradio gnuradio_core_gengen) + #:use-module (gnuradio gnuradio_core_hier) + #:duplicates (merge-generics check)) + +(re-export-all '(gnuradio gnuradio_core_runtime)) +(re-export-all '(gnuradio runtime-shim)) +(re-export-all '(gnuradio gnuradio_core_filter)) +(re-export-all '(gnuradio gnuradio_core_io)) +(re-export-all '(gnuradio gnuradio_core_general)) +(re-export-all '(gnuradio gnuradio_core_gengen)) +(re-export-all '(gnuradio gnuradio_core_hier)) diff --git a/gnuradio-core/src/guile/gnuradio/export-safely.scm b/gnuradio-core/src/guile/gnuradio/export-safely.scm new file mode 100644 index 000000000..664292d2b --- /dev/null +++ b/gnuradio-core/src/guile/gnuradio/export-safely.scm @@ -0,0 +1,90 @@ +;;; +;;; 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 module implements a macro, export-safely, that avoids +;;; exporting symbols that are actually generic-functions imported +;;; (explicity or implicitly) from elsewhere. +;;; +;;; This hackery is required so that the swig generated goops wrappers +;;; don't stomp on each other. For background on what this is about +;;; see this thread: +;;; +;;; http://lists.gnu.org/archive/html/guile-user/2006-05/msg00007.html +;;; +;;; Don't expect to understand what's going on here without looking at +;;; the guts of the module system (implemented in ice-9/boot-9.scm) and +;;; having a pretty good understanding of goops and generic-functions. + + +(define-module (gnuradio export-safely) + #:use-module (oop goops) + #:use-module (srfi srfi-1) + #:export-syntax (export-safely)) + +(define-public (generics-in-module module) + (let ((lst '())) + (module-for-each (lambda (sym var) + (if (variable-bound? var) + (let ((v (variable-ref var))) + (cond ((is-a? v ) + (set! lst (cons v lst))))))) + module) + lst)) + +(define-public (generic-function-names-in-module module) + (map generic-function-name (generics-in-module module))) + +(define-public (generic-function-names-in-imported-modules module) + (concatenate (map generic-function-names-in-module (module-uses module)))) + +(define-public (export-syms-if-not-imported-gf list-of-syms) + (let ((gf-names (generic-function-names-in-imported-modules (current-module)))) + (let ((to-export (filter (lambda (sym) + (not (memq sym gf-names))) + (delete-duplicates list-of-syms)))) + (module-export! (current-module) to-export)))) + +(defmacro export-safely names + `(export-syms-if-not-imported-gf ',names)) + + +(define-public (names-in-module module) + (let ((lst '())) + (module-for-each (lambda (sym var) + (if (variable-bound? var) + (set! lst (cons sym lst)))) + module) + lst)) + +(define-public (names-in-imported-modules module) + (delete-duplicates (concatenate (map names-in-module (module-uses module))))) + +(define-public (re-export-all src-module-name) + (let ((current (current-module)) + (src-module (resolve-interface src-module-name))) + + (define (ok-to-re-export? name) + (let ((var (module-variable current name))) + (cond ((not var) #f) ; Undefined var + ((eq? var (module-local-variable current name)) #f) ; local var + (else #t)))) ; OK + + (module-re-export! current + (filter ok-to-re-export? + (names-in-module src-module))))) diff --git a/gnuradio-core/src/guile/gnuradio/runtime-shim.scm b/gnuradio-core/src/guile/gnuradio/runtime-shim.scm new file mode 100644 index 000000000..c08d3947c --- /dev/null +++ b/gnuradio-core/src/guile/gnuradio/runtime-shim.scm @@ -0,0 +1,89 @@ +;;; +;;; 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 . +;;; + +(define-module (gnuradio runtime-shim) + #:use-module (oop goops) + #:use-module (gnuradio gnuradio_core_runtime) + #:duplicates (merge-generics replace check)) + +(define-class () + (block #:accessor block #:init-keyword #:block) + (port #:init-value 0 #:accessor port #:init-keyword #:port)) + +(define (gr:ep block port) + (make + #:block (coerce-to-basic-block block) #:port port)) + +(define (coerce-to-endpoint ep) + (cond ((is-a? ep ) ep) + ((false-if-exception (gr:to-basic-block ep)) + => (lambda (x) (gr:ep x 0))) + ((and (pair? ep) (= 2 (length ep)) + (false-if-exception (gr:to-basic-block (car ep)))) + => (lambda (x) (gr:ep x (cadr ep)))) + (else (error "Cannot coerce to an endpoint: " ep)))) + +(define (coerce-to-basic-block block) + (cond ((is-a? block ) block) + ((false-if-exception (gr:to-basic-block block)) => (lambda (x) x)) + (else (error "Cannot coerce to a gr_basic_block: " block)))) + +(define (coerce-to-top-block block) + (cond ((is-a? block ) block) + ((false-if-exception (gr:to-top-block block)) => (lambda (x) x)) + (else (error "Cannot coerce to a gr_top_block: " block)))) + +(define (coerce-to-hier-block2 block) + (cond ((is-a? block ) block) + ((false-if-exception (gr:to-hier-block2 block)) => (lambda (x) x)) + (else (error "Cannot coerce to a gr_hier_block2: " block)))) + + +;;; Connect one or more block endpoints. An endpoint is either a , +;;; a 2-list (block port), or a block instance. In the latter case, the port number +;;; is assumed to be zero. +;;; +;;; If multiple arguments are provided, connect will attempt to wire them in series, +;;; interpreting the endpoints as inputs or outputs as appropriate. +(define-method (gr:connect hb . points) + (dis/connect "connect" gr:primitive-connect hb points)) + +;;; Disconnect one or more block endpoints... +(define-method (gr:disconnect hb . points) + (dis/connect "disconnect" gr:primitive-disconnect hb points)) + +(define (dis/connect name gf hb points) + (let ((hb (coerce-to-hier-block2 hb)) + (points (list->vector (map coerce-to-endpoint points)))) + + (define (op2 p0 p1) + (gf hb (block p0) (port p0) (block p1) (port p1))) + + (let ((len (vector-length points))) + (case len + ((0) (error (string-append name " requires at least 1 endpoint; None provided."))) + ((1) (gf hb (vector-ref points 0))) + (else + (let loop ((n 1)) + (cond ((< n len) + (op2 (vector-ref points (1- n)) (vector-ref points n)) + (loop (1+ n)))))))))) + + +(export-safely gr:ep gr:connect gr:disconnect) 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 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/gnuradio-core/src/lib/swig/Swig/common.scm b/gnuradio-core/src/lib/swig/Swig/common.scm deleted file mode 100644 index a51d3a71d..000000000 --- a/gnuradio-core/src/lib/swig/Swig/common.scm +++ /dev/null @@ -1,76 +0,0 @@ -;;;************************************************************************ -;;;*common.scm -;;;* -;;;* This file contains generic SWIG GOOPS classes for generated -;;;* GOOPS file support -;;;* -;;;* Copyright (C) 2003 John Lenz (jelenz@wisc.edu) -;;;* Copyright (C) 2004 Matthias Koeppe (mkoeppe@mail.math.uni-magdeburg.de) -;;;* -;;;* This file may be freely redistributed without license or fee provided -;;;* this copyright message remains intact. -;;;************************************************************************ - -(define-module (Swig swigrun)) - -(define-module (Swig common) - #:use-module (oop goops) - #:use-module (Swig swigrun)) - -(define-class () - (new-function #:init-value #f)) - -(define-method (initialize (class ) initargs) - (slot-set! class 'new-function (get-keyword #:new-function initargs #f)) - (next-method)) - -(define-class () - (swig-smob #:init-value #f) - #:metaclass -) - -(define-method (initialize (obj ) initargs) - (next-method) - (slot-set! obj 'swig-smob - (let ((arg (get-keyword #:init-smob initargs #f))) - (if arg - arg - (let ((ret (apply (slot-ref (class-of obj) 'new-function) (get-keyword #:args initargs '())))) - ;; if the class is registered with runtime environment, - ;; new-Function will return a goops class. In that case, extract the smob - ;; from that goops class and set it as the current smob. - (if (slot-exists? ret 'swig-smob) - (slot-ref ret 'swig-smob) - ret)))))) - -(define (display-address o file) - (display (number->string (object-address o) 16) file)) - -(define (display-pointer-address o file) - ;; Don't fail if the function SWIG-PointerAddress is not present. - (let ((address (false-if-exception (SWIG-PointerAddress o)))) - (if address - (begin - (display " @ " file) - (display (number->string address 16) file))))) - -(define-method (write (o ) file) - ;; We display _two_ addresses to show the object's identity: - ;; * first the address of the GOOPS proxy object, - ;; * second the pointer address. - ;; The reason is that proxy objects are created and discarded on the - ;; fly, so different proxy objects for the same C object will appear. - (let ((class (class-of o))) - (if (slot-bound? class 'name) - (begin - (display "#<" file) - (display (class-name class) file) - (display #\space file) - (display-address o file) - (display-pointer-address o file) - (display ">" file)) - (next-method)))) - -(export ) - -;;; common.scm ends here diff --git a/gnuradio-core/src/lib/swig/gnuradio/core.scm b/gnuradio-core/src/lib/swig/gnuradio/core.scm deleted file mode 100644 index f13a8fb60..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio/core.scm +++ /dev/null @@ -1,19 +0,0 @@ -;;; Glue the separate pieces of gnuradio-core into a single module - -(define-module (gnuradio core) - #:use-module (gnuradio gnuradio_core_runtime) - #:use-module (gnuradio runtime-shim) - #:use-module (gnuradio gnuradio_core_filter) - #:use-module (gnuradio gnuradio_core_io) - #:use-module (gnuradio gnuradio_core_general) - #:use-module (gnuradio gnuradio_core_gengen) - #:use-module (gnuradio gnuradio_core_hier) - #:duplicates (merge-generics check)) - -(re-export-all '(gnuradio gnuradio_core_runtime)) -(re-export-all '(gnuradio runtime-shim)) -(re-export-all '(gnuradio gnuradio_core_filter)) -(re-export-all '(gnuradio gnuradio_core_io)) -(re-export-all '(gnuradio gnuradio_core_general)) -(re-export-all '(gnuradio gnuradio_core_gengen)) -(re-export-all '(gnuradio gnuradio_core_hier)) diff --git a/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm b/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm deleted file mode 100644 index 664292d2b..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio/export-safely.scm +++ /dev/null @@ -1,90 +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 . -;;; - -;;; This module implements a macro, export-safely, that avoids -;;; exporting symbols that are actually generic-functions imported -;;; (explicity or implicitly) from elsewhere. -;;; -;;; This hackery is required so that the swig generated goops wrappers -;;; don't stomp on each other. For background on what this is about -;;; see this thread: -;;; -;;; http://lists.gnu.org/archive/html/guile-user/2006-05/msg00007.html -;;; -;;; Don't expect to understand what's going on here without looking at -;;; the guts of the module system (implemented in ice-9/boot-9.scm) and -;;; having a pretty good understanding of goops and generic-functions. - - -(define-module (gnuradio export-safely) - #:use-module (oop goops) - #:use-module (srfi srfi-1) - #:export-syntax (export-safely)) - -(define-public (generics-in-module module) - (let ((lst '())) - (module-for-each (lambda (sym var) - (if (variable-bound? var) - (let ((v (variable-ref var))) - (cond ((is-a? v ) - (set! lst (cons v lst))))))) - module) - lst)) - -(define-public (generic-function-names-in-module module) - (map generic-function-name (generics-in-module module))) - -(define-public (generic-function-names-in-imported-modules module) - (concatenate (map generic-function-names-in-module (module-uses module)))) - -(define-public (export-syms-if-not-imported-gf list-of-syms) - (let ((gf-names (generic-function-names-in-imported-modules (current-module)))) - (let ((to-export (filter (lambda (sym) - (not (memq sym gf-names))) - (delete-duplicates list-of-syms)))) - (module-export! (current-module) to-export)))) - -(defmacro export-safely names - `(export-syms-if-not-imported-gf ',names)) - - -(define-public (names-in-module module) - (let ((lst '())) - (module-for-each (lambda (sym var) - (if (variable-bound? var) - (set! lst (cons sym lst)))) - module) - lst)) - -(define-public (names-in-imported-modules module) - (delete-duplicates (concatenate (map names-in-module (module-uses module))))) - -(define-public (re-export-all src-module-name) - (let ((current (current-module)) - (src-module (resolve-interface src-module-name))) - - (define (ok-to-re-export? name) - (let ((var (module-variable current name))) - (cond ((not var) #f) ; Undefined var - ((eq? var (module-local-variable current name)) #f) ; local var - (else #t)))) ; OK - - (module-re-export! current - (filter ok-to-re-export? - (names-in-module src-module))))) diff --git a/gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm b/gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm deleted file mode 100644 index c08d3947c..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio/runtime-shim.scm +++ /dev/null @@ -1,89 +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 . -;;; - -(define-module (gnuradio runtime-shim) - #:use-module (oop goops) - #:use-module (gnuradio gnuradio_core_runtime) - #:duplicates (merge-generics replace check)) - -(define-class () - (block #:accessor block #:init-keyword #:block) - (port #:init-value 0 #:accessor port #:init-keyword #:port)) - -(define (gr:ep block port) - (make - #:block (coerce-to-basic-block block) #:port port)) - -(define (coerce-to-endpoint ep) - (cond ((is-a? ep ) ep) - ((false-if-exception (gr:to-basic-block ep)) - => (lambda (x) (gr:ep x 0))) - ((and (pair? ep) (= 2 (length ep)) - (false-if-exception (gr:to-basic-block (car ep)))) - => (lambda (x) (gr:ep x (cadr ep)))) - (else (error "Cannot coerce to an endpoint: " ep)))) - -(define (coerce-to-basic-block block) - (cond ((is-a? block ) block) - ((false-if-exception (gr:to-basic-block block)) => (lambda (x) x)) - (else (error "Cannot coerce to a gr_basic_block: " block)))) - -(define (coerce-to-top-block block) - (cond ((is-a? block ) block) - ((false-if-exception (gr:to-top-block block)) => (lambda (x) x)) - (else (error "Cannot coerce to a gr_top_block: " block)))) - -(define (coerce-to-hier-block2 block) - (cond ((is-a? block ) block) - ((false-if-exception (gr:to-hier-block2 block)) => (lambda (x) x)) - (else (error "Cannot coerce to a gr_hier_block2: " block)))) - - -;;; Connect one or more block endpoints. An endpoint is either a , -;;; a 2-list (block port), or a block instance. In the latter case, the port number -;;; is assumed to be zero. -;;; -;;; If multiple arguments are provided, connect will attempt to wire them in series, -;;; interpreting the endpoints as inputs or outputs as appropriate. -(define-method (gr:connect hb . points) - (dis/connect "connect" gr:primitive-connect hb points)) - -;;; Disconnect one or more block endpoints... -(define-method (gr:disconnect hb . points) - (dis/connect "disconnect" gr:primitive-disconnect hb points)) - -(define (dis/connect name gf hb points) - (let ((hb (coerce-to-hier-block2 hb)) - (points (list->vector (map coerce-to-endpoint points)))) - - (define (op2 p0 p1) - (gf hb (block p0) (port p0) (block p1) (port p1))) - - (let ((len (vector-length points))) - (case len - ((0) (error (string-append name " requires at least 1 endpoint; None provided."))) - ((1) (gf hb (vector-ref points 0))) - (else - (let loop ((n 1)) - (cond ((< n len) - (op2 (vector-ref points (1- n)) (vector-ref points n)) - (loop (1+ n)))))))))) - - -(export-safely gr:ep gr:connect gr:disconnect) -- cgit From 5c81f275a32f969cefd20287a44bdeb1aeef436f Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 5 Nov 2010 19:48:27 -0700 Subject: Remove .gitignore from empty directory --- gnuradio-core/src/lib/swig/gnuradio/.gitignore | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 gnuradio-core/src/lib/swig/gnuradio/.gitignore (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio/.gitignore b/gnuradio-core/src/lib/swig/gnuradio/.gitignore deleted file mode 100644 index 20ce65795..000000000 --- a/gnuradio-core/src/lib/swig/gnuradio/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -/gnuradio_core_filter.scm -/gnuradio_core_filter-primitive.scm -/gnuradio_core_general.scm -/gnuradio_core_general-primitive.scm -/gnuradio_core_gengen.scm -/gnuradio_core_gengen-primitive.scm -/gnuradio_core_hier.scm -/gnuradio_core_hier-primitive.scm -/gnuradio_core_io.scm -/gnuradio_core_io-primitive.scm -/gnuradio_core_runtime.scm -/gnuradio_core_runtime-primitive.scm -- cgit From 53c6be5b6bdca4fe93b9034cb0b34eaa274af9d9 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 5 Nov 2010 19:57:18 -0700 Subject: update .gitignore --- gnuradio-core/src/lib/swig/.gitignore | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/.gitignore b/gnuradio-core/src/lib/swig/.gitignore index 75d6ce5b7..35e974948 100644 --- a/gnuradio-core/src/lib/swig/.gitignore +++ b/gnuradio-core/src/lib/swig/.gitignore @@ -16,28 +16,35 @@ gnuradio_core_filter.d gnuradio_core_filter.h gnuradio_core_filter.py gnuradio_core_filter.scm +gnuradio_core_filter-primitive.scm gnuradio_core_general.cc gnuradio_core_general.d gnuradio_core_general.h gnuradio_core_general.py gnuradio_core_general.scm +gnuradio_core_general-primitive.scm gnuradio_core_gengen.cc gnuradio_core_gengen.d gnuradio_core_gengen.h gnuradio_core_gengen.py gnuradio_core_gengen.scm +gnuradio_core_gengen-primitive.scm gnuradio_core_hier.cc gnuradio_core_hier.d gnuradio_core_hier.h gnuradio_core_hier.py gnuradio_core_hier.scm +gnuradio_core_hier-primitive.scm gnuradio_core_io.cc gnuradio_core_io.d gnuradio_core_io.h gnuradio_core_io.py gnuradio_core_io.scm +gnuradio_core_io-primitive.scm gnuradio_core_runtime.cc gnuradio_core_runtime.d gnuradio_core_runtime.h gnuradio_core_runtime.py gnuradio_core_runtime.scm +gnuradio_core_runtime-primitive.scm + -- cgit From a79986e0a88632029daf2dad5d05518d33bb1866 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 5 Nov 2010 21:58:58 -0700 Subject: First real guile QA code --- gnuradio-core/src/guile/Makefile.am | 4 +- gnuradio-core/src/guile/qa_0000_basics.scm | 82 +++ gnuradio-core/src/guile/qa_stub.scm | 0 gnuradio-core/src/guile/srfi/srfi-64.scm | 970 +++++++++++++++++++++++++++++ 4 files changed, 1054 insertions(+), 2 deletions(-) create mode 100644 gnuradio-core/src/guile/qa_0000_basics.scm delete mode 100644 gnuradio-core/src/guile/qa_stub.scm create mode 100644 gnuradio-core/src/guile/srfi/srfi-64.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index 3c21373af..ef6ab0b7e 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -34,5 +34,5 @@ nobase_guile_DATA = \ Swig/common.scm \ gnuradio/core.scm \ gnuradio/export-safely.scm \ - gnuradio/runtime-shim.scm - + gnuradio/runtime-shim.scm \ + srfi/srfi-64.scm diff --git a/gnuradio-core/src/guile/qa_0000_basics.scm b/gnuradio-core/src/guile/qa_0000_basics.scm new file mode 100644 index 000000000..19bde0589 --- /dev/null +++ b/gnuradio-core/src/guile/qa_0000_basics.scm @@ -0,0 +1,82 @@ +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +(load-from-path "srfi/srfi-64") +(use-modules (ice-9 format)) +(use-modules (ice-9 pretty-print)) + +;; (write "Hello QA world!\n") + +(define (vector-map f v) + (list->vector (map f (vector->list v)))) + +(define (test-1) + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + (expected-result (vector-map (lambda (x) (* x 2)) src-data)) + (tb (gr:top-block-swig "my top block")) + (src (gr:vector-source-i src-data #f)) + (op (gr:multiply-const-ii 2)) + (dst (gr:vector-sink-i))) + + ;; using gr:ep to create endpoints + (gr:connect tb (gr:ep src 0) (gr:ep op 0)) + (gr:connect tb (gr:ep op 0) (gr:ep dst 0)) + + (gr:run tb) + (let ((actual-result (gr:data dst))) + (test-equal expected-result actual-result)))) + +(define (test-2) + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + (expected-result (vector-map (lambda (x) (* x 2)) src-data)) + (tb (gr:top-block-swig "my top block")) + (src (gr:vector-source-i src-data #f)) + (op (gr:multiply-const-ii 2)) + (dst (gr:vector-sink-i))) + + ;; using just blocks + (gr:connect tb src op) + (gr:connect tb op dst) + + (gr:run tb) + (let ((actual-result (gr:data dst))) + (test-equal expected-result actual-result)))) + +(define (test-3) + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + (expected-result (vector-map (lambda (x) (* x 2)) src-data)) + (tb (gr:top-block-swig "my top block")) + (src (gr:vector-source-i src-data #f)) + (op (gr:multiply-const-ii 2)) + (dst (gr:vector-sink-i))) + + ;; using lists to represent endpoints + (gr:connect tb `(,src 0) `(,op 0)) + (gr:connect tb `(,op 0) `(,dst 0)) + + (gr:run tb) + (let ((actual-result (gr:data dst))) + (test-equal expected-result actual-result)))) + +(define (test-4) + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + (expected-result (vector-map (lambda (x) (* x 2)) src-data)) + (tb (gr:top-block-swig "my top block")) + (src (gr:vector-source-i src-data #f)) + (op (gr:multiply-const-ii 2)) + (dst (gr:vector-sink-i))) + + ;; using multiple endpoints + (gr:connect tb src op dst) + + (gr:run tb) + (let ((actual-result (gr:data dst))) + (test-equal expected-result actual-result)))) + + +(test-begin "qa_0000_basics") +(test-1) +(test-2) +(test-3) +(test-4) +(test-end "qa_0000_basics") diff --git a/gnuradio-core/src/guile/qa_stub.scm b/gnuradio-core/src/guile/qa_stub.scm deleted file mode 100644 index e69de29bb..000000000 diff --git a/gnuradio-core/src/guile/srfi/srfi-64.scm b/gnuradio-core/src/guile/srfi/srfi-64.scm new file mode 100644 index 000000000..25833b3f7 --- /dev/null +++ b/gnuradio-core/src/guile/srfi/srfi-64.scm @@ -0,0 +1,970 @@ +;; Copyright (c) 2005, 2006 Per Bothner +;; +;; Permission is hereby granted, free of charge, to any person +;; obtaining a copy of this software and associated documentation +;; files (the "Software"), to deal in the Software without +;; restriction, including without limitation the rights to use, copy, +;; modify, merge, publish, distribute, sublicense, and/or sell copies +;; of the Software, and to permit persons to whom the Software is +;; furnished to do so, subject to the following conditions: +;; +;; The above copyright notice and this permission notice shall be +;; included in all copies or substantial portions of the Software. +;; +;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +;; NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +;; BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +;; ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +;; CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +;; SOFTWARE. + +(cond-expand + (chicken + (require-extension syntax-case)) + (guile + (use-modules (ice-9 syncase) (srfi srfi-9) + ;;(srfi srfi-34) (srfi srfi-35) - not in Guile 1.6.7 + (srfi srfi-39))) + (sisc + (require-extension (srfi 9 34 35 39))) + (kawa + (module-compile-options warn-undefined-variable: #t + warn-invoke-unknown-method: #t) + (provide 'srfi-64) + (provide 'testing) + (require 'srfi-34) + (require 'srfi-35)) + (else () + )) + +(cond-expand + (kawa + (define-syntax %test-export + (syntax-rules () + ((%test-export test-begin . other-names) + (module-export %test-begin . other-names))))) + (else + (define-syntax %test-export + (syntax-rules () + ((%test-export . names) (if #f #f)))))) + +;; List of exported names +(%test-export + test-begin ;; must be listed first, since in Kawa (at least) it is "magic". + test-end test-assert test-eqv test-eq test-equal + test-approximate test-assert test-error test-apply test-with-runner + test-match-nth test-match-all test-match-any test-match-name + test-skip test-expect-fail test-read-eval-string + test-runner-group-path test-group-with-cleanup + test-result-ref test-result-set! test-result-clear test-result-remove + test-result-kind test-passed? + test-log-to-file + ; Misc test-runner functions + test-runner? test-runner-reset test-runner-null + test-runner-simple test-runner-current test-runner-factory test-runner-get + test-runner-create test-runner-test-name + ;; test-runner field setter and getter functions - see %test-record-define: + test-runner-pass-count test-runner-pass-count! + test-runner-fail-count test-runner-fail-count! + test-runner-xpass-count test-runner-xpass-count! + test-runner-xfail-count test-runner-xfail-count! + test-runner-skip-count test-runner-skip-count! + test-runner-group-stack test-runner-group-stack! + test-runner-on-test-begin test-runner-on-test-begin! + test-runner-on-test-end test-runner-on-test-end! + test-runner-on-group-begin test-runner-on-group-begin! + test-runner-on-group-end test-runner-on-group-end! + test-runner-on-final test-runner-on-final! + test-runner-on-bad-count test-runner-on-bad-count! + test-runner-on-bad-end-name test-runner-on-bad-end-name! + test-result-alist test-result-alist! + test-runner-aux-value test-runner-aux-value! + ;; default/simple call-back functions, used in default test-runner, + ;; but can be called to construct more complex ones. + test-on-group-begin-simple test-on-group-end-simple + test-on-bad-count-simple test-on-bad-end-name-simple + test-on-final-simple test-on-test-end-simple + test-on-final-simple) + +(cond-expand + (srfi-9 + (define-syntax %test-record-define + (syntax-rules () + ((%test-record-define alloc runner? (name index setter getter) ...) + (define-record-type test-runner + (alloc) + runner? + (name setter getter) ...))))) + (else + (define %test-runner-cookie (list "test-runner")) + (define-syntax %test-record-define + (syntax-rules () + ((%test-record-define alloc runner? (name index getter setter) ...) + (begin + (define (runner? obj) + (and (vector? obj) + (> (vector-length obj) 1) + (eq (vector-ref obj 0) %test-runner-cookie))) + (define (alloc) + (let ((runner (make-vector 22))) + (vector-set! runner 0 %test-runner-cookie) + runner)) + (begin + (define (getter runner) + (vector-ref runner index)) ...) + (begin + (define (setter runner value) + (vector-set! runner index value)) ...))))))) + +(%test-record-define + %test-runner-alloc test-runner? + ;; Cumulate count of all tests that have passed and were expected to. + (pass-count 1 test-runner-pass-count test-runner-pass-count!) + (fail-count 2 test-runner-fail-count test-runner-fail-count!) + (xpass-count 3 test-runner-xpass-count test-runner-xpass-count!) + (xfail-count 4 test-runner-xfail-count test-runner-xfail-count!) + (skip-count 5 test-runner-skip-count test-runner-skip-count!) + (skip-list 6 %test-runner-skip-list %test-runner-skip-list!) + (fail-list 7 %test-runner-fail-list %test-runner-fail-list!) + ;; Normally #t, except when in a test-apply. + (run-list 8 %test-runner-run-list %test-runner-run-list!) + (skip-save 9 %test-runner-skip-save %test-runner-skip-save!) + (fail-save 10 %test-runner-fail-save %test-runner-fail-save!) + (group-stack 11 test-runner-group-stack test-runner-group-stack!) + (on-test-begin 12 test-runner-on-test-begin test-runner-on-test-begin!) + (on-test-end 13 test-runner-on-test-end test-runner-on-test-end!) + ;; Call-back when entering a group. Takes (runner suite-name count). + (on-group-begin 14 test-runner-on-group-begin test-runner-on-group-begin!) + ;; Call-back when leaving a group. + (on-group-end 15 test-runner-on-group-end test-runner-on-group-end!) + ;; Call-back when leaving the outermost group. + (on-final 16 test-runner-on-final test-runner-on-final!) + ;; Call-back when expected number of tests was wrong. + (on-bad-count 17 test-runner-on-bad-count test-runner-on-bad-count!) + ;; Call-back when name in test=end doesn't match test-begin. + (on-bad-end-name 18 test-runner-on-bad-end-name test-runner-on-bad-end-name!) + ;; Cumulate count of all tests that have been done. + (total-count 19 %test-runner-total-count %test-runner-total-count!) + ;; Stack (list) of (count-at-start . expected-count): + (count-list 20 %test-runner-count-list %test-runner-count-list!) + (result-alist 21 test-result-alist test-result-alist!) + ;; Field can be used by test-runner for any purpose. + ;; test-runner-simple uses it for a log file. + (aux-value 22 test-runner-aux-value test-runner-aux-value!) +) + +(define (test-runner-reset runner) + (test-runner-pass-count! runner 0) + (test-runner-fail-count! runner 0) + (test-runner-xpass-count! runner 0) + (test-runner-xfail-count! runner 0) + (test-runner-skip-count! runner 0) + (%test-runner-total-count! runner 0) + (%test-runner-count-list! runner '()) + (%test-runner-run-list! runner #t) + (%test-runner-skip-list! runner '()) + (%test-runner-fail-list! runner '()) + (%test-runner-skip-save! runner '()) + (%test-runner-fail-save! runner '()) + (test-runner-group-stack! runner '())) + +(define (test-runner-group-path runner) + (reverse (test-runner-group-stack runner))) + +(define (%test-null-callback runner) #f) + +(define (test-runner-null) + (let ((runner (%test-runner-alloc))) + (test-runner-reset runner) + (test-runner-on-group-begin! runner (lambda (runner name count) #f)) + (test-runner-on-group-end! runner %test-null-callback) + (test-runner-on-final! runner %test-null-callback) + (test-runner-on-test-begin! runner %test-null-callback) + (test-runner-on-test-end! runner %test-null-callback) + (test-runner-on-bad-count! runner (lambda (runner count expected) #f)) + (test-runner-on-bad-end-name! runner (lambda (runner begin end) #f)) + runner)) + +;; Not part of the specification. FIXME +;; Controls whether a log file is generated. +(define test-log-to-file #f) + +(define (test-runner-simple) + (let ((runner (%test-runner-alloc))) + (test-runner-reset runner) + (test-runner-on-group-begin! runner test-on-group-begin-simple) + (test-runner-on-group-end! runner test-on-group-end-simple) + (test-runner-on-final! runner test-on-final-simple) + (test-runner-on-test-begin! runner test-on-test-begin-simple) + (test-runner-on-test-end! runner test-on-test-end-simple) + (test-runner-on-bad-count! runner test-on-bad-count-simple) + (test-runner-on-bad-end-name! runner test-on-bad-end-name-simple) + runner)) + +(cond-expand + (srfi-39 + (define test-runner-current (make-parameter #f)) + (define test-runner-factory (make-parameter test-runner-simple))) + (else + (define %test-runner-current #f) + (define-syntax test-runner-current + (syntax-rules () + ((test-runner-current) + %test-runner-current) + ((test-runner-current runner) + (set! %test-runner-current runner)))) + (define %test-runner-factory test-runner-simple) + (define-syntax test-runner-factory + (syntax-rules () + ((test-runner-factory) + %test-runner-factory) + ((test-runner-factory runner) + (set! %test-runner-factory runner)))))) + +;; A safer wrapper to test-runner-current. +(define (test-runner-get) + (let ((r (test-runner-current))) + (if (not r) + (cond-expand + (srfi-23 (error "test-runner not initialized - test-begin missing?")) + (else #t))) + r)) + +(define (%test-specificier-matches spec runner) + (spec runner)) + +(define (test-runner-create) + ((test-runner-factory))) + +(define (%test-any-specifier-matches list runner) + (let ((result #f)) + (let loop ((l list)) + (cond ((null? l) result) + (else + (if (%test-specificier-matches (car l) runner) + (set! result #t)) + (loop (cdr l))))))) + +;; Returns #f, #t, or 'xfail. +(define (%test-should-execute runner) + (let ((run (%test-runner-run-list runner))) + (cond ((or + (not (or (eqv? run #t) + (%test-any-specifier-matches run runner))) + (%test-any-specifier-matches + (%test-runner-skip-list runner) + runner)) + (test-result-set! runner 'result-kind 'skip) + #f) + ((%test-any-specifier-matches + (%test-runner-fail-list runner) + runner) + (test-result-set! runner 'result-kind 'xfail) + 'xfail) + (else #t)))) + +(define (%test-begin suite-name count) + (if (not (test-runner-current)) + (test-runner-current (test-runner-create))) + (let ((runner (test-runner-current))) + ((test-runner-on-group-begin runner) runner suite-name count) + (%test-runner-skip-save! runner + (cons (%test-runner-skip-list runner) + (%test-runner-skip-save runner))) + (%test-runner-fail-save! runner + (cons (%test-runner-fail-list runner) + (%test-runner-fail-save runner))) + (%test-runner-count-list! runner + (cons (cons (%test-runner-total-count runner) + count) + (%test-runner-count-list runner))) + (test-runner-group-stack! runner (cons suite-name + (test-runner-group-stack runner))))) +(cond-expand + (kawa + ;; Kawa has test-begin built in, implemented as: + ;; (begin + ;; (cond-expand (srfi-64 #!void) (else (require 'srfi-64))) + ;; (%test-begin suite-name [count])) + ;; This puts test-begin but only test-begin in the default environment., + ;; which makes normal test suites loadable without non-portable commands. + ) + (else + (define-syntax test-begin + (syntax-rules () + ((test-begin suite-name) + (%test-begin suite-name #f)) + ((test-begin suite-name count) + (%test-begin suite-name count)))))) + +(define (test-on-group-begin-simple runner suite-name count) + (if (null? (test-runner-group-stack runner)) + (begin + (display "%%%% Starting test ") + (display suite-name) + (if test-log-to-file + (let* ((log-file-name + (if (string? test-log-to-file) test-log-to-file + (string-append suite-name ".log"))) + (log-file + (cond-expand (mzscheme + (open-output-file log-file-name 'truncate/replace)) + (else (open-output-file log-file-name))))) + (display "%%%% Starting test " log-file) + (display suite-name log-file) + (newline log-file) + (test-runner-aux-value! runner log-file) + (display " (Writing full log to \"") + (display log-file-name) + (display "\")"))) + (newline))) + (let ((log (test-runner-aux-value runner))) + (if (output-port? log) + (begin + (display "Group begin: " log) + (display suite-name log) + (newline log)))) + #f) + +(define (test-on-group-end-simple runner) + (let ((log (test-runner-aux-value runner))) + (if (output-port? log) + (begin + (display "Group end: " log) + (display (car (test-runner-group-stack runner)) log) + (newline log)))) + #f) + +(define (%test-on-bad-count-write runner count expected-count port) + (display "*** Total number of tests was " port) + (display count port) + (display " but should be " port) + (display expected-count port) + (display ". ***" port) + (newline port) + (display "*** Discrepancy indicates testsuite error or exceptions. ***" port) + (newline port)) + +(define (test-on-bad-count-simple runner count expected-count) + (%test-on-bad-count-write runner count expected-count (current-output-port)) + (let ((log (test-runner-aux-value runner))) + (if (output-port? log) + (%test-on-bad-count-write runner count expected-count log)))) + +(define (test-on-bad-end-name-simple runner begin-name end-name) + (let ((msg (string-append (%test-format-line runner) "test-end " begin-name + " does not match test-begin " end-name))) + (cond-expand + (srfi-23 (error msg)) + (else (display msg) (newline))))) + + +(define (%test-final-report1 value label port) + (if (> value 0) + (begin + (display label port) + (display value port) + (newline port)))) + +(define (%test-final-report-simple runner port) + (%test-final-report1 (test-runner-pass-count runner) + "# of expected passes " port) + (%test-final-report1 (test-runner-xfail-count runner) + "# of expected failures " port) + (%test-final-report1 (test-runner-xpass-count runner) + "# of unexpected successes " port) + (%test-final-report1 (test-runner-fail-count runner) + "# of unexpected failures " port) + (%test-final-report1 (test-runner-skip-count runner) + "# of skipped tests " port)) + +(define (test-on-final-simple runner) + (%test-final-report-simple runner (current-output-port)) + (let ((log (test-runner-aux-value runner))) + (if (output-port? log) + (%test-final-report-simple runner log)))) + +(define (%test-format-line runner) + (let* ((line-info (test-result-alist runner)) + (source-file (assq 'source-file line-info)) + (source-line (assq 'source-line line-info)) + (file (if source-file (cdr source-file) ""))) + (if source-line + (string-append file ":" + (number->string (cdr source-line)) ": ") + ""))) + +(define (%test-end suite-name line-info) + (let* ((r (test-runner-get)) + (groups (test-runner-group-stack r)) + (line (%test-format-line r))) + (test-result-alist! r line-info) + (if (null? groups) + (let ((msg (string-append line "test-end not in a group"))) + (cond-expand + (srfi-23 (error msg)) + (else (display msg) (newline))))) + (if (and suite-name (not (equal? suite-name (car groups)))) + ((test-runner-on-bad-end-name r) r suite-name (car groups))) + (let* ((count-list (%test-runner-count-list r)) + (expected-count (cdar count-list)) + (saved-count (caar count-list)) + (group-count (- (%test-runner-total-count r) saved-count))) + (if (and expected-count + (not (= expected-count group-count))) + ((test-runner-on-bad-count r) r group-count expected-count)) + ((test-runner-on-group-end r) r) + (test-runner-group-stack! r (cdr (test-runner-group-stack r))) + (%test-runner-skip-list! r (car (%test-runner-skip-save r))) + (%test-runner-skip-save! r (cdr (%test-runner-skip-save r))) + (%test-runner-fail-list! r (car (%test-runner-fail-save r))) + (%test-runner-fail-save! r (cdr (%test-runner-fail-save r))) + (%test-runner-count-list! r (cdr count-list)) + (if (null? (test-runner-group-stack r)) + ((test-runner-on-final r) r))))) + +(define-syntax test-group + (syntax-rules () + ((test-group suite-name . body) + (let ((r (test-runner-current))) + ;; Ideally should also set line-number, if available. + (test-result-alist! r (list (cons 'test-name suite-name))) + (if (%test-should-execute r) + (dynamic-wind + (lambda () (test-begin suite-name)) + (lambda () . body) + (lambda () (test-end suite-name)))))))) + +(define-syntax test-group-with-cleanup + (syntax-rules () + ((test-group-with-cleanup suite-name form cleanup-form) + (test-group suite-name + (dynamic-wind + (lambda () #f) + (lambda () form) + (lambda () cleanup-form)))) + ((test-group-with-cleanup suite-name cleanup-form) + (test-group-with-cleanup suite-name #f cleanup-form)) + ((test-group-with-cleanup suite-name form1 form2 form3 . rest) + (test-group-with-cleanup suite-name (begin form1 form2) form3 . rest)))) + +(define (test-on-test-begin-simple runner) + (let ((log (test-runner-aux-value runner))) + (if (output-port? log) + (let* ((results (test-result-alist runner)) + (source-file (assq 'source-file results)) + (source-line (assq 'source-line results)) + (source-form (assq 'source-form results)) + (test-name (assq 'test-name results))) + (display "Test begin:" log) + (newline log) + (if test-name (%test-write-result1 test-name log)) + (if source-file (%test-write-result1 source-file log)) + (if source-line (%test-write-result1 source-line log)) + (if source-file (%test-write-result1 source-form log)))))) + +(define-syntax test-result-ref + (syntax-rules () + ((test-result-ref runner pname) + (test-result-ref runner pname #f)) + ((test-result-ref runner pname default) + (let ((p (assq pname (test-result-alist runner)))) + (if p (cdr p) default))))) + +(define (test-on-test-end-simple runner) + (let ((log (test-runner-aux-value runner)) + (kind (test-result-ref runner 'result-kind))) + (if (memq kind '(fail xpass)) + (let* ((results (test-result-alist runner)) + (source-file (assq 'source-file results)) + (source-line (assq 'source-line results)) + (test-name (assq 'test-name results))) + (if (or source-file source-line) + (begin + (if source-file (display (cdr source-file))) + (display ":") + (if source-line (display (cdr source-line))) + (display ": "))) + (display (if (eq? kind 'xpass) "XPASS" "FAIL")) + (if test-name + (begin + (display " ") + (display (cdr test-name)))) + (newline))) + (if (output-port? log) + (begin + (display "Test end:" log) + (newline log) + (let loop ((list (test-result-alist runner))) + (if (pair? list) + (let ((pair (car list))) + ;; Write out properties not written out by on-test-begin. + (if (not (memq (car pair) + '(test-name source-file source-line source-form))) + (%test-write-result1 pair log)) + (loop (cdr list))))))))) + +(define (%test-write-result1 pair port) + (display " " port) + (display (car pair) port) + (display ": " port) + (write (cdr pair) port) + (newline port)) + +(define (test-result-set! runner pname value) + (let* ((alist (test-result-alist runner)) + (p (assq pname alist))) + (if p + (set-cdr! p value) + (test-result-alist! runner (cons (cons pname value) alist))))) + +(define (test-result-clear runner) + (test-result-alist! runner '())) + +(define (test-result-remove runner pname) + (let* ((alist (test-result-alist runner)) + (p (assq pname alist))) + (if p + (test-result-alist! runner + (let loop ((r alist)) + (if (eq? r p) (cdr r) + (cons (car r) (loop (cdr r))))))))) + +(define (test-result-kind . rest) + (let ((runner (if (pair? rest) (car rest) (test-runner-current)))) + (test-result-ref runner 'result-kind))) + +(define (test-passed? . rest) + (let ((runner (if (pair? rest) (car rest) (test-runner-get)))) + (memq (test-result-ref runner 'result-kind) '(pass xpass)))) + +(define (%test-report-result) + (let* ((r (test-runner-get)) + (result-kind (test-result-kind r))) + (case result-kind + ((pass) + (test-runner-pass-count! r (+ 1 (test-runner-pass-count r)))) + ((fail) + (test-runner-fail-count! r (+ 1 (test-runner-fail-count r)))) + ((xpass) + (test-runner-xpass-count! r (+ 1 (test-runner-xpass-count r)))) + ((xfail) + (test-runner-xfail-count! r (+ 1 (test-runner-xfail-count r)))) + (else + (test-runner-skip-count! r (+ 1 (test-runner-skip-count r))))) + (%test-runner-total-count! r (+ 1 (%test-runner-total-count r))) + ((test-runner-on-test-end r) r))) + +(cond-expand + (guile + (define-syntax %test-evaluate-with-catch + (syntax-rules () + ((%test-evaluate-with-catch test-expression) + (catch #t (lambda () test-expression) (lambda (key . args) #f)))))) + (kawa + (define-syntax %test-evaluate-with-catch + (syntax-rules () + ((%test-evaluate-with-catch test-expression) + (try-catch test-expression + (ex + (test-result-set! (test-runner-current) 'actual-error ex) + #f)))))) + (srfi-34 + (define-syntax %test-evaluate-with-catch + (syntax-rules () + ((%test-evaluate-with-catch test-expression) + (guard (err (else #f)) test-expression))))) + (chicken + (define-syntax %test-evaluate-with-catch + (syntax-rules () + ((%test-evaluate-with-catch test-expression) + (condition-case test-expression (ex () #f)))))) + (else + (define-syntax %test-evaluate-with-catch + (syntax-rules () + ((%test-evaluate-with-catch test-expression) + test-expression))))) + +(cond-expand + ((or kawa mzscheme) + (cond-expand + (mzscheme + (define-for-syntax (%test-syntax-file form) + (let ((source (syntax-source form))) + (cond ((string? source) file) + ((path? source) (path->string source)) + (else #f))))) + (kawa + (define (%test-syntax-file form) + (syntax-source form)))) + (define-for-syntax (%test-source-line2 form) + (let* ((line (syntax-line form)) + (file (%test-syntax-file form)) + (line-pair (if line (list (cons 'source-line line)) '()))) + (cons (cons 'source-form (syntax-object->datum form)) + (if file (cons (cons 'source-file file) line-pair) line-pair))))) + (else + (define (%test-source-line2 form) + '()))) + +(define (%test-on-test-begin r) + (%test-should-execute r) + ((test-runner-on-test-begin r) r) + (not (eq? 'skip (test-result-ref r 'result-kind)))) + +(define (%test-on-test-end r result) + (test-result-set! r 'result-kind + (if (eq? (test-result-ref r 'result-kind) 'xfail) + (if result 'xpass 'xfail) + (if result 'pass 'fail)))) + +(define (test-runner-test-name runner) + (test-result-ref runner 'test-name "")) + +(define-syntax %test-comp2body + (syntax-rules () + ((%test-comp2body r comp expected expr) + (let () + (if (%test-on-test-begin r) + (let ((exp expected)) + (test-result-set! r 'expected-value exp) + (let ((res (%test-evaluate-with-catch expr))) + (test-result-set! r 'actual-value res) + (%test-on-test-end r (comp exp res))))) + (%test-report-result))))) + +(define (%test-approximimate= error) + (lambda (value expected) + (and (>= value (- expected error)) + (<= value (+ expected error))))) + +(define-syntax %test-comp1body + (syntax-rules () + ((%test-comp1body r expr) + (let () + (if (%test-on-test-begin r) + (let () + (let ((res (%test-evaluate-with-catch expr))) + (test-result-set! r 'actual-value res) + (%test-on-test-end r res)))) + (%test-report-result))))) + +(cond-expand + ((or kawa mzscheme) + ;; Should be made to work for any Scheme with syntax-case + ;; However, I haven't gotten the quoting working. FIXME. + (define-syntax test-end + (lambda (x) + (syntax-case (list x (list 'quote (%test-source-line2 x))) () + (((mac suite-name) line) + (syntax + (%test-end suite-name line))) + (((mac) line) + (syntax + (%test-end #f line)))))) + (define-syntax test-assert + (lambda (x) + (syntax-case (list x (list 'quote (%test-source-line2 x))) () + (((mac tname expr) line) + (syntax + (let* ((r (test-runner-get)) + (name tname)) + (test-result-alist! r (cons (cons 'test-name tname) line)) + (%test-comp1body r expr)))) + (((mac expr) line) + (syntax + (let* ((r (test-runner-get))) + (test-result-alist! r line) + (%test-comp1body r expr))))))) + (define-for-syntax (%test-comp2 comp x) + (syntax-case (list x (list 'quote (%test-source-line2 x)) comp) () + (((mac tname expected expr) line comp) + (syntax + (let* ((r (test-runner-get)) + (name tname)) + (test-result-alist! r (cons (cons 'test-name tname) line)) + (%test-comp2body r comp expected expr)))) + (((mac expected expr) line comp) + (syntax + (let* ((r (test-runner-get))) + (test-result-alist! r line) + (%test-comp2body r comp expected expr)))))) + (define-syntax test-eqv + (lambda (x) (%test-comp2 (syntax eqv?) x))) + (define-syntax test-eq + (lambda (x) (%test-comp2 (syntax eq?) x))) + (define-syntax test-equal + (lambda (x) (%test-comp2 (syntax equal?) x))) + (define-syntax test-approximate ;; FIXME - needed for non-Kawa + (lambda (x) + (syntax-case (list x (list 'quote (%test-source-line2 x))) () + (((mac tname expected expr error) line) + (syntax + (let* ((r (test-runner-get)) + (name tname)) + (test-result-alist! r (cons (cons 'test-name tname) line)) + (%test-comp2body r (%test-approximimate= error) expected expr)))) + (((mac expected expr error) line) + (syntax + (let* ((r (test-runner-get))) + (test-result-alist! r line) + (%test-comp2body r (%test-approximimate= error) expected expr)))))))) + (else + (define-syntax test-end + (syntax-rules () + ((test-end) + (%test-end #f '())) + ((test-end suite-name) + (%test-end suite-name '())))) + (define-syntax test-assert + (syntax-rules () + ((test-assert tname test-expression) + (let* ((r (test-runner-get)) + (name tname)) + (test-result-alist! r '((test-name . tname))) + (%test-comp1body r test-expression))) + ((test-assert test-expression) + (let* ((r (test-runner-get))) + (test-result-alist! r '()) + (%test-comp1body r test-expression))))) + (define-syntax %test-comp2 + (syntax-rules () + ((%test-comp2 comp tname expected expr) + (let* ((r (test-runner-get)) + (name tname)) + (test-result-alist! r (list (cons 'test-name tname))) + (%test-comp2body r comp expected expr))) + ((%test-comp2 comp expected expr) + (let* ((r (test-runner-get))) + (test-result-alist! r '()) + (%test-comp2body r comp expected expr))))) + (define-syntax test-equal + (syntax-rules () + ((test-equal . rest) + (%test-comp2 equal? . rest)))) + (define-syntax test-eqv + (syntax-rules () + ((test-eqv . rest) + (%test-comp2 eqv? . rest)))) + (define-syntax test-eq + (syntax-rules () + ((test-eq . rest) + (%test-comp2 eq? . rest)))) + (define-syntax test-approximate + (syntax-rules () + ((test-approximate tname expected expr error) + (%test-comp2 (%test-approximimate= error) tname expected expr)) + ((test-approximate expected expr error) + (%test-comp2 (%test-approximimate= error) expected expr)))))) + +(cond-expand + (guile + (define-syntax %test-error + (syntax-rules () + ((%test-error r etype expr) + (%test-comp1body r (catch #t (lambda () expr) (lambda (key . args) #t))))))) + (mzscheme + (define-syntax %test-error + (syntax-rules () + ((%test-error r etype expr) + (%test-comp1body r (with-handlers (((lambda (h) #t) (lambda (h) #t))) + (let () + (test-result-set! r 'actual-value expr) + #f))))))) + (chicken + (define-syntax %test-error + (syntax-rules () + ((%test-error r etype expr) + (%test-comp1body r (condition-case expr (ex () #t))))))) + (kawa + (define-syntax %test-error + (syntax-rules () + ((%test-error r etype expr) + (let () + (if (%test-on-test-begin r) + (let ((et etype)) + (test-result-set! r 'expected-error et) + (%test-on-test-end r + (try-catch + (let () + (test-result-set! r 'actual-value expr) + #f) + (ex + (test-result-set! r 'actual-error ex) + (cond ((and (instance? et ) + (gnu.bytecode.ClassType:isSubclass et )) + (instance? ex et)) + (else #t))))) + (%test-report-result)))))))) + ((and srfi-34 srfi-35) + (define-syntax %test-error + (syntax-rules () + ((%test-error r etype expr) + (%test-comp1body r (guard (ex ((condition-type? etype) + (and (condition? ex) (condition-has-type? ex etype))) + ((procedure? etype) + (etype ex)) + ((equal? type #t) + #t) + (else #t)) + expr)))))) + (srfi-34 + (define-syntax %test-error + (syntax-rules () + ((%test-error r etype expr) + (%test-comp1body r (guard (ex (else #t)) expr)))))) + (else + (define-syntax %test-error + (syntax-rules () + ((%test-error r etype expr) + (begin + ((test-runner-on-test-begin r) r) + (test-result-set! r 'result-kind 'skip) + (%test-report-result))))))) + +(cond-expand + ((or kawa mzscheme) + + (define-syntax test-error + (lambda (x) + (syntax-case (list x (list 'quote (%test-source-line2 x))) () + (((mac tname etype expr) line) + (syntax + (let* ((r (test-runner-get)) + (name tname)) + (test-result-alist! r (cons (cons 'test-name tname) line)) + (%test-error r etype expr)))) + (((mac etype expr) line) + (syntax + (let* ((r (test-runner-get))) + (test-result-alist! r line) + (%test-error r etype expr)))) + (((mac expr) line) + (syntax + (let* ((r (test-runner-get))) + (test-result-alist! r line) + (%test-error r #t expr)))))))) + (else + (define-syntax test-error + (syntax-rules () + ((test-error name etype expr) + (test-assert name (%test-error etype expr))) + ((test-error etype expr) + (test-assert (%test-error etype expr))) + ((test-error expr) + (test-assert (%test-error #t expr))))))) + +(define (test-apply first . rest) + (if (test-runner? first) + (test-with-runner first (apply test-apply rest)) + (let ((r (test-runner-current))) + (if r + (let ((run-list (%test-runner-run-list r))) + (cond ((null? rest) + (%test-runner-run-list! r (reverse! run-list)) + (first)) ;; actually apply procedure thunk + (else + (%test-runner-run-list! + r + (if (eq? run-list #t) (list first) (cons first run-list))) + (apply test-apply rest) + (%test-runner-run-list! r run-list)))) + (let ((r (test-runner-create))) + (test-with-runner r (apply test-apply first rest)) + ((test-runner-on-final r) r)))))) + +(define-syntax test-with-runner + (syntax-rules () + ((test-with-runner runner form ...) + (let ((saved-runner (test-runner-current))) + (dynamic-wind + (lambda () (test-runner-current runner)) + (lambda () form ...) + (lambda () (test-runner-current saved-runner))))))) + +;;; Predicates + +(define (%test-match-nth n count) + (let ((i 0)) + (lambda (runner) + (set! i (+ i 1)) + (and (>= i n) (< i (+ n count)))))) + +(define-syntax test-match-nth + (syntax-rules () + ((test-match-nth n) + (test-match-nth n 1)) + ((test-match-nth n count) + (%test-match-nth n count)))) + +(define (%test-match-all . pred-list) + (lambda (runner) + (let ((result #t)) + (let loop ((l pred-list)) + (if (null? l) + result + (begin + (if (not ((car l) runner)) + (set! result #f)) + (loop (cdr l)))))))) + +(define-syntax test-match-all + (syntax-rules () + ((test-match-all pred ...) + (%test-match-all (%test-as-specifier pred) ...)))) + +(define (%test-match-any . pred-list) + (lambda (runner) + (let ((result #f)) + (let loop ((l pred-list)) + (if (null? l) + result + (begin + (if ((car l) runner) + (set! result #t)) + (loop (cdr l)))))))) + +(define-syntax test-match-any + (syntax-rules () + ((test-match-any pred ...) + (%test-match-any (%test-as-specifier pred) ...)))) + +;; Coerce to a predicate function: +(define (%test-as-specifier specifier) + (cond ((procedure? specifier) specifier) + ((integer? specifier) (test-match-nth 1 specifier)) + ((string? specifier) (test-match-name specifier)) + (else + (error "not a valid test specifier")))) + +(define-syntax test-skip + (syntax-rules () + ((test-skip pred ...) + (let ((runner (test-runner-get))) + (%test-runner-skip-list! runner + (cons (test-match-all (%test-as-specifier pred) ...) + (%test-runner-skip-list runner))))))) + +(define-syntax test-expect-fail + (syntax-rules () + ((test-expect-fail pred ...) + (let ((runner (test-runner-get))) + (%test-runner-fail-list! runner + (cons (test-match-all (%test-as-specifier pred) ...) + (%test-runner-fail-list runner))))))) + +(define (test-match-name name) + (lambda (runner) + (equal? name (test-runner-test-name runner)))) + +(define (test-read-eval-string string) + (let* ((port (open-input-string string)) + (form (read port))) + (if (eof-object? (read-char port)) + (eval form) + (cond-expand + (srfi-23 (error "(not at eof)")) + (else "error"))))) + -- cgit From b316cb06d0c6aa7be9942e48c71324fb8d637de8 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 5 Nov 2010 22:32:35 -0700 Subject: More guile QA code --- gnuradio-core/src/guile/.gitignore | 1 + gnuradio-core/src/guile/Makefile.am | 2 + gnuradio-core/src/guile/qa_0000_basics.scm | 66 ++++++++++++++++++++++-------- gnuradio-core/src/guile/srfi/srfi-64.scm | 2 +- 4 files changed, 53 insertions(+), 18 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/.gitignore b/gnuradio-core/src/guile/.gitignore index 6a0410b79..c76800aac 100644 --- a/gnuradio-core/src/guile/.gitignore +++ b/gnuradio-core/src/guile/.gitignore @@ -1,3 +1,4 @@ /Makefile /Makefile.in /run_guile_tests +/qa_*.log diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index ef6ab0b7e..5a9721b64 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -36,3 +36,5 @@ nobase_guile_DATA = \ gnuradio/export-safely.scm \ gnuradio/runtime-shim.scm \ srfi/srfi-64.scm + +CLEANFILES = qa_*.log diff --git a/gnuradio-core/src/guile/qa_0000_basics.scm b/gnuradio-core/src/guile/qa_0000_basics.scm index 19bde0589..5d3a53d24 100644 --- a/gnuradio-core/src/guile/qa_0000_basics.scm +++ b/gnuradio-core/src/guile/qa_0000_basics.scm @@ -1,19 +1,17 @@ (use-modules (gnuradio core)) (use-modules (oop goops)) +;;(use-modules (ice-9 format)) +;;(use-modules (ice-9 pretty-print)) -(load-from-path "srfi/srfi-64") -(use-modules (ice-9 format)) -(use-modules (ice-9 pretty-print)) - -;; (write "Hello QA world!\n") +(load-from-path "srfi/srfi-64") ; unit test library (define (vector-map f v) (list->vector (map f (vector->list v)))) -(define (test-1) +(define (test-connect-1) (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) - (tb (gr:top-block-swig "my top block")) + (tb (gr:top-block-swig "QA top block")) (src (gr:vector-source-i src-data #f)) (op (gr:multiply-const-ii 2)) (dst (gr:vector-sink-i))) @@ -26,10 +24,10 @@ (let ((actual-result (gr:data dst))) (test-equal expected-result actual-result)))) -(define (test-2) +(define (test-connect-2) (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) - (tb (gr:top-block-swig "my top block")) + (tb (gr:top-block-swig "QA top block")) (src (gr:vector-source-i src-data #f)) (op (gr:multiply-const-ii 2)) (dst (gr:vector-sink-i))) @@ -42,10 +40,10 @@ (let ((actual-result (gr:data dst))) (test-equal expected-result actual-result)))) -(define (test-3) +(define (test-connect-3) (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) - (tb (gr:top-block-swig "my top block")) + (tb (gr:top-block-swig "QA top block")) (src (gr:vector-source-i src-data #f)) (op (gr:multiply-const-ii 2)) (dst (gr:vector-sink-i))) @@ -58,10 +56,10 @@ (let ((actual-result (gr:data dst))) (test-equal expected-result actual-result)))) -(define (test-4) +(define (test-connect-4) (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) - (tb (gr:top-block-swig "my top block")) + (tb (gr:top-block-swig "QA top block")) (src (gr:vector-source-i src-data #f)) (op (gr:multiply-const-ii 2)) (dst (gr:vector-sink-i))) @@ -73,10 +71,44 @@ (let ((actual-result (gr:data dst))) (test-equal expected-result actual-result)))) +(define (test-io-signature-1) + (let ((ios1 (gr:io-signature 1 2 8)) + (ios2 (gr:io-signature2 1 2 16 32)) + (ios3 (gr:io-signature3 1 -1 14 32 48)) + (iosv (gr:io-signaturev 1 4 '(1 2 3)))) + + (test-equal 1 (gr:min-streams ios1)) + (test-equal 2 (gr:max-streams ios1)) + (test-equal 8 (gr:sizeof-stream-item ios1 0)) + (test-equal 8 (gr:sizeof-stream-item ios1 1)) + + (test-equal 1 (gr:min-streams ios2)) + (test-equal 2 (gr:max-streams ios2)) + (test-equal 16 (gr:sizeof-stream-item ios2 0)) + (test-equal 32 (gr:sizeof-stream-item ios2 1)) + + (test-equal 1 (gr:min-streams ios3)) + (test-equal -1 (gr:max-streams ios3)) + (test-equal 14 (gr:sizeof-stream-item ios3 0)) + (test-equal 32 (gr:sizeof-stream-item ios3 1)) + (test-equal 48 (gr:sizeof-stream-item ios3 2)) + (test-equal '#(14 32 48) (gr:sizeof-stream-items ios3)) + + (test-equal 1 (gr:min-streams iosv)) + (test-equal 4 (gr:max-streams iosv)) + (test-equal 1 (gr:sizeof-stream-item iosv 0)) + (test-equal 2 (gr:sizeof-stream-item iosv 1)) + (test-equal 3 (gr:sizeof-stream-item iosv 2)) + (test-equal 3 (gr:sizeof-stream-item iosv 3)) + (test-equal '#(1 2 3) (gr:sizeof-stream-items iosv)) + )) + + (test-begin "qa_0000_basics") -(test-1) -(test-2) -(test-3) -(test-4) +(test-connect-1) +(test-connect-2) +(test-connect-3) +(test-connect-4) +(test-io-signature-1) (test-end "qa_0000_basics") diff --git a/gnuradio-core/src/guile/srfi/srfi-64.scm b/gnuradio-core/src/guile/srfi/srfi-64.scm index 25833b3f7..4ad9ccbab 100644 --- a/gnuradio-core/src/guile/srfi/srfi-64.scm +++ b/gnuradio-core/src/guile/srfi/srfi-64.scm @@ -189,7 +189,7 @@ ;; Not part of the specification. FIXME ;; Controls whether a log file is generated. -(define test-log-to-file #f) +(define test-log-to-file #t) (define (test-runner-simple) (let ((runner (%test-runner-alloc))) -- cgit From aa86e6975ee71a3e654cb87dd5a6bae5b06b8d16 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 5 Nov 2010 23:13:22 -0700 Subject: Add QA stub files for all gnuradio-core constructors --- gnuradio-core/src/guile/qa_0010_ctor_filter.scm | 92 +++++++++++++++ gnuradio-core/src/guile/qa_0010_ctor_general.scm | 143 +++++++++++++++++++++++ gnuradio-core/src/guile/qa_0010_ctor_gengen.scm | 129 ++++++++++++++++++++ gnuradio-core/src/guile/qa_0010_ctor_hier.scm | 27 +++++ gnuradio-core/src/guile/qa_0010_ctor_io.scm | 39 +++++++ gnuradio-core/src/guile/qa_0010_ctor_runtime.scm | 28 +++++ 6 files changed, 458 insertions(+) create mode 100644 gnuradio-core/src/guile/qa_0010_ctor_filter.scm create mode 100644 gnuradio-core/src/guile/qa_0010_ctor_general.scm create mode 100644 gnuradio-core/src/guile/qa_0010_ctor_gengen.scm create mode 100644 gnuradio-core/src/guile/qa_0010_ctor_hier.scm create mode 100644 gnuradio-core/src/guile/qa_0010_ctor_io.scm create mode 100644 gnuradio-core/src/guile/qa_0010_ctor_runtime.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/qa_0010_ctor_filter.scm b/gnuradio-core/src/guile/qa_0010_ctor_filter.scm new file mode 100644 index 000000000..0dd539a8e --- /dev/null +++ b/gnuradio-core/src/guile/qa_0010_ctor_filter.scm @@ -0,0 +1,92 @@ +;;; +;;; 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 . +;;; + +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +(load-from-path "srfi/srfi-64") ; unit test library + +;;; Add test code for all constructors in these files +;;; +;;; ./filter/gr_adaptive_fir_ccf.h +;;; ./filter/gr_cma_equalizer_cc.h +;;; ./filter/gr_fft_filter_ccc.h +;;; ./filter/gr_fft_filter_fff.h +;;; ./filter/gr_filter_delay_fc.h +;;; ./filter/gr_fir_ccc_generic.h +;;; ./filter/gr_fir_ccc_simd.h +;;; ./filter/gr_fir_ccc_x86.h +;;; ./filter/gr_fir_ccf_generic.h +;;; ./filter/gr_fir_ccf_simd.h +;;; ./filter/gr_fir_ccf_x86.h +;;; ./filter/gr_fir_fcc_generic.h +;;; ./filter/gr_fir_fcc_simd.h +;;; ./filter/gr_fir_fcc_x86.h +;;; ./filter/gr_fir_fff_altivec.h +;;; ./filter/gr_fir_fff_armv7_a.h +;;; ./filter/gr_fir_fff_generic.h +;;; ./filter/gr_fir_fff_simd.h +;;; ./filter/gr_fir_fff_x86.h +;;; ./filter/gr_fir_filter_ccc.h +;;; ./filter/gr_fir_filter_ccf.h +;;; ./filter/gr_fir_filter_fcc.h +;;; ./filter/gr_fir_filter_fff.h +;;; ./filter/gr_fir_filter_fsf.h +;;; ./filter/gr_fir_filter_scc.h +;;; ./filter/gr_fir_fsf_generic.h +;;; ./filter/gr_fir_fsf_simd.h +;;; ./filter/gr_fir_fsf_x86.h +;;; ./filter/gr_fir_scc_generic.h +;;; ./filter/gr_fir_scc_simd.h +;;; ./filter/gr_fir_scc_x86.h +;;; ./filter/gr_fir_sysconfig_armv7_a.h +;;; ./filter/gr_fir_sysconfig_generic.h +;;; ./filter/gr_fir_sysconfig_powerpc.h +;;; ./filter/gr_fir_sysconfig_x86.h +;;; ./filter/gr_fractional_interpolator_cc.h +;;; ./filter/gr_fractional_interpolator_ff.h +;;; ./filter/gr_freq_xlating_fir_filter_ccc.h +;;; ./filter/gr_freq_xlating_fir_filter_ccf.h +;;; ./filter/gr_freq_xlating_fir_filter_fcc.h +;;; ./filter/gr_freq_xlating_fir_filter_fcf.h +;;; ./filter/gr_freq_xlating_fir_filter_scc.h +;;; ./filter/gr_freq_xlating_fir_filter_scf.h +;;; ./filter/gr_goertzel_fc.h +;;; ./filter/gr_hilbert_fc.h +;;; ./filter/gr_iir_filter_ffd.h +;;; ./filter/gr_interp_fir_filter_ccc.h +;;; ./filter/gr_interp_fir_filter_ccf.h +;;; ./filter/gr_interp_fir_filter_fcc.h +;;; ./filter/gr_interp_fir_filter_fff.h +;;; ./filter/gr_interp_fir_filter_fsf.h +;;; ./filter/gr_interp_fir_filter_scc.h +;;; ./filter/gr_pfb_arb_resampler_ccf.h +;;; ./filter/gr_pfb_channelizer_ccf.h +;;; ./filter/gr_pfb_clock_sync_ccf.h +;;; ./filter/gr_pfb_clock_sync_fff.h +;;; ./filter/gr_pfb_decimator_ccf.h +;;; ./filter/gr_pfb_interpolator_ccf.h +;;; ./filter/gr_rational_resampler_base_ccc.h +;;; ./filter/gr_rational_resampler_base_ccf.h +;;; ./filter/gr_rational_resampler_base_fcc.h +;;; ./filter/gr_rational_resampler_base_fff.h +;;; ./filter/gr_rational_resampler_base_fsf.h +;;; ./filter/gr_rational_resampler_base_scc.h +;;; ./filter/gr_single_pole_iir_filter_cc.h +;;; ./filter/gr_single_pole_iir_filter_ff.h diff --git a/gnuradio-core/src/guile/qa_0010_ctor_general.scm b/gnuradio-core/src/guile/qa_0010_ctor_general.scm new file mode 100644 index 000000000..1531a59de --- /dev/null +++ b/gnuradio-core/src/guile/qa_0010_ctor_general.scm @@ -0,0 +1,143 @@ +;;; +;;; 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 . +;;; + +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +(load-from-path "srfi/srfi-64") ; unit test library + +;;; Add test code for all constructors in these files +;;; +;;; ./general/gr_additive_scrambler_bb.h +;;; ./general/gr_agc2_cc.h +;;; ./general/gr_agc2_ff.h +;;; ./general/gr_agc_cc.h +;;; ./general/gr_agc_ff.h +;;; ./general/gr_align_on_samplenumbers_ss.h +;;; ./general/gr_bin_statistics_f.h +;;; ./general/gr_binary_slicer_fb.h +;;; ./general/gr_bytes_to_syms.h +;;; ./general/gr_char_to_float.h +;;; ./general/gr_check_counting_s.h +;;; ./general/gr_check_lfsr_32k_s.h +;;; ./general/gr_clock_recovery_mm_cc.h +;;; ./general/gr_clock_recovery_mm_ff.h +;;; ./general/gr_complex_to_interleaved_short.h +;;; ./general/gr_complex_to_xxx.h +;;; ./general/gr_conjugate_cc.h +;;; ./general/gr_constellation_decoder_cb.h +;;; ./general/gr_copy.h +;;; ./general/gr_correlate_access_code_bb.h +;;; ./general/gr_costas_loop_cc.h +;;; ./general/gr_cpfsk_bc.h +;;; ./general/gr_ctcss_squelch_ff.h +;;; ./general/gr_decode_ccsds_27_fb.h +;;; ./general/gr_deinterleave.h +;;; ./general/gr_delay.h +;;; ./general/gr_descrambler_bb.h +;;; ./general/gr_diff_decoder_bb.h +;;; ./general/gr_diff_encoder_bb.h +;;; ./general/gr_diff_phasor_cc.h +;;; ./general/gr_dpll_bb.h +;;; ./general/gr_encode_ccsds_27_bb.h +;;; ./general/gr_fake_channel_coder_pp.h +;;; ./general/gr_feedforward_agc_cc.h +;;; ./general/gr_fft_vcc.h +;;; ./general/gr_fft_vcc_fftw.h +;;; ./general/gr_fft_vfc.h +;;; ./general/gr_fll_band_edge_cc.h +;;; ./general/gr_float_to_char.h +;;; ./general/gr_float_to_complex.h +;;; ./general/gr_float_to_short.h +;;; ./general/gr_float_to_uchar.h +;;; ./general/gr_fmdet_cf.h +;;; ./general/gr_framer_sink_1.h +;;; ./general/gr_frequency_modulator_fc.h +;;; ./general/gr_glfsr_source_b.h +;;; ./general/gr_glfsr_source_f.h +;;; ./general/gr_head.h +;;; ./general/gr_interleave.h +;;; ./general/gr_interleaved_short_to_complex.h +;;; ./general/gr_iqcomp_cc.h +;;; ./general/gr_keep_one_in_n.h +;;; ./general/gr_kludge_copy.h +;;; ./general/gr_lfsr_32k_source_s.h +;;; ./general/gr_lms_dfe_cc.h +;;; ./general/gr_lms_dfe_ff.h +;;; ./general/gr_map_bb.h +;;; ./general/gr_mpsk_receiver_cc.h +;;; ./general/gr_nlog10_ff.h +;;; ./general/gr_nop.h +;;; ./general/gr_null_sink.h +;;; ./general/gr_null_source.h +;;; ./general/gr_ofdm_bpsk_demapper.h +;;; ./general/gr_ofdm_cyclic_prefixer.h +;;; ./general/gr_ofdm_demapper_vcb.h +;;; ./general/gr_ofdm_frame_acquisition.h +;;; ./general/gr_ofdm_frame_sink.h +;;; ./general/gr_ofdm_insert_preamble.h +;;; ./general/gr_ofdm_mapper_bcv.h +;;; ./general/gr_ofdm_sampler.h +;;; ./general/gr_pa_2x2_phase_combiner.h +;;; ./general/gr_packet_sink.h +;;; ./general/gr_peak_detector2_fb.h +;;; ./general/gr_phase_modulator_fc.h +;;; ./general/gr_pll_carriertracking_cc.h +;;; ./general/gr_pll_freqdet_cf.h +;;; ./general/gr_pll_refout_cc.h +;;; ./general/gr_pn_correlator_cc.h +;;; ./general/gr_probe_avg_mag_sqrd_c.h +;;; ./general/gr_probe_avg_mag_sqrd_cf.h +;;; ./general/gr_probe_avg_mag_sqrd_f.h +;;; ./general/gr_probe_density_b.h +;;; ./general/gr_probe_mpsk_snr_c.h +;;; ./general/gr_probe_signal_f.h +;;; ./general/gr_pwr_squelch_cc.h +;;; ./general/gr_pwr_squelch_ff.h +;;; ./general/gr_quadrature_demod_cf.h +;;; ./general/gr_rail_ff.h +;;; ./general/gr_regenerate_bb.h +;;; ./general/gr_repeat.h +;;; ./general/gr_rms_cf.h +;;; ./general/gr_rms_ff.h +;;; ./general/gr_scrambler_bb.h +;;; ./general/gr_short_to_float.h +;;; ./general/gr_simple_correlator.h +;;; ./general/gr_simple_framer.h +;;; ./general/gr_simple_squelch_cc.h +;;; ./general/gr_skiphead.h +;;; ./general/gr_squash_ff.h +;;; ./general/gr_squelch_base_cc.h +;;; ./general/gr_squelch_base_ff.h +;;; ./general/gr_stream_mux.h +;;; ./general/gr_stream_to_streams.h +;;; ./general/gr_stream_to_vector.h +;;; ./general/gr_streams_to_stream.h +;;; ./general/gr_streams_to_vector.h +;;; ./general/gr_stretch_ff.h +;;; ./general/gr_test.h +;;; ./general/gr_threshold_ff.h +;;; ./general/gr_throttle.h +;;; ./general/gr_uchar_to_float.h +;;; ./general/gr_unpack_k_bits_bb.h +;;; ./general/gr_vco_f.h +;;; ./general/gr_vector_to_stream.h +;;; ./general/gr_vector_to_streams.h +;;; ./general/gr_wavelet_ff.h +;;; ./general/gr_wvps_ff.h diff --git a/gnuradio-core/src/guile/qa_0010_ctor_gengen.scm b/gnuradio-core/src/guile/qa_0010_ctor_gengen.scm new file mode 100644 index 000000000..8e9c509e8 --- /dev/null +++ b/gnuradio-core/src/guile/qa_0010_ctor_gengen.scm @@ -0,0 +1,129 @@ +;;; +;;; 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 . +;;; + +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +(load-from-path "srfi/srfi-64") ; unit test library + +;;; Add test code for all constructors in these files +;;; +;;; ./gengen/gr_add_cc.h +;;; ./gengen/gr_add_const_cc.h +;;; ./gengen/gr_add_const_ff.h +;;; ./gengen/gr_add_const_ii.h +;;; ./gengen/gr_add_const_sf.h +;;; ./gengen/gr_add_const_ss.h +;;; ./gengen/gr_add_const_vcc.h +;;; ./gengen/gr_add_const_vff.h +;;; ./gengen/gr_add_const_vii.h +;;; ./gengen/gr_add_const_vss.h +;;; ./gengen/gr_add_ff.h +;;; ./gengen/gr_add_ii.h +;;; ./gengen/gr_add_ss.h +;;; ./gengen/gr_and_bb.h +;;; ./gengen/gr_and_const_bb.h +;;; ./gengen/gr_and_const_ii.h +;;; ./gengen/gr_and_const_ss.h +;;; ./gengen/gr_and_ii.h +;;; ./gengen/gr_and_ss.h +;;; ./gengen/gr_argmax_fs.h +;;; ./gengen/gr_argmax_is.h +;;; ./gengen/gr_argmax_ss.h +;;; ./gengen/gr_chunks_to_symbols_bc.h +;;; ./gengen/gr_chunks_to_symbols_bf.h +;;; ./gengen/gr_chunks_to_symbols_ic.h +;;; ./gengen/gr_chunks_to_symbols_if.h +;;; ./gengen/gr_chunks_to_symbols_sc.h +;;; ./gengen/gr_chunks_to_symbols_sf.h +;;; ./gengen/gr_divide_cc.h +;;; ./gengen/gr_divide_ff.h +;;; ./gengen/gr_divide_ii.h +;;; ./gengen/gr_divide_ss.h +;;; ./gengen/gr_integrate_cc.h +;;; ./gengen/gr_integrate_ff.h +;;; ./gengen/gr_integrate_ii.h +;;; ./gengen/gr_integrate_ss.h +;;; ./gengen/gr_max_ff.h +;;; ./gengen/gr_max_ii.h +;;; ./gengen/gr_max_ss.h +;;; ./gengen/gr_moving_average_cc.h +;;; ./gengen/gr_moving_average_ff.h +;;; ./gengen/gr_moving_average_ii.h +;;; ./gengen/gr_moving_average_ss.h +;;; ./gengen/gr_multiply_cc.h +;;; ./gengen/gr_multiply_const_cc.h +;;; ./gengen/gr_multiply_const_ff.h +;;; ./gengen/gr_multiply_const_ii.h +;;; ./gengen/gr_multiply_const_ss.h +;;; ./gengen/gr_multiply_const_vcc.h +;;; ./gengen/gr_multiply_const_vff.h +;;; ./gengen/gr_multiply_const_vii.h +;;; ./gengen/gr_multiply_const_vss.h +;;; ./gengen/gr_multiply_ff.h +;;; ./gengen/gr_multiply_ii.h +;;; ./gengen/gr_multiply_ss.h +;;; ./gengen/gr_mute_cc.h +;;; ./gengen/gr_mute_ff.h +;;; ./gengen/gr_mute_ii.h +;;; ./gengen/gr_mute_ss.h +;;; ./gengen/gr_noise_source_c.h +;;; ./gengen/gr_noise_source_f.h +;;; ./gengen/gr_noise_source_i.h +;;; ./gengen/gr_noise_source_s.h +;;; ./gengen/gr_not_bb.h +;;; ./gengen/gr_not_ii.h +;;; ./gengen/gr_not_ss.h +;;; ./gengen/gr_or_bb.h +;;; ./gengen/gr_or_ii.h +;;; ./gengen/gr_or_ss.h +;;; ./gengen/gr_packed_to_unpacked_bb.h +;;; ./gengen/gr_packed_to_unpacked_ii.h +;;; ./gengen/gr_packed_to_unpacked_ss.h +;;; ./gengen/gr_peak_detector_fb.h +;;; ./gengen/gr_peak_detector_ib.h +;;; ./gengen/gr_peak_detector_sb.h +;;; ./gengen/gr_sample_and_hold_bb.h +;;; ./gengen/gr_sample_and_hold_ff.h +;;; ./gengen/gr_sample_and_hold_ii.h +;;; ./gengen/gr_sample_and_hold_ss.h +;;; ./gengen/gr_sig_source_c.h +;;; ./gengen/gr_sig_source_f.h +;;; ./gengen/gr_sig_source_i.h +;;; ./gengen/gr_sig_source_s.h +;;; ./gengen/gr_sub_cc.h +;;; ./gengen/gr_sub_ff.h +;;; ./gengen/gr_sub_ii.h +;;; ./gengen/gr_sub_ss.h +;;; ./gengen/gr_unpacked_to_packed_bb.h +;;; ./gengen/gr_unpacked_to_packed_ii.h +;;; ./gengen/gr_unpacked_to_packed_ss.h +;;; ./gengen/gr_vector_sink_b.h +;;; ./gengen/gr_vector_sink_c.h +;;; ./gengen/gr_vector_sink_f.h +;;; ./gengen/gr_vector_sink_i.h +;;; ./gengen/gr_vector_sink_s.h +;;; ./gengen/gr_vector_source_b.h +;;; ./gengen/gr_vector_source_c.h +;;; ./gengen/gr_vector_source_f.h +;;; ./gengen/gr_vector_source_i.h +;;; ./gengen/gr_vector_source_s.h +;;; ./gengen/gr_xor_bb.h +;;; ./gengen/gr_xor_ii.h +;;; ./gengen/gr_xor_ss.h diff --git a/gnuradio-core/src/guile/qa_0010_ctor_hier.scm b/gnuradio-core/src/guile/qa_0010_ctor_hier.scm new file mode 100644 index 000000000..14d3f4119 --- /dev/null +++ b/gnuradio-core/src/guile/qa_0010_ctor_hier.scm @@ -0,0 +1,27 @@ +;;; +;;; 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 . +;;; + +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +(load-from-path "srfi/srfi-64") ; unit test library + +;;; Add test code for all constructors in these files +;;; +;;; ./hier/gr_channel_model.h diff --git a/gnuradio-core/src/guile/qa_0010_ctor_io.scm b/gnuradio-core/src/guile/qa_0010_ctor_io.scm new file mode 100644 index 000000000..95f231091 --- /dev/null +++ b/gnuradio-core/src/guile/qa_0010_ctor_io.scm @@ -0,0 +1,39 @@ +;;; +;;; 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 . +;;; + +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +(load-from-path "srfi/srfi-64") ; unit test library + +;;; Add test code for all constructors in these files +;;; +;;; ./io/gr_file_descriptor_sink.h +;;; ./io/gr_file_descriptor_source.h +;;; ./io/gr_file_sink.h +;;; ./io/gr_file_source.h +;;; ./io/gr_histo_sink_f.h +;;; ./io/gr_message_sink.h +;;; ./io/gr_message_source.h +;;; ./io/gr_oscope_sink_f.h +;;; ./io/gr_oscope_sink_x.h +;;; ./io/gr_udp_sink.h +;;; ./io/gr_udp_source.h +;;; ./io/gr_wavfile_sink.h +;;; ./io/gr_wavfile_source.h diff --git a/gnuradio-core/src/guile/qa_0010_ctor_runtime.scm b/gnuradio-core/src/guile/qa_0010_ctor_runtime.scm new file mode 100644 index 000000000..339601bf1 --- /dev/null +++ b/gnuradio-core/src/guile/qa_0010_ctor_runtime.scm @@ -0,0 +1,28 @@ +;;; +;;; 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 . +;;; + +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +(load-from-path "srfi/srfi-64") ; unit test library + +;;; Add test code for all constructors in these files +;;; +;;; ./runtime/gr_hier_block2.h +;;; ./runtime/gr_msg_queue.h -- cgit From f07057eb3a78378799baec89e4f97916ea5e5ba9 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 5 Nov 2010 23:14:09 -0700 Subject: Add copyright and license header --- gnuradio-core/src/guile/qa_0000_basics.scm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/qa_0000_basics.scm b/gnuradio-core/src/guile/qa_0000_basics.scm index 5d3a53d24..aa4dc37ff 100644 --- a/gnuradio-core/src/guile/qa_0000_basics.scm +++ b/gnuradio-core/src/guile/qa_0000_basics.scm @@ -1,3 +1,22 @@ +;;; +;;; 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 . +;;; + (use-modules (gnuradio core)) (use-modules (oop goops)) ;;(use-modules (ice-9 format)) -- cgit From 45a88c35386e7ea0d93651cd528bc7c1261d3197 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 5 Nov 2010 23:25:54 -0700 Subject: Add qa_*.scm files to Makefile as noinst_DATA --- gnuradio-core/src/guile/Makefile.am | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index 5a9721b64..4db679cff 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -21,7 +21,8 @@ include $(top_srcdir)/Makefile.common TESTS = run_guile_tests -EXTRA_DIST = run_guile_tests.in +EXTRA_DIST = \ + run_guile_tests.in # These are the hand-code guile files for gnuradio-core. # @@ -37,4 +38,14 @@ nobase_guile_DATA = \ gnuradio/runtime-shim.scm \ srfi/srfi-64.scm +noinst_DATA = \ + qa_0000_basics.scm \ + qa_0010_ctor_filter.scm \ + qa_0010_ctor_general.scm \ + qa_0010_ctor_gengen.scm \ + qa_0010_ctor_hier.scm \ + qa_0010_ctor_io.scm \ + qa_0010_ctor_runtime.scm + + CLEANFILES = qa_*.log -- cgit From 2f865632e7208dc748fe7f2b8003297730fc133d Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 6 Nov 2010 00:38:20 -0700 Subject: Refactor guile QA code to use test-group. --- gnuradio-core/src/guile/qa_0000_basics.scm | 41 ++++++++++++++---------------- 1 file changed, 19 insertions(+), 22 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/qa_0000_basics.scm b/gnuradio-core/src/guile/qa_0000_basics.scm index aa4dc37ff..423a49478 100644 --- a/gnuradio-core/src/guile/qa_0000_basics.scm +++ b/gnuradio-core/src/guile/qa_0000_basics.scm @@ -27,8 +27,12 @@ (define (vector-map f v) (list->vector (map f (vector->list v)))) -(define (test-connect-1) - (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + +;; Must precede all tests +(test-begin "qa_0000_basics") + +(test-group "test-connect-1" + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) (tb (gr:top-block-swig "QA top block")) (src (gr:vector-source-i src-data #f)) @@ -40,10 +44,10 @@ (gr:connect tb (gr:ep op 0) (gr:ep dst 0)) (gr:run tb) - (let ((actual-result (gr:data dst))) - (test-equal expected-result actual-result)))) + (test-equal expected-result (gr:data dst)))) + -(define (test-connect-2) +(test-group "test-connect-2" (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) (tb (gr:top-block-swig "QA top block")) @@ -56,10 +60,10 @@ (gr:connect tb op dst) (gr:run tb) - (let ((actual-result (gr:data dst))) - (test-equal expected-result actual-result)))) + (test-equal expected-result (gr:data dst)))) + -(define (test-connect-3) +(test-group "test-connect-3" (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) (tb (gr:top-block-swig "QA top block")) @@ -72,10 +76,10 @@ (gr:connect tb `(,op 0) `(,dst 0)) (gr:run tb) - (let ((actual-result (gr:data dst))) - (test-equal expected-result actual-result)))) + (test-equal expected-result (gr:data dst)))) -(define (test-connect-4) + +(test-group "test-connect-4" (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) (tb (gr:top-block-swig "QA top block")) @@ -87,10 +91,10 @@ (gr:connect tb src op dst) (gr:run tb) - (let ((actual-result (gr:data dst))) - (test-equal expected-result actual-result)))) + (test-equal expected-result (gr:data dst)))) + -(define (test-io-signature-1) +(test-group "test-io-signature-1" (let ((ios1 (gr:io-signature 1 2 8)) (ios2 (gr:io-signature2 1 2 16 32)) (ios3 (gr:io-signature3 1 -1 14 32 48)) @@ -122,12 +126,5 @@ (test-equal '#(1 2 3) (gr:sizeof-stream-items iosv)) )) - - -(test-begin "qa_0000_basics") -(test-connect-1) -(test-connect-2) -(test-connect-3) -(test-connect-4) -(test-io-signature-1) +;; Must follow all tests (test-end "qa_0000_basics") -- cgit From 5a908ea900ac5f5f418eef71a7647ae540755df7 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 7 Nov 2010 13:33:16 -0800 Subject: fix syntax problem in test-assert --- gnuradio-core/src/guile/srfi/srfi-64.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/srfi/srfi-64.scm b/gnuradio-core/src/guile/srfi/srfi-64.scm index 4ad9ccbab..8d61b14a8 100644 --- a/gnuradio-core/src/guile/srfi/srfi-64.scm +++ b/gnuradio-core/src/guile/srfi/srfi-64.scm @@ -850,11 +850,11 @@ (define-syntax test-error (syntax-rules () ((test-error name etype expr) - (test-assert name (%test-error etype expr))) + (test-assert name (%test-error (test-runner-get) etype expr))) ((test-error etype expr) - (test-assert (%test-error etype expr))) + (test-assert (%test-error (test-runner-get) etype expr))) ((test-error expr) - (test-assert (%test-error #t expr))))))) + (test-assert (%test-error (test-runner-get) #t expr))))))) (define (test-apply first . rest) (if (test-runner? first) -- cgit From d3ef5a72bacedfc04bd22448e75be2daf23dd677 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 7 Nov 2010 13:37:05 -0800 Subject: Import guile's own testing framework --- gnuradio-core/src/guile/test-suite/guile-test | 241 +++++++++++ gnuradio-core/src/guile/test-suite/lib.scm | 559 ++++++++++++++++++++++++++ 2 files changed, 800 insertions(+) create mode 100755 gnuradio-core/src/guile/test-suite/guile-test create mode 100644 gnuradio-core/src/guile/test-suite/lib.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/test-suite/guile-test b/gnuradio-core/src/guile/test-suite/guile-test new file mode 100755 index 000000000..1e1c70a77 --- /dev/null +++ b/gnuradio-core/src/guile/test-suite/guile-test @@ -0,0 +1,241 @@ +#!../libguile/guile \ +-e main -s +!# + +;;;; guile-test --- run the Guile test suite +;;;; Jim Blandy --- May 1999 +;;;; +;;;; Copyright (C) 1999, 2001, 2006 Free Software Foundation, Inc. +;;;; +;;;; This program 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 2, or (at your option) +;;;; any later version. +;;;; +;;;; This program 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 software; see the file COPYING. If not, write to +;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;;;; Boston, MA 02110-1301 USA + + +;;;; Usage: [guile -e main -s] guile-test [OPTIONS] [TEST ...] +;;;; +;;;; Run tests from the Guile test suite. Report failures and +;;;; unexpected passes to the standard output, along with a summary of +;;;; all the results. Record each reported test outcome in the log +;;;; file, `guile.log'. The exit status is #f if any of the tests +;;;; fail or pass unexpectedly. +;;;; +;;;; Normally, guile-test scans the test directory, and executes all +;;;; files whose names end in `.test'. (It assumes they contain +;;;; Scheme code.) However, you can have it execute specific tests by +;;;; listing their filenames on the command line. +;;;; +;;;; The option `--test-suite' can be given to specify the test +;;;; directory. If no such option is given, the test directory is +;;;; taken from the environment variable TEST_SUITE_DIR (if defined), +;;;; otherwise a default directory that is hardcoded in this file is +;;;; used (see "Installation" below). +;;;; +;;;; If present, the `--log-file LOG' option tells `guile-test' to put +;;;; the log output in a file named LOG. +;;;; +;;;; If present, the `--debug' option will enable a debugging mode. +;;;; +;;;; If present, the `--flag-unresolved' option will cause guile-test +;;;; to exit with failure status if any tests are UNRESOLVED. +;;;; +;;;; +;;;; Installation: +;;;; +;;;; If you change the #! line at the top of this script to point at +;;;; the Guile interpreter you want to test, you can call this script +;;;; as an executable instead of having to pass it as a parameter to +;;;; guile via "guile -e main -s guile-test". Further, you can edit +;;;; the definition of default-test-suite to point to the parent +;;;; directory of the `tests' tree, which makes it unnecessary to set +;;;; the environment variable `TEST_SUITE_DIR'. +;;;; +;;;; +;;;; Shortcomings: +;;;; +;;;; At the moment, due to a simple-minded implementation, test files +;;;; must live in the test directory, and you must specify their names +;;;; relative to the top of the test directory. If you want to send +;;;; me a patch that fixes this, but still leaves sane test names in +;;;; the log file, that would be great. At the moment, all the tests +;;;; I care about are in the test directory, though. +;;;; +;;;; It would be nice if you could specify the Guile interpreter you +;;;; want to test on the command line. As it stands, if you want to +;;;; change which Guile interpreter you're testing, you need to edit +;;;; the #! line at the top of this file, which is stupid. + +(define (main . args) + (let ((module (resolve-module '(test-suite guile-test)))) + (apply (module-ref module 'main) args))) + +(define-module (test-suite guile-test) + :use-module (test-suite lib) + :use-module (ice-9 getopt-long) + :use-module (ice-9 and-let-star) + :use-module (ice-9 rdelim) + :export (main data-file-name test-file-name)) + + +;;; User configurable settings: +(define default-test-suite + (string-append (getenv "HOME") "/bogus-path/test-suite")) + + +;;; Variables that will receive their actual values later. +(define test-suite default-test-suite) + +(define tmp-dir #f) + + +;;; General utilities, that probably should be in a library somewhere. + +;;; Enable debugging +(define (enable-debug-mode) + (write-line %load-path) + (set! %load-verbosely #t) + (debug-enable 'backtrace 'debug)) + +;;; Traverse the directory tree at ROOT, applying F to the name of +;;; each file in the tree, including ROOT itself. For a subdirectory +;;; SUB, if (F SUB) is true, we recurse into SUB. Do not follow +;;; symlinks. +(define (for-each-file f root) + + ;; A "hard directory" is a path that denotes a directory and is not a + ;; symlink. + (define (file-is-hard-directory? filename) + (eq? (stat:type (lstat filename)) 'directory)) + + (let visit ((root root)) + (let ((should-recur (f root))) + (if (and should-recur (file-is-hard-directory? root)) + (let ((dir (opendir root))) + (let loop () + (let ((entry (readdir dir))) + (cond + ((eof-object? entry) #f) + ((or (string=? entry ".") + (string=? entry "..") + (string=? entry "CVS") + (string=? entry "RCS")) + (loop)) + (else + (visit (string-append root "/" entry)) + (loop)))))))))) + + +;;; The test driver. + + +;;; Localizing test files and temporary data files. + +(define (data-file-name filename) + (in-vicinity tmp-dir filename)) + +(define (test-file-name test) + (in-vicinity test-suite test)) + +;;; Return a list of all the test files in the test tree. +(define (enumerate-tests test-dir) + (let ((root-len (+ 1 (string-length test-dir))) + (tests '())) + (for-each-file (lambda (file) + (if (has-suffix? file ".test") + (let ((short-name + (substring file root-len))) + (set! tests (cons short-name tests)))) + #t) + test-dir) + + ;; for-each-file presents the files in whatever order it finds + ;; them in the directory. We sort them here, so they'll always + ;; appear in the same order. This makes it easier to compare test + ;; log files mechanically. + (sort tests string. +;;; + +(use-modules (gnuradio core)) +(use-modules (oop goops)) +;;(use-modules (ice-9 format)) +;;(use-modules (ice-9 pretty-print)) + +(load-from-path "srfi/srfi-64") ; unit test library + +(define (vector-map f v) + (list->vector (map f (vector->list v)))) + + +;; Must precede all tests +(test-begin "qa_0000_basics") + +(test-group "test-connect-1" + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + (expected-result (vector-map (lambda (x) (* x 2)) src-data)) + (tb (gr:top-block-swig "QA top block")) + (src (gr:vector-source-i src-data #f)) + (op (gr:multiply-const-ii 2)) + (dst (gr:vector-sink-i))) + + ;; using gr:ep to create endpoints + (gr:connect tb (gr:ep src 0) (gr:ep op 0)) + (gr:connect tb (gr:ep op 0) (gr:ep dst 0)) + + (gr:run tb) + (test-equal expected-result (gr:data dst)))) + + +(test-group "test-connect-2" + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + (expected-result (vector-map (lambda (x) (* x 2)) src-data)) + (tb (gr:top-block-swig "QA top block")) + (src (gr:vector-source-i src-data #f)) + (op (gr:multiply-const-ii 2)) + (dst (gr:vector-sink-i))) + + ;; using just blocks + (gr:connect tb src op) + (gr:connect tb op dst) + + (gr:run tb) + (test-equal expected-result (gr:data dst)))) + + +(test-group "test-connect-3" + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + (expected-result (vector-map (lambda (x) (* x 2)) src-data)) + (tb (gr:top-block-swig "QA top block")) + (src (gr:vector-source-i src-data #f)) + (op (gr:multiply-const-ii 2)) + (dst (gr:vector-sink-i))) + + ;; using lists to represent endpoints + (gr:connect tb `(,src 0) `(,op 0)) + (gr:connect tb `(,op 0) `(,dst 0)) + + (gr:run tb) + (test-equal expected-result (gr:data dst)))) + + +(test-group "test-connect-4" + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + (expected-result (vector-map (lambda (x) (* x 2)) src-data)) + (tb (gr:top-block-swig "QA top block")) + (src (gr:vector-source-i src-data #f)) + (op (gr:multiply-const-ii 2)) + (dst (gr:vector-sink-i))) + + ;; using multiple endpoints + (gr:connect tb src op dst) + + (gr:run tb) + (test-equal expected-result (gr:data dst)))) + + +(test-group "test-io-signature-1" + (let ((ios1 (gr:io-signature 1 2 8)) + (ios2 (gr:io-signature2 1 2 16 32)) + (ios3 (gr:io-signature3 1 -1 14 32 48)) + (iosv (gr:io-signaturev 1 4 '(1 2 3)))) + + (test-equal 1 (gr:min-streams ios1)) + (test-equal 2 (gr:max-streams ios1)) + (test-equal 8 (gr:sizeof-stream-item ios1 0)) + (test-equal 8 (gr:sizeof-stream-item ios1 1)) + + (test-equal 1 (gr:min-streams ios2)) + (test-equal 2 (gr:max-streams ios2)) + (test-equal 16 (gr:sizeof-stream-item ios2 0)) + (test-equal 32 (gr:sizeof-stream-item ios2 1)) + + (test-equal 1 (gr:min-streams ios3)) + (test-equal -1 (gr:max-streams ios3)) + (test-equal 14 (gr:sizeof-stream-item ios3 0)) + (test-equal 32 (gr:sizeof-stream-item ios3 1)) + (test-equal 48 (gr:sizeof-stream-item ios3 2)) + (test-equal '#(14 32 48) (gr:sizeof-stream-items ios3)) + + (test-equal 1 (gr:min-streams iosv)) + (test-equal 4 (gr:max-streams iosv)) + (test-equal 1 (gr:sizeof-stream-item iosv 0)) + (test-equal 2 (gr:sizeof-stream-item iosv 1)) + (test-equal 3 (gr:sizeof-stream-item iosv 2)) + (test-equal 3 (gr:sizeof-stream-item iosv 3)) + (test-equal '#(1 2 3) (gr:sizeof-stream-items iosv)) + )) + +;; Must follow all tests +(test-end "qa_0000_basics") diff --git a/gnuradio-core/src/guile/00_runtime_ctors.test b/gnuradio-core/src/guile/00_runtime_ctors.test new file mode 100644 index 000000000..339601bf1 --- /dev/null +++ b/gnuradio-core/src/guile/00_runtime_ctors.test @@ -0,0 +1,28 @@ +;;; +;;; 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 . +;;; + +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +(load-from-path "srfi/srfi-64") ; unit test library + +;;; Add test code for all constructors in these files +;;; +;;; ./runtime/gr_hier_block2.h +;;; ./runtime/gr_msg_queue.h diff --git a/gnuradio-core/src/guile/filter_ctors.test b/gnuradio-core/src/guile/filter_ctors.test new file mode 100644 index 000000000..0dd539a8e --- /dev/null +++ b/gnuradio-core/src/guile/filter_ctors.test @@ -0,0 +1,92 @@ +;;; +;;; 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 . +;;; + +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +(load-from-path "srfi/srfi-64") ; unit test library + +;;; Add test code for all constructors in these files +;;; +;;; ./filter/gr_adaptive_fir_ccf.h +;;; ./filter/gr_cma_equalizer_cc.h +;;; ./filter/gr_fft_filter_ccc.h +;;; ./filter/gr_fft_filter_fff.h +;;; ./filter/gr_filter_delay_fc.h +;;; ./filter/gr_fir_ccc_generic.h +;;; ./filter/gr_fir_ccc_simd.h +;;; ./filter/gr_fir_ccc_x86.h +;;; ./filter/gr_fir_ccf_generic.h +;;; ./filter/gr_fir_ccf_simd.h +;;; ./filter/gr_fir_ccf_x86.h +;;; ./filter/gr_fir_fcc_generic.h +;;; ./filter/gr_fir_fcc_simd.h +;;; ./filter/gr_fir_fcc_x86.h +;;; ./filter/gr_fir_fff_altivec.h +;;; ./filter/gr_fir_fff_armv7_a.h +;;; ./filter/gr_fir_fff_generic.h +;;; ./filter/gr_fir_fff_simd.h +;;; ./filter/gr_fir_fff_x86.h +;;; ./filter/gr_fir_filter_ccc.h +;;; ./filter/gr_fir_filter_ccf.h +;;; ./filter/gr_fir_filter_fcc.h +;;; ./filter/gr_fir_filter_fff.h +;;; ./filter/gr_fir_filter_fsf.h +;;; ./filter/gr_fir_filter_scc.h +;;; ./filter/gr_fir_fsf_generic.h +;;; ./filter/gr_fir_fsf_simd.h +;;; ./filter/gr_fir_fsf_x86.h +;;; ./filter/gr_fir_scc_generic.h +;;; ./filter/gr_fir_scc_simd.h +;;; ./filter/gr_fir_scc_x86.h +;;; ./filter/gr_fir_sysconfig_armv7_a.h +;;; ./filter/gr_fir_sysconfig_generic.h +;;; ./filter/gr_fir_sysconfig_powerpc.h +;;; ./filter/gr_fir_sysconfig_x86.h +;;; ./filter/gr_fractional_interpolator_cc.h +;;; ./filter/gr_fractional_interpolator_ff.h +;;; ./filter/gr_freq_xlating_fir_filter_ccc.h +;;; ./filter/gr_freq_xlating_fir_filter_ccf.h +;;; ./filter/gr_freq_xlating_fir_filter_fcc.h +;;; ./filter/gr_freq_xlating_fir_filter_fcf.h +;;; ./filter/gr_freq_xlating_fir_filter_scc.h +;;; ./filter/gr_freq_xlating_fir_filter_scf.h +;;; ./filter/gr_goertzel_fc.h +;;; ./filter/gr_hilbert_fc.h +;;; ./filter/gr_iir_filter_ffd.h +;;; ./filter/gr_interp_fir_filter_ccc.h +;;; ./filter/gr_interp_fir_filter_ccf.h +;;; ./filter/gr_interp_fir_filter_fcc.h +;;; ./filter/gr_interp_fir_filter_fff.h +;;; ./filter/gr_interp_fir_filter_fsf.h +;;; ./filter/gr_interp_fir_filter_scc.h +;;; ./filter/gr_pfb_arb_resampler_ccf.h +;;; ./filter/gr_pfb_channelizer_ccf.h +;;; ./filter/gr_pfb_clock_sync_ccf.h +;;; ./filter/gr_pfb_clock_sync_fff.h +;;; ./filter/gr_pfb_decimator_ccf.h +;;; ./filter/gr_pfb_interpolator_ccf.h +;;; ./filter/gr_rational_resampler_base_ccc.h +;;; ./filter/gr_rational_resampler_base_ccf.h +;;; ./filter/gr_rational_resampler_base_fcc.h +;;; ./filter/gr_rational_resampler_base_fff.h +;;; ./filter/gr_rational_resampler_base_fsf.h +;;; ./filter/gr_rational_resampler_base_scc.h +;;; ./filter/gr_single_pole_iir_filter_cc.h +;;; ./filter/gr_single_pole_iir_filter_ff.h diff --git a/gnuradio-core/src/guile/general_ctors.test b/gnuradio-core/src/guile/general_ctors.test new file mode 100644 index 000000000..1531a59de --- /dev/null +++ b/gnuradio-core/src/guile/general_ctors.test @@ -0,0 +1,143 @@ +;;; +;;; 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 . +;;; + +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +(load-from-path "srfi/srfi-64") ; unit test library + +;;; Add test code for all constructors in these files +;;; +;;; ./general/gr_additive_scrambler_bb.h +;;; ./general/gr_agc2_cc.h +;;; ./general/gr_agc2_ff.h +;;; ./general/gr_agc_cc.h +;;; ./general/gr_agc_ff.h +;;; ./general/gr_align_on_samplenumbers_ss.h +;;; ./general/gr_bin_statistics_f.h +;;; ./general/gr_binary_slicer_fb.h +;;; ./general/gr_bytes_to_syms.h +;;; ./general/gr_char_to_float.h +;;; ./general/gr_check_counting_s.h +;;; ./general/gr_check_lfsr_32k_s.h +;;; ./general/gr_clock_recovery_mm_cc.h +;;; ./general/gr_clock_recovery_mm_ff.h +;;; ./general/gr_complex_to_interleaved_short.h +;;; ./general/gr_complex_to_xxx.h +;;; ./general/gr_conjugate_cc.h +;;; ./general/gr_constellation_decoder_cb.h +;;; ./general/gr_copy.h +;;; ./general/gr_correlate_access_code_bb.h +;;; ./general/gr_costas_loop_cc.h +;;; ./general/gr_cpfsk_bc.h +;;; ./general/gr_ctcss_squelch_ff.h +;;; ./general/gr_decode_ccsds_27_fb.h +;;; ./general/gr_deinterleave.h +;;; ./general/gr_delay.h +;;; ./general/gr_descrambler_bb.h +;;; ./general/gr_diff_decoder_bb.h +;;; ./general/gr_diff_encoder_bb.h +;;; ./general/gr_diff_phasor_cc.h +;;; ./general/gr_dpll_bb.h +;;; ./general/gr_encode_ccsds_27_bb.h +;;; ./general/gr_fake_channel_coder_pp.h +;;; ./general/gr_feedforward_agc_cc.h +;;; ./general/gr_fft_vcc.h +;;; ./general/gr_fft_vcc_fftw.h +;;; ./general/gr_fft_vfc.h +;;; ./general/gr_fll_band_edge_cc.h +;;; ./general/gr_float_to_char.h +;;; ./general/gr_float_to_complex.h +;;; ./general/gr_float_to_short.h +;;; ./general/gr_float_to_uchar.h +;;; ./general/gr_fmdet_cf.h +;;; ./general/gr_framer_sink_1.h +;;; ./general/gr_frequency_modulator_fc.h +;;; ./general/gr_glfsr_source_b.h +;;; ./general/gr_glfsr_source_f.h +;;; ./general/gr_head.h +;;; ./general/gr_interleave.h +;;; ./general/gr_interleaved_short_to_complex.h +;;; ./general/gr_iqcomp_cc.h +;;; ./general/gr_keep_one_in_n.h +;;; ./general/gr_kludge_copy.h +;;; ./general/gr_lfsr_32k_source_s.h +;;; ./general/gr_lms_dfe_cc.h +;;; ./general/gr_lms_dfe_ff.h +;;; ./general/gr_map_bb.h +;;; ./general/gr_mpsk_receiver_cc.h +;;; ./general/gr_nlog10_ff.h +;;; ./general/gr_nop.h +;;; ./general/gr_null_sink.h +;;; ./general/gr_null_source.h +;;; ./general/gr_ofdm_bpsk_demapper.h +;;; ./general/gr_ofdm_cyclic_prefixer.h +;;; ./general/gr_ofdm_demapper_vcb.h +;;; ./general/gr_ofdm_frame_acquisition.h +;;; ./general/gr_ofdm_frame_sink.h +;;; ./general/gr_ofdm_insert_preamble.h +;;; ./general/gr_ofdm_mapper_bcv.h +;;; ./general/gr_ofdm_sampler.h +;;; ./general/gr_pa_2x2_phase_combiner.h +;;; ./general/gr_packet_sink.h +;;; ./general/gr_peak_detector2_fb.h +;;; ./general/gr_phase_modulator_fc.h +;;; ./general/gr_pll_carriertracking_cc.h +;;; ./general/gr_pll_freqdet_cf.h +;;; ./general/gr_pll_refout_cc.h +;;; ./general/gr_pn_correlator_cc.h +;;; ./general/gr_probe_avg_mag_sqrd_c.h +;;; ./general/gr_probe_avg_mag_sqrd_cf.h +;;; ./general/gr_probe_avg_mag_sqrd_f.h +;;; ./general/gr_probe_density_b.h +;;; ./general/gr_probe_mpsk_snr_c.h +;;; ./general/gr_probe_signal_f.h +;;; ./general/gr_pwr_squelch_cc.h +;;; ./general/gr_pwr_squelch_ff.h +;;; ./general/gr_quadrature_demod_cf.h +;;; ./general/gr_rail_ff.h +;;; ./general/gr_regenerate_bb.h +;;; ./general/gr_repeat.h +;;; ./general/gr_rms_cf.h +;;; ./general/gr_rms_ff.h +;;; ./general/gr_scrambler_bb.h +;;; ./general/gr_short_to_float.h +;;; ./general/gr_simple_correlator.h +;;; ./general/gr_simple_framer.h +;;; ./general/gr_simple_squelch_cc.h +;;; ./general/gr_skiphead.h +;;; ./general/gr_squash_ff.h +;;; ./general/gr_squelch_base_cc.h +;;; ./general/gr_squelch_base_ff.h +;;; ./general/gr_stream_mux.h +;;; ./general/gr_stream_to_streams.h +;;; ./general/gr_stream_to_vector.h +;;; ./general/gr_streams_to_stream.h +;;; ./general/gr_streams_to_vector.h +;;; ./general/gr_stretch_ff.h +;;; ./general/gr_test.h +;;; ./general/gr_threshold_ff.h +;;; ./general/gr_throttle.h +;;; ./general/gr_uchar_to_float.h +;;; ./general/gr_unpack_k_bits_bb.h +;;; ./general/gr_vco_f.h +;;; ./general/gr_vector_to_stream.h +;;; ./general/gr_vector_to_streams.h +;;; ./general/gr_wavelet_ff.h +;;; ./general/gr_wvps_ff.h diff --git a/gnuradio-core/src/guile/gengen_ctors.test b/gnuradio-core/src/guile/gengen_ctors.test new file mode 100644 index 000000000..8e9c509e8 --- /dev/null +++ b/gnuradio-core/src/guile/gengen_ctors.test @@ -0,0 +1,129 @@ +;;; +;;; 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 . +;;; + +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +(load-from-path "srfi/srfi-64") ; unit test library + +;;; Add test code for all constructors in these files +;;; +;;; ./gengen/gr_add_cc.h +;;; ./gengen/gr_add_const_cc.h +;;; ./gengen/gr_add_const_ff.h +;;; ./gengen/gr_add_const_ii.h +;;; ./gengen/gr_add_const_sf.h +;;; ./gengen/gr_add_const_ss.h +;;; ./gengen/gr_add_const_vcc.h +;;; ./gengen/gr_add_const_vff.h +;;; ./gengen/gr_add_const_vii.h +;;; ./gengen/gr_add_const_vss.h +;;; ./gengen/gr_add_ff.h +;;; ./gengen/gr_add_ii.h +;;; ./gengen/gr_add_ss.h +;;; ./gengen/gr_and_bb.h +;;; ./gengen/gr_and_const_bb.h +;;; ./gengen/gr_and_const_ii.h +;;; ./gengen/gr_and_const_ss.h +;;; ./gengen/gr_and_ii.h +;;; ./gengen/gr_and_ss.h +;;; ./gengen/gr_argmax_fs.h +;;; ./gengen/gr_argmax_is.h +;;; ./gengen/gr_argmax_ss.h +;;; ./gengen/gr_chunks_to_symbols_bc.h +;;; ./gengen/gr_chunks_to_symbols_bf.h +;;; ./gengen/gr_chunks_to_symbols_ic.h +;;; ./gengen/gr_chunks_to_symbols_if.h +;;; ./gengen/gr_chunks_to_symbols_sc.h +;;; ./gengen/gr_chunks_to_symbols_sf.h +;;; ./gengen/gr_divide_cc.h +;;; ./gengen/gr_divide_ff.h +;;; ./gengen/gr_divide_ii.h +;;; ./gengen/gr_divide_ss.h +;;; ./gengen/gr_integrate_cc.h +;;; ./gengen/gr_integrate_ff.h +;;; ./gengen/gr_integrate_ii.h +;;; ./gengen/gr_integrate_ss.h +;;; ./gengen/gr_max_ff.h +;;; ./gengen/gr_max_ii.h +;;; ./gengen/gr_max_ss.h +;;; ./gengen/gr_moving_average_cc.h +;;; ./gengen/gr_moving_average_ff.h +;;; ./gengen/gr_moving_average_ii.h +;;; ./gengen/gr_moving_average_ss.h +;;; ./gengen/gr_multiply_cc.h +;;; ./gengen/gr_multiply_const_cc.h +;;; ./gengen/gr_multiply_const_ff.h +;;; ./gengen/gr_multiply_const_ii.h +;;; ./gengen/gr_multiply_const_ss.h +;;; ./gengen/gr_multiply_const_vcc.h +;;; ./gengen/gr_multiply_const_vff.h +;;; ./gengen/gr_multiply_const_vii.h +;;; ./gengen/gr_multiply_const_vss.h +;;; ./gengen/gr_multiply_ff.h +;;; ./gengen/gr_multiply_ii.h +;;; ./gengen/gr_multiply_ss.h +;;; ./gengen/gr_mute_cc.h +;;; ./gengen/gr_mute_ff.h +;;; ./gengen/gr_mute_ii.h +;;; ./gengen/gr_mute_ss.h +;;; ./gengen/gr_noise_source_c.h +;;; ./gengen/gr_noise_source_f.h +;;; ./gengen/gr_noise_source_i.h +;;; ./gengen/gr_noise_source_s.h +;;; ./gengen/gr_not_bb.h +;;; ./gengen/gr_not_ii.h +;;; ./gengen/gr_not_ss.h +;;; ./gengen/gr_or_bb.h +;;; ./gengen/gr_or_ii.h +;;; ./gengen/gr_or_ss.h +;;; ./gengen/gr_packed_to_unpacked_bb.h +;;; ./gengen/gr_packed_to_unpacked_ii.h +;;; ./gengen/gr_packed_to_unpacked_ss.h +;;; ./gengen/gr_peak_detector_fb.h +;;; ./gengen/gr_peak_detector_ib.h +;;; ./gengen/gr_peak_detector_sb.h +;;; ./gengen/gr_sample_and_hold_bb.h +;;; ./gengen/gr_sample_and_hold_ff.h +;;; ./gengen/gr_sample_and_hold_ii.h +;;; ./gengen/gr_sample_and_hold_ss.h +;;; ./gengen/gr_sig_source_c.h +;;; ./gengen/gr_sig_source_f.h +;;; ./gengen/gr_sig_source_i.h +;;; ./gengen/gr_sig_source_s.h +;;; ./gengen/gr_sub_cc.h +;;; ./gengen/gr_sub_ff.h +;;; ./gengen/gr_sub_ii.h +;;; ./gengen/gr_sub_ss.h +;;; ./gengen/gr_unpacked_to_packed_bb.h +;;; ./gengen/gr_unpacked_to_packed_ii.h +;;; ./gengen/gr_unpacked_to_packed_ss.h +;;; ./gengen/gr_vector_sink_b.h +;;; ./gengen/gr_vector_sink_c.h +;;; ./gengen/gr_vector_sink_f.h +;;; ./gengen/gr_vector_sink_i.h +;;; ./gengen/gr_vector_sink_s.h +;;; ./gengen/gr_vector_source_b.h +;;; ./gengen/gr_vector_source_c.h +;;; ./gengen/gr_vector_source_f.h +;;; ./gengen/gr_vector_source_i.h +;;; ./gengen/gr_vector_source_s.h +;;; ./gengen/gr_xor_bb.h +;;; ./gengen/gr_xor_ii.h +;;; ./gengen/gr_xor_ss.h diff --git a/gnuradio-core/src/guile/hier_ctors.test b/gnuradio-core/src/guile/hier_ctors.test new file mode 100644 index 000000000..14d3f4119 --- /dev/null +++ b/gnuradio-core/src/guile/hier_ctors.test @@ -0,0 +1,27 @@ +;;; +;;; 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 . +;;; + +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +(load-from-path "srfi/srfi-64") ; unit test library + +;;; Add test code for all constructors in these files +;;; +;;; ./hier/gr_channel_model.h diff --git a/gnuradio-core/src/guile/io_ctors.test b/gnuradio-core/src/guile/io_ctors.test new file mode 100644 index 000000000..95f231091 --- /dev/null +++ b/gnuradio-core/src/guile/io_ctors.test @@ -0,0 +1,39 @@ +;;; +;;; 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 . +;;; + +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +(load-from-path "srfi/srfi-64") ; unit test library + +;;; Add test code for all constructors in these files +;;; +;;; ./io/gr_file_descriptor_sink.h +;;; ./io/gr_file_descriptor_source.h +;;; ./io/gr_file_sink.h +;;; ./io/gr_file_source.h +;;; ./io/gr_histo_sink_f.h +;;; ./io/gr_message_sink.h +;;; ./io/gr_message_source.h +;;; ./io/gr_oscope_sink_f.h +;;; ./io/gr_oscope_sink_x.h +;;; ./io/gr_udp_sink.h +;;; ./io/gr_udp_source.h +;;; ./io/gr_wavfile_sink.h +;;; ./io/gr_wavfile_source.h diff --git a/gnuradio-core/src/guile/qa_0000_basics.scm b/gnuradio-core/src/guile/qa_0000_basics.scm deleted file mode 100644 index 423a49478..000000000 --- a/gnuradio-core/src/guile/qa_0000_basics.scm +++ /dev/null @@ -1,130 +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 . -;;; - -(use-modules (gnuradio core)) -(use-modules (oop goops)) -;;(use-modules (ice-9 format)) -;;(use-modules (ice-9 pretty-print)) - -(load-from-path "srfi/srfi-64") ; unit test library - -(define (vector-map f v) - (list->vector (map f (vector->list v)))) - - -;; Must precede all tests -(test-begin "qa_0000_basics") - -(test-group "test-connect-1" - (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) - (expected-result (vector-map (lambda (x) (* x 2)) src-data)) - (tb (gr:top-block-swig "QA top block")) - (src (gr:vector-source-i src-data #f)) - (op (gr:multiply-const-ii 2)) - (dst (gr:vector-sink-i))) - - ;; using gr:ep to create endpoints - (gr:connect tb (gr:ep src 0) (gr:ep op 0)) - (gr:connect tb (gr:ep op 0) (gr:ep dst 0)) - - (gr:run tb) - (test-equal expected-result (gr:data dst)))) - - -(test-group "test-connect-2" - (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) - (expected-result (vector-map (lambda (x) (* x 2)) src-data)) - (tb (gr:top-block-swig "QA top block")) - (src (gr:vector-source-i src-data #f)) - (op (gr:multiply-const-ii 2)) - (dst (gr:vector-sink-i))) - - ;; using just blocks - (gr:connect tb src op) - (gr:connect tb op dst) - - (gr:run tb) - (test-equal expected-result (gr:data dst)))) - - -(test-group "test-connect-3" - (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) - (expected-result (vector-map (lambda (x) (* x 2)) src-data)) - (tb (gr:top-block-swig "QA top block")) - (src (gr:vector-source-i src-data #f)) - (op (gr:multiply-const-ii 2)) - (dst (gr:vector-sink-i))) - - ;; using lists to represent endpoints - (gr:connect tb `(,src 0) `(,op 0)) - (gr:connect tb `(,op 0) `(,dst 0)) - - (gr:run tb) - (test-equal expected-result (gr:data dst)))) - - -(test-group "test-connect-4" - (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) - (expected-result (vector-map (lambda (x) (* x 2)) src-data)) - (tb (gr:top-block-swig "QA top block")) - (src (gr:vector-source-i src-data #f)) - (op (gr:multiply-const-ii 2)) - (dst (gr:vector-sink-i))) - - ;; using multiple endpoints - (gr:connect tb src op dst) - - (gr:run tb) - (test-equal expected-result (gr:data dst)))) - - -(test-group "test-io-signature-1" - (let ((ios1 (gr:io-signature 1 2 8)) - (ios2 (gr:io-signature2 1 2 16 32)) - (ios3 (gr:io-signature3 1 -1 14 32 48)) - (iosv (gr:io-signaturev 1 4 '(1 2 3)))) - - (test-equal 1 (gr:min-streams ios1)) - (test-equal 2 (gr:max-streams ios1)) - (test-equal 8 (gr:sizeof-stream-item ios1 0)) - (test-equal 8 (gr:sizeof-stream-item ios1 1)) - - (test-equal 1 (gr:min-streams ios2)) - (test-equal 2 (gr:max-streams ios2)) - (test-equal 16 (gr:sizeof-stream-item ios2 0)) - (test-equal 32 (gr:sizeof-stream-item ios2 1)) - - (test-equal 1 (gr:min-streams ios3)) - (test-equal -1 (gr:max-streams ios3)) - (test-equal 14 (gr:sizeof-stream-item ios3 0)) - (test-equal 32 (gr:sizeof-stream-item ios3 1)) - (test-equal 48 (gr:sizeof-stream-item ios3 2)) - (test-equal '#(14 32 48) (gr:sizeof-stream-items ios3)) - - (test-equal 1 (gr:min-streams iosv)) - (test-equal 4 (gr:max-streams iosv)) - (test-equal 1 (gr:sizeof-stream-item iosv 0)) - (test-equal 2 (gr:sizeof-stream-item iosv 1)) - (test-equal 3 (gr:sizeof-stream-item iosv 2)) - (test-equal 3 (gr:sizeof-stream-item iosv 3)) - (test-equal '#(1 2 3) (gr:sizeof-stream-items iosv)) - )) - -;; Must follow all tests -(test-end "qa_0000_basics") diff --git a/gnuradio-core/src/guile/qa_0010_ctor_filter.scm b/gnuradio-core/src/guile/qa_0010_ctor_filter.scm deleted file mode 100644 index 0dd539a8e..000000000 --- a/gnuradio-core/src/guile/qa_0010_ctor_filter.scm +++ /dev/null @@ -1,92 +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 . -;;; - -(use-modules (gnuradio core)) -(use-modules (oop goops)) - -(load-from-path "srfi/srfi-64") ; unit test library - -;;; Add test code for all constructors in these files -;;; -;;; ./filter/gr_adaptive_fir_ccf.h -;;; ./filter/gr_cma_equalizer_cc.h -;;; ./filter/gr_fft_filter_ccc.h -;;; ./filter/gr_fft_filter_fff.h -;;; ./filter/gr_filter_delay_fc.h -;;; ./filter/gr_fir_ccc_generic.h -;;; ./filter/gr_fir_ccc_simd.h -;;; ./filter/gr_fir_ccc_x86.h -;;; ./filter/gr_fir_ccf_generic.h -;;; ./filter/gr_fir_ccf_simd.h -;;; ./filter/gr_fir_ccf_x86.h -;;; ./filter/gr_fir_fcc_generic.h -;;; ./filter/gr_fir_fcc_simd.h -;;; ./filter/gr_fir_fcc_x86.h -;;; ./filter/gr_fir_fff_altivec.h -;;; ./filter/gr_fir_fff_armv7_a.h -;;; ./filter/gr_fir_fff_generic.h -;;; ./filter/gr_fir_fff_simd.h -;;; ./filter/gr_fir_fff_x86.h -;;; ./filter/gr_fir_filter_ccc.h -;;; ./filter/gr_fir_filter_ccf.h -;;; ./filter/gr_fir_filter_fcc.h -;;; ./filter/gr_fir_filter_fff.h -;;; ./filter/gr_fir_filter_fsf.h -;;; ./filter/gr_fir_filter_scc.h -;;; ./filter/gr_fir_fsf_generic.h -;;; ./filter/gr_fir_fsf_simd.h -;;; ./filter/gr_fir_fsf_x86.h -;;; ./filter/gr_fir_scc_generic.h -;;; ./filter/gr_fir_scc_simd.h -;;; ./filter/gr_fir_scc_x86.h -;;; ./filter/gr_fir_sysconfig_armv7_a.h -;;; ./filter/gr_fir_sysconfig_generic.h -;;; ./filter/gr_fir_sysconfig_powerpc.h -;;; ./filter/gr_fir_sysconfig_x86.h -;;; ./filter/gr_fractional_interpolator_cc.h -;;; ./filter/gr_fractional_interpolator_ff.h -;;; ./filter/gr_freq_xlating_fir_filter_ccc.h -;;; ./filter/gr_freq_xlating_fir_filter_ccf.h -;;; ./filter/gr_freq_xlating_fir_filter_fcc.h -;;; ./filter/gr_freq_xlating_fir_filter_fcf.h -;;; ./filter/gr_freq_xlating_fir_filter_scc.h -;;; ./filter/gr_freq_xlating_fir_filter_scf.h -;;; ./filter/gr_goertzel_fc.h -;;; ./filter/gr_hilbert_fc.h -;;; ./filter/gr_iir_filter_ffd.h -;;; ./filter/gr_interp_fir_filter_ccc.h -;;; ./filter/gr_interp_fir_filter_ccf.h -;;; ./filter/gr_interp_fir_filter_fcc.h -;;; ./filter/gr_interp_fir_filter_fff.h -;;; ./filter/gr_interp_fir_filter_fsf.h -;;; ./filter/gr_interp_fir_filter_scc.h -;;; ./filter/gr_pfb_arb_resampler_ccf.h -;;; ./filter/gr_pfb_channelizer_ccf.h -;;; ./filter/gr_pfb_clock_sync_ccf.h -;;; ./filter/gr_pfb_clock_sync_fff.h -;;; ./filter/gr_pfb_decimator_ccf.h -;;; ./filter/gr_pfb_interpolator_ccf.h -;;; ./filter/gr_rational_resampler_base_ccc.h -;;; ./filter/gr_rational_resampler_base_ccf.h -;;; ./filter/gr_rational_resampler_base_fcc.h -;;; ./filter/gr_rational_resampler_base_fff.h -;;; ./filter/gr_rational_resampler_base_fsf.h -;;; ./filter/gr_rational_resampler_base_scc.h -;;; ./filter/gr_single_pole_iir_filter_cc.h -;;; ./filter/gr_single_pole_iir_filter_ff.h diff --git a/gnuradio-core/src/guile/qa_0010_ctor_general.scm b/gnuradio-core/src/guile/qa_0010_ctor_general.scm deleted file mode 100644 index 1531a59de..000000000 --- a/gnuradio-core/src/guile/qa_0010_ctor_general.scm +++ /dev/null @@ -1,143 +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 . -;;; - -(use-modules (gnuradio core)) -(use-modules (oop goops)) - -(load-from-path "srfi/srfi-64") ; unit test library - -;;; Add test code for all constructors in these files -;;; -;;; ./general/gr_additive_scrambler_bb.h -;;; ./general/gr_agc2_cc.h -;;; ./general/gr_agc2_ff.h -;;; ./general/gr_agc_cc.h -;;; ./general/gr_agc_ff.h -;;; ./general/gr_align_on_samplenumbers_ss.h -;;; ./general/gr_bin_statistics_f.h -;;; ./general/gr_binary_slicer_fb.h -;;; ./general/gr_bytes_to_syms.h -;;; ./general/gr_char_to_float.h -;;; ./general/gr_check_counting_s.h -;;; ./general/gr_check_lfsr_32k_s.h -;;; ./general/gr_clock_recovery_mm_cc.h -;;; ./general/gr_clock_recovery_mm_ff.h -;;; ./general/gr_complex_to_interleaved_short.h -;;; ./general/gr_complex_to_xxx.h -;;; ./general/gr_conjugate_cc.h -;;; ./general/gr_constellation_decoder_cb.h -;;; ./general/gr_copy.h -;;; ./general/gr_correlate_access_code_bb.h -;;; ./general/gr_costas_loop_cc.h -;;; ./general/gr_cpfsk_bc.h -;;; ./general/gr_ctcss_squelch_ff.h -;;; ./general/gr_decode_ccsds_27_fb.h -;;; ./general/gr_deinterleave.h -;;; ./general/gr_delay.h -;;; ./general/gr_descrambler_bb.h -;;; ./general/gr_diff_decoder_bb.h -;;; ./general/gr_diff_encoder_bb.h -;;; ./general/gr_diff_phasor_cc.h -;;; ./general/gr_dpll_bb.h -;;; ./general/gr_encode_ccsds_27_bb.h -;;; ./general/gr_fake_channel_coder_pp.h -;;; ./general/gr_feedforward_agc_cc.h -;;; ./general/gr_fft_vcc.h -;;; ./general/gr_fft_vcc_fftw.h -;;; ./general/gr_fft_vfc.h -;;; ./general/gr_fll_band_edge_cc.h -;;; ./general/gr_float_to_char.h -;;; ./general/gr_float_to_complex.h -;;; ./general/gr_float_to_short.h -;;; ./general/gr_float_to_uchar.h -;;; ./general/gr_fmdet_cf.h -;;; ./general/gr_framer_sink_1.h -;;; ./general/gr_frequency_modulator_fc.h -;;; ./general/gr_glfsr_source_b.h -;;; ./general/gr_glfsr_source_f.h -;;; ./general/gr_head.h -;;; ./general/gr_interleave.h -;;; ./general/gr_interleaved_short_to_complex.h -;;; ./general/gr_iqcomp_cc.h -;;; ./general/gr_keep_one_in_n.h -;;; ./general/gr_kludge_copy.h -;;; ./general/gr_lfsr_32k_source_s.h -;;; ./general/gr_lms_dfe_cc.h -;;; ./general/gr_lms_dfe_ff.h -;;; ./general/gr_map_bb.h -;;; ./general/gr_mpsk_receiver_cc.h -;;; ./general/gr_nlog10_ff.h -;;; ./general/gr_nop.h -;;; ./general/gr_null_sink.h -;;; ./general/gr_null_source.h -;;; ./general/gr_ofdm_bpsk_demapper.h -;;; ./general/gr_ofdm_cyclic_prefixer.h -;;; ./general/gr_ofdm_demapper_vcb.h -;;; ./general/gr_ofdm_frame_acquisition.h -;;; ./general/gr_ofdm_frame_sink.h -;;; ./general/gr_ofdm_insert_preamble.h -;;; ./general/gr_ofdm_mapper_bcv.h -;;; ./general/gr_ofdm_sampler.h -;;; ./general/gr_pa_2x2_phase_combiner.h -;;; ./general/gr_packet_sink.h -;;; ./general/gr_peak_detector2_fb.h -;;; ./general/gr_phase_modulator_fc.h -;;; ./general/gr_pll_carriertracking_cc.h -;;; ./general/gr_pll_freqdet_cf.h -;;; ./general/gr_pll_refout_cc.h -;;; ./general/gr_pn_correlator_cc.h -;;; ./general/gr_probe_avg_mag_sqrd_c.h -;;; ./general/gr_probe_avg_mag_sqrd_cf.h -;;; ./general/gr_probe_avg_mag_sqrd_f.h -;;; ./general/gr_probe_density_b.h -;;; ./general/gr_probe_mpsk_snr_c.h -;;; ./general/gr_probe_signal_f.h -;;; ./general/gr_pwr_squelch_cc.h -;;; ./general/gr_pwr_squelch_ff.h -;;; ./general/gr_quadrature_demod_cf.h -;;; ./general/gr_rail_ff.h -;;; ./general/gr_regenerate_bb.h -;;; ./general/gr_repeat.h -;;; ./general/gr_rms_cf.h -;;; ./general/gr_rms_ff.h -;;; ./general/gr_scrambler_bb.h -;;; ./general/gr_short_to_float.h -;;; ./general/gr_simple_correlator.h -;;; ./general/gr_simple_framer.h -;;; ./general/gr_simple_squelch_cc.h -;;; ./general/gr_skiphead.h -;;; ./general/gr_squash_ff.h -;;; ./general/gr_squelch_base_cc.h -;;; ./general/gr_squelch_base_ff.h -;;; ./general/gr_stream_mux.h -;;; ./general/gr_stream_to_streams.h -;;; ./general/gr_stream_to_vector.h -;;; ./general/gr_streams_to_stream.h -;;; ./general/gr_streams_to_vector.h -;;; ./general/gr_stretch_ff.h -;;; ./general/gr_test.h -;;; ./general/gr_threshold_ff.h -;;; ./general/gr_throttle.h -;;; ./general/gr_uchar_to_float.h -;;; ./general/gr_unpack_k_bits_bb.h -;;; ./general/gr_vco_f.h -;;; ./general/gr_vector_to_stream.h -;;; ./general/gr_vector_to_streams.h -;;; ./general/gr_wavelet_ff.h -;;; ./general/gr_wvps_ff.h diff --git a/gnuradio-core/src/guile/qa_0010_ctor_gengen.scm b/gnuradio-core/src/guile/qa_0010_ctor_gengen.scm deleted file mode 100644 index 8e9c509e8..000000000 --- a/gnuradio-core/src/guile/qa_0010_ctor_gengen.scm +++ /dev/null @@ -1,129 +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 . -;;; - -(use-modules (gnuradio core)) -(use-modules (oop goops)) - -(load-from-path "srfi/srfi-64") ; unit test library - -;;; Add test code for all constructors in these files -;;; -;;; ./gengen/gr_add_cc.h -;;; ./gengen/gr_add_const_cc.h -;;; ./gengen/gr_add_const_ff.h -;;; ./gengen/gr_add_const_ii.h -;;; ./gengen/gr_add_const_sf.h -;;; ./gengen/gr_add_const_ss.h -;;; ./gengen/gr_add_const_vcc.h -;;; ./gengen/gr_add_const_vff.h -;;; ./gengen/gr_add_const_vii.h -;;; ./gengen/gr_add_const_vss.h -;;; ./gengen/gr_add_ff.h -;;; ./gengen/gr_add_ii.h -;;; ./gengen/gr_add_ss.h -;;; ./gengen/gr_and_bb.h -;;; ./gengen/gr_and_const_bb.h -;;; ./gengen/gr_and_const_ii.h -;;; ./gengen/gr_and_const_ss.h -;;; ./gengen/gr_and_ii.h -;;; ./gengen/gr_and_ss.h -;;; ./gengen/gr_argmax_fs.h -;;; ./gengen/gr_argmax_is.h -;;; ./gengen/gr_argmax_ss.h -;;; ./gengen/gr_chunks_to_symbols_bc.h -;;; ./gengen/gr_chunks_to_symbols_bf.h -;;; ./gengen/gr_chunks_to_symbols_ic.h -;;; ./gengen/gr_chunks_to_symbols_if.h -;;; ./gengen/gr_chunks_to_symbols_sc.h -;;; ./gengen/gr_chunks_to_symbols_sf.h -;;; ./gengen/gr_divide_cc.h -;;; ./gengen/gr_divide_ff.h -;;; ./gengen/gr_divide_ii.h -;;; ./gengen/gr_divide_ss.h -;;; ./gengen/gr_integrate_cc.h -;;; ./gengen/gr_integrate_ff.h -;;; ./gengen/gr_integrate_ii.h -;;; ./gengen/gr_integrate_ss.h -;;; ./gengen/gr_max_ff.h -;;; ./gengen/gr_max_ii.h -;;; ./gengen/gr_max_ss.h -;;; ./gengen/gr_moving_average_cc.h -;;; ./gengen/gr_moving_average_ff.h -;;; ./gengen/gr_moving_average_ii.h -;;; ./gengen/gr_moving_average_ss.h -;;; ./gengen/gr_multiply_cc.h -;;; ./gengen/gr_multiply_const_cc.h -;;; ./gengen/gr_multiply_const_ff.h -;;; ./gengen/gr_multiply_const_ii.h -;;; ./gengen/gr_multiply_const_ss.h -;;; ./gengen/gr_multiply_const_vcc.h -;;; ./gengen/gr_multiply_const_vff.h -;;; ./gengen/gr_multiply_const_vii.h -;;; ./gengen/gr_multiply_const_vss.h -;;; ./gengen/gr_multiply_ff.h -;;; ./gengen/gr_multiply_ii.h -;;; ./gengen/gr_multiply_ss.h -;;; ./gengen/gr_mute_cc.h -;;; ./gengen/gr_mute_ff.h -;;; ./gengen/gr_mute_ii.h -;;; ./gengen/gr_mute_ss.h -;;; ./gengen/gr_noise_source_c.h -;;; ./gengen/gr_noise_source_f.h -;;; ./gengen/gr_noise_source_i.h -;;; ./gengen/gr_noise_source_s.h -;;; ./gengen/gr_not_bb.h -;;; ./gengen/gr_not_ii.h -;;; ./gengen/gr_not_ss.h -;;; ./gengen/gr_or_bb.h -;;; ./gengen/gr_or_ii.h -;;; ./gengen/gr_or_ss.h -;;; ./gengen/gr_packed_to_unpacked_bb.h -;;; ./gengen/gr_packed_to_unpacked_ii.h -;;; ./gengen/gr_packed_to_unpacked_ss.h -;;; ./gengen/gr_peak_detector_fb.h -;;; ./gengen/gr_peak_detector_ib.h -;;; ./gengen/gr_peak_detector_sb.h -;;; ./gengen/gr_sample_and_hold_bb.h -;;; ./gengen/gr_sample_and_hold_ff.h -;;; ./gengen/gr_sample_and_hold_ii.h -;;; ./gengen/gr_sample_and_hold_ss.h -;;; ./gengen/gr_sig_source_c.h -;;; ./gengen/gr_sig_source_f.h -;;; ./gengen/gr_sig_source_i.h -;;; ./gengen/gr_sig_source_s.h -;;; ./gengen/gr_sub_cc.h -;;; ./gengen/gr_sub_ff.h -;;; ./gengen/gr_sub_ii.h -;;; ./gengen/gr_sub_ss.h -;;; ./gengen/gr_unpacked_to_packed_bb.h -;;; ./gengen/gr_unpacked_to_packed_ii.h -;;; ./gengen/gr_unpacked_to_packed_ss.h -;;; ./gengen/gr_vector_sink_b.h -;;; ./gengen/gr_vector_sink_c.h -;;; ./gengen/gr_vector_sink_f.h -;;; ./gengen/gr_vector_sink_i.h -;;; ./gengen/gr_vector_sink_s.h -;;; ./gengen/gr_vector_source_b.h -;;; ./gengen/gr_vector_source_c.h -;;; ./gengen/gr_vector_source_f.h -;;; ./gengen/gr_vector_source_i.h -;;; ./gengen/gr_vector_source_s.h -;;; ./gengen/gr_xor_bb.h -;;; ./gengen/gr_xor_ii.h -;;; ./gengen/gr_xor_ss.h diff --git a/gnuradio-core/src/guile/qa_0010_ctor_hier.scm b/gnuradio-core/src/guile/qa_0010_ctor_hier.scm deleted file mode 100644 index 14d3f4119..000000000 --- a/gnuradio-core/src/guile/qa_0010_ctor_hier.scm +++ /dev/null @@ -1,27 +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 . -;;; - -(use-modules (gnuradio core)) -(use-modules (oop goops)) - -(load-from-path "srfi/srfi-64") ; unit test library - -;;; Add test code for all constructors in these files -;;; -;;; ./hier/gr_channel_model.h diff --git a/gnuradio-core/src/guile/qa_0010_ctor_io.scm b/gnuradio-core/src/guile/qa_0010_ctor_io.scm deleted file mode 100644 index 95f231091..000000000 --- a/gnuradio-core/src/guile/qa_0010_ctor_io.scm +++ /dev/null @@ -1,39 +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 . -;;; - -(use-modules (gnuradio core)) -(use-modules (oop goops)) - -(load-from-path "srfi/srfi-64") ; unit test library - -;;; Add test code for all constructors in these files -;;; -;;; ./io/gr_file_descriptor_sink.h -;;; ./io/gr_file_descriptor_source.h -;;; ./io/gr_file_sink.h -;;; ./io/gr_file_source.h -;;; ./io/gr_histo_sink_f.h -;;; ./io/gr_message_sink.h -;;; ./io/gr_message_source.h -;;; ./io/gr_oscope_sink_f.h -;;; ./io/gr_oscope_sink_x.h -;;; ./io/gr_udp_sink.h -;;; ./io/gr_udp_source.h -;;; ./io/gr_wavfile_sink.h -;;; ./io/gr_wavfile_source.h diff --git a/gnuradio-core/src/guile/qa_0010_ctor_runtime.scm b/gnuradio-core/src/guile/qa_0010_ctor_runtime.scm deleted file mode 100644 index 339601bf1..000000000 --- a/gnuradio-core/src/guile/qa_0010_ctor_runtime.scm +++ /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 . -;;; - -(use-modules (gnuradio core)) -(use-modules (oop goops)) - -(load-from-path "srfi/srfi-64") ; unit test library - -;;; Add test code for all constructors in these files -;;; -;;; ./runtime/gr_hier_block2.h -;;; ./runtime/gr_msg_queue.h -- cgit From e02be919a1abe9bde91aa32ad70f8a7133ce29e3 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 7 Nov 2010 15:09:27 -0800 Subject: new QA code work-in-progress --- .../src/guile/gnuradio/test-suite/guile-test | 241 +++++++++ .../src/guile/gnuradio/test-suite/lib.scm | 559 +++++++++++++++++++++ gnuradio-core/src/guile/test-suite/guile-test | 241 --------- gnuradio-core/src/guile/test-suite/lib.scm | 559 --------------------- 4 files changed, 800 insertions(+), 800 deletions(-) create mode 100755 gnuradio-core/src/guile/gnuradio/test-suite/guile-test create mode 100644 gnuradio-core/src/guile/gnuradio/test-suite/lib.scm delete mode 100755 gnuradio-core/src/guile/test-suite/guile-test delete mode 100644 gnuradio-core/src/guile/test-suite/lib.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/gnuradio/test-suite/guile-test b/gnuradio-core/src/guile/gnuradio/test-suite/guile-test new file mode 100755 index 000000000..1e1c70a77 --- /dev/null +++ b/gnuradio-core/src/guile/gnuradio/test-suite/guile-test @@ -0,0 +1,241 @@ +#!../libguile/guile \ +-e main -s +!# + +;;;; guile-test --- run the Guile test suite +;;;; Jim Blandy --- May 1999 +;;;; +;;;; Copyright (C) 1999, 2001, 2006 Free Software Foundation, Inc. +;;;; +;;;; This program 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 2, or (at your option) +;;;; any later version. +;;;; +;;;; This program 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 software; see the file COPYING. If not, write to +;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;;;; Boston, MA 02110-1301 USA + + +;;;; Usage: [guile -e main -s] guile-test [OPTIONS] [TEST ...] +;;;; +;;;; Run tests from the Guile test suite. Report failures and +;;;; unexpected passes to the standard output, along with a summary of +;;;; all the results. Record each reported test outcome in the log +;;;; file, `guile.log'. The exit status is #f if any of the tests +;;;; fail or pass unexpectedly. +;;;; +;;;; Normally, guile-test scans the test directory, and executes all +;;;; files whose names end in `.test'. (It assumes they contain +;;;; Scheme code.) However, you can have it execute specific tests by +;;;; listing their filenames on the command line. +;;;; +;;;; The option `--test-suite' can be given to specify the test +;;;; directory. If no such option is given, the test directory is +;;;; taken from the environment variable TEST_SUITE_DIR (if defined), +;;;; otherwise a default directory that is hardcoded in this file is +;;;; used (see "Installation" below). +;;;; +;;;; If present, the `--log-file LOG' option tells `guile-test' to put +;;;; the log output in a file named LOG. +;;;; +;;;; If present, the `--debug' option will enable a debugging mode. +;;;; +;;;; If present, the `--flag-unresolved' option will cause guile-test +;;;; to exit with failure status if any tests are UNRESOLVED. +;;;; +;;;; +;;;; Installation: +;;;; +;;;; If you change the #! line at the top of this script to point at +;;;; the Guile interpreter you want to test, you can call this script +;;;; as an executable instead of having to pass it as a parameter to +;;;; guile via "guile -e main -s guile-test". Further, you can edit +;;;; the definition of default-test-suite to point to the parent +;;;; directory of the `tests' tree, which makes it unnecessary to set +;;;; the environment variable `TEST_SUITE_DIR'. +;;;; +;;;; +;;;; Shortcomings: +;;;; +;;;; At the moment, due to a simple-minded implementation, test files +;;;; must live in the test directory, and you must specify their names +;;;; relative to the top of the test directory. If you want to send +;;;; me a patch that fixes this, but still leaves sane test names in +;;;; the log file, that would be great. At the moment, all the tests +;;;; I care about are in the test directory, though. +;;;; +;;;; It would be nice if you could specify the Guile interpreter you +;;;; want to test on the command line. As it stands, if you want to +;;;; change which Guile interpreter you're testing, you need to edit +;;;; the #! line at the top of this file, which is stupid. + +(define (main . args) + (let ((module (resolve-module '(test-suite guile-test)))) + (apply (module-ref module 'main) args))) + +(define-module (test-suite guile-test) + :use-module (test-suite lib) + :use-module (ice-9 getopt-long) + :use-module (ice-9 and-let-star) + :use-module (ice-9 rdelim) + :export (main data-file-name test-file-name)) + + +;;; User configurable settings: +(define default-test-suite + (string-append (getenv "HOME") "/bogus-path/test-suite")) + + +;;; Variables that will receive their actual values later. +(define test-suite default-test-suite) + +(define tmp-dir #f) + + +;;; General utilities, that probably should be in a library somewhere. + +;;; Enable debugging +(define (enable-debug-mode) + (write-line %load-path) + (set! %load-verbosely #t) + (debug-enable 'backtrace 'debug)) + +;;; Traverse the directory tree at ROOT, applying F to the name of +;;; each file in the tree, including ROOT itself. For a subdirectory +;;; SUB, if (F SUB) is true, we recurse into SUB. Do not follow +;;; symlinks. +(define (for-each-file f root) + + ;; A "hard directory" is a path that denotes a directory and is not a + ;; symlink. + (define (file-is-hard-directory? filename) + (eq? (stat:type (lstat filename)) 'directory)) + + (let visit ((root root)) + (let ((should-recur (f root))) + (if (and should-recur (file-is-hard-directory? root)) + (let ((dir (opendir root))) + (let loop () + (let ((entry (readdir dir))) + (cond + ((eof-object? entry) #f) + ((or (string=? entry ".") + (string=? entry "..") + (string=? entry "CVS") + (string=? entry "RCS")) + (loop)) + (else + (visit (string-append root "/" entry)) + (loop)))))))))) + + +;;; The test driver. + + +;;; Localizing test files and temporary data files. + +(define (data-file-name filename) + (in-vicinity tmp-dir filename)) + +(define (test-file-name test) + (in-vicinity test-suite test)) + +;;; Return a list of all the test files in the test tree. +(define (enumerate-tests test-dir) + (let ((root-len (+ 1 (string-length test-dir))) + (tests '())) + (for-each-file (lambda (file) + (if (has-suffix? file ".test") + (let ((short-name + (substring file root-len))) + (set! tests (cons short-name tests)))) + #t) + test-dir) + + ;; for-each-file presents the files in whatever order it finds + ;; them in the directory. We sort them here, so they'll always + ;; appear in the same order. This makes it easier to compare test + ;; log files mechanically. + (sort tests string --- May 1999 -;;;; -;;;; Copyright (C) 1999, 2001, 2006 Free Software Foundation, Inc. -;;;; -;;;; This program 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 2, or (at your option) -;;;; any later version. -;;;; -;;;; This program 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 software; see the file COPYING. If not, write to -;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;;;; Boston, MA 02110-1301 USA - - -;;;; Usage: [guile -e main -s] guile-test [OPTIONS] [TEST ...] -;;;; -;;;; Run tests from the Guile test suite. Report failures and -;;;; unexpected passes to the standard output, along with a summary of -;;;; all the results. Record each reported test outcome in the log -;;;; file, `guile.log'. The exit status is #f if any of the tests -;;;; fail or pass unexpectedly. -;;;; -;;;; Normally, guile-test scans the test directory, and executes all -;;;; files whose names end in `.test'. (It assumes they contain -;;;; Scheme code.) However, you can have it execute specific tests by -;;;; listing their filenames on the command line. -;;;; -;;;; The option `--test-suite' can be given to specify the test -;;;; directory. If no such option is given, the test directory is -;;;; taken from the environment variable TEST_SUITE_DIR (if defined), -;;;; otherwise a default directory that is hardcoded in this file is -;;;; used (see "Installation" below). -;;;; -;;;; If present, the `--log-file LOG' option tells `guile-test' to put -;;;; the log output in a file named LOG. -;;;; -;;;; If present, the `--debug' option will enable a debugging mode. -;;;; -;;;; If present, the `--flag-unresolved' option will cause guile-test -;;;; to exit with failure status if any tests are UNRESOLVED. -;;;; -;;;; -;;;; Installation: -;;;; -;;;; If you change the #! line at the top of this script to point at -;;;; the Guile interpreter you want to test, you can call this script -;;;; as an executable instead of having to pass it as a parameter to -;;;; guile via "guile -e main -s guile-test". Further, you can edit -;;;; the definition of default-test-suite to point to the parent -;;;; directory of the `tests' tree, which makes it unnecessary to set -;;;; the environment variable `TEST_SUITE_DIR'. -;;;; -;;;; -;;;; Shortcomings: -;;;; -;;;; At the moment, due to a simple-minded implementation, test files -;;;; must live in the test directory, and you must specify their names -;;;; relative to the top of the test directory. If you want to send -;;;; me a patch that fixes this, but still leaves sane test names in -;;;; the log file, that would be great. At the moment, all the tests -;;;; I care about are in the test directory, though. -;;;; -;;;; It would be nice if you could specify the Guile interpreter you -;;;; want to test on the command line. As it stands, if you want to -;;;; change which Guile interpreter you're testing, you need to edit -;;;; the #! line at the top of this file, which is stupid. - -(define (main . args) - (let ((module (resolve-module '(test-suite guile-test)))) - (apply (module-ref module 'main) args))) - -(define-module (test-suite guile-test) - :use-module (test-suite lib) - :use-module (ice-9 getopt-long) - :use-module (ice-9 and-let-star) - :use-module (ice-9 rdelim) - :export (main data-file-name test-file-name)) - - -;;; User configurable settings: -(define default-test-suite - (string-append (getenv "HOME") "/bogus-path/test-suite")) - - -;;; Variables that will receive their actual values later. -(define test-suite default-test-suite) - -(define tmp-dir #f) - - -;;; General utilities, that probably should be in a library somewhere. - -;;; Enable debugging -(define (enable-debug-mode) - (write-line %load-path) - (set! %load-verbosely #t) - (debug-enable 'backtrace 'debug)) - -;;; Traverse the directory tree at ROOT, applying F to the name of -;;; each file in the tree, including ROOT itself. For a subdirectory -;;; SUB, if (F SUB) is true, we recurse into SUB. Do not follow -;;; symlinks. -(define (for-each-file f root) - - ;; A "hard directory" is a path that denotes a directory and is not a - ;; symlink. - (define (file-is-hard-directory? filename) - (eq? (stat:type (lstat filename)) 'directory)) - - (let visit ((root root)) - (let ((should-recur (f root))) - (if (and should-recur (file-is-hard-directory? root)) - (let ((dir (opendir root))) - (let loop () - (let ((entry (readdir dir))) - (cond - ((eof-object? entry) #f) - ((or (string=? entry ".") - (string=? entry "..") - (string=? entry "CVS") - (string=? entry "RCS")) - (loop)) - (else - (visit (string-append root "/" entry)) - (loop)))))))))) - - -;;; The test driver. - - -;;; Localizing test files and temporary data files. - -(define (data-file-name filename) - (in-vicinity tmp-dir filename)) - -(define (test-file-name test) - (in-vicinity test-suite test)) - -;;; Return a list of all the test files in the test tree. -(define (enumerate-tests test-dir) - (let ((root-len (+ 1 (string-length test-dir))) - (tests '())) - (for-each-file (lambda (file) - (if (has-suffix? file ".test") - (let ((short-name - (substring file root-len))) - (set! tests (cons short-name tests)))) - #t) - test-dir) - - ;; for-each-file presents the files in whatever order it finds - ;; them in the directory. We sort them here, so they'll always - ;; appear in the same order. This makes it easier to compare test - ;; log files mechanically. - (sort tests string. ;;; +(use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) +(use-modules (ice-9 syncase)) ;;(use-modules (ice-9 format)) ;;(use-modules (ice-9 pretty-print)) -(load-from-path "srfi/srfi-64") ; unit test library +;; (test-equal [name] expected test-expr) +(define-syntax test-equal + (syntax-rules () + ((_ expected test-expr) + (pass-if (equal? expected test-expr))) + ((_ name expected test-exprt) + (pass-if name (equal? expected test-expr))))) + (define (vector-map f v) (list->vector (map f (vector->list v)))) -;; Must precede all tests -(test-begin "qa_0000_basics") - -(test-group "test-connect-1" +(with-test-prefix "test-connect-1" (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) (tb (gr:top-block-swig "QA top block")) @@ -44,10 +51,11 @@ (gr:connect tb (gr:ep op 0) (gr:ep dst 0)) (gr:run tb) - (test-equal expected-result (gr:data dst)))) - + ;;(pass-if (equal? expected-result (gr:data dst))) + (test-equal expected-result (gr:data dst)) + )) -(test-group "test-connect-2" +(with-test-prefix "test-connect-2" (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) (tb (gr:top-block-swig "QA top block")) @@ -63,7 +71,7 @@ (test-equal expected-result (gr:data dst)))) -(test-group "test-connect-3" +(with-test-prefix "test-connect-3" (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) (tb (gr:top-block-swig "QA top block")) @@ -79,7 +87,7 @@ (test-equal expected-result (gr:data dst)))) -(test-group "test-connect-4" +(with-test-prefix "test-connect-4" (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) (tb (gr:top-block-swig "QA top block")) @@ -94,7 +102,7 @@ (test-equal expected-result (gr:data dst)))) -(test-group "test-io-signature-1" +(with-test-prefix "test-io-signature-1" (let ((ios1 (gr:io-signature 1 2 8)) (ios2 (gr:io-signature2 1 2 16 32)) (ios3 (gr:io-signature3 1 -1 14 32 48)) @@ -126,5 +134,3 @@ (test-equal '#(1 2 3) (gr:sizeof-stream-items iosv)) )) -;; Must follow all tests -(test-end "qa_0000_basics") diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index 4db679cff..bbb36794e 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -38,14 +38,14 @@ nobase_guile_DATA = \ gnuradio/runtime-shim.scm \ srfi/srfi-64.scm -noinst_DATA = \ - qa_0000_basics.scm \ - qa_0010_ctor_filter.scm \ - qa_0010_ctor_general.scm \ - qa_0010_ctor_gengen.scm \ - qa_0010_ctor_hier.scm \ - qa_0010_ctor_io.scm \ - qa_0010_ctor_runtime.scm - +# noinst_DATA = \ +# qa_0000_basics.scm \ +# qa_0010_ctor_filter.scm \ +# qa_0010_ctor_general.scm \ +# qa_0010_ctor_gengen.scm \ +# qa_0010_ctor_hier.scm \ +# qa_0010_ctor_io.scm \ +# qa_0010_ctor_runtime.scm +# CLEANFILES = qa_*.log diff --git a/gnuradio-core/src/guile/gnuradio/test-suite/guile-test b/gnuradio-core/src/guile/gnuradio/test-suite/guile-test index 1e1c70a77..6dc1a9658 100755 --- a/gnuradio-core/src/guile/gnuradio/test-suite/guile-test +++ b/gnuradio-core/src/guile/gnuradio/test-suite/guile-test @@ -1,4 +1,4 @@ -#!../libguile/guile \ +#!/usr/bin/guile \ -e main -s !# @@ -77,11 +77,11 @@ ;;;; the #! line at the top of this file, which is stupid. (define (main . args) - (let ((module (resolve-module '(test-suite guile-test)))) + (let ((module (resolve-module '(gnuradio test-suite guile-test)))) (apply (module-ref module 'main) args))) -(define-module (test-suite guile-test) - :use-module (test-suite lib) +(define-module (gnuradio test-suite guile-test) + :use-module (gnuradio test-suite lib) :use-module (ice-9 getopt-long) :use-module (ice-9 and-let-star) :use-module (ice-9 rdelim) diff --git a/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm b/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm index c4ddf9e7c..272fe2f10 100644 --- a/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm +++ b/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm @@ -16,7 +16,7 @@ ;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ;;;; Boston, MA 02110-1301 USA -(define-module (test-suite lib) +(define-module (gnuradio test-suite lib) :use-module (ice-9 stack-catch) :use-module (ice-9 regex) :export ( -- cgit From 8a4a74414804f1ccc1ce748b14f82acff3078806 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 7 Nov 2010 15:37:04 -0800 Subject: Modify *.test to import correct modules --- gnuradio-core/src/guile/.gitignore | 2 +- gnuradio-core/src/guile/00_runtime_basics.test | 12 -------- gnuradio-core/src/guile/00_runtime_ctors.test | 6 +++- gnuradio-core/src/guile/Makefile.am | 22 +++++++------- gnuradio-core/src/guile/filter_ctors.test | 7 +++-- gnuradio-core/src/guile/general_ctors.test | 7 +++-- gnuradio-core/src/guile/gengen_ctors.test | 7 +++-- .../src/guile/gnuradio/test-suite/lib.scm | 35 +++++++++++++++++++++- gnuradio-core/src/guile/hier_ctors.test | 7 +++-- gnuradio-core/src/guile/io_ctors.test | 7 +++-- 10 files changed, 76 insertions(+), 36 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/.gitignore b/gnuradio-core/src/guile/.gitignore index c76800aac..82a29a907 100644 --- a/gnuradio-core/src/guile/.gitignore +++ b/gnuradio-core/src/guile/.gitignore @@ -1,4 +1,4 @@ /Makefile /Makefile.in /run_guile_tests -/qa_*.log +/guile.log diff --git a/gnuradio-core/src/guile/00_runtime_basics.test b/gnuradio-core/src/guile/00_runtime_basics.test index a8fcf263b..c9d251268 100644 --- a/gnuradio-core/src/guile/00_runtime_basics.test +++ b/gnuradio-core/src/guile/00_runtime_basics.test @@ -21,18 +21,6 @@ (use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) -(use-modules (ice-9 syncase)) -;;(use-modules (ice-9 format)) -;;(use-modules (ice-9 pretty-print)) - -;; (test-equal [name] expected test-expr) -(define-syntax test-equal - (syntax-rules () - ((_ expected test-expr) - (pass-if (equal? expected test-expr))) - ((_ name expected test-exprt) - (pass-if name (equal? expected test-expr))))) - (define (vector-map f v) (list->vector (map f (vector->list v)))) diff --git a/gnuradio-core/src/guile/00_runtime_ctors.test b/gnuradio-core/src/guile/00_runtime_ctors.test index 339601bf1..e0a946ab9 100644 --- a/gnuradio-core/src/guile/00_runtime_ctors.test +++ b/gnuradio-core/src/guile/00_runtime_ctors.test @@ -1,3 +1,4 @@ +;;; -*- Scheme -*- ;;; ;;; Copyright 2010 Free Software Foundation, Inc. ;;; @@ -17,10 +18,13 @@ ;;; along with this program. If not, see . ;;; +;;; If you're using Emacs's Scheme mode: +;;; (put 'with-test-prefix 'scheme-indent-function 1) + +(use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) -(load-from-path "srfi/srfi-64") ; unit test library ;;; Add test code for all constructors in these files ;;; diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index bbb36794e..71ce29067 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -36,16 +36,16 @@ nobase_guile_DATA = \ gnuradio/core.scm \ gnuradio/export-safely.scm \ gnuradio/runtime-shim.scm \ - srfi/srfi-64.scm + gnuradio/test-suite/guile-test \ + gnuradio/test-suite/lib.scm -# noinst_DATA = \ -# qa_0000_basics.scm \ -# qa_0010_ctor_filter.scm \ -# qa_0010_ctor_general.scm \ -# qa_0010_ctor_gengen.scm \ -# qa_0010_ctor_hier.scm \ -# qa_0010_ctor_io.scm \ -# qa_0010_ctor_runtime.scm -# +noinst_DATA = \ + 00_runtime_basics.test \ + 00_runtime_ctors.test \ + filter_ctors.test \ + general_ctors.test \ + gengen_ctors.test \ + hier_ctors.test \ + io_ctors.test -CLEANFILES = qa_*.log +CLEANFILES = guile.log diff --git a/gnuradio-core/src/guile/filter_ctors.test b/gnuradio-core/src/guile/filter_ctors.test index 0dd539a8e..040b8ba10 100644 --- a/gnuradio-core/src/guile/filter_ctors.test +++ b/gnuradio-core/src/guile/filter_ctors.test @@ -1,3 +1,4 @@ +;;; -*- Scheme -*- ;;; ;;; Copyright 2010 Free Software Foundation, Inc. ;;; @@ -17,11 +18,13 @@ ;;; along with this program. If not, see . ;;; +;;; If you're using Emacs's Scheme mode: +;;; (put 'with-test-prefix 'scheme-indent-function 1) + +(use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) -(load-from-path "srfi/srfi-64") ; unit test library - ;;; Add test code for all constructors in these files ;;; ;;; ./filter/gr_adaptive_fir_ccf.h diff --git a/gnuradio-core/src/guile/general_ctors.test b/gnuradio-core/src/guile/general_ctors.test index 1531a59de..8d272f768 100644 --- a/gnuradio-core/src/guile/general_ctors.test +++ b/gnuradio-core/src/guile/general_ctors.test @@ -1,3 +1,4 @@ +;;; -*- Scheme -*- ;;; ;;; Copyright 2010 Free Software Foundation, Inc. ;;; @@ -17,11 +18,13 @@ ;;; along with this program. If not, see . ;;; +;;; If you're using Emacs's Scheme mode: +;;; (put 'with-test-prefix 'scheme-indent-function 1) + +(use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) -(load-from-path "srfi/srfi-64") ; unit test library - ;;; Add test code for all constructors in these files ;;; ;;; ./general/gr_additive_scrambler_bb.h diff --git a/gnuradio-core/src/guile/gengen_ctors.test b/gnuradio-core/src/guile/gengen_ctors.test index 8e9c509e8..652556d3f 100644 --- a/gnuradio-core/src/guile/gengen_ctors.test +++ b/gnuradio-core/src/guile/gengen_ctors.test @@ -1,3 +1,4 @@ +;;; -*- Scheme -*- ;;; ;;; Copyright 2010 Free Software Foundation, Inc. ;;; @@ -17,11 +18,13 @@ ;;; along with this program. If not, see . ;;; +;;; If you're using Emacs's Scheme mode: +;;; (put 'with-test-prefix 'scheme-indent-function 1) + +(use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) -(load-from-path "srfi/srfi-64") ; unit test library - ;;; Add test code for all constructors in these files ;;; ;;; ./gengen/gr_add_cc.h diff --git a/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm b/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm index 272fe2f10..b7046a8b0 100644 --- a/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm +++ b/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm @@ -19,6 +19,7 @@ (define-module (gnuradio test-suite lib) :use-module (ice-9 stack-catch) :use-module (ice-9 regex) + :use-module (ice-9 syncase) :export ( ;; Exceptions which are commonly being tested for. @@ -50,7 +51,13 @@ make-count-reporter print-counts make-log-reporter full-reporter - user-reporter)) + user-reporter + + ;; srfi-64 compatibility macros + test-equal + test-eqv + test-eq +)) ;;;; If you're using Emacs's Scheme mode: @@ -557,3 +564,29 @@ (apply full-reporter result name args))) (set! default-reporter full-reporter) + + +;;; Macros for a bit of compatibility with srfi-64 +;;; (test-equal [name] expected test-expr) +(define-syntax test-equal + (syntax-rules () + ((_ expected test-expr) + (pass-if (equal? expected test-expr))) + ((_ name expected test-exprt) + (pass-if name (equal? expected test-expr))))) + +;;; (test-eqv [name] expected test-expr) +(define-syntax test-eqv + (syntax-rules () + ((_ expected test-expr) + (pass-if (eqv? expected test-expr))) + ((_ name expected test-exprt) + (pass-if name (eqv? expected test-expr))))) + +;;; (test-eq [name] expected test-expr) +(define-syntax test-eq + (syntax-rules () + ((_ expected test-expr) + (pass-if (eq? expected test-expr))) + ((_ name expected test-exprt) + (pass-if name (eq? expected test-expr))))) diff --git a/gnuradio-core/src/guile/hier_ctors.test b/gnuradio-core/src/guile/hier_ctors.test index 14d3f4119..c297fb9dd 100644 --- a/gnuradio-core/src/guile/hier_ctors.test +++ b/gnuradio-core/src/guile/hier_ctors.test @@ -1,3 +1,4 @@ +;;; -*- Scheme -*- ;;; ;;; Copyright 2010 Free Software Foundation, Inc. ;;; @@ -17,11 +18,13 @@ ;;; along with this program. If not, see . ;;; +;;; If you're using Emacs's Scheme mode: +;;; (put 'with-test-prefix 'scheme-indent-function 1) + +(use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) -(load-from-path "srfi/srfi-64") ; unit test library - ;;; Add test code for all constructors in these files ;;; ;;; ./hier/gr_channel_model.h diff --git a/gnuradio-core/src/guile/io_ctors.test b/gnuradio-core/src/guile/io_ctors.test index 95f231091..2001e5fa5 100644 --- a/gnuradio-core/src/guile/io_ctors.test +++ b/gnuradio-core/src/guile/io_ctors.test @@ -1,3 +1,4 @@ +;;; -*- Scheme -*- ;;; ;;; Copyright 2010 Free Software Foundation, Inc. ;;; @@ -17,11 +18,13 @@ ;;; along with this program. If not, see . ;;; +;;; If you're using Emacs's Scheme mode: +;;; (put 'with-test-prefix 'scheme-indent-function 1) + +(use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) -(load-from-path "srfi/srfi-64") ; unit test library - ;;; Add test code for all constructors in these files ;;; ;;; ./io/gr_file_descriptor_sink.h -- cgit From f4959dce1e5ec6b61c10df489c2421d56963beb3 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 7 Nov 2010 16:02:24 -0800 Subject: guile-test -> guile-test.in so we can use @GUILE@ --- gnuradio-core/src/guile/.gitignore | 1 + gnuradio-core/src/guile/Makefile.am | 4 +- .../src/guile/gnuradio/test-suite/guile-test | 241 --------------------- .../src/guile/gnuradio/test-suite/guile-test.in | 241 +++++++++++++++++++++ 4 files changed, 245 insertions(+), 242 deletions(-) delete mode 100755 gnuradio-core/src/guile/gnuradio/test-suite/guile-test create mode 100755 gnuradio-core/src/guile/gnuradio/test-suite/guile-test.in (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/.gitignore b/gnuradio-core/src/guile/.gitignore index 82a29a907..bc212f566 100644 --- a/gnuradio-core/src/guile/.gitignore +++ b/gnuradio-core/src/guile/.gitignore @@ -2,3 +2,4 @@ /Makefile.in /run_guile_tests /guile.log +/gnuradio/test-suite/guile-test diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index 71ce29067..d7fdbce60 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -22,7 +22,9 @@ include $(top_srcdir)/Makefile.common TESTS = run_guile_tests EXTRA_DIST = \ - run_guile_tests.in + run_guile_tests.in \ + gnuradio/test-suite/guile-test.in + # These are the hand-code guile files for gnuradio-core. # diff --git a/gnuradio-core/src/guile/gnuradio/test-suite/guile-test b/gnuradio-core/src/guile/gnuradio/test-suite/guile-test deleted file mode 100755 index 6dc1a9658..000000000 --- a/gnuradio-core/src/guile/gnuradio/test-suite/guile-test +++ /dev/null @@ -1,241 +0,0 @@ -#!/usr/bin/guile \ --e main -s -!# - -;;;; guile-test --- run the Guile test suite -;;;; Jim Blandy --- May 1999 -;;;; -;;;; Copyright (C) 1999, 2001, 2006 Free Software Foundation, Inc. -;;;; -;;;; This program 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 2, or (at your option) -;;;; any later version. -;;;; -;;;; This program 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 software; see the file COPYING. If not, write to -;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;;;; Boston, MA 02110-1301 USA - - -;;;; Usage: [guile -e main -s] guile-test [OPTIONS] [TEST ...] -;;;; -;;;; Run tests from the Guile test suite. Report failures and -;;;; unexpected passes to the standard output, along with a summary of -;;;; all the results. Record each reported test outcome in the log -;;;; file, `guile.log'. The exit status is #f if any of the tests -;;;; fail or pass unexpectedly. -;;;; -;;;; Normally, guile-test scans the test directory, and executes all -;;;; files whose names end in `.test'. (It assumes they contain -;;;; Scheme code.) However, you can have it execute specific tests by -;;;; listing their filenames on the command line. -;;;; -;;;; The option `--test-suite' can be given to specify the test -;;;; directory. If no such option is given, the test directory is -;;;; taken from the environment variable TEST_SUITE_DIR (if defined), -;;;; otherwise a default directory that is hardcoded in this file is -;;;; used (see "Installation" below). -;;;; -;;;; If present, the `--log-file LOG' option tells `guile-test' to put -;;;; the log output in a file named LOG. -;;;; -;;;; If present, the `--debug' option will enable a debugging mode. -;;;; -;;;; If present, the `--flag-unresolved' option will cause guile-test -;;;; to exit with failure status if any tests are UNRESOLVED. -;;;; -;;;; -;;;; Installation: -;;;; -;;;; If you change the #! line at the top of this script to point at -;;;; the Guile interpreter you want to test, you can call this script -;;;; as an executable instead of having to pass it as a parameter to -;;;; guile via "guile -e main -s guile-test". Further, you can edit -;;;; the definition of default-test-suite to point to the parent -;;;; directory of the `tests' tree, which makes it unnecessary to set -;;;; the environment variable `TEST_SUITE_DIR'. -;;;; -;;;; -;;;; Shortcomings: -;;;; -;;;; At the moment, due to a simple-minded implementation, test files -;;;; must live in the test directory, and you must specify their names -;;;; relative to the top of the test directory. If you want to send -;;;; me a patch that fixes this, but still leaves sane test names in -;;;; the log file, that would be great. At the moment, all the tests -;;;; I care about are in the test directory, though. -;;;; -;;;; It would be nice if you could specify the Guile interpreter you -;;;; want to test on the command line. As it stands, if you want to -;;;; change which Guile interpreter you're testing, you need to edit -;;;; the #! line at the top of this file, which is stupid. - -(define (main . args) - (let ((module (resolve-module '(gnuradio test-suite guile-test)))) - (apply (module-ref module 'main) args))) - -(define-module (gnuradio test-suite guile-test) - :use-module (gnuradio test-suite lib) - :use-module (ice-9 getopt-long) - :use-module (ice-9 and-let-star) - :use-module (ice-9 rdelim) - :export (main data-file-name test-file-name)) - - -;;; User configurable settings: -(define default-test-suite - (string-append (getenv "HOME") "/bogus-path/test-suite")) - - -;;; Variables that will receive their actual values later. -(define test-suite default-test-suite) - -(define tmp-dir #f) - - -;;; General utilities, that probably should be in a library somewhere. - -;;; Enable debugging -(define (enable-debug-mode) - (write-line %load-path) - (set! %load-verbosely #t) - (debug-enable 'backtrace 'debug)) - -;;; Traverse the directory tree at ROOT, applying F to the name of -;;; each file in the tree, including ROOT itself. For a subdirectory -;;; SUB, if (F SUB) is true, we recurse into SUB. Do not follow -;;; symlinks. -(define (for-each-file f root) - - ;; A "hard directory" is a path that denotes a directory and is not a - ;; symlink. - (define (file-is-hard-directory? filename) - (eq? (stat:type (lstat filename)) 'directory)) - - (let visit ((root root)) - (let ((should-recur (f root))) - (if (and should-recur (file-is-hard-directory? root)) - (let ((dir (opendir root))) - (let loop () - (let ((entry (readdir dir))) - (cond - ((eof-object? entry) #f) - ((or (string=? entry ".") - (string=? entry "..") - (string=? entry "CVS") - (string=? entry "RCS")) - (loop)) - (else - (visit (string-append root "/" entry)) - (loop)))))))))) - - -;;; The test driver. - - -;;; Localizing test files and temporary data files. - -(define (data-file-name filename) - (in-vicinity tmp-dir filename)) - -(define (test-file-name test) - (in-vicinity test-suite test)) - -;;; Return a list of all the test files in the test tree. -(define (enumerate-tests test-dir) - (let ((root-len (+ 1 (string-length test-dir))) - (tests '())) - (for-each-file (lambda (file) - (if (has-suffix? file ".test") - (let ((short-name - (substring file root-len))) - (set! tests (cons short-name tests)))) - #t) - test-dir) - - ;; for-each-file presents the files in whatever order it finds - ;; them in the directory. We sort them here, so they'll always - ;; appear in the same order. This makes it easier to compare test - ;; log files mechanically. - (sort tests string --- May 1999 +;;;; +;;;; Copyright (C) 1999, 2001, 2006 Free Software Foundation, Inc. +;;;; +;;;; This program 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 2, or (at your option) +;;;; any later version. +;;;; +;;;; This program 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 software; see the file COPYING. If not, write to +;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;;;; Boston, MA 02110-1301 USA + + +;;;; Usage: [guile -e main -s] guile-test [OPTIONS] [TEST ...] +;;;; +;;;; Run tests from the Guile test suite. Report failures and +;;;; unexpected passes to the standard output, along with a summary of +;;;; all the results. Record each reported test outcome in the log +;;;; file, `guile.log'. The exit status is #f if any of the tests +;;;; fail or pass unexpectedly. +;;;; +;;;; Normally, guile-test scans the test directory, and executes all +;;;; files whose names end in `.test'. (It assumes they contain +;;;; Scheme code.) However, you can have it execute specific tests by +;;;; listing their filenames on the command line. +;;;; +;;;; The option `--test-suite' can be given to specify the test +;;;; directory. If no such option is given, the test directory is +;;;; taken from the environment variable TEST_SUITE_DIR (if defined), +;;;; otherwise a default directory that is hardcoded in this file is +;;;; used (see "Installation" below). +;;;; +;;;; If present, the `--log-file LOG' option tells `guile-test' to put +;;;; the log output in a file named LOG. +;;;; +;;;; If present, the `--debug' option will enable a debugging mode. +;;;; +;;;; If present, the `--flag-unresolved' option will cause guile-test +;;;; to exit with failure status if any tests are UNRESOLVED. +;;;; +;;;; +;;;; Installation: +;;;; +;;;; If you change the #! line at the top of this script to point at +;;;; the Guile interpreter you want to test, you can call this script +;;;; as an executable instead of having to pass it as a parameter to +;;;; guile via "guile -e main -s guile-test". Further, you can edit +;;;; the definition of default-test-suite to point to the parent +;;;; directory of the `tests' tree, which makes it unnecessary to set +;;;; the environment variable `TEST_SUITE_DIR'. +;;;; +;;;; +;;;; Shortcomings: +;;;; +;;;; At the moment, due to a simple-minded implementation, test files +;;;; must live in the test directory, and you must specify their names +;;;; relative to the top of the test directory. If you want to send +;;;; me a patch that fixes this, but still leaves sane test names in +;;;; the log file, that would be great. At the moment, all the tests +;;;; I care about are in the test directory, though. +;;;; +;;;; It would be nice if you could specify the Guile interpreter you +;;;; want to test on the command line. As it stands, if you want to +;;;; change which Guile interpreter you're testing, you need to edit +;;;; the #! line at the top of this file, which is stupid. + +(define (main . args) + (let ((module (resolve-module '(gnuradio test-suite guile-test)))) + (apply (module-ref module 'main) args))) + +(define-module (gnuradio test-suite guile-test) + :use-module (gnuradio test-suite lib) + :use-module (ice-9 getopt-long) + :use-module (ice-9 and-let-star) + :use-module (ice-9 rdelim) + :export (main data-file-name test-file-name)) + + +;;; User configurable settings: +(define default-test-suite + (string-append (getenv "HOME") "/bogus-path/test-suite")) + + +;;; Variables that will receive their actual values later. +(define test-suite default-test-suite) + +(define tmp-dir #f) + + +;;; General utilities, that probably should be in a library somewhere. + +;;; Enable debugging +(define (enable-debug-mode) + (write-line %load-path) + (set! %load-verbosely #t) + (debug-enable 'backtrace 'debug)) + +;;; Traverse the directory tree at ROOT, applying F to the name of +;;; each file in the tree, including ROOT itself. For a subdirectory +;;; SUB, if (F SUB) is true, we recurse into SUB. Do not follow +;;; symlinks. +(define (for-each-file f root) + + ;; A "hard directory" is a path that denotes a directory and is not a + ;; symlink. + (define (file-is-hard-directory? filename) + (eq? (stat:type (lstat filename)) 'directory)) + + (let visit ((root root)) + (let ((should-recur (f root))) + (if (and should-recur (file-is-hard-directory? root)) + (let ((dir (opendir root))) + (let loop () + (let ((entry (readdir dir))) + (cond + ((eof-object? entry) #f) + ((or (string=? entry ".") + (string=? entry "..") + (string=? entry "CVS") + (string=? entry "RCS")) + (loop)) + (else + (visit (string-append root "/" entry)) + (loop)))))))))) + + +;;; The test driver. + + +;;; Localizing test files and temporary data files. + +(define (data-file-name filename) + (in-vicinity tmp-dir filename)) + +(define (test-file-name test) + (in-vicinity test-suite test)) + +;;; Return a list of all the test files in the test tree. +(define (enumerate-tests test-dir) + (let ((root-len (+ 1 (string-length test-dir))) + (tests '())) + (for-each-file (lambda (file) + (if (has-suffix? file ".test") + (let ((short-name + (substring file root-len))) + (set! tests (cons short-name tests)))) + #t) + test-dir) + + ;; for-each-file presents the files in whatever order it finds + ;; them in the directory. We sort them here, so they'll always + ;; appear in the same order. This makes it easier to compare test + ;; log files mechanically. + (sort tests string. -;;; - -(use-modules (gnuradio test-suite lib)) -(use-modules (gnuradio core)) -(use-modules (oop goops)) - -(define (vector-map f v) - (list->vector (map f (vector->list v)))) - - -(with-test-prefix "test-connect-1" - (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) - (expected-result (vector-map (lambda (x) (* x 2)) src-data)) - (tb (gr:top-block-swig "QA top block")) - (src (gr:vector-source-i src-data #f)) - (op (gr:multiply-const-ii 2)) - (dst (gr:vector-sink-i))) - - ;; using gr:ep to create endpoints - (gr:connect tb (gr:ep src 0) (gr:ep op 0)) - (gr:connect tb (gr:ep op 0) (gr:ep dst 0)) - - (gr:run tb) - ;;(pass-if (equal? expected-result (gr:data dst))) - (test-equal expected-result (gr:data dst)) - )) - -(with-test-prefix "test-connect-2" - (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) - (expected-result (vector-map (lambda (x) (* x 2)) src-data)) - (tb (gr:top-block-swig "QA top block")) - (src (gr:vector-source-i src-data #f)) - (op (gr:multiply-const-ii 2)) - (dst (gr:vector-sink-i))) - - ;; using just blocks - (gr:connect tb src op) - (gr:connect tb op dst) - - (gr:run tb) - (test-equal expected-result (gr:data dst)))) - - -(with-test-prefix "test-connect-3" - (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) - (expected-result (vector-map (lambda (x) (* x 2)) src-data)) - (tb (gr:top-block-swig "QA top block")) - (src (gr:vector-source-i src-data #f)) - (op (gr:multiply-const-ii 2)) - (dst (gr:vector-sink-i))) - - ;; using lists to represent endpoints - (gr:connect tb `(,src 0) `(,op 0)) - (gr:connect tb `(,op 0) `(,dst 0)) - - (gr:run tb) - (test-equal expected-result (gr:data dst)))) - - -(with-test-prefix "test-connect-4" - (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) - (expected-result (vector-map (lambda (x) (* x 2)) src-data)) - (tb (gr:top-block-swig "QA top block")) - (src (gr:vector-source-i src-data #f)) - (op (gr:multiply-const-ii 2)) - (dst (gr:vector-sink-i))) - - ;; using multiple endpoints - (gr:connect tb src op dst) - - (gr:run tb) - (test-equal expected-result (gr:data dst)))) - - -(with-test-prefix "test-io-signature-1" - (let ((ios1 (gr:io-signature 1 2 8)) - (ios2 (gr:io-signature2 1 2 16 32)) - (ios3 (gr:io-signature3 1 -1 14 32 48)) - (iosv (gr:io-signaturev 1 4 '(1 2 3)))) - - (test-equal 1 (gr:min-streams ios1)) - (test-equal 2 (gr:max-streams ios1)) - (test-equal 8 (gr:sizeof-stream-item ios1 0)) - (test-equal 8 (gr:sizeof-stream-item ios1 1)) - - (test-equal 1 (gr:min-streams ios2)) - (test-equal 2 (gr:max-streams ios2)) - (test-equal 16 (gr:sizeof-stream-item ios2 0)) - (test-equal 32 (gr:sizeof-stream-item ios2 1)) - - (test-equal 1 (gr:min-streams ios3)) - (test-equal -1 (gr:max-streams ios3)) - (test-equal 14 (gr:sizeof-stream-item ios3 0)) - (test-equal 32 (gr:sizeof-stream-item ios3 1)) - (test-equal 48 (gr:sizeof-stream-item ios3 2)) - (test-equal '#(14 32 48) (gr:sizeof-stream-items ios3)) - - (test-equal 1 (gr:min-streams iosv)) - (test-equal 4 (gr:max-streams iosv)) - (test-equal 1 (gr:sizeof-stream-item iosv 0)) - (test-equal 2 (gr:sizeof-stream-item iosv 1)) - (test-equal 3 (gr:sizeof-stream-item iosv 2)) - (test-equal 3 (gr:sizeof-stream-item iosv 3)) - (test-equal '#(1 2 3) (gr:sizeof-stream-items iosv)) - )) - diff --git a/gnuradio-core/src/guile/00_runtime_ctors.test b/gnuradio-core/src/guile/00_runtime_ctors.test deleted file mode 100644 index e0a946ab9..000000000 --- a/gnuradio-core/src/guile/00_runtime_ctors.test +++ /dev/null @@ -1,32 +0,0 @@ -;;; -*- Scheme -*- -;;; -;;; 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 . -;;; - -;;; If you're using Emacs's Scheme mode: -;;; (put 'with-test-prefix 'scheme-indent-function 1) - -(use-modules (gnuradio test-suite lib)) -(use-modules (gnuradio core)) -(use-modules (oop goops)) - - -;;; Add test code for all constructors in these files -;;; -;;; ./runtime/gr_hier_block2.h -;;; ./runtime/gr_msg_queue.h diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index d7fdbce60..f3c02a446 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -42,12 +42,12 @@ nobase_guile_DATA = \ gnuradio/test-suite/lib.scm noinst_DATA = \ - 00_runtime_basics.test \ - 00_runtime_ctors.test \ - filter_ctors.test \ - general_ctors.test \ - gengen_ctors.test \ - hier_ctors.test \ - io_ctors.test + tests/00_runtime_basics.test \ + tests/00_runtime_ctors.test \ + tests/filter_ctors.test \ + tests/general_ctors.test \ + tests/gengen_ctors.test \ + tests/hier_ctors.test \ + tests/io_ctors.test CLEANFILES = guile.log diff --git a/gnuradio-core/src/guile/filter_ctors.test b/gnuradio-core/src/guile/filter_ctors.test deleted file mode 100644 index 040b8ba10..000000000 --- a/gnuradio-core/src/guile/filter_ctors.test +++ /dev/null @@ -1,95 +0,0 @@ -;;; -*- Scheme -*- -;;; -;;; 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 . -;;; - -;;; If you're using Emacs's Scheme mode: -;;; (put 'with-test-prefix 'scheme-indent-function 1) - -(use-modules (gnuradio test-suite lib)) -(use-modules (gnuradio core)) -(use-modules (oop goops)) - -;;; Add test code for all constructors in these files -;;; -;;; ./filter/gr_adaptive_fir_ccf.h -;;; ./filter/gr_cma_equalizer_cc.h -;;; ./filter/gr_fft_filter_ccc.h -;;; ./filter/gr_fft_filter_fff.h -;;; ./filter/gr_filter_delay_fc.h -;;; ./filter/gr_fir_ccc_generic.h -;;; ./filter/gr_fir_ccc_simd.h -;;; ./filter/gr_fir_ccc_x86.h -;;; ./filter/gr_fir_ccf_generic.h -;;; ./filter/gr_fir_ccf_simd.h -;;; ./filter/gr_fir_ccf_x86.h -;;; ./filter/gr_fir_fcc_generic.h -;;; ./filter/gr_fir_fcc_simd.h -;;; ./filter/gr_fir_fcc_x86.h -;;; ./filter/gr_fir_fff_altivec.h -;;; ./filter/gr_fir_fff_armv7_a.h -;;; ./filter/gr_fir_fff_generic.h -;;; ./filter/gr_fir_fff_simd.h -;;; ./filter/gr_fir_fff_x86.h -;;; ./filter/gr_fir_filter_ccc.h -;;; ./filter/gr_fir_filter_ccf.h -;;; ./filter/gr_fir_filter_fcc.h -;;; ./filter/gr_fir_filter_fff.h -;;; ./filter/gr_fir_filter_fsf.h -;;; ./filter/gr_fir_filter_scc.h -;;; ./filter/gr_fir_fsf_generic.h -;;; ./filter/gr_fir_fsf_simd.h -;;; ./filter/gr_fir_fsf_x86.h -;;; ./filter/gr_fir_scc_generic.h -;;; ./filter/gr_fir_scc_simd.h -;;; ./filter/gr_fir_scc_x86.h -;;; ./filter/gr_fir_sysconfig_armv7_a.h -;;; ./filter/gr_fir_sysconfig_generic.h -;;; ./filter/gr_fir_sysconfig_powerpc.h -;;; ./filter/gr_fir_sysconfig_x86.h -;;; ./filter/gr_fractional_interpolator_cc.h -;;; ./filter/gr_fractional_interpolator_ff.h -;;; ./filter/gr_freq_xlating_fir_filter_ccc.h -;;; ./filter/gr_freq_xlating_fir_filter_ccf.h -;;; ./filter/gr_freq_xlating_fir_filter_fcc.h -;;; ./filter/gr_freq_xlating_fir_filter_fcf.h -;;; ./filter/gr_freq_xlating_fir_filter_scc.h -;;; ./filter/gr_freq_xlating_fir_filter_scf.h -;;; ./filter/gr_goertzel_fc.h -;;; ./filter/gr_hilbert_fc.h -;;; ./filter/gr_iir_filter_ffd.h -;;; ./filter/gr_interp_fir_filter_ccc.h -;;; ./filter/gr_interp_fir_filter_ccf.h -;;; ./filter/gr_interp_fir_filter_fcc.h -;;; ./filter/gr_interp_fir_filter_fff.h -;;; ./filter/gr_interp_fir_filter_fsf.h -;;; ./filter/gr_interp_fir_filter_scc.h -;;; ./filter/gr_pfb_arb_resampler_ccf.h -;;; ./filter/gr_pfb_channelizer_ccf.h -;;; ./filter/gr_pfb_clock_sync_ccf.h -;;; ./filter/gr_pfb_clock_sync_fff.h -;;; ./filter/gr_pfb_decimator_ccf.h -;;; ./filter/gr_pfb_interpolator_ccf.h -;;; ./filter/gr_rational_resampler_base_ccc.h -;;; ./filter/gr_rational_resampler_base_ccf.h -;;; ./filter/gr_rational_resampler_base_fcc.h -;;; ./filter/gr_rational_resampler_base_fff.h -;;; ./filter/gr_rational_resampler_base_fsf.h -;;; ./filter/gr_rational_resampler_base_scc.h -;;; ./filter/gr_single_pole_iir_filter_cc.h -;;; ./filter/gr_single_pole_iir_filter_ff.h diff --git a/gnuradio-core/src/guile/general_ctors.test b/gnuradio-core/src/guile/general_ctors.test deleted file mode 100644 index 8d272f768..000000000 --- a/gnuradio-core/src/guile/general_ctors.test +++ /dev/null @@ -1,146 +0,0 @@ -;;; -*- Scheme -*- -;;; -;;; 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 . -;;; - -;;; If you're using Emacs's Scheme mode: -;;; (put 'with-test-prefix 'scheme-indent-function 1) - -(use-modules (gnuradio test-suite lib)) -(use-modules (gnuradio core)) -(use-modules (oop goops)) - -;;; Add test code for all constructors in these files -;;; -;;; ./general/gr_additive_scrambler_bb.h -;;; ./general/gr_agc2_cc.h -;;; ./general/gr_agc2_ff.h -;;; ./general/gr_agc_cc.h -;;; ./general/gr_agc_ff.h -;;; ./general/gr_align_on_samplenumbers_ss.h -;;; ./general/gr_bin_statistics_f.h -;;; ./general/gr_binary_slicer_fb.h -;;; ./general/gr_bytes_to_syms.h -;;; ./general/gr_char_to_float.h -;;; ./general/gr_check_counting_s.h -;;; ./general/gr_check_lfsr_32k_s.h -;;; ./general/gr_clock_recovery_mm_cc.h -;;; ./general/gr_clock_recovery_mm_ff.h -;;; ./general/gr_complex_to_interleaved_short.h -;;; ./general/gr_complex_to_xxx.h -;;; ./general/gr_conjugate_cc.h -;;; ./general/gr_constellation_decoder_cb.h -;;; ./general/gr_copy.h -;;; ./general/gr_correlate_access_code_bb.h -;;; ./general/gr_costas_loop_cc.h -;;; ./general/gr_cpfsk_bc.h -;;; ./general/gr_ctcss_squelch_ff.h -;;; ./general/gr_decode_ccsds_27_fb.h -;;; ./general/gr_deinterleave.h -;;; ./general/gr_delay.h -;;; ./general/gr_descrambler_bb.h -;;; ./general/gr_diff_decoder_bb.h -;;; ./general/gr_diff_encoder_bb.h -;;; ./general/gr_diff_phasor_cc.h -;;; ./general/gr_dpll_bb.h -;;; ./general/gr_encode_ccsds_27_bb.h -;;; ./general/gr_fake_channel_coder_pp.h -;;; ./general/gr_feedforward_agc_cc.h -;;; ./general/gr_fft_vcc.h -;;; ./general/gr_fft_vcc_fftw.h -;;; ./general/gr_fft_vfc.h -;;; ./general/gr_fll_band_edge_cc.h -;;; ./general/gr_float_to_char.h -;;; ./general/gr_float_to_complex.h -;;; ./general/gr_float_to_short.h -;;; ./general/gr_float_to_uchar.h -;;; ./general/gr_fmdet_cf.h -;;; ./general/gr_framer_sink_1.h -;;; ./general/gr_frequency_modulator_fc.h -;;; ./general/gr_glfsr_source_b.h -;;; ./general/gr_glfsr_source_f.h -;;; ./general/gr_head.h -;;; ./general/gr_interleave.h -;;; ./general/gr_interleaved_short_to_complex.h -;;; ./general/gr_iqcomp_cc.h -;;; ./general/gr_keep_one_in_n.h -;;; ./general/gr_kludge_copy.h -;;; ./general/gr_lfsr_32k_source_s.h -;;; ./general/gr_lms_dfe_cc.h -;;; ./general/gr_lms_dfe_ff.h -;;; ./general/gr_map_bb.h -;;; ./general/gr_mpsk_receiver_cc.h -;;; ./general/gr_nlog10_ff.h -;;; ./general/gr_nop.h -;;; ./general/gr_null_sink.h -;;; ./general/gr_null_source.h -;;; ./general/gr_ofdm_bpsk_demapper.h -;;; ./general/gr_ofdm_cyclic_prefixer.h -;;; ./general/gr_ofdm_demapper_vcb.h -;;; ./general/gr_ofdm_frame_acquisition.h -;;; ./general/gr_ofdm_frame_sink.h -;;; ./general/gr_ofdm_insert_preamble.h -;;; ./general/gr_ofdm_mapper_bcv.h -;;; ./general/gr_ofdm_sampler.h -;;; ./general/gr_pa_2x2_phase_combiner.h -;;; ./general/gr_packet_sink.h -;;; ./general/gr_peak_detector2_fb.h -;;; ./general/gr_phase_modulator_fc.h -;;; ./general/gr_pll_carriertracking_cc.h -;;; ./general/gr_pll_freqdet_cf.h -;;; ./general/gr_pll_refout_cc.h -;;; ./general/gr_pn_correlator_cc.h -;;; ./general/gr_probe_avg_mag_sqrd_c.h -;;; ./general/gr_probe_avg_mag_sqrd_cf.h -;;; ./general/gr_probe_avg_mag_sqrd_f.h -;;; ./general/gr_probe_density_b.h -;;; ./general/gr_probe_mpsk_snr_c.h -;;; ./general/gr_probe_signal_f.h -;;; ./general/gr_pwr_squelch_cc.h -;;; ./general/gr_pwr_squelch_ff.h -;;; ./general/gr_quadrature_demod_cf.h -;;; ./general/gr_rail_ff.h -;;; ./general/gr_regenerate_bb.h -;;; ./general/gr_repeat.h -;;; ./general/gr_rms_cf.h -;;; ./general/gr_rms_ff.h -;;; ./general/gr_scrambler_bb.h -;;; ./general/gr_short_to_float.h -;;; ./general/gr_simple_correlator.h -;;; ./general/gr_simple_framer.h -;;; ./general/gr_simple_squelch_cc.h -;;; ./general/gr_skiphead.h -;;; ./general/gr_squash_ff.h -;;; ./general/gr_squelch_base_cc.h -;;; ./general/gr_squelch_base_ff.h -;;; ./general/gr_stream_mux.h -;;; ./general/gr_stream_to_streams.h -;;; ./general/gr_stream_to_vector.h -;;; ./general/gr_streams_to_stream.h -;;; ./general/gr_streams_to_vector.h -;;; ./general/gr_stretch_ff.h -;;; ./general/gr_test.h -;;; ./general/gr_threshold_ff.h -;;; ./general/gr_throttle.h -;;; ./general/gr_uchar_to_float.h -;;; ./general/gr_unpack_k_bits_bb.h -;;; ./general/gr_vco_f.h -;;; ./general/gr_vector_to_stream.h -;;; ./general/gr_vector_to_streams.h -;;; ./general/gr_wavelet_ff.h -;;; ./general/gr_wvps_ff.h diff --git a/gnuradio-core/src/guile/gengen_ctors.test b/gnuradio-core/src/guile/gengen_ctors.test deleted file mode 100644 index 652556d3f..000000000 --- a/gnuradio-core/src/guile/gengen_ctors.test +++ /dev/null @@ -1,132 +0,0 @@ -;;; -*- Scheme -*- -;;; -;;; 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 . -;;; - -;;; If you're using Emacs's Scheme mode: -;;; (put 'with-test-prefix 'scheme-indent-function 1) - -(use-modules (gnuradio test-suite lib)) -(use-modules (gnuradio core)) -(use-modules (oop goops)) - -;;; Add test code for all constructors in these files -;;; -;;; ./gengen/gr_add_cc.h -;;; ./gengen/gr_add_const_cc.h -;;; ./gengen/gr_add_const_ff.h -;;; ./gengen/gr_add_const_ii.h -;;; ./gengen/gr_add_const_sf.h -;;; ./gengen/gr_add_const_ss.h -;;; ./gengen/gr_add_const_vcc.h -;;; ./gengen/gr_add_const_vff.h -;;; ./gengen/gr_add_const_vii.h -;;; ./gengen/gr_add_const_vss.h -;;; ./gengen/gr_add_ff.h -;;; ./gengen/gr_add_ii.h -;;; ./gengen/gr_add_ss.h -;;; ./gengen/gr_and_bb.h -;;; ./gengen/gr_and_const_bb.h -;;; ./gengen/gr_and_const_ii.h -;;; ./gengen/gr_and_const_ss.h -;;; ./gengen/gr_and_ii.h -;;; ./gengen/gr_and_ss.h -;;; ./gengen/gr_argmax_fs.h -;;; ./gengen/gr_argmax_is.h -;;; ./gengen/gr_argmax_ss.h -;;; ./gengen/gr_chunks_to_symbols_bc.h -;;; ./gengen/gr_chunks_to_symbols_bf.h -;;; ./gengen/gr_chunks_to_symbols_ic.h -;;; ./gengen/gr_chunks_to_symbols_if.h -;;; ./gengen/gr_chunks_to_symbols_sc.h -;;; ./gengen/gr_chunks_to_symbols_sf.h -;;; ./gengen/gr_divide_cc.h -;;; ./gengen/gr_divide_ff.h -;;; ./gengen/gr_divide_ii.h -;;; ./gengen/gr_divide_ss.h -;;; ./gengen/gr_integrate_cc.h -;;; ./gengen/gr_integrate_ff.h -;;; ./gengen/gr_integrate_ii.h -;;; ./gengen/gr_integrate_ss.h -;;; ./gengen/gr_max_ff.h -;;; ./gengen/gr_max_ii.h -;;; ./gengen/gr_max_ss.h -;;; ./gengen/gr_moving_average_cc.h -;;; ./gengen/gr_moving_average_ff.h -;;; ./gengen/gr_moving_average_ii.h -;;; ./gengen/gr_moving_average_ss.h -;;; ./gengen/gr_multiply_cc.h -;;; ./gengen/gr_multiply_const_cc.h -;;; ./gengen/gr_multiply_const_ff.h -;;; ./gengen/gr_multiply_const_ii.h -;;; ./gengen/gr_multiply_const_ss.h -;;; ./gengen/gr_multiply_const_vcc.h -;;; ./gengen/gr_multiply_const_vff.h -;;; ./gengen/gr_multiply_const_vii.h -;;; ./gengen/gr_multiply_const_vss.h -;;; ./gengen/gr_multiply_ff.h -;;; ./gengen/gr_multiply_ii.h -;;; ./gengen/gr_multiply_ss.h -;;; ./gengen/gr_mute_cc.h -;;; ./gengen/gr_mute_ff.h -;;; ./gengen/gr_mute_ii.h -;;; ./gengen/gr_mute_ss.h -;;; ./gengen/gr_noise_source_c.h -;;; ./gengen/gr_noise_source_f.h -;;; ./gengen/gr_noise_source_i.h -;;; ./gengen/gr_noise_source_s.h -;;; ./gengen/gr_not_bb.h -;;; ./gengen/gr_not_ii.h -;;; ./gengen/gr_not_ss.h -;;; ./gengen/gr_or_bb.h -;;; ./gengen/gr_or_ii.h -;;; ./gengen/gr_or_ss.h -;;; ./gengen/gr_packed_to_unpacked_bb.h -;;; ./gengen/gr_packed_to_unpacked_ii.h -;;; ./gengen/gr_packed_to_unpacked_ss.h -;;; ./gengen/gr_peak_detector_fb.h -;;; ./gengen/gr_peak_detector_ib.h -;;; ./gengen/gr_peak_detector_sb.h -;;; ./gengen/gr_sample_and_hold_bb.h -;;; ./gengen/gr_sample_and_hold_ff.h -;;; ./gengen/gr_sample_and_hold_ii.h -;;; ./gengen/gr_sample_and_hold_ss.h -;;; ./gengen/gr_sig_source_c.h -;;; ./gengen/gr_sig_source_f.h -;;; ./gengen/gr_sig_source_i.h -;;; ./gengen/gr_sig_source_s.h -;;; ./gengen/gr_sub_cc.h -;;; ./gengen/gr_sub_ff.h -;;; ./gengen/gr_sub_ii.h -;;; ./gengen/gr_sub_ss.h -;;; ./gengen/gr_unpacked_to_packed_bb.h -;;; ./gengen/gr_unpacked_to_packed_ii.h -;;; ./gengen/gr_unpacked_to_packed_ss.h -;;; ./gengen/gr_vector_sink_b.h -;;; ./gengen/gr_vector_sink_c.h -;;; ./gengen/gr_vector_sink_f.h -;;; ./gengen/gr_vector_sink_i.h -;;; ./gengen/gr_vector_sink_s.h -;;; ./gengen/gr_vector_source_b.h -;;; ./gengen/gr_vector_source_c.h -;;; ./gengen/gr_vector_source_f.h -;;; ./gengen/gr_vector_source_i.h -;;; ./gengen/gr_vector_source_s.h -;;; ./gengen/gr_xor_bb.h -;;; ./gengen/gr_xor_ii.h -;;; ./gengen/gr_xor_ss.h diff --git a/gnuradio-core/src/guile/hier_ctors.test b/gnuradio-core/src/guile/hier_ctors.test deleted file mode 100644 index c297fb9dd..000000000 --- a/gnuradio-core/src/guile/hier_ctors.test +++ /dev/null @@ -1,30 +0,0 @@ -;;; -*- Scheme -*- -;;; -;;; 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 . -;;; - -;;; If you're using Emacs's Scheme mode: -;;; (put 'with-test-prefix 'scheme-indent-function 1) - -(use-modules (gnuradio test-suite lib)) -(use-modules (gnuradio core)) -(use-modules (oop goops)) - -;;; Add test code for all constructors in these files -;;; -;;; ./hier/gr_channel_model.h diff --git a/gnuradio-core/src/guile/io_ctors.test b/gnuradio-core/src/guile/io_ctors.test deleted file mode 100644 index 2001e5fa5..000000000 --- a/gnuradio-core/src/guile/io_ctors.test +++ /dev/null @@ -1,42 +0,0 @@ -;;; -*- Scheme -*- -;;; -;;; 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 . -;;; - -;;; If you're using Emacs's Scheme mode: -;;; (put 'with-test-prefix 'scheme-indent-function 1) - -(use-modules (gnuradio test-suite lib)) -(use-modules (gnuradio core)) -(use-modules (oop goops)) - -;;; Add test code for all constructors in these files -;;; -;;; ./io/gr_file_descriptor_sink.h -;;; ./io/gr_file_descriptor_source.h -;;; ./io/gr_file_sink.h -;;; ./io/gr_file_source.h -;;; ./io/gr_histo_sink_f.h -;;; ./io/gr_message_sink.h -;;; ./io/gr_message_source.h -;;; ./io/gr_oscope_sink_f.h -;;; ./io/gr_oscope_sink_x.h -;;; ./io/gr_udp_sink.h -;;; ./io/gr_udp_source.h -;;; ./io/gr_wavfile_sink.h -;;; ./io/gr_wavfile_source.h diff --git a/gnuradio-core/src/guile/tests/00_runtime_basics.test b/gnuradio-core/src/guile/tests/00_runtime_basics.test new file mode 100644 index 000000000..c9d251268 --- /dev/null +++ b/gnuradio-core/src/guile/tests/00_runtime_basics.test @@ -0,0 +1,124 @@ +;;; -*- Scheme -*- +;;; +;;; 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 . +;;; + +(use-modules (gnuradio test-suite lib)) +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +(define (vector-map f v) + (list->vector (map f (vector->list v)))) + + +(with-test-prefix "test-connect-1" + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + (expected-result (vector-map (lambda (x) (* x 2)) src-data)) + (tb (gr:top-block-swig "QA top block")) + (src (gr:vector-source-i src-data #f)) + (op (gr:multiply-const-ii 2)) + (dst (gr:vector-sink-i))) + + ;; using gr:ep to create endpoints + (gr:connect tb (gr:ep src 0) (gr:ep op 0)) + (gr:connect tb (gr:ep op 0) (gr:ep dst 0)) + + (gr:run tb) + ;;(pass-if (equal? expected-result (gr:data dst))) + (test-equal expected-result (gr:data dst)) + )) + +(with-test-prefix "test-connect-2" + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + (expected-result (vector-map (lambda (x) (* x 2)) src-data)) + (tb (gr:top-block-swig "QA top block")) + (src (gr:vector-source-i src-data #f)) + (op (gr:multiply-const-ii 2)) + (dst (gr:vector-sink-i))) + + ;; using just blocks + (gr:connect tb src op) + (gr:connect tb op dst) + + (gr:run tb) + (test-equal expected-result (gr:data dst)))) + + +(with-test-prefix "test-connect-3" + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + (expected-result (vector-map (lambda (x) (* x 2)) src-data)) + (tb (gr:top-block-swig "QA top block")) + (src (gr:vector-source-i src-data #f)) + (op (gr:multiply-const-ii 2)) + (dst (gr:vector-sink-i))) + + ;; using lists to represent endpoints + (gr:connect tb `(,src 0) `(,op 0)) + (gr:connect tb `(,op 0) `(,dst 0)) + + (gr:run tb) + (test-equal expected-result (gr:data dst)))) + + +(with-test-prefix "test-connect-4" + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + (expected-result (vector-map (lambda (x) (* x 2)) src-data)) + (tb (gr:top-block-swig "QA top block")) + (src (gr:vector-source-i src-data #f)) + (op (gr:multiply-const-ii 2)) + (dst (gr:vector-sink-i))) + + ;; using multiple endpoints + (gr:connect tb src op dst) + + (gr:run tb) + (test-equal expected-result (gr:data dst)))) + + +(with-test-prefix "test-io-signature-1" + (let ((ios1 (gr:io-signature 1 2 8)) + (ios2 (gr:io-signature2 1 2 16 32)) + (ios3 (gr:io-signature3 1 -1 14 32 48)) + (iosv (gr:io-signaturev 1 4 '(1 2 3)))) + + (test-equal 1 (gr:min-streams ios1)) + (test-equal 2 (gr:max-streams ios1)) + (test-equal 8 (gr:sizeof-stream-item ios1 0)) + (test-equal 8 (gr:sizeof-stream-item ios1 1)) + + (test-equal 1 (gr:min-streams ios2)) + (test-equal 2 (gr:max-streams ios2)) + (test-equal 16 (gr:sizeof-stream-item ios2 0)) + (test-equal 32 (gr:sizeof-stream-item ios2 1)) + + (test-equal 1 (gr:min-streams ios3)) + (test-equal -1 (gr:max-streams ios3)) + (test-equal 14 (gr:sizeof-stream-item ios3 0)) + (test-equal 32 (gr:sizeof-stream-item ios3 1)) + (test-equal 48 (gr:sizeof-stream-item ios3 2)) + (test-equal '#(14 32 48) (gr:sizeof-stream-items ios3)) + + (test-equal 1 (gr:min-streams iosv)) + (test-equal 4 (gr:max-streams iosv)) + (test-equal 1 (gr:sizeof-stream-item iosv 0)) + (test-equal 2 (gr:sizeof-stream-item iosv 1)) + (test-equal 3 (gr:sizeof-stream-item iosv 2)) + (test-equal 3 (gr:sizeof-stream-item iosv 3)) + (test-equal '#(1 2 3) (gr:sizeof-stream-items iosv)) + )) + diff --git a/gnuradio-core/src/guile/tests/00_runtime_ctors.test b/gnuradio-core/src/guile/tests/00_runtime_ctors.test new file mode 100644 index 000000000..e0a946ab9 --- /dev/null +++ b/gnuradio-core/src/guile/tests/00_runtime_ctors.test @@ -0,0 +1,32 @@ +;;; -*- Scheme -*- +;;; +;;; 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 . +;;; + +;;; If you're using Emacs's Scheme mode: +;;; (put 'with-test-prefix 'scheme-indent-function 1) + +(use-modules (gnuradio test-suite lib)) +(use-modules (gnuradio core)) +(use-modules (oop goops)) + + +;;; Add test code for all constructors in these files +;;; +;;; ./runtime/gr_hier_block2.h +;;; ./runtime/gr_msg_queue.h diff --git a/gnuradio-core/src/guile/tests/filter_ctors.test b/gnuradio-core/src/guile/tests/filter_ctors.test new file mode 100644 index 000000000..040b8ba10 --- /dev/null +++ b/gnuradio-core/src/guile/tests/filter_ctors.test @@ -0,0 +1,95 @@ +;;; -*- Scheme -*- +;;; +;;; 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 . +;;; + +;;; If you're using Emacs's Scheme mode: +;;; (put 'with-test-prefix 'scheme-indent-function 1) + +(use-modules (gnuradio test-suite lib)) +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +;;; Add test code for all constructors in these files +;;; +;;; ./filter/gr_adaptive_fir_ccf.h +;;; ./filter/gr_cma_equalizer_cc.h +;;; ./filter/gr_fft_filter_ccc.h +;;; ./filter/gr_fft_filter_fff.h +;;; ./filter/gr_filter_delay_fc.h +;;; ./filter/gr_fir_ccc_generic.h +;;; ./filter/gr_fir_ccc_simd.h +;;; ./filter/gr_fir_ccc_x86.h +;;; ./filter/gr_fir_ccf_generic.h +;;; ./filter/gr_fir_ccf_simd.h +;;; ./filter/gr_fir_ccf_x86.h +;;; ./filter/gr_fir_fcc_generic.h +;;; ./filter/gr_fir_fcc_simd.h +;;; ./filter/gr_fir_fcc_x86.h +;;; ./filter/gr_fir_fff_altivec.h +;;; ./filter/gr_fir_fff_armv7_a.h +;;; ./filter/gr_fir_fff_generic.h +;;; ./filter/gr_fir_fff_simd.h +;;; ./filter/gr_fir_fff_x86.h +;;; ./filter/gr_fir_filter_ccc.h +;;; ./filter/gr_fir_filter_ccf.h +;;; ./filter/gr_fir_filter_fcc.h +;;; ./filter/gr_fir_filter_fff.h +;;; ./filter/gr_fir_filter_fsf.h +;;; ./filter/gr_fir_filter_scc.h +;;; ./filter/gr_fir_fsf_generic.h +;;; ./filter/gr_fir_fsf_simd.h +;;; ./filter/gr_fir_fsf_x86.h +;;; ./filter/gr_fir_scc_generic.h +;;; ./filter/gr_fir_scc_simd.h +;;; ./filter/gr_fir_scc_x86.h +;;; ./filter/gr_fir_sysconfig_armv7_a.h +;;; ./filter/gr_fir_sysconfig_generic.h +;;; ./filter/gr_fir_sysconfig_powerpc.h +;;; ./filter/gr_fir_sysconfig_x86.h +;;; ./filter/gr_fractional_interpolator_cc.h +;;; ./filter/gr_fractional_interpolator_ff.h +;;; ./filter/gr_freq_xlating_fir_filter_ccc.h +;;; ./filter/gr_freq_xlating_fir_filter_ccf.h +;;; ./filter/gr_freq_xlating_fir_filter_fcc.h +;;; ./filter/gr_freq_xlating_fir_filter_fcf.h +;;; ./filter/gr_freq_xlating_fir_filter_scc.h +;;; ./filter/gr_freq_xlating_fir_filter_scf.h +;;; ./filter/gr_goertzel_fc.h +;;; ./filter/gr_hilbert_fc.h +;;; ./filter/gr_iir_filter_ffd.h +;;; ./filter/gr_interp_fir_filter_ccc.h +;;; ./filter/gr_interp_fir_filter_ccf.h +;;; ./filter/gr_interp_fir_filter_fcc.h +;;; ./filter/gr_interp_fir_filter_fff.h +;;; ./filter/gr_interp_fir_filter_fsf.h +;;; ./filter/gr_interp_fir_filter_scc.h +;;; ./filter/gr_pfb_arb_resampler_ccf.h +;;; ./filter/gr_pfb_channelizer_ccf.h +;;; ./filter/gr_pfb_clock_sync_ccf.h +;;; ./filter/gr_pfb_clock_sync_fff.h +;;; ./filter/gr_pfb_decimator_ccf.h +;;; ./filter/gr_pfb_interpolator_ccf.h +;;; ./filter/gr_rational_resampler_base_ccc.h +;;; ./filter/gr_rational_resampler_base_ccf.h +;;; ./filter/gr_rational_resampler_base_fcc.h +;;; ./filter/gr_rational_resampler_base_fff.h +;;; ./filter/gr_rational_resampler_base_fsf.h +;;; ./filter/gr_rational_resampler_base_scc.h +;;; ./filter/gr_single_pole_iir_filter_cc.h +;;; ./filter/gr_single_pole_iir_filter_ff.h diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test new file mode 100644 index 000000000..8d272f768 --- /dev/null +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -0,0 +1,146 @@ +;;; -*- Scheme -*- +;;; +;;; 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 . +;;; + +;;; If you're using Emacs's Scheme mode: +;;; (put 'with-test-prefix 'scheme-indent-function 1) + +(use-modules (gnuradio test-suite lib)) +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +;;; Add test code for all constructors in these files +;;; +;;; ./general/gr_additive_scrambler_bb.h +;;; ./general/gr_agc2_cc.h +;;; ./general/gr_agc2_ff.h +;;; ./general/gr_agc_cc.h +;;; ./general/gr_agc_ff.h +;;; ./general/gr_align_on_samplenumbers_ss.h +;;; ./general/gr_bin_statistics_f.h +;;; ./general/gr_binary_slicer_fb.h +;;; ./general/gr_bytes_to_syms.h +;;; ./general/gr_char_to_float.h +;;; ./general/gr_check_counting_s.h +;;; ./general/gr_check_lfsr_32k_s.h +;;; ./general/gr_clock_recovery_mm_cc.h +;;; ./general/gr_clock_recovery_mm_ff.h +;;; ./general/gr_complex_to_interleaved_short.h +;;; ./general/gr_complex_to_xxx.h +;;; ./general/gr_conjugate_cc.h +;;; ./general/gr_constellation_decoder_cb.h +;;; ./general/gr_copy.h +;;; ./general/gr_correlate_access_code_bb.h +;;; ./general/gr_costas_loop_cc.h +;;; ./general/gr_cpfsk_bc.h +;;; ./general/gr_ctcss_squelch_ff.h +;;; ./general/gr_decode_ccsds_27_fb.h +;;; ./general/gr_deinterleave.h +;;; ./general/gr_delay.h +;;; ./general/gr_descrambler_bb.h +;;; ./general/gr_diff_decoder_bb.h +;;; ./general/gr_diff_encoder_bb.h +;;; ./general/gr_diff_phasor_cc.h +;;; ./general/gr_dpll_bb.h +;;; ./general/gr_encode_ccsds_27_bb.h +;;; ./general/gr_fake_channel_coder_pp.h +;;; ./general/gr_feedforward_agc_cc.h +;;; ./general/gr_fft_vcc.h +;;; ./general/gr_fft_vcc_fftw.h +;;; ./general/gr_fft_vfc.h +;;; ./general/gr_fll_band_edge_cc.h +;;; ./general/gr_float_to_char.h +;;; ./general/gr_float_to_complex.h +;;; ./general/gr_float_to_short.h +;;; ./general/gr_float_to_uchar.h +;;; ./general/gr_fmdet_cf.h +;;; ./general/gr_framer_sink_1.h +;;; ./general/gr_frequency_modulator_fc.h +;;; ./general/gr_glfsr_source_b.h +;;; ./general/gr_glfsr_source_f.h +;;; ./general/gr_head.h +;;; ./general/gr_interleave.h +;;; ./general/gr_interleaved_short_to_complex.h +;;; ./general/gr_iqcomp_cc.h +;;; ./general/gr_keep_one_in_n.h +;;; ./general/gr_kludge_copy.h +;;; ./general/gr_lfsr_32k_source_s.h +;;; ./general/gr_lms_dfe_cc.h +;;; ./general/gr_lms_dfe_ff.h +;;; ./general/gr_map_bb.h +;;; ./general/gr_mpsk_receiver_cc.h +;;; ./general/gr_nlog10_ff.h +;;; ./general/gr_nop.h +;;; ./general/gr_null_sink.h +;;; ./general/gr_null_source.h +;;; ./general/gr_ofdm_bpsk_demapper.h +;;; ./general/gr_ofdm_cyclic_prefixer.h +;;; ./general/gr_ofdm_demapper_vcb.h +;;; ./general/gr_ofdm_frame_acquisition.h +;;; ./general/gr_ofdm_frame_sink.h +;;; ./general/gr_ofdm_insert_preamble.h +;;; ./general/gr_ofdm_mapper_bcv.h +;;; ./general/gr_ofdm_sampler.h +;;; ./general/gr_pa_2x2_phase_combiner.h +;;; ./general/gr_packet_sink.h +;;; ./general/gr_peak_detector2_fb.h +;;; ./general/gr_phase_modulator_fc.h +;;; ./general/gr_pll_carriertracking_cc.h +;;; ./general/gr_pll_freqdet_cf.h +;;; ./general/gr_pll_refout_cc.h +;;; ./general/gr_pn_correlator_cc.h +;;; ./general/gr_probe_avg_mag_sqrd_c.h +;;; ./general/gr_probe_avg_mag_sqrd_cf.h +;;; ./general/gr_probe_avg_mag_sqrd_f.h +;;; ./general/gr_probe_density_b.h +;;; ./general/gr_probe_mpsk_snr_c.h +;;; ./general/gr_probe_signal_f.h +;;; ./general/gr_pwr_squelch_cc.h +;;; ./general/gr_pwr_squelch_ff.h +;;; ./general/gr_quadrature_demod_cf.h +;;; ./general/gr_rail_ff.h +;;; ./general/gr_regenerate_bb.h +;;; ./general/gr_repeat.h +;;; ./general/gr_rms_cf.h +;;; ./general/gr_rms_ff.h +;;; ./general/gr_scrambler_bb.h +;;; ./general/gr_short_to_float.h +;;; ./general/gr_simple_correlator.h +;;; ./general/gr_simple_framer.h +;;; ./general/gr_simple_squelch_cc.h +;;; ./general/gr_skiphead.h +;;; ./general/gr_squash_ff.h +;;; ./general/gr_squelch_base_cc.h +;;; ./general/gr_squelch_base_ff.h +;;; ./general/gr_stream_mux.h +;;; ./general/gr_stream_to_streams.h +;;; ./general/gr_stream_to_vector.h +;;; ./general/gr_streams_to_stream.h +;;; ./general/gr_streams_to_vector.h +;;; ./general/gr_stretch_ff.h +;;; ./general/gr_test.h +;;; ./general/gr_threshold_ff.h +;;; ./general/gr_throttle.h +;;; ./general/gr_uchar_to_float.h +;;; ./general/gr_unpack_k_bits_bb.h +;;; ./general/gr_vco_f.h +;;; ./general/gr_vector_to_stream.h +;;; ./general/gr_vector_to_streams.h +;;; ./general/gr_wavelet_ff.h +;;; ./general/gr_wvps_ff.h diff --git a/gnuradio-core/src/guile/tests/gengen_ctors.test b/gnuradio-core/src/guile/tests/gengen_ctors.test new file mode 100644 index 000000000..652556d3f --- /dev/null +++ b/gnuradio-core/src/guile/tests/gengen_ctors.test @@ -0,0 +1,132 @@ +;;; -*- Scheme -*- +;;; +;;; 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 . +;;; + +;;; If you're using Emacs's Scheme mode: +;;; (put 'with-test-prefix 'scheme-indent-function 1) + +(use-modules (gnuradio test-suite lib)) +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +;;; Add test code for all constructors in these files +;;; +;;; ./gengen/gr_add_cc.h +;;; ./gengen/gr_add_const_cc.h +;;; ./gengen/gr_add_const_ff.h +;;; ./gengen/gr_add_const_ii.h +;;; ./gengen/gr_add_const_sf.h +;;; ./gengen/gr_add_const_ss.h +;;; ./gengen/gr_add_const_vcc.h +;;; ./gengen/gr_add_const_vff.h +;;; ./gengen/gr_add_const_vii.h +;;; ./gengen/gr_add_const_vss.h +;;; ./gengen/gr_add_ff.h +;;; ./gengen/gr_add_ii.h +;;; ./gengen/gr_add_ss.h +;;; ./gengen/gr_and_bb.h +;;; ./gengen/gr_and_const_bb.h +;;; ./gengen/gr_and_const_ii.h +;;; ./gengen/gr_and_const_ss.h +;;; ./gengen/gr_and_ii.h +;;; ./gengen/gr_and_ss.h +;;; ./gengen/gr_argmax_fs.h +;;; ./gengen/gr_argmax_is.h +;;; ./gengen/gr_argmax_ss.h +;;; ./gengen/gr_chunks_to_symbols_bc.h +;;; ./gengen/gr_chunks_to_symbols_bf.h +;;; ./gengen/gr_chunks_to_symbols_ic.h +;;; ./gengen/gr_chunks_to_symbols_if.h +;;; ./gengen/gr_chunks_to_symbols_sc.h +;;; ./gengen/gr_chunks_to_symbols_sf.h +;;; ./gengen/gr_divide_cc.h +;;; ./gengen/gr_divide_ff.h +;;; ./gengen/gr_divide_ii.h +;;; ./gengen/gr_divide_ss.h +;;; ./gengen/gr_integrate_cc.h +;;; ./gengen/gr_integrate_ff.h +;;; ./gengen/gr_integrate_ii.h +;;; ./gengen/gr_integrate_ss.h +;;; ./gengen/gr_max_ff.h +;;; ./gengen/gr_max_ii.h +;;; ./gengen/gr_max_ss.h +;;; ./gengen/gr_moving_average_cc.h +;;; ./gengen/gr_moving_average_ff.h +;;; ./gengen/gr_moving_average_ii.h +;;; ./gengen/gr_moving_average_ss.h +;;; ./gengen/gr_multiply_cc.h +;;; ./gengen/gr_multiply_const_cc.h +;;; ./gengen/gr_multiply_const_ff.h +;;; ./gengen/gr_multiply_const_ii.h +;;; ./gengen/gr_multiply_const_ss.h +;;; ./gengen/gr_multiply_const_vcc.h +;;; ./gengen/gr_multiply_const_vff.h +;;; ./gengen/gr_multiply_const_vii.h +;;; ./gengen/gr_multiply_const_vss.h +;;; ./gengen/gr_multiply_ff.h +;;; ./gengen/gr_multiply_ii.h +;;; ./gengen/gr_multiply_ss.h +;;; ./gengen/gr_mute_cc.h +;;; ./gengen/gr_mute_ff.h +;;; ./gengen/gr_mute_ii.h +;;; ./gengen/gr_mute_ss.h +;;; ./gengen/gr_noise_source_c.h +;;; ./gengen/gr_noise_source_f.h +;;; ./gengen/gr_noise_source_i.h +;;; ./gengen/gr_noise_source_s.h +;;; ./gengen/gr_not_bb.h +;;; ./gengen/gr_not_ii.h +;;; ./gengen/gr_not_ss.h +;;; ./gengen/gr_or_bb.h +;;; ./gengen/gr_or_ii.h +;;; ./gengen/gr_or_ss.h +;;; ./gengen/gr_packed_to_unpacked_bb.h +;;; ./gengen/gr_packed_to_unpacked_ii.h +;;; ./gengen/gr_packed_to_unpacked_ss.h +;;; ./gengen/gr_peak_detector_fb.h +;;; ./gengen/gr_peak_detector_ib.h +;;; ./gengen/gr_peak_detector_sb.h +;;; ./gengen/gr_sample_and_hold_bb.h +;;; ./gengen/gr_sample_and_hold_ff.h +;;; ./gengen/gr_sample_and_hold_ii.h +;;; ./gengen/gr_sample_and_hold_ss.h +;;; ./gengen/gr_sig_source_c.h +;;; ./gengen/gr_sig_source_f.h +;;; ./gengen/gr_sig_source_i.h +;;; ./gengen/gr_sig_source_s.h +;;; ./gengen/gr_sub_cc.h +;;; ./gengen/gr_sub_ff.h +;;; ./gengen/gr_sub_ii.h +;;; ./gengen/gr_sub_ss.h +;;; ./gengen/gr_unpacked_to_packed_bb.h +;;; ./gengen/gr_unpacked_to_packed_ii.h +;;; ./gengen/gr_unpacked_to_packed_ss.h +;;; ./gengen/gr_vector_sink_b.h +;;; ./gengen/gr_vector_sink_c.h +;;; ./gengen/gr_vector_sink_f.h +;;; ./gengen/gr_vector_sink_i.h +;;; ./gengen/gr_vector_sink_s.h +;;; ./gengen/gr_vector_source_b.h +;;; ./gengen/gr_vector_source_c.h +;;; ./gengen/gr_vector_source_f.h +;;; ./gengen/gr_vector_source_i.h +;;; ./gengen/gr_vector_source_s.h +;;; ./gengen/gr_xor_bb.h +;;; ./gengen/gr_xor_ii.h +;;; ./gengen/gr_xor_ss.h diff --git a/gnuradio-core/src/guile/tests/hier_ctors.test b/gnuradio-core/src/guile/tests/hier_ctors.test new file mode 100644 index 000000000..c297fb9dd --- /dev/null +++ b/gnuradio-core/src/guile/tests/hier_ctors.test @@ -0,0 +1,30 @@ +;;; -*- Scheme -*- +;;; +;;; 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 . +;;; + +;;; If you're using Emacs's Scheme mode: +;;; (put 'with-test-prefix 'scheme-indent-function 1) + +(use-modules (gnuradio test-suite lib)) +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +;;; Add test code for all constructors in these files +;;; +;;; ./hier/gr_channel_model.h diff --git a/gnuradio-core/src/guile/tests/io_ctors.test b/gnuradio-core/src/guile/tests/io_ctors.test new file mode 100644 index 000000000..2001e5fa5 --- /dev/null +++ b/gnuradio-core/src/guile/tests/io_ctors.test @@ -0,0 +1,42 @@ +;;; -*- Scheme -*- +;;; +;;; 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 . +;;; + +;;; If you're using Emacs's Scheme mode: +;;; (put 'with-test-prefix 'scheme-indent-function 1) + +(use-modules (gnuradio test-suite lib)) +(use-modules (gnuradio core)) +(use-modules (oop goops)) + +;;; Add test code for all constructors in these files +;;; +;;; ./io/gr_file_descriptor_sink.h +;;; ./io/gr_file_descriptor_source.h +;;; ./io/gr_file_sink.h +;;; ./io/gr_file_source.h +;;; ./io/gr_histo_sink_f.h +;;; ./io/gr_message_sink.h +;;; ./io/gr_message_source.h +;;; ./io/gr_oscope_sink_f.h +;;; ./io/gr_oscope_sink_x.h +;;; ./io/gr_udp_sink.h +;;; ./io/gr_udp_source.h +;;; ./io/gr_wavfile_sink.h +;;; ./io/gr_wavfile_source.h -- cgit 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... --- gnuradio-core/src/guile/.gitignore | 1 - .../src/guile/gnuradio/test-suite/guile-test | 241 +++++++++++++++++++++ .../src/guile/gnuradio/test-suite/guile-test.in | 241 --------------------- gnuradio-core/src/guile/run_guile_tests.in | 15 +- 4 files changed, 250 insertions(+), 248 deletions(-) create mode 100644 gnuradio-core/src/guile/gnuradio/test-suite/guile-test delete mode 100755 gnuradio-core/src/guile/gnuradio/test-suite/guile-test.in (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/.gitignore b/gnuradio-core/src/guile/.gitignore index bc212f566..82a29a907 100644 --- a/gnuradio-core/src/guile/.gitignore +++ b/gnuradio-core/src/guile/.gitignore @@ -2,4 +2,3 @@ /Makefile.in /run_guile_tests /guile.log -/gnuradio/test-suite/guile-test diff --git a/gnuradio-core/src/guile/gnuradio/test-suite/guile-test b/gnuradio-core/src/guile/gnuradio/test-suite/guile-test new file mode 100644 index 000000000..6dc1a9658 --- /dev/null +++ b/gnuradio-core/src/guile/gnuradio/test-suite/guile-test @@ -0,0 +1,241 @@ +#!/usr/bin/guile \ +-e main -s +!# + +;;;; guile-test --- run the Guile test suite +;;;; Jim Blandy --- May 1999 +;;;; +;;;; Copyright (C) 1999, 2001, 2006 Free Software Foundation, Inc. +;;;; +;;;; This program 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 2, or (at your option) +;;;; any later version. +;;;; +;;;; This program 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 software; see the file COPYING. If not, write to +;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;;;; Boston, MA 02110-1301 USA + + +;;;; Usage: [guile -e main -s] guile-test [OPTIONS] [TEST ...] +;;;; +;;;; Run tests from the Guile test suite. Report failures and +;;;; unexpected passes to the standard output, along with a summary of +;;;; all the results. Record each reported test outcome in the log +;;;; file, `guile.log'. The exit status is #f if any of the tests +;;;; fail or pass unexpectedly. +;;;; +;;;; Normally, guile-test scans the test directory, and executes all +;;;; files whose names end in `.test'. (It assumes they contain +;;;; Scheme code.) However, you can have it execute specific tests by +;;;; listing their filenames on the command line. +;;;; +;;;; The option `--test-suite' can be given to specify the test +;;;; directory. If no such option is given, the test directory is +;;;; taken from the environment variable TEST_SUITE_DIR (if defined), +;;;; otherwise a default directory that is hardcoded in this file is +;;;; used (see "Installation" below). +;;;; +;;;; If present, the `--log-file LOG' option tells `guile-test' to put +;;;; the log output in a file named LOG. +;;;; +;;;; If present, the `--debug' option will enable a debugging mode. +;;;; +;;;; If present, the `--flag-unresolved' option will cause guile-test +;;;; to exit with failure status if any tests are UNRESOLVED. +;;;; +;;;; +;;;; Installation: +;;;; +;;;; If you change the #! line at the top of this script to point at +;;;; the Guile interpreter you want to test, you can call this script +;;;; as an executable instead of having to pass it as a parameter to +;;;; guile via "guile -e main -s guile-test". Further, you can edit +;;;; the definition of default-test-suite to point to the parent +;;;; directory of the `tests' tree, which makes it unnecessary to set +;;;; the environment variable `TEST_SUITE_DIR'. +;;;; +;;;; +;;;; Shortcomings: +;;;; +;;;; At the moment, due to a simple-minded implementation, test files +;;;; must live in the test directory, and you must specify their names +;;;; relative to the top of the test directory. If you want to send +;;;; me a patch that fixes this, but still leaves sane test names in +;;;; the log file, that would be great. At the moment, all the tests +;;;; I care about are in the test directory, though. +;;;; +;;;; It would be nice if you could specify the Guile interpreter you +;;;; want to test on the command line. As it stands, if you want to +;;;; change which Guile interpreter you're testing, you need to edit +;;;; the #! line at the top of this file, which is stupid. + +(define (main . args) + (let ((module (resolve-module '(gnuradio test-suite guile-test)))) + (apply (module-ref module 'main) args))) + +(define-module (gnuradio test-suite guile-test) + :use-module (gnuradio test-suite lib) + :use-module (ice-9 getopt-long) + :use-module (ice-9 and-let-star) + :use-module (ice-9 rdelim) + :export (main data-file-name test-file-name)) + + +;;; User configurable settings: +(define default-test-suite + (string-append (getenv "HOME") "/bogus-path/test-suite")) + + +;;; Variables that will receive their actual values later. +(define test-suite default-test-suite) + +(define tmp-dir #f) + + +;;; General utilities, that probably should be in a library somewhere. + +;;; Enable debugging +(define (enable-debug-mode) + (write-line %load-path) + (set! %load-verbosely #t) + (debug-enable 'backtrace 'debug)) + +;;; Traverse the directory tree at ROOT, applying F to the name of +;;; each file in the tree, including ROOT itself. For a subdirectory +;;; SUB, if (F SUB) is true, we recurse into SUB. Do not follow +;;; symlinks. +(define (for-each-file f root) + + ;; A "hard directory" is a path that denotes a directory and is not a + ;; symlink. + (define (file-is-hard-directory? filename) + (eq? (stat:type (lstat filename)) 'directory)) + + (let visit ((root root)) + (let ((should-recur (f root))) + (if (and should-recur (file-is-hard-directory? root)) + (let ((dir (opendir root))) + (let loop () + (let ((entry (readdir dir))) + (cond + ((eof-object? entry) #f) + ((or (string=? entry ".") + (string=? entry "..") + (string=? entry "CVS") + (string=? entry "RCS")) + (loop)) + (else + (visit (string-append root "/" entry)) + (loop)))))))))) + + +;;; The test driver. + + +;;; Localizing test files and temporary data files. + +(define (data-file-name filename) + (in-vicinity tmp-dir filename)) + +(define (test-file-name test) + (in-vicinity test-suite test)) + +;;; Return a list of all the test files in the test tree. +(define (enumerate-tests test-dir) + (let ((root-len (+ 1 (string-length test-dir))) + (tests '())) + (for-each-file (lambda (file) + (if (has-suffix? file ".test") + (let ((short-name + (substring file root-len))) + (set! tests (cons short-name tests)))) + #t) + test-dir) + + ;; for-each-file presents the files in whatever order it finds + ;; them in the directory. We sort them here, so they'll always + ;; appear in the same order. This makes it easier to compare test + ;; log files mechanically. + (sort tests string --- May 1999 -;;;; -;;;; Copyright (C) 1999, 2001, 2006 Free Software Foundation, Inc. -;;;; -;;;; This program 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 2, or (at your option) -;;;; any later version. -;;;; -;;;; This program 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 software; see the file COPYING. If not, write to -;;;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;;;; Boston, MA 02110-1301 USA - - -;;;; Usage: [guile -e main -s] guile-test [OPTIONS] [TEST ...] -;;;; -;;;; Run tests from the Guile test suite. Report failures and -;;;; unexpected passes to the standard output, along with a summary of -;;;; all the results. Record each reported test outcome in the log -;;;; file, `guile.log'. The exit status is #f if any of the tests -;;;; fail or pass unexpectedly. -;;;; -;;;; Normally, guile-test scans the test directory, and executes all -;;;; files whose names end in `.test'. (It assumes they contain -;;;; Scheme code.) However, you can have it execute specific tests by -;;;; listing their filenames on the command line. -;;;; -;;;; The option `--test-suite' can be given to specify the test -;;;; directory. If no such option is given, the test directory is -;;;; taken from the environment variable TEST_SUITE_DIR (if defined), -;;;; otherwise a default directory that is hardcoded in this file is -;;;; used (see "Installation" below). -;;;; -;;;; If present, the `--log-file LOG' option tells `guile-test' to put -;;;; the log output in a file named LOG. -;;;; -;;;; If present, the `--debug' option will enable a debugging mode. -;;;; -;;;; If present, the `--flag-unresolved' option will cause guile-test -;;;; to exit with failure status if any tests are UNRESOLVED. -;;;; -;;;; -;;;; Installation: -;;;; -;;;; If you change the #! line at the top of this script to point at -;;;; the Guile interpreter you want to test, you can call this script -;;;; as an executable instead of having to pass it as a parameter to -;;;; guile via "guile -e main -s guile-test". Further, you can edit -;;;; the definition of default-test-suite to point to the parent -;;;; directory of the `tests' tree, which makes it unnecessary to set -;;;; the environment variable `TEST_SUITE_DIR'. -;;;; -;;;; -;;;; Shortcomings: -;;;; -;;;; At the moment, due to a simple-minded implementation, test files -;;;; must live in the test directory, and you must specify their names -;;;; relative to the top of the test directory. If you want to send -;;;; me a patch that fixes this, but still leaves sane test names in -;;;; the log file, that would be great. At the moment, all the tests -;;;; I care about are in the test directory, though. -;;;; -;;;; It would be nice if you could specify the Guile interpreter you -;;;; want to test on the command line. As it stands, if you want to -;;;; change which Guile interpreter you're testing, you need to edit -;;;; the #! line at the top of this file, which is stupid. - -(define (main . args) - (let ((module (resolve-module '(gnuradio test-suite guile-test)))) - (apply (module-ref module 'main) args))) - -(define-module (gnuradio test-suite guile-test) - :use-module (gnuradio test-suite lib) - :use-module (ice-9 getopt-long) - :use-module (ice-9 and-let-star) - :use-module (ice-9 rdelim) - :export (main data-file-name test-file-name)) - - -;;; User configurable settings: -(define default-test-suite - (string-append (getenv "HOME") "/bogus-path/test-suite")) - - -;;; Variables that will receive their actual values later. -(define test-suite default-test-suite) - -(define tmp-dir #f) - - -;;; General utilities, that probably should be in a library somewhere. - -;;; Enable debugging -(define (enable-debug-mode) - (write-line %load-path) - (set! %load-verbosely #t) - (debug-enable 'backtrace 'debug)) - -;;; Traverse the directory tree at ROOT, applying F to the name of -;;; each file in the tree, including ROOT itself. For a subdirectory -;;; SUB, if (F SUB) is true, we recurse into SUB. Do not follow -;;; symlinks. -(define (for-each-file f root) - - ;; A "hard directory" is a path that denotes a directory and is not a - ;; symlink. - (define (file-is-hard-directory? filename) - (eq? (stat:type (lstat filename)) 'directory)) - - (let visit ((root root)) - (let ((should-recur (f root))) - (if (and should-recur (file-is-hard-directory? root)) - (let ((dir (opendir root))) - (let loop () - (let ((entry (readdir dir))) - (cond - ((eof-object? entry) #f) - ((or (string=? entry ".") - (string=? entry "..") - (string=? entry "CVS") - (string=? entry "RCS")) - (loop)) - (else - (visit (string-append root "/" entry)) - (loop)))))))))) - - -;;; The test driver. - - -;;; Localizing test files and temporary data files. - -(define (data-file-name filename) - (in-vicinity tmp-dir filename)) - -(define (test-file-name test) - (in-vicinity test-suite test)) - -;;; Return a list of all the test files in the test tree. -(define (enumerate-tests test-dir) - (let ((root-len (+ 1 (string-length test-dir))) - (tests '())) - (for-each-file (lambda (file) - (if (has-suffix? file ".test") - (let ((short-name - (substring file root-len))) - (set! tests (cons short-name tests)))) - #t) - test-dir) - - ;; for-each-file presents the files in whatever order it finds - ;; them in the directory. We sort them here, so they'll always - ;; appear in the same order. This makes it easier to compare test - ;; log files mechanically. - (sort tests string (vector-length obj) 1) - (eq (vector-ref obj 0) %test-runner-cookie))) - (define (alloc) - (let ((runner (make-vector 22))) - (vector-set! runner 0 %test-runner-cookie) - runner)) - (begin - (define (getter runner) - (vector-ref runner index)) ...) - (begin - (define (setter runner value) - (vector-set! runner index value)) ...))))))) - -(%test-record-define - %test-runner-alloc test-runner? - ;; Cumulate count of all tests that have passed and were expected to. - (pass-count 1 test-runner-pass-count test-runner-pass-count!) - (fail-count 2 test-runner-fail-count test-runner-fail-count!) - (xpass-count 3 test-runner-xpass-count test-runner-xpass-count!) - (xfail-count 4 test-runner-xfail-count test-runner-xfail-count!) - (skip-count 5 test-runner-skip-count test-runner-skip-count!) - (skip-list 6 %test-runner-skip-list %test-runner-skip-list!) - (fail-list 7 %test-runner-fail-list %test-runner-fail-list!) - ;; Normally #t, except when in a test-apply. - (run-list 8 %test-runner-run-list %test-runner-run-list!) - (skip-save 9 %test-runner-skip-save %test-runner-skip-save!) - (fail-save 10 %test-runner-fail-save %test-runner-fail-save!) - (group-stack 11 test-runner-group-stack test-runner-group-stack!) - (on-test-begin 12 test-runner-on-test-begin test-runner-on-test-begin!) - (on-test-end 13 test-runner-on-test-end test-runner-on-test-end!) - ;; Call-back when entering a group. Takes (runner suite-name count). - (on-group-begin 14 test-runner-on-group-begin test-runner-on-group-begin!) - ;; Call-back when leaving a group. - (on-group-end 15 test-runner-on-group-end test-runner-on-group-end!) - ;; Call-back when leaving the outermost group. - (on-final 16 test-runner-on-final test-runner-on-final!) - ;; Call-back when expected number of tests was wrong. - (on-bad-count 17 test-runner-on-bad-count test-runner-on-bad-count!) - ;; Call-back when name in test=end doesn't match test-begin. - (on-bad-end-name 18 test-runner-on-bad-end-name test-runner-on-bad-end-name!) - ;; Cumulate count of all tests that have been done. - (total-count 19 %test-runner-total-count %test-runner-total-count!) - ;; Stack (list) of (count-at-start . expected-count): - (count-list 20 %test-runner-count-list %test-runner-count-list!) - (result-alist 21 test-result-alist test-result-alist!) - ;; Field can be used by test-runner for any purpose. - ;; test-runner-simple uses it for a log file. - (aux-value 22 test-runner-aux-value test-runner-aux-value!) -) - -(define (test-runner-reset runner) - (test-runner-pass-count! runner 0) - (test-runner-fail-count! runner 0) - (test-runner-xpass-count! runner 0) - (test-runner-xfail-count! runner 0) - (test-runner-skip-count! runner 0) - (%test-runner-total-count! runner 0) - (%test-runner-count-list! runner '()) - (%test-runner-run-list! runner #t) - (%test-runner-skip-list! runner '()) - (%test-runner-fail-list! runner '()) - (%test-runner-skip-save! runner '()) - (%test-runner-fail-save! runner '()) - (test-runner-group-stack! runner '())) - -(define (test-runner-group-path runner) - (reverse (test-runner-group-stack runner))) - -(define (%test-null-callback runner) #f) - -(define (test-runner-null) - (let ((runner (%test-runner-alloc))) - (test-runner-reset runner) - (test-runner-on-group-begin! runner (lambda (runner name count) #f)) - (test-runner-on-group-end! runner %test-null-callback) - (test-runner-on-final! runner %test-null-callback) - (test-runner-on-test-begin! runner %test-null-callback) - (test-runner-on-test-end! runner %test-null-callback) - (test-runner-on-bad-count! runner (lambda (runner count expected) #f)) - (test-runner-on-bad-end-name! runner (lambda (runner begin end) #f)) - runner)) - -;; Not part of the specification. FIXME -;; Controls whether a log file is generated. -(define test-log-to-file #t) - -(define (test-runner-simple) - (let ((runner (%test-runner-alloc))) - (test-runner-reset runner) - (test-runner-on-group-begin! runner test-on-group-begin-simple) - (test-runner-on-group-end! runner test-on-group-end-simple) - (test-runner-on-final! runner test-on-final-simple) - (test-runner-on-test-begin! runner test-on-test-begin-simple) - (test-runner-on-test-end! runner test-on-test-end-simple) - (test-runner-on-bad-count! runner test-on-bad-count-simple) - (test-runner-on-bad-end-name! runner test-on-bad-end-name-simple) - runner)) - -(cond-expand - (srfi-39 - (define test-runner-current (make-parameter #f)) - (define test-runner-factory (make-parameter test-runner-simple))) - (else - (define %test-runner-current #f) - (define-syntax test-runner-current - (syntax-rules () - ((test-runner-current) - %test-runner-current) - ((test-runner-current runner) - (set! %test-runner-current runner)))) - (define %test-runner-factory test-runner-simple) - (define-syntax test-runner-factory - (syntax-rules () - ((test-runner-factory) - %test-runner-factory) - ((test-runner-factory runner) - (set! %test-runner-factory runner)))))) - -;; A safer wrapper to test-runner-current. -(define (test-runner-get) - (let ((r (test-runner-current))) - (if (not r) - (cond-expand - (srfi-23 (error "test-runner not initialized - test-begin missing?")) - (else #t))) - r)) - -(define (%test-specificier-matches spec runner) - (spec runner)) - -(define (test-runner-create) - ((test-runner-factory))) - -(define (%test-any-specifier-matches list runner) - (let ((result #f)) - (let loop ((l list)) - (cond ((null? l) result) - (else - (if (%test-specificier-matches (car l) runner) - (set! result #t)) - (loop (cdr l))))))) - -;; Returns #f, #t, or 'xfail. -(define (%test-should-execute runner) - (let ((run (%test-runner-run-list runner))) - (cond ((or - (not (or (eqv? run #t) - (%test-any-specifier-matches run runner))) - (%test-any-specifier-matches - (%test-runner-skip-list runner) - runner)) - (test-result-set! runner 'result-kind 'skip) - #f) - ((%test-any-specifier-matches - (%test-runner-fail-list runner) - runner) - (test-result-set! runner 'result-kind 'xfail) - 'xfail) - (else #t)))) - -(define (%test-begin suite-name count) - (if (not (test-runner-current)) - (test-runner-current (test-runner-create))) - (let ((runner (test-runner-current))) - ((test-runner-on-group-begin runner) runner suite-name count) - (%test-runner-skip-save! runner - (cons (%test-runner-skip-list runner) - (%test-runner-skip-save runner))) - (%test-runner-fail-save! runner - (cons (%test-runner-fail-list runner) - (%test-runner-fail-save runner))) - (%test-runner-count-list! runner - (cons (cons (%test-runner-total-count runner) - count) - (%test-runner-count-list runner))) - (test-runner-group-stack! runner (cons suite-name - (test-runner-group-stack runner))))) -(cond-expand - (kawa - ;; Kawa has test-begin built in, implemented as: - ;; (begin - ;; (cond-expand (srfi-64 #!void) (else (require 'srfi-64))) - ;; (%test-begin suite-name [count])) - ;; This puts test-begin but only test-begin in the default environment., - ;; which makes normal test suites loadable without non-portable commands. - ) - (else - (define-syntax test-begin - (syntax-rules () - ((test-begin suite-name) - (%test-begin suite-name #f)) - ((test-begin suite-name count) - (%test-begin suite-name count)))))) - -(define (test-on-group-begin-simple runner suite-name count) - (if (null? (test-runner-group-stack runner)) - (begin - (display "%%%% Starting test ") - (display suite-name) - (if test-log-to-file - (let* ((log-file-name - (if (string? test-log-to-file) test-log-to-file - (string-append suite-name ".log"))) - (log-file - (cond-expand (mzscheme - (open-output-file log-file-name 'truncate/replace)) - (else (open-output-file log-file-name))))) - (display "%%%% Starting test " log-file) - (display suite-name log-file) - (newline log-file) - (test-runner-aux-value! runner log-file) - (display " (Writing full log to \"") - (display log-file-name) - (display "\")"))) - (newline))) - (let ((log (test-runner-aux-value runner))) - (if (output-port? log) - (begin - (display "Group begin: " log) - (display suite-name log) - (newline log)))) - #f) - -(define (test-on-group-end-simple runner) - (let ((log (test-runner-aux-value runner))) - (if (output-port? log) - (begin - (display "Group end: " log) - (display (car (test-runner-group-stack runner)) log) - (newline log)))) - #f) - -(define (%test-on-bad-count-write runner count expected-count port) - (display "*** Total number of tests was " port) - (display count port) - (display " but should be " port) - (display expected-count port) - (display ". ***" port) - (newline port) - (display "*** Discrepancy indicates testsuite error or exceptions. ***" port) - (newline port)) - -(define (test-on-bad-count-simple runner count expected-count) - (%test-on-bad-count-write runner count expected-count (current-output-port)) - (let ((log (test-runner-aux-value runner))) - (if (output-port? log) - (%test-on-bad-count-write runner count expected-count log)))) - -(define (test-on-bad-end-name-simple runner begin-name end-name) - (let ((msg (string-append (%test-format-line runner) "test-end " begin-name - " does not match test-begin " end-name))) - (cond-expand - (srfi-23 (error msg)) - (else (display msg) (newline))))) - - -(define (%test-final-report1 value label port) - (if (> value 0) - (begin - (display label port) - (display value port) - (newline port)))) - -(define (%test-final-report-simple runner port) - (%test-final-report1 (test-runner-pass-count runner) - "# of expected passes " port) - (%test-final-report1 (test-runner-xfail-count runner) - "# of expected failures " port) - (%test-final-report1 (test-runner-xpass-count runner) - "# of unexpected successes " port) - (%test-final-report1 (test-runner-fail-count runner) - "# of unexpected failures " port) - (%test-final-report1 (test-runner-skip-count runner) - "# of skipped tests " port)) - -(define (test-on-final-simple runner) - (%test-final-report-simple runner (current-output-port)) - (let ((log (test-runner-aux-value runner))) - (if (output-port? log) - (%test-final-report-simple runner log)))) - -(define (%test-format-line runner) - (let* ((line-info (test-result-alist runner)) - (source-file (assq 'source-file line-info)) - (source-line (assq 'source-line line-info)) - (file (if source-file (cdr source-file) ""))) - (if source-line - (string-append file ":" - (number->string (cdr source-line)) ": ") - ""))) - -(define (%test-end suite-name line-info) - (let* ((r (test-runner-get)) - (groups (test-runner-group-stack r)) - (line (%test-format-line r))) - (test-result-alist! r line-info) - (if (null? groups) - (let ((msg (string-append line "test-end not in a group"))) - (cond-expand - (srfi-23 (error msg)) - (else (display msg) (newline))))) - (if (and suite-name (not (equal? suite-name (car groups)))) - ((test-runner-on-bad-end-name r) r suite-name (car groups))) - (let* ((count-list (%test-runner-count-list r)) - (expected-count (cdar count-list)) - (saved-count (caar count-list)) - (group-count (- (%test-runner-total-count r) saved-count))) - (if (and expected-count - (not (= expected-count group-count))) - ((test-runner-on-bad-count r) r group-count expected-count)) - ((test-runner-on-group-end r) r) - (test-runner-group-stack! r (cdr (test-runner-group-stack r))) - (%test-runner-skip-list! r (car (%test-runner-skip-save r))) - (%test-runner-skip-save! r (cdr (%test-runner-skip-save r))) - (%test-runner-fail-list! r (car (%test-runner-fail-save r))) - (%test-runner-fail-save! r (cdr (%test-runner-fail-save r))) - (%test-runner-count-list! r (cdr count-list)) - (if (null? (test-runner-group-stack r)) - ((test-runner-on-final r) r))))) - -(define-syntax test-group - (syntax-rules () - ((test-group suite-name . body) - (let ((r (test-runner-current))) - ;; Ideally should also set line-number, if available. - (test-result-alist! r (list (cons 'test-name suite-name))) - (if (%test-should-execute r) - (dynamic-wind - (lambda () (test-begin suite-name)) - (lambda () . body) - (lambda () (test-end suite-name)))))))) - -(define-syntax test-group-with-cleanup - (syntax-rules () - ((test-group-with-cleanup suite-name form cleanup-form) - (test-group suite-name - (dynamic-wind - (lambda () #f) - (lambda () form) - (lambda () cleanup-form)))) - ((test-group-with-cleanup suite-name cleanup-form) - (test-group-with-cleanup suite-name #f cleanup-form)) - ((test-group-with-cleanup suite-name form1 form2 form3 . rest) - (test-group-with-cleanup suite-name (begin form1 form2) form3 . rest)))) - -(define (test-on-test-begin-simple runner) - (let ((log (test-runner-aux-value runner))) - (if (output-port? log) - (let* ((results (test-result-alist runner)) - (source-file (assq 'source-file results)) - (source-line (assq 'source-line results)) - (source-form (assq 'source-form results)) - (test-name (assq 'test-name results))) - (display "Test begin:" log) - (newline log) - (if test-name (%test-write-result1 test-name log)) - (if source-file (%test-write-result1 source-file log)) - (if source-line (%test-write-result1 source-line log)) - (if source-file (%test-write-result1 source-form log)))))) - -(define-syntax test-result-ref - (syntax-rules () - ((test-result-ref runner pname) - (test-result-ref runner pname #f)) - ((test-result-ref runner pname default) - (let ((p (assq pname (test-result-alist runner)))) - (if p (cdr p) default))))) - -(define (test-on-test-end-simple runner) - (let ((log (test-runner-aux-value runner)) - (kind (test-result-ref runner 'result-kind))) - (if (memq kind '(fail xpass)) - (let* ((results (test-result-alist runner)) - (source-file (assq 'source-file results)) - (source-line (assq 'source-line results)) - (test-name (assq 'test-name results))) - (if (or source-file source-line) - (begin - (if source-file (display (cdr source-file))) - (display ":") - (if source-line (display (cdr source-line))) - (display ": "))) - (display (if (eq? kind 'xpass) "XPASS" "FAIL")) - (if test-name - (begin - (display " ") - (display (cdr test-name)))) - (newline))) - (if (output-port? log) - (begin - (display "Test end:" log) - (newline log) - (let loop ((list (test-result-alist runner))) - (if (pair? list) - (let ((pair (car list))) - ;; Write out properties not written out by on-test-begin. - (if (not (memq (car pair) - '(test-name source-file source-line source-form))) - (%test-write-result1 pair log)) - (loop (cdr list))))))))) - -(define (%test-write-result1 pair port) - (display " " port) - (display (car pair) port) - (display ": " port) - (write (cdr pair) port) - (newline port)) - -(define (test-result-set! runner pname value) - (let* ((alist (test-result-alist runner)) - (p (assq pname alist))) - (if p - (set-cdr! p value) - (test-result-alist! runner (cons (cons pname value) alist))))) - -(define (test-result-clear runner) - (test-result-alist! runner '())) - -(define (test-result-remove runner pname) - (let* ((alist (test-result-alist runner)) - (p (assq pname alist))) - (if p - (test-result-alist! runner - (let loop ((r alist)) - (if (eq? r p) (cdr r) - (cons (car r) (loop (cdr r))))))))) - -(define (test-result-kind . rest) - (let ((runner (if (pair? rest) (car rest) (test-runner-current)))) - (test-result-ref runner 'result-kind))) - -(define (test-passed? . rest) - (let ((runner (if (pair? rest) (car rest) (test-runner-get)))) - (memq (test-result-ref runner 'result-kind) '(pass xpass)))) - -(define (%test-report-result) - (let* ((r (test-runner-get)) - (result-kind (test-result-kind r))) - (case result-kind - ((pass) - (test-runner-pass-count! r (+ 1 (test-runner-pass-count r)))) - ((fail) - (test-runner-fail-count! r (+ 1 (test-runner-fail-count r)))) - ((xpass) - (test-runner-xpass-count! r (+ 1 (test-runner-xpass-count r)))) - ((xfail) - (test-runner-xfail-count! r (+ 1 (test-runner-xfail-count r)))) - (else - (test-runner-skip-count! r (+ 1 (test-runner-skip-count r))))) - (%test-runner-total-count! r (+ 1 (%test-runner-total-count r))) - ((test-runner-on-test-end r) r))) - -(cond-expand - (guile - (define-syntax %test-evaluate-with-catch - (syntax-rules () - ((%test-evaluate-with-catch test-expression) - (catch #t (lambda () test-expression) (lambda (key . args) #f)))))) - (kawa - (define-syntax %test-evaluate-with-catch - (syntax-rules () - ((%test-evaluate-with-catch test-expression) - (try-catch test-expression - (ex - (test-result-set! (test-runner-current) 'actual-error ex) - #f)))))) - (srfi-34 - (define-syntax %test-evaluate-with-catch - (syntax-rules () - ((%test-evaluate-with-catch test-expression) - (guard (err (else #f)) test-expression))))) - (chicken - (define-syntax %test-evaluate-with-catch - (syntax-rules () - ((%test-evaluate-with-catch test-expression) - (condition-case test-expression (ex () #f)))))) - (else - (define-syntax %test-evaluate-with-catch - (syntax-rules () - ((%test-evaluate-with-catch test-expression) - test-expression))))) - -(cond-expand - ((or kawa mzscheme) - (cond-expand - (mzscheme - (define-for-syntax (%test-syntax-file form) - (let ((source (syntax-source form))) - (cond ((string? source) file) - ((path? source) (path->string source)) - (else #f))))) - (kawa - (define (%test-syntax-file form) - (syntax-source form)))) - (define-for-syntax (%test-source-line2 form) - (let* ((line (syntax-line form)) - (file (%test-syntax-file form)) - (line-pair (if line (list (cons 'source-line line)) '()))) - (cons (cons 'source-form (syntax-object->datum form)) - (if file (cons (cons 'source-file file) line-pair) line-pair))))) - (else - (define (%test-source-line2 form) - '()))) - -(define (%test-on-test-begin r) - (%test-should-execute r) - ((test-runner-on-test-begin r) r) - (not (eq? 'skip (test-result-ref r 'result-kind)))) - -(define (%test-on-test-end r result) - (test-result-set! r 'result-kind - (if (eq? (test-result-ref r 'result-kind) 'xfail) - (if result 'xpass 'xfail) - (if result 'pass 'fail)))) - -(define (test-runner-test-name runner) - (test-result-ref runner 'test-name "")) - -(define-syntax %test-comp2body - (syntax-rules () - ((%test-comp2body r comp expected expr) - (let () - (if (%test-on-test-begin r) - (let ((exp expected)) - (test-result-set! r 'expected-value exp) - (let ((res (%test-evaluate-with-catch expr))) - (test-result-set! r 'actual-value res) - (%test-on-test-end r (comp exp res))))) - (%test-report-result))))) - -(define (%test-approximimate= error) - (lambda (value expected) - (and (>= value (- expected error)) - (<= value (+ expected error))))) - -(define-syntax %test-comp1body - (syntax-rules () - ((%test-comp1body r expr) - (let () - (if (%test-on-test-begin r) - (let () - (let ((res (%test-evaluate-with-catch expr))) - (test-result-set! r 'actual-value res) - (%test-on-test-end r res)))) - (%test-report-result))))) - -(cond-expand - ((or kawa mzscheme) - ;; Should be made to work for any Scheme with syntax-case - ;; However, I haven't gotten the quoting working. FIXME. - (define-syntax test-end - (lambda (x) - (syntax-case (list x (list 'quote (%test-source-line2 x))) () - (((mac suite-name) line) - (syntax - (%test-end suite-name line))) - (((mac) line) - (syntax - (%test-end #f line)))))) - (define-syntax test-assert - (lambda (x) - (syntax-case (list x (list 'quote (%test-source-line2 x))) () - (((mac tname expr) line) - (syntax - (let* ((r (test-runner-get)) - (name tname)) - (test-result-alist! r (cons (cons 'test-name tname) line)) - (%test-comp1body r expr)))) - (((mac expr) line) - (syntax - (let* ((r (test-runner-get))) - (test-result-alist! r line) - (%test-comp1body r expr))))))) - (define-for-syntax (%test-comp2 comp x) - (syntax-case (list x (list 'quote (%test-source-line2 x)) comp) () - (((mac tname expected expr) line comp) - (syntax - (let* ((r (test-runner-get)) - (name tname)) - (test-result-alist! r (cons (cons 'test-name tname) line)) - (%test-comp2body r comp expected expr)))) - (((mac expected expr) line comp) - (syntax - (let* ((r (test-runner-get))) - (test-result-alist! r line) - (%test-comp2body r comp expected expr)))))) - (define-syntax test-eqv - (lambda (x) (%test-comp2 (syntax eqv?) x))) - (define-syntax test-eq - (lambda (x) (%test-comp2 (syntax eq?) x))) - (define-syntax test-equal - (lambda (x) (%test-comp2 (syntax equal?) x))) - (define-syntax test-approximate ;; FIXME - needed for non-Kawa - (lambda (x) - (syntax-case (list x (list 'quote (%test-source-line2 x))) () - (((mac tname expected expr error) line) - (syntax - (let* ((r (test-runner-get)) - (name tname)) - (test-result-alist! r (cons (cons 'test-name tname) line)) - (%test-comp2body r (%test-approximimate= error) expected expr)))) - (((mac expected expr error) line) - (syntax - (let* ((r (test-runner-get))) - (test-result-alist! r line) - (%test-comp2body r (%test-approximimate= error) expected expr)))))))) - (else - (define-syntax test-end - (syntax-rules () - ((test-end) - (%test-end #f '())) - ((test-end suite-name) - (%test-end suite-name '())))) - (define-syntax test-assert - (syntax-rules () - ((test-assert tname test-expression) - (let* ((r (test-runner-get)) - (name tname)) - (test-result-alist! r '((test-name . tname))) - (%test-comp1body r test-expression))) - ((test-assert test-expression) - (let* ((r (test-runner-get))) - (test-result-alist! r '()) - (%test-comp1body r test-expression))))) - (define-syntax %test-comp2 - (syntax-rules () - ((%test-comp2 comp tname expected expr) - (let* ((r (test-runner-get)) - (name tname)) - (test-result-alist! r (list (cons 'test-name tname))) - (%test-comp2body r comp expected expr))) - ((%test-comp2 comp expected expr) - (let* ((r (test-runner-get))) - (test-result-alist! r '()) - (%test-comp2body r comp expected expr))))) - (define-syntax test-equal - (syntax-rules () - ((test-equal . rest) - (%test-comp2 equal? . rest)))) - (define-syntax test-eqv - (syntax-rules () - ((test-eqv . rest) - (%test-comp2 eqv? . rest)))) - (define-syntax test-eq - (syntax-rules () - ((test-eq . rest) - (%test-comp2 eq? . rest)))) - (define-syntax test-approximate - (syntax-rules () - ((test-approximate tname expected expr error) - (%test-comp2 (%test-approximimate= error) tname expected expr)) - ((test-approximate expected expr error) - (%test-comp2 (%test-approximimate= error) expected expr)))))) - -(cond-expand - (guile - (define-syntax %test-error - (syntax-rules () - ((%test-error r etype expr) - (%test-comp1body r (catch #t (lambda () expr) (lambda (key . args) #t))))))) - (mzscheme - (define-syntax %test-error - (syntax-rules () - ((%test-error r etype expr) - (%test-comp1body r (with-handlers (((lambda (h) #t) (lambda (h) #t))) - (let () - (test-result-set! r 'actual-value expr) - #f))))))) - (chicken - (define-syntax %test-error - (syntax-rules () - ((%test-error r etype expr) - (%test-comp1body r (condition-case expr (ex () #t))))))) - (kawa - (define-syntax %test-error - (syntax-rules () - ((%test-error r etype expr) - (let () - (if (%test-on-test-begin r) - (let ((et etype)) - (test-result-set! r 'expected-error et) - (%test-on-test-end r - (try-catch - (let () - (test-result-set! r 'actual-value expr) - #f) - (ex - (test-result-set! r 'actual-error ex) - (cond ((and (instance? et ) - (gnu.bytecode.ClassType:isSubclass et )) - (instance? ex et)) - (else #t))))) - (%test-report-result)))))))) - ((and srfi-34 srfi-35) - (define-syntax %test-error - (syntax-rules () - ((%test-error r etype expr) - (%test-comp1body r (guard (ex ((condition-type? etype) - (and (condition? ex) (condition-has-type? ex etype))) - ((procedure? etype) - (etype ex)) - ((equal? type #t) - #t) - (else #t)) - expr)))))) - (srfi-34 - (define-syntax %test-error - (syntax-rules () - ((%test-error r etype expr) - (%test-comp1body r (guard (ex (else #t)) expr)))))) - (else - (define-syntax %test-error - (syntax-rules () - ((%test-error r etype expr) - (begin - ((test-runner-on-test-begin r) r) - (test-result-set! r 'result-kind 'skip) - (%test-report-result))))))) - -(cond-expand - ((or kawa mzscheme) - - (define-syntax test-error - (lambda (x) - (syntax-case (list x (list 'quote (%test-source-line2 x))) () - (((mac tname etype expr) line) - (syntax - (let* ((r (test-runner-get)) - (name tname)) - (test-result-alist! r (cons (cons 'test-name tname) line)) - (%test-error r etype expr)))) - (((mac etype expr) line) - (syntax - (let* ((r (test-runner-get))) - (test-result-alist! r line) - (%test-error r etype expr)))) - (((mac expr) line) - (syntax - (let* ((r (test-runner-get))) - (test-result-alist! r line) - (%test-error r #t expr)))))))) - (else - (define-syntax test-error - (syntax-rules () - ((test-error name etype expr) - (test-assert name (%test-error (test-runner-get) etype expr))) - ((test-error etype expr) - (test-assert (%test-error (test-runner-get) etype expr))) - ((test-error expr) - (test-assert (%test-error (test-runner-get) #t expr))))))) - -(define (test-apply first . rest) - (if (test-runner? first) - (test-with-runner first (apply test-apply rest)) - (let ((r (test-runner-current))) - (if r - (let ((run-list (%test-runner-run-list r))) - (cond ((null? rest) - (%test-runner-run-list! r (reverse! run-list)) - (first)) ;; actually apply procedure thunk - (else - (%test-runner-run-list! - r - (if (eq? run-list #t) (list first) (cons first run-list))) - (apply test-apply rest) - (%test-runner-run-list! r run-list)))) - (let ((r (test-runner-create))) - (test-with-runner r (apply test-apply first rest)) - ((test-runner-on-final r) r)))))) - -(define-syntax test-with-runner - (syntax-rules () - ((test-with-runner runner form ...) - (let ((saved-runner (test-runner-current))) - (dynamic-wind - (lambda () (test-runner-current runner)) - (lambda () form ...) - (lambda () (test-runner-current saved-runner))))))) - -;;; Predicates - -(define (%test-match-nth n count) - (let ((i 0)) - (lambda (runner) - (set! i (+ i 1)) - (and (>= i n) (< i (+ n count)))))) - -(define-syntax test-match-nth - (syntax-rules () - ((test-match-nth n) - (test-match-nth n 1)) - ((test-match-nth n count) - (%test-match-nth n count)))) - -(define (%test-match-all . pred-list) - (lambda (runner) - (let ((result #t)) - (let loop ((l pred-list)) - (if (null? l) - result - (begin - (if (not ((car l) runner)) - (set! result #f)) - (loop (cdr l)))))))) - -(define-syntax test-match-all - (syntax-rules () - ((test-match-all pred ...) - (%test-match-all (%test-as-specifier pred) ...)))) - -(define (%test-match-any . pred-list) - (lambda (runner) - (let ((result #f)) - (let loop ((l pred-list)) - (if (null? l) - result - (begin - (if ((car l) runner) - (set! result #t)) - (loop (cdr l)))))))) - -(define-syntax test-match-any - (syntax-rules () - ((test-match-any pred ...) - (%test-match-any (%test-as-specifier pred) ...)))) - -;; Coerce to a predicate function: -(define (%test-as-specifier specifier) - (cond ((procedure? specifier) specifier) - ((integer? specifier) (test-match-nth 1 specifier)) - ((string? specifier) (test-match-name specifier)) - (else - (error "not a valid test specifier")))) - -(define-syntax test-skip - (syntax-rules () - ((test-skip pred ...) - (let ((runner (test-runner-get))) - (%test-runner-skip-list! runner - (cons (test-match-all (%test-as-specifier pred) ...) - (%test-runner-skip-list runner))))))) - -(define-syntax test-expect-fail - (syntax-rules () - ((test-expect-fail pred ...) - (let ((runner (test-runner-get))) - (%test-runner-fail-list! runner - (cons (test-match-all (%test-as-specifier pred) ...) - (%test-runner-fail-list runner))))))) - -(define (test-match-name name) - (lambda (runner) - (equal? name (test-runner-test-name runner)))) - -(define (test-read-eval-string string) - (let* ((port (open-input-string string)) - (form (read port))) - (if (eof-object? (read-char port)) - (eval form) - (cond-expand - (srfi-23 (error "(not at eof)")) - (else "error"))))) - -- cgit From 4645f4105f480f6643f3749013c4eabc3f831124 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 7 Nov 2010 18:31:01 -0800 Subject: Add comments pointing to info on how to write test cases. --- gnuradio-core/src/guile/tests/00_runtime_basics.test | 7 +++++++ gnuradio-core/src/guile/tests/00_runtime_ctors.test | 5 ++++- gnuradio-core/src/guile/tests/filter_ctors.test | 4 ++++ gnuradio-core/src/guile/tests/general_ctors.test | 4 ++++ gnuradio-core/src/guile/tests/gengen_ctors.test | 4 ++++ gnuradio-core/src/guile/tests/hier_ctors.test | 4 ++++ gnuradio-core/src/guile/tests/io_ctors.test | 4 ++++ 7 files changed, 31 insertions(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/00_runtime_basics.test b/gnuradio-core/src/guile/tests/00_runtime_basics.test index c9d251268..90949c8f8 100644 --- a/gnuradio-core/src/guile/tests/00_runtime_basics.test +++ b/gnuradio-core/src/guile/tests/00_runtime_basics.test @@ -18,6 +18,13 @@ ;;; along with this program. If not, see . ;;; +;;; If you're using Emacs's Scheme mode: +;;; (put 'with-test-prefix 'scheme-indent-function 1) + +;;; See the comments in gnuradio/test-suite/lib.scm for info on writing tests. +;;; See also the very end of the file, where the test-equal, test-eqv +;;; and test-eq macros are defined. + (use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) diff --git a/gnuradio-core/src/guile/tests/00_runtime_ctors.test b/gnuradio-core/src/guile/tests/00_runtime_ctors.test index e0a946ab9..0c131f5bd 100644 --- a/gnuradio-core/src/guile/tests/00_runtime_ctors.test +++ b/gnuradio-core/src/guile/tests/00_runtime_ctors.test @@ -21,11 +21,14 @@ ;;; If you're using Emacs's Scheme mode: ;;; (put 'with-test-prefix 'scheme-indent-function 1) +;;; See the comments in gnuradio/test-suite/lib.scm for info on writing tests. +;;; See also the very end of the file where the test-equal, test-eqv +;;; and test-eq macros are defined. + (use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) - ;;; Add test code for all constructors in these files ;;; ;;; ./runtime/gr_hier_block2.h diff --git a/gnuradio-core/src/guile/tests/filter_ctors.test b/gnuradio-core/src/guile/tests/filter_ctors.test index 040b8ba10..9ff251a55 100644 --- a/gnuradio-core/src/guile/tests/filter_ctors.test +++ b/gnuradio-core/src/guile/tests/filter_ctors.test @@ -21,6 +21,10 @@ ;;; If you're using Emacs's Scheme mode: ;;; (put 'with-test-prefix 'scheme-indent-function 1) +;;; See the comments in gnuradio/test-suite/lib.scm for info on writing tests. +;;; See also the very end of the file, where the test-equal, test-eqv +;;; and test-eq macros are defined. + (use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index 8d272f768..ef2a3e729 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -21,6 +21,10 @@ ;;; If you're using Emacs's Scheme mode: ;;; (put 'with-test-prefix 'scheme-indent-function 1) +;;; See the comments in gnuradio/test-suite/lib.scm for info on writing tests. +;;; See also the very end of the file, where the test-equal, test-eqv +;;; and test-eq macros are defined. + (use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) diff --git a/gnuradio-core/src/guile/tests/gengen_ctors.test b/gnuradio-core/src/guile/tests/gengen_ctors.test index 652556d3f..de4ecb35e 100644 --- a/gnuradio-core/src/guile/tests/gengen_ctors.test +++ b/gnuradio-core/src/guile/tests/gengen_ctors.test @@ -21,6 +21,10 @@ ;;; If you're using Emacs's Scheme mode: ;;; (put 'with-test-prefix 'scheme-indent-function 1) +;;; See the comments in gnuradio/test-suite/lib.scm for info on writing tests. +;;; See also the very end of the file, where the test-equal, test-eqv +;;; and test-eq macros are defined. + (use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) diff --git a/gnuradio-core/src/guile/tests/hier_ctors.test b/gnuradio-core/src/guile/tests/hier_ctors.test index c297fb9dd..48d2bfa2d 100644 --- a/gnuradio-core/src/guile/tests/hier_ctors.test +++ b/gnuradio-core/src/guile/tests/hier_ctors.test @@ -21,6 +21,10 @@ ;;; If you're using Emacs's Scheme mode: ;;; (put 'with-test-prefix 'scheme-indent-function 1) +;;; See the comments in gnuradio/test-suite/lib.scm for info on writing tests. +;;; See also the very end of the file, where the test-equal, test-eqv +;;; and test-eq macros are defined. + (use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) diff --git a/gnuradio-core/src/guile/tests/io_ctors.test b/gnuradio-core/src/guile/tests/io_ctors.test index 2001e5fa5..8bb0bc34f 100644 --- a/gnuradio-core/src/guile/tests/io_ctors.test +++ b/gnuradio-core/src/guile/tests/io_ctors.test @@ -21,6 +21,10 @@ ;;; If you're using Emacs's Scheme mode: ;;; (put 'with-test-prefix 'scheme-indent-function 1) +;;; See the comments in gnuradio/test-suite/lib.scm for info on writing tests. +;;; See also the very end of the file, where the test-equal, test-eqv +;;; and test-eq macros are defined. + (use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) -- cgit From 66d6c1b983e48f426b1169be3302407d5116d752 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 7 Nov 2010 23:13:09 -0800 Subject: Add not-yet-working test that should confirm exception raised --- gnuradio-core/src/guile/tests/00_runtime_basics.test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/00_runtime_basics.test b/gnuradio-core/src/guile/tests/00_runtime_basics.test index 90949c8f8..989ae423c 100644 --- a/gnuradio-core/src/guile/tests/00_runtime_basics.test +++ b/gnuradio-core/src/guile/tests/00_runtime_basics.test @@ -96,6 +96,24 @@ (gr:run tb) (test-equal expected-result (gr:data dst)))) +#! +;;; FIXME pass-if-exception is broken if the underlying code throws +;;; (like ours does). Need to write our own test utility for +;;; exceptions. +(with-test-prefix "test-connect-5" + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + (expected-result (vector-map (lambda (x) (* x 2)) src-data)) + (tb (gr:top-block-swig "QA top block")) + (src (gr:vector-source-i src-data #f)) + (op (gr:multiply-const-ii 2)) + (dst (gr:vector-sink-i))) + + ;; FIXME This isn't working... + (pass-if-exception "bad port" exception:swig-exception + (gr:connect tb src op (gr:ep dst 1))) + + )) +!# (with-test-prefix "test-io-signature-1" (let ((ios1 (gr:io-signature 1 2 8)) -- cgit From 10e3659b0cba48e834d577600392edbcfbff3b4b Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Mon, 8 Nov 2010 13:48:44 -0800 Subject: New macros pass-if-throw & expect-fail-throw that test exceptions. Confirmed with "connect-5" test in 00_runtime_basics.test. --- .../src/guile/gnuradio/test-suite/lib.scm | 26 ++++++++++++++++++++++ .../src/guile/tests/00_runtime_basics.test | 21 ++++++----------- 2 files changed, 33 insertions(+), 14 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm b/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm index b7046a8b0..458e627de 100644 --- a/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm +++ b/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm @@ -38,6 +38,7 @@ run-test pass-if expect-fail pass-if-exception expect-fail-exception + pass-if-throw expect-fail-throw ;; Naming groups of tests in a regular fashion. with-test-prefix with-test-prefix* current-test-prefix @@ -340,6 +341,13 @@ `(run-test ,name #f (lambda () ,@rest)))) ;;; A helper function to implement the macros that test for exceptions. +;;; +;;; This doesn't work for all exceptions, just those that were +;;; raised by scm-error or error. This doesn't include those +;;; raised by throw in the general case, or SWIG in particular. +;;; +;;; See also run-raise-exception, pass-if-throw and expect-fail-throw +;;; for alternatives that work with all exceptions. (define (run-test-exception name exception expect-pass thunk) (run-test name expect-pass (lambda () @@ -376,6 +384,24 @@ (defmacro expect-fail-exception (name exception body . rest) `(,run-test-exception ,name ,exception #f (lambda () ,body ,@rest))) + +;;; Helper for macros below +(define (run-test-throw name exception-key expect-pass thunk) + (run-test name expect-pass + (lambda () + (stack-catch exception-key + (lambda () (thunk) #f) + (lambda (key . rest) #t))))) + +;;; A short form for tests that expect a certain exception to be thrown, +;;; where the exception is specified only by the exception-key symbol. +(defmacro pass-if-throw (name exception-key body . rest) + `(,run-test-throw ,name ,exception-key #t (lambda () ,body ,@rest))) + +;;; A short form for tests that expect a certain exception to be thrown, +;;; where the exception is specified only by the exception-key symbol. +(defmacro expect-fail-throw (name exception-key body . rest) + `(,run-test-throw ,name ,exception-key #f (lambda () ,body ,@rest))) ;;;; TEST NAMES ;;;; diff --git a/gnuradio-core/src/guile/tests/00_runtime_basics.test b/gnuradio-core/src/guile/tests/00_runtime_basics.test index 989ae423c..93dcff4d7 100644 --- a/gnuradio-core/src/guile/tests/00_runtime_basics.test +++ b/gnuradio-core/src/guile/tests/00_runtime_basics.test @@ -33,7 +33,7 @@ (list->vector (map f (vector->list v)))) -(with-test-prefix "test-connect-1" +(with-test-prefix "connect-1" (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) (tb (gr:top-block-swig "QA top block")) @@ -50,7 +50,7 @@ (test-equal expected-result (gr:data dst)) )) -(with-test-prefix "test-connect-2" +(with-test-prefix "connect-2" (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) (tb (gr:top-block-swig "QA top block")) @@ -66,7 +66,7 @@ (test-equal expected-result (gr:data dst)))) -(with-test-prefix "test-connect-3" +(with-test-prefix "connect-3" (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) (tb (gr:top-block-swig "QA top block")) @@ -82,7 +82,7 @@ (test-equal expected-result (gr:data dst)))) -(with-test-prefix "test-connect-4" +(with-test-prefix "connect-4" (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) (tb (gr:top-block-swig "QA top block")) @@ -96,11 +96,7 @@ (gr:run tb) (test-equal expected-result (gr:data dst)))) -#! -;;; FIXME pass-if-exception is broken if the underlying code throws -;;; (like ours does). Need to write our own test utility for -;;; exceptions. -(with-test-prefix "test-connect-5" +(with-test-prefix "connect-5" (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) (tb (gr:top-block-swig "QA top block")) @@ -108,14 +104,11 @@ (op (gr:multiply-const-ii 2)) (dst (gr:vector-sink-i))) - ;; FIXME This isn't working... - (pass-if-exception "bad port" exception:swig-exception + (pass-if-throw "bad port exception" 'swig-exception (gr:connect tb src op (gr:ep dst 1))) - )) -!# -(with-test-prefix "test-io-signature-1" +(with-test-prefix "io-signature-1" (let ((ios1 (gr:io-signature 1 2 8)) (ios2 (gr:io-signature2 1 2 16 32)) (ios3 (gr:io-signature3 1 -1 14 32 48)) -- cgit From 95a575c177be15b7d4a8634a071ee11f3fb403f4 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Mon, 8 Nov 2010 13:50:54 -0800 Subject: Add test case. --- .../src/guile/tests/00_runtime_basics.test | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/00_runtime_basics.test b/gnuradio-core/src/guile/tests/00_runtime_basics.test index 93dcff4d7..15bf9cb3f 100644 --- a/gnuradio-core/src/guile/tests/00_runtime_basics.test +++ b/gnuradio-core/src/guile/tests/00_runtime_basics.test @@ -108,6 +108,32 @@ (gr:connect tb src op (gr:ep dst 1))) )) +#! +;;; FIXME currently triggers core dump. +;;; The problem is that swig isn't paying attention to +;;; this throw declaration: +;;; +;;; gr_top_block.i: +;;; void start() throw (std::runtime_error); +;;; +(with-test-prefix "gr_top_block::start throw" + (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) + (expected-result (vector-map (lambda (x) (* x 2)) src-data)) + (tb (gr:top-block-swig "QA top block")) + (src (gr:vector-source-i src-data #f)) + (op (gr:multiply-const-ii 2)) + (dst (gr:vector-sink-i))) + + ;; We deliberately don't connect op's output + (gr:connect tb src op) + + ;; Which should lead to an exception here... + ;; but currently triggers a core dump. + (pass-if-throw "throws std::runtime_error" #t + (gr:run tb)) + )) +!# + (with-test-prefix "io-signature-1" (let ((ios1 (gr:io-signature 1 2 8)) (ios2 (gr:io-signature2 1 2 16 32)) -- cgit From 941c9a792f103c48de6157026d08d7b0a6bae227 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Mon, 8 Nov 2010 14:03:19 -0800 Subject: Enable test case & fix (missing throw (std::runtime_error) declaration). --- gnuradio-core/src/guile/tests/00_runtime_basics.test | 14 ++------------ gnuradio-core/src/lib/runtime/gr_top_block.i | 2 +- 2 files changed, 3 insertions(+), 13 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/00_runtime_basics.test b/gnuradio-core/src/guile/tests/00_runtime_basics.test index 15bf9cb3f..18b298f22 100644 --- a/gnuradio-core/src/guile/tests/00_runtime_basics.test +++ b/gnuradio-core/src/guile/tests/00_runtime_basics.test @@ -108,14 +108,6 @@ (gr:connect tb src op (gr:ep dst 1))) )) -#! -;;; FIXME currently triggers core dump. -;;; The problem is that swig isn't paying attention to -;;; this throw declaration: -;;; -;;; gr_top_block.i: -;;; void start() throw (std::runtime_error); -;;; (with-test-prefix "gr_top_block::start throw" (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) (expected-result (vector-map (lambda (x) (* x 2)) src-data)) @@ -127,12 +119,10 @@ ;; We deliberately don't connect op's output (gr:connect tb src op) - ;; Which should lead to an exception here... - ;; but currently triggers a core dump. - (pass-if-throw "throws std::runtime_error" #t + ;; Which will lead to an exception here... + (pass-if-throw "throws std::runtime_error" 'swig-exception (gr:run tb)) )) -!# (with-test-prefix "io-signature-1" (let ((ios1 (gr:io-signature 1 2 8)) diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.i b/gnuradio-core/src/lib/runtime/gr_top_block.i index d9adf1e18..f18d8890b 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block.i +++ b/gnuradio-core/src/lib/runtime/gr_top_block.i @@ -43,7 +43,7 @@ public: void start() throw (std::runtime_error); void stop(); void wait(); - void run(); + void run() throw (std::runtime_error); void lock(); void unlock() throw (std::runtime_error); void dump(); -- cgit From 0eb9f4f3217dc9a68befab7f205aa2cdc67653f6 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Mon, 8 Nov 2010 14:47:27 -0800 Subject: new test case and fix for problem --- gnuradio-core/src/guile/tests/general_ctors.test | 14 ++++++++++++-- gnuradio-core/src/lib/general/gr_unpack_k_bits_bb.i | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index ef2a3e729..a706c827c 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -29,9 +29,20 @@ (use-modules (gnuradio core)) (use-modules (oop goops)) + +;;; Return #t if x is not #f +(define (true? x) + (and x #t)) + ;;; Add test code for all constructors in these files -;;; + ;;; ./general/gr_additive_scrambler_bb.h +(pass-if (true? (gr:additive-scrambler-bb 0 0 0 0))) + +;; Here's one that will throw if its arg is 0 +(pass-if (true? (gr:unpack-k-bits-bb 10))) +(pass-if-throw "confirm throw" #t (true? (gr:unpack-k-bits-bb 0))) + ;;; ./general/gr_agc2_cc.h ;;; ./general/gr_agc2_ff.h ;;; ./general/gr_agc_cc.h @@ -142,7 +153,6 @@ ;;; ./general/gr_threshold_ff.h ;;; ./general/gr_throttle.h ;;; ./general/gr_uchar_to_float.h -;;; ./general/gr_unpack_k_bits_bb.h ;;; ./general/gr_vco_f.h ;;; ./general/gr_vector_to_stream.h ;;; ./general/gr_vector_to_streams.h diff --git a/gnuradio-core/src/lib/general/gr_unpack_k_bits_bb.i b/gnuradio-core/src/lib/general/gr_unpack_k_bits_bb.i index 5f9a8f134..2e9aa406b 100644 --- a/gnuradio-core/src/lib/general/gr_unpack_k_bits_bb.i +++ b/gnuradio-core/src/lib/general/gr_unpack_k_bits_bb.i @@ -22,7 +22,7 @@ GR_SWIG_BLOCK_MAGIC(gr,unpack_k_bits_bb) -gr_unpack_k_bits_bb_sptr gr_make_unpack_k_bits_bb (int k); +gr_unpack_k_bits_bb_sptr gr_make_unpack_k_bits_bb (int k) throw(std::exception); class gr_unpack_k_bits_bb : public gr_sync_interpolator { -- cgit From b87c20de46e52c4cac66dc80b74db48d60a43095 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Tue, 9 Nov 2010 09:14:34 -0700 Subject: make the tests directory before trying to run any tests --- gnuradio-core/src/guile/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index f3c02a446..c8d05ecfa 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -25,7 +25,6 @@ EXTRA_DIST = \ run_guile_tests.in \ gnuradio/test-suite/guile-test.in - # These are the hand-code guile files for gnuradio-core. # # Swig/common.scm is glue that's required for the goops wrappers. @@ -51,3 +50,7 @@ noinst_DATA = \ tests/io_ctors.test CLEANFILES = guile.log + +check-am: all-am + @test -d "tests" || $(mkinstalldirs) "tests" + $(MAKE) $(AM_MAKEFLAGS) check-TESTS -- cgit From 5f89cc658099916aad49dcff0ebef296eaa09135 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Tue, 9 Nov 2010 09:20:36 -0800 Subject: Remove guile-test.in. We're not rewriting the header anymore --- gnuradio-core/src/guile/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index c8d05ecfa..5eb9444af 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -22,8 +22,7 @@ include $(top_srcdir)/Makefile.common TESTS = run_guile_tests EXTRA_DIST = \ - run_guile_tests.in \ - gnuradio/test-suite/guile-test.in + run_guile_tests.in # These are the hand-code guile files for gnuradio-core. # -- cgit From 5a9a440109ef950ac8b749a55644528204520131 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Tue, 9 Nov 2010 18:41:27 -0700 Subject: add tests for all the constructors, failing ones commented out for now --- gnuradio-core/src/guile/tests/general_ctors.test | 279 ++++++++++++++++++++++- 1 file changed, 274 insertions(+), 5 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index a706c827c..10ee9e9e8 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -29,7 +29,6 @@ (use-modules (gnuradio core)) (use-modules (oop goops)) - ;;; Return #t if x is not #f (define (true? x) (and x #t)) @@ -41,120 +40,390 @@ ;; Here's one that will throw if its arg is 0 (pass-if (true? (gr:unpack-k-bits-bb 10))) -(pass-if-throw "confirm throw" #t (true? (gr:unpack-k-bits-bb 0))) +(pass-if-throw "confirm throw gr:unpack-k-bits-bb" #t (true? (gr:unpack-k-bits-bb 0))) ;;; ./general/gr_agc2_cc.h +(pass-if (true? (gr:agc2-cc 1e-1 1e-2 1.0 1.0 0.0))) + ;;; ./general/gr_agc2_ff.h +(pass-if (true? (gr:agc2-ff 0 0 0 0 0))) + ;;; ./general/gr_agc_cc.h +(pass-if (true? (gr:agc-cc 0 0 0 0))) + ;;; ./general/gr_agc_ff.h +(pass-if (true? (gr:agc-ff 0 0 0 0))) + ;;; ./general/gr_align_on_samplenumbers_ss.h +;; (pass-if (true? (gr:align-on-samplenumbers-ss 0 0))) FIXME: throws + ;;; ./general/gr_bin_statistics_f.h +;; (pass-if (true? (gr:bin-statistics-f 0 0 0 0 0))) FIXME: not found + ;;; ./general/gr_binary_slicer_fb.h +(pass-if (true? (gr:binary-slicer-fb))) + ;;; ./general/gr_bytes_to_syms.h +(pass-if (true? (gr:bytes-to-syms))) + ;;; ./general/gr_char_to_float.h +(pass-if (true? (gr:char-to-float))) + ;;; ./general/gr_check_counting_s.h +;; (pass-if (true? (gr:check-counting-s false))) FIXME: not found + ;;; ./general/gr_check_lfsr_32k_s.h +;; (pass-if (true? (gr:check-lfsr-2k-s))) FIXME: not found + ;;; ./general/gr_clock_recovery_mm_cc.h +(pass-if (true? (gr:clock-recovery-mm-cc 1 1 1 1 1))) +;; (pass-if-throw "confirm throw gr:clock-recovery-mm-cc" #t (true? (gr:clock-recovery-mm-cc 0 0 0 0 0))) FIXME: segfault + ;;; ./general/gr_clock_recovery_mm_ff.h +(pass-if (true? (gr:clock-recovery-mm-ff 1 1 1 1 1))) +;; (pass-if-throw "confirm throw gr:clock-recovery-mm-ff" #t (true? (gr:clock-recovery-mm-ff 0 0 0 0 0))) ;; FIXME: segfault + ;;; ./general/gr_complex_to_interleaved_short.h -;;; ./general/gr_complex_to_xxx.h +(pass-if (true? (gr:complex-to-interleaved-short))) + +;;; ./general/gr_complex_to_xxx.h FIXME: all throw +;; (pass-if (true? (gr:complex-to-float 0))) +;; (pass-if (true? (gr:complex-to-real 0))) +;; (pass-if (true? (gr:complex-to-imag 0))) +;; (pass-if (true? (gr:complex-to-mag 0))) +;; (pass-if (true? (gr:complex-to-mag-squared 0))) +;; (pass-if (true? (gr:complex-to-arg 0))) + ;;; ./general/gr_conjugate_cc.h +(pass-if (true? (gr:conjugate-cc))) + ;;; ./general/gr_constellation_decoder_cb.h +;gr_constellation_decoder_cb (const std::vector &sym_position, +; const std::vector &sym_value_out); +;; (pass-if (true? (gr:constellation_decoder_cb ))) + ;;; ./general/gr_copy.h +;; (pass-if (true? (gr:copy 0))) FIXME: throws + ;;; ./general/gr_correlate_access_code_bb.h +(pass-if (true? (gr:correlate-access-code-bb "foo" 0))) +;; (pass-if-throw "confirm throw correlate-access-code-bb" #t (true? (gr:correlate-access-code-bb "foo" -1))) FIXME: throws + ;;; ./general/gr_costas_loop_cc.h +(pass-if (true? (gr:costas-loop-cc 0 0 0 0 2))) +(pass-if-throw "confirm throw gr:costas-loop-cc" #t (true? (gr:costas-loop-cc 0 0 0 0 3))) + ;;; ./general/gr_cpfsk_bc.h +;; (pass-if (true? (gr:cpfsk-bc 0 0 0))) FIXME: throws + ;;; ./general/gr_ctcss_squelch_ff.h +;; (pass-if (true? (gr:ctcss-squelch-ff 0 0 0 0 0 true))) FIXME: not found + ;;; ./general/gr_decode_ccsds_27_fb.h +(pass-if (true? (gr:decode-ccsds-27-fb))) + ;;; ./general/gr_deinterleave.h +;; (pass-if (true? (gr:deinterleave 0))) FIXME: throws + ;;; ./general/gr_delay.h +;; (pass-if (true? (gr:delay 0 0))) FIXME: throws + ;;; ./general/gr_descrambler_bb.h +(pass-if (true? (gr:descrambler-bb 0 0 0))) + ;;; ./general/gr_diff_decoder_bb.h +(pass-if (true? (gr:diff-decoder-bb 0))) + ;;; ./general/gr_diff_encoder_bb.h +(pass-if (true? (gr:diff-encoder-bb 0))) + ;;; ./general/gr_diff_phasor_cc.h +(pass-if (true? (gr:diff-phasor-cc))) + ;;; ./general/gr_dpll_bb.h +(pass-if (true? (gr:dpll-bb 0 0))) + ;;; ./general/gr_encode_ccsds_27_bb.h +(pass-if (true? (gr:encode-ccsds-27-bb))) + ;;; ./general/gr_fake_channel_coder_pp.h +;; (pass-if (true? (gr:fake-channel-coder-pp 1 1))) FIXME: not found +;; (pass-if-throw "confirm throw" #t (true? (gr:fake-channel-coder-pp -1 1))) + ;;; ./general/gr_feedforward_agc_cc.h +;; (pass-if (true? (gr:feedforward-agc-cc 0 0))) FIXME: throws + ;;; ./general/gr_fft_vcc.h +;; gr_fft_vcc (int fft_size, bool forward, const std::vector &window, bool shift); +;; (pass-if (true? (gr:fft-vcc ))) + ;;; ./general/gr_fft_vcc_fftw.h +;; gr_make_fft_vcc_fftw (int fft_size, bool forward, const std::vector &window, bool shift); +;; (pass-if (true? (gr:fft-vcc-fftw ))) + ;;; ./general/gr_fft_vfc.h +;; bool set_window(const std::vector &window); +;; (pass-if (true? (gr:fft_vfc ))) + ;;; ./general/gr_fll_band_edge_cc.h -;;; ./general/gr_float_to_char.h -;;; ./general/gr_float_to_complex.h +(pass-if (true? (gr:fll-band-edge-cc 0 0 0 0 0))) + +;; ;;; ./general/gr_float_to_char.h +(pass-if (true? (gr:float-to-char))) + +;; ;;; ./general/gr_float_to_complex.h +;; (pass-if (true? (gr:float-to-complex 0))) FIXME: throws + ;;; ./general/gr_float_to_short.h +(pass-if (true? (gr:float-to-short))) + ;;; ./general/gr_float_to_uchar.h +(pass-if (true? (gr:float-to-uchar))) + ;;; ./general/gr_fmdet_cf.h +(pass-if (true? (gr:fmdet-cf 0 0 0 0))) + ;;; ./general/gr_framer_sink_1.h +;; (pass-if (true? (gr:framer-sink-1))) FIXME: not found + ;;; ./general/gr_frequency_modulator_fc.h +(pass-if (true? (gr:frequency-modulator-fc 0))) + ;;; ./general/gr_glfsr_source_b.h +;; (pass-if (true? (gr: glfsr-source-b 0 true 0 0))) FIXME: not found +;; (pass-if-throw "confirm throw" #t (true? (gr:glfsr_source_b 33 true 0 0))) + ;;; ./general/gr_glfsr_source_f.h +;; (pass-if (true? (gr:glfsr-source-f 0 true 0 0))) FIXME: not found +;; (pass-if-throw "confirm throw" #t (true? (gr:glfsr_source_f 33 true 0 0))) + ;;; ./general/gr_head.h +;; (pass-if (true? (gr:head 0 0))) FIXME: throws + ;;; ./general/gr_interleave.h +;; (pass-if (true? (gr:interleave 0))) FIXME: throws + ;;; ./general/gr_interleaved_short_to_complex.h +(pass-if (true? (gr:interleaved-short-to-complex))) + ;;; ./general/gr_iqcomp_cc.h +;; (pass-if (true? (gr:iqcomp-cc 0 0))) FIXME: not found + ;;; ./general/gr_keep_one_in_n.h +;; (pass-if (true? (gr:keep-one-in-n 0 0))) FIXME: throws + ;;; ./general/gr_kludge_copy.h +;; (pass-if (true? (gr:kludge-copy 0))) FIXME: throws + ;;; ./general/gr_lfsr_32k_source_s.h +(pass-if (true? (gr:lfsr-32k-source-s))) + ;;; ./general/gr_lms_dfe_cc.h +;; (pass-if (true? (gr:lms-dfe-ff 0 0 0 0))) FIXME: hangs + ;;; ./general/gr_lms_dfe_ff.h +;; (pass-if (true? (gr:lms-dfe-ff 0 0 0 0))) FIXME: hangs + ;;; ./general/gr_map_bb.h +;; gr_map_bb (const std::vector &map); +;; (pass-if (true? (gr:map-bb xx))) + ;;; ./general/gr_mpsk_receiver_cc.h +;; (pass-if (true? (gr:mpsk-receiver-cc 0 0 0 0 0 0 0 0 0 0 0))) FIXME: throws + ;;; ./general/gr_nlog10_ff.h +;; (pass-if (true? (gr:nlog10-ff 0 0 0))) FIXME: throws + ;;; ./general/gr_nop.h +;; (pass-if (true? (gr:nop 0))) FIXME: throws + ;;; ./general/gr_null_sink.h +;; (pass-if (true? (gr:null-sink 0))) FIXME: throws + ;;; ./general/gr_null_source.h +;; (pass-if (true? (gr:null-source 0)))v FIXME: throws + ;;; ./general/gr_ofdm_bpsk_demapper.h +;; (pass-if (true? (gr:ofdm-bpsk-demapper))) FIXME: not found + ;;; ./general/gr_ofdm_cyclic_prefixer.h +;; (pass-if (true? (gr:ofdm-cyclic-prefixer 0 0))) FIXME: throws + ;;; ./general/gr_ofdm_demapper_vcb.h +;; (pass-if (true? (gr:ofdm-mapper-bcv 0 0))) FIXME: throws + ;;; ./general/gr_ofdm_frame_acquisition.h +;; gr_ofdm_frame_acquisition (unsigned int occupied_carriers, +;; unsigned int fft_length, +;; unsigned int cplen, +;; const std::vector &known_symbol, +;; unsigned int max_fft_shift_len); +;; (pass-if (true? (gr:ofdm-frame-acquisition 0 0 0 (0 0) 0))) + ;;; ./general/gr_ofdm_frame_sink.h +;; gr_ofdm_frame_sink(const std::vector &sym_position, +;; const std::vector &sym_value_out, +;; gr_msg_queue_sptr target_queue, unsigned int occupied_tones, +;; float phase_gain, float freq_gain); +;; (pass-if (true? (gr:ofdm_frame_sink ))) + ;;; ./general/gr_ofdm_insert_preamble.h +;; gr_ofdm_insert_preamble(int fft_length, +;; const std::vector > &preamble); +;; (pass-if (true? (gr:ofdm-insert-preamble ))) + ;;; ./general/gr_ofdm_mapper_bcv.h +;; gr_ofdm_mapper_bcv (const std::vector &constellation, +;; unsigned int msgq_limit, +;; unsigned int bits_per_symbol, +;; unsigned int fft_length); +;; (pass-if (true? (gr:ofdm-mapper-bcv ))) + ;;; ./general/gr_ofdm_sampler.h +;; (pass-if (true? (gr:ofdm-sampler 0 0 0))) FIXME: throws + ;;; ./general/gr_pa_2x2_phase_combiner.h +(pass-if (true? (gr:pa-2x2-phase-combiner))) + ;;; ./general/gr_packet_sink.h +;; (pass-if (true? gr_make_packet_sink (const std::vector& sync_vector, +;; gr_msg_queue_sptr target_queue, +;; int threshold = -1 // -1 -> use default +;; ); +;; (gr:packet-sink ))) + ;;; ./general/gr_peak_detector2_fb.h +(pass-if (true? (gr:peak-detector2-fb 0 0 0))) + ;;; ./general/gr_phase_modulator_fc.h +(pass-if (true? (gr:phase-modulator-fc 0))) + ;;; ./general/gr_pll_carriertracking_cc.h +(pass-if (true? (gr:pll-carriertracking-cc 0 0 0 0))) + ;;; ./general/gr_pll_freqdet_cf.h +(pass-if (true? (gr:pll-freqdet-cf 0 0 0 0))) + ;;; ./general/gr_pll_refout_cc.h +(pass-if (true? (gr:pll-refout-cc 0 0 0 0))) + ;;; ./general/gr_pn_correlator_cc.h +;; (pass-if (true? (gr:pn-correlator-cc 0 0 0))) FIXME: throws + ;;; ./general/gr_probe_avg_mag_sqrd_c.h +(pass-if (true? (gr:probe-avg-mag-sqrd-c 0 0))) + ;;; ./general/gr_probe_avg_mag_sqrd_cf.h +(pass-if (true? (gr:probe-avg-mag-sqrd-cf 0 0))) + ;;; ./general/gr_probe_avg_mag_sqrd_f.h +(pass-if (true? (gr:probe-avg-mag-sqrd-f 0 0))) + ;;; ./general/gr_probe_density_b.h +(pass-if (true? (gr:probe-density-b 0))) + ;;; ./general/gr_probe_mpsk_snr_c.h +(pass-if (true? (gr:probe-mpsk-snr-c 0))) + ;;; ./general/gr_probe_signal_f.h +(pass-if (true? (gr:probe-signal-f))) + ;;; ./general/gr_pwr_squelch_cc.h +;; (pass-if (true? (gr:pwr-squelch-cc 0 0 0 0))) FIXME: not found + ;;; ./general/gr_pwr_squelch_ff.h +;; (pass-if (true? (gr:pwr-squelch-ff 0.0 0.0 0 false))) FIXME: not found + ;;; ./general/gr_quadrature_demod_cf.h +(pass-if (true? (gr:quadrature-demod-cf 0))) + ;;; ./general/gr_rail_ff.h +(pass-if (true? (gr:rail-ff 0 0))) + ;;; ./general/gr_regenerate_bb.h +(pass-if (true? (gr:regenerate-bb 0 0))) + ;;; ./general/gr_repeat.h +;; (pass-if (true? (gr:repeat 0 0))) FIXME: throws + ;;; ./general/gr_rms_cf.h +(pass-if (true? (gr:rms-cf 0))) + ;;; ./general/gr_rms_ff.h +(pass-if (true? (gr:rms-ff 0))) + ;;; ./general/gr_scrambler_bb.h +(pass-if (true? (gr:scrambler-bb 0 0 0))) + ;;; ./general/gr_short_to_float.h +(pass-if (true? (gr:short-to-float))) + ;;; ./general/gr_simple_correlator.h +(pass-if (true? (gr:simple-correlator 0))) + ;;; ./general/gr_simple_framer.h +(pass-if (true? (gr:simple-framer 0))) + ;;; ./general/gr_simple_squelch_cc.h +(pass-if (true? (gr:simple-squelch-cc 0 0))) + ;;; ./general/gr_skiphead.h +;; (pass-if (true? (gr:skiphead 0 0))) FIXME: throws + ;;; ./general/gr_squash_ff.h +;; gr_squash_ff_sptr gr_make_squash_ff(const std::vector &igrid, +;; const std::vector &ogrid); +;; (pass-if (true? (gr:squash_ff ))) + ;;; ./general/gr_squelch_base_cc.h +;; (pass-if (true? (gr:squelch-base-cc "foo" 0 false))) FIXME: not found + ;;; ./general/gr_squelch_base_ff.h +;; (pass-if (true? (gr:squelch-base-ff "foo" 0 false))) FIXME: not found + ;;; ./general/gr_stream_mux.h +;; gr_make_stream_mux (size_t itemsize, +;; const std::vector &lengths); +;; (pass-if (true? (gr:stream_mux ))) + ;;; ./general/gr_stream_to_streams.h +;; (pass-if (true? (gr:stream-to-streams 0 0))) FIXME: throws + ;;; ./general/gr_stream_to_vector.h +;; (pass-if (true? (gr:stream-to-vector 0 0))) FIXME: throws + ;;; ./general/gr_streams_to_stream.h +;; (pass-if (true? (gr:streams-to-stream 0 0))) FIXME: throws + ;;; ./general/gr_streams_to_vector.h +;; (pass-if (true? (gr:streams-to-vector 0 0))) FIXME: throws + ;;; ./general/gr_stretch_ff.h +;; (pass-if (true? (gr:stretch-ff 0 0))) FIXME: throws + ;;; ./general/gr_test.h +(pass-if (true? (gr:test "foo" 1 1 1 1 1 1 1 1))) + ;;; ./general/gr_threshold_ff.h +(pass-if (true? (gr:threshold-ff 0 0))) + ;;; ./general/gr_throttle.h +;; (pass-if (true? (gr:throttle 0 0))) FIXME: throws + ;;; ./general/gr_uchar_to_float.h +(pass-if (true? (gr:uchar-to-float))) + ;;; ./general/gr_vco_f.h +(pass-if (true? (gr:vco-f 0 0 0))) + ;;; ./general/gr_vector_to_stream.h +;; (pass-if (true? (gr:vector-to-stream 0 0))) FIXME: throws + ;;; ./general/gr_vector_to_streams.h +;; (pass-if (true? (gr:vector-to-streams 0 0))) FIXME: throws + ;;; ./general/gr_wavelet_ff.h +;; (pass-if (true? (gr:wavelet-ff 0 0))) FIXME: throws + ;;; ./general/gr_wvps_ff.h +;; (pass-if (true? (gr:wvps_ff 0))) FIXME: throws -- cgit From 5228dd1ba5de72642208404b29f8b876fe59f388 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Tue, 9 Nov 2010 18:42:48 -0800 Subject: First pass at waveform-spec --- gnuradio-core/src/guile/gnuradio/waveform-spec.scm | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 gnuradio-core/src/guile/gnuradio/waveform-spec.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/gnuradio/waveform-spec.scm b/gnuradio-core/src/guile/gnuradio/waveform-spec.scm new file mode 100644 index 000000000..956a36106 --- /dev/null +++ b/gnuradio-core/src/guile/gnuradio/waveform-spec.scm @@ -0,0 +1,36 @@ +;;; +;;; 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 . +;;; + +(define-module (gnuradio waveform-spec) + #:use-module (ice-9 syncase) + #:export-syntax waveform-spec) + +(define-syntax waveform-spec + (syntax-rules (vars blocks connections) + ((_ (args ...) + (vars (v-name v-val) ...) + (blocks (b-name b-val) ...) + (connections (endpoint1 endpoint2 ...) ...)) + (lambda (args ...) + (let* ((v-name v-val) ... + (b-name b-val) ... + (tb (gr:top-block-swig "waveform-top-block"))) + (gr:connect tb endpoint1 endpoint2 ...) ... + tb))))) + -- cgit From 15987345134793d3f6f0618bdf6b45ffc6609c0c Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Tue, 9 Nov 2010 19:26:40 -0800 Subject: Example of how to fix throw crashes --- gnuradio-core/src/guile/tests/general_ctors.test | 3 ++- gnuradio-core/src/lib/general/gr_align_on_samplenumbers_ss.i | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index 10ee9e9e8..0580d6382 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -55,7 +55,8 @@ (pass-if (true? (gr:agc-ff 0 0 0 0))) ;;; ./general/gr_align_on_samplenumbers_ss.h -;; (pass-if (true? (gr:align-on-samplenumbers-ss 0 0))) FIXME: throws +(pass-if (true? (gr:align-on-samplenumbers-ss 2 128))) +(pass-if-throw "confirm throw gr:align-on-samplenumbers-ss" #t (true? (gr:align-on-samplenumbers-ss 0 0))) ;;; ./general/gr_bin_statistics_f.h ;; (pass-if (true? (gr:bin-statistics-f 0 0 0 0 0))) FIXME: not found diff --git a/gnuradio-core/src/lib/general/gr_align_on_samplenumbers_ss.i b/gnuradio-core/src/lib/general/gr_align_on_samplenumbers_ss.i index 841613ca6..ea73dd46d 100644 --- a/gnuradio-core/src/lib/general/gr_align_on_samplenumbers_ss.i +++ b/gnuradio-core/src/lib/general/gr_align_on_samplenumbers_ss.i @@ -22,7 +22,8 @@ GR_SWIG_BLOCK_MAGIC(gr,align_on_samplenumbers_ss); -gr_align_on_samplenumbers_ss_sptr gr_make_align_on_samplenumbers_ss(int nchan=2, int align_interval=128); +gr_align_on_samplenumbers_ss_sptr +gr_make_align_on_samplenumbers_ss(int nchan=2, int align_interval=128) throw (std::exception); class gr_align_on_samplenumbers_ss : public gr_block { -- cgit From 1c2355390190f67762a39d77424b5e48563cfe9a Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Tue, 9 Nov 2010 21:51:45 -0700 Subject: stub out all the tests, but they depend on the next branch. :-( --- gnuradio-core/src/guile/tests/io_ctors.test | 37 +++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/io_ctors.test b/gnuradio-core/src/guile/tests/io_ctors.test index 8bb0bc34f..6516ef7fe 100644 --- a/gnuradio-core/src/guile/tests/io_ctors.test +++ b/gnuradio-core/src/guile/tests/io_ctors.test @@ -31,16 +31,49 @@ ;;; Add test code for all constructors in these files ;;; + ;;; ./io/gr_file_descriptor_sink.h +;;(pass-if (true? (gr:file-descriptor-sink 0 0))) FIXME: throws gr_io_signature(3) + ;;; ./io/gr_file_descriptor_source.h +;; (pass-if (true? (gr:file-descriptor-source 1 1 false))) FIXME: not found + ;;; ./io/gr_file_sink.h +(pass-if (true? (gr:file-sink 1 "foo"))) + ;;; ./io/gr_file_source.h -;;; ./io/gr_histo_sink_f.h +;; (pass-if (true? (gr:file-source 1 "foo" false))) FIXME: not found + +;;; ./io/gr_histo_sink_f.h FIXME: needs gr_msg_queue_sptr +;; gr_make_histo_sink_f (gr_msg_queue_sptr msgq); +;; (pass-if (true? (gr:histo-sink-f ))) + ;;; ./io/gr_message_sink.h +;; (pass-if (true? (gr:message-sink ))) + ;;; ./io/gr_message_source.h -;;; ./io/gr_oscope_sink_f.h +;; (pass-if (true? (gr:message-source ))) + +;;; ./io/gr_oscope_sink_f.h FIXME: needs gr_io_signature_sptr +;; _oscope_sink_x (const std::string name, gr_io_signature_sptr input_sig, +;; double sample_rate); +;; (pass-if (true? (gr:oscope-sink-f ))) + ;;; ./io/gr_oscope_sink_x.h + +;; gr_oscope_sink_x (const std::string name, +;; gr_io_signature_sptr input_sig, +;; double sampling_rate); +;; (pass-if (true? (gr:oscope_sink_x ))) + ;;; ./io/gr_udp_sink.h + ;;; ./io/gr_udp_source.h +;; (pass-if (true? (gr:message-source 0 "foo" 0 1472 true true))) FIXME: not found + ;;; ./io/gr_wavfile_sink.h +;; (pass-if (true? (gr:message-source "foo" 1 1 1))) FIXME: not found + ;;; ./io/gr_wavfile_source.h +;; (pass-if (true? (gr:message-source "foo" false))) FIXME: not found + -- cgit From ab0d7d5b428fdf39d38f335a0ea6fc9be4924ca5 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Tue, 9 Nov 2010 21:56:08 -0700 Subject: add tests for the stuff that works, stubs for the rest --- gnuradio-core/src/guile/tests/gengen_ctors.test | 84 ++++++++++++++++++++++--- 1 file changed, 74 insertions(+), 10 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/gengen_ctors.test b/gnuradio-core/src/guile/tests/gengen_ctors.test index de4ecb35e..ead12a729 100644 --- a/gnuradio-core/src/guile/tests/gengen_ctors.test +++ b/gnuradio-core/src/guile/tests/gengen_ctors.test @@ -31,34 +31,98 @@ ;;; Add test code for all constructors in these files ;;; + ;;; ./gengen/gr_add_cc.h +;; (pass-if (true? (gr:add-cc 0))) FIXME: throws gr_io_signature(3) + ;;; ./gengen/gr_add_const_cc.h +(pass-if (true? (gr:add-const-cc 0))) + ;;; ./gengen/gr_add_const_ff.h +(pass-if (true? (gr:add-const-ff 0))) + ;;; ./gengen/gr_add_const_ii.h +(pass-if (true? (gr:add-const-ii 0))) + ;;; ./gengen/gr_add_const_sf.h +(pass-if (true? (gr:add-const-sf 0))) + ;;; ./gengen/gr_add_const_ss.h -;;; ./gengen/gr_add_const_vcc.h -;;; ./gengen/gr_add_const_vff.h -;;; ./gengen/gr_add_const_vii.h -;;; ./gengen/gr_add_const_vss.h +(pass-if (true? (gr:add-const-ss 0))) + +;;; ./gengen/gr_add_const_vcc.h FIXME: needs complex +;; gr_make_add_const_vcc (const std::vector &k); +;; (pass-if (true? (gr:add-const-vcc 0))) + +;;; ./gengen/gr_add_const_vff.h FIXME: needs vector +;; gr_make_add_const_vff (const std::vector &k); +;; (pass-if (true? (gr:add-const-vff ))) + +;;; ./gengen/gr_add_const_vii.h FIXME: needs vector +;; gr_make_add_const_vii (const std::vector &k); +;; (pass-if (true? (gr:add-const-vii ))) + +;;; ./gengen/gr_add_const_vss.h FIXME: needs vector +;; (pass-if (true? (gr:add-const-vss ))) + ;;; ./gengen/gr_add_ff.h +;; (pass-if (true? (gr:add-ff 0))) FIXME: throws gr_io_signature(3) + ;;; ./gengen/gr_add_ii.h +;; (pass-if (true? (gr:add-ii 0))) FIXME: throws gr_io_signature(3) + ;;; ./gengen/gr_add_ss.h +;; (pass-if (true? (gr:add-ss 0 ))) FIXME: throws gr_io_signature(3) + ;;; ./gengen/gr_and_bb.h +(pass-if (true? (gr:and-bb))) + ;;; ./gengen/gr_and_const_bb.h +(pass-if (true? (gr:and-const-bb 0))) + ;;; ./gengen/gr_and_const_ii.h +(pass-if (true? (gr:and-const-ii 0))) + ;;; ./gengen/gr_and_const_ss.h +(pass-if (true? (gr:and-const-ss 0))) + ;;; ./gengen/gr_and_ii.h +(pass-if (true? (gr:and-ii))) + ;;; ./gengen/gr_and_ss.h +(pass-if (true? (gr:and-ss))) + ;;; ./gengen/gr_argmax_fs.h +(pass-if (true? (gr:argmax-fs 1))) + ;;; ./gengen/gr_argmax_is.h +(pass-if (true? (gr:argmax-is 1))) + ;;; ./gengen/gr_argmax_ss.h -;;; ./gengen/gr_chunks_to_symbols_bc.h -;;; ./gengen/gr_chunks_to_symbols_bf.h -;;; ./gengen/gr_chunks_to_symbols_ic.h -;;; ./gengen/gr_chunks_to_symbols_if.h -;;; ./gengen/gr_chunks_to_symbols_sc.h -;;; ./gengen/gr_chunks_to_symbols_sf.h +(pass-if (true? (gr:argmax-ss 1))) + +;;; ./gengen/gr_chunks_to_symbols_bc.h FIXME: needs vector +;; gr_make_chunks_to_symbols_bc (const std::vector &symbol_table, const int D = 1); +;; (pass-if (true? (gr:chunks-to-symbols-bc ))) + +;;; ./gengen/gr_chunks_to_symbols_bf.h FIXME: needs vector +;; gr_make_chunks_to_symbols_bf (const std::vector &symbol_table, const int D = 1); +;; (pass-if (true? (gr:chunks-to-symbols-bf ))) + +;;; ./gengen/gr_chunks_to_symbols_ic.h FIXME: needs vector +;; gr_make_chunks_to_symbols_ic (const std::vector &symbol_table, const int D = 1); +;; (pass-if (true? (gr:chunks-to-symbols-ic ))) + +;;; ./gengen/gr_chunks_to_symbols_if.h FIXME: needs vector +;; gr_make_chunks_to_symbols_if (const std::vector &symbol_table, const int D = 1); +;; (pass-if (true? (gr:chunks_to_symbols_if ))) + +;;; ./gengen/gr_chunks_to_symbols_sc.h FIXME: needs vector +;; (pass-if (true? (gr:chunks_to_symbols_sc ))) + +;;; ./gengen/gr_chunks_to_symbols_sf.h FIXME: needs vector +;; (pass-if (true? (gr:chunks_to_symbols_sf ))) + ;;; ./gengen/gr_divide_cc.h ;;; ./gengen/gr_divide_ff.h ;;; ./gengen/gr_divide_ii.h -- cgit From b580c7b327028fc5cfd48cdebe8cab819c17fa75 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Tue, 9 Nov 2010 21:56:45 -0700 Subject: add stub for the only test --- gnuradio-core/src/guile/tests/hier_ctors.test | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/hier_ctors.test b/gnuradio-core/src/guile/tests/hier_ctors.test index 48d2bfa2d..8a83c86d5 100644 --- a/gnuradio-core/src/guile/tests/hier_ctors.test +++ b/gnuradio-core/src/guile/tests/hier_ctors.test @@ -31,4 +31,10 @@ ;;; Add test code for all constructors in these files ;;; + ;;; ./hier/gr_channel_model.h +;; gr_make_channel_model(double noise_voltage=0.0, double frequency_offset=0.0, +;; double epsilon=1.0, +;; const std::vector &taps=std::vector(1, 1), +;; double noise_seed=3021); +;; (pass-if (true? (gr:channel_model ))) -- cgit From b4f491386b9cb67cd35cee8032f559442822ddab Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Wed, 10 Nov 2010 09:36:27 -0700 Subject: initial blast through gengen tests --- gnuradio-core/src/guile/tests/gengen_ctors.test | 232 +++++++++++++++++++++--- 1 file changed, 204 insertions(+), 28 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/gengen_ctors.test b/gnuradio-core/src/guile/tests/gengen_ctors.test index ead12a729..5bdd207f9 100644 --- a/gnuradio-core/src/guile/tests/gengen_ctors.test +++ b/gnuradio-core/src/guile/tests/gengen_ctors.test @@ -124,77 +124,253 @@ ;; (pass-if (true? (gr:chunks_to_symbols_sf ))) ;;; ./gengen/gr_divide_cc.h +(pass-if (true? (gr:divide-cc 1))) + ;;; ./gengen/gr_divide_ff.h +(pass-if (true? (gr:divide-ff 1))) + ;;; ./gengen/gr_divide_ii.h +(pass-if (true? (gr:divide-ii 1))) + ;;; ./gengen/gr_divide_ss.h +(pass-if (true? (gr:divide-ss 1))) + ;;; ./gengen/gr_integrate_cc.h +(pass-if (true? (gr:integrate-cc 0))) + ;;; ./gengen/gr_integrate_ff.h +(pass-if (true? (gr:integrate-ff 0))) + ;;; ./gengen/gr_integrate_ii.h +(pass-if (true? (gr:integrate-ii 0))) + ;;; ./gengen/gr_integrate_ss.h +(pass-if (true? (gr:integrate-ss 0))) + ;;; ./gengen/gr_max_ff.h +(pass-if (true? (gr:max-ff 1))) + ;;; ./gengen/gr_max_ii.h +(pass-if (true? (gr:max-ii 1))) + ;;; ./gengen/gr_max_ss.h -;;; ./gengen/gr_moving_average_cc.h +(pass-if (true? (gr:max-ss 1))) + +;;; ./gengen/gr_moving_average_cc.h FIXME: needs gr_complex +;; gr_make_moving_average_cc (int length, gr_complex scale, int max_iter=4096); +;; (pass-if (true? (gr:moving-average-cc ))) + ;;; ./gengen/gr_moving_average_ff.h +(pass-if (true? (gr:moving-average-ff 1 0 4096))) + ;;; ./gengen/gr_moving_average_ii.h +(pass-if (true? (gr:moving-average-ii 1 0 4096))) + ;;; ./gengen/gr_moving_average_ss.h +(pass-if (true? (gr:moving-average-ss 1 0 4096))) + ;;; ./gengen/gr_multiply_cc.h +(pass-if (true? (gr:multiply-cc 1))) + ;;; ./gengen/gr_multiply_const_cc.h +(pass-if (true? (gr:multiply-const-cc 1))) + ;;; ./gengen/gr_multiply_const_ff.h +(pass-if (true? (gr:multiply-const-ff 1))) + ;;; ./gengen/gr_multiply_const_ii.h +(pass-if (true? (gr:multiply-const-ii 1))) + ;;; ./gengen/gr_multiply_const_ss.h -;;; ./gengen/gr_multiply_const_vcc.h -;;; ./gengen/gr_multiply_const_vff.h -;;; ./gengen/gr_multiply_const_vii.h -;;; ./gengen/gr_multiply_const_vss.h +(pass-if (true? (gr:multiply-const-ss 1))) + +;;; ./gengen/gr_multiply_const_vcc.h FIXME: needs vector +;; gr_make_multiply_const_vcc (const std::vector &k); +;; (pass-if (true? (gr:multiply-const-vcc 1))) + +;;; ./gengen/gr_multiply_const_vff.h FIXME: needs vector +;; gr_make_multiply_const_vff (const std::vector &k); +;; (pass-if (true? (gr:multiply-const-vff ))) + +;;; ./gengen/gr_multiply_const_vii.h FIXME: needs vector +;; gr_make_multiply_const_vii (const std::vector &k); +;; (pass-if (true? (gr:multiply-const-vii ))) + +;;; ./gengen/gr_multiply_const_vss.h FIXME: needs vector +;; gr_make_multiply_const_vss (const std::vector &k); +;; (pass-if (true? (gr:multiply-const-vss ))) + ;;; ./gengen/gr_multiply_ff.h +(pass-if (true? (gr:multiply-ff 1))) + ;;; ./gengen/gr_multiply_ii.h +(pass-if (true? (gr:multiply-ii 1))) + ;;; ./gengen/gr_multiply_ss.h -;;; ./gengen/gr_mute_cc.h -;;; ./gengen/gr_mute_ff.h -;;; ./gengen/gr_mute_ii.h -;;; ./gengen/gr_mute_ss.h -;;; ./gengen/gr_noise_source_c.h -;;; ./gengen/gr_noise_source_f.h -;;; ./gengen/gr_noise_source_i.h -;;; ./gengen/gr_noise_source_s.h +(pass-if (true? (gr:multiply-ss 1))) + +;;; ./gengen/gr_mute_cc.h FIXME: not found +;; (pass-if (true? (gr:mute-cc false))) + +;;; ./gengen/gr_mute_ff.h FIXME: not found +;;(pass-if (true? (gr:mute-ff false))) + +;;; ./gengen/gr_mute_ii.h FIXME: not found +;; (pass-if (true? (gr:mute-ii false))) + +;;; ./gengen/gr_mute_ss.h FIXME: not found +;; (pass-if (true? (gr:mute-ss false))) + +;;; ./gengen/gr_noise_source_c.h FIXME: needs gr_noise_type_t +;; gr_make_noise_source_c (gr_noise_type_t type, float ampl, long seed = 3021); +;; (pass-if (true? (gr:noise-source-c ))) + +;;; ./gengen/gr_noise_source_f.h FIXME: needs gr_noise_type_t +;; gr_make_noise_source_f (gr_noise_type_t type, float ampl, long seed = 3021); +;; (pass-if (true? (gr:noise-source-f ))) + +;;; ./gengen/gr_noise_source_i.h FIXME: needs gr_noise_type_t +;; gr_make_noise_source_i (gr_noise_type_t type, float ampl, long seed = 3021); +;; (pass-if (true? (gr:noise-source-i ))) + +;;; ./gengen/gr_noise_source_s.h FIXME: needs gr_noise_type_t +;; gr_make_noise_source_s (gr_noise_type_t type, float ampl, long seed = 3021); +;; (pass-if (true? (gr:noise-source-s ))) + ;;; ./gengen/gr_not_bb.h +(pass-if (true? (gr:not-bb))) + ;;; ./gengen/gr_not_ii.h +(pass-if (true? (gr:not-ii))) + ;;; ./gengen/gr_not_ss.h +(pass-if (true? (gr:not-ss))) + ;;; ./gengen/gr_or_bb.h +(pass-if (true? (gr:or-bb))) + ;;; ./gengen/gr_or_ii.h +(pass-if (true? (gr:or-ii))) + ;;; ./gengen/gr_or_ss.h -;;; ./gengen/gr_packed_to_unpacked_bb.h -;;; ./gengen/gr_packed_to_unpacked_ii.h -;;; ./gengen/gr_packed_to_unpacked_ss.h +(pass-if (true? (gr:or-ss))) + +;;; ./gengen/gr_packed_to_unpacked_bb.h FIXME: needs gr_endianness_t +;; gr_make_packed_to_unpacked_bb (unsigned int bits_per_chunk, gr_endianness_t endianness); +;; (pass-if (true? (gr:packed-to-unpacked-bb ))) + +;;; ./gengen/gr_packed_to_unpacked_ii.h FIXME: needs gr_endianness_t +;; gr_make_packed_to_unpacked_ii (unsigned int bits_per_chunk, gr_endianness_t endianness); +;; (pass-if (true? (gr:packed-to-unpacked-ii ))) + +;;; ./gengen/gr_packed_to_unpacked_ss.h FIXME: needs gr_endianness_t +;; gr_make_packed_to_unpacked_ss (unsigned int bits_per_chunk, gr_endianness_t endianness); +;; (pass-if (true? (gr:packed-to-unpacked-ss ))) + ;;; ./gengen/gr_peak_detector_fb.h +(pass-if (true? (gr:peak-detector-fb 0.25 0.40 10 0.001))) + ;;; ./gengen/gr_peak_detector_ib.h +(pass-if (true? (gr:peak-detector-ib 0.25 0.40 10 0.001))) + ;;; ./gengen/gr_peak_detector_sb.h +(pass-if (true? (gr:peak-detector-sb 0.25 0.40 10 0.001))) + ;;; ./gengen/gr_sample_and_hold_bb.h +(pass-if (true? (gr:sample-and-hold-bb))) + ;;; ./gengen/gr_sample_and_hold_ff.h +(pass-if (true? (gr:sample-and-hold-ff))) + ;;; ./gengen/gr_sample_and_hold_ii.h +(pass-if (true? (gr:sample-and-hold-ii))) + ;;; ./gengen/gr_sample_and_hold_ss.h -;;; ./gengen/gr_sig_source_c.h -;;; ./gengen/gr_sig_source_f.h -;;; ./gengen/gr_sig_source_i.h -;;; ./gengen/gr_sig_source_s.h +(pass-if (true? (gr:sample-and-hold-ss))) + +;;; ./gengen/gr_sig_source_c.h FIXME: needs gr_waveform_t +;; gr_make_sig_source_c (double sampling_freq, gr_waveform_t waveform, +;; double wave_freq, double ampl, gr_complex offset = 0); +;; (pass-if (true? (gr:sig-source-c ))) + +;;; ./gengen/gr_sig_source_f.h FIXME: needs gr_waveform_t +;; gr_make_sig_source_f (double sampling_freq, gr_waveform_t waveform, +;; double wave_freq, double ampl, float offset = 0); +;; (pass-if (true? (gr:sig-source-f ))) + +;;; ./gengen/gr_sig_source_i.h FIXME: needs gr_waveform_t +;; gr_make_sig_source_i (double sampling_freq, gr_waveform_t waveform, +;; double wave_freq, double ampl, int offset = 0); +;; (pass-if (true? (gr:sig-source-i ))) + +;;; ./gengen/gr_sig_source_s.h FIXME: needs gr_waveform_t +;; gr_make_sig_source_s (double sampling_freq, gr_waveform_t waveform, +;; double wave_freq, double ampl, short offset = 0); +;; (pass-if (true? (gr:sig-source-s ))) + ;;; ./gengen/gr_sub_cc.h +(pass-if (true? (gr:sub-cc 1))) + ;;; ./gengen/gr_sub_ff.h +(pass-if (true? (gr:sub-ff 1))) + ;;; ./gengen/gr_sub_ii.h +(pass-if (true? (gr:sub-ii 1))) + ;;; ./gengen/gr_sub_ss.h -;;; ./gengen/gr_unpacked_to_packed_bb.h -;;; ./gengen/gr_unpacked_to_packed_ii.h -;;; ./gengen/gr_unpacked_to_packed_ss.h +(pass-if (true? (gr:sub-ss 1))) + +;;; ./gengen/gr_unpacked_to_packed_bb.h FIXME: needs gr_endianness_t +;; gr_make_unpacked_to_packed_bb (unsigned int bits_per_chunk, gr_endianness_t endianness); +;; (pass-if (true? (gr:unpacked-to-packed-bb ))) + +;;; ./gengen/gr_unpacked_to_packed_ii.h FIXME: needs gr_endianness_t +;; gr_make_unpacked_to_packed_ii (unsigned int bits_per_chunk, gr_endianness_t endianness); +;; (pass-if (true? (gr:unpacked-to-packed-ii ))) + +;;; ./gengen/gr_unpacked_to_packed_ss.h FIXME: needs gr_endianness_t +;; gr_make_unpacked_to_packed_ss (unsigned int bits_per_chunk, gr_endianness_t endianness); +;; (pass-if (true? (gr:unpacked-to-packed-ss ))) + ;;; ./gengen/gr_vector_sink_b.h +(pass-if (true? (gr:vector-sink-b 1))) + ;;; ./gengen/gr_vector_sink_c.h +(pass-if (true? (gr:vector-sink-c 1))) + ;;; ./gengen/gr_vector_sink_f.h +(pass-if (true? (gr:vector-sink-f 1))) + ;;; ./gengen/gr_vector_sink_i.h +(pass-if (true? (gr:vector-sink-i 1))) + ;;; ./gengen/gr_vector_sink_s.h -;;; ./gengen/gr_vector_source_b.h -;;; ./gengen/gr_vector_source_c.h -;;; ./gengen/gr_vector_source_f.h -;;; ./gengen/gr_vector_source_i.h -;;; ./gengen/gr_vector_source_s.h +(pass-if (true? (gr:vector-sink-s 1))) + +;;; ./gengen/gr_vector_source_b.h FIXME: needs vector, may throw +;; gr_make_vector_source_b (const std::vector &data, bool repeat = false, int vlen = 1) +;; (pass-if (true? (gr:vector-source-b ))) + +;;; ./gengen/gr_vector_source_c.h FIXME: needs vector, may throw +;; gr_make_vector_source_c (const std::vector &data, bool repeat = false, int vlen = 1) +;; (pass-if (true? (gr:vector-source-c ))) + +;;; ./gengen/gr_vector_source_f.h FIXME: needs vector, may throw +;; gr_make_vector_source_f (const std::vector &data, bool repeat = false, int vlen = 1) +;; (pass-if (true? (gr:vector-source-f ))) + +;;; ./gengen/gr_vector_source_i.h FIXME: needs vector, may throw +;; gr_make_vector_source_i (const std::vector &data, bool repeat = false, int vlen = 1) +;; (pass-if (true? (gr:vector-source-i ))) + +;;; ./gengen/gr_vector_source_s.h FIXME: needs vector, may throw +;; (pass-if (true? (gr:vector-source-s ))) + ;;; ./gengen/gr_xor_bb.h +(pass-if (true? (gr:xor-bb))) + ;;; ./gengen/gr_xor_ii.h +(pass-if (true? (gr:xor-ii))) + ;;; ./gengen/gr_xor_ss.h +(pass-if (true? (gr:xor-ss))) -- cgit From 2567c81d0236437034b0ab02de8e5cc657064249 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Wed, 10 Nov 2010 10:14:14 -0700 Subject: fix most of the tests to work. --- gnuradio-core/src/guile/tests/gengen_ctors.test | 173 ++++++++++-------------- 1 file changed, 73 insertions(+), 100 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/gengen_ctors.test b/gnuradio-core/src/guile/tests/gengen_ctors.test index 5bdd207f9..f05feceb6 100644 --- a/gnuradio-core/src/guile/tests/gengen_ctors.test +++ b/gnuradio-core/src/guile/tests/gengen_ctors.test @@ -50,29 +50,27 @@ ;;; ./gengen/gr_add_const_ss.h (pass-if (true? (gr:add-const-ss 0))) -;;; ./gengen/gr_add_const_vcc.h FIXME: needs complex +;;; ./gengen/gr_add_const_vcc.h FIXME: Wrong type argument in position ~A: ;; gr_make_add_const_vcc (const std::vector &k); -;; (pass-if (true? (gr:add-const-vcc 0))) +;; (pass-if (true? (gr:add-const-vcc #(1+3i 23+5i)))) -;;; ./gengen/gr_add_const_vff.h FIXME: needs vector -;; gr_make_add_const_vff (const std::vector &k); -;; (pass-if (true? (gr:add-const-vff ))) +;;; ./gengen/gr_add_const_vff.h +(pass-if (true? (gr:add-const-vff #(1.0 2.0)))) -;;; ./gengen/gr_add_const_vii.h FIXME: needs vector -;; gr_make_add_const_vii (const std::vector &k); -;; (pass-if (true? (gr:add-const-vii ))) +;;; ./gengen/gr_add_const_vii.h +(pass-if (true? (gr:add-const-vii #(1 2)))) -;;; ./gengen/gr_add_const_vss.h FIXME: needs vector -;; (pass-if (true? (gr:add-const-vss ))) +;;; ./gengen/gr_add_const_vss.h +(pass-if (true? (gr:add-const-vss #(1 2)))) ;;; ./gengen/gr_add_ff.h -;; (pass-if (true? (gr:add-ff 0))) FIXME: throws gr_io_signature(3) +(pass-if (true? (gr:add-ff 1))) ;;; ./gengen/gr_add_ii.h -;; (pass-if (true? (gr:add-ii 0))) FIXME: throws gr_io_signature(3) +(pass-if (true? (gr:add-ii 1))) ;;; ./gengen/gr_add_ss.h -;; (pass-if (true? (gr:add-ss 0 ))) FIXME: throws gr_io_signature(3) +(pass-if (true? (gr:add-ss 1))) ;;; ./gengen/gr_and_bb.h (pass-if (true? (gr:and-bb))) @@ -101,27 +99,25 @@ ;;; ./gengen/gr_argmax_ss.h (pass-if (true? (gr:argmax-ss 1))) -;;; ./gengen/gr_chunks_to_symbols_bc.h FIXME: needs vector -;; gr_make_chunks_to_symbols_bc (const std::vector &symbol_table, const int D = 1); -;; (pass-if (true? (gr:chunks-to-symbols-bc ))) +;;; ./gengen/gr_chunks_to_symbols_bc.h FIXME: not found +;; (pass-if (true? (gr:chunks-to-symbols-bc #(1+3i 23+5i) 1))) -;;; ./gengen/gr_chunks_to_symbols_bf.h FIXME: needs vector -;; gr_make_chunks_to_symbols_bf (const std::vector &symbol_table, const int D = 1); -;; (pass-if (true? (gr:chunks-to-symbols-bf ))) +;;; ./gengen/gr_chunks_to_symbols_bf.h +(pass-if (true? (gr:chunks-to-symbols-bf #(1.0 2.0) 1))) -;;; ./gengen/gr_chunks_to_symbols_ic.h FIXME: needs vector +;;; ./gengen/gr_chunks_to_symbols_ic.h FIXME: not found ;; gr_make_chunks_to_symbols_ic (const std::vector &symbol_table, const int D = 1); -;; (pass-if (true? (gr:chunks-to-symbols-ic ))) +;; (pass-if (true? (gr:chunks-to-symbols-ic #(1+3i 23+5i) 1))) -;;; ./gengen/gr_chunks_to_symbols_if.h FIXME: needs vector +;;; ./gengen/gr_chunks_to_symbols_if.h FIXME: not found ;; gr_make_chunks_to_symbols_if (const std::vector &symbol_table, const int D = 1); -;; (pass-if (true? (gr:chunks_to_symbols_if ))) +;; (pass-if (true? (gr:chunks_to_symbols_if #(1.0 2.0) 1))) -;;; ./gengen/gr_chunks_to_symbols_sc.h FIXME: needs vector -;; (pass-if (true? (gr:chunks_to_symbols_sc ))) +;;; ./gengen/gr_chunks_to_symbols_sc.h FIXME: not found +;; (pass-if (true? (gr:chunks_to_symbols_sc #(1.0 2.0) 1))) -;;; ./gengen/gr_chunks_to_symbols_sf.h FIXME: needs vector -;; (pass-if (true? (gr:chunks_to_symbols_sf ))) +;;; ./gengen/gr_chunks_to_symbols_sf.h FIXME: not found +;; (pass-if (true? (gr:chunks_to_symbols_sf #(1.0 2.0) 1))) ;;; ./gengen/gr_divide_cc.h (pass-if (true? (gr:divide-cc 1))) @@ -156,9 +152,8 @@ ;;; ./gengen/gr_max_ss.h (pass-if (true? (gr:max-ss 1))) -;;; ./gengen/gr_moving_average_cc.h FIXME: needs gr_complex -;; gr_make_moving_average_cc (int length, gr_complex scale, int max_iter=4096); -;; (pass-if (true? (gr:moving-average-cc ))) +;;; ./gengen/gr_moving_average_cc.h +(pass-if (true? (gr:moving-average-cc 1 1+3i 4096))) ;;; ./gengen/gr_moving_average_ff.h (pass-if (true? (gr:moving-average-ff 1 0 4096))) @@ -184,21 +179,18 @@ ;;; ./gengen/gr_multiply_const_ss.h (pass-if (true? (gr:multiply-const-ss 1))) -;;; ./gengen/gr_multiply_const_vcc.h FIXME: needs vector +;;; ./gengen/gr_multiply_const_vcc.h FIXME: wrong type argument in position ~A: ;; gr_make_multiply_const_vcc (const std::vector &k); -;; (pass-if (true? (gr:multiply-const-vcc 1))) +;; (pass-if (true? (gr:multiply-const-vcc #(1+3i 23+5i)))) -;;; ./gengen/gr_multiply_const_vff.h FIXME: needs vector -;; gr_make_multiply_const_vff (const std::vector &k); -;; (pass-if (true? (gr:multiply-const-vff ))) +;;; ./gengen/gr_multiply_const_vff.h +(pass-if (true? (gr:multiply-const-vff #(1.0 2.0)))) -;;; ./gengen/gr_multiply_const_vii.h FIXME: needs vector -;; gr_make_multiply_const_vii (const std::vector &k); -;; (pass-if (true? (gr:multiply-const-vii ))) +;;; ./gengen/gr_multiply_const_vii.h +(pass-if (true? (gr:multiply-const-vii #(1 2)))) -;;; ./gengen/gr_multiply_const_vss.h FIXME: needs vector -;; gr_make_multiply_const_vss (const std::vector &k); -;; (pass-if (true? (gr:multiply-const-vss ))) +;;; ./gengen/gr_multiply_const_vss.h +(pass-if (true? (gr:multiply-const-vss #(1 2)))) ;;; ./gengen/gr_multiply_ff.h (pass-if (true? (gr:multiply-ff 1))) @@ -221,21 +213,17 @@ ;;; ./gengen/gr_mute_ss.h FIXME: not found ;; (pass-if (true? (gr:mute-ss false))) -;;; ./gengen/gr_noise_source_c.h FIXME: needs gr_noise_type_t -;; gr_make_noise_source_c (gr_noise_type_t type, float ampl, long seed = 3021); -;; (pass-if (true? (gr:noise-source-c ))) +;;; ./gengen/gr_noise_source_c.h +(pass-if (true? (gr:noise-source-c 1 0 3021))) -;;; ./gengen/gr_noise_source_f.h FIXME: needs gr_noise_type_t -;; gr_make_noise_source_f (gr_noise_type_t type, float ampl, long seed = 3021); -;; (pass-if (true? (gr:noise-source-f ))) +;;; ./gengen/gr_noise_source_f.h +(pass-if (true? (gr:noise-source-f 1 0 3021))) -;;; ./gengen/gr_noise_source_i.h FIXME: needs gr_noise_type_t -;; gr_make_noise_source_i (gr_noise_type_t type, float ampl, long seed = 3021); -;; (pass-if (true? (gr:noise-source-i ))) +;;; ./gengen/gr_noise_source_i.h +(pass-if (true? (gr:noise-source-i 1 0 3021))) -;;; ./gengen/gr_noise_source_s.h FIXME: needs gr_noise_type_t -;; gr_make_noise_source_s (gr_noise_type_t type, float ampl, long seed = 3021); -;; (pass-if (true? (gr:noise-source-s ))) +;;; ./gengen/gr_noise_source_s.h +(pass-if (true? (gr:noise-source-s 1 0 3021))) ;;; ./gengen/gr_not_bb.h (pass-if (true? (gr:not-bb))) @@ -255,26 +243,23 @@ ;;; ./gengen/gr_or_ss.h (pass-if (true? (gr:or-ss))) -;;; ./gengen/gr_packed_to_unpacked_bb.h FIXME: needs gr_endianness_t -;; gr_make_packed_to_unpacked_bb (unsigned int bits_per_chunk, gr_endianness_t endianness); -;; (pass-if (true? (gr:packed-to-unpacked-bb ))) +;;; ./gengen/gr_packed_to_unpacked_bb.h +(pass-if (true? (gr:packed-to-unpacked-bb 1 1))) -;;; ./gengen/gr_packed_to_unpacked_ii.h FIXME: needs gr_endianness_t -;; gr_make_packed_to_unpacked_ii (unsigned int bits_per_chunk, gr_endianness_t endianness); -;; (pass-if (true? (gr:packed-to-unpacked-ii ))) +;;; ./gengen/gr_packed_to_unpacked_ii.h +(pass-if (true? (gr:packed-to-unpacked-ii 1 1))) -;;; ./gengen/gr_packed_to_unpacked_ss.h FIXME: needs gr_endianness_t -;; gr_make_packed_to_unpacked_ss (unsigned int bits_per_chunk, gr_endianness_t endianness); -;; (pass-if (true? (gr:packed-to-unpacked-ss ))) +;;; ./gengen/gr_packed_to_unpacked_ss.h +(pass-if (true? (gr:packed-to-unpacked-ss 1 1))) ;;; ./gengen/gr_peak_detector_fb.h (pass-if (true? (gr:peak-detector-fb 0.25 0.40 10 0.001))) ;;; ./gengen/gr_peak_detector_ib.h -(pass-if (true? (gr:peak-detector-ib 0.25 0.40 10 0.001))) +(pass-if (true? (gr:peak-detector-ib 0.25 0.40 10 0.001))) ;;; ./gengen/gr_peak_detector_sb.h -(pass-if (true? (gr:peak-detector-sb 0.25 0.40 10 0.001))) +(pass-if (true? (gr:peak-detector-sb 0.25 0.40 10 0.001))) ;;; ./gengen/gr_sample_and_hold_bb.h (pass-if (true? (gr:sample-and-hold-bb))) @@ -288,25 +273,17 @@ ;;; ./gengen/gr_sample_and_hold_ss.h (pass-if (true? (gr:sample-and-hold-ss))) -;;; ./gengen/gr_sig_source_c.h FIXME: needs gr_waveform_t -;; gr_make_sig_source_c (double sampling_freq, gr_waveform_t waveform, -;; double wave_freq, double ampl, gr_complex offset = 0); -;; (pass-if (true? (gr:sig-source-c ))) +;;; ./gengen/gr_sig_source_c.h +(pass-if (true? (gr:sig-source-c 0 0 0 0 0))) -;;; ./gengen/gr_sig_source_f.h FIXME: needs gr_waveform_t -;; gr_make_sig_source_f (double sampling_freq, gr_waveform_t waveform, -;; double wave_freq, double ampl, float offset = 0); -;; (pass-if (true? (gr:sig-source-f ))) +;;; ./gengen/gr_sig_source_f.h +(pass-if (true? (gr:sig-source-f 0 0 0 0 0))) -;;; ./gengen/gr_sig_source_i.h FIXME: needs gr_waveform_t -;; gr_make_sig_source_i (double sampling_freq, gr_waveform_t waveform, -;; double wave_freq, double ampl, int offset = 0); -;; (pass-if (true? (gr:sig-source-i ))) +;;; ./gengen/gr_sig_source_i.h +(pass-if (true? (gr:sig-source-i 0 0 0 0 0))) -;;; ./gengen/gr_sig_source_s.h FIXME: needs gr_waveform_t -;; gr_make_sig_source_s (double sampling_freq, gr_waveform_t waveform, -;; double wave_freq, double ampl, short offset = 0); -;; (pass-if (true? (gr:sig-source-s ))) +;;; ./gengen/gr_sig_source_s.h +(pass-if (true? (gr:sig-source-s 0 0 0 0 0))) ;;; ./gengen/gr_sub_cc.h (pass-if (true? (gr:sub-cc 1))) @@ -320,17 +297,14 @@ ;;; ./gengen/gr_sub_ss.h (pass-if (true? (gr:sub-ss 1))) -;;; ./gengen/gr_unpacked_to_packed_bb.h FIXME: needs gr_endianness_t -;; gr_make_unpacked_to_packed_bb (unsigned int bits_per_chunk, gr_endianness_t endianness); -;; (pass-if (true? (gr:unpacked-to-packed-bb ))) +;;; ./gengen/gr_unpacked_to_packed_bb.h +(pass-if (true? (gr:unpacked-to-packed-bb 1 1))) -;;; ./gengen/gr_unpacked_to_packed_ii.h FIXME: needs gr_endianness_t -;; gr_make_unpacked_to_packed_ii (unsigned int bits_per_chunk, gr_endianness_t endianness); -;; (pass-if (true? (gr:unpacked-to-packed-ii ))) +;;; ./gengen/gr_unpacked_to_packed_ii.h +(pass-if (true? (gr:unpacked-to-packed-ii 1 1))) -;;; ./gengen/gr_unpacked_to_packed_ss.h FIXME: needs gr_endianness_t -;; gr_make_unpacked_to_packed_ss (unsigned int bits_per_chunk, gr_endianness_t endianness); -;; (pass-if (true? (gr:unpacked-to-packed-ss ))) +;;; ./gengen/gr_unpacked_to_packed_ss.h +(pass-if (true? (gr:unpacked-to-packed-ss 1 1))) ;;; ./gengen/gr_vector_sink_b.h (pass-if (true? (gr:vector-sink-b 1))) @@ -347,24 +321,23 @@ ;;; ./gengen/gr_vector_sink_s.h (pass-if (true? (gr:vector-sink-s 1))) -;;; ./gengen/gr_vector_source_b.h FIXME: needs vector, may throw -;; gr_make_vector_source_b (const std::vector &data, bool repeat = false, int vlen = 1) -;; (pass-if (true? (gr:vector-source-b ))) +;;; ./gengen/gr_vector_source_b.h FIXME: not found +;; (pass-if (true? (gr:vector-source-b #(1 2) false 1))) -;;; ./gengen/gr_vector_source_c.h FIXME: needs vector, may throw +;;; ./gengen/gr_vector_source_c.h FIXME: not found ;; gr_make_vector_source_c (const std::vector &data, bool repeat = false, int vlen = 1) -;; (pass-if (true? (gr:vector-source-c ))) +;; (pass-if (true? (gr:vector-source-c #(1+3i 23+5i) false 1))) -;;; ./gengen/gr_vector_source_f.h FIXME: needs vector, may throw +;;; ./gengen/gr_vector_source_f.h FIXME: not found ;; gr_make_vector_source_f (const std::vector &data, bool repeat = false, int vlen = 1) -;; (pass-if (true? (gr:vector-source-f ))) +;; (pass-if (true? (gr:vector-source-f #(1.0 2.0) false 1))) -;;; ./gengen/gr_vector_source_i.h FIXME: needs vector, may throw +;;; ./gengen/gr_vector_source_i.h FIXME: not found ;; gr_make_vector_source_i (const std::vector &data, bool repeat = false, int vlen = 1) -;; (pass-if (true? (gr:vector-source-i ))) +;; (pass-if (true? (gr:vector-source-i #(1 2) false 1))) -;;; ./gengen/gr_vector_source_s.h FIXME: needs vector, may throw -;; (pass-if (true? (gr:vector-source-s ))) +;;; ./gengen/gr_vector_source_s.h FIXME: not found +;; (pass-if (true? (gr:vector-source-s #(1 2) false 1))) ;;; ./gengen/gr_xor_bb.h (pass-if (true? (gr:xor-bb))) -- cgit From 8c2c60e6777a41a202a6e387384b1b536eb33c8b Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Wed, 10 Nov 2010 10:35:05 -0700 Subject: fix one test --- gnuradio-core/src/guile/tests/gengen_ctors.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/gengen_ctors.test b/gnuradio-core/src/guile/tests/gengen_ctors.test index f05feceb6..10eb1d9e0 100644 --- a/gnuradio-core/src/guile/tests/gengen_ctors.test +++ b/gnuradio-core/src/guile/tests/gengen_ctors.test @@ -33,7 +33,7 @@ ;;; ;;; ./gengen/gr_add_cc.h -;; (pass-if (true? (gr:add-cc 0))) FIXME: throws gr_io_signature(3) +(pass-if (true? (gr:add-cc 1))) ;;; ./gengen/gr_add_const_cc.h (pass-if (true? (gr:add-const-cc 0))) -- cgit From 649cf353deb00fcfce7da7e748dee77c3444e0e3 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Wed, 10 Nov 2010 10:40:50 -0700 Subject: stub out the rest of the not found tests --- gnuradio-core/src/guile/tests/io_ctors.test | 39 ++++++++++++++--------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/io_ctors.test b/gnuradio-core/src/guile/tests/io_ctors.test index 6516ef7fe..80fb2d3f2 100644 --- a/gnuradio-core/src/guile/tests/io_ctors.test +++ b/gnuradio-core/src/guile/tests/io_ctors.test @@ -41,39 +41,38 @@ ;;; ./io/gr_file_sink.h (pass-if (true? (gr:file-sink 1 "foo"))) -;;; ./io/gr_file_source.h -;; (pass-if (true? (gr:file-source 1 "foo" false))) FIXME: not found +;;; ./io/gr_file_source.h FIXME: not found +;; (pass-if (true? (gr:file-source 1 "foo" false))) -;;; ./io/gr_histo_sink_f.h FIXME: needs gr_msg_queue_sptr +;;; ./io/gr_histo_sink_f.h FIXME: not found ;; gr_make_histo_sink_f (gr_msg_queue_sptr msgq); -;; (pass-if (true? (gr:histo-sink-f ))) +;; (pass-if (true? (gr:histo-sink-f 1))) -;;; ./io/gr_message_sink.h -;; (pass-if (true? (gr:message-sink ))) +;;; ./io/gr_message_sink.h FIXME: not found +;; (pass-if (true? (gr:message-sink 1 1 false))) ;;; ./io/gr_message_source.h ;; (pass-if (true? (gr:message-source ))) -;;; ./io/gr_oscope_sink_f.h FIXME: needs gr_io_signature_sptr +;;; ./io/gr_oscope_sink_f.h FIXME: not found ;; _oscope_sink_x (const std::string name, gr_io_signature_sptr input_sig, ;; double sample_rate); -;; (pass-if (true? (gr:oscope-sink-f ))) +;; (pass-if (true? (gr:oscope-sink-f "foo" 1 1))) -;;; ./io/gr_oscope_sink_x.h - -;; gr_oscope_sink_x (const std::string name, -;; gr_io_signature_sptr input_sig, +;;; ./io/gr_oscope_sink_x.h FIXME: not found +;; gr_oscope_sink_x (const std::string name, gr_io_signature_sptr input_sig, ;; double sampling_rate); -;; (pass-if (true? (gr:oscope_sink_x ))) +;; (pass-if (true? (gr:oscope_sink_x "foo" 1 1))) -;;; ./io/gr_udp_sink.h +;;; ./io/gr_udp_sink.h FIXME: not found +;; (pass-if (true? (gr:udp-sink 1 "foo" 1472 true))) -;;; ./io/gr_udp_source.h -;; (pass-if (true? (gr:message-source 0 "foo" 0 1472 true true))) FIXME: not found +;;; ./io/gr_udp_source.h FIXME: not found +;; (pass-if (true? (gr:message-source 0 "foo" 0 1472 true true))) -;;; ./io/gr_wavfile_sink.h -;; (pass-if (true? (gr:message-source "foo" 1 1 1))) FIXME: not found +;;; ./io/gr_wavfile_sink.h FIXME: not found +;; (pass-if (true? (gr:message-source "foo" 1 1 1))) -;;; ./io/gr_wavfile_source.h -;; (pass-if (true? (gr:message-source "foo" false))) FIXME: not found +;;; ./io/gr_wavfile_source.h FIXME: not found +;; (pass-if (true? (gr:message-source "foo" false))) -- cgit From a740d3fbda03e2b718bd10ea78c0eeb1ce178586 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Wed, 10 Nov 2010 11:29:36 -0700 Subject: fix bogus throws and vectors --- gnuradio-core/src/guile/tests/general_ctors.test | 184 +++++++++++------------ 1 file changed, 87 insertions(+), 97 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index 0580d6382..6153ce795 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -54,12 +54,12 @@ ;;; ./general/gr_agc_ff.h (pass-if (true? (gr:agc-ff 0 0 0 0))) -;;; ./general/gr_align_on_samplenumbers_ss.h +;;; ./general/gr_align_on_samplenumbers_ss.h FIXME: throws (pass-if (true? (gr:align-on-samplenumbers-ss 2 128))) -(pass-if-throw "confirm throw gr:align-on-samplenumbers-ss" #t (true? (gr:align-on-samplenumbers-ss 0 0))) +;; (pass-if-throw "confirm throw gr:align-on-samplenumbers-ss" #t (true? (gr:align-on-samplenumbers-ss 0 0))) -;;; ./general/gr_bin_statistics_f.h -;; (pass-if (true? (gr:bin-statistics-f 0 0 0 0 0))) FIXME: not found +;;; ./general/gr_bin_statistics_f.h FIXME: not found +;; (pass-if (true? (gr:bin-statistics-f 0 0 0 0 0))) ;;; ./general/gr_binary_slicer_fb.h (pass-if (true? (gr:binary-slicer-fb))) @@ -70,11 +70,11 @@ ;;; ./general/gr_char_to_float.h (pass-if (true? (gr:char-to-float))) -;;; ./general/gr_check_counting_s.h -;; (pass-if (true? (gr:check-counting-s false))) FIXME: not found +;;; ./general/gr_check_counting_s.h FIXME: not found +;; (pass-if (true? (gr:check-counting-s false))) -;;; ./general/gr_check_lfsr_32k_s.h -;; (pass-if (true? (gr:check-lfsr-2k-s))) FIXME: not found +;;; ./general/gr_check_lfsr_32k_s.h FIXME: not found +;; (pass-if (true? (gr:check-lfsr-2k-s))) ;;; ./general/gr_clock_recovery_mm_cc.h (pass-if (true? (gr:clock-recovery-mm-cc 1 1 1 1 1))) @@ -82,29 +82,29 @@ ;;; ./general/gr_clock_recovery_mm_ff.h (pass-if (true? (gr:clock-recovery-mm-ff 1 1 1 1 1))) -;; (pass-if-throw "confirm throw gr:clock-recovery-mm-ff" #t (true? (gr:clock-recovery-mm-ff 0 0 0 0 0))) ;; FIXME: segfault +(pass-if-throw "confirm throw gr:clock-recovery-mm-ff" #t (true? (gr:clock-recovery-mm-ff 1 1 1 1 1))) ;;; ./general/gr_complex_to_interleaved_short.h (pass-if (true? (gr:complex-to-interleaved-short))) -;;; ./general/gr_complex_to_xxx.h FIXME: all throw -;; (pass-if (true? (gr:complex-to-float 0))) -;; (pass-if (true? (gr:complex-to-real 0))) -;; (pass-if (true? (gr:complex-to-imag 0))) -;; (pass-if (true? (gr:complex-to-mag 0))) -;; (pass-if (true? (gr:complex-to-mag-squared 0))) -;; (pass-if (true? (gr:complex-to-arg 0))) +;;; ./general/gr_complex_to_xxx.h +(pass-if (true? (gr:complex-to-float 1))) +(pass-if (true? (gr:complex-to-real 1))) +(pass-if (true? (gr:complex-to-imag 1))) +(pass-if (true? (gr:complex-to-mag 1))) +(pass-if (true? (gr:complex-to-mag-squared 1))) +(pass-if (true? (gr:complex-to-arg 1))) ;;; ./general/gr_conjugate_cc.h (pass-if (true? (gr:conjugate-cc))) -;;; ./general/gr_constellation_decoder_cb.h +;;; ./general/gr_constellation_decoder_cb.h FIXME: not found ;gr_constellation_decoder_cb (const std::vector &sym_position, ; const std::vector &sym_value_out); -;; (pass-if (true? (gr:constellation_decoder_cb ))) +;; (pass-if (true? (gr:constellation_decoder_cb #(1+3i 23+5i) #(1 2)))) ;;; ./general/gr_copy.h -;; (pass-if (true? (gr:copy 0))) FIXME: throws +(pass-if (true? (gr:copy 1))) ;;; ./general/gr_correlate_access_code_bb.h (pass-if (true? (gr:correlate-access-code-bb "foo" 0))) @@ -115,19 +115,19 @@ (pass-if-throw "confirm throw gr:costas-loop-cc" #t (true? (gr:costas-loop-cc 0 0 0 0 3))) ;;; ./general/gr_cpfsk_bc.h -;; (pass-if (true? (gr:cpfsk-bc 0 0 0))) FIXME: throws +(pass-if (true? (gr:cpfsk-bc 1 1 1))) -;;; ./general/gr_ctcss_squelch_ff.h -;; (pass-if (true? (gr:ctcss-squelch-ff 0 0 0 0 0 true))) FIXME: not found +;;; ./general/gr_ctcss_squelch_ff.h FIXME: not found +;; (pass-if (true? (gr:ctcss-squelch-ff 0 0 0 0 0 true))) ;;; ./general/gr_decode_ccsds_27_fb.h (pass-if (true? (gr:decode-ccsds-27-fb))) ;;; ./general/gr_deinterleave.h -;; (pass-if (true? (gr:deinterleave 0))) FIXME: throws +(pass-if (true? (gr:deinterleave 1))) ;;; ./general/gr_delay.h -;; (pass-if (true? (gr:delay 0 0))) FIXME: throws +(pass-if (true? (gr:delay 1 1))) ;;; ./general/gr_descrambler_bb.h (pass-if (true? (gr:descrambler-bb 0 0 0))) @@ -147,24 +147,22 @@ ;;; ./general/gr_encode_ccsds_27_bb.h (pass-if (true? (gr:encode-ccsds-27-bb))) -;;; ./general/gr_fake_channel_coder_pp.h -;; (pass-if (true? (gr:fake-channel-coder-pp 1 1))) FIXME: not found +;;; ./general/gr_fake_channel_coder_pp.h FIXME: not found +;; (pass-if (true? (gr:fake-channel-coder-pp 1 1))) ;; (pass-if-throw "confirm throw" #t (true? (gr:fake-channel-coder-pp -1 1))) ;;; ./general/gr_feedforward_agc_cc.h -;; (pass-if (true? (gr:feedforward-agc-cc 0 0))) FIXME: throws +(pass-if (true? (gr:feedforward-agc-cc 1 1))) -;;; ./general/gr_fft_vcc.h -;; gr_fft_vcc (int fft_size, bool forward, const std::vector &window, bool shift); -;; (pass-if (true? (gr:fft-vcc ))) +;;; ./general/gr_fft_vcc.h FIXME: not found +;; (pass-if (true? (gr:fft-vcc 1 false #(1.0 2.0) true))) -;;; ./general/gr_fft_vcc_fftw.h -;; gr_make_fft_vcc_fftw (int fft_size, bool forward, const std::vector &window, bool shift); -;; (pass-if (true? (gr:fft-vcc-fftw ))) +;;; ./general/gr_fft_vcc_fftw.h FIXME: not found +;; (pass-if (true? (gr:fft-vcc-fftw 1 #(1.0 2.0) false))) -;;; ./general/gr_fft_vfc.h +;;; ./general/gr_fft_vfc.h FIXME: not found ;; bool set_window(const std::vector &window); -;; (pass-if (true? (gr:fft_vfc ))) +;; (pass-if (true? (gr:fft_vfc #(1.0 2.0)))) ;;; ./general/gr_fll_band_edge_cc.h (pass-if (true? (gr:fll-band-edge-cc 0 0 0 0 0))) @@ -173,7 +171,7 @@ (pass-if (true? (gr:float-to-char))) ;; ;;; ./general/gr_float_to_complex.h -;; (pass-if (true? (gr:float-to-complex 0))) FIXME: throws +(pass-if (true? (gr:float-to-complex 1))) ;;; ./general/gr_float_to_short.h (pass-if (true? (gr:float-to-short))) @@ -184,114 +182,110 @@ ;;; ./general/gr_fmdet_cf.h (pass-if (true? (gr:fmdet-cf 0 0 0 0))) -;;; ./general/gr_framer_sink_1.h -;; (pass-if (true? (gr:framer-sink-1))) FIXME: not found +;;; ./general/gr_framer_sink_1.h FIXME: not found +;; (pass-if (true? (gr:framer-sink-1))) ;;; ./general/gr_frequency_modulator_fc.h (pass-if (true? (gr:frequency-modulator-fc 0))) -;;; ./general/gr_glfsr_source_b.h -;; (pass-if (true? (gr: glfsr-source-b 0 true 0 0))) FIXME: not found +;;; ./general/gr_glfsr_source_b.h FIXME: not found +;; (pass-if (true? (gr: glfsr-source-b 0 true 0 0))) ;; (pass-if-throw "confirm throw" #t (true? (gr:glfsr_source_b 33 true 0 0))) -;;; ./general/gr_glfsr_source_f.h -;; (pass-if (true? (gr:glfsr-source-f 0 true 0 0))) FIXME: not found +;;; ./general/gr_glfsr_source_f.h FIXME: not found +;; (pass-if (true? (gr:glfsr-source-f 1 true 1 1))) ;; (pass-if-throw "confirm throw" #t (true? (gr:glfsr_source_f 33 true 0 0))) ;;; ./general/gr_head.h -;; (pass-if (true? (gr:head 0 0))) FIXME: throws +(pass-if (true? (gr:head 1 1))) ;;; ./general/gr_interleave.h -;; (pass-if (true? (gr:interleave 0))) FIXME: throws +(pass-if (true? (gr:interleave 1))) ;;; ./general/gr_interleaved_short_to_complex.h (pass-if (true? (gr:interleaved-short-to-complex))) -;;; ./general/gr_iqcomp_cc.h -;; (pass-if (true? (gr:iqcomp-cc 0 0))) FIXME: not found +;;; ./general/gr_iqcomp_cc.h FIXME: not found +;; (pass-if (true? (gr:iqcomp-cc 1 1))) ;;; ./general/gr_keep_one_in_n.h -;; (pass-if (true? (gr:keep-one-in-n 0 0))) FIXME: throws +(pass-if (true? (gr:keep-one-in-n 1 1))) ;;; ./general/gr_kludge_copy.h -;; (pass-if (true? (gr:kludge-copy 0))) FIXME: throws +(pass-if (true? (gr:kludge-copy 1))) ;;; ./general/gr_lfsr_32k_source_s.h (pass-if (true? (gr:lfsr-32k-source-s))) ;;; ./general/gr_lms_dfe_cc.h -;; (pass-if (true? (gr:lms-dfe-ff 0 0 0 0))) FIXME: hangs +(pass-if (true? (gr:lms-dfe-ff 1 1 1 1))) ;;; ./general/gr_lms_dfe_ff.h -;; (pass-if (true? (gr:lms-dfe-ff 0 0 0 0))) FIXME: hangs +(pass-if (true? (gr:lms-dfe-ff 1 1 1 1))) ;;; ./general/gr_map_bb.h ;; gr_map_bb (const std::vector &map); -;; (pass-if (true? (gr:map-bb xx))) +(pass-if (true? (gr:map-bb #(1 2)))) ;;; ./general/gr_mpsk_receiver_cc.h -;; (pass-if (true? (gr:mpsk-receiver-cc 0 0 0 0 0 0 0 0 0 0 0))) FIXME: throws +(pass-if (true? (gr:mpsk-receiver-cc 1 1 1 1 1 1 1 1 1 1 1))) ;;; ./general/gr_nlog10_ff.h -;; (pass-if (true? (gr:nlog10-ff 0 0 0))) FIXME: throws +(pass-if (true? (gr:nlog10-ff 1 1 1))) ;;; ./general/gr_nop.h -;; (pass-if (true? (gr:nop 0))) FIXME: throws +(pass-if (true? (gr:nop 1))) ;;; ./general/gr_null_sink.h -;; (pass-if (true? (gr:null-sink 0))) FIXME: throws +(pass-if (true? (gr:null-sink 1))) ;;; ./general/gr_null_source.h -;; (pass-if (true? (gr:null-source 0)))v FIXME: throws +(pass-if (true? (gr:null-source 1))) -;;; ./general/gr_ofdm_bpsk_demapper.h -;; (pass-if (true? (gr:ofdm-bpsk-demapper))) FIXME: not found +;;; ./general/gr_ofdm_bpsk_demapper.h FIXME: not found +;; (pass-if (true? (gr:ofdm-bpsk-demapper 1))) ;;; ./general/gr_ofdm_cyclic_prefixer.h -;; (pass-if (true? (gr:ofdm-cyclic-prefixer 0 0))) FIXME: throws +(pass-if (true? (gr:ofdm-cyclic-prefixer 1 1))) -;;; ./general/gr_ofdm_demapper_vcb.h -;; (pass-if (true? (gr:ofdm-mapper-bcv 0 0))) FIXME: throws +;;; ./general/gr_ofdm_demapper_vcb.h FIXME: not found +;; (pass-if (true? (gr:ofdm-mapper-bcv 1 1))) -;;; ./general/gr_ofdm_frame_acquisition.h +;;; ./general/gr_ofdm_frame_acquisition.h FIXME: not found ;; gr_ofdm_frame_acquisition (unsigned int occupied_carriers, ;; unsigned int fft_length, ;; unsigned int cplen, ;; const std::vector &known_symbol, ;; unsigned int max_fft_shift_len); -;; (pass-if (true? (gr:ofdm-frame-acquisition 0 0 0 (0 0) 0))) +;; (pass-if (true? (gr:ofdm-frame-acquisition 0 0 0 #(1+3i 23+5i) 0))) -;;; ./general/gr_ofdm_frame_sink.h +;;; ./general/gr_ofdm_frame_sink.h FIXME: not found ;; gr_ofdm_frame_sink(const std::vector &sym_position, ;; const std::vector &sym_value_out, ;; gr_msg_queue_sptr target_queue, unsigned int occupied_tones, ;; float phase_gain, float freq_gain); -;; (pass-if (true? (gr:ofdm_frame_sink ))) +;; (pass-if (true? (gr:ofdm-frame-sink #(1+3i 23+5i) #(1 2) 1 1 0.25 0))) -;;; ./general/gr_ofdm_insert_preamble.h +;;; ./general/gr_ofdm_insert_preamble.h FIXME: Wrong type argument in position ~A: ;; gr_ofdm_insert_preamble(int fft_length, ;; const std::vector > &preamble); -;; (pass-if (true? (gr:ofdm-insert-preamble ))) +;; (pass-if (true? (gr:ofdm-insert-preamble 1 #(#(1+3i 23+5i) #(1+3i 23+5i))))) -;;; ./general/gr_ofdm_mapper_bcv.h +;;; ./general/gr_ofdm_mapper_bcv.h FIXME: Wrong type argument in position ~A: ;; gr_ofdm_mapper_bcv (const std::vector &constellation, ;; unsigned int msgq_limit, ;; unsigned int bits_per_symbol, ;; unsigned int fft_length); -;; (pass-if (true? (gr:ofdm-mapper-bcv ))) +;; (pass-if (true? (gr:ofdm-mapper-bcv #(1+3i 23+5i) 1 1 1))) ;;; ./general/gr_ofdm_sampler.h -;; (pass-if (true? (gr:ofdm-sampler 0 0 0))) FIXME: throws +(pass-if (true? (gr:ofdm-sampler 1 1 1))) ;;; ./general/gr_pa_2x2_phase_combiner.h (pass-if (true? (gr:pa-2x2-phase-combiner))) -;;; ./general/gr_packet_sink.h -;; (pass-if (true? gr_make_packet_sink (const std::vector& sync_vector, -;; gr_msg_queue_sptr target_queue, -;; int threshold = -1 // -1 -> use default -;; ); -;; (gr:packet-sink ))) +;;; ./general/gr_packet_sink.h FIXME: not found +;; (pass-if (true? (gr:packet-sink #(1 2) 1 -1))) ;;; ./general/gr_peak_detector2_fb.h (pass-if (true? (gr:peak-detector2-fb 0 0 0))) @@ -309,7 +303,7 @@ (pass-if (true? (gr:pll-refout-cc 0 0 0 0))) ;;; ./general/gr_pn_correlator_cc.h -;; (pass-if (true? (gr:pn-correlator-cc 0 0 0))) FIXME: throws +(pass-if (true? (gr:pn-correlator-cc 1 1 1))) ;;; ./general/gr_probe_avg_mag_sqrd_c.h (pass-if (true? (gr:probe-avg-mag-sqrd-c 0 0))) @@ -345,7 +339,7 @@ (pass-if (true? (gr:regenerate-bb 0 0))) ;;; ./general/gr_repeat.h -;; (pass-if (true? (gr:repeat 0 0))) FIXME: throws +(pass-if (true? (gr:repeat 1 1))) ;;; ./general/gr_rms_cf.h (pass-if (true? (gr:rms-cf 0))) @@ -369,12 +363,10 @@ (pass-if (true? (gr:simple-squelch-cc 0 0))) ;;; ./general/gr_skiphead.h -;; (pass-if (true? (gr:skiphead 0 0))) FIXME: throws +(pass-if (true? (gr:skiphead 1 1))) -;;; ./general/gr_squash_ff.h -;; gr_squash_ff_sptr gr_make_squash_ff(const std::vector &igrid, -;; const std::vector &ogrid); -;; (pass-if (true? (gr:squash_ff ))) +;;; ./general/gr_squash_ff.h FIXME: not found +;; (pass-if (true? (gr:squash_ff #(1.0 2.0) #(1.0 2.0)))) ;;; ./general/gr_squelch_base_cc.h ;; (pass-if (true? (gr:squelch-base-cc "foo" 0 false))) FIXME: not found @@ -383,24 +375,22 @@ ;; (pass-if (true? (gr:squelch-base-ff "foo" 0 false))) FIXME: not found ;;; ./general/gr_stream_mux.h -;; gr_make_stream_mux (size_t itemsize, -;; const std::vector &lengths); -;; (pass-if (true? (gr:stream_mux ))) +(pass-if (true? (gr:stream-mux 1 #(1 2)))) ;;; ./general/gr_stream_to_streams.h -;; (pass-if (true? (gr:stream-to-streams 0 0))) FIXME: throws +(pass-if (true? (gr:stream-to-streams 1 1))) ;;; ./general/gr_stream_to_vector.h -;; (pass-if (true? (gr:stream-to-vector 0 0))) FIXME: throws +(pass-if (true? (gr:stream-to-vector 1 1))) ;;; ./general/gr_streams_to_stream.h -;; (pass-if (true? (gr:streams-to-stream 0 0))) FIXME: throws +(pass-if (true? (gr:streams-to-stream 1 1))) ;;; ./general/gr_streams_to_vector.h -;; (pass-if (true? (gr:streams-to-vector 0 0))) FIXME: throws +(pass-if (true? (gr:streams-to-vector 1 1))) ;;; ./general/gr_stretch_ff.h -;; (pass-if (true? (gr:stretch-ff 0 0))) FIXME: throws +(pass-if (true? (gr:stretch-ff 1 1))) ;;; ./general/gr_test.h (pass-if (true? (gr:test "foo" 1 1 1 1 1 1 1 1))) @@ -409,7 +399,7 @@ (pass-if (true? (gr:threshold-ff 0 0))) ;;; ./general/gr_throttle.h -;; (pass-if (true? (gr:throttle 0 0))) FIXME: throws +(pass-if (true? (gr:throttle 1 1))) ;;; ./general/gr_uchar_to_float.h (pass-if (true? (gr:uchar-to-float))) @@ -418,13 +408,13 @@ (pass-if (true? (gr:vco-f 0 0 0))) ;;; ./general/gr_vector_to_stream.h -;; (pass-if (true? (gr:vector-to-stream 0 0))) FIXME: throws +(pass-if (true? (gr:vector-to-stream 1 1))) ;;; ./general/gr_vector_to_streams.h -;; (pass-if (true? (gr:vector-to-streams 0 0))) FIXME: throws +(pass-if (true? (gr:vector-to-streams 1 1))) -;;; ./general/gr_wavelet_ff.h -;; (pass-if (true? (gr:wavelet-ff 0 0))) FIXME: throws +;;; ./general/gr_wavelet_ff.h FIXME: not found +;; (pass-if (true? (gr:wavelet-ff 1024 20 true))) ;;; ./general/gr_wvps_ff.h -;; (pass-if (true? (gr:wvps_ff 0))) FIXME: throws +(pass-if (true? (gr:wvps-ff 2))) -- cgit From ec44d0c5ad93dcbb145bbd77a4deff99af9d49bc Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Wed, 10 Nov 2010 11:29:53 -0700 Subject: add stubs, nothing seems to exist --- gnuradio-core/src/guile/tests/filter_ctors.test | 251 +++++++++++++++++++----- 1 file changed, 200 insertions(+), 51 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/filter_ctors.test b/gnuradio-core/src/guile/tests/filter_ctors.test index 9ff251a55..8618890fa 100644 --- a/gnuradio-core/src/guile/tests/filter_ctors.test +++ b/gnuradio-core/src/guile/tests/filter_ctors.test @@ -31,69 +31,218 @@ ;;; Add test code for all constructors in these files ;;; -;;; ./filter/gr_adaptive_fir_ccf.h -;;; ./filter/gr_cma_equalizer_cc.h -;;; ./filter/gr_fft_filter_ccc.h -;;; ./filter/gr_fft_filter_fff.h -;;; ./filter/gr_filter_delay_fc.h -;;; ./filter/gr_fir_ccc_generic.h -;;; ./filter/gr_fir_ccc_simd.h -;;; ./filter/gr_fir_ccc_x86.h -;;; ./filter/gr_fir_ccf_generic.h -;;; ./filter/gr_fir_ccf_simd.h -;;; ./filter/gr_fir_ccf_x86.h -;;; ./filter/gr_fir_fcc_generic.h -;;; ./filter/gr_fir_fcc_simd.h -;;; ./filter/gr_fir_fcc_x86.h -;;; ./filter/gr_fir_fff_altivec.h -;;; ./filter/gr_fir_fff_armv7_a.h -;;; ./filter/gr_fir_fff_generic.h -;;; ./filter/gr_fir_fff_simd.h -;;; ./filter/gr_fir_fff_x86.h -;;; ./filter/gr_fir_filter_ccc.h -;;; ./filter/gr_fir_filter_ccf.h -;;; ./filter/gr_fir_filter_fcc.h -;;; ./filter/gr_fir_filter_fff.h -;;; ./filter/gr_fir_filter_fsf.h -;;; ./filter/gr_fir_filter_scc.h -;;; ./filter/gr_fir_fsf_generic.h -;;; ./filter/gr_fir_fsf_simd.h -;;; ./filter/gr_fir_fsf_x86.h -;;; ./filter/gr_fir_scc_generic.h -;;; ./filter/gr_fir_scc_simd.h -;;; ./filter/gr_fir_scc_x86.h -;;; ./filter/gr_fir_sysconfig_armv7_a.h -;;; ./filter/gr_fir_sysconfig_generic.h -;;; ./filter/gr_fir_sysconfig_powerpc.h -;;; ./filter/gr_fir_sysconfig_x86.h -;;; ./filter/gr_fractional_interpolator_cc.h -;;; ./filter/gr_fractional_interpolator_ff.h -;;; ./filter/gr_freq_xlating_fir_filter_ccc.h -;;; ./filter/gr_freq_xlating_fir_filter_ccf.h -;;; ./filter/gr_freq_xlating_fir_filter_fcc.h -;;; ./filter/gr_freq_xlating_fir_filter_fcf.h -;;; ./filter/gr_freq_xlating_fir_filter_scc.h -;;; ./filter/gr_freq_xlating_fir_filter_scf.h -;;; ./filter/gr_goertzel_fc.h -;;; ./filter/gr_hilbert_fc.h -;;; ./filter/gr_iir_filter_ffd.h -;;; ./filter/gr_interp_fir_filter_ccc.h -;;; ./filter/gr_interp_fir_filter_ccf.h -;;; ./filter/gr_interp_fir_filter_fcc.h -;;; ./filter/gr_interp_fir_filter_fff.h -;;; ./filter/gr_interp_fir_filter_fsf.h + +;;; ./filter/gr_adaptive_fir_ccf.h FIXME: not found +;; gr_adaptive_fir_ccf(char *name, int decimation, const std::vector &taps); +;; (pass-if (true? (gr:adaptive-fir-ccf "foo" 0 #(1.0 2.0 3.0 4.0)))) + +;;; ./filter/gr_cma_equalizer_cc.h FIXME: not found +;; (pass-if (true? (gr:cma-equalizer-cc 0 0 0))) + +;;; ./filter/gr_fft_filter_ccc.h FIXME: not found +;; (pass-if (true? (gr:fft-filter-ccc 0 #(1+3i 23+5i)))) + +;;; ./filter/gr_fft_filter_fff.h FIXME: not found +;; (pass-if (true? (gr:fft-filter-fff 0 #(1.0 2.0)))) + +;;; ./filter/gr_filter_delay_fc.h FIXME: not found +;; (pass-if (true? (gr:filter-delay-fc #(1.0 2.0)))) + +;;; ./filter/gr_fir_ccc_generic.h FIXME: not found +;; (pass-if (true? (gr:fir-ccc-generic))) +;; (pass-if (true? (gr:fir-ccc-generic #(1+3i 23+5i)))) + +;;; ./filter/gr_fir_ccc_simd.h FIXME: not found +;; (pass-if (true? (gr:fir-ccc-simd))) +;; (pass-if (true? (gr:fir-ccc-simd #(1+3i 23+5i)))) + +;;; ./filter/gr_fir_ccc_x86.h FIXME: not found +;; (pass-if (true? (gr:fir-ccc-x86))) +;; (pass-if (true? (gr:fir-ccc-x86 #(1+3i 23+5i)))) + +;;; ./filter/gr_fir_ccf_generic.h FIXME: not found +;; (pass-if (true? (gr:fir-ccf-generic))) +;; (pass-if (true? (gr:fir-ccf-generic #(1+3i 23+5i)))) + +;;; ./filter/gr_fir_ccf_simd.h FIXME: not found +;; (pass-if (true? (gr:fir-ccf-simd 0 0 0 0))) + +;;; ./filter/gr_fir_ccf_x86.h FIXME: not found +;; (pass-if (true? (gr:fir-ccf-x86))) +;; (pass-if (true? (gr:fir-ccf-x86 #(1.0 2.0)))) + +;;; ./filter/gr_fir_fcc_generic.h FIXME: not found +;; (pass-if (true? (gr:fir-fcc-generic))) +;; (pass-if (true? (gr:fir-fcc-generic #(1+3i 23+5i)))) + +;;; ./filter/gr_fir_fcc_simd.h FIXME: not found +;; (pass-if (true? (gr:fir-fcc-simd 0 0 0 0))) + +;;; ./filter/gr_fir_fcc_x86.h FIXME: not found +;; (pass-if (true? (gr:fir-fcc-x86))) +;; (pass-if (true? (gr:fir-fcc-x86 #(1+3i 23+5i)))) + +;;; ./filter/gr_fir_fff_altivec.h FIXME: not found +;; (pass-if (true? (gr:fir-fff-altivec))) +;; (pass-if (true? (gr:fir-fff-altivec #(1.0 2.0)))) + +;;; ./filter/gr_fir_fff_armv7_a.h FIXME: not found +;; (pass-if (true? (gr:fir-fff-armv7-a))) +;; (pass-if (true? (gr:fir-fff-armv7-a #(1.0 2.0)))) + +;;; ./filter/gr_fir_fff_generic.h FIXME: not found +;; (pass-if (true? (gr:fir-fff-generic))) +;; (pass-if (true? (gr:fir-fff-generic #(1.0 2.0)))) + +;;; ./filter/gr_fir_fff_simd.h FIXME: not found +;; (pass-if (true? (gr:fir-fff-simd 0 0 0))) + +;;; ./filter/gr_fir_fff_x86.h FIXME: not found +;; (pass-if (true? (gr:fir-fff-x86))) +;; (pass-if (true? (gr:fir-fff-x86 #(1.0 2.0)))) + +;;; ./filter/gr_fir_filter_ccc.h FIXME: not found +;; (pass-if (true? (gr:fir-filter-ccc 1 #(1+3i 23+5i)))) + +;;; ./filter/gr_fir_filter_ccf.h FIXME: not found +;; (pass-if (true? (gr:fir-filter-ccf 1 #(1.0 2.0)))) + +;;; ./filter/gr_fir_filter_fcc.h FIXME: not found +;; (pass-if (true? (gr:fir-filter-fcc 1 #(1+3i 23+5i)))) + +;;; ./filter/gr_fir_filter_fff.h FIXME: not found +;; (pass-if (true? (gr:fir-filter-fff 1 #(1.0 2.0)))) + +;;; ./filter/gr_fir_filter_fsf.h FIXME: not found +;; (pass-if (true? (gr:fir-filter-fsf 1 #(1.0 2.0)))) + +;;; ./filter/gr_fir_filter_scc.h FIXME: not found +;; (pass-if (true? (gr:fir-filter-scc 1 #(1+3i 23+5i)))) + +;;; ./filter/gr_fir_fsf_generic.h FIXME: not found +;; (pass-if (true? (gr:fir-fsf-generic))) +;; (pass-if (true? (gr:fir-fsf-generic #(1.0 2.0)))) + +;;; ./filter/gr_fir_fsf_simd.h FIXME: not found +;; (pass-if (true? (gr:fir-fsf-simd 0 0 0))) + +;;; ./filter/gr_fir_fsf_x86.h FIXME: not found +;; (pass-if (true? (gr:fir-fsf-x86))) +;; (pass-if (true? (gr:fir-fsf-x86 #(1.0 2.0)))) + +;;; ./filter/gr_fir_scc_generic.h FIXME: not found +;; (pass-if (true? (gr:fir-scc-generic))) +;; (pass-if (true? (gr:fir-scc-generic #(1+3i 23+5i)))) + +;;; ./filter/gr_fir_scc_simd.h FIXME: not found +;; (pass-if (true? (gr:fir-scc-simd))) +;; (pass-if (true? (gr:fir-scc-simd #(1+3i 23+5i)))) + +;;; ./filter/gr_fir_scc_x86.h FIXME: not found +;; (pass-if (true? (gr:fir-scc-x86))) +;; (pass-if (true? (gr:fir-scc-x86 #(1+3i 23+5i)))) + +;;; ./filter/gr_fir_sysconfig_armv7_a.h FIXME: virtual methods +;; (pass-if (true? (gr:fir-sysconfig-armv7-a ))) + +;;; ./filter/gr_fir_sysconfig_generic.h FIXME: virtual methods +;; (pass-if (true? (gr:fir-sysconfig-generic ))) + +;;; ./filter/gr_fir_sysconfig_powerpc.h FIXME: virtual methods +;; (pass-if (true? (gr:fir-sysconfig-powerpc ))) + +;;; ./filter/gr_fir_sysconfig_x86.h FIXME: virtual methods +;; (pass-if (true? (gr:fir-sysconfig-x86 ))) + +;;; ./filter/gr_fractional_interpolator_cc.h FIXME: not found +;; (pass-if (true? (gr:fractional-interpolator-cc 1.0 1.0))) + +;;; ./filter/gr_fractional_interpolator_ff.h FIXME: not found +;; (pass-if (true? (gr:fractional-interpolator-ff 1.0 1.0))) + +;;; ./filter/gr_freq_xlating_fir_filter_ccc.h FIXME: not found +;; (pass-if (true? (gr:freq-xlating-fir-filter-ccc 1.0 1.0))) + +;;; ./filter/gr_freq_xlating_fir_filter_ccf.h FIXME: not found +;; (pass-if (true? (gr:freq-xlating-fir-filter-ccf 1.0 1.0))) + +;;; ./filter/gr_freq_xlating_fir_filter_fcc.h FIXME: not found +;; (pass-if (true? (gr:freq-xlating-fir-filter-fcc 1.0 1.0))) + +;;; ./filter/gr_freq_xlating_fir_filter_fcf.h FIXME: not found +;; (pass-if (true? (gr:freq-xlating-fir-filter-fcf 1.0 1.0))) + +;;; ./filter/gr_freq_xlating_fir_filter_scc.h FIXME: not found +;; (pass-if (true? (gr:freq-xlating-fir-filter-scc 1.0 1.0))) + +;;; ./filter/gr_freq_xlating_fir_filter_scf.h FIXME: not found +;; (pass-if (true? (gr:freq-xlating-fir-filter-scf 1.0 1.0))) + +;;; ./filter/gr_goertzel_fc.h FIXME: not found +;; (pass-if (true? (gr:goertzel-fc 1 1 1))) + +;;; ./filter/gr_hilbert_fc.h FIXME: not found +;; (pass-if (true? (gr:hilbert-fc ))) + +;;; ./filter/gr_iir_filter_ffd.h FIXME: not found +;; (pass-if (true? (gr:iir-filter-ffd ))) + +;;; ./filter/gr_interp_fir_filter_ccc.h FIXME: not found +;; (pass-if (true? (gr:interp-fir-filter-ccc ))) + +;;; ./filter/gr_interp_fir_filter_ccf.h FIXME: not found +;; (pass-if (true? (gr:interp-fir-filter-ccf ))) + +;;; ./filter/gr_interp_fir_filter_fcc.h FIXME: not found +;; (pass-if (true? (gr:interp-fir-filter-fcc ))) + +;;; ./filter/gr_interp_fir_filter_fff.h FIXME: not found +;; (pass-if (true? (gr:interp-fir-filter-fff ))) + +;;; ./filter/gr_interp_fir_filter_fsf.h FIXME: not found +;; (pass-if (true? (gr:interp-fir-filter-fsf ))) + ;;; ./filter/gr_interp_fir_filter_scc.h +;; (pass-if (true? (gr:interp-fir-filter-scc ))) + ;;; ./filter/gr_pfb_arb_resampler_ccf.h +;; (pass-if (true? (gr:pfb-arb-resampler-ccf ))) + ;;; ./filter/gr_pfb_channelizer_ccf.h +;; (pass-if (true? (gr:pfb-channelizer-ccf ))) + ;;; ./filter/gr_pfb_clock_sync_ccf.h +;; (pass-if (true? (gr:pfb-clock-sync-ccf ))) + ;;; ./filter/gr_pfb_clock_sync_fff.h +;; (pass-if (true? (gr:pfb-clock-sync-fff ))) + ;;; ./filter/gr_pfb_decimator_ccf.h +;; (pass-if (true? (gr:pfb-decimator-ccf ))) + ;;; ./filter/gr_pfb_interpolator_ccf.h +;; (pass-if (true? (gr:pfb-interpolator-ccf ))) + ;;; ./filter/gr_rational_resampler_base_ccc.h +;; (pass-if (true? (gr:rational-resampler-base-ccc ))) + ;;; ./filter/gr_rational_resampler_base_ccf.h +;; (pass-if (true? (gr:rational-resampler-base-ccf ))) + ;;; ./filter/gr_rational_resampler_base_fcc.h +;; (pass-if (true? (gr:rational-resampler-base-fcc ))) + ;;; ./filter/gr_rational_resampler_base_fff.h +;; (pass-if (true? (gr:rational-resampler-base-fff ))) + ;;; ./filter/gr_rational_resampler_base_fsf.h +;; (pass-if (true? (gr:rational-resampler-base-fsf ))) + ;;; ./filter/gr_rational_resampler_base_scc.h +;; (pass-if (true? (gr:rational-resampler-base-scc ))) + ;;; ./filter/gr_single_pole_iir_filter_cc.h +;; (pass-if (true? (gr:single-pole-iir-filter-cc ))) + ;;; ./filter/gr_single_pole_iir_filter_ff.h +;; (pass-if (true? (gr:single-pole-iir-filter-ff ))) -- cgit From c4b880a4d6fcd21da17191a7a4f6f0db7dff95e3 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Wed, 10 Nov 2010 11:32:34 -0700 Subject: comment out the two failures --- gnuradio-core/src/guile/tests/general_ctors.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index 6153ce795..d9f44a12d 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -76,13 +76,13 @@ ;;; ./general/gr_check_lfsr_32k_s.h FIXME: not found ;; (pass-if (true? (gr:check-lfsr-2k-s))) -;;; ./general/gr_clock_recovery_mm_cc.h +;;; ./general/gr_clock_recovery_mm_cc.h FIXME: throw test fails (pass-if (true? (gr:clock-recovery-mm-cc 1 1 1 1 1))) -;; (pass-if-throw "confirm throw gr:clock-recovery-mm-cc" #t (true? (gr:clock-recovery-mm-cc 0 0 0 0 0))) FIXME: segfault +;; (pass-if-throw "confirm throw gr:clock-recovery-mm-cc" #t (true? (gr:clock-recovery-mm-cc 1 1 1 1 1))) -;;; ./general/gr_clock_recovery_mm_ff.h +;;; ./general/gr_clock_recovery_mm_ff.h FIXME: throw test fails (pass-if (true? (gr:clock-recovery-mm-ff 1 1 1 1 1))) -(pass-if-throw "confirm throw gr:clock-recovery-mm-ff" #t (true? (gr:clock-recovery-mm-ff 1 1 1 1 1))) +;; (pass-if-throw "confirm throw gr:clock-recovery-mm-ff" #t (true? (gr:clock-recovery-mm-ff 1 1 1 1 1))) ;;; ./general/gr_complex_to_interleaved_short.h (pass-if (true? (gr:complex-to-interleaved-short))) -- cgit From df92b7c6315c567e58e0d9c293d7c9c2699023d3 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 10 Nov 2010 13:01:38 -0800 Subject: regenerated --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index 0803cbfee..7da681a26 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -112,8 +112,8 @@ gnuradio_core_runtime.py: gnuradio_core_runtime.i if GUILE gnuradio_core_runtime_scmlib_LTLIBRARIES = libguile-gnuradio_core_runtime.la -libguile_gnuradio_core_runtime_la_SOURCES = \ - guile/gnuradio_core_runtime.cc \ +libguile_gnuradio_core_runtime_la_SOURCES = \ + guile/gnuradio_core_runtime.cc \ $(gnuradio_core_runtime_la_swig_sources) nobase_gnuradio_core_runtime_scm_DATA = gnuradio/gnuradio_core_runtime.scm gnuradio/gnuradio_core_runtime-primitive.scm @@ -245,8 +245,8 @@ gnuradio_core_general.py: gnuradio_core_general.i if GUILE gnuradio_core_general_scmlib_LTLIBRARIES = libguile-gnuradio_core_general.la -libguile_gnuradio_core_general_la_SOURCES = \ - guile/gnuradio_core_general.cc \ +libguile_gnuradio_core_general_la_SOURCES = \ + guile/gnuradio_core_general.cc \ $(gnuradio_core_general_la_swig_sources) nobase_gnuradio_core_general_scm_DATA = gnuradio/gnuradio_core_general.scm gnuradio/gnuradio_core_general-primitive.scm @@ -378,8 +378,8 @@ gnuradio_core_gengen.py: gnuradio_core_gengen.i if GUILE gnuradio_core_gengen_scmlib_LTLIBRARIES = libguile-gnuradio_core_gengen.la -libguile_gnuradio_core_gengen_la_SOURCES = \ - guile/gnuradio_core_gengen.cc \ +libguile_gnuradio_core_gengen_la_SOURCES = \ + guile/gnuradio_core_gengen.cc \ $(gnuradio_core_gengen_la_swig_sources) nobase_gnuradio_core_gengen_scm_DATA = gnuradio/gnuradio_core_gengen.scm gnuradio/gnuradio_core_gengen-primitive.scm @@ -511,8 +511,8 @@ gnuradio_core_filter.py: gnuradio_core_filter.i if GUILE gnuradio_core_filter_scmlib_LTLIBRARIES = libguile-gnuradio_core_filter.la -libguile_gnuradio_core_filter_la_SOURCES = \ - guile/gnuradio_core_filter.cc \ +libguile_gnuradio_core_filter_la_SOURCES = \ + guile/gnuradio_core_filter.cc \ $(gnuradio_core_filter_la_swig_sources) nobase_gnuradio_core_filter_scm_DATA = gnuradio/gnuradio_core_filter.scm gnuradio/gnuradio_core_filter-primitive.scm @@ -644,8 +644,8 @@ gnuradio_core_io.py: gnuradio_core_io.i if GUILE gnuradio_core_io_scmlib_LTLIBRARIES = libguile-gnuradio_core_io.la -libguile_gnuradio_core_io_la_SOURCES = \ - guile/gnuradio_core_io.cc \ +libguile_gnuradio_core_io_la_SOURCES = \ + guile/gnuradio_core_io.cc \ $(gnuradio_core_io_la_swig_sources) nobase_gnuradio_core_io_scm_DATA = gnuradio/gnuradio_core_io.scm gnuradio/gnuradio_core_io-primitive.scm @@ -777,8 +777,8 @@ gnuradio_core_hier.py: gnuradio_core_hier.i if GUILE gnuradio_core_hier_scmlib_LTLIBRARIES = libguile-gnuradio_core_hier.la -libguile_gnuradio_core_hier_la_SOURCES = \ - guile/gnuradio_core_hier.cc \ +libguile_gnuradio_core_hier_la_SOURCES = \ + guile/gnuradio_core_hier.cc \ $(gnuradio_core_hier_la_swig_sources) nobase_gnuradio_core_hier_scm_DATA = gnuradio/gnuradio_core_hier.scm gnuradio/gnuradio_core_hier-primitive.scm -- cgit From f43d2a4759e0ecd6519c0ac0aa4afbc54e70ea65 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Wed, 10 Nov 2010 17:57:11 -0700 Subject: add the .i files as dependencies --- gnuradio-core/src/lib/filter/Makefile.am | 14 ++++++++++++++ gnuradio-core/src/lib/general/Makefile.am | 14 ++++++++++++++ gnuradio-core/src/lib/gengen/Makefile.am | 14 ++++++++++++++ gnuradio-core/src/lib/hier/Makefile.am | 16 +++++++++++++++- gnuradio-core/src/lib/io/Makefile.am | 14 ++++++++++++++ 5 files changed, 71 insertions(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/filter/Makefile.am b/gnuradio-core/src/lib/filter/Makefile.am index 6d2ec1c7e..be220425f 100644 --- a/gnuradio-core/src/lib/filter/Makefile.am +++ b/gnuradio-core/src/lib/filter/Makefile.am @@ -387,3 +387,17 @@ gen_sources = $(BUILT_SOURCES) gen_sources_deps = $(core_generator) par_gen_command = PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_all.py include $(top_srcdir)/Makefile.par.gen + +# Produce a list of the file names with the .cc stripped off +files = $(foreach HFILE,$(libfilter_la_SOURCES), $(patsubst %.cc,%,$(HFILE))) + +# All .lo files depend on the .i file of the same name +define template +-include $(DEPDIR)/$(1).d +$(DEPDIR)/$(1).d: + @echo "$(1).lo: \\" > $(DEPDIR)/$(1).d + @cat ../swig/guile/gnuradio_core_filter.Std | sed -e '1d;' >> $(DEPDIR)/$(1).d +endef + +# Generate all the dependencies at runtime +$(foreach prog,$(files),$(eval $(call template,$(prog)))) diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am index 3d8a42805..4a25df00a 100644 --- a/gnuradio-core/src/lib/general/Makefile.am +++ b/gnuradio-core/src/lib/general/Makefile.am @@ -486,3 +486,17 @@ swiginclude_HEADERS = \ gr_probe_mpsk_snr_c.i \ gr_probe_density_b.i endif + +# Produce a list of the file names with the .cc stripped off +files = $(foreach HFILE,$(libgeneral_la_SOURCES), $(patsubst %.cc,%,$(HFILE))) + +# All .lo files depend on the .i file of the same name +define template +-include $(DEPDIR)/$(1).d +$(DEPDIR)/$(1).d: + @echo "$(1).lo: \\" > $(DEPDIR)/$(1).d + @cat ../swig/guile/gnuradio_core_general.Std | sed -e '1d;' >> $(DEPDIR)/$(1).d +endef + +# Generate all the dependencies at runtime +$(foreach prog,$(files),$(eval $(call template,$(prog)))) diff --git a/gnuradio-core/src/lib/gengen/Makefile.am b/gnuradio-core/src/lib/gengen/Makefile.am index 4978ad1c5..83a4003af 100644 --- a/gnuradio-core/src/lib/gengen/Makefile.am +++ b/gnuradio-core/src/lib/gengen/Makefile.am @@ -159,3 +159,17 @@ gen_sources = $(BUILT_SOURCES) gen_sources_deps = $(core_generator) par_gen_command = PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_all.py include $(top_srcdir)/Makefile.par.gen + +# Produce a list of the file names with the .cc stripped off +files = $(foreach HFILE,$(libgengen_la_SOURCES), $(patsubst %.cc,%,$(HFILE))) + +# All .lo files depend on the .i file of the same name +define template +-include $(DEPDIR)/$(1).d +$(DEPDIR)/$(1).d: + @echo "$(1).lo: \\" > $(DEPDIR)/$(1).d + @cat ../swig/guile/gnuradio_core_gengen.Std | sed -e '1d;' >> $(DEPDIR)/$(1).d +endef + +# Generate all the dependencies at runtime +$(foreach prog,$(files),$(eval $(call template,$(prog)))) diff --git a/gnuradio-core/src/lib/hier/Makefile.am b/gnuradio-core/src/lib/hier/Makefile.am index e2e7fe886..86639c660 100644 --- a/gnuradio-core/src/lib/hier/Makefile.am +++ b/gnuradio-core/src/lib/hier/Makefile.am @@ -20,7 +20,7 @@ # include $(top_srcdir)/Makefile.common - +#-include $(top_builddir)/gnuradio-core/src/lib/swig/guile/gnuradio_core_hier.d AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(WITH_INCLUDES) @@ -37,3 +37,17 @@ swiginclude_HEADERS = \ hier.i \ gr_channel_model.i endif + +# Produce a list of the file names with the .cc stripped off +files = $(foreach HFILE,$(libhier_la_SOURCES), $(patsubst %.cc,%,$(HFILE))) + +# All .lo files depend on the .i file of the same name +define template +-include $(DEPDIR)/$(1).d +$(DEPDIR)/$(1).d: + @echo "$(1).lo: \\" > $(DEPDIR)/$(1).d + @cat ../swig/guile/gnuradio_core_hier.Std | sed -e '1d;' >> $(DEPDIR)/$(1).d +endef + +# Generate all the dependencies at runtime +$(foreach prog,$(files),$(eval $(call template,$(prog)))) diff --git a/gnuradio-core/src/lib/io/Makefile.am b/gnuradio-core/src/lib/io/Makefile.am index c52554645..0ab9ac135 100644 --- a/gnuradio-core/src/lib/io/Makefile.am +++ b/gnuradio-core/src/lib/io/Makefile.am @@ -113,3 +113,17 @@ swiginclude_HEADERS = \ gr_wavfile_source.i \ gr_wavfile_sink.i endif + +# Produce a list of the file names with the .cc stripped off +files = $(foreach HFILE,$(libio_la_SOURCES), $(patsubst %.cc,%,$(HFILE))) + +# All .lo files depend on the .i file of the same name +define template +-include $(DEPDIR)/$(1).d +$(DEPDIR)/$(1).d: + @echo "$(1).lo: \\" > $(DEPDIR)/$(1).d + @cat ../swig/guile/gnuradio_core_io.Std | sed -e '1d;' >> $(DEPDIR)/$(1).d +endef + +# Generate all the dependencies at runtime +$(foreach prog,$(files),$(eval $(call template,$(prog)))) -- cgit From 95ccbf4791363ab7c07a1b647976a3be1873722d Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 10 Nov 2010 18:09:11 -0800 Subject: Remove generated file from repo --- .../lib/filter/gri_fir_filter_with_buffer_ccf.h | 131 --------------------- 1 file changed, 131 deletions(-) delete mode 100644 gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_ccf.h (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_ccf.h b/gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_ccf.h deleted file mode 100644 index bd7fa33cf..000000000 --- a/gnuradio-core/src/lib/filter/gri_fir_filter_with_buffer_ccf.h +++ /dev/null @@ -1,131 +0,0 @@ -/* -*- c++ -*- */ -/* - * 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 GNU Radio; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, - * Boston, MA 02110-1301, USA. - */ - -/* - * WARNING: This file is automatically generated by generate_gri_fir_XXX.py - * Any changes made to this file will be overwritten. - */ - - -#ifndef INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H -#define INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H - -#include -#include -#include -#include -#include - -/*! - * \brief FIR with internal buffer for gr_complex input, - gr_complex output and float taps - * \ingroup filter - * - */ - -class gri_fir_filter_with_buffer_ccf { - -protected: - std::vector d_taps; // reversed taps - gr_complex *d_buffer; - unsigned int d_idx; - -public: - - // CONSTRUCTORS - - /*! - * \brief construct new FIR with given taps. - * - * Note that taps must be in forward order, e.g., coefficient 0 is - * stored in new_taps[0], coefficient 1 is stored in - * new_taps[1], etc. - */ - gri_fir_filter_with_buffer_ccf (const std::vector &taps); - - ~gri_fir_filter_with_buffer_ccf (); - - // MANIPULATORS - - /*! - * \brief compute a single output value. - * - * \p input is a single input value of the filter type - * - * \returns the filtered input value. - */ - gr_complex filter (gr_complex input); - - - /*! - * \brief compute a single output value; designed for decimating filters. - * - * \p input is a single input value of the filter type. The value of dec is the - * decimating value of the filter, so input[] must have dec valid values. - * The filter pushes dec number of items onto the circ. buffer before computing - * a single output. - * - * \returns the filtered input value. - */ - gr_complex filter (const gr_complex input[], unsigned long dec); - - /*! - * \brief compute an array of N output values. - * - * \p input must have (n - 1 + ntaps()) valid entries. - * input[0] .. input[n - 1 + ntaps() - 1] are referenced to compute the output values. - */ - void filterN (gr_complex output[], const gr_complex input[], - unsigned long n); - - /*! - * \brief compute an array of N output values, decimating the input - * - * \p input must have (decimate * (n - 1) + ntaps()) valid entries. - * input[0] .. input[decimate * (n - 1) + ntaps() - 1] are referenced to - * compute the output values. - */ - void filterNdec (gr_complex output[], const gr_complex input[], - unsigned long n, unsigned long decimate); - - /*! - * \brief install \p new_taps as the current taps. - */ - void set_taps (const std::vector &taps); - - // ACCESSORS - - /*! - * \return number of taps in filter. - */ - unsigned ntaps () const { return d_taps.size (); } - - /*! - * \return current taps - */ - const std::vector get_taps () const - { - return gr_reverse(d_taps); - } -}; - -#endif /* INCLUDED_GRI_FIR_FILTER_WITH_BUFFER_CCF_H */ -- cgit From fa9eeb2aab040a3c74da639233ba8f9a585b0455 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 10 Nov 2010 18:12:02 -0800 Subject: Add @srcdir@ to test directory specifier --- gnuradio-core/src/guile/Makefile.am | 4 ---- gnuradio-core/src/guile/run_guile_tests.in | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index 5eb9444af..f4cc14175 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -49,7 +49,3 @@ noinst_DATA = \ tests/io_ctors.test CLEANFILES = guile.log - -check-am: all-am - @test -d "tests" || $(mkinstalldirs) "tests" - $(MAKE) $(AM_MAKEFLAGS) check-TESTS diff --git a/gnuradio-core/src/guile/run_guile_tests.in b/gnuradio-core/src/guile/run_guile_tests.in index e52497332..ceaa84108 100644 --- a/gnuradio-core/src/guile/run_guile_tests.in +++ b/gnuradio-core/src/guile/run_guile_tests.in @@ -12,4 +12,4 @@ # "" \ # "" -@GUILE@ -e main -c '(use-modules (gnuradio test-suite guile-test))' -t tests +@GUILE@ -e main -c '(use-modules (gnuradio test-suite guile-test))' -t @srcdir@/tests -- cgit From 5783b693279b6c64ef800f6e8294ec68a2869b29 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 10 Nov 2010 18:21:50 -0800 Subject: Revert "add the .i files as dependencies" This reverts commit f43d2a4759e0ecd6519c0ac0aa4afbc54e70ea65. The dependencies doesn't make any sense. There's an attempt to run sed on files that haven't been generated yet. --- gnuradio-core/src/lib/filter/Makefile.am | 14 -------------- gnuradio-core/src/lib/general/Makefile.am | 14 -------------- gnuradio-core/src/lib/gengen/Makefile.am | 14 -------------- gnuradio-core/src/lib/hier/Makefile.am | 16 +--------------- gnuradio-core/src/lib/io/Makefile.am | 14 -------------- 5 files changed, 1 insertion(+), 71 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/filter/Makefile.am b/gnuradio-core/src/lib/filter/Makefile.am index be220425f..6d2ec1c7e 100644 --- a/gnuradio-core/src/lib/filter/Makefile.am +++ b/gnuradio-core/src/lib/filter/Makefile.am @@ -387,17 +387,3 @@ gen_sources = $(BUILT_SOURCES) gen_sources_deps = $(core_generator) par_gen_command = PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_all.py include $(top_srcdir)/Makefile.par.gen - -# Produce a list of the file names with the .cc stripped off -files = $(foreach HFILE,$(libfilter_la_SOURCES), $(patsubst %.cc,%,$(HFILE))) - -# All .lo files depend on the .i file of the same name -define template --include $(DEPDIR)/$(1).d -$(DEPDIR)/$(1).d: - @echo "$(1).lo: \\" > $(DEPDIR)/$(1).d - @cat ../swig/guile/gnuradio_core_filter.Std | sed -e '1d;' >> $(DEPDIR)/$(1).d -endef - -# Generate all the dependencies at runtime -$(foreach prog,$(files),$(eval $(call template,$(prog)))) diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am index 4a25df00a..3d8a42805 100644 --- a/gnuradio-core/src/lib/general/Makefile.am +++ b/gnuradio-core/src/lib/general/Makefile.am @@ -486,17 +486,3 @@ swiginclude_HEADERS = \ gr_probe_mpsk_snr_c.i \ gr_probe_density_b.i endif - -# Produce a list of the file names with the .cc stripped off -files = $(foreach HFILE,$(libgeneral_la_SOURCES), $(patsubst %.cc,%,$(HFILE))) - -# All .lo files depend on the .i file of the same name -define template --include $(DEPDIR)/$(1).d -$(DEPDIR)/$(1).d: - @echo "$(1).lo: \\" > $(DEPDIR)/$(1).d - @cat ../swig/guile/gnuradio_core_general.Std | sed -e '1d;' >> $(DEPDIR)/$(1).d -endef - -# Generate all the dependencies at runtime -$(foreach prog,$(files),$(eval $(call template,$(prog)))) diff --git a/gnuradio-core/src/lib/gengen/Makefile.am b/gnuradio-core/src/lib/gengen/Makefile.am index 83a4003af..4978ad1c5 100644 --- a/gnuradio-core/src/lib/gengen/Makefile.am +++ b/gnuradio-core/src/lib/gengen/Makefile.am @@ -159,17 +159,3 @@ gen_sources = $(BUILT_SOURCES) gen_sources_deps = $(core_generator) par_gen_command = PYTHONPATH=$(top_srcdir)/gnuradio-core/src/python srcdir=$(srcdir) $(PYTHON) $(srcdir)/generate_all.py include $(top_srcdir)/Makefile.par.gen - -# Produce a list of the file names with the .cc stripped off -files = $(foreach HFILE,$(libgengen_la_SOURCES), $(patsubst %.cc,%,$(HFILE))) - -# All .lo files depend on the .i file of the same name -define template --include $(DEPDIR)/$(1).d -$(DEPDIR)/$(1).d: - @echo "$(1).lo: \\" > $(DEPDIR)/$(1).d - @cat ../swig/guile/gnuradio_core_gengen.Std | sed -e '1d;' >> $(DEPDIR)/$(1).d -endef - -# Generate all the dependencies at runtime -$(foreach prog,$(files),$(eval $(call template,$(prog)))) diff --git a/gnuradio-core/src/lib/hier/Makefile.am b/gnuradio-core/src/lib/hier/Makefile.am index 86639c660..e2e7fe886 100644 --- a/gnuradio-core/src/lib/hier/Makefile.am +++ b/gnuradio-core/src/lib/hier/Makefile.am @@ -20,7 +20,7 @@ # include $(top_srcdir)/Makefile.common -#-include $(top_builddir)/gnuradio-core/src/lib/swig/guile/gnuradio_core_hier.d + AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(WITH_INCLUDES) @@ -37,17 +37,3 @@ swiginclude_HEADERS = \ hier.i \ gr_channel_model.i endif - -# Produce a list of the file names with the .cc stripped off -files = $(foreach HFILE,$(libhier_la_SOURCES), $(patsubst %.cc,%,$(HFILE))) - -# All .lo files depend on the .i file of the same name -define template --include $(DEPDIR)/$(1).d -$(DEPDIR)/$(1).d: - @echo "$(1).lo: \\" > $(DEPDIR)/$(1).d - @cat ../swig/guile/gnuradio_core_hier.Std | sed -e '1d;' >> $(DEPDIR)/$(1).d -endef - -# Generate all the dependencies at runtime -$(foreach prog,$(files),$(eval $(call template,$(prog)))) diff --git a/gnuradio-core/src/lib/io/Makefile.am b/gnuradio-core/src/lib/io/Makefile.am index 0ab9ac135..c52554645 100644 --- a/gnuradio-core/src/lib/io/Makefile.am +++ b/gnuradio-core/src/lib/io/Makefile.am @@ -113,17 +113,3 @@ swiginclude_HEADERS = \ gr_wavfile_source.i \ gr_wavfile_sink.i endif - -# Produce a list of the file names with the .cc stripped off -files = $(foreach HFILE,$(libio_la_SOURCES), $(patsubst %.cc,%,$(HFILE))) - -# All .lo files depend on the .i file of the same name -define template --include $(DEPDIR)/$(1).d -$(DEPDIR)/$(1).d: - @echo "$(1).lo: \\" > $(DEPDIR)/$(1).d - @cat ../swig/guile/gnuradio_core_io.Std | sed -e '1d;' >> $(DEPDIR)/$(1).d -endef - -# Generate all the dependencies at runtime -$(foreach prog,$(files),$(eval $(call template,$(prog)))) -- 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. --- gnuradio-core/src/guile/run_guile_tests.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/run_guile_tests.in b/gnuradio-core/src/guile/run_guile_tests.in index ceaa84108..3aca7bdb0 100644 --- a/gnuradio-core/src/guile/run_guile_tests.in +++ b/gnuradio-core/src/guile/run_guile_tests.in @@ -2,11 +2,11 @@ . @top_builddir@/setup_guile_test_env -# 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 -# We're in gnuradio-core, we don't need this +# We're in gnuradio-core, we don't need these # add_local_paths \ # "" \ # "" \ -- cgit From abde5affda1533c518cce06d5edcffa4eda52340 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 13 Nov 2010 16:19:48 -0800 Subject: dail-tone.wfd example waveform can be loaded and run by gr-run-waveform. Write new app, gr-run-waveform, that reads waveforms and runs them. We'll need to turn this into a small piece of C/C++ code that embeds guile, but the guts of it is working. --- gnuradio-core/src/guile/Makefile.am | 6 ++- gnuradio-core/src/guile/gnuradio/waveform-spec.scm | 36 --------------- gnuradio-core/src/guile/gnuradio/waveform.scm | 54 ++++++++++++++++++++++ gnuradio-core/src/lib/.gitignore | 2 - 4 files changed, 58 insertions(+), 40 deletions(-) delete mode 100644 gnuradio-core/src/guile/gnuradio/waveform-spec.scm create mode 100644 gnuradio-core/src/guile/gnuradio/waveform.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index f4cc14175..0c0becbc1 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -22,7 +22,8 @@ include $(top_srcdir)/Makefile.common TESTS = run_guile_tests EXTRA_DIST = \ - run_guile_tests.in + run_guile_tests.in \ + $(GUILE_TESTS) # These are the hand-code guile files for gnuradio-core. # @@ -36,10 +37,11 @@ nobase_guile_DATA = \ gnuradio/core.scm \ gnuradio/export-safely.scm \ gnuradio/runtime-shim.scm \ + gnuradio/waveform.scm \ gnuradio/test-suite/guile-test \ gnuradio/test-suite/lib.scm -noinst_DATA = \ +GUILE_TESTS = \ tests/00_runtime_basics.test \ tests/00_runtime_ctors.test \ tests/filter_ctors.test \ diff --git a/gnuradio-core/src/guile/gnuradio/waveform-spec.scm b/gnuradio-core/src/guile/gnuradio/waveform-spec.scm deleted file mode 100644 index 956a36106..000000000 --- a/gnuradio-core/src/guile/gnuradio/waveform-spec.scm +++ /dev/null @@ -1,36 +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 . -;;; - -(define-module (gnuradio waveform-spec) - #:use-module (ice-9 syncase) - #:export-syntax waveform-spec) - -(define-syntax waveform-spec - (syntax-rules (vars blocks connections) - ((_ (args ...) - (vars (v-name v-val) ...) - (blocks (b-name b-val) ...) - (connections (endpoint1 endpoint2 ...) ...)) - (lambda (args ...) - (let* ((v-name v-val) ... - (b-name b-val) ... - (tb (gr:top-block-swig "waveform-top-block"))) - (gr:connect tb endpoint1 endpoint2 ...) ... - tb))))) - diff --git a/gnuradio-core/src/guile/gnuradio/waveform.scm b/gnuradio-core/src/guile/gnuradio/waveform.scm new file mode 100644 index 000000000..0031be931 --- /dev/null +++ b/gnuradio-core/src/guile/gnuradio/waveform.scm @@ -0,0 +1,54 @@ +;;; +;;; 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 . +;;; + +(define-module (gnuradio waveform) + #:use-module (ice-9 syncase) + #:export-syntax (define-waveform)) + + +(define *registry* '()) ; alist +(define *last-registered* #f) + + +(define-syntax define-waveform + (syntax-rules (vars blocks connections) + ((_ (name cmd-line-args) + (vars (v-name v-val) ...) + (blocks (b-name b-val) ...) + (connections (endpoint1 endpoint2 ...) ...)) + (waveform-register 'name + (lambda (cmd-line-args) + (let* ((v-name v-val) ... + (b-name b-val) ... + (tb (gr:top-block-swig "waveform-top-block"))) + (gr:connect tb endpoint1 endpoint2 ...) ... + tb)))))) + + +(define-public (waveform-register name thunk) + (set! *registry* (assoc-set! *registry* name thunk)) + (set! *last-registered* thunk) + #t) + +(define-public (waveform-lookup name) + (let ((r (assoc name *registry*))) + (and r (cdr r)))) + +(define-public (waveform-last-registered) + *last-registered*) diff --git a/gnuradio-core/src/lib/.gitignore b/gnuradio-core/src/lib/.gitignore index e3bc1ee6a..0d5077da5 100644 --- a/gnuradio-core/src/lib/.gitignore +++ b/gnuradio-core/src/lib/.gitignore @@ -1,7 +1,5 @@ /Makefile /Makefile.in -/.la -/.lo /.deps /.libs /*.la -- cgit From b7667afd81b8303a542204ac05ffa969519702af Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 14 Nov 2010 09:05:16 -0800 Subject: Fixed as many problems in general_ctors.test as I could quickly. --- gnuradio-core/src/guile/tests/general_ctors.test | 111 ++++++++++----------- .../src/lib/general/gr_clock_recovery_mm_cc.i | 7 +- .../src/lib/general/gr_clock_recovery_mm_ff.i | 7 +- gnuradio-core/src/lib/general/gr_fft_vfc.i | 3 +- 4 files changed, 61 insertions(+), 67 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index d9f44a12d..5cdff5c3f 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -54,12 +54,12 @@ ;;; ./general/gr_agc_ff.h (pass-if (true? (gr:agc-ff 0 0 0 0))) -;;; ./general/gr_align_on_samplenumbers_ss.h FIXME: throws +;;; ./general/gr_align_on_samplenumbers_ss.h (pass-if (true? (gr:align-on-samplenumbers-ss 2 128))) -;; (pass-if-throw "confirm throw gr:align-on-samplenumbers-ss" #t (true? (gr:align-on-samplenumbers-ss 0 0))) +(pass-if-throw "confirm throw gr:align-on-samplenumbers-ss" #t (true? (gr:align-on-samplenumbers-ss 0 0))) -;;; ./general/gr_bin_statistics_f.h FIXME: not found -;; (pass-if (true? (gr:bin-statistics-f 0 0 0 0 0))) +;;; ./general/gr_bin_statistics_f.h WONTFIX: requires gr_feval_dd & swig directors +;;;(pass-if (true? (gr:bin-statistics-f 1 (gr:msg-queue) 0 0 0))) ;;; ./general/gr_binary_slicer_fb.h (pass-if (true? (gr:binary-slicer-fb))) @@ -70,19 +70,19 @@ ;;; ./general/gr_char_to_float.h (pass-if (true? (gr:char-to-float))) -;;; ./general/gr_check_counting_s.h FIXME: not found -;; (pass-if (true? (gr:check-counting-s false))) +;;; ./general/gr_check_counting_s.h +(pass-if (true? (gr:check-counting-s #f))) -;;; ./general/gr_check_lfsr_32k_s.h FIXME: not found -;; (pass-if (true? (gr:check-lfsr-2k-s))) +;;; ./general/gr_check_lfsr_32k_s.h +(pass-if (true? (gr:check-lfsr-32k-s))) -;;; ./general/gr_clock_recovery_mm_cc.h FIXME: throw test fails +;;; ./general/gr_clock_recovery_mm_cc.h (pass-if (true? (gr:clock-recovery-mm-cc 1 1 1 1 1))) -;; (pass-if-throw "confirm throw gr:clock-recovery-mm-cc" #t (true? (gr:clock-recovery-mm-cc 1 1 1 1 1))) +(pass-if-throw "confirm throw gr:clock-recovery-mm-cc" #t (true? (gr:clock-recovery-mm-cc -1 1 1 1 1))) -;;; ./general/gr_clock_recovery_mm_ff.h FIXME: throw test fails +;;; ./general/gr_clock_recovery_mm_ff.h (pass-if (true? (gr:clock-recovery-mm-ff 1 1 1 1 1))) -;; (pass-if-throw "confirm throw gr:clock-recovery-mm-ff" #t (true? (gr:clock-recovery-mm-ff 1 1 1 1 1))) +(pass-if-throw "confirm throw gr:clock-recovery-mm-ff" #t (true? (gr:clock-recovery-mm-ff -1 1 1 1 1))) ;;; ./general/gr_complex_to_interleaved_short.h (pass-if (true? (gr:complex-to-interleaved-short))) @@ -98,17 +98,19 @@ ;;; ./general/gr_conjugate_cc.h (pass-if (true? (gr:conjugate-cc))) -;;; ./general/gr_constellation_decoder_cb.h FIXME: not found +;;; ./general/gr_constellation_decoder_cb.h FIXME: wrong-arg-type (not sure why...) ;gr_constellation_decoder_cb (const std::vector &sym_position, ; const std::vector &sym_value_out); -;; (pass-if (true? (gr:constellation_decoder_cb #(1+3i 23+5i) #(1 2)))) +;; (pass-if (true? (gr:constellation-decoder-cb #(2+3i 23+5i) #(0 1)))) ;;; ./general/gr_copy.h (pass-if (true? (gr:copy 1))) ;;; ./general/gr_correlate_access_code_bb.h (pass-if (true? (gr:correlate-access-code-bb "foo" 0))) -;; (pass-if-throw "confirm throw correlate-access-code-bb" #t (true? (gr:correlate-access-code-bb "foo" -1))) FIXME: throws +(pass-if-throw "confirm throw correlate-access-code-bb" #t + (true? (gr:correlate-access-code-bb + "00000000000000000000000000000000000000000000000000000000000000000" 0))) ;;; ./general/gr_costas_loop_cc.h (pass-if (true? (gr:costas-loop-cc 0 0 0 0 2))) @@ -117,8 +119,8 @@ ;;; ./general/gr_cpfsk_bc.h (pass-if (true? (gr:cpfsk-bc 1 1 1))) -;;; ./general/gr_ctcss_squelch_ff.h FIXME: not found -;; (pass-if (true? (gr:ctcss-squelch-ff 0 0 0 0 0 true))) +;;; ./general/gr_ctcss_squelch_ff.h +(pass-if (true? (gr:ctcss-squelch-ff 0 0 0 0 0 #t))) ;;; ./general/gr_decode_ccsds_27_fb.h (pass-if (true? (gr:decode-ccsds-27-fb))) @@ -147,22 +149,20 @@ ;;; ./general/gr_encode_ccsds_27_bb.h (pass-if (true? (gr:encode-ccsds-27-bb))) -;;; ./general/gr_fake_channel_coder_pp.h FIXME: not found -;; (pass-if (true? (gr:fake-channel-coder-pp 1 1))) -;; (pass-if-throw "confirm throw" #t (true? (gr:fake-channel-coder-pp -1 1))) +;;; ./general/gr_fake_channel_coder_pp.h FIXME: file name doesn't match class name +(pass-if (true? (gr:fake-channel-encoder-pp 1 1))) +(pass-if-throw "confirm throw" #t (true? (gr:fake-channel-encoder-pp -1 1))) ;;; ./general/gr_feedforward_agc_cc.h (pass-if (true? (gr:feedforward-agc-cc 1 1))) -;;; ./general/gr_fft_vcc.h FIXME: not found -;; (pass-if (true? (gr:fft-vcc 1 false #(1.0 2.0) true))) +;;; ./general/gr_fft_vcc.h +(pass-if (true? (gr:fft-vcc 1 #f #(1.0 2.0) #t))) -;;; ./general/gr_fft_vcc_fftw.h FIXME: not found -;; (pass-if (true? (gr:fft-vcc-fftw 1 #(1.0 2.0) false))) - -;;; ./general/gr_fft_vfc.h FIXME: not found +;;; ./general/gr_fft_vfc.h ;; bool set_window(const std::vector &window); -;; (pass-if (true? (gr:fft_vfc #(1.0 2.0)))) +(pass-if (true? (gr:fft-vfc 4 #t #(1.0 2.0 3.0 4.0)))) +(pass-if-throw "confirm throw gr:fft-vfc" #t (true? (gr:fft-vfc 4 #f #(1.0 2.0 3.0 4.0)))) ;;; ./general/gr_fll_band_edge_cc.h (pass-if (true? (gr:fll-band-edge-cc 0 0 0 0 0))) @@ -182,19 +182,19 @@ ;;; ./general/gr_fmdet_cf.h (pass-if (true? (gr:fmdet-cf 0 0 0 0))) -;;; ./general/gr_framer_sink_1.h FIXME: not found -;; (pass-if (true? (gr:framer-sink-1))) +;;; ./general/gr_framer_sink_1.h +(pass-if (true? (gr:framer-sink-1 (gr:msg-queue)))) ;;; ./general/gr_frequency_modulator_fc.h (pass-if (true? (gr:frequency-modulator-fc 0))) -;;; ./general/gr_glfsr_source_b.h FIXME: not found -;; (pass-if (true? (gr: glfsr-source-b 0 true 0 0))) -;; (pass-if-throw "confirm throw" #t (true? (gr:glfsr_source_b 33 true 0 0))) +;;; ./general/gr_glfsr_source_b.h +(pass-if (true? (gr:glfsr-source-b 1 #t 0 1))) +(pass-if-throw "confirm throw" #t (true? (gr:glfsr_source_b 33 #t 0 0))) -;;; ./general/gr_glfsr_source_f.h FIXME: not found -;; (pass-if (true? (gr:glfsr-source-f 1 true 1 1))) -;; (pass-if-throw "confirm throw" #t (true? (gr:glfsr_source_f 33 true 0 0))) +;;; ./general/gr_glfsr_source_f.h +(pass-if (true? (gr:glfsr-source-f 1 #t 1 1))) +(pass-if-throw "confirm throw" #t (true? (gr:glfsr_source_f 33 #t 0 0))) ;;; ./general/gr_head.h (pass-if (true? (gr:head 1 1))) @@ -205,9 +205,6 @@ ;;; ./general/gr_interleaved_short_to_complex.h (pass-if (true? (gr:interleaved-short-to-complex))) -;;; ./general/gr_iqcomp_cc.h FIXME: not found -;; (pass-if (true? (gr:iqcomp-cc 1 1))) - ;;; ./general/gr_keep_one_in_n.h (pass-if (true? (gr:keep-one-in-n 1 1))) @@ -242,16 +239,10 @@ ;;; ./general/gr_null_source.h (pass-if (true? (gr:null-source 1))) -;;; ./general/gr_ofdm_bpsk_demapper.h FIXME: not found -;; (pass-if (true? (gr:ofdm-bpsk-demapper 1))) - ;;; ./general/gr_ofdm_cyclic_prefixer.h (pass-if (true? (gr:ofdm-cyclic-prefixer 1 1))) -;;; ./general/gr_ofdm_demapper_vcb.h FIXME: not found -;; (pass-if (true? (gr:ofdm-mapper-bcv 1 1))) - -;;; ./general/gr_ofdm_frame_acquisition.h FIXME: not found +;;; ./general/gr_ofdm_frame_acquisition.h FIXME: "No matching method for generic function `ofdm_frame_acquisition'" ;; gr_ofdm_frame_acquisition (unsigned int occupied_carriers, ;; unsigned int fft_length, ;; unsigned int cplen, @@ -259,17 +250,17 @@ ;; unsigned int max_fft_shift_len); ;; (pass-if (true? (gr:ofdm-frame-acquisition 0 0 0 #(1+3i 23+5i) 0))) -;;; ./general/gr_ofdm_frame_sink.h FIXME: not found +;;; ./general/gr_ofdm_frame_sink.h FIXME: "No matching method for generic function `ofdm_frame_sink'" ;; gr_ofdm_frame_sink(const std::vector &sym_position, ;; const std::vector &sym_value_out, ;; gr_msg_queue_sptr target_queue, unsigned int occupied_tones, ;; float phase_gain, float freq_gain); -;; (pass-if (true? (gr:ofdm-frame-sink #(1+3i 23+5i) #(1 2) 1 1 0.25 0))) +;;(pass-if (true? (gr:ofdm-frame-sink #(1+3i 23+5i) #(1 2) (gr:msg-queue) 1 0.25 0))) ;;; ./general/gr_ofdm_insert_preamble.h FIXME: Wrong type argument in position ~A: ;; gr_ofdm_insert_preamble(int fft_length, ;; const std::vector > &preamble); -;; (pass-if (true? (gr:ofdm-insert-preamble 1 #(#(1+3i 23+5i) #(1+3i 23+5i))))) +;;(pass-if (true? (gr:ofdm-insert-preamble 1 #(#(1+3i 23+5i))))) ;;; ./general/gr_ofdm_mapper_bcv.h FIXME: Wrong type argument in position ~A: ;; gr_ofdm_mapper_bcv (const std::vector &constellation, @@ -284,8 +275,8 @@ ;;; ./general/gr_pa_2x2_phase_combiner.h (pass-if (true? (gr:pa-2x2-phase-combiner))) -;;; ./general/gr_packet_sink.h FIXME: not found -;; (pass-if (true? (gr:packet-sink #(1 2) 1 -1))) +;;; ./general/gr_packet_sink.h +(pass-if (true? (gr:packet-sink #(1 2) (gr:msg-queue) -1))) ;;; ./general/gr_peak_detector2_fb.h (pass-if (true? (gr:peak-detector2-fb 0 0 0))) @@ -324,10 +315,10 @@ (pass-if (true? (gr:probe-signal-f))) ;;; ./general/gr_pwr_squelch_cc.h -;; (pass-if (true? (gr:pwr-squelch-cc 0 0 0 0))) FIXME: not found +(pass-if (true? (gr:pwr-squelch-cc 0 0 0 #f))) ;;; ./general/gr_pwr_squelch_ff.h -;; (pass-if (true? (gr:pwr-squelch-ff 0.0 0.0 0 false))) FIXME: not found +(pass-if (true? (gr:pwr-squelch-ff 0.0 0.0 0 #f))) ;;; ./general/gr_quadrature_demod_cf.h (pass-if (true? (gr:quadrature-demod-cf 0))) @@ -365,14 +356,14 @@ ;;; ./general/gr_skiphead.h (pass-if (true? (gr:skiphead 1 1))) -;;; ./general/gr_squash_ff.h FIXME: not found -;; (pass-if (true? (gr:squash_ff #(1.0 2.0) #(1.0 2.0)))) +;;; ./general/gr_squash_ff.h +(pass-if (true? (gr:squash-ff #(1.0 2.0 3.0 4.0 5.0) #(1.0 2.0 3.0 4.0 5.0)))) -;;; ./general/gr_squelch_base_cc.h -;; (pass-if (true? (gr:squelch-base-cc "foo" 0 false))) FIXME: not found +;;; ./general/gr_squelch_base_cc.h WONTFIX: not wrapped +;;; (pass-if (true? (gr:squelch-base-cc "foo" 0 #f))) -;;; ./general/gr_squelch_base_ff.h -;; (pass-if (true? (gr:squelch-base-ff "foo" 0 false))) FIXME: not found +;;; ./general/gr_squelch_base_ff.h WONTFIX: not wrapped +;; (pass-if (true? (gr:squelch-base-ff "foo" 0 #f))) ;;; ./general/gr_stream_mux.h (pass-if (true? (gr:stream-mux 1 #(1 2)))) @@ -413,8 +404,8 @@ ;;; ./general/gr_vector_to_streams.h (pass-if (true? (gr:vector-to-streams 1 1))) -;;; ./general/gr_wavelet_ff.h FIXME: not found -;; (pass-if (true? (gr:wavelet-ff 1024 20 true))) +;;; ./general/gr_wavelet_ff.h +(pass-if (true? (gr:wavelet-ff 1024 20 #t))) ;;; ./general/gr_wvps_ff.h (pass-if (true? (gr:wvps-ff 2))) diff --git a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.i b/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.i index 98d326b28..27eb70b95 100644 --- a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.i +++ b/gnuradio-core/src/lib/general/gr_clock_recovery_mm_cc.i @@ -22,9 +22,10 @@ GR_SWIG_BLOCK_MAGIC(gr,clock_recovery_mm_cc); -gr_clock_recovery_mm_cc_sptr gr_make_clock_recovery_mm_cc (float omega, float gain_omega, - float mu, float gain_mu, - float omega_relative_limit); +gr_clock_recovery_mm_cc_sptr +gr_make_clock_recovery_mm_cc (float omega, float gain_omega, + float mu, float gain_mu, + float omega_relative_limit) throw(std::exception); class gr_clock_recovery_mm_cc : public gr_sync_block { diff --git a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.i b/gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.i index 4f08aa760..1b2437000 100644 --- a/gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.i +++ b/gnuradio-core/src/lib/general/gr_clock_recovery_mm_ff.i @@ -22,9 +22,10 @@ GR_SWIG_BLOCK_MAGIC(gr,clock_recovery_mm_ff); -gr_clock_recovery_mm_ff_sptr gr_make_clock_recovery_mm_ff (float omega, float gain_omega, - float mu, float gain_mu, - float omega_relative_limit=0.001); +gr_clock_recovery_mm_ff_sptr +gr_make_clock_recovery_mm_ff (float omega, float gain_omega, + float mu, float gain_mu, + float omega_relative_limit=0.001) throw(std::exception); class gr_clock_recovery_mm_ff : public gr_sync_block { diff --git a/gnuradio-core/src/lib/general/gr_fft_vfc.i b/gnuradio-core/src/lib/general/gr_fft_vfc.i index f680c4022..149745b58 100644 --- a/gnuradio-core/src/lib/general/gr_fft_vfc.i +++ b/gnuradio-core/src/lib/general/gr_fft_vfc.i @@ -23,7 +23,8 @@ GR_SWIG_BLOCK_MAGIC(gr, fft_vfc) gr_fft_vfc_sptr -gr_make_fft_vfc (int fft_size, bool forward, const std::vector &window); +gr_make_fft_vfc (int fft_size, bool forward, const std::vector &window) +throw(std::exception); class gr_fft_vfc : public gr_sync_block { -- cgit From ababbe79dba97b1c88e5dec7eb28175c3574d015 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 14 Nov 2010 11:56:18 -0800 Subject: Update gr_nop, gr_null_sink and gr_null_source to modern coding conventions. --- gnuradio-core/src/lib/general/gr_nop.cc | 2 +- gnuradio-core/src/lib/general/gr_nop.h | 14 ++++++++------ gnuradio-core/src/lib/general/gr_nop.i | 11 ++++++----- gnuradio-core/src/lib/general/gr_null_sink.cc | 2 +- gnuradio-core/src/lib/general/gr_null_sink.h | 16 +++++++++------- gnuradio-core/src/lib/general/gr_null_sink.i | 11 ++++++----- gnuradio-core/src/lib/general/gr_null_source.cc | 2 +- gnuradio-core/src/lib/general/gr_null_source.h | 14 ++++++++------ gnuradio-core/src/lib/general/gr_null_source.i | 11 ++++++----- 9 files changed, 46 insertions(+), 37 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/general/gr_nop.cc b/gnuradio-core/src/lib/general/gr_nop.cc index e69c8b340..950ef878e 100644 --- a/gnuradio-core/src/lib/general/gr_nop.cc +++ b/gnuradio-core/src/lib/general/gr_nop.cc @@ -33,7 +33,7 @@ gr_nop::gr_nop (size_t sizeof_stream_item) { } -gr_block_sptr +gr_nop_sptr gr_make_nop (size_t sizeof_stream_item) { return gnuradio::get_initial_sptr (new gr_nop (sizeof_stream_item)); diff --git a/gnuradio-core/src/lib/general/gr_nop.h b/gnuradio-core/src/lib/general/gr_nop.h index 60b20c5ab..4f18c9183 100644 --- a/gnuradio-core/src/lib/general/gr_nop.h +++ b/gnuradio-core/src/lib/general/gr_nop.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -26,14 +26,19 @@ #include #include // size_t +class gr_nop; +typedef boost::shared_ptr gr_nop_sptr; + +gr_nop_sptr +gr_make_nop (size_t sizeof_stream_item); + /*! * \brief Does nothing. Used for testing only. * \ingroup misc_blk */ class gr_nop : public gr_block { - friend gr_block_sptr gr_make_nop (size_t sizeof_stream_item); - + friend gr_nop_sptr gr_make_nop (size_t sizeof_stream_item); gr_nop (size_t sizeof_stream_item); public: @@ -43,7 +48,4 @@ class gr_nop : public gr_block gr_vector_void_star &output_items); }; -gr_block_sptr -gr_make_nop (size_t sizeof_stream_item); - #endif /* INCLUDED_GR_NOP_H */ diff --git a/gnuradio-core/src/lib/general/gr_nop.i b/gnuradio-core/src/lib/general/gr_nop.i index 8220e5c6c..85354d421 100644 --- a/gnuradio-core/src/lib/general/gr_nop.i +++ b/gnuradio-core/src/lib/general/gr_nop.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -20,11 +20,12 @@ * Boston, MA 02110-1301, USA. */ -%ignore gr_nop; +GR_SWIG_BLOCK_MAGIC(gr,nop) + +gr_nop_sptr gr_make_nop (size_t sizeof_stream_item); + class gr_nop : public gr_block { - friend gr_block_sptr gr_make_nop (size_t sizeof_stream_item); +private: gr_nop (size_t sizeof_stream_item); }; -%rename(nop) gr_make_nop; -gr_block_sptr gr_make_nop (size_t sizeof_stream_item); diff --git a/gnuradio-core/src/lib/general/gr_null_sink.cc b/gnuradio-core/src/lib/general/gr_null_sink.cc index 0b7f2d9e8..67ef57a46 100644 --- a/gnuradio-core/src/lib/general/gr_null_sink.cc +++ b/gnuradio-core/src/lib/general/gr_null_sink.cc @@ -34,7 +34,7 @@ gr_null_sink::gr_null_sink (size_t sizeof_stream_item) { } -gr_block_sptr +gr_null_sink_sptr gr_make_null_sink (size_t sizeof_stream_item) { return gnuradio::get_initial_sptr (new gr_null_sink (sizeof_stream_item)); diff --git a/gnuradio-core/src/lib/general/gr_null_sink.h b/gnuradio-core/src/lib/general/gr_null_sink.h index 66df5d138..6d00382a5 100644 --- a/gnuradio-core/src/lib/general/gr_null_sink.h +++ b/gnuradio-core/src/lib/general/gr_null_sink.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -26,15 +26,20 @@ #include #include // size_t +class gr_null_sink; +typedef boost::shared_ptr gr_null_sink_sptr; + +gr_null_sink_sptr +gr_make_null_sink (size_t sizeof_stream_item); + + /*! * \brief Bit bucket * \ingroup sink_blk */ - class gr_null_sink : public gr_sync_block { - friend gr_block_sptr gr_make_null_sink (size_t sizeof_stream_item); - + friend gr_null_sink_sptr gr_make_null_sink (size_t sizeof_stream_item); gr_null_sink (size_t sizeof_stream_item); public: @@ -45,7 +50,4 @@ class gr_null_sink : public gr_sync_block }; -gr_block_sptr -gr_make_null_sink (size_t sizeof_stream_item); - #endif /* INCLUDED_GR_NULL_SINK_H */ diff --git a/gnuradio-core/src/lib/general/gr_null_sink.i b/gnuradio-core/src/lib/general/gr_null_sink.i index fc4bcffda..e739ce118 100644 --- a/gnuradio-core/src/lib/general/gr_null_sink.i +++ b/gnuradio-core/src/lib/general/gr_null_sink.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -20,11 +20,12 @@ * Boston, MA 02110-1301, USA. */ -%ignore gr_null_sink; +GR_SWIG_BLOCK_MAGIC(gr,null_sink) + +gr_null_sink_sptr gr_make_null_sink (size_t sizeof_stream_item); + class gr_null_sink : public gr_sync_block { - friend gr_block_sptr gr_make_null_sink (size_t sizeof_stream_item); +private: gr_null_sink (size_t sizeof_stream_item); }; -%rename(null_sink) gr_make_null_sink; -gr_block_sptr gr_make_null_sink (size_t sizeof_stream_item); diff --git a/gnuradio-core/src/lib/general/gr_null_source.cc b/gnuradio-core/src/lib/general/gr_null_source.cc index b65c39035..85fd2db4b 100644 --- a/gnuradio-core/src/lib/general/gr_null_source.cc +++ b/gnuradio-core/src/lib/general/gr_null_source.cc @@ -35,7 +35,7 @@ gr_null_source::gr_null_source (size_t sizeof_stream_item) { } -gr_block_sptr +gr_null_source_sptr gr_make_null_source (size_t sizeof_stream_item) { return gnuradio::get_initial_sptr (new gr_null_source (sizeof_stream_item)); diff --git a/gnuradio-core/src/lib/general/gr_null_source.h b/gnuradio-core/src/lib/general/gr_null_source.h index 63b1939bf..b1a46a195 100644 --- a/gnuradio-core/src/lib/general/gr_null_source.h +++ b/gnuradio-core/src/lib/general/gr_null_source.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -25,14 +25,19 @@ #include +class gr_null_source; +typedef boost::shared_ptr gr_null_source_sptr; + +gr_null_source_sptr +gr_make_null_source (size_t sizeof_stream_item); + /*! * \brief A source of zeros. * \ingroup source_blk */ - class gr_null_source : public gr_sync_block { - friend gr_block_sptr gr_make_null_source (size_t sizeof_stream_item); + friend gr_null_source_sptr gr_make_null_source (size_t sizeof_stream_item); gr_null_source (size_t sizeof_stream_item); @@ -43,7 +48,4 @@ class gr_null_source : public gr_sync_block }; -gr_block_sptr -gr_make_null_source (size_t sizeof_stream_item); - #endif /* INCLUDED_GR_NULL_SOURCE_H */ diff --git a/gnuradio-core/src/lib/general/gr_null_source.i b/gnuradio-core/src/lib/general/gr_null_source.i index f9ddef86f..133161d0a 100644 --- a/gnuradio-core/src/lib/general/gr_null_source.i +++ b/gnuradio-core/src/lib/general/gr_null_source.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -20,11 +20,12 @@ * Boston, MA 02110-1301, USA. */ -%ignore gr_null_source; +GR_SWIG_BLOCK_MAGIC(gr,null_source) + +gr_null_source_sptr gr_make_null_source (size_t sizeof_stream_item); + class gr_null_source : public gr_sync_block { - friend gr_block_sptr gr_make_null_source (size_t sizeof_stream_item); +private: gr_null_source (size_t sizeof_stream_item); }; -%rename(null_source) gr_make_null_source; -gr_block_sptr gr_make_null_source (size_t sizeof_stream_item); -- cgit From e8d0dbbdfce26f6963dfe0a727faf9c9cc5baf75 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 14 Nov 2010 11:57:19 -0800 Subject: Remove code that's no longer needed. --- gnuradio-core/src/lib/runtime/gr_basic_block.i | 7 +------ gnuradio-core/src/lib/runtime/gr_block.i | 13 +------------ 2 files changed, 2 insertions(+), 18 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_basic_block.i b/gnuradio-core/src/lib/runtime/gr_basic_block.i index 9b360e5ab..03d4725d5 100644 --- a/gnuradio-core/src/lib/runtime/gr_basic_block.i +++ b/gnuradio-core/src/lib/runtime/gr_basic_block.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -52,8 +52,3 @@ long gr_basic_block_ncurrently_allocated(); gr_basic_block_sptr.__repr__ = lambda self: "" % (self.name(), self.unique_id ()) %} #endif - -#ifdef SWIGGUILE -#warning "gr_basic_block.i: gr_block_sptr needs to be implemented!" -#endif - diff --git a/gnuradio-core/src/lib/runtime/gr_block.i b/gnuradio-core/src/lib/runtime/gr_block.i index d13c268ca..f4ee43477 100644 --- a/gnuradio-core/src/lib/runtime/gr_block.i +++ b/gnuradio-core/src/lib/runtime/gr_block.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -53,14 +53,3 @@ class gr_block : public gr_basic_block { gr_block_detail_sptr detail () const { return d_detail; } void set_detail (gr_block_detail_sptr detail) { d_detail = detail; } }; - -#ifdef SWIGPYTHON -%pythoncode %{ -gr_block_sptr.__repr__ = lambda self: "" % (self.name(), self.unique_id ()) -gr_block_sptr.block = lambda self: self -%} -#endif - -#ifdef SWIGGUILE -#warning "gr_block.i: gr_block_sptr needs to be implemented!" -#endif -- cgit From 48f6c8b4c398b7ee18ee4292ae20d4f4c1dd3087 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 14 Nov 2010 12:25:23 -0800 Subject: Move true? from general_ctors.test to core.scm --- gnuradio-core/src/guile/gnuradio/core.scm | 4 ++++ gnuradio-core/src/guile/tests/general_ctors.test | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/gnuradio/core.scm b/gnuradio-core/src/guile/gnuradio/core.scm index f13a8fb60..b24d5afa9 100644 --- a/gnuradio-core/src/guile/gnuradio/core.scm +++ b/gnuradio-core/src/guile/gnuradio/core.scm @@ -17,3 +17,7 @@ (re-export-all '(gnuradio gnuradio_core_general)) (re-export-all '(gnuradio gnuradio_core_gengen)) (re-export-all '(gnuradio gnuradio_core_hier)) + +;;; Return #t if x is not #f +(define-public (true? x) + (and x #t)) diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index 5cdff5c3f..75c0f0bd4 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -29,10 +29,6 @@ (use-modules (gnuradio core)) (use-modules (oop goops)) -;;; Return #t if x is not #f -(define (true? x) - (and x #t)) - ;;; Add test code for all constructors in these files ;;; ./general/gr_additive_scrambler_bb.h -- cgit From eedcd7145c20403dcd0dcc44d15efb5d82beb7ec Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 14 Nov 2010 13:15:26 -0800 Subject: Make cma-equalizer-cc test work --- gnuradio-core/src/guile/tests/filter_ctors.test | 6 +++--- gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.cc | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/filter_ctors.test b/gnuradio-core/src/guile/tests/filter_ctors.test index 8618890fa..6a35bd296 100644 --- a/gnuradio-core/src/guile/tests/filter_ctors.test +++ b/gnuradio-core/src/guile/tests/filter_ctors.test @@ -32,12 +32,12 @@ ;;; Add test code for all constructors in these files ;;; -;;; ./filter/gr_adaptive_fir_ccf.h FIXME: not found +;;; ./filter/gr_adaptive_fir_ccf.h WONTFIX: not wrapped ;; gr_adaptive_fir_ccf(char *name, int decimation, const std::vector &taps); ;; (pass-if (true? (gr:adaptive-fir-ccf "foo" 0 #(1.0 2.0 3.0 4.0)))) -;;; ./filter/gr_cma_equalizer_cc.h FIXME: not found -;; (pass-if (true? (gr:cma-equalizer-cc 0 0 0))) +;;; ./filter/gr_cma_equalizer_cc.h +(pass-if (true? (gr:cma-equalizer-cc 0 0 0))) ;;; ./filter/gr_fft_filter_ccc.h FIXME: not found ;; (pass-if (true? (gr:fft-filter-ccc 0 #(1+3i 23+5i)))) diff --git a/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.cc b/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.cc index 8252509bb..f80bfd518 100644 --- a/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.cc +++ b/gnuradio-core/src/lib/filter/gr_cma_equalizer_cc.cc @@ -36,6 +36,7 @@ gr_cma_equalizer_cc::gr_cma_equalizer_cc(int num_taps, float modulus, float mu) : gr_adaptive_fir_ccf("cma_equalizer_cc", 1, std::vector(num_taps)), d_modulus(modulus), d_mu(mu) { - d_taps[0] = 1.0; + if (num_taps > 0) + d_taps[0] = 1.0; } -- cgit From f2d5299a3f7dd5baa795a27c2864b2cfe67edb37 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 14 Nov 2010 13:26:59 -0800 Subject: Add tests that show that vector> is not working... --- gnuradio-core/src/guile/tests/general_ctors.test | 22 ++++++++++++++ gnuradio-core/src/lib/general/Makefile.am | 3 ++ gnuradio-core/src/lib/general/complex_vec_test.cc | 37 +++++++++++++++++++++++ gnuradio-core/src/lib/general/complex_vec_test.h | 15 +++++++++ gnuradio-core/src/lib/general/complex_vec_test.i | 12 ++++++++ gnuradio-core/src/lib/general/general.i | 2 ++ 6 files changed, 91 insertions(+) create mode 100644 gnuradio-core/src/lib/general/complex_vec_test.cc create mode 100644 gnuradio-core/src/lib/general/complex_vec_test.h create mode 100644 gnuradio-core/src/lib/general/complex_vec_test.i (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index 75c0f0bd4..a18766400 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -28,6 +28,28 @@ (use-modules (gnuradio test-suite lib)) (use-modules (gnuradio core)) (use-modules (oop goops)) +(use-modules (ice-9 format)) + + +(define (verbose-equal? expected actual) + (cond ((equal? expected actual) #t) + (else + (format #t "Expected:\n~y\n" expected) + (format #t "Actual:\n~y\n" actual) + #f))) + + +;;; Test complex scalars +(pass-if (equal? 5.0+5.0i (gr:complex-scalar-test0))) +(pass-if (equal? 1.5+0.5i (gr:complex-scalar-test1 1+1i))) + +;;; Test complex vectors +(pass-if (verbose-equal? #(0+0i 1+1i 2+2i 3+3i 4+4i) + (gr:complex-vec-test0))) + +(pass-if (verbose-equal? #(1.5+0.5i 2.5+1.5i 3.5+2.5i) + (gr:complex-vec-test1 #(1+1i 2+2i 3+3i)))) + ;;; Add test code for all constructors in these files diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am index 3d8a42805..735795789 100644 --- a/gnuradio-core/src/lib/general/Makefile.am +++ b/gnuradio-core/src/lib/general/Makefile.am @@ -34,6 +34,7 @@ EXTRA_DIST = \ gr_constants.cc.in libgeneral_la_SOURCES = \ + complex_vec_test.cc \ gr_additive_scrambler_bb.cc \ gr_agc_cc.cc \ gr_agc_ff.cc \ @@ -188,6 +189,7 @@ libgeneral_qa_la_SOURCES = \ qa_gri_lfsr.cc grinclude_HEADERS = \ + complex_vec_test.h \ gr_additive_scrambler_bb.h \ gr_agc_cc.h \ gr_agc_ff.h \ @@ -359,6 +361,7 @@ noinst_HEADERS = \ if PYTHON swiginclude_HEADERS = \ + complex_vec_test.i \ general.i \ gr_additive_scrambler_bb.i \ gr_agc_cc.i \ diff --git a/gnuradio-core/src/lib/general/complex_vec_test.cc b/gnuradio-core/src/lib/general/complex_vec_test.cc new file mode 100644 index 000000000..21bca1765 --- /dev/null +++ b/gnuradio-core/src/lib/general/complex_vec_test.cc @@ -0,0 +1,37 @@ +#include +#include + +std::vector > +complex_vec_test0() +{ + std::vector > r(5); + + for (size_t i = 0; i < r.size(); i++) + r[i] = std::complex(i, i); + + return r; +} + +std::vector > +complex_vec_test1(const std::vector > &input) +{ + std::vector > r(input.size()); + + for (size_t i = 0; i < input.size(); i++) + r[i] = std::complex(input[i].real()+0.5, input[i].imag()-0.5); + + return r; +} + +std::complex +complex_scalar_test0() +{ + return std::complex(5, 5); +} + +std::complex +complex_scalar_test1(std::complex input) +{ + return std::complex(input.real()+0.5, input.imag()-0.5); +} + diff --git a/gnuradio-core/src/lib/general/complex_vec_test.h b/gnuradio-core/src/lib/general/complex_vec_test.h new file mode 100644 index 000000000..f1a8a14e2 --- /dev/null +++ b/gnuradio-core/src/lib/general/complex_vec_test.h @@ -0,0 +1,15 @@ +#include +#include + +std::vector > +complex_vec_test0(); + +std::vector > +complex_vec_test1(const std::vector > &input); + +std::complex +complex_scalar_test0(); + +std::complex +complex_scalar_test1(std::complex input); + diff --git a/gnuradio-core/src/lib/general/complex_vec_test.i b/gnuradio-core/src/lib/general/complex_vec_test.i new file mode 100644 index 000000000..1c62cfda2 --- /dev/null +++ b/gnuradio-core/src/lib/general/complex_vec_test.i @@ -0,0 +1,12 @@ +std::vector > +complex_vec_test0(); + +std::vector > +complex_vec_test1(const std::vector > &input); + +std::complex +complex_scalar_test0(); + +std::complex +complex_scalar_test1(std::complex input); + diff --git a/gnuradio-core/src/lib/general/general.i b/gnuradio-core/src/lib/general/general.i index 3ad40b218..2c86a6240 100644 --- a/gnuradio-core/src/lib/general/general.i +++ b/gnuradio-core/src/lib/general/general.i @@ -141,6 +141,7 @@ #include #include #include +#include %} %include "gr_nop.i" @@ -262,3 +263,4 @@ %include "gr_copy.i" %include "gr_fll_band_edge_cc.i" %include "gr_additive_scrambler_bb.i" +%include "complex_vec_test.i" -- cgit From c80fdf2897624d10123a35b1a19d150f3a5645c8 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Mon, 15 Nov 2010 23:49:35 -0800 Subject: Modify GR_SWIG_BLOCK_MAGIC to not strip package prefix when using GUILE outside of gnuradio-core. This avoids the problem with the guile bindings where multiple blocks end up with the name gr:sink (e.g., audio_alsa_sink). With this change, it ends us as gr:audio-alsa-sink. Blocks in gnuradio-core continue to have the leading gr_ removed from their class names. --- gnuradio-core/src/lib/swig/Makefile.am | 1 + gnuradio-core/src/lib/swig/gr_swig_block_magic.i | 35 ++++++++++++++++-------- 2 files changed, 24 insertions(+), 12 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 5e003bdf2..8e356bea8 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -104,6 +104,7 @@ swig_built_sources += $(PYTHON_GEN) endif # end of if python if GUILE +SWIG_GUILE_FLAGS += -DIN_GNURADIO_CORE #GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(patsubst %.i,%.scm,$(HFILE))) GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(patsubst %.i,gnuradio/%.scm,$(HFILE))) # GUILE_GEN_STAMPS = $(filter %.scm,$(TOP_SWIG_IFILES)) diff --git a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i index ea6368fd4..a080c2b27 100644 --- a/gnuradio-core/src/lib/swig/gr_swig_block_magic.i +++ b/gnuradio-core/src/lib/swig/gr_swig_block_magic.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2004 Free Software Foundation, Inc. + * Copyright 2004,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -21,29 +21,40 @@ */ %define GR_SWIG_BLOCK_MAGIC(PKG, BASE_NAME) -_GR_SWIG_BLOCK_MAGIC_HELPER(PKG, PKG ## _ ## BASE_NAME, BASE_NAME) +_GR_SWIG_BLOCK_MAGIC_HELPER(PKG, BASE_NAME, PKG ## _ ## BASE_NAME) %enddef -%define _GR_SWIG_BLOCK_MAGIC_HELPER_COMMON(PKG, NAME, BASE_NAME) -class NAME; -typedef boost::shared_ptr NAME ## _sptr; -%template(NAME ## _sptr) boost::shared_ptr; +%define _GR_SWIG_BLOCK_MAGIC_HELPER_COMMON(PKG, BASE_NAME, FULL_NAME) +class FULL_NAME; +typedef boost::shared_ptr FULL_NAME ## _sptr; +%template(FULL_NAME ## _sptr) boost::shared_ptr; %rename(BASE_NAME) PKG ## _make_ ## BASE_NAME; -%ignore NAME; +%ignore FULL_NAME; %enddef #ifdef SWIGPYTHON -%define _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, NAME, BASE_NAME) -_GR_SWIG_BLOCK_MAGIC_HELPER_COMMON(PKG, NAME, BASE_NAME) +%define _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, BASE_NAME, FULL_NAME) +_GR_SWIG_BLOCK_MAGIC_HELPER_COMMON(PKG, BASE_NAME, FULL_NAME) %pythoncode %{ -NAME ## _sptr.__repr__ = lambda self: "" % (self.name(), self.unique_id ()) +FULL_NAME ## _sptr.__repr__ = lambda self: "" % (self.name(), self.unique_id ()) %} %enddef #endif #ifdef SWIGGUILE -%define _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, NAME, BASE_NAME) -_GR_SWIG_BLOCK_MAGIC_HELPER_COMMON(PKG, NAME, BASE_NAME) +#ifdef IN_GNURADIO_CORE // normal behavior +%define _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, BASE_NAME, FULL_NAME) +_GR_SWIG_BLOCK_MAGIC_HELPER_COMMON(PKG, BASE_NAME, FULL_NAME) /* FIXME May want to add something here to get a friendlier printed representation */ %enddef +#else // Don't strip PKG from name +%define _GR_SWIG_BLOCK_MAGIC_HELPER(PKG, BASE_NAME, FULL_NAME) +class FULL_NAME; +typedef boost::shared_ptr FULL_NAME ## _sptr; +%template(FULL_NAME ## _sptr) boost::shared_ptr; +%ignore FULL_NAME; +%rename(FULL_NAME) PKG ## _make_ ## BASE_NAME; +/* FIXME May want to add something here to get a friendlier printed representation */ +%enddef +#endif #endif -- cgit From 8180bb1d7020e07c9b0a217820c68d07f0d98a74 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Tue, 16 Nov 2010 21:33:50 -0800 Subject: regenerated --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index 7da681a26..dc7a7b3bb 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -101,7 +101,7 @@ _gnuradio_core_runtime_la_CXXFLAGS = \ gnuradio_core_runtime_python_PYTHON = \ gnuradio_core_runtime.py \ - $(gnuradio_core_runtime) + $(gnuradio_core_runtime_python) python/gnuradio_core_runtime.cc: gnuradio_core_runtime.py gnuradio_core_runtime.py: gnuradio_core_runtime.i @@ -234,7 +234,7 @@ _gnuradio_core_general_la_CXXFLAGS = \ gnuradio_core_general_python_PYTHON = \ gnuradio_core_general.py \ - $(gnuradio_core_general) + $(gnuradio_core_general_python) python/gnuradio_core_general.cc: gnuradio_core_general.py gnuradio_core_general.py: gnuradio_core_general.i @@ -367,7 +367,7 @@ _gnuradio_core_gengen_la_CXXFLAGS = \ gnuradio_core_gengen_python_PYTHON = \ gnuradio_core_gengen.py \ - $(gnuradio_core_gengen) + $(gnuradio_core_gengen_python) python/gnuradio_core_gengen.cc: gnuradio_core_gengen.py gnuradio_core_gengen.py: gnuradio_core_gengen.i @@ -500,7 +500,7 @@ _gnuradio_core_filter_la_CXXFLAGS = \ gnuradio_core_filter_python_PYTHON = \ gnuradio_core_filter.py \ - $(gnuradio_core_filter) + $(gnuradio_core_filter_python) python/gnuradio_core_filter.cc: gnuradio_core_filter.py gnuradio_core_filter.py: gnuradio_core_filter.i @@ -633,7 +633,7 @@ _gnuradio_core_io_la_CXXFLAGS = \ gnuradio_core_io_python_PYTHON = \ gnuradio_core_io.py \ - $(gnuradio_core_io) + $(gnuradio_core_io_python) python/gnuradio_core_io.cc: gnuradio_core_io.py gnuradio_core_io.py: gnuradio_core_io.i @@ -766,7 +766,7 @@ _gnuradio_core_hier_la_CXXFLAGS = \ gnuradio_core_hier_python_PYTHON = \ gnuradio_core_hier.py \ - $(gnuradio_core_hier) + $(gnuradio_core_hier_python) python/gnuradio_core_hier.cc: gnuradio_core_hier.py gnuradio_core_hier.py: gnuradio_core_hier.i -- cgit From 4eadee57c588940347027c7e7f99ac7e993874fd Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 17 Nov 2010 13:54:04 -0800 Subject: Add support for guile std::vector< std::complex >. --- gnuradio-core/src/lib/swig/Makefile.am | 3 +- gnuradio-core/src/lib/swig/gnuradio.i | 15 +- gnuradio-core/src/lib/swig/guile/std_vector.i | 437 ++++++++++++++++++++++++++ 3 files changed, 451 insertions(+), 4 deletions(-) create mode 100644 gnuradio-core/src/lib/swig/guile/std_vector.i (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 8e356bea8..16b5d677e 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -53,7 +53,8 @@ swiginclude_HEADERS = \ # SWIG headers that get installed in ${prefix}/include/gnuradio/swig/... nobase_swiginclude_HEADERS = \ - guile/std_complex.i + guile/std_complex.i \ + guile/std_vector.i if PYTHON diff --git a/gnuradio-core/src/lib/swig/gnuradio.i b/gnuradio-core/src/lib/swig/gnuradio.i index 6eb44cbe9..47fd4e330 100644 --- a/gnuradio-core/src/lib/swig/gnuradio.i +++ b/gnuradio-core/src/lib/swig/gnuradio.i @@ -41,13 +41,22 @@ %include // non-local SWIG files -%include -%include -#ifdef SWIGGUILE +#ifdef SWIGGUILE // Local overrides to support complex +// It's kind of screwy, but the target language subdir isn't +// searched automatically except for under ./swig_lib which +// doesn't really help us since we run swig in many directories %include +%include +%include +%include +%include +%include #else %include +%include +%include #endif +%include typedef std::complex gr_complex; typedef std::complex gr_complexd; diff --git a/gnuradio-core/src/lib/swig/guile/std_vector.i b/gnuradio-core/src/lib/swig/guile/std_vector.i new file mode 100644 index 000000000..ef1f20667 --- /dev/null +++ b/gnuradio-core/src/lib/swig/guile/std_vector.i @@ -0,0 +1,437 @@ +/* ----------------------------------------------------------------------------- + * See the LICENSE file for information on copyright, usage and redistribution + * of SWIG, and the README file for authors - http://www.swig.org/release.html. + * + * std_vector.i + * + * SWIG typemaps for std::vector + * ----------------------------------------------------------------------------- */ + +%include + +// ------------------------------------------------------------------------ +// std::vector +// +// The aim of all that follows would be to integrate std::vector with +// Guile as much as possible, namely, to allow the user to pass and +// be returned Guile vectors or lists. +// const declarations are used to guess the intent of the function being +// exported; therefore, the following rationale is applied: +// +// -- f(std::vector), f(const std::vector&), f(const std::vector*): +// the parameter being read-only, either a Guile sequence or a +// previously wrapped std::vector can be passed. +// -- f(std::vector&), f(std::vector*): +// the parameter must be modified; therefore, only a wrapped std::vector +// can be passed. +// -- std::vector f(): +// the vector is returned by copy; therefore, a Guile vector of T:s +// is returned which is most easily used in other Guile functions +// -- std::vector& f(), std::vector* f(), const std::vector& f(), +// const std::vector* f(): +// the vector is returned by reference; therefore, a wrapped std::vector +// is returned +// ------------------------------------------------------------------------ + +%{ +#include +#include +#include +#include +%} + +%{ + inline std::complex SWIG_scm2cmplxfloat(SCM x){ + return std::complex(scm_c_real_part(x), scm_c_imag_part(x)); + } + + inline std::complex SWIG_scm2cmplxdouble(SCM x){ + return std::complex(scm_c_real_part(x), scm_c_imag_part(x)); + } + + inline SCM SWIG_cmplxfloat2scm(std::complex x){ + return scm_c_make_rectangular(x.real(), x.imag()); + } + + inline SCM SWIG_cmplxdouble2scm(std::complex x){ + return scm_c_make_rectangular(x.real(), x.imag()); + } +%} + +// exported class + +namespace std { + + template class vector { + %typemap(in) vector { + if (gh_vector_p($input)) { + unsigned long size = gh_vector_length($input); + $1 = std::vector(size); + for (unsigned long i=0; i(); + } else if (gh_pair_p($input)) { + SCM head, tail; + $1 = std::vector(); + tail = $input; + while (!gh_null_p(tail)) { + head = gh_car(tail); + tail = gh_cdr(tail); + $1.push_back(*((T*)SWIG_MustGetPtr(head, + $descriptor(T *), + $argnum, 0))); + } + } else { + $1 = *(($&1_type) + SWIG_MustGetPtr($input,$&1_descriptor,$argnum, 0)); + } + } + %typemap(in) const vector& (std::vector temp), + const vector* (std::vector temp) { + if (gh_vector_p($input)) { + unsigned long size = gh_vector_length($input); + temp = std::vector(size); + $1 = &temp; + for (unsigned long i=0; i(); + $1 = &temp; + } else if (gh_pair_p($input)) { + temp = std::vector(); + $1 = &temp; + SCM head, tail; + tail = $input; + while (!gh_null_p(tail)) { + head = gh_car(tail); + tail = gh_cdr(tail); + temp.push_back(*((T*) SWIG_MustGetPtr(head, + $descriptor(T *), + $argnum, 0))); + } + } else { + $1 = ($1_ltype) SWIG_MustGetPtr($input,$1_descriptor,$argnum, 0); + } + } + %typemap(out) vector { + $result = gh_make_vector(gh_long2scm($1.size()),SCM_UNSPECIFIED); + for (unsigned int i=0; i<$1.size(); i++) { + T* x = new T((($1_type &)$1)[i]); + gh_vector_set_x($result,gh_long2scm(i), + SWIG_NewPointerObj(x, $descriptor(T *), 1)); + } + } + %typecheck(SWIG_TYPECHECK_VECTOR) vector { + /* native sequence? */ + if (gh_vector_p($input)) { + unsigned int size = gh_vector_length($input); + if (size == 0) { + /* an empty sequence can be of any type */ + $1 = 1; + } else { + /* check the first element only */ + SCM o = gh_vector_ref($input,gh_ulong2scm(0)); + T* x; + if (SWIG_ConvertPtr(o,(void**) &x, + $descriptor(T *), 0) != -1) + $1 = 1; + else + $1 = 0; + } + } else if (gh_null_p($input)) { + /* again, an empty sequence can be of any type */ + $1 = 1; + } else if (gh_pair_p($input)) { + /* check the first element only */ + T* x; + SCM head = gh_car($input); + if (SWIG_ConvertPtr(head,(void**) &x, + $descriptor(T *), 0) != -1) + $1 = 1; + else + $1 = 0; + } else { + /* wrapped vector? */ + std::vector* v; + if (SWIG_ConvertPtr($input,(void **) &v, + $&1_descriptor, 0) != -1) + $1 = 1; + else + $1 = 0; + } + } + %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, + const vector* { + /* native sequence? */ + if (gh_vector_p($input)) { + unsigned int size = gh_vector_length($input); + if (size == 0) { + /* an empty sequence can be of any type */ + $1 = 1; + } else { + /* check the first element only */ + T* x; + SCM o = gh_vector_ref($input,gh_ulong2scm(0)); + if (SWIG_ConvertPtr(o,(void**) &x, + $descriptor(T *), 0) != -1) + $1 = 1; + else + $1 = 0; + } + } else if (gh_null_p($input)) { + /* again, an empty sequence can be of any type */ + $1 = 1; + } else if (gh_pair_p($input)) { + /* check the first element only */ + T* x; + SCM head = gh_car($input); + if (SWIG_ConvertPtr(head,(void**) &x, + $descriptor(T *), 0) != -1) + $1 = 1; + else + $1 = 0; + } else { + /* wrapped vector? */ + std::vector* v; + if (SWIG_ConvertPtr($input,(void **) &v, + $1_descriptor, 0) != -1) + $1 = 1; + else + $1 = 0; + } + } + public: + vector(unsigned int size = 0); + vector(unsigned int size, const T& value); + vector(const vector&); + %rename(length) size; + unsigned int size() const; + %rename("empty?") empty; + bool empty() const; + %rename("clear!") clear; + void clear(); + %rename("set!") set; + %rename("pop!") pop; + %rename("push!") push_back; + void push_back(const T& x); + %extend { + T pop() throw (std::out_of_range) { + if (self->size() == 0) + throw std::out_of_range("pop from empty vector"); + T x = self->back(); + self->pop_back(); + return x; + } + T& ref(int i) throw (std::out_of_range) { + int size = int(self->size()); + if (i>=0 && isize()); + if (i>=0 && i class vector { + %typemap(in) vector { + if (gh_vector_p($input)) { + unsigned long size = gh_vector_length($input); + $1 = std::vector(size); + for (unsigned long i=0; i(); + } else if (gh_pair_p($input)) { + SCM v = gh_list_to_vector($input); + unsigned long size = gh_vector_length(v); + $1 = std::vector(size); + for (unsigned long i=0; i& (std::vector temp), + const vector* (std::vector temp) { + if (gh_vector_p($input)) { + unsigned long size = gh_vector_length($input); + temp = std::vector(size); + $1 = &temp; + for (unsigned long i=0; i(); + $1 = &temp; + } else if (gh_pair_p($input)) { + SCM v = gh_list_to_vector($input); + unsigned long size = gh_vector_length(v); + temp = std::vector(size); + $1 = &temp; + for (unsigned long i=0; i { + $result = gh_make_vector(gh_long2scm($1.size()),SCM_UNSPECIFIED); + for (unsigned int i=0; i<$1.size(); i++) { + SCM x = CONVERT_TO((($1_type &)$1)[i]); + gh_vector_set_x($result,gh_long2scm(i),x); + } + } + %typecheck(SWIG_TYPECHECK_VECTOR) vector { + /* native sequence? */ + if (gh_vector_p($input)) { + unsigned int size = gh_vector_length($input); + if (size == 0) { + /* an empty sequence can be of any type */ + $1 = 1; + } else { + /* check the first element only */ + T* x; + SCM o = gh_vector_ref($input,gh_ulong2scm(0)); + $1 = CHECK(o) ? 1 : 0; + } + } else if (gh_null_p($input)) { + /* again, an empty sequence can be of any type */ + $1 = 1; + } else if (gh_pair_p($input)) { + /* check the first element only */ + T* x; + SCM head = gh_car($input); + $1 = CHECK(head) ? 1 : 0; + } else { + /* wrapped vector? */ + std::vector* v; + $1 = (SWIG_ConvertPtr($input,(void **) &v, + $&1_descriptor, 0) != -1) ? 1 : 0; + } + } + %typecheck(SWIG_TYPECHECK_VECTOR) const vector&, + const vector* { + /* native sequence? */ + if (gh_vector_p($input)) { + unsigned int size = gh_vector_length($input); + if (size == 0) { + /* an empty sequence can be of any type */ + $1 = 1; + } else { + /* check the first element only */ + T* x; + SCM o = gh_vector_ref($input,gh_ulong2scm(0)); + $1 = CHECK(o) ? 1 : 0; + } + } else if (gh_null_p($input)) { + /* again, an empty sequence can be of any type */ + $1 = 1; + } else if (gh_pair_p($input)) { + /* check the first element only */ + T* x; + SCM head = gh_car($input); + $1 = CHECK(head) ? 1 : 0; + } else { + /* wrapped vector? */ + std::vector* v; + $1 = (SWIG_ConvertPtr($input,(void **) &v, + $1_descriptor, 0) != -1) ? 1 : 0; + } + } + public: + vector(unsigned int size = 0); + vector(unsigned int size, const T& value); + vector(const vector&); + %rename(length) size; + unsigned int size() const; + %rename("empty?") empty; + bool empty() const; + %rename("clear!") clear; + void clear(); + %rename("set!") set; + %rename("pop!") pop; + %rename("push!") push_back; + void push_back(T x); + %extend { + T pop() throw (std::out_of_range) { + if (self->size() == 0) + throw std::out_of_range("pop from empty vector"); + T x = self->back(); + self->pop_back(); + return x; + } + T ref(int i) throw (std::out_of_range) { + int size = int(self->size()); + if (i>=0 && isize()); + if (i>=0 && i, scm_is_complex, + SWIG_scm2cmplxfloat, SWIG_cmplxfloat2scm); + specialize_stl_vector(std::complex, scm_is_complex, + SWIG_scm2cmplxdouble,SWIG_cmplxdouble2scm); + +} + -- cgit From 18da1655fe25b7517577a9417c2304edbc3afdca Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Wed, 17 Nov 2010 20:41:49 -0700 Subject: enable more tests --- gnuradio-core/src/guile/tests/filter_ctors.test | 116 +++++++++++------------ gnuradio-core/src/guile/tests/general_ctors.test | 33 ++----- gnuradio-core/src/guile/tests/gengen_ctors.test | 43 ++++----- gnuradio-core/src/guile/tests/hier_ctors.test | 4 +- gnuradio-core/src/guile/tests/io_ctors.test | 10 +- 5 files changed, 92 insertions(+), 114 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/filter_ctors.test b/gnuradio-core/src/guile/tests/filter_ctors.test index 6a35bd296..ee851b6e0 100644 --- a/gnuradio-core/src/guile/tests/filter_ctors.test +++ b/gnuradio-core/src/guile/tests/filter_ctors.test @@ -39,17 +39,17 @@ ;;; ./filter/gr_cma_equalizer_cc.h (pass-if (true? (gr:cma-equalizer-cc 0 0 0))) -;;; ./filter/gr_fft_filter_ccc.h FIXME: not found -;; (pass-if (true? (gr:fft-filter-ccc 0 #(1+3i 23+5i)))) +;;; ./filter/gr_fft_filter_ccc.h +(pass-if (true? (gr:fft-filter-ccc 0 #(1+3i 23+5i)))) -;;; ./filter/gr_fft_filter_fff.h FIXME: not found -;; (pass-if (true? (gr:fft-filter-fff 0 #(1.0 2.0)))) +;;; ./filter/gr_fft_filter_fff.h +(pass-if (true? (gr:fft-filter-fff 0 #(1.0 2.0)))) -;;; ./filter/gr_filter_delay_fc.h FIXME: not found -;; (pass-if (true? (gr:filter-delay-fc #(1.0 2.0)))) +;;; ./filter/gr_filter_delay_fc.h +(pass-if (true? (gr:filter-delay-fc #(1.0 2.0)))) -;;; ./filter/gr_fir_ccc_generic.h FIXME: not found -;; (pass-if (true? (gr:fir-ccc-generic))) +;;; ./filter/gr_fir_ccc_generic. FIXME: Unbound variable: ~S" (gr:fir-ccc-generic) #f)) +;; (pass-if (true? (gr:fir-ccc-generic))) ;; (pass-if (true? (gr:fir-ccc-generic #(1+3i 23+5i)))) ;;; ./filter/gr_fir_ccc_simd.h FIXME: not found @@ -104,41 +104,41 @@ ;;; ./filter/gr_fir_filter_ccc.h FIXME: not found ;; (pass-if (true? (gr:fir-filter-ccc 1 #(1+3i 23+5i)))) -;;; ./filter/gr_fir_filter_ccf.h FIXME: not found -;; (pass-if (true? (gr:fir-filter-ccf 1 #(1.0 2.0)))) +;;; ./filter/gr_fir_filter_ccf.h +(pass-if (true? (gr:fir-filter-ccf 1 #(1.0 2.0)))) -;;; ./filter/gr_fir_filter_fcc.h FIXME: not found -;; (pass-if (true? (gr:fir-filter-fcc 1 #(1+3i 23+5i)))) +;;; ./filter/gr_fir_filter_fcc.h +(pass-if (true? (gr:fir-filter-fcc 1 #(1+3i 23+5i)))) -;;; ./filter/gr_fir_filter_fff.h FIXME: not found -;; (pass-if (true? (gr:fir-filter-fff 1 #(1.0 2.0)))) +;;; ./filter/gr_fir_filter_fff.h +(pass-if (true? (gr:fir-filter-fff 1 #(1.0 2.0)))) -;;; ./filter/gr_fir_filter_fsf.h FIXME: not found -;; (pass-if (true? (gr:fir-filter-fsf 1 #(1.0 2.0)))) +;;; ./filter/gr_fir_filter_fsf.h +(pass-if (true? (gr:fir-filter-fsf 1 #(1.0 2.0)))) -;;; ./filter/gr_fir_filter_scc.h FIXME: not found -;; (pass-if (true? (gr:fir-filter-scc 1 #(1+3i 23+5i)))) +;;; ./filter/gr_fir_filter_scc.h +(pass-if (true? (gr:fir-filter-scc 1 #(1+3i 23+5i)))) -;;; ./filter/gr_fir_fsf_generic.h FIXME: not found +;;; ./filter/gr_fir_fsf_generic.h FIXME: "Unbound variable: ~S" (gr:fir-fsf-generic) #f)) ;; (pass-if (true? (gr:fir-fsf-generic))) ;; (pass-if (true? (gr:fir-fsf-generic #(1.0 2.0)))) ;;; ./filter/gr_fir_fsf_simd.h FIXME: not found ;; (pass-if (true? (gr:fir-fsf-simd 0 0 0))) -;;; ./filter/gr_fir_fsf_x86.h FIXME: not found +;;; ./filter/gr_fir_fsf_x86.h FIXME: "Unbound variable: ~S" (gr:fir-fsf-x86) #f)) ;; (pass-if (true? (gr:fir-fsf-x86))) ;; (pass-if (true? (gr:fir-fsf-x86 #(1.0 2.0)))) -;;; ./filter/gr_fir_scc_generic.h FIXME: not found +;;; ./filter/gr_fir_scc_generic.h FIXME: file not found ;; (pass-if (true? (gr:fir-scc-generic))) ;; (pass-if (true? (gr:fir-scc-generic #(1+3i 23+5i)))) -;;; ./filter/gr_fir_scc_simd.h FIXME: not found +;;; ./filter/gr_fir_scc_simd.h FIXME: Unbound variable: ~S" (gr:fir-scc-simd) #f)) ;; (pass-if (true? (gr:fir-scc-simd))) ;; (pass-if (true? (gr:fir-scc-simd #(1+3i 23+5i)))) -;;; ./filter/gr_fir_scc_x86.h FIXME: not found +;;; ./filter/gr_fir_scc_x86.h FIXME: "Unbound variable: ~S" (gr:fir-scc-x86) #f)) ;; (pass-if (true? (gr:fir-scc-x86))) ;; (pass-if (true? (gr:fir-scc-x86 #(1+3i 23+5i)))) @@ -152,97 +152,97 @@ ;; (pass-if (true? (gr:fir-sysconfig-powerpc ))) ;;; ./filter/gr_fir_sysconfig_x86.h FIXME: virtual methods -;; (pass-if (true? (gr:fir-sysconfig-x86 ))) +;; (pass-if (true? (gr:fir-sysconfig-x86 #(1+3i 23+5i)))) -;;; ./filter/gr_fractional_interpolator_cc.h FIXME: not found +;;; ./filter/gr_fractional_interpolator_cc.h FIXME: file not found ;; (pass-if (true? (gr:fractional-interpolator-cc 1.0 1.0))) -;;; ./filter/gr_fractional_interpolator_ff.h FIXME: not found +;;; ./filter/gr_fractional_interpolator_ff.h FIXME: file not found ;; (pass-if (true? (gr:fractional-interpolator-ff 1.0 1.0))) -;;; ./filter/gr_freq_xlating_fir_filter_ccc.h FIXME: not found +;;; ./filter/gr_freq_xlating_fir_filter_ccc.h FIXME: file not found ;; (pass-if (true? (gr:freq-xlating-fir-filter-ccc 1.0 1.0))) -;;; ./filter/gr_freq_xlating_fir_filter_ccf.h FIXME: not found +;;; ./filter/gr_freq_xlating_fir_filter_ccf.h FIXME: file not found ;; (pass-if (true? (gr:freq-xlating-fir-filter-ccf 1.0 1.0))) -;;; ./filter/gr_freq_xlating_fir_filter_fcc.h FIXME: not found +;;; ./filter/gr_freq_xlating_fir_filter_fcc.h FIXME: file not found ;; (pass-if (true? (gr:freq-xlating-fir-filter-fcc 1.0 1.0))) -;;; ./filter/gr_freq_xlating_fir_filter_fcf.h FIXME: not found +;;; ./filter/gr_freq_xlating_fir_filter_fcf.h FIXME: file not found ;; (pass-if (true? (gr:freq-xlating-fir-filter-fcf 1.0 1.0))) -;;; ./filter/gr_freq_xlating_fir_filter_scc.h FIXME: not found +;;; ./filter/gr_freq_xlating_fir_filter_scc.h FIXME: file not found ;; (pass-if (true? (gr:freq-xlating-fir-filter-scc 1.0 1.0))) -;;; ./filter/gr_freq_xlating_fir_filter_scf.h FIXME: not found +;;; ./filter/gr_freq_xlating_fir_filter_scf.h FIXME: file not found ;; (pass-if (true? (gr:freq-xlating-fir-filter-scf 1.0 1.0))) -;;; ./filter/gr_goertzel_fc.h FIXME: not found -;; (pass-if (true? (gr:goertzel-fc 1 1 1))) +;;; ./filter/gr_goertzel_fc.h +(pass-if (true? (gr:goertzel-fc 1 1 1))) -;;; ./filter/gr_hilbert_fc.h FIXME: not found -;; (pass-if (true? (gr:hilbert-fc ))) +;;; ./filter/gr_hilbert_fc.h +(pass-if (true? (gr:hilbert-fc 1))) -;;; ./filter/gr_iir_filter_ffd.h FIXME: not found -;; (pass-if (true? (gr:iir-filter-ffd ))) +;;; ./filter/gr_iir_filter_ffd.h +(pass-if (true? (gr:iir-filter-ffd #(1.0 2.0) #(1.0 2.0)))) -;;; ./filter/gr_interp_fir_filter_ccc.h FIXME: not found +;;; ./filter/gr_interp_fir_filter_ccc.h FIXME: file not found ;; (pass-if (true? (gr:interp-fir-filter-ccc ))) -;;; ./filter/gr_interp_fir_filter_ccf.h FIXME: not found +;;; ./filter/gr_interp_fir_filter_ccf.h FIXME: file not found ;; (pass-if (true? (gr:interp-fir-filter-ccf ))) -;;; ./filter/gr_interp_fir_filter_fcc.h FIXME: not found +;;; ./filter/gr_interp_fir_filter_fcc.h FIXME: file not found ;; (pass-if (true? (gr:interp-fir-filter-fcc ))) -;;; ./filter/gr_interp_fir_filter_fff.h FIXME: not found +;;; ./filter/gr_interp_fir_filter_fff.h FIXME: file not found ;; (pass-if (true? (gr:interp-fir-filter-fff ))) -;;; ./filter/gr_interp_fir_filter_fsf.h FIXME: not found +;;; ./filter/gr_interp_fir_filter_fsf.h FIXME: file not found ;; (pass-if (true? (gr:interp-fir-filter-fsf ))) -;;; ./filter/gr_interp_fir_filter_scc.h +;;; ./filter/gr_interp_fir_filter_scc.h FIXME: file not found ;; (pass-if (true? (gr:interp-fir-filter-scc ))) ;;; ./filter/gr_pfb_arb_resampler_ccf.h -;; (pass-if (true? (gr:pfb-arb-resampler-ccf ))) +(pass-if (true? (gr:pfb-arb-resampler-ccf 1.0 #(1.0 2.0) 32))) ;;; ./filter/gr_pfb_channelizer_ccf.h -;; (pass-if (true? (gr:pfb-channelizer-ccf ))) +(pass-if (true? (gr:pfb-channelizer-ccf 1 #(1.0 2.0) 1))) ;;; ./filter/gr_pfb_clock_sync_ccf.h -;; (pass-if (true? (gr:pfb-clock-sync-ccf ))) +(pass-if (true? (gr:pfb-clock-sync-ccf 1.0 1.0 #(1.0 2.0) 32 0 1.5))) ;;; ./filter/gr_pfb_clock_sync_fff.h -;; (pass-if (true? (gr:pfb-clock-sync-fff ))) +(pass-if (true? (gr:pfb-clock-sync-fff 1.0 1.0 #(1.0 2.0) 32 0 1.5))) ;;; ./filter/gr_pfb_decimator_ccf.h -;; (pass-if (true? (gr:pfb-decimator-ccf ))) +(pass-if (true? (gr:pfb-decimator-ccf 1 #(1.0 2.0) 0))) ;;; ./filter/gr_pfb_interpolator_ccf.h -;; (pass-if (true? (gr:pfb-interpolator-ccf ))) +(pass-if (true? (gr:pfb-interpolator-ccf 1 #(1.0 2.0)))) -;;; ./filter/gr_rational_resampler_base_ccc.h +;;; ./filter/gr_rational_resampler_base_ccc.h FIXME: file not found ;; (pass-if (true? (gr:rational-resampler-base-ccc ))) -;;; ./filter/gr_rational_resampler_base_ccf.h +;;; ./filter/gr_rational_resampler_base_ccf.h FIXME: file not found ;; (pass-if (true? (gr:rational-resampler-base-ccf ))) -;;; ./filter/gr_rational_resampler_base_fcc.h +;;; ./filter/gr_rational_resampler_base_fcc.h FIXME: file not found ;; (pass-if (true? (gr:rational-resampler-base-fcc ))) -;;; ./filter/gr_rational_resampler_base_fff.h +;;; ./filter/gr_rational_resampler_base_fff.h FIXME: file not found ;; (pass-if (true? (gr:rational-resampler-base-fff ))) -;;; ./filter/gr_rational_resampler_base_fsf.h +;;; ./filter/gr_rational_resampler_base_fsf.h FIXME: file not found ;; (pass-if (true? (gr:rational-resampler-base-fsf ))) -;;; ./filter/gr_rational_resampler_base_scc.h +;;; ./filter/gr_rational_resampler_base_scc.h FIXME: file not found ;; (pass-if (true? (gr:rational-resampler-base-scc ))) ;;; ./filter/gr_single_pole_iir_filter_cc.h -;; (pass-if (true? (gr:single-pole-iir-filter-cc ))) +(pass-if (true? (gr:single-pole-iir-filter-cc 1.0 1))) ;;; ./filter/gr_single_pole_iir_filter_ff.h -;; (pass-if (true? (gr:single-pole-iir-filter-ff ))) +(pass-if (true? (gr:single-pole-iir-filter-ff 1.0 1))) diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index a18766400..6abc08399 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -116,10 +116,8 @@ ;;; ./general/gr_conjugate_cc.h (pass-if (true? (gr:conjugate-cc))) -;;; ./general/gr_constellation_decoder_cb.h FIXME: wrong-arg-type (not sure why...) -;gr_constellation_decoder_cb (const std::vector &sym_position, -; const std::vector &sym_value_out); -;; (pass-if (true? (gr:constellation-decoder-cb #(2+3i 23+5i) #(0 1)))) +;;; ./general/gr_constellation_decoder_cb.h +(pass-if (true? (gr:constellation-decoder-cb #(2+3i 23+5i) #(0 1)))) ;;; ./general/gr_copy.h (pass-if (true? (gr:copy 1))) @@ -167,7 +165,7 @@ ;;; ./general/gr_encode_ccsds_27_bb.h (pass-if (true? (gr:encode-ccsds-27-bb))) -;;; ./general/gr_fake_channel_coder_pp.h FIXME: file name doesn't match class name +;;; ./general/gr_fake_channel_coder_pp.h (pass-if (true? (gr:fake-channel-encoder-pp 1 1))) (pass-if-throw "confirm throw" #t (true? (gr:fake-channel-encoder-pp -1 1))) @@ -178,7 +176,6 @@ (pass-if (true? (gr:fft-vcc 1 #f #(1.0 2.0) #t))) ;;; ./general/gr_fft_vfc.h -;; bool set_window(const std::vector &window); (pass-if (true? (gr:fft-vfc 4 #t #(1.0 2.0 3.0 4.0)))) (pass-if-throw "confirm throw gr:fft-vfc" #t (true? (gr:fft-vfc 4 #f #(1.0 2.0 3.0 4.0)))) @@ -239,7 +236,6 @@ (pass-if (true? (gr:lms-dfe-ff 1 1 1 1))) ;;; ./general/gr_map_bb.h -;; gr_map_bb (const std::vector &map); (pass-if (true? (gr:map-bb #(1 2)))) ;;; ./general/gr_mpsk_receiver_cc.h @@ -260,25 +256,14 @@ ;;; ./general/gr_ofdm_cyclic_prefixer.h (pass-if (true? (gr:ofdm-cyclic-prefixer 1 1))) -;;; ./general/gr_ofdm_frame_acquisition.h FIXME: "No matching method for generic function `ofdm_frame_acquisition'" -;; gr_ofdm_frame_acquisition (unsigned int occupied_carriers, -;; unsigned int fft_length, -;; unsigned int cplen, -;; const std::vector &known_symbol, -;; unsigned int max_fft_shift_len); -;; (pass-if (true? (gr:ofdm-frame-acquisition 0 0 0 #(1+3i 23+5i) 0))) +;;; ./general/gr_ofdm_frame_acquisition.h +(pass-if (true? (gr:ofdm-frame-acquisition 1 1 1 #(1+3i 23+5i) 1))) ;;; ./general/gr_ofdm_frame_sink.h FIXME: "No matching method for generic function `ofdm_frame_sink'" -;; gr_ofdm_frame_sink(const std::vector &sym_position, -;; const std::vector &sym_value_out, -;; gr_msg_queue_sptr target_queue, unsigned int occupied_tones, -;; float phase_gain, float freq_gain); -;;(pass-if (true? (gr:ofdm-frame-sink #(1+3i 23+5i) #(1 2) (gr:msg-queue) 1 0.25 0))) - -;;; ./general/gr_ofdm_insert_preamble.h FIXME: Wrong type argument in position ~A: -;; gr_ofdm_insert_preamble(int fft_length, -;; const std::vector > &preamble); -;;(pass-if (true? (gr:ofdm-insert-preamble 1 #(#(1+3i 23+5i))))) +;; (pass-if (true? (gr:ofdm-frame-sink #(1+3i 23+5i) #(1 2) (gr:msg-queue) 1 0.25 0))) + +;;; ./general/gr_ofdm_insert_preamble.h FIXME: "Wrong type argument in position ~A: ~S" +;; (pass-if (true? (gr:ofdm-insert-preamble 1 #(#(1+3i 23+5i))))) ;;; ./general/gr_ofdm_mapper_bcv.h FIXME: Wrong type argument in position ~A: ;; gr_ofdm_mapper_bcv (const std::vector &constellation, diff --git a/gnuradio-core/src/guile/tests/gengen_ctors.test b/gnuradio-core/src/guile/tests/gengen_ctors.test index 10eb1d9e0..43996c001 100644 --- a/gnuradio-core/src/guile/tests/gengen_ctors.test +++ b/gnuradio-core/src/guile/tests/gengen_ctors.test @@ -50,9 +50,8 @@ ;;; ./gengen/gr_add_const_ss.h (pass-if (true? (gr:add-const-ss 0))) -;;; ./gengen/gr_add_const_vcc.h FIXME: Wrong type argument in position ~A: -;; gr_make_add_const_vcc (const std::vector &k); -;; (pass-if (true? (gr:add-const-vcc #(1+3i 23+5i)))) +;;; ./gengen/gr_add_const_vcc.h +(pass-if (true? (gr:add-const-vcc #(1+3i 23+5i)))) ;;; ./gengen/gr_add_const_vff.h (pass-if (true? (gr:add-const-vff #(1.0 2.0)))) @@ -99,25 +98,23 @@ ;;; ./gengen/gr_argmax_ss.h (pass-if (true? (gr:argmax-ss 1))) -;;; ./gengen/gr_chunks_to_symbols_bc.h FIXME: not found -;; (pass-if (true? (gr:chunks-to-symbols-bc #(1+3i 23+5i) 1))) +;;; ./gengen/gr_chunks_to_symbols_bc.h +(pass-if (true? (gr:chunks-to-symbols-bc #(1+3i 23+5i) 1))) ;;; ./gengen/gr_chunks_to_symbols_bf.h (pass-if (true? (gr:chunks-to-symbols-bf #(1.0 2.0) 1))) -;;; ./gengen/gr_chunks_to_symbols_ic.h FIXME: not found -;; gr_make_chunks_to_symbols_ic (const std::vector &symbol_table, const int D = 1); -;; (pass-if (true? (gr:chunks-to-symbols-ic #(1+3i 23+5i) 1))) +;;; ./gengen/gr_chunks_to_symbols_ic.h +(pass-if (true? (gr:chunks-to-symbols-ic #(1+3i 23+5i) 1))) -;;; ./gengen/gr_chunks_to_symbols_if.h FIXME: not found -;; gr_make_chunks_to_symbols_if (const std::vector &symbol_table, const int D = 1); -;; (pass-if (true? (gr:chunks_to_symbols_if #(1.0 2.0) 1))) +;;; ./gengen/gr_chunks_to_symbols_if.h +(pass-if (true? (gr:chunks-to-symbols-if #(1.0 2.0) 1))) -;;; ./gengen/gr_chunks_to_symbols_sc.h FIXME: not found -;; (pass-if (true? (gr:chunks_to_symbols_sc #(1.0 2.0) 1))) +;;; ./gengen/gr_chunks_to_symbols_sc.h +(pass-if (true? (gr:chunks-to-symbols-sc #(1.0 2.0) 1))) -;;; ./gengen/gr_chunks_to_symbols_sf.h FIXME: not found -;; (pass-if (true? (gr:chunks_to_symbols_sf #(1.0 2.0) 1))) +;;; ./gengen/gr_chunks_to_symbols_sf.h +(pass-if (true? (gr:chunks-to-symbols-sf #(1.0 2.0) 1))) ;;; ./gengen/gr_divide_cc.h (pass-if (true? (gr:divide-cc 1))) @@ -179,9 +176,8 @@ ;;; ./gengen/gr_multiply_const_ss.h (pass-if (true? (gr:multiply-const-ss 1))) -;;; ./gengen/gr_multiply_const_vcc.h FIXME: wrong type argument in position ~A: -;; gr_make_multiply_const_vcc (const std::vector &k); -;; (pass-if (true? (gr:multiply-const-vcc #(1+3i 23+5i)))) +;;; ./gengen/gr_multiply_const_vcc.h +(pass-if (true? (gr:multiply-const-vcc #(1+3i 23+5i)))) ;;; ./gengen/gr_multiply_const_vff.h (pass-if (true? (gr:multiply-const-vff #(1.0 2.0)))) @@ -321,19 +317,16 @@ ;;; ./gengen/gr_vector_sink_s.h (pass-if (true? (gr:vector-sink-s 1))) -;;; ./gengen/gr_vector_source_b.h FIXME: not found +;;; ./gengen/gr_vector_source_b.h ;; (pass-if (true? (gr:vector-source-b #(1 2) false 1))) -;;; ./gengen/gr_vector_source_c.h FIXME: not found -;; gr_make_vector_source_c (const std::vector &data, bool repeat = false, int vlen = 1) +;; ;;; ./gengen/gr_vector_source_c.h ;; (pass-if (true? (gr:vector-source-c #(1+3i 23+5i) false 1))) -;;; ./gengen/gr_vector_source_f.h FIXME: not found -;; gr_make_vector_source_f (const std::vector &data, bool repeat = false, int vlen = 1) +;; ;;; ./gengen/gr_vector_source_f.h ;; (pass-if (true? (gr:vector-source-f #(1.0 2.0) false 1))) -;;; ./gengen/gr_vector_source_i.h FIXME: not found -;; gr_make_vector_source_i (const std::vector &data, bool repeat = false, int vlen = 1) +;;; ./gengen/gr_vector_source_i.h ;; (pass-if (true? (gr:vector-source-i #(1 2) false 1))) ;;; ./gengen/gr_vector_source_s.h FIXME: not found diff --git a/gnuradio-core/src/guile/tests/hier_ctors.test b/gnuradio-core/src/guile/tests/hier_ctors.test index 8a83c86d5..b79ee0f15 100644 --- a/gnuradio-core/src/guile/tests/hier_ctors.test +++ b/gnuradio-core/src/guile/tests/hier_ctors.test @@ -32,9 +32,9 @@ ;;; Add test code for all constructors in these files ;;; -;;; ./hier/gr_channel_model.h +;;; ./hier/gr_channel_model.h FIXME: Unbound variable: ~S" (gr:channel_model) #f)) ;; gr_make_channel_model(double noise_voltage=0.0, double frequency_offset=0.0, ;; double epsilon=1.0, ;; const std::vector &taps=std::vector(1, 1), ;; double noise_seed=3021); -;; (pass-if (true? (gr:channel_model ))) +;; (pass-if (true? (gr:channel_model 0.0 0.0 1.0 #(1 1) 3021))) diff --git a/gnuradio-core/src/guile/tests/io_ctors.test b/gnuradio-core/src/guile/tests/io_ctors.test index 80fb2d3f2..b74d66cda 100644 --- a/gnuradio-core/src/guile/tests/io_ctors.test +++ b/gnuradio-core/src/guile/tests/io_ctors.test @@ -33,10 +33,10 @@ ;;; ;;; ./io/gr_file_descriptor_sink.h -;;(pass-if (true? (gr:file-descriptor-sink 0 0))) FIXME: throws gr_io_signature(3) +(pass-if (true? (gr:file-descriptor-sink 1 1))) -;;; ./io/gr_file_descriptor_source.h -;; (pass-if (true? (gr:file-descriptor-source 1 1 false))) FIXME: not found +;;; ./io/gr_file_descriptor_source.h FIXME: not found +;; (pass-if (true? (gr:file-descriptor-source 1 1 false))) ;;; ./io/gr_file_sink.h (pass-if (true? (gr:file-sink 1 "foo"))) @@ -51,8 +51,8 @@ ;;; ./io/gr_message_sink.h FIXME: not found ;; (pass-if (true? (gr:message-sink 1 1 false))) -;;; ./io/gr_message_source.h -;; (pass-if (true? (gr:message-source ))) +;;; ./io/gr_message_source.h FIXME: not found +;; (pass-if (true? (gr:message-source 1.0 0))) ;;; ./io/gr_oscope_sink_f.h FIXME: not found ;; _oscope_sink_x (const std::string name, gr_io_signature_sptr input_sig, -- cgit From 5331ab1ce1d24e1608f11fc57df5c84ad3c8be9e Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Wed, 17 Nov 2010 20:55:47 -0700 Subject: fixe more tests --- gnuradio-core/src/guile/tests/filter_ctors.test | 60 ++++++++++++------------ gnuradio-core/src/guile/tests/general_ctors.test | 2 +- 2 files changed, 31 insertions(+), 31 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/filter_ctors.test b/gnuradio-core/src/guile/tests/filter_ctors.test index ee851b6e0..4dd0bc187 100644 --- a/gnuradio-core/src/guile/tests/filter_ctors.test +++ b/gnuradio-core/src/guile/tests/filter_ctors.test @@ -154,29 +154,29 @@ ;;; ./filter/gr_fir_sysconfig_x86.h FIXME: virtual methods ;; (pass-if (true? (gr:fir-sysconfig-x86 #(1+3i 23+5i)))) -;;; ./filter/gr_fractional_interpolator_cc.h FIXME: file not found -;; (pass-if (true? (gr:fractional-interpolator-cc 1.0 1.0))) +;;; ./filter/gr_fractional_interpolator_cc.h +(pass-if (true? (gr:fractional-interpolator-cc 1.0 1.0))) -;;; ./filter/gr_fractional_interpolator_ff.h FIXME: file not found -;; (pass-if (true? (gr:fractional-interpolator-ff 1.0 1.0))) +;;; ./filter/gr_fractional_interpolator_ff.h +(pass-if (true? (gr:fractional-interpolator-ff 1.0 1.0))) -;;; ./filter/gr_freq_xlating_fir_filter_ccc.h FIXME: file not found -;; (pass-if (true? (gr:freq-xlating-fir-filter-ccc 1.0 1.0))) +;;; ./filter/gr_freq_xlating_fir_filter_ccc.h +(pass-if (true? (gr:freq-xlating-fir-filter-ccc 1 #(1+3i 23+5i) 1.0 1.0))) -;;; ./filter/gr_freq_xlating_fir_filter_ccf.h FIXME: file not found -;; (pass-if (true? (gr:freq-xlating-fir-filter-ccf 1.0 1.0))) +;;; ./filter/gr_freq_xlating_fir_filter_ccf.h +(pass-if (true? (gr:freq-xlating-fir-filter-ccf 1 #(1.0 2.0) 1.0 1.0))) -;;; ./filter/gr_freq_xlating_fir_filter_fcc.h FIXME: file not found -;; (pass-if (true? (gr:freq-xlating-fir-filter-fcc 1.0 1.0))) +;;; ./filter/gr_freq_xlating_fir_filter_fcc.h +(pass-if (true? (gr:freq-xlating-fir-filter-fcc 1 #(1.0 2.0) 1.0 1.0))) -;;; ./filter/gr_freq_xlating_fir_filter_fcf.h FIXME: file not found -;; (pass-if (true? (gr:freq-xlating-fir-filter-fcf 1.0 1.0))) +;;; ./filter/gr_freq_xlating_fir_filter_fcf.h +(pass-if (true? (gr:freq-xlating-fir-filter-fcf 1 #(1.0 2.0) 1.0 1.0))) -;;; ./filter/gr_freq_xlating_fir_filter_scc.h FIXME: file not found -;; (pass-if (true? (gr:freq-xlating-fir-filter-scc 1.0 1.0))) +;;; ./filter/gr_freq_xlating_fir_filter_scc.h +(pass-if (true? (gr:freq-xlating-fir-filter-scc 1 #(1.0 2.0) 1.0 1.0))) -;;; ./filter/gr_freq_xlating_fir_filter_scf.h FIXME: file not found -;; (pass-if (true? (gr:freq-xlating-fir-filter-scf 1.0 1.0))) +;;; ./filter/gr_freq_xlating_fir_filter_scf.h +(pass-if (true? (gr:freq-xlating-fir-filter-scf 1 #(1.0 2.0) 1.0 1.0))) ;;; ./filter/gr_goertzel_fc.h (pass-if (true? (gr:goertzel-fc 1 1 1))) @@ -187,22 +187,22 @@ ;;; ./filter/gr_iir_filter_ffd.h (pass-if (true? (gr:iir-filter-ffd #(1.0 2.0) #(1.0 2.0)))) -;;; ./filter/gr_interp_fir_filter_ccc.h FIXME: file not found -;; (pass-if (true? (gr:interp-fir-filter-ccc ))) +;;; ./filter/gr_interp_fir_filter_ccc.h FIXME: not found +;; (pass-if (true? (gr:interp-fir-filter-ccc #(1+3i 23+5i)))) -;;; ./filter/gr_interp_fir_filter_ccf.h FIXME: file not found +;;; ./filter/gr_interp_fir_filter_ccf.h FIXME: not found ;; (pass-if (true? (gr:interp-fir-filter-ccf ))) -;;; ./filter/gr_interp_fir_filter_fcc.h FIXME: file not found +;;; ./filter/gr_interp_fir_filter_fcc.h FIXME: not found ;; (pass-if (true? (gr:interp-fir-filter-fcc ))) -;;; ./filter/gr_interp_fir_filter_fff.h FIXME: file not found +;;; ./filter/gr_interp_fir_filter_fff.h FIXME: not found ;; (pass-if (true? (gr:interp-fir-filter-fff ))) -;;; ./filter/gr_interp_fir_filter_fsf.h FIXME: file not found +;;; ./filter/gr_interp_fir_filter_fsf.h FIXME: not found ;; (pass-if (true? (gr:interp-fir-filter-fsf ))) -;;; ./filter/gr_interp_fir_filter_scc.h FIXME: file not found +;;; ./filter/gr_interp_fir_filter_scc.h FIXME: not found ;; (pass-if (true? (gr:interp-fir-filter-scc ))) ;;; ./filter/gr_pfb_arb_resampler_ccf.h @@ -223,22 +223,22 @@ ;;; ./filter/gr_pfb_interpolator_ccf.h (pass-if (true? (gr:pfb-interpolator-ccf 1 #(1.0 2.0)))) -;;; ./filter/gr_rational_resampler_base_ccc.h FIXME: file not found -;; (pass-if (true? (gr:rational-resampler-base-ccc ))) +;;; ./filter/gr_rational_resampler_base_ccc.h FIXME: not found +;; (pass-if (true? (gr:rational-resampler-base-ccc 1 1 #(1+3i 23+5i)))) -;;; ./filter/gr_rational_resampler_base_ccf.h FIXME: file not found +;;; ./filter/gr_rational_resampler_base_ccf.h FIXME: not found ;; (pass-if (true? (gr:rational-resampler-base-ccf ))) -;;; ./filter/gr_rational_resampler_base_fcc.h FIXME: file not found +;;; ./filter/gr_rational_resampler_base_fcc.h FIXME: not found ;; (pass-if (true? (gr:rational-resampler-base-fcc ))) -;;; ./filter/gr_rational_resampler_base_fff.h FIXME: file not found +;;; ./filter/gr_rational_resampler_base_fff.h FIXME: not found ;; (pass-if (true? (gr:rational-resampler-base-fff ))) -;;; ./filter/gr_rational_resampler_base_fsf.h FIXME: file not found +;;; ./filter/gr_rational_resampler_base_fsf.h FIXME: not found ;; (pass-if (true? (gr:rational-resampler-base-fsf ))) -;;; ./filter/gr_rational_resampler_base_scc.h FIXME: file not found +;;; ./filter/gr_rational_resampler_base_scc.h FIXME: not found ;; (pass-if (true? (gr:rational-resampler-base-scc ))) ;;; ./filter/gr_single_pole_iir_filter_cc.h diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index 6abc08399..d09766a95 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -260,7 +260,7 @@ (pass-if (true? (gr:ofdm-frame-acquisition 1 1 1 #(1+3i 23+5i) 1))) ;;; ./general/gr_ofdm_frame_sink.h FIXME: "No matching method for generic function `ofdm_frame_sink'" -;; (pass-if (true? (gr:ofdm-frame-sink #(1+3i 23+5i) #(1 2) (gr:msg-queue) 1 0.25 0))) +;; (pass-if (true? (gr:ofdm-frame-sink #(1+3i 23+5i) #('a' 'b') (gr:msg-queue) 1 0.25 0))) ;;; ./general/gr_ofdm_insert_preamble.h FIXME: "Wrong type argument in position ~A: ~S" ;; (pass-if (true? (gr:ofdm-insert-preamble 1 #(#(1+3i 23+5i))))) -- cgit From f60c4420e1fdef24687ffed6baf4fd7fa5ca5cf8 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 18 Nov 2010 17:33:05 -0800 Subject: Fix guile related problems with gr_message_{sink,source}. --- gnuradio-core/src/guile/gnuradio/core.scm | 11 ++++++++++- gnuradio-core/src/guile/tests/io_ctors.test | 23 ++++++++++++++--------- gnuradio-core/src/lib/io/gr_message_source.i | 13 ++++++++----- 3 files changed, 32 insertions(+), 15 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/gnuradio/core.scm b/gnuradio-core/src/guile/gnuradio/core.scm index b24d5afa9..9c69cea42 100644 --- a/gnuradio-core/src/guile/gnuradio/core.scm +++ b/gnuradio-core/src/guile/gnuradio/core.scm @@ -1,6 +1,7 @@ ;;; Glue the separate pieces of gnuradio-core into a single module (define-module (gnuradio core) + #:use-module (oop goops) #:use-module (gnuradio gnuradio_core_runtime) #:use-module (gnuradio runtime-shim) #:use-module (gnuradio gnuradio_core_filter) @@ -8,7 +9,7 @@ #:use-module (gnuradio gnuradio_core_general) #:use-module (gnuradio gnuradio_core_gengen) #:use-module (gnuradio gnuradio_core_hier) - #:duplicates (merge-generics check)) + #:duplicates (merge-generics replace check)) (re-export-all '(gnuradio gnuradio_core_runtime)) (re-export-all '(gnuradio runtime-shim)) @@ -18,6 +19,14 @@ (re-export-all '(gnuradio gnuradio_core_gengen)) (re-export-all '(gnuradio gnuradio_core_hier)) +;; Work around problem with gr:message-source +(define-generic gr:message-source) +(define-method (gr:message-source itemsize (msgq )) + (gr:message-source-msgq-ctor itemsize msgq)) +(define-method (gr:message-source itemsize (limit )) + (gr:message-source-limit-ctor itemsize limit)) +(export gr:message-source) + ;;; Return #t if x is not #f (define-public (true? x) (and x #t)) diff --git a/gnuradio-core/src/guile/tests/io_ctors.test b/gnuradio-core/src/guile/tests/io_ctors.test index b74d66cda..99c84ae37 100644 --- a/gnuradio-core/src/guile/tests/io_ctors.test +++ b/gnuradio-core/src/guile/tests/io_ctors.test @@ -29,6 +29,10 @@ (use-modules (gnuradio core)) (use-modules (oop goops)) + +(define (rm-foo) + (false-if-exception (delete-file "foo"))) + ;;; Add test code for all constructors in these files ;;; @@ -36,23 +40,24 @@ (pass-if (true? (gr:file-descriptor-sink 1 1))) ;;; ./io/gr_file_descriptor_source.h FIXME: not found -;; (pass-if (true? (gr:file-descriptor-source 1 1 false))) +;; (pass-if (true? (gr:file-descriptor-source 1 1 #f))) ;;; ./io/gr_file_sink.h (pass-if (true? (gr:file-sink 1 "foo"))) ;;; ./io/gr_file_source.h FIXME: not found -;; (pass-if (true? (gr:file-source 1 "foo" false))) +;; (pass-if (true? (gr:file-source 1 "foo" #f))) ;;; ./io/gr_histo_sink_f.h FIXME: not found ;; gr_make_histo_sink_f (gr_msg_queue_sptr msgq); ;; (pass-if (true? (gr:histo-sink-f 1))) -;;; ./io/gr_message_sink.h FIXME: not found -;; (pass-if (true? (gr:message-sink 1 1 false))) +;;; ./io/gr_message_sink.h +(pass-if (true? (gr:message-sink 1 (gr:msg-queue) #f))) -;;; ./io/gr_message_source.h FIXME: not found -;; (pass-if (true? (gr:message-source 1.0 0))) +;;; ./io/gr_message_source.h +(pass-if (true? (gr:message-source 1 1))) +(pass-if (true? (gr:message-source 1 (gr:msg-queue)))) ;;; ./io/gr_oscope_sink_f.h FIXME: not found ;; _oscope_sink_x (const std::string name, gr_io_signature_sptr input_sig, @@ -65,14 +70,14 @@ ;; (pass-if (true? (gr:oscope_sink_x "foo" 1 1))) ;;; ./io/gr_udp_sink.h FIXME: not found -;; (pass-if (true? (gr:udp-sink 1 "foo" 1472 true))) +;; (pass-if (true? (gr:udp-sink 1 "foo" 1472 #t))) ;;; ./io/gr_udp_source.h FIXME: not found -;; (pass-if (true? (gr:message-source 0 "foo" 0 1472 true true))) +;; (pass-if (true? (gr:message-source 0 "foo" 0 1472 #t #t))) ;;; ./io/gr_wavfile_sink.h FIXME: not found ;; (pass-if (true? (gr:message-source "foo" 1 1 1))) ;;; ./io/gr_wavfile_source.h FIXME: not found -;; (pass-if (true? (gr:message-source "foo" false))) +;; (pass-if (true? (gr:message-source "foo" #f))) diff --git a/gnuradio-core/src/lib/io/gr_message_source.i b/gnuradio-core/src/lib/io/gr_message_source.i index 3566ee5a7..e4e2016d0 100644 --- a/gnuradio-core/src/lib/io/gr_message_source.i +++ b/gnuradio-core/src/lib/io/gr_message_source.i @@ -20,12 +20,16 @@ * Boston, MA 02110-1301, USA. */ -#ifdef SWIGGUILE -#warning "gr_message_source.i: FIXME being ignored by swig/guile for now" -#else - GR_SWIG_BLOCK_MAGIC(gr,message_source); +#ifdef SWIGGUILE +// Rename these. Without this, the primitive bindings are OK, but the +// goops bindings try to create a bogus generic-function... +// See core.scm for the second part of the workaround. +%rename(message_source_limit_ctor) gr_make_message_source(size_t itemsize, int msgq_limit); +%rename(message_source_msgq_ctor) gr_make_message_source(size_t itemsize, gr_msg_queue_sptr msgq); +#endif + gr_message_source_sptr gr_make_message_source (size_t itemsize, int msgq_limit=0); gr_message_source_sptr gr_make_message_source (size_t itemsize, gr_msg_queue_sptr msgq); @@ -40,4 +44,3 @@ class gr_message_source : public gr_sync_block gr_msg_queue_sptr msgq() const; }; -#endif -- cgit From 9631c1fa5f67379218459030d4697ab56720fbfa Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Thu, 18 Nov 2010 18:39:14 -0700 Subject: don't generate the list of scripts here, use the version in Makefile.swig --- gnuradio-core/src/lib/swig/Makefile.am | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 16b5d677e..e990d998e 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -56,8 +56,6 @@ nobase_swiginclude_HEADERS = \ guile/std_complex.i \ guile/std_vector.i - -if PYTHON AM_CPPFLAGS = -I$(srcdir) $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \ $(WITH_INCLUDES) @@ -70,8 +68,8 @@ ourpython_PYTHON = gnuradio_core.py # ---------------------------------------------------------------- # FIXME As of swig 1.3.31, this still seems to be required... - -gnuradio_swig_bug_workaround.h : gnuradio_core_runtime.py $(srcdir)/gen-swig-bug-fix +if PYTHON +gnuradio_swig_bug_workaround.h: gnuradio_core_runtime.py $(srcdir)/gen-swig-bug-fix $(PYTHON) $(srcdir)/gen-swig-bug-fix python/gnuradio_core_runtime.cc $@ # C/C++ headers get installed in ${prefix}/include/gnuradio @@ -98,19 +96,13 @@ gnuradio_core_hier_la_swig_libadd = $(GNURADIO_CORE_LA) # add some of the variables generated inside the Makefile.swig -# include the SWIG-generated .h files in the BUILT SOURCES, since they -# aren't by default when using Makefile.swig; order doesn't matter. -PYTHON_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(subst .i,.py,$(HFILE))) -swig_built_sources += $(PYTHON_GEN) -endif # end of if python +endif # end of python -if GUILE -SWIG_GUILE_FLAGS += -DIN_GNURADIO_CORE -#GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(patsubst %.i,%.scm,$(HFILE))) -GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(patsubst %.i,gnuradio/%.scm,$(HFILE))) -# GUILE_GEN_STAMPS = $(filter %.scm,$(TOP_SWIG_IFILES)) -swig_built_sources += $(GUILE_GEN) -endif +if PYTHON +else +gnuradio_swig_bug_workaround.h: + @touch gnuradio_swig_bug_workaround.h +endif # end of guile # Do not distribute the output of SWIG no_dist_files = $(swig_built_sources) -- cgit From f2e0c5b9a703afb919fdcd9a49381bc2160a149e Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Thu, 18 Nov 2010 18:39:34 -0700 Subject: regenerated --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 204 ++++++++++++++++++--------- 1 file changed, 138 insertions(+), 66 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index dc7a7b3bb..160fc8fd8 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -79,6 +79,7 @@ gnuradio_core_runtime_swiginclude_HEADERS = \ gnuradio_core_runtime.i \ $(gnuradio_core_runtime_swiginclude_headers) +if PYTHON gnuradio_core_runtime_pylib_LTLIBRARIES = \ _gnuradio_core_runtime.la @@ -86,6 +87,10 @@ _gnuradio_core_runtime_la_SOURCES = \ python/gnuradio_core_runtime.cc \ $(gnuradio_core_runtime_la_swig_sources) +gnuradio_core_runtime_python_PYTHON = \ + gnuradio_core_runtime.py \ + $(gnuradio_core_runtime_python) + _gnuradio_core_runtime_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_runtime_la_swig_libadd) @@ -99,27 +104,34 @@ _gnuradio_core_runtime_la_CXXFLAGS = \ -I$(top_builddir) \ $(gnuradio_core_runtime_la_swig_cxxflags) -gnuradio_core_runtime_python_PYTHON = \ - gnuradio_core_runtime.py \ - $(gnuradio_core_runtime_python) - python/gnuradio_core_runtime.cc: gnuradio_core_runtime.py gnuradio_core_runtime.py: gnuradio_core_runtime.i # Include the python dependencies for this file -include python/gnuradio_core_runtime.d -# end of PYTHON + +endif # end of if python if GUILE -gnuradio_core_runtime_scmlib_LTLIBRARIES = libguile-gnuradio_core_runtime.la + +gnuradio_core_runtime_scmlib_LTLIBRARIES = \ + libguile-gnuradio_core_runtime.la libguile_gnuradio_core_runtime_la_SOURCES = \ guile/gnuradio_core_runtime.cc \ $(gnuradio_core_runtime_la_swig_sources) -nobase_gnuradio_core_runtime_scm_DATA = gnuradio/gnuradio_core_runtime.scm gnuradio/gnuradio_core_runtime-primitive.scm - -libguile_gnuradio_core_runtime_la_LIBADD = $(_gnuradio_core_runtime_la_LIBADD) -libguile_gnuradio_core_runtime_la_LDFLAGS = $(_gnuradio_core_runtime_la_LDFLAGS) -libguile_gnuradio_core_runtime_la_CXXFLAGS = $(_gnuradio_core_runtime_la_CXXFLAGS) +nobase_gnuradio_core_runtime_scm_DATA = \ + gnuradio/gnuradio_core_runtime.scm \ + gnuradio/gnuradio_core_runtime-primitive.scm +libguile_gnuradio_core_runtime_la_LIBADD = \ + $(STD_SWIG_LA_LIB_ADD) \ + $(gnuradio_core_runtime_la_swig_libadd) +libguile_gnuradio_core_runtime_la_LDFLAGS = \ + $(STD_SWIG_LA_LD_FLAGS) \ + $(gnuradio_core_runtime_la_swig_ldflags) +libguile_gnuradio_core_runtime_la_CXXFLAGS = \ + $(STD_SWIG_CXX_FLAGS) \ + -I$(top_builddir) \ + $(gnuradio_core_runtime_la_swig_cxxflags) guile/gnuradio_core_runtime.cc: gnuradio/gnuradio_core_runtime.scm gnuradio/gnuradio_core_runtime.scm: gnuradio_core_runtime.i @@ -212,6 +224,7 @@ gnuradio_core_general_swiginclude_HEADERS = \ gnuradio_core_general.i \ $(gnuradio_core_general_swiginclude_headers) +if PYTHON gnuradio_core_general_pylib_LTLIBRARIES = \ _gnuradio_core_general.la @@ -219,6 +232,10 @@ _gnuradio_core_general_la_SOURCES = \ python/gnuradio_core_general.cc \ $(gnuradio_core_general_la_swig_sources) +gnuradio_core_general_python_PYTHON = \ + gnuradio_core_general.py \ + $(gnuradio_core_general_python) + _gnuradio_core_general_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_general_la_swig_libadd) @@ -232,27 +249,34 @@ _gnuradio_core_general_la_CXXFLAGS = \ -I$(top_builddir) \ $(gnuradio_core_general_la_swig_cxxflags) -gnuradio_core_general_python_PYTHON = \ - gnuradio_core_general.py \ - $(gnuradio_core_general_python) - python/gnuradio_core_general.cc: gnuradio_core_general.py gnuradio_core_general.py: gnuradio_core_general.i # Include the python dependencies for this file -include python/gnuradio_core_general.d -# end of PYTHON + +endif # end of if python if GUILE -gnuradio_core_general_scmlib_LTLIBRARIES = libguile-gnuradio_core_general.la + +gnuradio_core_general_scmlib_LTLIBRARIES = \ + libguile-gnuradio_core_general.la libguile_gnuradio_core_general_la_SOURCES = \ guile/gnuradio_core_general.cc \ $(gnuradio_core_general_la_swig_sources) -nobase_gnuradio_core_general_scm_DATA = gnuradio/gnuradio_core_general.scm gnuradio/gnuradio_core_general-primitive.scm - -libguile_gnuradio_core_general_la_LIBADD = $(_gnuradio_core_general_la_LIBADD) -libguile_gnuradio_core_general_la_LDFLAGS = $(_gnuradio_core_general_la_LDFLAGS) -libguile_gnuradio_core_general_la_CXXFLAGS = $(_gnuradio_core_general_la_CXXFLAGS) +nobase_gnuradio_core_general_scm_DATA = \ + gnuradio/gnuradio_core_general.scm \ + gnuradio/gnuradio_core_general-primitive.scm +libguile_gnuradio_core_general_la_LIBADD = \ + $(STD_SWIG_LA_LIB_ADD) \ + $(gnuradio_core_general_la_swig_libadd) +libguile_gnuradio_core_general_la_LDFLAGS = \ + $(STD_SWIG_LA_LD_FLAGS) \ + $(gnuradio_core_general_la_swig_ldflags) +libguile_gnuradio_core_general_la_CXXFLAGS = \ + $(STD_SWIG_CXX_FLAGS) \ + -I$(top_builddir) \ + $(gnuradio_core_general_la_swig_cxxflags) guile/gnuradio_core_general.cc: gnuradio/gnuradio_core_general.scm gnuradio/gnuradio_core_general.scm: gnuradio_core_general.i @@ -345,6 +369,7 @@ gnuradio_core_gengen_swiginclude_HEADERS = \ gnuradio_core_gengen.i \ $(gnuradio_core_gengen_swiginclude_headers) +if PYTHON gnuradio_core_gengen_pylib_LTLIBRARIES = \ _gnuradio_core_gengen.la @@ -352,6 +377,10 @@ _gnuradio_core_gengen_la_SOURCES = \ python/gnuradio_core_gengen.cc \ $(gnuradio_core_gengen_la_swig_sources) +gnuradio_core_gengen_python_PYTHON = \ + gnuradio_core_gengen.py \ + $(gnuradio_core_gengen_python) + _gnuradio_core_gengen_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_gengen_la_swig_libadd) @@ -365,27 +394,34 @@ _gnuradio_core_gengen_la_CXXFLAGS = \ -I$(top_builddir) \ $(gnuradio_core_gengen_la_swig_cxxflags) -gnuradio_core_gengen_python_PYTHON = \ - gnuradio_core_gengen.py \ - $(gnuradio_core_gengen_python) - python/gnuradio_core_gengen.cc: gnuradio_core_gengen.py gnuradio_core_gengen.py: gnuradio_core_gengen.i # Include the python dependencies for this file -include python/gnuradio_core_gengen.d -# end of PYTHON + +endif # end of if python if GUILE -gnuradio_core_gengen_scmlib_LTLIBRARIES = libguile-gnuradio_core_gengen.la + +gnuradio_core_gengen_scmlib_LTLIBRARIES = \ + libguile-gnuradio_core_gengen.la libguile_gnuradio_core_gengen_la_SOURCES = \ guile/gnuradio_core_gengen.cc \ $(gnuradio_core_gengen_la_swig_sources) -nobase_gnuradio_core_gengen_scm_DATA = gnuradio/gnuradio_core_gengen.scm gnuradio/gnuradio_core_gengen-primitive.scm - -libguile_gnuradio_core_gengen_la_LIBADD = $(_gnuradio_core_gengen_la_LIBADD) -libguile_gnuradio_core_gengen_la_LDFLAGS = $(_gnuradio_core_gengen_la_LDFLAGS) -libguile_gnuradio_core_gengen_la_CXXFLAGS = $(_gnuradio_core_gengen_la_CXXFLAGS) +nobase_gnuradio_core_gengen_scm_DATA = \ + gnuradio/gnuradio_core_gengen.scm \ + gnuradio/gnuradio_core_gengen-primitive.scm +libguile_gnuradio_core_gengen_la_LIBADD = \ + $(STD_SWIG_LA_LIB_ADD) \ + $(gnuradio_core_gengen_la_swig_libadd) +libguile_gnuradio_core_gengen_la_LDFLAGS = \ + $(STD_SWIG_LA_LD_FLAGS) \ + $(gnuradio_core_gengen_la_swig_ldflags) +libguile_gnuradio_core_gengen_la_CXXFLAGS = \ + $(STD_SWIG_CXX_FLAGS) \ + -I$(top_builddir) \ + $(gnuradio_core_gengen_la_swig_cxxflags) guile/gnuradio_core_gengen.cc: gnuradio/gnuradio_core_gengen.scm gnuradio/gnuradio_core_gengen.scm: gnuradio_core_gengen.i @@ -478,6 +514,7 @@ gnuradio_core_filter_swiginclude_HEADERS = \ gnuradio_core_filter.i \ $(gnuradio_core_filter_swiginclude_headers) +if PYTHON gnuradio_core_filter_pylib_LTLIBRARIES = \ _gnuradio_core_filter.la @@ -485,6 +522,10 @@ _gnuradio_core_filter_la_SOURCES = \ python/gnuradio_core_filter.cc \ $(gnuradio_core_filter_la_swig_sources) +gnuradio_core_filter_python_PYTHON = \ + gnuradio_core_filter.py \ + $(gnuradio_core_filter_python) + _gnuradio_core_filter_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_filter_la_swig_libadd) @@ -498,27 +539,34 @@ _gnuradio_core_filter_la_CXXFLAGS = \ -I$(top_builddir) \ $(gnuradio_core_filter_la_swig_cxxflags) -gnuradio_core_filter_python_PYTHON = \ - gnuradio_core_filter.py \ - $(gnuradio_core_filter_python) - python/gnuradio_core_filter.cc: gnuradio_core_filter.py gnuradio_core_filter.py: gnuradio_core_filter.i # Include the python dependencies for this file -include python/gnuradio_core_filter.d -# end of PYTHON + +endif # end of if python if GUILE -gnuradio_core_filter_scmlib_LTLIBRARIES = libguile-gnuradio_core_filter.la + +gnuradio_core_filter_scmlib_LTLIBRARIES = \ + libguile-gnuradio_core_filter.la libguile_gnuradio_core_filter_la_SOURCES = \ guile/gnuradio_core_filter.cc \ $(gnuradio_core_filter_la_swig_sources) -nobase_gnuradio_core_filter_scm_DATA = gnuradio/gnuradio_core_filter.scm gnuradio/gnuradio_core_filter-primitive.scm - -libguile_gnuradio_core_filter_la_LIBADD = $(_gnuradio_core_filter_la_LIBADD) -libguile_gnuradio_core_filter_la_LDFLAGS = $(_gnuradio_core_filter_la_LDFLAGS) -libguile_gnuradio_core_filter_la_CXXFLAGS = $(_gnuradio_core_filter_la_CXXFLAGS) +nobase_gnuradio_core_filter_scm_DATA = \ + gnuradio/gnuradio_core_filter.scm \ + gnuradio/gnuradio_core_filter-primitive.scm +libguile_gnuradio_core_filter_la_LIBADD = \ + $(STD_SWIG_LA_LIB_ADD) \ + $(gnuradio_core_filter_la_swig_libadd) +libguile_gnuradio_core_filter_la_LDFLAGS = \ + $(STD_SWIG_LA_LD_FLAGS) \ + $(gnuradio_core_filter_la_swig_ldflags) +libguile_gnuradio_core_filter_la_CXXFLAGS = \ + $(STD_SWIG_CXX_FLAGS) \ + -I$(top_builddir) \ + $(gnuradio_core_filter_la_swig_cxxflags) guile/gnuradio_core_filter.cc: gnuradio/gnuradio_core_filter.scm gnuradio/gnuradio_core_filter.scm: gnuradio_core_filter.i @@ -611,6 +659,7 @@ gnuradio_core_io_swiginclude_HEADERS = \ gnuradio_core_io.i \ $(gnuradio_core_io_swiginclude_headers) +if PYTHON gnuradio_core_io_pylib_LTLIBRARIES = \ _gnuradio_core_io.la @@ -618,6 +667,10 @@ _gnuradio_core_io_la_SOURCES = \ python/gnuradio_core_io.cc \ $(gnuradio_core_io_la_swig_sources) +gnuradio_core_io_python_PYTHON = \ + gnuradio_core_io.py \ + $(gnuradio_core_io_python) + _gnuradio_core_io_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_io_la_swig_libadd) @@ -631,27 +684,34 @@ _gnuradio_core_io_la_CXXFLAGS = \ -I$(top_builddir) \ $(gnuradio_core_io_la_swig_cxxflags) -gnuradio_core_io_python_PYTHON = \ - gnuradio_core_io.py \ - $(gnuradio_core_io_python) - python/gnuradio_core_io.cc: gnuradio_core_io.py gnuradio_core_io.py: gnuradio_core_io.i # Include the python dependencies for this file -include python/gnuradio_core_io.d -# end of PYTHON + +endif # end of if python if GUILE -gnuradio_core_io_scmlib_LTLIBRARIES = libguile-gnuradio_core_io.la + +gnuradio_core_io_scmlib_LTLIBRARIES = \ + libguile-gnuradio_core_io.la libguile_gnuradio_core_io_la_SOURCES = \ guile/gnuradio_core_io.cc \ $(gnuradio_core_io_la_swig_sources) -nobase_gnuradio_core_io_scm_DATA = gnuradio/gnuradio_core_io.scm gnuradio/gnuradio_core_io-primitive.scm - -libguile_gnuradio_core_io_la_LIBADD = $(_gnuradio_core_io_la_LIBADD) -libguile_gnuradio_core_io_la_LDFLAGS = $(_gnuradio_core_io_la_LDFLAGS) -libguile_gnuradio_core_io_la_CXXFLAGS = $(_gnuradio_core_io_la_CXXFLAGS) +nobase_gnuradio_core_io_scm_DATA = \ + gnuradio/gnuradio_core_io.scm \ + gnuradio/gnuradio_core_io-primitive.scm +libguile_gnuradio_core_io_la_LIBADD = \ + $(STD_SWIG_LA_LIB_ADD) \ + $(gnuradio_core_io_la_swig_libadd) +libguile_gnuradio_core_io_la_LDFLAGS = \ + $(STD_SWIG_LA_LD_FLAGS) \ + $(gnuradio_core_io_la_swig_ldflags) +libguile_gnuradio_core_io_la_CXXFLAGS = \ + $(STD_SWIG_CXX_FLAGS) \ + -I$(top_builddir) \ + $(gnuradio_core_io_la_swig_cxxflags) guile/gnuradio_core_io.cc: gnuradio/gnuradio_core_io.scm gnuradio/gnuradio_core_io.scm: gnuradio_core_io.i @@ -744,6 +804,7 @@ gnuradio_core_hier_swiginclude_HEADERS = \ gnuradio_core_hier.i \ $(gnuradio_core_hier_swiginclude_headers) +if PYTHON gnuradio_core_hier_pylib_LTLIBRARIES = \ _gnuradio_core_hier.la @@ -751,6 +812,10 @@ _gnuradio_core_hier_la_SOURCES = \ python/gnuradio_core_hier.cc \ $(gnuradio_core_hier_la_swig_sources) +gnuradio_core_hier_python_PYTHON = \ + gnuradio_core_hier.py \ + $(gnuradio_core_hier_python) + _gnuradio_core_hier_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_hier_la_swig_libadd) @@ -764,27 +829,34 @@ _gnuradio_core_hier_la_CXXFLAGS = \ -I$(top_builddir) \ $(gnuradio_core_hier_la_swig_cxxflags) -gnuradio_core_hier_python_PYTHON = \ - gnuradio_core_hier.py \ - $(gnuradio_core_hier_python) - python/gnuradio_core_hier.cc: gnuradio_core_hier.py gnuradio_core_hier.py: gnuradio_core_hier.i # Include the python dependencies for this file -include python/gnuradio_core_hier.d -# end of PYTHON + +endif # end of if python if GUILE -gnuradio_core_hier_scmlib_LTLIBRARIES = libguile-gnuradio_core_hier.la + +gnuradio_core_hier_scmlib_LTLIBRARIES = \ + libguile-gnuradio_core_hier.la libguile_gnuradio_core_hier_la_SOURCES = \ guile/gnuradio_core_hier.cc \ $(gnuradio_core_hier_la_swig_sources) -nobase_gnuradio_core_hier_scm_DATA = gnuradio/gnuradio_core_hier.scm gnuradio/gnuradio_core_hier-primitive.scm - -libguile_gnuradio_core_hier_la_LIBADD = $(_gnuradio_core_hier_la_LIBADD) -libguile_gnuradio_core_hier_la_LDFLAGS = $(_gnuradio_core_hier_la_LDFLAGS) -libguile_gnuradio_core_hier_la_CXXFLAGS = $(_gnuradio_core_hier_la_CXXFLAGS) +nobase_gnuradio_core_hier_scm_DATA = \ + gnuradio/gnuradio_core_hier.scm \ + gnuradio/gnuradio_core_hier-primitive.scm +libguile_gnuradio_core_hier_la_LIBADD = \ + $(STD_SWIG_LA_LIB_ADD) \ + $(gnuradio_core_hier_la_swig_libadd) +libguile_gnuradio_core_hier_la_LDFLAGS = \ + $(STD_SWIG_LA_LD_FLAGS) \ + $(gnuradio_core_hier_la_swig_ldflags) +libguile_gnuradio_core_hier_la_CXXFLAGS = \ + $(STD_SWIG_CXX_FLAGS) \ + -I$(top_builddir) \ + $(gnuradio_core_hier_la_swig_cxxflags) guile/gnuradio_core_hier.cc: gnuradio/gnuradio_core_hier.scm gnuradio/gnuradio_core_hier.scm: gnuradio_core_hier.i -- cgit From d1d226abdede58231583369047861cd2216489e9 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 18 Nov 2010 18:00:58 -0800 Subject: Disable items that require swig directors when building guile bindings. --- .../src/lib/general/gr_bin_statistics_f.i | 7 ++++- gnuradio-core/src/lib/general/gr_feval.i | 30 +++++----------------- 2 files changed, 13 insertions(+), 24 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/general/gr_bin_statistics_f.i b/gnuradio-core/src/lib/general/gr_bin_statistics_f.i index 5cec882f0..be98a464b 100644 --- a/gnuradio-core/src/lib/general/gr_bin_statistics_f.i +++ b/gnuradio-core/src/lib/general/gr_bin_statistics_f.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -19,6 +19,9 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +// Directors are only supported in Python, Java and C#. gr_feval_dd uses directors +#ifdef SWIGPYTHON + GR_SWIG_BLOCK_MAGIC(gr,bin_statistics_f); gr_bin_statistics_f_sptr @@ -40,3 +43,5 @@ private: public: ~gr_bin_statistics_f(); }; + +#endif diff --git a/gnuradio-core/src/lib/general/gr_feval.i b/gnuradio-core/src/lib/general/gr_feval.i index 843ca3f2a..c5522805d 100644 --- a/gnuradio-core/src/lib/general/gr_feval.i +++ b/gnuradio-core/src/lib/general/gr_feval.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006 Free Software Foundation, Inc. + * Copyright 2006,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -43,6 +43,9 @@ */ +// Directors are only supported in Python, Java and C# +#ifdef SWIGPYTHON + // Enable SWIG directors for these classes %feature("director") gr_py_feval_dd; %feature("director") gr_py_feval_cc; @@ -65,8 +68,8 @@ // catch (Swig::DirectorException &e) { std::cerr << e.getMessage(); SWIG_fail; } //} -#ifdef SWIGPYTHON %{ + // class that ensures we acquire and release the Python GIL class ensure_py_gil_state { @@ -77,19 +80,6 @@ public: }; %} -#endif - -#ifdef SWIGGUILE -#if 0 -// FIXME: this is a bogus stub, just here so things build -class ensure_py_gil_state { -public: - ensure_py_gil_state() { } - ~ensure_py_gil_state() { } -}; -#endif -#warning "class ensure_py_gil_state needs to be implemented!" -#endif /* * These are the real C++ base classes, however we don't want these exposed. @@ -158,9 +148,7 @@ class gr_py_feval_dd : public gr_feval_dd public: double calleval(double x) { -#ifdef PYTHON ensure_py_gil_state _lock; -#endif return eval(x); } }; @@ -170,9 +158,7 @@ class gr_py_feval_cc : public gr_feval_cc public: gr_complex calleval(gr_complex x) { -#ifdef PYTHON ensure_py_gil_state _lock; -#endif return eval(x); } }; @@ -182,9 +168,7 @@ class gr_py_feval_ll : public gr_feval_ll public: long calleval(long x) { -#ifdef PYTHON ensure_py_gil_state _lock; -#endif return eval(x); } }; @@ -194,9 +178,7 @@ class gr_py_feval : public gr_feval public: void calleval() { -#ifdef PYTHON ensure_py_gil_state _lock; -#endif eval(); } }; @@ -218,3 +200,5 @@ long gr_feval_ll_example(gr_feval_ll *f, long x); %rename(feval_example) gr_feval_example; void gr_feval_example(gr_feval *f); + +#endif // SWIGPYTHON -- cgit From 6237fafa53938db53a3e2a82b79e80b524dd05db Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 18 Nov 2010 22:22:23 -0800 Subject: gr_msg_queue now working correctly from within guile. --- .../src/guile/tests/00_runtime_ctors.test | 19 +++++++ gnuradio-core/src/lib/runtime/gr_msg_queue.i | 58 ++++++++++++++++++++-- 2 files changed, 74 insertions(+), 3 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/00_runtime_ctors.test b/gnuradio-core/src/guile/tests/00_runtime_ctors.test index 0c131f5bd..966d8c909 100644 --- a/gnuradio-core/src/guile/tests/00_runtime_ctors.test +++ b/gnuradio-core/src/guile/tests/00_runtime_ctors.test @@ -32,4 +32,23 @@ ;;; Add test code for all constructors in these files ;;; ;;; ./runtime/gr_hier_block2.h + ;;; ./runtime/gr_msg_queue.h + +(define (equal-message? a b) + (equal? (gr:to-string a) (gr:to-string b))) + +(with-test-prefix "gr:message/gr:msg-queue" + (let ((msg1 (gr:message-from-string "Hello")) + (msg2 (gr:message-from-string "World!")) + (q (gr:msg-queue))) + (pass-if (equal? "Hello" (gr:to-string msg1))) + (pass-if (equal? "World!" (gr:to-string msg2))) + (pass-if (gr:empty-p q)) + (gr:insert-tail q msg1) + (pass-if (not (gr:empty-p q))) + (gr:insert-tail q msg2) + (let ((r1 (gr:delete-head q)) + (r2 (gr:delete-head q))) + (pass-if (equal-message? r1 msg1)) + (pass-if (equal-message? r2 msg2))))) diff --git a/gnuradio-core/src/lib/runtime/gr_msg_queue.i b/gnuradio-core/src/lib/runtime/gr_msg_queue.i index 5b8fea49f..932747688 100644 --- a/gnuradio-core/src/lib/runtime/gr_msg_queue.i +++ b/gnuradio-core/src/lib/runtime/gr_msg_queue.i @@ -104,8 +104,60 @@ gr_msg_queue_sptr.delete_head = gr_py_msg_queue__delete_head gr_msg_queue_sptr.insert_tail = gr_py_msg_queue__insert_tail gr_msg_queue_sptr.handle = gr_py_msg_queue__insert_tail %} -#endif +#endif // SWIGPYTHON +/* + * Similar trickery as above, only this time for Guile + */ #ifdef SWIGGUILE -#warning "gr_msg_queue.i: gr_msg_queue_sptr needs to be implemented!" -#endif + +%{ + struct arg_holder { + gr_msg_queue_sptr q; + gr_message_sptr msg; + }; + + void *insert_tail_shim(void *arg) + { + arg_holder *a = (arg_holder *)arg; + a->q->insert_tail(a->msg); + return 0; + } + + void *delete_head_shim(void *arg) + { + arg_holder *a = (arg_holder *)arg; + a->msg = a->q->delete_head(); + return 0; + } +%} + +%inline %{ + + // handle and insert_tail are equivalent + static void handle(gr_msg_queue_sptr q, gr_message_sptr msg) + { + arg_holder a; + a.q = q; + a.msg = msg; + scm_without_guile(insert_tail_shim, (void *) &a); + } + + static void insert_tail(gr_msg_queue_sptr q, gr_message_sptr msg) + { + arg_holder a; + a.q = q; + a.msg = msg; + scm_without_guile(insert_tail_shim, (void *) &a); + } + + static gr_message_sptr delete_head(gr_msg_queue_sptr q) + { + arg_holder a; + a.q = q; + scm_without_guile(delete_head_shim, (void *) &a); + return a.msg; + } +%} + +#endif // SWIGGUILE -- cgit From 31b5e27fbf72eca257bc4dd548e127ce16eef9ec Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 19 Nov 2010 00:13:28 -0800 Subject: Enable a couple more tests --- gnuradio-core/src/guile/tests/general_ctors.test | 20 ++++++++++---------- gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.i | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index d09766a95..ff5ee74fa 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -259,18 +259,18 @@ ;;; ./general/gr_ofdm_frame_acquisition.h (pass-if (true? (gr:ofdm-frame-acquisition 1 1 1 #(1+3i 23+5i) 1))) -;;; ./general/gr_ofdm_frame_sink.h FIXME: "No matching method for generic function `ofdm_frame_sink'" -;; (pass-if (true? (gr:ofdm-frame-sink #(1+3i 23+5i) #('a' 'b') (gr:msg-queue) 1 0.25 0))) +;;; ./general/gr_ofdm_frame_sink.h +(pass-if (true? (gr:ofdm-frame-sink #(1+3i 23+5i) #(0 1) (gr:msg-queue) 128 0.25 0))) ;;; ./general/gr_ofdm_insert_preamble.h FIXME: "Wrong type argument in position ~A: ~S" -;; (pass-if (true? (gr:ofdm-insert-preamble 1 #(#(1+3i 23+5i))))) - -;;; ./general/gr_ofdm_mapper_bcv.h FIXME: Wrong type argument in position ~A: -;; gr_ofdm_mapper_bcv (const std::vector &constellation, -;; unsigned int msgq_limit, -;; unsigned int bits_per_symbol, -;; unsigned int fft_length); -;; (pass-if (true? (gr:ofdm-mapper-bcv #(1+3i 23+5i) 1 1 1))) +;;; WONTFIX: Need vector>> +;;(pass-if (true? (gr:ofdm-insert-preamble 2 #(#(1+3i 23+5i) #(1+3i 23+5i))))) + +;;; ./general/gr_ofdm_mapper_bcv.h +(pass-if (true? (gr:ofdm-mapper-bcv #(0+1i 0-1i) 1 100 128))) +(pass-if-throw "confirm throw gr:ofdm-mapper-bcv" #t + (true? (gr:ofdm-mapper-bcv #(0+1i 0-1i) 1 10 128))) + ;;; ./general/gr_ofdm_sampler.h (pass-if (true? (gr:ofdm-sampler 1 1 1))) diff --git a/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.i b/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.i index 30c692926..3850220ba 100644 --- a/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.i +++ b/gnuradio-core/src/lib/general/gr_ofdm_mapper_bcv.i @@ -26,7 +26,7 @@ gr_ofdm_mapper_bcv_sptr gr_make_ofdm_mapper_bcv (const std::vector &constellation, unsigned int msgq_limit, unsigned int bits_per_symbol, - unsigned int fft_length); + unsigned int fft_length) throw(std::exception); class gr_ofdm_mapper_bcv : public gr_sync_block -- cgit From 37a1e931c11f2ba0bdd8ef9ff07c6710e83c6139 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 19 Nov 2010 00:47:07 -0800 Subject: Enable more tests --- gnuradio-core/src/guile/tests/gengen_ctors.test | 18 ++++----- gnuradio-core/src/guile/tests/io_ctors.test | 49 ++++++++++++------------- 2 files changed, 33 insertions(+), 34 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/gengen_ctors.test b/gnuradio-core/src/guile/tests/gengen_ctors.test index 43996c001..6e1213c63 100644 --- a/gnuradio-core/src/guile/tests/gengen_ctors.test +++ b/gnuradio-core/src/guile/tests/gengen_ctors.test @@ -198,16 +198,16 @@ (pass-if (true? (gr:multiply-ss 1))) ;;; ./gengen/gr_mute_cc.h FIXME: not found -;; (pass-if (true? (gr:mute-cc false))) +(pass-if (true? (gr:mute-cc #f))) ;;; ./gengen/gr_mute_ff.h FIXME: not found -;;(pass-if (true? (gr:mute-ff false))) +(pass-if (true? (gr:mute-ff #f))) ;;; ./gengen/gr_mute_ii.h FIXME: not found -;; (pass-if (true? (gr:mute-ii false))) +(pass-if (true? (gr:mute-ii #f))) ;;; ./gengen/gr_mute_ss.h FIXME: not found -;; (pass-if (true? (gr:mute-ss false))) +(pass-if (true? (gr:mute-ss #f))) ;;; ./gengen/gr_noise_source_c.h (pass-if (true? (gr:noise-source-c 1 0 3021))) @@ -318,19 +318,19 @@ (pass-if (true? (gr:vector-sink-s 1))) ;;; ./gengen/gr_vector_source_b.h -;; (pass-if (true? (gr:vector-source-b #(1 2) false 1))) +;; (pass-if (true? (gr:vector-source-b #(1 2) #f 1))) ;; ;;; ./gengen/gr_vector_source_c.h -;; (pass-if (true? (gr:vector-source-c #(1+3i 23+5i) false 1))) +;; (pass-if (true? (gr:vector-source-c #(1+3i 23+5i) #f 1))) ;; ;;; ./gengen/gr_vector_source_f.h -;; (pass-if (true? (gr:vector-source-f #(1.0 2.0) false 1))) +;; (pass-if (true? (gr:vector-source-f #(1.0 2.0) #f 1))) ;;; ./gengen/gr_vector_source_i.h -;; (pass-if (true? (gr:vector-source-i #(1 2) false 1))) +;; (pass-if (true? (gr:vector-source-i #(1 2) #f 1))) ;;; ./gengen/gr_vector_source_s.h FIXME: not found -;; (pass-if (true? (gr:vector-source-s #(1 2) false 1))) +;; (pass-if (true? (gr:vector-source-s #(1 2) #f 1))) ;;; ./gengen/gr_xor_bb.h (pass-if (true? (gr:xor-bb))) diff --git a/gnuradio-core/src/guile/tests/io_ctors.test b/gnuradio-core/src/guile/tests/io_ctors.test index 99c84ae37..1c5c9a771 100644 --- a/gnuradio-core/src/guile/tests/io_ctors.test +++ b/gnuradio-core/src/guile/tests/io_ctors.test @@ -37,20 +37,21 @@ ;;; ;;; ./io/gr_file_descriptor_sink.h -(pass-if (true? (gr:file-descriptor-sink 1 1))) +(pass-if (true? (gr:file-descriptor-sink 1 (dup 1)))) -;;; ./io/gr_file_descriptor_source.h FIXME: not found -;; (pass-if (true? (gr:file-descriptor-source 1 1 #f))) +;;; ./io/gr_file_descriptor_source.h +(pass-if (true? (gr:file-descriptor-source 1 (dup 0) #f))) ;;; ./io/gr_file_sink.h (pass-if (true? (gr:file-sink 1 "foo"))) -;;; ./io/gr_file_source.h FIXME: not found -;; (pass-if (true? (gr:file-source 1 "foo" #f))) +;;; ./io/gr_file_source.h +(pass-if (true? (gr:file-source 1 "foo" #f))) +(rm-foo) -;;; ./io/gr_histo_sink_f.h FIXME: not found +;;; ./io/gr_histo_sink_f.h ;; gr_make_histo_sink_f (gr_msg_queue_sptr msgq); -;; (pass-if (true? (gr:histo-sink-f 1))) +(pass-if (true? (gr:histo-sink-f (gr:msg-queue)))) ;;; ./io/gr_message_sink.h (pass-if (true? (gr:message-sink 1 (gr:msg-queue) #f))) @@ -59,25 +60,23 @@ (pass-if (true? (gr:message-source 1 1))) (pass-if (true? (gr:message-source 1 (gr:msg-queue)))) -;;; ./io/gr_oscope_sink_f.h FIXME: not found -;; _oscope_sink_x (const std::string name, gr_io_signature_sptr input_sig, -;; double sample_rate); -;; (pass-if (true? (gr:oscope-sink-f "foo" 1 1))) +;;; ./io/gr_oscope_sink_f.h +(pass-if (true? (gr:oscope-sink-f 1000 (gr:msg-queue)))) -;;; ./io/gr_oscope_sink_x.h FIXME: not found -;; gr_oscope_sink_x (const std::string name, gr_io_signature_sptr input_sig, -;; double sampling_rate); -;; (pass-if (true? (gr:oscope_sink_x "foo" 1 1))) +;;; ./io/gr_udp_sink.h +(pass-if (true? (gr:udp-sink 4 "localhost" 80 1472 #f))) +(pass-if-throw "confirm throw gr:udp-sink" #t + (true? (gr:udp-sink 4 "localhostx" 80 1472 #f))) -;;; ./io/gr_udp_sink.h FIXME: not found -;; (pass-if (true? (gr:udp-sink 1 "foo" 1472 #t))) +;;; ./io/gr_udp_source.h +(pass-if (true? (gr:udp-source 4 "localhost" 0 1472 #f #t))) +(pass-if-throw "confirm throw gr:udp-sink" #t + (true? (gr:udp-source 4 "localhostx" 0 1472 #f #t))) -;;; ./io/gr_udp_source.h FIXME: not found -;; (pass-if (true? (gr:message-source 0 "foo" 0 1472 #t #t))) - -;;; ./io/gr_wavfile_sink.h FIXME: not found -;; (pass-if (true? (gr:message-source "foo" 1 1 1))) - -;;; ./io/gr_wavfile_source.h FIXME: not found -;; (pass-if (true? (gr:message-source "foo" #f))) +;;; ./io/gr_wavfile_sink.h +(pass-if (true? (gr:wavfile-sink "foo" 2 48000 16))) +;;; ./io/gr_wavfile_source.h WONTFIX: buggy source won't accept file +;;; created immediately above. +;;(pass-if (true? (gr:wavfile-source "foo" #f))) +(rm-foo) -- cgit From 6551f537ed235bbb0ddfadb50744ea3b3fcbc2e6 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 20 Nov 2010 16:30:43 -0800 Subject: Add guile shim to gr_top_block::wait that exits guile mode before blocking. --- gnuradio-core/src/guile/gnuradio/runtime-shim.scm | 13 +++++++- gnuradio-core/src/lib/runtime/gr_top_block.i | 37 ++++++++++++++++++++--- 2 files changed, 44 insertions(+), 6 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/gnuradio/runtime-shim.scm b/gnuradio-core/src/guile/gnuradio/runtime-shim.scm index c08d3947c..105f4ddb8 100644 --- a/gnuradio-core/src/guile/gnuradio/runtime-shim.scm +++ b/gnuradio-core/src/guile/gnuradio/runtime-shim.scm @@ -86,4 +86,15 @@ (loop (1+ n)))))))))) -(export-safely gr:ep gr:connect gr:disconnect) + + +(define-method (gr:run (self )) + (gr:start self) + (gr:wait self)) + +(define-method (gr:wait (self )) + ;; FIXME Set up SIGINT handling here... + (gr:top-block-wait-unlocked self)) + + +(export-safely gr:ep gr:connect gr:disconnect gr:run gr:wait) diff --git a/gnuradio-core/src/lib/runtime/gr_top_block.i b/gnuradio-core/src/lib/runtime/gr_top_block.i index f18d8890b..90fa18b94 100644 --- a/gnuradio-core/src/lib/runtime/gr_top_block.i +++ b/gnuradio-core/src/lib/runtime/gr_top_block.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2007,2008 Free Software Foundation, Inc. + * Copyright 2007,2008,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -42,8 +42,8 @@ public: void start() throw (std::runtime_error); void stop(); - void wait(); - void run() throw (std::runtime_error); + //void wait(); + //void run() throw (std::runtime_error); void lock(); void unlock() throw (std::runtime_error); void dump(); @@ -71,6 +71,33 @@ void top_block_wait_unlocked(gr_top_block_sptr r) throw (std::runtime_error) #endif -#ifdef SWIG_GUILE -#warning "gr_top_block.i: top_block_run_unlocked needs to be implemented!" +#ifdef SWIGGUILE + +%{ + struct tb_arg_holder { + gr_top_block_sptr tb; + }; + + static void * + tb_wait_shim(void *arg) + { + tb_arg_holder *a = (tb_arg_holder *)arg; + a->tb->wait(); + return 0; + } + +%} + +%inline %{ + + static void + top_block_wait_unlocked(gr_top_block_sptr r) throw (std::runtime_error) + { + tb_arg_holder a; + a.tb = r; + scm_without_guile(tb_wait_shim, (void *) &a); + } + +%} + #endif -- cgit From 5c91f873301a6eca0895788b0b03862fc0060a19 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 20 Nov 2010 16:34:04 -0800 Subject: Minor tweaks: comments, static --- gnuradio-core/src/lib/runtime/gr_msg_queue.i | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_msg_queue.i b/gnuradio-core/src/lib/runtime/gr_msg_queue.i index 932747688..c9214bef3 100644 --- a/gnuradio-core/src/lib/runtime/gr_msg_queue.i +++ b/gnuradio-core/src/lib/runtime/gr_msg_queue.i @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2005,2009 Free Software Foundation, Inc. + * Copyright 2005,2009,2010 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -117,14 +117,16 @@ gr_msg_queue_sptr.handle = gr_py_msg_queue__insert_tail gr_message_sptr msg; }; - void *insert_tail_shim(void *arg) + static void * + insert_tail_shim(void *arg) { arg_holder *a = (arg_holder *)arg; a->q->insert_tail(a->msg); return 0; } - void *delete_head_shim(void *arg) + static void * + delete_head_shim(void *arg) { arg_holder *a = (arg_holder *)arg; a->msg = a->q->delete_head(); @@ -135,7 +137,8 @@ gr_msg_queue_sptr.handle = gr_py_msg_queue__insert_tail %inline %{ // handle and insert_tail are equivalent - static void handle(gr_msg_queue_sptr q, gr_message_sptr msg) + static void + handle(gr_msg_queue_sptr q, gr_message_sptr msg) { arg_holder a; a.q = q; @@ -143,7 +146,8 @@ gr_msg_queue_sptr.handle = gr_py_msg_queue__insert_tail scm_without_guile(insert_tail_shim, (void *) &a); } - static void insert_tail(gr_msg_queue_sptr q, gr_message_sptr msg) + static void + insert_tail(gr_msg_queue_sptr q, gr_message_sptr msg) { arg_holder a; a.q = q; @@ -151,7 +155,8 @@ gr_msg_queue_sptr.handle = gr_py_msg_queue__insert_tail scm_without_guile(insert_tail_shim, (void *) &a); } - static gr_message_sptr delete_head(gr_msg_queue_sptr q) + static gr_message_sptr + delete_head(gr_msg_queue_sptr q) { arg_holder a; a.q = q; -- cgit From da6620e6a3d23b78e7231ba70b914974988d3ae1 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sat, 20 Nov 2010 18:27:04 -0800 Subject: Add guile SIGINT handler to gr:wait. --- gnuradio-core/src/guile/gnuradio/runtime-shim.scm | 35 +++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/gnuradio/runtime-shim.scm b/gnuradio-core/src/guile/gnuradio/runtime-shim.scm index 105f4ddb8..bba702670 100644 --- a/gnuradio-core/src/guile/gnuradio/runtime-shim.scm +++ b/gnuradio-core/src/guile/gnuradio/runtime-shim.scm @@ -19,6 +19,7 @@ (define-module (gnuradio runtime-shim) #:use-module (oop goops) + #:use-module (ice-9 threads) #:use-module (gnuradio gnuradio_core_runtime) #:duplicates (merge-generics replace check)) @@ -92,9 +93,37 @@ (gr:start self) (gr:wait self)) -(define-method (gr:wait (self )) - ;; FIXME Set up SIGINT handling here... - (gr:top-block-wait-unlocked self)) + +(define-method (gr:wait (tb )) + + (define (sigint-handler sig) + ;;(display "\nSIGINT!\n" (current-error-port)) + ;; tell flow graph to stop + (gr:stop tb)) + + (let ((old-handler #f)) + (dynamic-wind + + ;; Called at entry + (lambda () + ;; Install SIGINT handler + (set! old-handler (sigaction SIGINT sigint-handler))) + + ;; Protected thunk + (lambda () + (let ((waiter (begin-thread (gr:top-block-wait-unlocked tb)))) + (join-thread waiter) + ;;(display "\nAfter join-thread\n" (current-error-port)) + )) + + ;; Called at exit + (lambda () + ;; Restore SIGINT handler + (if (not (car old-handler)) + ;; restore original C handler + (sigaction SIGINT #f) + ;; restore Scheme handler, SIG_IGN or SIG_DFL + (sigaction SIGINT (car old-handler) (cdr old-handler))))))) (export-safely gr:ep gr:connect gr:disconnect gr:run gr:wait) -- 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. --- gnuradio-core/gnuradio-core.pc.in | 1 + gnuradio-core/src/guile/run_guile_tests.in | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/gnuradio-core.pc.in b/gnuradio-core/gnuradio-core.pc.in index 5d743a4e9..40c26a129 100644 --- a/gnuradio-core/gnuradio-core.pc.in +++ b/gnuradio-core/gnuradio-core.pc.in @@ -2,6 +2,7 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@/gnuradio +guile_load_path=@prefix@/share/guile/site Name: gnuradio-core Description: GNU Software Radio toolkit diff --git a/gnuradio-core/src/guile/run_guile_tests.in b/gnuradio-core/src/guile/run_guile_tests.in index 3aca7bdb0..61968065e 100644 --- a/gnuradio-core/src/guile/run_guile_tests.in +++ b/gnuradio-core/src/guile/run_guile_tests.in @@ -2,14 +2,16 @@ . @top_builddir@/setup_guile_test_env +# Since we're in gnuradio-core, we don't need to add anything, +# but we do need to call add_local_paths to set everything up + # 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 -# We're in gnuradio-core, we don't need these -# add_local_paths \ -# "" \ -# "" \ -# "" +add_local_paths \ + "" \ + "" \ + "" @GUILE@ -e main -c '(use-modules (gnuradio test-suite guile-test))' -t @srcdir@/tests -- cgit From 734791dfe5489166ac561c6916051fde6241f2f4 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sun, 21 Nov 2010 17:43:58 -0700 Subject: don't generate this file anymore --- .../src/lib/swig/gnuradio_swig_bug_workaround.h | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 gnuradio-core/src/lib/swig/gnuradio_swig_bug_workaround.h (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio_swig_bug_workaround.h b/gnuradio-core/src/lib/swig/gnuradio_swig_bug_workaround.h new file mode 100644 index 000000000..8f7eea0bf --- /dev/null +++ b/gnuradio-core/src/lib/swig/gnuradio_swig_bug_workaround.h @@ -0,0 +1,45 @@ +/* -*- c++ -*- */ +/* + * Copyright 2004 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 GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_GNURADIO_SWIG_BUG_WORKAROUND_H +#define INCLUDED_GNURADIO_SWIG_BUG_WORKAROUND_H + +/* + * This include files works around a bug in SWIG 1.3.21 and 22 + * where it fails to emit these declarations when doing + * %import "gnuradio.i" + */ + +class gr_base_error_handler; +class gr_basic_block; +class gr_block; +class gr_error_handler; +class gr_file_error_handler; +class gr_hier_block2; +class gr_msg_handler; +class gr_msg_queue; +class gr_sync_block; +class gr_sync_decimator; +class gr_sync_interpolator; +class gr_top_block; + +#endif /* INCLUDED_GNURADIO_SWIG_BUG_WORKAROUND_H */ -- cgit From ac2fcdb905d616c4aa902479ed44d6ea90947c39 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sun, 21 Nov 2010 17:44:29 -0700 Subject: remove -/gnuradio_swig_bug_workaround.h, it's not generated anymore. --- gnuradio-core/src/lib/swig/.gitignore | 1 - 1 file changed, 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/.gitignore b/gnuradio-core/src/lib/swig/.gitignore index 35e974948..a6f145618 100644 --- a/gnuradio-core/src/lib/swig/.gitignore +++ b/gnuradio-core/src/lib/swig/.gitignore @@ -10,7 +10,6 @@ /swigrun.py /swigrun_wrap.c /Makefile.swigdeps.new -/gnuradio_swig_bug_workaround.h gnuradio_core_filter.cc gnuradio_core_filter.d gnuradio_core_filter.h -- cgit From 6702bd5b6470dcae091b0d0c5aa426537f2cbc1e Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sun, 21 Nov 2010 18:07:12 -0700 Subject: always go into the swig directory --- gnuradio-core/src/lib/Makefile.am | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/Makefile.am b/gnuradio-core/src/lib/Makefile.am index f3a3accdb..1281b4aa6 100644 --- a/gnuradio-core/src/lib/Makefile.am +++ b/gnuradio-core/src/lib/Makefile.am @@ -24,10 +24,7 @@ include $(top_srcdir)/Makefile.common ## Process this file with automake to produce Makefile.in # We've got to build . before swig -SUBDIRS = missing runtime filter viterbi general gengen g72x reed-solomon io hier . -if PYTHON -SUBDIRS += swig -endif +SUBDIRS = missing runtime filter viterbi general gengen g72x reed-solomon io hier . swig AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES) -- cgit From d4ed4d96470c91bcb7fb45da5e07641b24331cba Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sun, 21 Nov 2010 18:07:59 -0700 Subject: go back to the generating the lists here, so make check works again --- gnuradio-core/src/lib/swig/Makefile.am | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index e990d998e..95edf5181 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -56,11 +56,13 @@ nobase_swiginclude_HEADERS = \ guile/std_complex.i \ guile/std_vector.i + AM_CPPFLAGS = -I$(srcdir) $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \ $(WITH_INCLUDES) EXTRA_DIST = gen-swig-bug-fix +if PYTHON # special install for this top-level Python script which includes all # of the split Python libraries. ourpythondir = $(grpythondir)/gr @@ -68,9 +70,8 @@ ourpython_PYTHON = gnuradio_core.py # ---------------------------------------------------------------- # FIXME As of swig 1.3.31, this still seems to be required... -if PYTHON -gnuradio_swig_bug_workaround.h: gnuradio_core_runtime.py $(srcdir)/gen-swig-bug-fix - $(PYTHON) $(srcdir)/gen-swig-bug-fix python/gnuradio_core_runtime.cc $@ +# gnuradio_swig_bug_workaround.h : gnuradio_core_runtime.py $(srcdir)/gen-swig-bug-fix +# $(PYTHON) $(srcdir)/gen-swig-bug-fix python/gnuradio_core_runtime.cc $@ # C/C++ headers get installed in ${prefix}/include/gnuradio grinclude_HEADERS = gnuradio_swig_bug_workaround.h @@ -96,13 +97,17 @@ gnuradio_core_hier_la_swig_libadd = $(GNURADIO_CORE_LA) # add some of the variables generated inside the Makefile.swig -endif # end of python +# include the SWIG-generated .h files in the BUILT SOURCES, since they +# aren't by default when using Makefile.swig; order doesn't matter. +PYTHON_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(subst .i,.py,$(HFILE))) +swig_built_sources += $(PYTHON_GEN) +endif # end of if python -if PYTHON -else -gnuradio_swig_bug_workaround.h: - @touch gnuradio_swig_bug_workaround.h -endif # end of guile +if GUILE +SWIG_GUILE_FLAGS += -DIN_GNURADIO_CORE +GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(patsubst %.i,gnuradio/%.scm,$(HFILE))) +swig_built_sources += $(GUILE_GEN) +endif # end of if guile # Do not distribute the output of SWIG no_dist_files = $(swig_built_sources) -- cgit From 192acf4d1399f6e72c228f0448ab3c7cec15b36b Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sun, 21 Nov 2010 18:56:54 -0700 Subject: always cd into python or guile --- gnuradio-core/src/Makefile.am | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/Makefile.am b/gnuradio-core/src/Makefile.am index 648fe299e..1717d373a 100644 --- a/gnuradio-core/src/Makefile.am +++ b/gnuradio-core/src/Makefile.am @@ -21,12 +21,6 @@ include $(top_srcdir)/Makefile.common -SUBDIRS = gen_interpolator_taps lib tests -if PYTHON -SUBDIRS += python -endif -if GUILE -SUBDIRS += guile -endif +SUBDIRS = gen_interpolator_taps lib tests python guile DIST_SUBDIRS = gen_interpolator_taps lib tests python guile utils -- cgit From e4eb47f0dd55485693e70ec2f45f79912fa899c4 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Sun, 21 Nov 2010 19:43:39 -0800 Subject: Clean up lib/swig/Makefile.am, Makefile.common and Makefile.swig Confirmed that it builds and make checks on all four combintations of --{enable,disable}-{python,guile}. Have not tested make dist, but expect that there may be some problems with it. I'm pretty sure that not all files that need to be removed from the distribution are removed, and make clean may still be leaving some files around. --- gnuradio-core/src/lib/swig/Makefile.am | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index 95edf5181..a97bb6ea0 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -24,11 +24,6 @@ include $(top_srcdir)/Makefile.swig BUILT_SOURCES = $(grinclude_HEADERS) $(swig_built_sources) -CLEANFILES = python/*.cc python/*.h -if GUILE -CLEANFILES += guile/*.cc gnuradio/*.scm -endif - # ---------------------------------------------------------------- # We've split the previously monstrous gnuradio_core into 6 # smaller pieces. This reduces compile time coupling and creates @@ -62,7 +57,6 @@ AM_CPPFLAGS = -I$(srcdir) $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \ EXTRA_DIST = gen-swig-bug-fix -if PYTHON # special install for this top-level Python script which includes all # of the split Python libraries. ourpythondir = $(grpythondir)/gr @@ -95,20 +89,5 @@ gnuradio_core_filter_la_swig_libadd = $(GNURADIO_CORE_LA) gnuradio_core_io_la_swig_libadd = $(GNURADIO_CORE_LA) gnuradio_core_hier_la_swig_libadd = $(GNURADIO_CORE_LA) -# add some of the variables generated inside the Makefile.swig - -# include the SWIG-generated .h files in the BUILT SOURCES, since they -# aren't by default when using Makefile.swig; order doesn't matter. -PYTHON_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(subst .i,.py,$(HFILE))) -swig_built_sources += $(PYTHON_GEN) -endif # end of if python -if GUILE SWIG_GUILE_FLAGS += -DIN_GNURADIO_CORE -GUILE_GEN = $(foreach HFILE,$(TOP_SWIG_IFILES), $(patsubst %.i,gnuradio/%.scm,$(HFILE))) -swig_built_sources += $(GUILE_GEN) -endif # end of if guile - -# Do not distribute the output of SWIG -no_dist_files = $(swig_built_sources) - -- cgit From 9cf988ad17529416f841870b01d0f548e1a0b9a0 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Sun, 21 Nov 2010 21:47:15 -0700 Subject: fix so distcheck *almost* fully works --- gnuradio-core/src/guile/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index 0c0becbc1..c2f8b5c39 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -23,6 +23,7 @@ TESTS = run_guile_tests EXTRA_DIST = \ run_guile_tests.in \ + $(nobase_guile_DATA) \ $(GUILE_TESTS) # These are the hand-code guile files for gnuradio-core. @@ -51,3 +52,5 @@ GUILE_TESTS = \ tests/io_ctors.test CLEANFILES = guile.log + +no_dist_dirs = python guile -- cgit From 1e0faf29d41c6af754e3ceec30d217ce69452cd1 Mon Sep 17 00:00:00 2001 From: Rob Savoye Date: Tue, 23 Nov 2010 17:16:25 -0700 Subject: add a few more .m files --- gnuradio-core/src/utils/Makefile.am | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/utils/Makefile.am b/gnuradio-core/src/utils/Makefile.am index 07960a072..22dae7117 100644 --- a/gnuradio-core/src/utils/Makefile.am +++ b/gnuradio-core/src/utils/Makefile.am @@ -42,4 +42,15 @@ EXTRA_DIST = \ read_cshort_binary.m \ single_pole_iir.m \ write_float_binary.m \ - write_short_binary.m + write_short_binary.m \ + is_complex.m \ + split_vect.m \ + rainbow.m \ + lp_to_bp.m \ + cool.m \ + read_xambi.m \ + runsum.m \ + plot_cic_decimator_response.m + +# partition-cascaded-decimating-filters.scm +# permute.scm -- cgit From 17b63012f821a85924c174b7d89f1236ba4ac5d0 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Tue, 23 Nov 2010 22:25:51 -0800 Subject: Move verbose-equal? to lib.scm --- gnuradio-core/src/guile/gnuradio/test-suite/lib.scm | 13 +++++++++++-- gnuradio-core/src/guile/tests/general_ctors.test | 8 -------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm b/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm index 458e627de..abdc89632 100644 --- a/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm +++ b/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm @@ -20,6 +20,7 @@ :use-module (ice-9 stack-catch) :use-module (ice-9 regex) :use-module (ice-9 syncase) + :use-module (ice-9 format) :export ( ;; Exceptions which are commonly being tested for. @@ -597,9 +598,9 @@ (define-syntax test-equal (syntax-rules () ((_ expected test-expr) - (pass-if (equal? expected test-expr))) + (pass-if (verbose-equal? expected test-expr))) ((_ name expected test-exprt) - (pass-if name (equal? expected test-expr))))) + (pass-if name (verbose-equal? expected test-expr))))) ;;; (test-eqv [name] expected test-expr) (define-syntax test-eqv @@ -616,3 +617,11 @@ (pass-if (eq? expected test-expr))) ((_ name expected test-exprt) (pass-if name (eq? expected test-expr))))) + + +(define-public (verbose-equal? expected actual) + (cond ((equal? expected actual) #t) + (else + (format #t "Expected:\n~y\n" expected) + (format #t "Actual:\n~y\n" actual) + #f))) diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index ff5ee74fa..244249dd8 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -31,14 +31,6 @@ (use-modules (ice-9 format)) -(define (verbose-equal? expected actual) - (cond ((equal? expected actual) #t) - (else - (format #t "Expected:\n~y\n" expected) - (format #t "Actual:\n~y\n" actual) - #f))) - - ;;; Test complex scalars (pass-if (equal? 5.0+5.0i (gr:complex-scalar-test0))) (pass-if (equal? 1.5+0.5i (gr:complex-scalar-test1 1+1i))) -- cgit From 99dc38c8f81fe388b13bf46e3f53cc272765249e Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 24 Nov 2010 13:49:59 -0800 Subject: Consistently use TESTS += in conditionals --- gnuradio-core/src/python/gnuradio/gr/Makefile.am | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/python/gnuradio/gr/Makefile.am b/gnuradio-core/src/python/gnuradio/gr/Makefile.am index c3017adcc..7d89777ef 100644 --- a/gnuradio-core/src/python/gnuradio/gr/Makefile.am +++ b/gnuradio-core/src/python/gnuradio/gr/Makefile.am @@ -25,8 +25,7 @@ EXTRA_DIST = \ run_tests.in \ test_16bit_1chunk.wav -TESTS = \ - run_tests +TESTS = run_tests grgrpythondir = $(grpythondir)/gr -- cgit From d692a41f98e7b888c745efbb9fcbbb0400f39025 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 24 Nov 2010 17:29:11 -0800 Subject: Major Makefile.am housecleaning. Passes distcheck. Move all occurrences of swig_built_sources out of Makefile.am's. Move all SWIG related use of BUILT_SOURCES out of Makefile.am's. Clean up 'if PYTHON' conditionalization in gr-* Still left to do: fix Makefile.swig CLEANFILES and no_dist_files such that they remove exactly the generated files. --- gnuradio-core/Makefile.am | 2 +- gnuradio-core/src/gen_interpolator_taps/Makefile.am | 8 +++++++- gnuradio-core/src/guile/Makefile.am | 4 +--- gnuradio-core/src/lib/filter/Makefile.am | 4 ++-- gnuradio-core/src/lib/g72x/Makefile.am | 2 +- gnuradio-core/src/lib/general/Makefile.am | 2 +- gnuradio-core/src/lib/gengen/Makefile.am | 4 ++-- gnuradio-core/src/lib/missing/Makefile.am | 2 +- gnuradio-core/src/lib/reed-solomon/Makefile.am | 2 +- gnuradio-core/src/lib/swig/Makefile.am | 12 +++++------- gnuradio-core/src/python/bin/Makefile.am | 4 ++-- gnuradio-core/src/python/gnuradio/gr/Makefile.am | 2 +- gnuradio-core/src/tests/Makefile.am | 4 ++-- gnuradio-core/src/utils/Makefile.am | 2 +- 14 files changed, 28 insertions(+), 26 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/Makefile.am b/gnuradio-core/Makefile.am index 107ff785b..0a4e7e151 100644 --- a/gnuradio-core/Makefile.am +++ b/gnuradio-core/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/Makefile.common -EXTRA_DIST = \ +EXTRA_DIST += \ gnuradio-core.pc.in SUBDIRS = src diff --git a/gnuradio-core/src/gen_interpolator_taps/Makefile.am b/gnuradio-core/src/gen_interpolator_taps/Makefile.am index d244e7f54..1b54af5e7 100644 --- a/gnuradio-core/src/gen_interpolator_taps/Makefile.am +++ b/gnuradio-core/src/gen_interpolator_taps/Makefile.am @@ -21,7 +21,13 @@ include $(top_srcdir)/Makefile.common -EXTRA_DIST = praxis.txt simpson.h objective_fct.c gen_interpolator_taps.c simpson.c praxis.f +EXTRA_DIST += \ + praxis.txt \ + simpson.h \ + objective_fct.c \ + gen_interpolator_taps.c \ + simpson.c \ + praxis.f # if ENABLE_FORTRAN # noinst_PROGRAMS = gen_interpolator_taps diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index c2f8b5c39..209e664a0 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/Makefile.common TESTS = run_guile_tests -EXTRA_DIST = \ +EXTRA_DIST += \ run_guile_tests.in \ $(nobase_guile_DATA) \ $(GUILE_TESTS) @@ -52,5 +52,3 @@ GUILE_TESTS = \ tests/io_ctors.test CLEANFILES = guile.log - -no_dist_dirs = python guile diff --git a/gnuradio-core/src/lib/filter/Makefile.am b/gnuradio-core/src/lib/filter/Makefile.am index 6d2ec1c7e..38edee3d5 100644 --- a/gnuradio-core/src/lib/filter/Makefile.am +++ b/gnuradio-core/src/lib/filter/Makefile.am @@ -67,7 +67,7 @@ code_generator = \ # Source built by Python into $(builddir) -BUILT_SOURCES = \ +BUILT_SOURCES += \ $(GENERATED_H) \ $(GENERATED_I) \ $(GENERATED_CC) \ @@ -178,7 +178,7 @@ EXTRA_libfilter_la_SOURCES = \ $(armv7_a_qa_CODE) -EXTRA_DIST = \ +EXTRA_DIST += \ 3dnow_float_dotprod_really_simple.S \ 3dnow_float_dotprod_simple.S \ $(code_generator) diff --git a/gnuradio-core/src/lib/g72x/Makefile.am b/gnuradio-core/src/lib/g72x/Makefile.am index 6c41f1911..d2700376f 100644 --- a/gnuradio-core/src/lib/g72x/Makefile.am +++ b/gnuradio-core/src/lib/g72x/Makefile.am @@ -24,4 +24,4 @@ include $(top_srcdir)/Makefile.common noinst_LTLIBRARIES = libccitt.la libccitt_la_SOURCES = g711.c g72x.c g721.c g723_24.c g723_40.c g72x.h -EXTRA_DIST = encode.c decode.c +EXTRA_DIST += encode.c decode.c diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am index 735795789..b25326deb 100644 --- a/gnuradio-core/src/lib/general/Makefile.am +++ b/gnuradio-core/src/lib/general/Makefile.am @@ -29,7 +29,7 @@ BUILT_SOURCES = # ---------------------------------------------------------------- -EXTRA_DIST = \ +EXTRA_DIST += \ gen_sine_table.py \ gr_constants.cc.in diff --git a/gnuradio-core/src/lib/gengen/Makefile.am b/gnuradio-core/src/lib/gengen/Makefile.am index 4978ad1c5..cfa043b67 100644 --- a/gnuradio-core/src/lib/gengen/Makefile.am +++ b/gnuradio-core/src/lib/gengen/Makefile.am @@ -115,7 +115,7 @@ core_generator = \ gr_moving_average_XX.i.t # Source built by Python into $(builddir) -BUILT_SOURCES = \ +BUILT_SOURCES += \ $(GENERATED_H) \ $(GENERATED_I) \ $(GENERATED_CC) \ @@ -123,7 +123,7 @@ BUILT_SOURCES = \ # ---------------------------------------------------------------- -EXTRA_DIST = \ +EXTRA_DIST += \ $(core_generator) libgengen_la_SOURCES = \ diff --git a/gnuradio-core/src/lib/missing/Makefile.am b/gnuradio-core/src/lib/missing/Makefile.am index 238370910..bd18cf143 100644 --- a/gnuradio-core/src/lib/missing/Makefile.am +++ b/gnuradio-core/src/lib/missing/Makefile.am @@ -23,7 +23,7 @@ include $(top_srcdir)/Makefile.common AM_CPPFLAGS = $(GNURADIO_INCLUDES) $(WITH_INCLUDES) -EXTRA_DIST = \ +EXTRA_DIST += \ getopt.h \ getopt.c \ gettimeofday.c \ diff --git a/gnuradio-core/src/lib/reed-solomon/Makefile.am b/gnuradio-core/src/lib/reed-solomon/Makefile.am index b7bd939b0..5548f4280 100644 --- a/gnuradio-core/src/lib/reed-solomon/Makefile.am +++ b/gnuradio-core/src/lib/reed-solomon/Makefile.am @@ -29,7 +29,7 @@ AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES) TESTS = rstest -EXTRA_DIST = \ +EXTRA_DIST += \ README.karn noinst_LTLIBRARIES = librs.la diff --git a/gnuradio-core/src/lib/swig/Makefile.am b/gnuradio-core/src/lib/swig/Makefile.am index a97bb6ea0..f8e7640ae 100644 --- a/gnuradio-core/src/lib/swig/Makefile.am +++ b/gnuradio-core/src/lib/swig/Makefile.am @@ -22,7 +22,8 @@ include $(top_srcdir)/Makefile.common include $(top_srcdir)/Makefile.swig -BUILT_SOURCES = $(grinclude_HEADERS) $(swig_built_sources) +AM_CPPFLAGS = -I$(srcdir) $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \ + $(WITH_INCLUDES) # ---------------------------------------------------------------- # We've split the previously monstrous gnuradio_core into 6 @@ -52,11 +53,6 @@ nobase_swiginclude_HEADERS = \ guile/std_vector.i -AM_CPPFLAGS = -I$(srcdir) $(STD_DEFINES_AND_INCLUDES) $(PYTHON_CPPFLAGS) \ - $(WITH_INCLUDES) - -EXTRA_DIST = gen-swig-bug-fix - # special install for this top-level Python script which includes all # of the split Python libraries. ourpythondir = $(grpythondir)/gr @@ -67,9 +63,12 @@ ourpython_PYTHON = gnuradio_core.py # gnuradio_swig_bug_workaround.h : gnuradio_core_runtime.py $(srcdir)/gen-swig-bug-fix # $(PYTHON) $(srcdir)/gen-swig-bug-fix python/gnuradio_core_runtime.cc $@ +EXTRA_DIST += gen-swig-bug-fix + # C/C++ headers get installed in ${prefix}/include/gnuradio grinclude_HEADERS = gnuradio_swig_bug_workaround.h + # Install so that they end up available as: # import gnuradio.gr # This ends up at: @@ -89,5 +88,4 @@ gnuradio_core_filter_la_swig_libadd = $(GNURADIO_CORE_LA) gnuradio_core_io_la_swig_libadd = $(GNURADIO_CORE_LA) gnuradio_core_hier_la_swig_libadd = $(GNURADIO_CORE_LA) - SWIG_GUILE_FLAGS += -DIN_GNURADIO_CORE diff --git a/gnuradio-core/src/python/bin/Makefile.am b/gnuradio-core/src/python/bin/Makefile.am index 0afd32767..6f9f162f1 100644 --- a/gnuradio-core/src/python/bin/Makefile.am +++ b/gnuradio-core/src/python/bin/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2005,2009 Free Software Foundation, Inc. +# Copyright 2005,2009,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -22,7 +22,7 @@ include $(top_srcdir)/Makefile.common -EXTRA_DIST = microtune.py +EXTRA_DIST += microtune.py noinst_SCRIPTS = \ microtune.py diff --git a/gnuradio-core/src/python/gnuradio/gr/Makefile.am b/gnuradio-core/src/python/gnuradio/gr/Makefile.am index 7d89777ef..b8da9cf48 100644 --- a/gnuradio-core/src/python/gnuradio/gr/Makefile.am +++ b/gnuradio-core/src/python/gnuradio/gr/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/Makefile.common -EXTRA_DIST = \ +EXTRA_DIST += \ run_tests.in \ test_16bit_1chunk.wav diff --git a/gnuradio-core/src/tests/Makefile.am b/gnuradio-core/src/tests/Makefile.am index 2bf7cb4e5..c75bb8c2a 100644 --- a/gnuradio-core/src/tests/Makefile.am +++ b/gnuradio-core/src/tests/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2001,2008 Free Software Foundation, Inc. +# Copyright 2001,2008,2010 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -31,7 +31,7 @@ TESTS = test_all # test_atsc #Test program to test setting up buffers using gr_test which can be run manually -EXTRA_DIST = \ +EXTRA_DIST += \ test_buffers.py \ benchmark_dotprod diff --git a/gnuradio-core/src/utils/Makefile.am b/gnuradio-core/src/utils/Makefile.am index 22dae7117..acf439140 100644 --- a/gnuradio-core/src/utils/Makefile.am +++ b/gnuradio-core/src/utils/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/Makefile.common -EXTRA_DIST = \ +EXTRA_DIST += \ cic_comp_taps.m \ db_width.m \ filter_tools.m \ -- cgit From 4dce044bcba406c69704baad7ff1a30a35a6d0e2 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 24 Nov 2010 19:18:11 -0800 Subject: Add conditionals around gnuradio-core/src/{guile,python} --- gnuradio-core/src/guile/Makefile.am | 6 +++++- gnuradio-core/src/python/Makefile.am | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index 209e664a0..4e12b646d 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -19,6 +19,8 @@ include $(top_srcdir)/Makefile.common +if GUILE + TESTS = run_guile_tests EXTRA_DIST += \ @@ -26,7 +28,7 @@ EXTRA_DIST += \ $(nobase_guile_DATA) \ $(GUILE_TESTS) -# These are the hand-code guile files for gnuradio-core. +# These are the hand-coded 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. @@ -52,3 +54,5 @@ GUILE_TESTS = \ tests/io_ctors.test CLEANFILES = guile.log + +endif diff --git a/gnuradio-core/src/python/Makefile.am b/gnuradio-core/src/python/Makefile.am index e50af8944..a90aaba5c 100644 --- a/gnuradio-core/src/python/Makefile.am +++ b/gnuradio-core/src/python/Makefile.am @@ -21,9 +21,10 @@ include $(top_srcdir)/Makefile.common +if PYTHON SUBDIRS = gnuradio bin noinst_PYTHON = \ build_utils.py \ build_utils_codes.py - +endif -- cgit From 37c2a3826eb876e8942d83991cd94284cc886903 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Mon, 29 Nov 2010 10:59:10 -0800 Subject: Add additional scripting language vector tests --- gnuradio-core/src/lib/general/complex_vec_test.cc | 45 +++++++++++++++++++++++ gnuradio-core/src/lib/general/complex_vec_test.h | 16 +++++++- gnuradio-core/src/lib/general/complex_vec_test.i | 17 ++++++++- 3 files changed, 74 insertions(+), 4 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/general/complex_vec_test.cc b/gnuradio-core/src/lib/general/complex_vec_test.cc index 21bca1765..df25c325e 100644 --- a/gnuradio-core/src/lib/general/complex_vec_test.cc +++ b/gnuradio-core/src/lib/general/complex_vec_test.cc @@ -35,3 +35,48 @@ complex_scalar_test1(std::complex input) return std::complex(input.real()+0.5, input.imag()-0.5); } + +std::vector +float_vec_test0() +{ + std::vector r(5); + + for (size_t i = 0; i < r.size(); i++) + r[i] = (float) i; + + return r; +} + +std::vector +float_vec_test1(const std::vector &input) +{ + std::vector r(input.size()); + + for (size_t i = 0; i < input.size(); i++) + r[i] = input[i] + 0.5; + + return r; +} + +std::vector +int_vec_test0() +{ + std::vector r(5); + + for (size_t i = 0; i < r.size(); i++) + r[i] = (int) i; + + return r; +} + +std::vector +int_vec_test1(const std::vector &input) +{ + std::vector r(input.size()); + + for (size_t i = 0; i < input.size(); i++) + r[i] = input[i] + 1; + + return r; +} + diff --git a/gnuradio-core/src/lib/general/complex_vec_test.h b/gnuradio-core/src/lib/general/complex_vec_test.h index f1a8a14e2..d13dedf63 100644 --- a/gnuradio-core/src/lib/general/complex_vec_test.h +++ b/gnuradio-core/src/lib/general/complex_vec_test.h @@ -1,10 +1,10 @@ #include #include -std::vector > +std::vector > complex_vec_test0(); -std::vector > +std::vector > complex_vec_test1(const std::vector > &input); std::complex @@ -13,3 +13,15 @@ complex_scalar_test0(); std::complex complex_scalar_test1(std::complex input); +std::vector +int_vec_test0(); + +std::vector +int_vec_test1(const std::vector &input); + +std::vector +float_vec_test0(); + +std::vector +float_vec_test1(const std::vector &input); + diff --git a/gnuradio-core/src/lib/general/complex_vec_test.i b/gnuradio-core/src/lib/general/complex_vec_test.i index 1c62cfda2..4b95633be 100644 --- a/gnuradio-core/src/lib/general/complex_vec_test.i +++ b/gnuradio-core/src/lib/general/complex_vec_test.i @@ -1,7 +1,8 @@ -std::vector > + +std::vector > complex_vec_test0(); -std::vector > +std::vector > complex_vec_test1(const std::vector > &input); std::complex @@ -10,3 +11,15 @@ complex_scalar_test0(); std::complex complex_scalar_test1(std::complex input); +std::vector +int_vec_test0(); + +std::vector +int_vec_test1(const std::vector &input); + +std::vector +float_vec_test0(); + +std::vector +float_vec_test1(const std::vector &input); + -- cgit From 9d91d36c7e509928705f093935024d08d2c019c8 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 2 Dec 2010 17:27:36 -0800 Subject: Move guts of gr-run-waveform into gnuradio/run-waveform.scm --- gnuradio-core/src/guile/Makefile.am | 1 + gnuradio-core/src/guile/gnuradio/run-waveform.scm | 53 +++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 gnuradio-core/src/guile/gnuradio/run-waveform.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index 4e12b646d..50d46411a 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -41,6 +41,7 @@ nobase_guile_DATA = \ gnuradio/export-safely.scm \ gnuradio/runtime-shim.scm \ gnuradio/waveform.scm \ + gnuradio/run-waveform.scm \ gnuradio/test-suite/guile-test \ gnuradio/test-suite/lib.scm diff --git a/gnuradio-core/src/guile/gnuradio/run-waveform.scm b/gnuradio-core/src/guile/gnuradio/run-waveform.scm new file mode 100644 index 000000000..3a2c4e6b7 --- /dev/null +++ b/gnuradio-core/src/guile/gnuradio/run-waveform.scm @@ -0,0 +1,53 @@ +;;; +;;; 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 . +;;; + +;;; Load and run a waveform defined with define-waveform + + +;; I don't seem to be able to make this work... +;; I think it's some kind of interaction with the syntax-case +;; macro, define-waveform, and the module system. +;; +;;(define-module (gnuradio run-waveform) +;; #:use-module (oop goops) +;; #:use-module (gnuradio core) +;; #:use-module (gnuradio waveform) +;; #:duplicates (merge-generics replace check)) + +(use-modules (oop goops) + (gnuradio core) + (gnuradio waveform)) + + +(define (load-into-module filename module) + (let ((f (open-file filename "r"))) + (let loop ((form (read f))) + (cond ((eof-object? form) #t) + (else (eval form module) + (loop (read f))))))) + + +(define-public (run-waveform waveform-filename . args) + (debug-enable 'backtrace 'debug) + (load waveform-filename) + ;;(load-into-module waveform-filename (current-module)) + (let ((f (waveform-last-registered))) + (if (not f) + (error "No define-waveform found in file \n" filename) + (gr:run (f args))))) -- cgit From cef9e8f38edb3f6aaea811fa04cfeebdbf26ba59 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 2 Dec 2010 21:21:41 -0800 Subject: Moved contents of gr-guile into gnuradio-core/src/guile and removed gr-guile. Passes distcheck. --- gnuradio-core/src/guile/Makefile.am | 4 +++ .../src/guile/example-waveforms/.gitignore | 6 ++++ .../src/guile/example-waveforms/Makefile.am | 28 +++++++++++++++ .../src/guile/example-waveforms/dial-tone.wfd | 40 ++++++++++++++++++++++ .../src/guile/gnuradio/scripts/gr-run-waveform.in | 40 ++++++++++++++++++++++ 5 files changed, 118 insertions(+) create mode 100644 gnuradio-core/src/guile/example-waveforms/.gitignore create mode 100644 gnuradio-core/src/guile/example-waveforms/Makefile.am create mode 100644 gnuradio-core/src/guile/example-waveforms/dial-tone.wfd create mode 100755 gnuradio-core/src/guile/gnuradio/scripts/gr-run-waveform.in (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index 50d46411a..447500b46 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -28,6 +28,9 @@ EXTRA_DIST += \ $(nobase_guile_DATA) \ $(GUILE_TESTS) + +SUBDIRS = example-waveforms + # These are the hand-coded guile files for gnuradio-core. # # Swig/common.scm is glue that's required for the goops wrappers. @@ -42,6 +45,7 @@ nobase_guile_DATA = \ 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 diff --git a/gnuradio-core/src/guile/example-waveforms/.gitignore b/gnuradio-core/src/guile/example-waveforms/.gitignore new file mode 100644 index 000000000..16c984055 --- /dev/null +++ b/gnuradio-core/src/guile/example-waveforms/.gitignore @@ -0,0 +1,6 @@ +/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 new file mode 100644 index 000000000..277b4ad0b --- /dev/null +++ b/gnuradio-core/src/guile/example-waveforms/Makefile.am @@ -0,0 +1,28 @@ +# +# 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 . +# + +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 new file mode 100644 index 000000000..ced3df572 --- /dev/null +++ b/gnuradio-core/src/guile/example-waveforms/dial-tone.wfd @@ -0,0 +1,40 @@ +;;; 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 . +;;; + +;;; 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/gr-run-waveform.in b/gnuradio-core/src/guile/gnuradio/scripts/gr-run-waveform.in new file mode 100755 index 000000000..8186d2e09 --- /dev/null +++ b/gnuradio-core/src/guile/gnuradio/scripts/gr-run-waveform.in @@ -0,0 +1,40 @@ +#!@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 . +;;; + +;;; 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: -- cgit From 9bc62cca21a0a171cbc220419af91b3d8f7e333b Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 3 Dec 2010 14:08:07 -0800 Subject: Add "shims" for booting (mostly) from magic file system --- gnuradio-core/src/guile/+boot+/ice-9/boot-9.scm | 27 +++++++++++++++++++++++++ gnuradio-core/src/guile/Makefile.am | 1 + 2 files changed, 28 insertions(+) create mode 100644 gnuradio-core/src/guile/+boot+/ice-9/boot-9.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/+boot+/ice-9/boot-9.scm b/gnuradio-core/src/guile/+boot+/ice-9/boot-9.scm new file mode 100644 index 000000000..4926c6f3c --- /dev/null +++ b/gnuradio-core/src/guile/+boot+/ice-9/boot-9.scm @@ -0,0 +1,27 @@ +;;; install shims for magic file system (if defined), then chain to real boot code. + +(if (defined? 'xyzzy-primitive-load) + (set! primitive-load xyzzy-primitive-load)) + +(if (defined? 'xyzzy-primitive-load-path) + (set! primitive-load-path xyzzy-primitive-load-path)) + +(if (defined? 'xyzzy-search-path) + (set! search-path xyzzy-search-path)) + +(if (defined? 'xyzzy-search-load-path) + (set! search-load-path xyzzy-search-load-path)) + +;; Remove any path containing /+boot+ from %load-path +(set! %load-path + (let ((new-path '())) + (let loop ((path %load-path)) + (cond ((not (pair? path)) + (reverse! new-path)) + ((string-contains (car path) "/+boot+") + (loop (cdr path))) + (else + (set! new-path (cons (car path) new-path)) + (loop (cdr path))))))) + +(primitive-load-path "ice-9/boot-9.scm") diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index 447500b46..cebef89f1 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -39,6 +39,7 @@ SUBDIRS = example-waveforms # gnuradio/runtime-shim implements "guile friendly" versions of connect & disconnect. nobase_guile_DATA = \ + +boot+/ice-9/boot-9.scm \ Swig/common.scm \ gnuradio/core.scm \ gnuradio/export-safely.scm \ -- cgit From c9597503e054b24ec79e6e379b2b56ffc369f3f3 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 3 Dec 2010 14:09:06 -0800 Subject: Try to get block destructors called (fairly) early --- gnuradio-core/src/guile/gnuradio/run-waveform.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/gnuradio/run-waveform.scm b/gnuradio-core/src/guile/gnuradio/run-waveform.scm index 3a2c4e6b7..01930521c 100644 --- a/gnuradio-core/src/guile/gnuradio/run-waveform.scm +++ b/gnuradio-core/src/guile/gnuradio/run-waveform.scm @@ -49,5 +49,7 @@ ;;(load-into-module waveform-filename (current-module)) (let ((f (waveform-last-registered))) (if (not f) - (error "No define-waveform found in file \n" filename) - (gr:run (f args))))) + (error "No define-waveform found in file \n" filename)) + (gr:run (f args)) + ;; Attempt to get block destructors called now. + (gc))) -- cgit From 63728823a570a305a18d462dae2d07ba77d520fd Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 3 Dec 2010 14:32:15 -0800 Subject: Revert "Add "shims" for booting (mostly) from magic file system" This reverts commit 9bc62cca21a0a171cbc220419af91b3d8f7e333b. This stragegy didn't work. Our new gsubrs have not yet be defined when the ice-9/boot-9.scm code is loaded. --- gnuradio-core/src/guile/+boot+/ice-9/boot-9.scm | 27 ------------------------- gnuradio-core/src/guile/Makefile.am | 1 - 2 files changed, 28 deletions(-) delete mode 100644 gnuradio-core/src/guile/+boot+/ice-9/boot-9.scm (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/+boot+/ice-9/boot-9.scm b/gnuradio-core/src/guile/+boot+/ice-9/boot-9.scm deleted file mode 100644 index 4926c6f3c..000000000 --- a/gnuradio-core/src/guile/+boot+/ice-9/boot-9.scm +++ /dev/null @@ -1,27 +0,0 @@ -;;; install shims for magic file system (if defined), then chain to real boot code. - -(if (defined? 'xyzzy-primitive-load) - (set! primitive-load xyzzy-primitive-load)) - -(if (defined? 'xyzzy-primitive-load-path) - (set! primitive-load-path xyzzy-primitive-load-path)) - -(if (defined? 'xyzzy-search-path) - (set! search-path xyzzy-search-path)) - -(if (defined? 'xyzzy-search-load-path) - (set! search-load-path xyzzy-search-load-path)) - -;; Remove any path containing /+boot+ from %load-path -(set! %load-path - (let ((new-path '())) - (let loop ((path %load-path)) - (cond ((not (pair? path)) - (reverse! new-path)) - ((string-contains (car path) "/+boot+") - (loop (cdr path))) - (else - (set! new-path (cons (car path) new-path)) - (loop (cdr path))))))) - -(primitive-load-path "ice-9/boot-9.scm") diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index cebef89f1..447500b46 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -39,7 +39,6 @@ SUBDIRS = example-waveforms # gnuradio/runtime-shim implements "guile friendly" versions of connect & disconnect. nobase_guile_DATA = \ - +boot+/ice-9/boot-9.scm \ Swig/common.scm \ gnuradio/core.scm \ gnuradio/export-safely.scm \ -- cgit From 4d16f8ac9e88babdcdf3dac3e5080d1bbf6fa1a7 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 3 Dec 2010 23:09:34 -0800 Subject: update .gitignore --- gnuradio-core/src/guile/gnuradio/scripts/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 gnuradio-core/src/guile/gnuradio/scripts/.gitignore (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/gnuradio/scripts/.gitignore b/gnuradio-core/src/guile/gnuradio/scripts/.gitignore new file mode 100644 index 000000000..64cbdbc0e --- /dev/null +++ b/gnuradio-core/src/guile/gnuradio/scripts/.gitignore @@ -0,0 +1 @@ +gr-run-waveform -- cgit From 0b5f66113f43d2ba94a1ca741b5ce65e1f9f2c02 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 3 Dec 2010 23:30:54 -0800 Subject: Rename libguile- to libguile-gnuradio- to match guile library naming convention. The stuff in gnuradio-core ends up with funky names, but that could be fixed by renaming gnuradio_core_filter.i -> core_filter.i etc. --- gnuradio-core/src/lib/swig/gnuradio_core_filter.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_general.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_gengen.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_hier.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_io.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_runtime.i | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_filter.i b/gnuradio-core/src/lib/swig/gnuradio_core_filter.i index 0acbfa3a6..d7262f140 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_filter.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_filter.i @@ -31,7 +31,7 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio_core_filter" "scm_init_gnuradio_gnuradio_core_filter_module") +(load-extension "libguile-gnuradio-gnuradio_core_filter" "scm_init_gnuradio_gnuradio_core_filter_module") %} %goops %{ diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_general.i b/gnuradio-core/src/lib/swig/gnuradio_core_general.i index 759a65459..e381f3509 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_general.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_general.i @@ -51,7 +51,7 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio_core_general" "scm_init_gnuradio_gnuradio_core_general_module") +(load-extension "libguile-gnuradio-gnuradio_core_general" "scm_init_gnuradio_gnuradio_core_general_module") %} %goops %{ diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i b/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i index c08109173..d9fe6672a 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i @@ -31,7 +31,7 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio_core_gengen" "scm_init_gnuradio_gnuradio_core_gengen_module") +(load-extension "libguile-gnuradio-gnuradio_core_gengen" "scm_init_gnuradio_gnuradio_core_gengen_module") %} %goops %{ diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_hier.i b/gnuradio-core/src/lib/swig/gnuradio_core_hier.i index 6d7a38321..2869fd56b 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_hier.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_hier.i @@ -31,7 +31,7 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio_core_hier" "scm_init_gnuradio_gnuradio_core_hier_module") +(load-extension "libguile-gnuradio-gnuradio_core_hier" "scm_init_gnuradio_gnuradio_core_hier_module") %} %goops %{ diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_io.i b/gnuradio-core/src/lib/swig/gnuradio_core_io.i index 936522ada..c8d818660 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_io.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_io.i @@ -31,7 +31,7 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio_core_io" "scm_init_gnuradio_gnuradio_core_io_module") +(load-extension "libguile-gnuradio-gnuradio_core_io" "scm_init_gnuradio_gnuradio_core_io_module") %} %goops %{ diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i b/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i index bb10b36b2..78b717d22 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i @@ -34,7 +34,7 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio_core_runtime" "scm_init_gnuradio_gnuradio_core_runtime_module") +(load-extension "libguile-gnuradio-gnuradio_core_runtime" "scm_init_gnuradio_gnuradio_core_runtime_module") %} %goops %{ -- cgit From 6df0423fe1880f5c33daa333604552ea68ac9593 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 3 Dec 2010 23:34:24 -0800 Subject: Regenerated Makefile.swig.gen's --- gnuradio-core/src/lib/swig/Makefile.swig.gen | 60 ++++++++++++++-------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/Makefile.swig.gen b/gnuradio-core/src/lib/swig/Makefile.swig.gen index 160fc8fd8..0c3247565 100644 --- a/gnuradio-core/src/lib/swig/Makefile.swig.gen +++ b/gnuradio-core/src/lib/swig/Makefile.swig.gen @@ -115,20 +115,20 @@ endif # end of if python if GUILE gnuradio_core_runtime_scmlib_LTLIBRARIES = \ - libguile-gnuradio_core_runtime.la -libguile_gnuradio_core_runtime_la_SOURCES = \ + libguile-gnuradio-gnuradio_core_runtime.la +libguile_gnuradio_gnuradio_core_runtime_la_SOURCES = \ guile/gnuradio_core_runtime.cc \ $(gnuradio_core_runtime_la_swig_sources) nobase_gnuradio_core_runtime_scm_DATA = \ gnuradio/gnuradio_core_runtime.scm \ gnuradio/gnuradio_core_runtime-primitive.scm -libguile_gnuradio_core_runtime_la_LIBADD = \ +libguile_gnuradio_gnuradio_core_runtime_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_runtime_la_swig_libadd) -libguile_gnuradio_core_runtime_la_LDFLAGS = \ +libguile_gnuradio_gnuradio_core_runtime_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_core_runtime_la_swig_ldflags) -libguile_gnuradio_core_runtime_la_CXXFLAGS = \ +libguile_gnuradio_gnuradio_core_runtime_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ $(gnuradio_core_runtime_la_swig_cxxflags) @@ -260,20 +260,20 @@ endif # end of if python if GUILE gnuradio_core_general_scmlib_LTLIBRARIES = \ - libguile-gnuradio_core_general.la -libguile_gnuradio_core_general_la_SOURCES = \ + libguile-gnuradio-gnuradio_core_general.la +libguile_gnuradio_gnuradio_core_general_la_SOURCES = \ guile/gnuradio_core_general.cc \ $(gnuradio_core_general_la_swig_sources) nobase_gnuradio_core_general_scm_DATA = \ gnuradio/gnuradio_core_general.scm \ gnuradio/gnuradio_core_general-primitive.scm -libguile_gnuradio_core_general_la_LIBADD = \ +libguile_gnuradio_gnuradio_core_general_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_general_la_swig_libadd) -libguile_gnuradio_core_general_la_LDFLAGS = \ +libguile_gnuradio_gnuradio_core_general_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_core_general_la_swig_ldflags) -libguile_gnuradio_core_general_la_CXXFLAGS = \ +libguile_gnuradio_gnuradio_core_general_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ $(gnuradio_core_general_la_swig_cxxflags) @@ -405,20 +405,20 @@ endif # end of if python if GUILE gnuradio_core_gengen_scmlib_LTLIBRARIES = \ - libguile-gnuradio_core_gengen.la -libguile_gnuradio_core_gengen_la_SOURCES = \ + libguile-gnuradio-gnuradio_core_gengen.la +libguile_gnuradio_gnuradio_core_gengen_la_SOURCES = \ guile/gnuradio_core_gengen.cc \ $(gnuradio_core_gengen_la_swig_sources) nobase_gnuradio_core_gengen_scm_DATA = \ gnuradio/gnuradio_core_gengen.scm \ gnuradio/gnuradio_core_gengen-primitive.scm -libguile_gnuradio_core_gengen_la_LIBADD = \ +libguile_gnuradio_gnuradio_core_gengen_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_gengen_la_swig_libadd) -libguile_gnuradio_core_gengen_la_LDFLAGS = \ +libguile_gnuradio_gnuradio_core_gengen_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_core_gengen_la_swig_ldflags) -libguile_gnuradio_core_gengen_la_CXXFLAGS = \ +libguile_gnuradio_gnuradio_core_gengen_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ $(gnuradio_core_gengen_la_swig_cxxflags) @@ -550,20 +550,20 @@ endif # end of if python if GUILE gnuradio_core_filter_scmlib_LTLIBRARIES = \ - libguile-gnuradio_core_filter.la -libguile_gnuradio_core_filter_la_SOURCES = \ + libguile-gnuradio-gnuradio_core_filter.la +libguile_gnuradio_gnuradio_core_filter_la_SOURCES = \ guile/gnuradio_core_filter.cc \ $(gnuradio_core_filter_la_swig_sources) nobase_gnuradio_core_filter_scm_DATA = \ gnuradio/gnuradio_core_filter.scm \ gnuradio/gnuradio_core_filter-primitive.scm -libguile_gnuradio_core_filter_la_LIBADD = \ +libguile_gnuradio_gnuradio_core_filter_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_filter_la_swig_libadd) -libguile_gnuradio_core_filter_la_LDFLAGS = \ +libguile_gnuradio_gnuradio_core_filter_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_core_filter_la_swig_ldflags) -libguile_gnuradio_core_filter_la_CXXFLAGS = \ +libguile_gnuradio_gnuradio_core_filter_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ $(gnuradio_core_filter_la_swig_cxxflags) @@ -695,20 +695,20 @@ endif # end of if python if GUILE gnuradio_core_io_scmlib_LTLIBRARIES = \ - libguile-gnuradio_core_io.la -libguile_gnuradio_core_io_la_SOURCES = \ + libguile-gnuradio-gnuradio_core_io.la +libguile_gnuradio_gnuradio_core_io_la_SOURCES = \ guile/gnuradio_core_io.cc \ $(gnuradio_core_io_la_swig_sources) nobase_gnuradio_core_io_scm_DATA = \ gnuradio/gnuradio_core_io.scm \ gnuradio/gnuradio_core_io-primitive.scm -libguile_gnuradio_core_io_la_LIBADD = \ +libguile_gnuradio_gnuradio_core_io_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_io_la_swig_libadd) -libguile_gnuradio_core_io_la_LDFLAGS = \ +libguile_gnuradio_gnuradio_core_io_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_core_io_la_swig_ldflags) -libguile_gnuradio_core_io_la_CXXFLAGS = \ +libguile_gnuradio_gnuradio_core_io_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ $(gnuradio_core_io_la_swig_cxxflags) @@ -840,20 +840,20 @@ endif # end of if python if GUILE gnuradio_core_hier_scmlib_LTLIBRARIES = \ - libguile-gnuradio_core_hier.la -libguile_gnuradio_core_hier_la_SOURCES = \ + libguile-gnuradio-gnuradio_core_hier.la +libguile_gnuradio_gnuradio_core_hier_la_SOURCES = \ guile/gnuradio_core_hier.cc \ $(gnuradio_core_hier_la_swig_sources) nobase_gnuradio_core_hier_scm_DATA = \ gnuradio/gnuradio_core_hier.scm \ gnuradio/gnuradio_core_hier-primitive.scm -libguile_gnuradio_core_hier_la_LIBADD = \ +libguile_gnuradio_gnuradio_core_hier_la_LIBADD = \ $(STD_SWIG_LA_LIB_ADD) \ $(gnuradio_core_hier_la_swig_libadd) -libguile_gnuradio_core_hier_la_LDFLAGS = \ +libguile_gnuradio_gnuradio_core_hier_la_LDFLAGS = \ $(STD_SWIG_LA_LD_FLAGS) \ $(gnuradio_core_hier_la_swig_ldflags) -libguile_gnuradio_core_hier_la_CXXFLAGS = \ +libguile_gnuradio_gnuradio_core_hier_la_CXXFLAGS = \ $(STD_SWIG_CXX_FLAGS) \ -I$(top_builddir) \ $(gnuradio_core_hier_la_swig_cxxflags) -- cgit From 9911a8d9edcde54b9a18810f37799a58a6895310 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Tue, 7 Dec 2010 13:35:54 -0800 Subject: Remove incorrect if PYTHON around swiginclude_HEADERS --- gnuradio-core/src/lib/filter/Makefile.am | 3 +-- gnuradio-core/src/lib/general/Makefile.am | 2 -- gnuradio-core/src/lib/gengen/Makefile.am | 2 -- gnuradio-core/src/lib/hier/Makefile.am | 2 -- gnuradio-core/src/lib/io/Makefile.am | 2 -- gnuradio-core/src/lib/runtime/Makefile.am | 2 -- 6 files changed, 1 insertion(+), 12 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/filter/Makefile.am b/gnuradio-core/src/lib/filter/Makefile.am index 38edee3d5..0a34cb5b5 100644 --- a/gnuradio-core/src/lib/filter/Makefile.am +++ b/gnuradio-core/src/lib/filter/Makefile.am @@ -345,7 +345,6 @@ noinst_HEADERS = \ qa_gri_fir_filter_with_buffer_scc.h -if PYTHON swiginclude_HEADERS = \ filter.i \ filter_generated.i \ @@ -369,7 +368,7 @@ swiginclude_HEADERS = \ gr_pfb_clock_sync_ccf.i \ gr_pfb_clock_sync_fff.i \ $(GENERATED_I) -endif + # Do creation and inclusion of other Makefiles last diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am index c6440506d..17623f0ba 100644 --- a/gnuradio-core/src/lib/general/Makefile.am +++ b/gnuradio-core/src/lib/general/Makefile.am @@ -365,7 +365,6 @@ noinst_HEADERS = \ sine_table.h \ qa_gr_math.h -if PYTHON swiginclude_HEADERS = \ complex_vec_test.i \ general.i \ @@ -497,4 +496,3 @@ swiginclude_HEADERS = \ gr_annotator_alltoall.i \ gr_annotator_1to1.i \ gr_burst_tagger.i -endif diff --git a/gnuradio-core/src/lib/gengen/Makefile.am b/gnuradio-core/src/lib/gengen/Makefile.am index cfa043b67..5fbb6f52c 100644 --- a/gnuradio-core/src/lib/gengen/Makefile.am +++ b/gnuradio-core/src/lib/gengen/Makefile.am @@ -135,13 +135,11 @@ grinclude_HEADERS = \ gr_noise_type.h \ gr_sig_source_waveform.h -if PYTHON swiginclude_HEADERS = \ $(GENERATED_I) \ gr_endianness.i \ gengen.i \ gengen_generated.i -endif # Do creation and inclusion of other Makefiles last diff --git a/gnuradio-core/src/lib/hier/Makefile.am b/gnuradio-core/src/lib/hier/Makefile.am index e2e7fe886..b525d19b4 100644 --- a/gnuradio-core/src/lib/hier/Makefile.am +++ b/gnuradio-core/src/lib/hier/Makefile.am @@ -32,8 +32,6 @@ libhier_la_SOURCES = \ grinclude_HEADERS = \ gr_channel_model.h -if PYTHON swiginclude_HEADERS = \ hier.i \ gr_channel_model.i -endif diff --git a/gnuradio-core/src/lib/io/Makefile.am b/gnuradio-core/src/lib/io/Makefile.am index 8ce740afd..442d5e3a9 100644 --- a/gnuradio-core/src/lib/io/Makefile.am +++ b/gnuradio-core/src/lib/io/Makefile.am @@ -93,7 +93,6 @@ grinclude_HEADERS = \ gri_wavfile.h \ gr_tagged_file_sink.h -if PYTHON swiginclude_HEADERS = \ io.i \ gr_file_sink.i \ @@ -115,4 +114,3 @@ swiginclude_HEADERS = \ gr_wavfile_source.i \ gr_wavfile_sink.i \ gr_tagged_file_sink.i -endif diff --git a/gnuradio-core/src/lib/runtime/Makefile.am b/gnuradio-core/src/lib/runtime/Makefile.am index dd9a8ea64..0fdb58aff 100644 --- a/gnuradio-core/src/lib/runtime/Makefile.am +++ b/gnuradio-core/src/lib/runtime/Makefile.am @@ -142,7 +142,6 @@ noinst_HEADERS = \ qa_block_tags.h \ qa_runtime.h -if PYTHON swiginclude_HEADERS = \ gr_basic_block.i \ gr_block.i \ @@ -162,4 +161,3 @@ swiginclude_HEADERS = \ gr_sync_interpolator.i \ gr_top_block.i \ runtime.i -endif -- cgit From c6d4c7d5b410d066e55a31c787476a9ac96b1277 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Tue, 7 Dec 2010 15:54:27 -0800 Subject: Moved out-of-tree includes out of gnuradio_core_INCLUDES to ensure that in-tree includes are searched before out-of-tree includes. --- gnuradio-core/src/lib/filter/Makefile.am | 4 +++- gnuradio-core/src/lib/general/Makefile.am | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/filter/Makefile.am b/gnuradio-core/src/lib/filter/Makefile.am index 0a34cb5b5..bf97d6cdc 100644 --- a/gnuradio-core/src/lib/filter/Makefile.am +++ b/gnuradio-core/src/lib/filter/Makefile.am @@ -26,7 +26,9 @@ include $(top_srcdir)/Makefile.common # other performance critical items # -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES) +# $(WITH_INCLUDES) must _always_ be last +AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) \ + $(FFTW3F_CPPFLAGS) $(WITH_INCLUDES) noinst_LTLIBRARIES = libfilter.la libfilter-qa.la diff --git a/gnuradio-core/src/lib/general/Makefile.am b/gnuradio-core/src/lib/general/Makefile.am index 17623f0ba..08610c58a 100644 --- a/gnuradio-core/src/lib/general/Makefile.am +++ b/gnuradio-core/src/lib/general/Makefile.am @@ -21,7 +21,9 @@ include $(top_srcdir)/Makefile.common -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) $(WITH_INCLUDES) +# $(WITH_INCLUDES) must _always_ be last +AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(CPPUNIT_INCLUDES) \ + $(FFTW3F_CPPFLAGS) $(GSL_CPPFLAGS) $(WITH_INCLUDES) noinst_LTLIBRARIES = libgeneral.la libgeneral-qa.la -- cgit From 74cbbd74dec5a1b976b5db028fe3aa4e20a899e3 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 9 Dec 2010 20:49:29 -0800 Subject: Disable guile udp tests. They were causing a problem on some systems. --- gnuradio-core/src/guile/tests/io_ctors.test | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/io_ctors.test b/gnuradio-core/src/guile/tests/io_ctors.test index 1c5c9a771..5f40d321c 100644 --- a/gnuradio-core/src/guile/tests/io_ctors.test +++ b/gnuradio-core/src/guile/tests/io_ctors.test @@ -64,14 +64,14 @@ (pass-if (true? (gr:oscope-sink-f 1000 (gr:msg-queue)))) ;;; ./io/gr_udp_sink.h -(pass-if (true? (gr:udp-sink 4 "localhost" 80 1472 #f))) -(pass-if-throw "confirm throw gr:udp-sink" #t - (true? (gr:udp-sink 4 "localhostx" 80 1472 #f))) +;;(pass-if (true? (gr:udp-sink 4 "localhost" 80 1472 #f))) +;;(pass-if-throw "confirm throw gr:udp-sink" #t +;; (true? (gr:udp-sink 4 "localhostx" 80 1472 #f))) ;;; ./io/gr_udp_source.h -(pass-if (true? (gr:udp-source 4 "localhost" 0 1472 #f #t))) -(pass-if-throw "confirm throw gr:udp-sink" #t - (true? (gr:udp-source 4 "localhostx" 0 1472 #f #t))) +;;(pass-if (true? (gr:udp-source 4 "localhost" 0 1472 #f #t))) +;;(pass-if-throw "confirm throw gr:udp-source" #t +;; (true? (gr:udp-source 4 "localhostx" 0 1472 #f #t))) ;;; ./io/gr_wavfile_sink.h (pass-if (true? (gr:wavfile-sink "foo" 2 48000 16))) -- cgit From 67c77e22564fbd9cf4543ff939495b3259b3818c Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 10 Dec 2010 16:12:04 -0800 Subject: Add new Guile gsubr that loads shared libraries using the equivalent of the RTLD_GLOBAL flag. This is part of a work-around for swig bug: 1863647 http://sourceforge.net/tracker/index.php?func=detail&aid=1863647&group_id=1645&atid=101645 --- gnuradio-core/src/guile/Makefile.am | 10 ++++ gnuradio-core/src/guile/dynl-global.c | 92 +++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 gnuradio-core/src/guile/dynl-global.c (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index 447500b46..b78225f4d 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -60,4 +60,14 @@ GUILE_TESTS = \ CLEANFILES = guile.log + +scmlibdir = $(libdir) +scmdir = $(guiledir) + +scmlib_LTLIBRARIES = libguile-gnuradio-dynl-global.la + +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) + endif diff --git a/gnuradio-core/src/guile/dynl-global.c b/gnuradio-core/src/guile/dynl-global.c new file mode 100644 index 000000000..1fc3a97a5 --- /dev/null +++ b/gnuradio-core/src/guile/dynl-global.c @@ -0,0 +1,92 @@ +/* -*- c -*- */ +/* + * 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 . + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +extern scm_t_bits scm_tc16_dynamic_obj; + +static lt_dlhandle +dlopenext_global (const char *filename) +{ + lt_dlhandle handle = 0; + lt_dladvise advise; + + if (!lt_dladvise_init (&advise) + && !lt_dladvise_ext (&advise) + && !lt_dladvise_global(&advise)) + handle = lt_dlopenadvise (filename, advise); + + lt_dladvise_destroy (&advise); + return handle; +} + + +static void * +sysdep_dynl_link_global (const char *fname, const char *subr) +{ + lt_dlhandle handle; + handle = dlopenext_global (fname); + if (NULL == handle) + { + SCM fn; + SCM msg; + + fn = scm_from_locale_string (fname); + msg = scm_from_locale_string (lt_dlerror ()); + scm_misc_error (subr, "file: ~S, message: ~S", scm_list_2 (fn, msg)); + } + return (void *) handle; +} + +SCM_DEFINE (scm_dynamic_link_global, "dynamic-link-global", 1, 0, 0, + (SCM filename), + "Find the shared object (shared library) denoted by\n" + "@var{filename} and link it into the running Guile\n" + "application. The returned\n" + "scheme object is a ``handle'' for the library which can\n" + "be passed to @code{dynamic-func}, @code{dynamic-call} etc.\n\n" + "Searching for object files is system dependent. Normally,\n" + "if @var{filename} does have an explicit directory it will\n" + "be searched for in locations\n" + "such as @file{/usr/lib} and @file{/usr/local/lib}.") +#define FUNC_NAME s_scm_dynamic_link_global +{ + void *handle; + char *file; + + scm_dynwind_begin (0); + file = scm_to_locale_string (filename); + scm_dynwind_free (file); + handle = sysdep_dynl_link_global (file, FUNC_NAME); + scm_dynwind_end (); + SCM_RETURN_NEWSMOB2 (scm_tc16_dynamic_obj, SCM_UNPACK (filename), handle); +} +#undef FUNC_NAME + +void +scm_init_gnuradio_dynl_global_module(void) +{ + scm_c_define_gsubr (s_scm_dynamic_link_global, 1, 0, 0, (SCM (*)()) scm_dynamic_link_global); +} -- cgit From 08907ee94fb6c34531d57b988324c67c26c8b747 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Fri, 10 Dec 2010 16:15:40 -0800 Subject: Use load-extension-global instead of load-extension --- gnuradio-core/src/lib/swig/gnuradio_core_filter.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_general.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_gengen.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_hier.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_io.i | 2 +- gnuradio-core/src/lib/swig/gnuradio_core_runtime.i | 13 ++++++++++++- 6 files changed, 17 insertions(+), 6 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_filter.i b/gnuradio-core/src/lib/swig/gnuradio_core_filter.i index d7262f140..e825467db 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_filter.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_filter.i @@ -31,7 +31,7 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio-gnuradio_core_filter" "scm_init_gnuradio_gnuradio_core_filter_module") +(load-extension-global "libguile-gnuradio-gnuradio_core_filter" "scm_init_gnuradio_gnuradio_core_filter_module") %} %goops %{ diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_general.i b/gnuradio-core/src/lib/swig/gnuradio_core_general.i index e381f3509..adf6b469a 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_general.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_general.i @@ -51,7 +51,7 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio-gnuradio_core_general" "scm_init_gnuradio_gnuradio_core_general_module") +(load-extension-global "libguile-gnuradio-gnuradio_core_general" "scm_init_gnuradio_gnuradio_core_general_module") %} %goops %{ diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i b/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i index d9fe6672a..496ced077 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_gengen.i @@ -31,7 +31,7 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio-gnuradio_core_gengen" "scm_init_gnuradio_gnuradio_core_gengen_module") +(load-extension-global "libguile-gnuradio-gnuradio_core_gengen" "scm_init_gnuradio_gnuradio_core_gengen_module") %} %goops %{ diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_hier.i b/gnuradio-core/src/lib/swig/gnuradio_core_hier.i index 2869fd56b..0b8161c5d 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_hier.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_hier.i @@ -31,7 +31,7 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio-gnuradio_core_hier" "scm_init_gnuradio_gnuradio_core_hier_module") +(load-extension-global "libguile-gnuradio-gnuradio_core_hier" "scm_init_gnuradio_gnuradio_core_hier_module") %} %goops %{ diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_io.i b/gnuradio-core/src/lib/swig/gnuradio_core_io.i index c8d818660..0d989ea87 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_io.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_io.i @@ -31,7 +31,7 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio-gnuradio_core_io" "scm_init_gnuradio_gnuradio_core_io_module") +(load-extension-global "libguile-gnuradio-gnuradio_core_io" "scm_init_gnuradio_gnuradio_core_io_module") %} %goops %{ diff --git a/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i b/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i index 78b717d22..579c51ce5 100644 --- a/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i +++ b/gnuradio-core/src/lib/swig/gnuradio_core_runtime.i @@ -34,7 +34,18 @@ #if SWIGGUILE %scheme %{ -(load-extension "libguile-gnuradio-gnuradio_core_runtime" "scm_init_gnuradio_gnuradio_core_runtime_module") + +;; Load our gsubr that loads libraries using the RTLD_GLOBAL option +(load-extension "libguile-gnuradio-dynl-global" "scm_init_gnuradio_dynl_global_module") + +;; Define load-extension-global in module '(guile) +(module-define! (resolve-module '(guile)) + 'load-extension-global + (lambda (lib init) + (dynamic-call init (dynamic-link-global lib)))) + +;; Use load-extension-global to load our swig modules +(load-extension-global "libguile-gnuradio-gnuradio_core_runtime" "scm_init_gnuradio_gnuradio_core_runtime_module") %} %goops %{ -- cgit From 199b77a7b0cc48215a2acf1b317bce81a62e39f7 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 12 Dec 2010 13:22:40 -0500 Subject: PFB resampler: fixes bug where filter could be looking past the number of inputs. --- gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc index 59b76a6f0..00c2dab0c 100644 --- a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc +++ b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc @@ -179,7 +179,7 @@ gr_pfb_arb_resampler_ccf::general_work (int noutput_items, j = d_last_filter; // produce output as long as we can and there are enough input samples - while((i < noutput_items) && (count < ninput_items[0]-1)) { + while((i < noutput_items) && (count < ninput_items[0]-d_taps_per_filter)) { // start j by wrapping around mod the number of channels while((j < d_int_rate) && (i < noutput_items)) { -- cgit From 1a3e498933844e995e91e71b932b9e0bf8e2cc3f Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 12 Dec 2010 13:39:06 -0500 Subject: PFB resampler: fix it this way to avoid the signed/unsigned warning. --- gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc index 00c2dab0c..84b0c578f 100644 --- a/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc +++ b/gnuradio-core/src/lib/filter/gr_pfb_arb_resampler_ccf.cc @@ -179,7 +179,8 @@ gr_pfb_arb_resampler_ccf::general_work (int noutput_items, j = d_last_filter; // produce output as long as we can and there are enough input samples - while((i < noutput_items) && (count < ninput_items[0]-d_taps_per_filter)) { + int max_input = ninput_items[0]-(int)d_taps_per_filter; + while((i < noutput_items) && (count < max_input)) { // start j by wrapping around mod the number of channels while((j < d_int_rate) && (i < noutput_items)) { -- cgit From 272971a25cbd777634331a8777d2fbab2bb10ab7 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 22 Dec 2010 16:49:05 -0800 Subject: Check for lt_dladvise_global and fall back to using lt_dlopenext if not found. --- gnuradio-core/src/guile/dynl-global.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/dynl-global.c b/gnuradio-core/src/guile/dynl-global.c index 1fc3a97a5..3bf2741b1 100644 --- a/gnuradio-core/src/guile/dynl-global.c +++ b/gnuradio-core/src/guile/dynl-global.c @@ -18,6 +18,21 @@ * along with this program. If not, see . */ +/* + * This file is an attempt to work around a problem that appears on + * certain Ubuntu (and perhaps other) systems. On those systems + * (10.04 is known to have the problem, while 10.10 and later work OK + * without this kludge), we end up with a situation where exceptions + * are not caught by the swig code, even though the swig generated + * code "looks right" and "is right". Details of the issue can be + * found in swig bug 1863647, + * http://sourceforge.net/tracker/index.php?func=detail&aid=1863647&group_id=1645&atid=101645 + * + * We work around the problem by loading swig generated guile modules + * using the equivalent of the dlopen's RTLD_GLOBAL flag. This is + * only possible on systems using libtool-2.*. Those systems contain + * the lt_dlavise_global function. + */ #ifdef HAVE_CONFIG_H #include #endif @@ -27,6 +42,10 @@ extern scm_t_bits scm_tc16_dynamic_obj; +#ifdef HAVE_LT_DLADVISE_GLOBAL +/* + * Load shared module using the equivalent of the RTLD_GLOBAL flag + */ static lt_dlhandle dlopenext_global (const char *filename) { @@ -42,6 +61,18 @@ dlopenext_global (const char *filename) return handle; } +#else + +/* + * We don't have lt_dladvise_global. Fall back to lt_dlopenext. + */ +static lt_dlhandle +dlopenext_global (const char *filename) +{ + return lt_dlopenext (filename); +} +#endif + static void * sysdep_dynl_link_global (const char *fname, const char *subr) -- cgit From 9fe81031520463dfe46a890fc9d039d44929a43a Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 23 Dec 2010 11:00:58 -0800 Subject: Add test to see if Guile was built with threads enabled --- gnuradio-core/src/guile/tests/00_runtime_basics.test | 1 + 1 file changed, 1 insertion(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/tests/00_runtime_basics.test b/gnuradio-core/src/guile/tests/00_runtime_basics.test index 18b298f22..4a5d967a1 100644 --- a/gnuradio-core/src/guile/tests/00_runtime_basics.test +++ b/gnuradio-core/src/guile/tests/00_runtime_basics.test @@ -32,6 +32,7 @@ (define (vector-map f v) (list->vector (map f (vector->list v)))) +(pass-if "Guile was built with threads" (not (not (memq 'threads *features*)))) (with-test-prefix "connect-1" (let* ((src-data #(-5 -4 -3 -2 -1 0 1 2 3 4 5)) -- cgit From 153de8c41caa9c478bec2f10b8a1167952809eed Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Thu, 23 Dec 2010 18:31:28 -0500 Subject: Modifying the unittest output. XML files are no longer written outside of the build tree. --- gnuradio-core/src/lib/runtime/gr_unittests.h | 9 ++---- gnuradio-core/src/python/gnuradio/gr_unittest.py | 37 ++++++++++++------------ 2 files changed, 22 insertions(+), 24 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_unittests.h b/gnuradio-core/src/lib/runtime/gr_unittests.h index 680e59ca4..70aa6f294 100644 --- a/gnuradio-core/src/lib/runtime/gr_unittests.h +++ b/gnuradio-core/src/lib/runtime/gr_unittests.h @@ -45,14 +45,13 @@ */ static void -ensure_unittest_path (const char *grpath, const char *path) +ensure_unittest_path (const char *path) { struct stat statbuf; if (stat (path, &statbuf) == 0 && S_ISDIR (statbuf.st_mode)) return; // blindly try to make it // FIXME make this robust. C++ SUCKS! - gr_mkdir (grpath, 0750); gr_mkdir (path, 0750); } @@ -60,11 +59,9 @@ static void get_unittest_path (const char *filename, char *fullpath, size_t pathsize) { char path[200]; - char grpath[200]; - snprintf (grpath, sizeof(grpath), "%s/.gnuradio", getenv ("HOME")); - snprintf (path, sizeof(path), "%s/unittests", grpath); + snprintf (path, sizeof(path), "./.unittests"); snprintf (fullpath, pathsize, "%s/%s", path, filename); - ensure_unittest_path(grpath, path); + ensure_unittest_path(path); } diff --git a/gnuradio-core/src/python/gnuradio/gr_unittest.py b/gnuradio-core/src/python/gnuradio/gr_unittest.py index 50d484a76..c2c4df2ba 100755 --- a/gnuradio-core/src/python/gnuradio/gr_unittest.py +++ b/gnuradio-core/src/python/gnuradio/gr_unittest.py @@ -38,7 +38,7 @@ class TestCase(unittest.TestCase): Note that decimal places (from zero) is usually not the same as significant digits (measured from the most signficant digit). - """ + """ if round(second.real-first.real, places) != 0: raise self.failureException, \ (msg or '%s != %s within %s places' % (`first`, `second`, `places` )) @@ -112,30 +112,31 @@ def run(PUT, filename=None): Runs the unittest on a TestCase and produces an optional XML report PUT: the program under test and should be a gr_unittest.TestCase filename: an optional filename to save the XML report of the tests - this will live in $HOME/.gnuradio/unittests/python + this will live in ./.unittests/python ''' # Run this is given a file name if(filename is not None): - homepath = os.getenv("HOME") - basepath = homepath + "/.gnuradio" - path = homepath + "/.gnuradio/unittests/python" + basepath = "./.unittests" + path = basepath + "/python" + + if not os.path.exists(basepath): + os.makedirs(basepath, 0750) xmlrunner = None - if os.path.exists(basepath): - # only proceed if $HOME/.gnuradio is writable - st = os.stat(basepath)[stat.ST_MODE] + # only proceed if .unittests is writable + st = os.stat(basepath)[stat.ST_MODE] + if(st & stat.S_IWUSR > 0): + # Test if path exists; if not, build it + if not os.path.exists(path): + os.makedirs(path, 0750) + + # Just for safety: make sure we can write here, too + st = os.stat(path)[stat.ST_MODE] if(st & stat.S_IWUSR > 0): - # Test if path exists; if not, build it - if not os.path.exists(path): - os.makedirs(path, 0750) - - # Just for safety: make sure we can write here, too - st = os.stat(path)[stat.ST_MODE] - if(st & stat.S_IWUSR > 0): - # Create an XML runner to filename - fout = file(path+"/"+filename, "w") - xmlrunner = gr_xmlrunner.XMLTestRunner(fout) + # Create an XML runner to filename + fout = file(path+"/"+filename, "w") + xmlrunner = gr_xmlrunner.XMLTestRunner(fout) txtrunner = TextTestRunner(verbosity=1) -- cgit From ae03fd9ae853055548be3e2c0ff5754828142c2a Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 28 Dec 2010 12:47:32 -0500 Subject: Updating the arb. resampler to use the optfir filter that provides better specificatiion of stopband atten. --- .../python/gnuradio/blks2impl/pfb_arb_resampler.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py index cd9289fa5..c4e496c45 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py @@ -20,7 +20,7 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr +from gnuradio import gr, optfir class pfb_arb_resampler_ccf(gr.hier_block2): ''' @@ -31,7 +31,7 @@ class pfb_arb_resampler_ccf(gr.hier_block2): streams. This block is provided to be consistent with the interface to the other PFB block. ''' - def __init__(self, rate, taps=None, flt_size=32, atten=80): + def __init__(self, rate, taps=None, flt_size=32, atten=100): gr.hier_block2.__init__(self, "pfb_arb_resampler_ccf", gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature @@ -43,9 +43,19 @@ class pfb_arb_resampler_ccf(gr.hier_block2): self._taps = taps else: # Create a filter that covers the full bandwidth of the input signal - bw = 0.5 - tb = 0.1 - self._taps = gr.firdes.low_pass_2(self._size, self._size, bw, tb, atten) + bw = 0.4 + tb = 0.2 + ripple = 0.1 + #self._taps = gr.firdes.low_pass_2(self._size, self._size, bw, tb, atten) + made = False + while not made: + try: + self._taps = optfir.low_pass(self._size, self._size, bw, bw+tb, ripple, atten) + made = True + except RuntimeError: + ripple += 0.01 + made = False + print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple)) self.pfb = gr.pfb_arb_resampler_ccf(self._rate, self._taps, self._size) -- cgit From 3751671d1b596113e441ca326280bdcc94fdcc6f Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 28 Dec 2010 12:48:18 -0500 Subject: PFB channelizer can be specified without external taps. Uses optfir to generate an internal filter to cover the channel bandwidth; user can specify the attenuation of this filter if desired. --- .../python/gnuradio/blks2impl/pfb_channelizer.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py index a479ed48e..ecbdd2047 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py @@ -20,7 +20,7 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr +from gnuradio import gr, optfir class pfb_channelizer_ccf(gr.hier_block2): ''' @@ -29,15 +29,31 @@ class pfb_channelizer_ccf(gr.hier_block2): This simplifies the interface by allowing a single input stream to connect to this block. It will then output a stream for each channel. ''' - def __init__(self, numchans, taps, oversample_rate=1): + def __init__(self, numchans, taps=None, oversample_rate=1, atten=100): gr.hier_block2.__init__(self, "pfb_channelizer_ccf", gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature gr.io_signature(numchans, numchans, gr.sizeof_gr_complex)) # Output signature self._numchans = numchans - self._taps = taps self._oversample_rate = oversample_rate + if taps is not None: + self._taps = taps + else: + # Create a filter that covers the full bandwidth of the input signal + bw = 0.4 + tb = 0.2 + ripple = 0.1 + made = False + while not made: + try: + self._taps = optfir.low_pass(1, self._numchans, bw, bw+tb, ripple, atten) + made = True + except RuntimeError: + ripple += 0.01 + made = False + print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple)) + self.s2ss = gr.stream_to_streams(gr.sizeof_gr_complex, self._numchans) self.pfb = gr.pfb_channelizer_ccf(self._numchans, self._taps, self._oversample_rate) -- cgit From 47c11429a1f2afa2d46419d3fedff60403e4ea12 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 28 Dec 2010 12:55:43 -0500 Subject: Allowing PFB decimator to be called without specifying the taps; autogen taps inside hierblock. --- .../src/python/gnuradio/blks2impl/pfb_decimator.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py index 176d0473e..103980da0 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py @@ -20,7 +20,7 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr +from gnuradio import gr, optfir class pfb_decimator_ccf(gr.hier_block2): ''' @@ -29,15 +29,31 @@ class pfb_decimator_ccf(gr.hier_block2): This simplifies the interface by allowing a single input stream to connect to this block. It will then output a stream that is the decimated output stream. ''' - def __init__(self, decim, taps, channel=0): + def __init__(self, decim, taps=None, channel=0, atten=100): gr.hier_block2.__init__(self, "pfb_decimator_ccf", gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature self._decim = decim - self._taps = taps self._channel = channel + if taps is not None: + self._taps = taps + else: + # Create a filter that covers the full bandwidth of the input signal + bw = 0.4 + tb = 0.2 + ripple = 0.1 + made = False + while not made: + try: + self._taps = optfir.low_pass(1, self._decim, bw, bw+tb, ripple, atten) + made = True + except RuntimeError: + ripple += 0.01 + made = False + print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple)) + self.s2ss = gr.stream_to_streams(gr.sizeof_gr_complex, self._decim) self.pfb = gr.pfb_decimator_ccf(self._decim, self._taps, self._channel) -- cgit From 3f32342fc5c82d53e7c94afbccb01d38280db733 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 28 Dec 2010 13:00:56 -0500 Subject: Allowing PFB interpolator to be called without specifying the taps; autogen taps inside hierblock. --- .../python/gnuradio/blks2impl/pfb_interpolator.py | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.py index db2944042..a210e3de8 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.py @@ -20,7 +20,7 @@ # Boston, MA 02110-1301, USA. # -from gnuradio import gr +from gnuradio import gr, optfir class pfb_interpolator_ccf(gr.hier_block2): ''' @@ -31,7 +31,7 @@ class pfb_interpolator_ccf(gr.hier_block2): streams. This block is provided to be consistent with the interface to the other PFB block. ''' - def __init__(self, interp, taps): + def __init__(self, interp, taps=None, atten=100): gr.hier_block2.__init__(self, "pfb_interpolator_ccf", gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature gr.io_signature(1, 1, gr.sizeof_gr_complex)) # Output signature @@ -39,6 +39,23 @@ class pfb_interpolator_ccf(gr.hier_block2): self._interp = interp self._taps = taps + if taps is not None: + self._taps = taps + else: + # Create a filter that covers the full bandwidth of the input signal + bw = 0.4 + tb = 0.2 + ripple = 0.1 + made = False + while not made: + try: + self._taps = optfir.low_pass(self._interp, self._interp, bw, bw+tb, ripple, atten) + made = True + except RuntimeError: + ripple += 0.01 + made = False + print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple)) + self.pfb = gr.pfb_interpolator_ccf(self._interp, self._taps) self.connect(self, self.pfb) -- cgit From 2fa7c997559e173c59227ee14a154e4b462d46bd Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 28 Dec 2010 13:08:55 -0500 Subject: Under extreme circumstances, optfir might never produce an answer (atten>300), so this puts in a check on the ripple; if it gets too large, stop trying. --- gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py | 4 ++++ gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py | 4 ++++ gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py | 4 ++++ gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.py | 6 +++++- 4 files changed, 17 insertions(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py index c4e496c45..5e4e06871 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_arb_resampler.py @@ -57,6 +57,10 @@ class pfb_arb_resampler_ccf(gr.hier_block2): made = False print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple)) + # Build in an exit strategy; if we've come this far, it ain't working. + if(ripple >= 1.0): + raise RuntimeError("optfir could not generate an appropriate filter.") + self.pfb = gr.pfb_arb_resampler_ccf(self._rate, self._taps, self._size) self.connect(self, self.pfb) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py index ecbdd2047..3ddc1749a 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_channelizer.py @@ -54,6 +54,10 @@ class pfb_channelizer_ccf(gr.hier_block2): made = False print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple)) + # Build in an exit strategy; if we've come this far, it ain't working. + if(ripple >= 1.0): + raise RuntimeError("optfir could not generate an appropriate filter.") + self.s2ss = gr.stream_to_streams(gr.sizeof_gr_complex, self._numchans) self.pfb = gr.pfb_channelizer_ccf(self._numchans, self._taps, self._oversample_rate) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py index 103980da0..2e36e7bc1 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_decimator.py @@ -54,6 +54,10 @@ class pfb_decimator_ccf(gr.hier_block2): made = False print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple)) + # Build in an exit strategy; if we've come this far, it ain't working. + if(ripple >= 1.0): + raise RuntimeError("optfir could not generate an appropriate filter.") + self.s2ss = gr.stream_to_streams(gr.sizeof_gr_complex, self._decim) self.pfb = gr.pfb_decimator_ccf(self._decim, self._taps, self._channel) diff --git a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.py b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.py index a210e3de8..a6094f7f4 100644 --- a/gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.py +++ b/gnuradio-core/src/python/gnuradio/blks2impl/pfb_interpolator.py @@ -45,7 +45,7 @@ class pfb_interpolator_ccf(gr.hier_block2): # Create a filter that covers the full bandwidth of the input signal bw = 0.4 tb = 0.2 - ripple = 0.1 + ripple = 0.99 made = False while not made: try: @@ -56,6 +56,10 @@ class pfb_interpolator_ccf(gr.hier_block2): made = False print("Warning: set ripple to %.4f dB. If this is a problem, adjust the attenuation or create your own filter taps." % (ripple)) + # Build in an exit strategy; if we've come this far, it ain't working. + if(ripple >= 1.0): + raise RuntimeError("optfir could not generate an appropriate filter.") + self.pfb = gr.pfb_interpolator_ccf(self._interp, self._taps) self.connect(self, self.pfb) -- cgit From 16416305bf6dc7879b81c6b86568a5597d8d5ab0 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 30 Dec 2010 13:50:11 -0800 Subject: Create and install gr-run-waveform-script, and symlink to it when installed. --- gnuradio-core/src/guile/Makefile.am | 12 ++++- .../src/guile/gnuradio/scripts/.gitignore | 1 - .../src/guile/gnuradio/scripts/gr-run-waveform.in | 40 ----------------- gnuradio-core/src/guile/gr-run-waveform-script.in | 51 ++++++++++++++++++++++ 4 files changed, 61 insertions(+), 43 deletions(-) delete mode 100644 gnuradio-core/src/guile/gnuradio/scripts/.gitignore delete mode 100755 gnuradio-core/src/guile/gnuradio/scripts/gr-run-waveform.in create mode 100644 gnuradio-core/src/guile/gr-run-waveform-script.in (limited to 'gnuradio-core') 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 . -;;; - -;;; 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 +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))) -- cgit From 9739742f0b90968a8aaf0f5c2e24f9bbadda5e80 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 30 Dec 2010 14:10:00 -0800 Subject: Move example waveforms to gnuradio-examples/waveforms. --- .../src/guile/example-waveforms/.gitignore | 6 ---- .../src/guile/example-waveforms/Makefile.am | 28 --------------- .../src/guile/example-waveforms/dial-tone.wfd | 40 ---------------------- 3 files changed, 74 deletions(-) delete mode 100644 gnuradio-core/src/guile/example-waveforms/.gitignore delete mode 100644 gnuradio-core/src/guile/example-waveforms/Makefile.am delete mode 100644 gnuradio-core/src/guile/example-waveforms/dial-tone.wfd (limited to 'gnuradio-core') 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 . -# - -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 . -;;; - -;;; 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 -- cgit From 66768f6ec30edbc2cf481e16b92a387b483dde6c Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 30 Dec 2010 15:23:59 -0800 Subject: Create symlink using install-exec-local, not install-exec-hook. Also rm the symlink using uninstall-local. Passes distcheck. --- gnuradio-core/src/guile/Makefile.am | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/guile/Makefile.am b/gnuradio-core/src/guile/Makefile.am index a74037ae7..122f05d97 100644 --- a/gnuradio-core/src/guile/Makefile.am +++ b/gnuradio-core/src/guile/Makefile.am @@ -28,10 +28,6 @@ EXTRA_DIST += \ $(nobase_guile_DATA) \ $(GUILE_TESTS) - -SUBDIRS = example-waveforms - - bin_SCRIPTS = \ gr-run-waveform-script @@ -74,8 +70,11 @@ 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) +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 -- cgit From 9c07c99147955574354d9d2a36c18f7aa8988130 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 2 Jan 2011 11:29:38 -0500 Subject: Fixing a comment. --- gnuradio-core/src/lib/runtime/gr_block_executor.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_block_executor.cc b/gnuradio-core/src/lib/runtime/gr_block_executor.cc index 112150235..a8d0bc1c8 100644 --- a/gnuradio-core/src/lib/runtime/gr_block_executor.cc +++ b/gnuradio-core/src/lib/runtime/gr_block_executor.cc @@ -93,8 +93,7 @@ propagate_tags(gr_block::tag_propagation_policy_t policy, gr_block_detail *d, std::vector &rtags) { // Move tags downstream - // if a sink, we don't need to move downstream; - // and do not bother if block uses TAGS_NONE attribute + // if a sink, we don't need to move downstream if(d->sink_p()) { return true; } -- cgit From c11a431055c1e84ed16a6567cc9b2f3b821ad5e7 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 2 Jan 2011 11:31:56 -0500 Subject: Buffers now hold on to all tags from both this window and the last window of items instead of just this window. This protects against the rare times when one block is called twice before another block is, thereby pruning the tags before they can be passed downstream. The same thing will happen if a block is called 3 times in a row, which is highly unlikely. --- gnuradio-core/src/lib/runtime/gr_buffer.cc | 9 +++++---- gnuradio-core/src/lib/runtime/gr_buffer.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.cc b/gnuradio-core/src/lib/runtime/gr_buffer.cc index 0b2eb52a0..0bff0271a 100644 --- a/gnuradio-core/src/lib/runtime/gr_buffer.cc +++ b/gnuradio-core/src/lib/runtime/gr_buffer.cc @@ -80,7 +80,8 @@ minimum_buffer_items (long type_size, long page_size) gr_buffer::gr_buffer (int nitems, size_t sizeof_item, gr_block_sptr link) : d_base (0), d_bufsize (0), d_vmcircbuf (0), d_sizeof_item (sizeof_item), d_link(link), - d_write_index (0), d_abs_write_offset(0), d_done (false) + d_write_index (0), d_abs_write_offset(0), d_done (false), + d_last_min_items_read(0) { if (!allocate_buffer (nitems, sizeof_item)) throw std::bad_alloc (); @@ -162,7 +163,9 @@ gr_buffer::space_available () min_items_read = std::min(min_items_read, d_readers[i]->nitems_read()); } - prune_tags(min_items_read); + //prune_tags(min_items_read); + prune_tags(d_last_min_items_read); + d_last_min_items_read = min_items_read; // The -1 ensures that the case d_write_index == d_read_index is // unambiguous. It indicates that there is no data for the reader @@ -241,7 +244,6 @@ gr_buffer::prune_tags(uint64_t max_time) */ //gruel::scoped_lock guard(*mutex()); - int n = 0; uint64_t item_time; std::deque::iterator itr = d_item_tags.begin(); @@ -249,7 +251,6 @@ gr_buffer::prune_tags(uint64_t max_time) item_time = pmt::pmt_to_uint64(pmt::pmt_tuple_ref(*itr, 0)); if(item_time < max_time) { d_item_tags.pop_front(); - n++; } itr++; } diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.h b/gnuradio-core/src/lib/runtime/gr_buffer.h index fe0e7585d..aa26f1e09 100644 --- a/gnuradio-core/src/lib/runtime/gr_buffer.h +++ b/gnuradio-core/src/lib/runtime/gr_buffer.h @@ -135,7 +135,7 @@ class gr_buffer { uint64_t d_abs_write_offset; // num items written since the start bool d_done; std::deque d_item_tags; - + uint64_t d_last_min_items_read; unsigned index_add (unsigned a, unsigned b) -- cgit From 9c0bfe8920ec66b5b9f1f287d63ee66b4d208862 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 2 Jan 2011 11:37:01 -0500 Subject: Not using an iterator to prune the tags to see if this fixes a problem in Windows. --- gnuradio-core/src/lib/runtime/gr_buffer.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.cc b/gnuradio-core/src/lib/runtime/gr_buffer.cc index 0bff0271a..da1d8b542 100644 --- a/gnuradio-core/src/lib/runtime/gr_buffer.cc +++ b/gnuradio-core/src/lib/runtime/gr_buffer.cc @@ -245,14 +245,11 @@ gr_buffer::prune_tags(uint64_t max_time) //gruel::scoped_lock guard(*mutex()); uint64_t item_time; - std::deque::iterator itr = d_item_tags.begin(); - - while(itr != d_item_tags.end()) { - item_time = pmt::pmt_to_uint64(pmt::pmt_tuple_ref(*itr, 0)); + for(size_t i = 0; i < d_item_tags.size(); i++) { + item_time = pmt::pmt_to_uint64(pmt::pmt_tuple_ref(d_item_tags[i], 0)); if(item_time < max_time) { d_item_tags.pop_front(); } - itr++; } } -- cgit From 6925ccc667c8278c7b250fb4f7225e01680c62ea Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Sun, 2 Jan 2011 13:49:08 -0500 Subject: Going back to iterators for use in erasing items from the deque. --- gnuradio-core/src/lib/runtime/gr_buffer.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.cc b/gnuradio-core/src/lib/runtime/gr_buffer.cc index da1d8b542..3c935b960 100644 --- a/gnuradio-core/src/lib/runtime/gr_buffer.cc +++ b/gnuradio-core/src/lib/runtime/gr_buffer.cc @@ -243,13 +243,23 @@ gr_buffer::prune_tags(uint64_t max_time) buffer's mutex al la the scoped_lock line below. */ //gruel::scoped_lock guard(*mutex()); + std::deque::iterator itr = d_item_tags.begin(); uint64_t item_time; - for(size_t i = 0; i < d_item_tags.size(); i++) { - item_time = pmt::pmt_to_uint64(pmt::pmt_tuple_ref(d_item_tags[i], 0)); + + // Since tags are not guarenteed to be in any particular order, + // we need to erase here instead of pop_front. An erase in the + // middle invalidates all iterators; so this resets the iterator + // to find more. Mostly, we wil be erasing from the front and + // therefore lose little time this way. + while(itr != d_item_tags.end()) { + item_time = pmt::pmt_to_uint64(pmt::pmt_tuple_ref(*itr, 0)); if(item_time < max_time) { - d_item_tags.pop_front(); + d_item_tags.erase(itr); + itr = d_item_tags.begin(); } + else + itr++; } } -- cgit From 99c2b220675f3ca73ef5cf0a9ebe03706f813d61 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 4 Jan 2011 11:10:27 -0500 Subject: Only prune if we've moved on in the number of items read. Fixes the problem or premature pruning. --- gnuradio-core/src/lib/runtime/gr_buffer.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.cc b/gnuradio-core/src/lib/runtime/gr_buffer.cc index 3c935b960..624ca78a8 100644 --- a/gnuradio-core/src/lib/runtime/gr_buffer.cc +++ b/gnuradio-core/src/lib/runtime/gr_buffer.cc @@ -163,9 +163,10 @@ gr_buffer::space_available () min_items_read = std::min(min_items_read, d_readers[i]->nitems_read()); } - //prune_tags(min_items_read); - prune_tags(d_last_min_items_read); - d_last_min_items_read = min_items_read; + if(min_items_read != d_last_min_items_read) { + prune_tags(d_last_min_items_read); + d_last_min_items_read = min_items_read; + } // The -1 ensures that the case d_write_index == d_read_index is // unambiguous. It indicates that there is no data for the reader -- cgit From 7c78b8501ac6e9f386c9d4c0315913f6d3c72617 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Tue, 4 Jan 2011 12:48:49 -0500 Subject: Fixing how far get_tags_in_range looks; should be exclusive of end point. --- gnuradio-core/src/lib/runtime/gr_buffer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_buffer.cc b/gnuradio-core/src/lib/runtime/gr_buffer.cc index 624ca78a8..03d5a8738 100644 --- a/gnuradio-core/src/lib/runtime/gr_buffer.cc +++ b/gnuradio-core/src/lib/runtime/gr_buffer.cc @@ -319,7 +319,7 @@ gr_buffer_reader::get_tags_in_range(std::vector &v, while(itr != d_buffer->get_tags_end()) { item_time = pmt::pmt_to_uint64(pmt::pmt_tuple_ref(*itr, 0)); - if((item_time >= abs_start) && (item_time <= abs_end)) { + if((item_time >= abs_start) && (item_time < abs_end)) { v.push_back(*itr); } -- cgit From dad65db9c2046a113e704394beac01852ac2b35c Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Wed, 5 Jan 2011 19:56:00 -0800 Subject: Have swig/guile wrap enums and constants as scheme variables, not functions. --- gnuradio-core/src/lib/swig/gnuradio.i | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/swig/gnuradio.i b/gnuradio-core/src/lib/swig/gnuradio.i index 1601cca12..1856d5007 100644 --- a/gnuradio-core/src/lib/swig/gnuradio.i +++ b/gnuradio-core/src/lib/swig/gnuradio.i @@ -37,6 +37,11 @@ %feature("autodoc","1"); +#ifdef SWIGGUILE +// Export constants and enums as scheme variables, not functions. +%feature("constasvar"); +#endif + // local file %include -- cgit From 98a3a1ce7462fe0c1662168c2c91c765eb8f841b Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Thu, 6 Jan 2011 10:26:54 -0500 Subject: Fixed error in the name of the test_filter output files. --- gnuradio-core/src/tests/test_filter.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/tests/test_filter.cc b/gnuradio-core/src/tests/test_filter.cc index 90fe66c2f..2781cfb35 100644 --- a/gnuradio-core/src/tests/test_filter.cc +++ b/gnuradio-core/src/tests/test_filter.cc @@ -30,7 +30,7 @@ int main (int argc, char **argv) { char path[200]; - get_unittest_path ("gnuradio_core_atsc.xml", path, 200); + get_unittest_path ("gnuradio_core_filter.xml", path, 200); CppUnit::TextTestRunner runner; std::ofstream xmlfile(path); -- cgit From b6005d9e5823d871c091f3b4a048ca67cd885821 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 6 Jan 2011 21:39:10 -0800 Subject: Change pmt message handling interface in gr_basic_block.h Change the API such that the message handler is now implemented with a callback, not an overridden virtual function. The callback is now set using gr_basic_block::set_msg_handler, which will accept pretty much any kind of callable. This change allows us to split the machinery for message handling out from the block inheritance hierarchy, and provides a foundation that can be used to build or experiment with arbitrary message dispatching techniques. --- gnuradio-core/src/lib/runtime/gr_basic_block.h | 54 ++++++++++++++++++---- .../src/lib/runtime/gr_tpb_thread_body.cc | 8 ++-- 2 files changed, 50 insertions(+), 12 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/gr_basic_block.h b/gnuradio-core/src/lib/runtime/gr_basic_block.h index d059a4bd3..ce7a1aa1d 100644 --- a/gnuradio-core/src/lib/runtime/gr_basic_block.h +++ b/gnuradio-core/src/lib/runtime/gr_basic_block.h @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2006,2008,2009 Free Software Foundation, Inc. + * Copyright 2006,2008,2009,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -42,9 +43,27 @@ class gr_basic_block : public gr_msg_accepter, public boost::enable_shared_from_this { + typedef boost::function msg_handler_t; + +private: + /* + * This function is called by the runtime system to dispatch messages. + * + * The thread-safety guarantees mentioned in set_msg_handler are implemented + * by the callers of this method. + */ + void dispatch_msg(pmt::pmt_t msg) + { + if (d_msg_handler) // Is there a handler? + d_msg_handler(msg); // Yes, invoke it. + }; + + msg_handler_t d_msg_handler; + protected: friend class gr_flowgraph; friend class gr_flat_flowgraph; // TODO: will be redundant + friend class gr_tpb_thread_body; enum vcolor { WHITE, GREY, BLACK }; @@ -99,15 +118,34 @@ public: virtual bool check_topology(int ninputs, int noutputs) { return true; } /*! - * \brief Block message handler. - * - * \param msg Arbitrary message encapsulated as pmt::pmt_t + * \brief Set the callback that is fired when messages are available. * - * This function is called by the runtime system whenever there are - * messages in its queue. Blocks should override this to receive - * messages; the default behavior is to drop them on the floor. + * \p msg_handler can be any kind of function pointer or function object + * that has the signature: + *
+     *    void msg_handler(pmt::pmt msg);
+     * 
+ * + * (You may want to use boost::bind to massage your callable into the + * correct form. See gr_nop.{h,cc} for an example that sets up a class + * method as the callback.) + * + * Blocks that desire to handle messages must call this method in their + * constructors to register the handler that will be invoked when messages + * are available. + * + * If the block inherits from gr_block, the runtime system will ensure that + * msg_handler is called in a thread-safe manner, such that work and + * msg_handler will never be called concurrently. This allows msg_handler + * to update state variables without having to worry about thread-safety + * issues with work, general_work or another invocation of msg_handler. + * + * If the block inherits from gr_hier_block2, the runtime system will + * ensure that no reentrant calls are made to msg_handler. */ - virtual void handle_msg(pmt::pmt_t msg) { }; + template void set_msg_handler(T msg_handler){ + d_msg_handler = msg_handler_t(msg_handler); + } }; inline bool operator<(gr_basic_block_sptr lhs, gr_basic_block_sptr rhs) diff --git a/gnuradio-core/src/lib/runtime/gr_tpb_thread_body.cc b/gnuradio-core/src/lib/runtime/gr_tpb_thread_body.cc index 03eef17d9..faa888697 100644 --- a/gnuradio-core/src/lib/runtime/gr_tpb_thread_body.cc +++ b/gnuradio-core/src/lib/runtime/gr_tpb_thread_body.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2008,2009 Free Software Foundation, Inc. + * Copyright 2008,2009,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -43,7 +43,7 @@ gr_tpb_thread_body::gr_tpb_thread_body(gr_block_sptr block) // handle any queued up messages while ((msg = d->d_tpb.delete_head_nowait())) - block->handle_msg(msg); + block->dispatch_msg(msg); d->d_tpb.clear_changed(); s = d_exec.run_one_iteration(); @@ -73,7 +73,7 @@ gr_tpb_thread_body::gr_tpb_thread_body(gr_block_sptr block) // handle all pending messages while ((msg = d->d_tpb.delete_head_nowait_already_holding_mutex())){ guard.unlock(); // release lock while processing msg - block->handle_msg(msg); + block->dispatch_msg(msg); guard.lock(); } } @@ -93,7 +93,7 @@ gr_tpb_thread_body::gr_tpb_thread_body(gr_block_sptr block) // handle all pending messages while ((msg = d->d_tpb.delete_head_nowait_already_holding_mutex())){ guard.unlock(); // release lock while processing msg - block->handle_msg(msg); + block->dispatch_msg(msg); guard.lock(); } } -- cgit From 1dc1dbeef3eb15e1316857d4dd7ba32c4304bf69 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 6 Jan 2011 21:46:55 -0800 Subject: Augment gr_nop to count received pmt messages by way of set_msg_handler. --- gnuradio-core/src/lib/general/gr_nop.cc | 24 +++++++++++++++++------- gnuradio-core/src/lib/general/gr_nop.h | 9 +++++++++ 2 files changed, 26 insertions(+), 7 deletions(-) (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/general/gr_nop.cc b/gnuradio-core/src/lib/general/gr_nop.cc index 950ef878e..bd5e4fd81 100644 --- a/gnuradio-core/src/lib/general/gr_nop.cc +++ b/gnuradio-core/src/lib/general/gr_nop.cc @@ -25,18 +25,30 @@ #endif #include #include +#include + +gr_nop_sptr +gr_make_nop (size_t sizeof_stream_item) +{ + return gnuradio::get_initial_sptr (new gr_nop (sizeof_stream_item)); +} gr_nop::gr_nop (size_t sizeof_stream_item) : gr_block ("nop", - gr_make_io_signature (0, -1, sizeof_stream_item), - gr_make_io_signature (0, -1, sizeof_stream_item)) + gr_make_io_signature (0, -1, sizeof_stream_item), + gr_make_io_signature (0, -1, sizeof_stream_item)), + d_nmsgs_recvd(0) { + // Arrange to have count_received_msgs called when messages are received. + set_msg_handler(boost::bind(&gr_nop::count_received_msgs, this, _1)); } -gr_nop_sptr -gr_make_nop (size_t sizeof_stream_item) +// Trivial message handler that just counts them. +// (N.B., This feature is used in qa_set_msg_handler) +void +gr_nop::count_received_msgs(pmt::pmt_t msg) { - return gnuradio::get_initial_sptr (new gr_nop (sizeof_stream_item)); + d_nmsgs_recvd++; } int @@ -51,5 +63,3 @@ gr_nop::general_work (int noutput_items, return noutput_items; } - - diff --git a/gnuradio-core/src/lib/general/gr_nop.h b/gnuradio-core/src/lib/general/gr_nop.h index 4f18c9183..354c2f9fc 100644 --- a/gnuradio-core/src/lib/general/gr_nop.h +++ b/gnuradio-core/src/lib/general/gr_nop.h @@ -41,11 +41,20 @@ class gr_nop : public gr_block friend gr_nop_sptr gr_make_nop (size_t sizeof_stream_item); gr_nop (size_t sizeof_stream_item); +protected: + int d_nmsgs_recvd; + + // Method that just counts any received messages. + void count_received_msgs(pmt::pmt_t msg); + public: virtual int general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items); + + int nmsgs_received() const { return d_nmsgs_recvd; } + }; #endif /* INCLUDED_GR_NOP_H */ -- cgit From bb438e7d12c5767123f8abed5810f284a5f18bf8 Mon Sep 17 00:00:00 2001 From: Eric Blossom Date: Thu, 6 Jan 2011 21:48:12 -0800 Subject: Add QA code for gr_basic_block::set_msg_handler. --- gnuradio-core/src/lib/runtime/Makefile.am | 2 + gnuradio-core/src/lib/runtime/qa_runtime.cc | 4 +- .../src/lib/runtime/qa_set_msg_handler.cc | 85 ++++++++++++++++++++++ gnuradio-core/src/lib/runtime/qa_set_msg_handler.h | 43 +++++++++++ 4 files changed, 133 insertions(+), 1 deletion(-) create mode 100644 gnuradio-core/src/lib/runtime/qa_set_msg_handler.cc create mode 100644 gnuradio-core/src/lib/runtime/qa_set_msg_handler.h (limited to 'gnuradio-core') diff --git a/gnuradio-core/src/lib/runtime/Makefile.am b/gnuradio-core/src/lib/runtime/Makefile.am index 0fdb58aff..3dd2b42f5 100644 --- a/gnuradio-core/src/lib/runtime/Makefile.am +++ b/gnuradio-core/src/lib/runtime/Makefile.am @@ -81,6 +81,7 @@ libruntime_qa_la_SOURCES = \ qa_gr_io_signature.cc \ qa_gr_vmcircbuf.cc \ qa_block_tags.cc \ + qa_set_msg_handler.cc \ qa_runtime.cc grinclude_HEADERS = \ @@ -140,6 +141,7 @@ noinst_HEADERS = \ qa_gr_top_block.h \ qa_gr_vmcircbuf.h \ qa_block_tags.h \ + qa_set_msg_handler.h \ qa_runtime.h swiginclude_HEADERS = \ diff --git a/gnuradio-core/src/lib/runtime/qa_runtime.cc b/gnuradio-core/src/lib/runtime/qa_runtime.cc index 967d4bfa8..c0bee8ea0 100644 --- a/gnuradio-core/src/lib/runtime/qa_runtime.cc +++ b/gnuradio-core/src/lib/runtime/qa_runtime.cc @@ -1,5 +1,5 @@ /* - * Copyright 2002,2007 Free Software Foundation, Inc. + * Copyright 2002,2007,2011 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -39,6 +39,7 @@ #include #include #include +#include CppUnit::TestSuite * qa_runtime::suite () @@ -54,6 +55,7 @@ qa_runtime::suite () s->addTest (qa_gr_hier_block2_derived::suite ()); s->addTest (qa_gr_buffer::suite ()); s->addTest (qa_block_tags::suite ()); + s->addTest (qa_set_msg_handler::suite ()); return s; } diff --git a/gnuradio-core/src/lib/runtime/qa_set_msg_handler.cc b/gnuradio-core/src/lib/runtime/qa_set_msg_handler.cc new file mode 100644 index 000000000..d52ca78b9 --- /dev/null +++ b/gnuradio-core/src/lib/runtime/qa_set_msg_handler.cc @@ -0,0 +1,85 @@ +/* -*- c++ -*- */ +/* + * Copyright 2007,2011 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 GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define VERBOSE 0 + +using namespace pmt; + +/* + * The gr_nop block has been instrumented so that it counts + * the number of messages sent to it. We use this feature + * to confirm that gr_nop's call to set_msg_handler is working + * correctly. + */ + +void qa_set_msg_handler::t0() +{ + static const int NMSGS = 10; + + if (VERBOSE) std::cout << "qa_set_msg_handler::t0()\n"; + + gr_top_block_sptr tb = gr_make_top_block("top"); + + gr_block_sptr src = gr_make_null_source(sizeof(int)); + gr_nop_sptr nop = gr_make_nop(sizeof(int)); + gr_block_sptr dst = gr_make_null_sink(sizeof(int)); + + tb->connect(src, 0, nop, 0); + tb->connect(nop, 0, dst, 0); + + // Must start graph before sending messages + tb->start(); + + // Send them... + for (int i = 0; i < NMSGS; i++){ + send(nop, mp(mp("example-msg"), mp(i))); + } + + // And send a message to null_source to confirm that the default + // message handling action (which should be a nop) doesn't dump + // core. + send(src, mp(mp("example-msg"), mp(0))); + + // Surrender our CPU for a bit + boost::this_thread::yield(); + + tb->stop(); + tb->wait(); + + // Confirm that the nop block received the right number of messages. + CPPUNIT_ASSERT_EQUAL(NMSGS, nop->nmsgs_received()); +} diff --git a/gnuradio-core/src/lib/runtime/qa_set_msg_handler.h b/gnuradio-core/src/lib/runtime/qa_set_msg_handler.h new file mode 100644 index 000000000..e73fffbcd --- /dev/null +++ b/gnuradio-core/src/lib/runtime/qa_set_msg_handler.h @@ -0,0 +1,43 @@ +/* -*- c++ -*- */ +/* + * Copyright 2007,2011 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 GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef INCLUDED_QA_SET_MSG_HANDLER_H +#define INCLUDED_QA_SET_MSG_HANDLER_H + +#include +#include +#include + +class qa_set_msg_handler : public CppUnit::TestCase +{ + CPPUNIT_TEST_SUITE(qa_set_msg_handler); + + CPPUNIT_TEST(t0); + + CPPUNIT_TEST_SUITE_END(); + +private: + + void t0(); +}; + +#endif /* INCLUDED_QA_SET_MSG_HANDLER_H */ -- cgit