summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/Makefile.am1
-rw-r--r--config/gr_guile.m465
-rw-r--r--config/gr_scripting.m413
-rw-r--r--config/gr_swig.m434
-rw-r--r--config/gr_tcl.m469
-rw-r--r--config/grc_gnuradio_core.m48
-rw-r--r--config/grc_gr_audio_alsa.m44
-rw-r--r--config/grc_gr_guile.m436
8 files changed, 224 insertions, 6 deletions
diff --git a/config/Makefile.am b/config/Makefile.am
index 4dc7216f1..f5f478cff 100644
--- a/config/Makefile.am
+++ b/config/Makefile.am
@@ -61,6 +61,7 @@ m4macros = \
grc_gr_gcell.m4 \
grc_gr_gpio.m4 \
grc_gr_gsm_fr_vocoder.m4 \
+ grc_gr_guile.m4 \
grc_gr_noaa.m4 \
grc_gr_radar_mono.m4 \
grc_gr_radio_astronomy.m4 \
diff --git a/config/gr_guile.m4 b/config/gr_guile.m4
new file mode 100644
index 000000000..90d4dfe9d
--- /dev/null
+++ b/config/gr_guile.m4
@@ -0,0 +1,65 @@
+dnl
+dnl Copyright 2003,2004,2005 Free Software Foundation, Inc.
+dnl
+dnl This file is part of GNU Radio
+dnl
+dnl GNU Radio is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3, or (at your option)
+dnl any later version.
+dnl
+dnl GNU Radio is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with GNU Radio; see the file COPYING. If not, write to
+dnl the Free Software Foundation, Inc., 51 Franklin Street,
+dnl Boston, MA 02110-1301, USA.
+dnl
+
+# GUILE_DEVEL()
+#
+# Checks for Guile and tries to get the include path to 'Guile.h'.
+# It sets the $(GUILE_CPPFLAGS), $(GUILE_LDFLAGS) and $(guiledir) output variables,
+#
+AC_DEFUN([GUILE_DEVEL],[
+ dnl see if GUILE is installed
+ AC_PATH_PROG(GUILE, guile)
+ dnl get the config program
+ AC_PATH_PROG(GUILE_CONFIG, guile-config)
+ if test x${GUILE_CONFIG} != x; then
+ GUILE_CFLAGS="`${GUILE_CONFIG} compile`"
+ GUILE_LIBS="`${GUILE_CONFIG} link`"
+ GUILE_PKLIBDIR="`${GUILE_CONFIG} info pkglibdir`"
+ GUILE_PKDATADIR="`${GUILE_CONFIG} info pkgdatadir`/site"
+ else
+ GUILE_CFLAGS=""
+ GUILE_PKLIBDIR=""
+ GUILE_LIBS="Wl,-Bsymbolic-functions -lguile lgmp -lcrypt"
+ fi
+ AC_SUBST(GUILE_CFLAGS)
+ AC_SUBST(GUILE_PKLIBDIR)
+ AC_SUBST(GUILE_PKDATADIR)
+ AC_SUBST(GUILE_LIBS)
+])
+
+# GUILE_CHECK_MODULE
+#
+# Determines if a particular Guile module can be imported
+#
+# $1 - module name
+# $2 - module description
+# $3 - action if found
+# $4 - action if not found
+# $5 - test command
+
+AC_DEFUN([GUILE_CHECK_MODULE],[
+ AC_MSG_CHECKING([for $2])
+ dnl ########################################
+ dnl # import and test checking
+ dnl ########################################
+ dnl if test x${enable_guile} = xyes; then
+ dnl fi
+])
diff --git a/config/gr_scripting.m4 b/config/gr_scripting.m4
index e030a8102..001f3b7e3 100644
--- a/config/gr_scripting.m4
+++ b/config/gr_scripting.m4
@@ -26,5 +26,16 @@ AC_DEFUN([GR_SCRIPTING],[
SWIG_PROG(1.3.31)
SWIG_ENABLE_CXX
- SWIG_PYTHON
+ dnl We need python at build time, as it's used as for utilities. If python
+ dnl isn't enabled, then we don't want the SWIG support for python.
+ AC_REQUIRE([AM_PATH_PYTHON])
+ if test x${enable_python} = xyes; then
+ SWIG_PYTHON
+ fi
+ if test x${enable_tcl} = xyes; then
+ SWIG_TCL
+ fi
+ if test x${enable_guile} = xyes; then
+ SWIG_GUILE
+ fi
])
diff --git a/config/gr_swig.m4 b/config/gr_swig.m4
index cdb28055c..8a9c73268 100644
--- a/config/gr_swig.m4
+++ b/config/gr_swig.m4
@@ -26,7 +26,8 @@ dnl
# is greater or equal to the value of the argument. It should have the format:
# N[.N[.N]] (N is a number between 0 and 999. Only the first N is mandatory.)
AC_DEFUN([SWIG_PROG],[
- AC_REQUIRE([AC_PROG_MAKE_SET])
+ AC_REQUIRE([AC_PROG_MAKE_SET])
+ if test x${enable_python} = xyes -o x${enable_guile} = xyes; then
AC_CHECK_PROG(SWIG,swig,[`which swig`])
if test -z "$SWIG" ; then
AC_MSG_ERROR([Cannot find 'swig' program. SWIG version >= $1 required])
@@ -48,6 +49,7 @@ AC_DEFUN([SWIG_PROG],[
AC_MSG_ERROR([cannot determine SWIG version])
fi
fi
+ fi
])
# SWIG_ENABLE_CXX()
@@ -56,9 +58,11 @@ AC_DEFUN([SWIG_PROG],[
AC_DEFUN([SWIG_ENABLE_CXX],[
AC_REQUIRE([SWIG_PROG])
AC_REQUIRE([AC_PROG_CXX])
- if test "$SWIG" != "false" ; then
+ if test x${enable_python} = xyes -o x${enable_guile} = xyes; then
+ if test "$SWIG" != "false" ; then
SWIG="$SWIG -c++"
- fi
+ fi
+ fi
])
# SWIG_PYTHON([use-shadow-classes])
@@ -83,3 +87,27 @@ dnl AC_SUBST(SWIG_PYTHON_OPT,[-python$swig_shadow])
fi
AC_SUBST(SWIG_PYTHON_CPPFLAGS,[$PYTHON_CPPFLAGS])
])
+
+AC_DEFUN([SWIG_TCL],[
+ AC_REQUIRE([SWIG_PROG])
+ AC_REQUIRE([TCL_DEVEL])
+ if test "$SWIG" != "false" ; then
+ AC_SUBST(SWIG_TCL_LIB,[-ltcl])
+dnl test ! "x$1" = "xno" && swig_shadow=" -shadow" || swig_shadow=""
+dnl AC_SUBST(SWIG_PYTHON_OPT,[-python$swig_shadow])
+ AC_SUBST(SWIG_TCL_OPT,[-tcl])
+ fi
+ AC_SUBST(SWIG_TCL_CPPFLAGS,[$TCL_CPPFLAGS])
+])
+
+AC_DEFUN([SWIG_GUILE],[
+ AC_REQUIRE([SWIG_PROG])
+ AC_REQUIRE([GUILE_DEVEL])
+ if test "$SWIG" != "false" ; then
+ AC_SUBST(SWIG_GUILE_LIB,[-lguile])
+dnl test ! "x$1" = "xno" && swig_shadow=" -shadow" || swig_shadow=""
+dnl AC_SUBST(SWIG_PYTHON_OPT,[-python$swig_shadow])
+ AC_SUBST(SWIG_GUILE_OPT,[-guile])
+ fi
+ AC_SUBST(SWIG_GUILE_CPPFLAGS,[$GUILE_CPPFLAGS])
+])
diff --git a/config/gr_tcl.m4 b/config/gr_tcl.m4
new file mode 100644
index 000000000..106bc6515
--- /dev/null
+++ b/config/gr_tcl.m4
@@ -0,0 +1,69 @@
+dnl
+dnl Copyright 2003,2004,2005 Free Software Foundation, Inc.
+dnl
+dnl This file is part of GNU Radio
+dnl
+dnl GNU Radio is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3, or (at your option)
+dnl any later version.
+dnl
+dnl GNU Radio is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with GNU Radio; see the file COPYING. If not, write to
+dnl the Free Software Foundation, Inc., 51 Franklin Street,
+dnl Boston, MA 02110-1301, USA.
+dnl
+
+# TCL_DEVEL()
+#
+# Checks for Tcl and tries to get the include path to 'Tcl.h'.
+# It sets the $(TCL_CPPFLAGS), $(TCL_LDFLAGS) and $(tcldir) output variables,
+#
+AC_DEFUN([TCL_DEVEL],[
+ dnl see if tclsh is installed
+ if test x${enable_tcl} = xyes; then
+ AC_PATH_PROG(TCLSH,tclsh)
+
+ AC_REQUIRE([AC_CANONICAL_HOST])
+
+ AC_ARG_WITH(tcldir,
+ AC_HELP_STRING([--with-tcldir=DIR],
+ [tcl installation directory (cross-compiling) [[default=$prefix/lib/tcl2.5/site-packages]]]),
+ [with_tcldir=${withval}],[with_tcldir=${prefix}/lib/tcl2.5/site-packages])
+
+ # if we're cross-compiling, asking the host tcl about any of
+ # this is completely useless...
+
+ dnl if test x$cross_compiling != xno; then
+ dnl tcldir=$with_tcldir
+ dnl pyexecdir=$with_tcldir
+ dnl AC_SUBST(TCL_CPPFLAGS)
+ dnl AC_SUBST(TCL_LDFLAGS)
+ dnl else
+ dnl fi
+ fi
+])
+
+# TCL_CHECK_MODULE
+#
+# Determines if a particular Tcl module can be imported
+#
+# $1 - module name
+# $2 - module description
+# $3 - action if found
+# $4 - action if not found
+# $5 - test command
+
+AC_DEFUN([TCL_CHECK_MODULE],[
+ AC_MSG_CHECKING([for $2])
+ dnl ########################################
+ dnl # import and test checking
+ dnl ########################################
+ dnl if test x${enable_tcl} = xyes; then
+ dnl fi
+])
diff --git a/config/grc_gnuradio_core.m4 b/config/grc_gnuradio_core.m4
index 269634324..8cbba49ef 100644
--- a/config/grc_gnuradio_core.m4
+++ b/config/grc_gnuradio_core.m4
@@ -81,6 +81,8 @@ AC_DEFUN([GRC_GNURADIO_CORE],[
gnuradio-core/gnuradio-core.pc \
gnuradio-core/src/Makefile \
gnuradio-core/src/gen_interpolator_taps/Makefile \
+ gnuradio-core/src/guile/Makefile \
+ gnuradio-core/src/guile/run_guile_tests \
gnuradio-core/src/lib/Makefile \
gnuradio-core/src/lib/filter/Makefile \
gnuradio-core/src/lib/g72x/Makefile \
@@ -110,6 +112,10 @@ AC_DEFUN([GRC_GNURADIO_CORE],[
GRC_BUILD_CONDITIONAL(gnuradio-core, [
dnl run_tests is created from run_tests.in. Make it executable.
- AC_CONFIG_COMMANDS([run_tests_core],[chmod +x gnuradio-core/src/python/gnuradio/gr/run_tests])
+ AC_CONFIG_COMMANDS([run_tests_core],
+ [
+ chmod +x gnuradio-core/src/python/gnuradio/gr/run_tests
+ chmod +x gnuradio-core/src/guile/run_guile_tests
+ ])
])
])
diff --git a/config/grc_gr_audio_alsa.m4 b/config/grc_gr_audio_alsa.m4
index d6955980d..35389d81d 100644
--- a/config/grc_gr_audio_alsa.m4
+++ b/config/grc_gr_audio_alsa.m4
@@ -37,11 +37,13 @@ AC_DEFUN([GRC_GR_AUDIO_ALSA],[
gr-audio-alsa/Makefile \
gr-audio-alsa/gnuradio-audio-alsa.pc \
gr-audio-alsa/src/Makefile \
+ gr-audio-alsa/src/run_guile_tests \
gr-audio-alsa/src/run_tests \
])
GRC_BUILD_CONDITIONAL(gr-audio-alsa,[
dnl run_tests is created from run_tests.in. Make it executable.
- AC_CONFIG_COMMANDS([run_tests_alsa], [chmod +x gr-audio-alsa/src/run_tests])
+ AC_CONFIG_COMMANDS([run_tests_alsa],
+ [chmod +x gr-audio-alsa/src/run_tests gr-audio-alsa/src/run_guile_tests])
])
])
diff --git a/config/grc_gr_guile.m4 b/config/grc_gr_guile.m4
new file mode 100644
index 000000000..35d6834eb
--- /dev/null
+++ b/config/grc_gr_guile.m4
@@ -0,0 +1,36 @@
+dnl Copyright 2001,2002,2003,2004,2005,2006,2008,2009,2010 Free Software Foundation, Inc.
+dnl
+dnl This file is part of GNU Radio
+dnl
+dnl GNU Radio is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 3, or (at your option)
+dnl any later version.
+dnl
+dnl GNU Radio is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+dnl GNU General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with GNU Radio; see the file COPYING. If not, write to
+dnl the Free Software Foundation, Inc., 51 Franklin Street,
+dnl Boston, MA 02110-1301, USA.
+
+AC_DEFUN([GRC_GR_GUILE],[
+ GRC_ENABLE(gr-guile)
+
+ dnl Don't do gr-guile if gnuradio-core skipped
+ GRC_CHECK_DEPENDENCY(gr-guile, gnuradio-core)
+
+ AC_CONFIG_FILES([ \
+ gr-guile/Makefile \
+ gr-guile/apps/Makefile \
+ gr-guile/example-waveforms/Makefile \
+ ])
+
+ GRC_BUILD_CONDITIONAL(gr-guile,[
+ dnl run_tests is created from run_tests.in. Make it executable.
+ dnl AC_CONFIG_COMMANDS([run_tests_guile], [chmod +x gr-guile/apps/run_guile_tests])
+ ])
+])