diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-05-13 01:46:41 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-05-13 01:46:41 +0200 |
commit | 5fea9ab85029df7b3a4b16a24b4d58c353e811b2 (patch) | |
tree | 4538865b00c14cc1eca4b678a01c699973fbb2aa /gsm-receiver/config | |
parent | 085852622cb2641fbc1fa88c85494c7951914ebd (diff) |
gsm-receiver: Migrate to more recent gnuradio autotools integration
These changes forward-port gsm-receiver to the gnuradio autotools magic
as per "gr-howto-write-a-block-3.2.2"
It also updates to libosmocore >= 0.3.0 and fixes other minor compilation
issues.
Diffstat (limited to 'gsm-receiver/config')
30 files changed, 1324 insertions, 494 deletions
diff --git a/gsm-receiver/config/Makefile.am b/gsm-receiver/config/Makefile.am index 1c99d68..5858d22 100644 --- a/gsm-receiver/config/Makefile.am +++ b/gsm-receiver/config/Makefile.am @@ -25,46 +25,57 @@ include $(top_srcdir)/Makefile.common m4datadir = $(datadir)/aclocal # List your m4 macros here -m4macros = \ - acx_pthread.m4 \ - bnv_have_qt.m4 \ - cppunit.m4 \ - gr_boost.m4 \ +m4macros = \ + acx_pthread.m4 \ + ax_boost_base.m4 \ + ax_boost_date_time.m4 \ + ax_boost_filesystem.m4 \ + ax_boost_iostreams.m4 \ + ax_boost_program_options.m4 \ + ax_boost_python.m4 \ + ax_boost_regex.m4 \ + ax_boost_serialization.m4 \ + ax_boost_signals.m4 \ + ax_boost_system.m4 \ + ax_boost_test_exec_monitor.m4 \ + ax_boost_thread.m4 \ + ax_boost_unit_test_framework.m4 \ + ax_boost_wserialization.m4 \ + bnv_have_qt.m4 \ + cppunit.m4 \ gr_check_createfilemapping.m4 \ - gr_check_usrp.m4 \ - gr_check_mc4020.m4 \ - gr_check_shm_open.m4 \ - gr_doxygen.m4 \ - gr_gprof.m4 \ + gr_check_mc4020.m4 \ + gr_check_shm_open.m4 \ + gr_check_usrp.m4 \ + gr_doxygen.m4 \ + gr_fortran.m4 \ + gr_gprof.m4 \ + gr_lib64.m4 \ gr_libgnuradio_core_extra_ldflags.m4 \ - gr_no_undefined.m4 \ - gr_omnithread.m4 \ - gr_pwin32.m4 \ - gr_python.m4 \ - gr_require_mc4020.m4 \ - gr_scripting.m4 \ - gr_set_md_cpu.m4 \ - gr_swig.m4 \ - gr_sysv_shm.m4 \ - gr_x86_64.m4 \ - lf_cc.m4 \ - lf_cxx.m4 \ - lf_warnings.m4 \ - lf_x11.m4 \ - mkstemp.m4 \ - onceonly.m4 \ - pkg.m4 \ - usrp_fusb_tech.m4 \ - usrp_libusb.m4 \ - usrp_sdcc.m4 + gr_no_undefined.m4 \ + gr_omnithread.m4 \ + gr_pwin32.m4 \ + gr_python.m4 \ + gr_require_mc4020.m4 \ + gr_scripting.m4 \ + gr_set_md_cpu.m4 \ + gr_standalone.m4 \ + gr_subversion.m4 \ + gr_swig.m4 \ + gr_sysv_shm.m4 \ + lf_cc.m4 \ + lf_cxx.m4 \ + lf_warnings.m4 \ + lf_x11.m4 \ + mkstemp.m4 \ + onceonly.m4 \ + pkg.m4 \ + usrp_fusb_tech.m4 \ + usrp_libusb.m4 \ + usrp_sdcc.m4 # Don't install m4 macros anymore # m4data_DATA = $(m4macros) -EXTRA_DIST = $(m4macros) \ - libtool.m4 \ - lt~obsolete.m4 \ - ltsugar.m4 \ - ltversion.m4 \ - ltoptions.m4 +EXTRA_DIST = $(m4macros) diff --git a/gsm-receiver/config/acx_pthread.m4 b/gsm-receiver/config/acx_pthread.m4 index d318ab0..eb09f5a 100644 --- a/gsm-receiver/config/acx_pthread.m4 +++ b/gsm-receiver/config/acx_pthread.m4 @@ -1,6 +1,84 @@ -dnl Available from the GNU Autoconf Macro Archive at: -dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_pthread.html -dnl +# =========================================================================== +# http://autoconf-archive.cryp.to/acx_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. e.g. you should link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threads programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# LAST MODIFICATION +# +# 2008-04-12 +# +# COPYLEFT +# +# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu> +# +# 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 3 of the License, 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 program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Macro Archive. When you make and +# distribute a modified version of the Autoconf Macro, you may extend this +# special exception to the GPL to apply to your modified version as well. + AC_DEFUN([ACX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE @@ -37,9 +115,10 @@ fi # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all. +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. -acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt" +acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: @@ -56,21 +135,23 @@ acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -m # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthread or + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: - acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" + acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" ;; esac @@ -87,6 +168,13 @@ for flag in $acx_pthread_flags; do PTHREAD_CFLAGS="$flag" ;; + pthread-config) + AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) + if test x"$acx_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" @@ -133,43 +221,40 @@ if test "x$acx_pthread_ok" = xyes; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - # Detect AIX lossage: threads are created detached by default - # and the JOINABLE attribute has a nonstandard name (UNDETACHED). - AC_MSG_CHECKING([for joinable pthread attribute]) - AC_TRY_LINK([#include <pthread.h>], - [int attr=PTHREAD_CREATE_JOINABLE;], - ok=PTHREAD_CREATE_JOINABLE, ok=unknown) - if test x"$ok" = xunknown; then - AC_TRY_LINK([#include <pthread.h>], - [int attr=PTHREAD_CREATE_UNDETACHED;], - ok=PTHREAD_CREATE_UNDETACHED, ok=unknown) - fi - if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then - AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok, - [Define to the necessary symbol if this constant - uses a non-standard name on your system.]) - fi - AC_MSG_RESULT(${ok}) - if test x"$ok" = xunknown; then - AC_MSG_WARN([we do not know how to create joinable pthreads]) + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;], + [attr_name=$attr; break]) + done + AC_MSG_RESULT($attr_name) + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case "${host_cpu}-${host_os}" in - *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; - *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; + *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" - # More AIX lossage: must compile with cc_r - AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) + else + PTHREAD_CC=$CC + fi else PTHREAD_CC="$CC" fi diff --git a/gsm-receiver/config/ax_boost_date_time.m4 b/gsm-receiver/config/ax_boost_date_time.m4 new file mode 100644 index 0000000..7b3f0fe --- /dev/null +++ b/gsm-receiver/config/ax_boost_date_time.m4 @@ -0,0 +1,34 @@ +# +# SYNOPSIS +# +# AX_BOOST_DATE_TIME +# +# DESCRIPTION +# +# Test for date_time library from the Boost C++ libraries. +# +# This macro calls: +# +# AC_SUBST(BOOST_DATE_TIME_LIB) +# +# And sets: +# +# HAVE_BOOST_DATE_TIME +# +# COPYLEFT +# +# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> +# Copyright (c) 2008 Michael Tindal +# Copyright (c) 2008 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +AC_DEFUN([AX_BOOST_DATE_TIME], +[ + AC_REQUIRE([AX_BOOST_BASE]) + _AX_BOOST_CHECK([boost_date_time], + [@%:@include <boost/date_time/gregorian/gregorian_types.hpp>], + [using namespace boost::gregorian; date d(2002,Jan,10); return 0;]) +]) diff --git a/gsm-receiver/config/ax_boost_filesystem.m4 b/gsm-receiver/config/ax_boost_filesystem.m4 new file mode 100644 index 0000000..bcb3fa4 --- /dev/null +++ b/gsm-receiver/config/ax_boost_filesystem.m4 @@ -0,0 +1,45 @@ +# +# SYNOPSIS +# +# AX_BOOST_FILESYSTEM +# +# DESCRIPTION +# +# Test for Filesystem library from the Boost C++ libraries. The macro +# requires a preceding call to AX_BOOST_BASE. +# +# This macro calls: +# +# AC_SUBST(BOOST_FILESYSTEM_LIB) +# +# And sets: +# +# HAVE_BOOST_FILESYSTEM +# +# COPYLEFT +# +# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> +# Copyright (c) 2008 Michael Tindal +# Copyright (c) 2008 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +AC_DEFUN([AX_BOOST_FILESYSTEM], +[ + AC_REQUIRE([AX_BOOST_BASE]) + + dnl depends on boost_system + AC_REQUIRE([AX_BOOST_SYSTEM]) + axbf_LDFLAGS_SAVED=$LDFLAGS + LDFLAGS="$LDFLAGS $BOOST_SYSTEM_LIB" + + _AX_BOOST_CHECK([boost_filesystem], + [@%:@include <boost/filesystem/path.hpp>], + [using namespace boost::filesystem; + path my_path( "foo/bar/data.txt" ); + return 0;]) + + LDFLAGS=$axbf_LDFLAGS_SAVED +]) diff --git a/gsm-receiver/config/ax_boost_iostreams.m4 b/gsm-receiver/config/ax_boost_iostreams.m4 new file mode 100644 index 0000000..181b1e7 --- /dev/null +++ b/gsm-receiver/config/ax_boost_iostreams.m4 @@ -0,0 +1,39 @@ +# +# SYNOPSIS +# +# AX_BOOST_IOSTREAMS +# +# DESCRIPTION +# +# Test for IOStreams library from the Boost C++ libraries. The macro +# requires a preceding call to AX_BOOST_BASE. +# +# This macro calls: +# +# AC_SUBST(BOOST_IOSTREAMS_LIB) +# +# And sets: +# +# HAVE_BOOST_IOSTREAMS +# +# COPYLEFT +# +# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> +# Copyright (c) 2008 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +AC_DEFUN([AX_BOOST_IOSTREAMS], +[ + AC_REQUIRE([AX_BOOST_BASE]) + _AX_BOOST_CHECK([boost_iostreams], + [@%:@include <boost/iostreams/filtering_stream.hpp> + @%:@include <boost/range/iterator_range.hpp>], + [std::string input = "Hello World!"; + namespace io = boost::iostreams; + io::filtering_istream in(boost::make_iterator_range(input)); + return 0;]) + +]) diff --git a/gsm-receiver/config/ax_boost_program_options.m4 b/gsm-receiver/config/ax_boost_program_options.m4 new file mode 100644 index 0000000..3829373 --- /dev/null +++ b/gsm-receiver/config/ax_boost_program_options.m4 @@ -0,0 +1,35 @@ +# +# SYNOPSIS +# +# AX_BOOST_PROGRAM_OPTIONS +# +# DESCRIPTION +# +# Test for program options library from the Boost C++ libraries. The macro +# requires a preceding call to AX_BOOST_BASE. +# +# This macro calls: +# +# AC_SUBST(BOOST_PROGRAM_OPTIONS_LIB) +# +# And sets: +# +# HAVE_BOOST_PROGRAM_OPTIONS +# +# COPYLEFT +# +# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> +# Copyright (c) 2008 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +AC_DEFUN([AX_BOOST_PROGRAM_OPTIONS], +[ + AC_REQUIRE([AX_BOOST_BASE]) + _AX_BOOST_CHECK([boost_program_options], + [@%:@include <boost/program_options.hpp>], + [boost::program_options::options_description generic("Generic options"); + return 0;]) +]) diff --git a/gsm-receiver/config/ax_boost_python.m4 b/gsm-receiver/config/ax_boost_python.m4 new file mode 100644 index 0000000..3c6c666 --- /dev/null +++ b/gsm-receiver/config/ax_boost_python.m4 @@ -0,0 +1,92 @@ +# =========================================================================== +# http://autoconf-archive.cryp.to/ax_boost_python.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_BOOST_PYTHON +# +# DESCRIPTION +# +# This macro checks to see if the Boost.Python library is installed. It +# also attempts to guess the currect library name using several attempts. +# It tries to build the library name using a user supplied name or suffix +# and then just the raw library. +# +# If the library is found, HAVE_BOOST_PYTHON is defined and +# BOOST_PYTHON_LIB is set to the name of the library. +# +# This macro calls AC_SUBST(BOOST_PYTHON_LIB). +# +# In order to ensure that the Python headers are specified on the include +# path, this macro requires AX_PYTHON to be called. +# +# LAST MODIFICATION +# +# 2008-04-12 +# +# COPYLEFT +# +# Copyright (c) 2008 Michael Tindal +# +# 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 of the License, 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 program. If not, see <http://www.gnu.org/licenses/>. +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Macro Archive. When you make and +# distribute a modified version of the Autoconf Macro, you may extend this +# special exception to the GPL to apply to your modified version as well. + +AC_DEFUN([AX_BOOST_PYTHON], +[AC_REQUIRE([AX_PYTHON])dnl +AC_CACHE_CHECK(whether the Boost::Python library is available, +ac_cv_boost_python, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + CPPFLAGS_SAVE=$CPPFLAGS + if test x$PYTHON_INCLUDE_DIR != x; then + CPPFLAGS=-I$PYTHON_INCLUDE_DIR $CPPFLAGS + fi + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ + #include <boost/python/module.hpp> + using namespace boost::python; + BOOST_PYTHON_MODULE(test) { throw "Boost::Python test."; }]], + [[return 0;]]), + ac_cv_boost_python=yes, ac_cv_boost_python=no) + AC_LANG_RESTORE + CPPFLAGS=$CPPFLAGS_SAVE +]) +if test "$ac_cv_boost_python" = "yes"; then + AC_LANG_PUSH([C++]) + AC_DEFINE(HAVE_BOOST_PYTHON,,[define if the Boost::Python library is available]) + ax_python_lib=boost_python + AC_ARG_WITH([boost-python],AS_HELP_STRING([--with-boost-python],[specify the boost python library or suffix to use]), + [if test "x$with_boost_python" != "xno"; then + ax_python_lib=$with_boost_python + ax_boost_python_lib=boost_python-$with_boost_python + fi]) + for ax_lib in $ax_python_lib $ax_boost_python_lib boost_python; do + AC_CHECK_LIB($ax_lib, exit, [BOOST_PYTHON_LIB=$ax_lib break]) + done + AC_SUBST(BOOST_PYTHON_LIB) + AC_LANG_POP([C++]) +fi +])dnl diff --git a/gsm-receiver/config/ax_boost_regex.m4 b/gsm-receiver/config/ax_boost_regex.m4 new file mode 100644 index 0000000..32b5313 --- /dev/null +++ b/gsm-receiver/config/ax_boost_regex.m4 @@ -0,0 +1,35 @@ +# +# SYNOPSIS +# +# AX_BOOST_REGEX +# +# DESCRIPTION +# +# Test for Regex library from the Boost C++ libraries. The macro requires +# a preceding call to AX_BOOST_BASE. +# +# This macro calls: +# +# AC_SUBST(BOOST_REGEX_LIB) +# +# And sets: +# +# HAVE_BOOST_REGEX +# +# COPYLEFT +# +# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> +# Copyright (c) 2008 Michael Tindal +# Copyright (c) 2008 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +AC_DEFUN([AX_BOOST_REGEX], +[ + AC_REQUIRE([AX_BOOST_BASE]) + _AX_BOOST_CHECK([boost_regex], + [@%:@include <boost/regex.hpp>], + [boost::regex r(); return 0;]) +]) diff --git a/gsm-receiver/config/ax_boost_serialization.m4 b/gsm-receiver/config/ax_boost_serialization.m4 new file mode 100644 index 0000000..78c9500 --- /dev/null +++ b/gsm-receiver/config/ax_boost_serialization.m4 @@ -0,0 +1,38 @@ +# +# SYNOPSIS +# +# AX_BOOST_SERIALIZATION +# +# DESCRIPTION +# +# Test for Serialization library from the Boost C++ libraries. The macro +# requires a preceding call to AX_BOOST_BASE. +# +# This macro calls: +# +# AC_SUBST(BOOST_SERIALIZATION_LIB) +# +# And sets: +# +# HAVE_BOOST_SERIALIZATION +# +# COPYLEFT +# +# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> +# Copyright (c) 2008 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +AC_DEFUN([AX_BOOST_SERIALIZATION], +[ + AC_REQUIRE([AX_BOOST_BASE]) + _AX_BOOST_CHECK([boost_serialization], + [@%:@include <fstream> + @%:@include <boost/archive/text_oarchive.hpp> + @%:@include <boost/archive/text_iarchive.hpp>], + [std::ofstream ofs("filename"); + boost::archive::text_oarchive oa(ofs); + return 0;]) +]) diff --git a/gsm-receiver/config/ax_boost_signals.m4 b/gsm-receiver/config/ax_boost_signals.m4 new file mode 100644 index 0000000..3c49717 --- /dev/null +++ b/gsm-receiver/config/ax_boost_signals.m4 @@ -0,0 +1,35 @@ +# +# SYNOPSIS +# +# AX_BOOST_SIGNALS +# +# DESCRIPTION +# +# Test for Signals library from the Boost C++ libraries. The macro +# requires a preceding call to AX_BOOST_BASE. +# +# This macro calls: +# +# AC_SUBST(BOOST_SIGNALS_LIB) +# +# And sets: +# +# HAVE_BOOST_SIGNALS +# +# COPYLEFT +# +# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> +# Copyright (c) 2008 Michael Tindal +# Copyright (c) 2008 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +AC_DEFUN([AX_BOOST_SIGNALS], +[ + AC_REQUIRE([AX_BOOST_BASE]) + _AX_BOOST_CHECK([boost_signals], + [@%:@include <boost/signal.hpp>], + [boost::signal<void ()> sig; return 0;]) +]) diff --git a/gsm-receiver/config/ax_boost_system.m4 b/gsm-receiver/config/ax_boost_system.m4 new file mode 100644 index 0000000..cb73f25 --- /dev/null +++ b/gsm-receiver/config/ax_boost_system.m4 @@ -0,0 +1,40 @@ +# =========================================================================== +# started with this: http://autoconf-archive.cryp.to/ax_boost_system.html, +# virtually nothing left +# =========================================================================== +# +# SYNOPSIS +# +# AX_BOOST_SYSTEM +# +# DESCRIPTION +# +# Test for System library from the Boost C++ libraries. The macro requires +# a preceding call to AX_BOOST_BASE. +# +# This macro calls: +# +# AC_SUBST(BOOST_SYSTEM_LIB) +# +# And sets: +# +# HAVE_BOOST_SYSTEM +# +# COPYLEFT +# +# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> +# Copyright (c) 2008 Michael Tindal +# Copyright (c) 2008 Daniel Casimiro <dan.casimiro@gmail.com> +# Copyright (c) 2008 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +AC_DEFUN([AX_BOOST_SYSTEM], +[ + AC_REQUIRE([AX_BOOST_BASE]) + _AX_BOOST_CHECK([boost_system], + [@%:@include <boost/system/error_code.hpp>], + [boost::system::system_category]) +]) diff --git a/gsm-receiver/config/ax_boost_test_exec_monitor.m4 b/gsm-receiver/config/ax_boost_test_exec_monitor.m4 new file mode 100644 index 0000000..2c30c0b --- /dev/null +++ b/gsm-receiver/config/ax_boost_test_exec_monitor.m4 @@ -0,0 +1,35 @@ +# +# SYNOPSIS +# +# AX_BOOST_TEST_EXEC_MONITOR +# +# DESCRIPTION +# +# Test for Test_Exec_Monitor library from the Boost C++ libraries. The +# macro requires a preceding call to AX_BOOST_BASE. +# +# This macro calls: +# +# AC_SUBST(BOOST_TEST_EXEC_MONITOR_LIB) +# +# And sets: +# +# HAVE_BOOST_TEST_EXEC_MONITOR +# +# COPYLEFT +# +# Copyright (c) 2008 Dodji Seketeli <dodji@seketeli.org> +# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> +# Copyright (c) 2008 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +AC_DEFUN([AX_BOOST_TEST_EXEC_MONITOR], +[ + AC_REQUIRE([AX_BOOST_BASE]) + _AX_BOOST_CHECK([boost_test_exec_monitor], + [@%:@include <boost/test/test_tools.hpp>], + [int i=1 ; BOOST_REQUIRE(i==1); ; return 0;]) +]) diff --git a/gsm-receiver/config/ax_boost_thread.m4 b/gsm-receiver/config/ax_boost_thread.m4 new file mode 100644 index 0000000..4df2322 --- /dev/null +++ b/gsm-receiver/config/ax_boost_thread.m4 @@ -0,0 +1,72 @@ +# +# SYNOPSIS +# +# AX_BOOST_THREAD +# +# DESCRIPTION +# +# Test for Thread library from the Boost C++ libraries. +# +# This macro calls: +# +# AC_SUBST(BOOST_THREAD_LIB) +# AC_SUBST(BOOST_CXXFLAGS) +# +# And sets: +# +# HAVE_BOOST_THREAD +# +# COPYLEFT +# +# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> +# Copyright (c) 2008 Michael Tindal +# Copyright (c) 2008 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + + +AC_DEFUN([AX_BOOST_THREAD], +[ + AC_REQUIRE([AX_BOOST_BASE]) + AC_REQUIRE([ACX_PTHREAD]) + _AX_BOOST_WITH([boost_thread]) + + if test "$want_boost" = "yes"; then + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_PROG_CXX]) + AC_REQUIRE([AC_CANONICAL_HOST]) + + CPPFLAGS_SAVED="$CPPFLAGS" + LDFLAGS_SAVED="$LDFLAGS" + CXXFLAGS_SAVED="$CXXFLAGS" + + CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" + LDFLAGS="$LDFLAGS $BOOST_LDFLAGS $PTHREAD_LIBS" + CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" + + AC_CACHE_CHECK(whether the boost::thread includes are available, + ax_cv_boost_thread, + [AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/thread/thread.hpp>]], + [[boost::thread_group thrds; + return 0;]]), + ax_cv_boost_thread=yes, ax_cv_boost_thread=no) + AC_LANG_POP([C++]) + ]) + + if test "$ax_cv_boost_thread" = "yes"; then + BOOST_CXXFLAGS="$PTHREAD_CFLAGS" + AC_SUBST(BOOST_CXXFLAGS) + _AX_BOOST_CHECK_LIB([boost_thread]) + if test "$link_ok" = "yes" && test -n "$PTHREAD_LIBS"; then + BOOST_THREAD_LIB="$BOOST_THREAD_LIB $PTHREAD_LIBS" + fi + fi + + CPPFLAGS="$CPPFLAGS_SAVED" + LDFLAGS="$LDFLAGS_SAVED" + CXXFLAGS="$CXXFLAGS_SAVED" + fi +]) diff --git a/gsm-receiver/config/ax_boost_unit_test_framework.m4 b/gsm-receiver/config/ax_boost_unit_test_framework.m4 new file mode 100644 index 0000000..73affcc --- /dev/null +++ b/gsm-receiver/config/ax_boost_unit_test_framework.m4 @@ -0,0 +1,36 @@ +# +# SYNOPSIS +# +# AX_BOOST_UNIT_TEST_FRAMEWORK +# +# DESCRIPTION +# +# Test for Unit_Test_Framework library from the Boost C++ libraries. The +# macro requires a preceding call to AX_BOOST_BASE. +# +# This macro calls: +# +# AC_SUBST(BOOST_UNIT_TEST_FRAMEWORK_LIB) +# +# And sets: +# +# HAVE_BOOST_UNIT_TEST_FRAMEWORK +# +# COPYLEFT +# +# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> +# Copyright (c) 2008 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +AC_DEFUN([AX_BOOST_UNIT_TEST_FRAMEWORK], +[ + AC_REQUIRE([AX_BOOST_BASE]) + _AX_BOOST_CHECK([boost_unit_test_framework], + [@%:@include <boost/test/unit_test.hpp>], + [using boost::unit_test::test_suite; + test_suite* test= BOOST_TEST_SUITE( "Unit test example 1" ); + return 0;]) +]) diff --git a/gsm-receiver/config/ax_boost_wserialization.m4 b/gsm-receiver/config/ax_boost_wserialization.m4 new file mode 100644 index 0000000..f384988 --- /dev/null +++ b/gsm-receiver/config/ax_boost_wserialization.m4 @@ -0,0 +1,46 @@ +# +# SYNOPSIS +# +# AX_BOOST_WSERIALIZATION +# +# DESCRIPTION +# +# Test for WSerialization library from the Boost C++ libraries. The macro +# requires a preceding call to AX_BOOST_BASE. +# +# This macro calls: +# +# AC_SUBST(BOOST_WSERIALIZATION_LIB) +# +# And sets: +# +# HAVE_BOOST_WSERIALIZATION +# +# COPYLEFT +# +# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de> +# Copyright (c) 2008 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. + +AC_DEFUN([AX_BOOST_WSERIALIZATION], +[ + AC_REQUIRE([AX_BOOST_BASE]) + + dnl depends on BOOST_SERIALIZATION + AC_REQUIRE([AX_BOOST_SERIALIZATION]) + axbws_LDFLAGS_SAVED=$LDFLAGS + LDFLAGS="$LDFLAGS $BOOST_SERIALIZATION_LIB" + + _AX_BOOST_CHECK([boost_wserialization], + [@%:@include <fstream> + @%:@include <boost/archive/text_oarchive.hpp> + @%:@include <boost/archive/text_iarchive.hpp>], + [std::ofstream ofs("filename"); + boost::archive::text_oarchive oa(ofs); + return 0;]) + + LDFLAGS=$axbf_LDFLAGS_SAVED +]) diff --git a/gsm-receiver/config/gr_boost.m4 b/gsm-receiver/config/gr_boost.m4 deleted file mode 100644 index 0664d36..0000000 --- a/gsm-receiver/config/gr_boost.m4 +++ /dev/null @@ -1,111 +0,0 @@ -dnl -dnl Copyright 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 - -dnl This tries to do the "right thing" to locate the boost include files. -dnl If the user explicitly specified --with-boost-include-dir=<foo> -dnl we believe them and use it. Otherwise, -dnl -dnl We look for boost/shared_ptr.hpp in the "normal places". That is, -dnl wherever AC_CHECK_HEADER looks. If the boost includes are in /usr/local/include -dnl this step will find them. -dnl -dnl Otherwise, we check to see if the boost stuff was installed in a version-specific -dnl directory under /usr/local/include. These look like: /usr/local/include/boost-1_33_1 -dnl If there's more than one version installed, we select the -dnl lexicographically greatest one. -dnl -dnl If none of these work, we bail. - -AC_DEFUN([GR_REQUIRE_BOOST_INCLUDES], -[ - AC_LANG_PUSH(C++) - gr_boost_include_dir= - AC_ARG_WITH([boost-include-dir], - AC_HELP_STRING([--with-boost-include-dir=<path>], - [path to boost c++ include files]), - [ - # "yes" and "no" are bogus answers - if test x"$with_boost_include_dir" = xyes || - test x"$with_boost_include_dir" = xno; then - gr_boost_include_dir= - else - gr_boost_include_dir=$with_boost_include_dir - fi - ]) - echo "gr_boost_include_dir = $gr_boost_include_dir" - if test x$gr_boost_include_dir != x; then - # - # If the user specified a directory, then we use it - # - OLD_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$gr_boost_include_dir" - AC_CHECK_HEADER([boost/shared_ptr.hpp], - [BOOST_CFLAGS="-I$gr_boost_include_dir"], - [AC_MSG_ERROR( - [Failed to locate boost/shared_ptr.hpp. -Try using --with-boost-include-dir=<path>, -E.g., --with-boost-include-dir=/usr/local/include/boost-1_33_1])]) - CPPFLAGS=$OLD_CPPFLAGS - else - # - # Otherwise we check in the default places - # - AC_CHECK_HEADER([boost/shared_ptr.hpp], - [BOOST_CFLAGS=""], - [ # Nope, look for latest version if any in $prefix/include/boost-* - - # Wipe out cached value. KLUDGE: AC should have API for this - unset AS_TR_SH([ac_cv_header_boost/shared_ptr.hpp]) - - boost_last_match(){ - #echo "boost_last_match: [$]*" - pattern="[$]1" - shift - if test "[$]pattern" = "[$]1" - then - LM='' - else - shift `expr [$]# - 1` - LM=[$]1 - fi - #echo "LM(1)='[$]LM'" - } - - pattern="/usr/local/include/boost-*" - boost_last_match "$pattern" $pattern - #echo "LM(2)='$LM'" - - OLD_CPPFLAGS=$CPP_FLAGS - CPPFLAGS="$CPPFLAGS -I$LM" - AC_CHECK_HEADER([boost/shared_ptr.hpp], - [BOOST_CFLAGS="-I$LM"], - [AC_MSG_ERROR( - [Failed to locate boost/shared_ptr.hpp. -Try using --with-boost-include-dir=<path>, -E.g., --with-boost-include-dir=/usr/local/include/boost-1_33_1])]) - CPPFLAGS=$OLD_CPPFLAGS - ]) - - fi - unset boost_last_match LM - AC_LANG_POP - AC_SUBST(BOOST_CFLAGS) -]) diff --git a/gsm-receiver/config/gr_doxygen.m4 b/gsm-receiver/config/gr_doxygen.m4 index 4670c29..15ece8b 100644 --- a/gsm-receiver/config/gr_doxygen.m4 +++ b/gsm-receiver/config/gr_doxygen.m4 @@ -20,10 +20,10 @@ dnl Boston, MA 02110-1301, USA. dnl AC_DEFUN([GR_CHECK_DOXYGEN],[ - AC_ARG_ENABLE(doxygen, [ --enable-doxygen enable documentation generation with doxygen (no)]) - AC_ARG_ENABLE(dot, [ --enable-dot use 'dot' to generate graphs in doxygen (auto)]) - AC_ARG_ENABLE(html-docs, [ --enable-html-docs enable HTML generation with doxygen (yes)], [], [ enable_html_docs=yes]) - AC_ARG_ENABLE(latex-docs, [ --enable-latex-docs enable LaTeX doc generation with doxygen (no)], [], [ enable_latex_docs=no]) + AC_ARG_ENABLE(doxygen, + AC_HELP_STRING([--enable-doxygen], + [enable documentation generation with doxygen (no)])) + AC_ARG_ENABLE(dot, AC_HELP_STRING([--enable-dot],[use 'dot' to generate graphs in doxygen (auto)])) if test "x$enable_doxygen" = xyes; then AC_PATH_PROG(DOXYGEN, doxygen, , $PATH) @@ -53,7 +53,8 @@ AC_DEFUN([GR_CHECK_DOXYGEN],[ enable_dot=yes fi AC_SUBST(enable_dot) - AC_SUBST(enable_html_docs) - AC_SUBST(enable_latex_docs) + AC_SUBST(enable_xml_docs, YES) + AC_SUBST(enable_html_docs, YES) + AC_SUBST(enable_latex_docs, NO) AC_SUBST(generate_docs) ]) diff --git a/gsm-receiver/config/gr_fortran.m4 b/gsm-receiver/config/gr_fortran.m4 new file mode 100644 index 0000000..b5b0470 --- /dev/null +++ b/gsm-receiver/config/gr_fortran.m4 @@ -0,0 +1,32 @@ +dnl Copyright 2001,2002,2003,2004,2005,2006 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([GR_FORTRAN],[ + dnl if you want to generate a different table of interpolator taps, you need fortran. + dnl we default to off, since almost no one wants to do this. + AC_ARG_ENABLE(fortran, AC_HELP_STRING([--enable-fortran],[enable fortran (no)]), + [], [enable_fortran=no]) + AM_CONDITIONAL(ENABLE_FORTRAN, test "x$enable_fortran" = xyes) + + if test "x$enable_fortran" = xyes + then + AC_PROG_F77 + AC_F77_LIBRARY_LDFLAGS + fi +]) diff --git a/gsm-receiver/config/gr_omnithread.m4 b/gsm-receiver/config/gr_omnithread.m4 index b5e4090..054f078 100644 --- a/gsm-receiver/config/gr_omnithread.m4 +++ b/gsm-receiver/config/gr_omnithread.m4 @@ -1,6 +1,6 @@ # Check for Omnithread (pthread/NT) thread support. -*- Autoconf -*- -# Copyright 2003 Free Software Foundation, Inc. +# Copyright 2003,2007 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 @@ -21,8 +21,9 @@ AC_DEFUN([GR_OMNITHREAD], [ # Check first for POSIX ACX_PTHREAD( - [ ot_posix="yes" - AC_DEFINE(OMNITHREAD_POSIX,[1],[Define to 1 to enable pthread]) + [ AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]) + ot_posix="yes" + DEFINES="$DEFINES -DOMNITHREAD_POSIX=1" ],[ # If no POSIX support found, then check for NT threads AC_MSG_CHECKING([for NT threads]) @@ -34,7 +35,7 @@ AC_DEFUN([GR_OMNITHREAD], ], [ ot_nt="yes" - AC_DEFINE(OMNITHREAD_NT,[1],[Define to 1 to enable NT thread]) + DEFINES="$DEFINES -DOMNITHREAD_NT=1" ], [AC_MSG_FAILURE([GNU Radio requires POSIX threads. pthreads not found.])] ) diff --git a/gsm-receiver/config/gr_python.m4 b/gsm-receiver/config/gr_python.m4 index 5816b27..6c862bb 100644 --- a/gsm-receiver/config/gr_python.m4 +++ b/gsm-receiver/config/gr_python.m4 @@ -22,27 +22,43 @@ dnl # PYTHON_DEVEL() # # Checks for Python and tries to get the include path to 'Python.h'. -# It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS) output variables. +# It sets the $(PYTHON_CPPFLAGS), $(PYTHON_LDFLAGS) and $(pythondir) output variables, # AC_DEFUN([PYTHON_DEVEL],[ AC_REQUIRE([AM_PATH_PYTHON]) AC_REQUIRE([AC_CANONICAL_HOST]) - # For Fedora Core 5 and 6, see ticket:39 in Trac - if test -f '/etc/redhat-release'; then - if (echo $pyexecdir | grep -q lib64); then - pythondir="$pyexecdir" - fi - fi + AC_ARG_WITH(pythondir, + AC_HELP_STRING([--with-pythondir=DIR], + [python installation directory (cross-compiling) [[default=$prefix/lib/python2.5/site-packages]]]), + [with_pythondir=${withval}],[with_pythondir=${prefix}/lib/python2.5/site-packages]) - # Check for Python include path - AC_MSG_CHECKING([for Python include path]) - if test -z "$PYTHON" ; then - AC_MSG_ERROR([cannot find Python path]) - fi + # if we're cross-compiling, asking the host python about any of + # this is completely useless... + + if test x$cross_compiling != xno + then + pythondir=$with_pythondir + pyexecdir=$with_pythondir + AC_SUBST(PYTHON_CPPFLAGS) + AC_SUBST(PYTHON_LDFLAGS) + else + + # For Fedora Core 5 and 6, see ticket:39 in Trac + if test -f '/etc/redhat-release'; then + if (echo $pyexecdir | grep -q lib64); then + pythondir="$pyexecdir" + fi + fi - # ask distutils which include path we should use - python_cmd=' + # Check for Python include path + AC_MSG_CHECKING([for Python include path]) + if test -z "$PYTHON" ; then + AC_MSG_ERROR([cannot find Python path]) + fi + + # ask distutils which include path we should use + python_cmd=' import distutils.sysconfig import os path = distutils.sysconfig.get_python_inc(plat_specific=False) @@ -50,30 +66,30 @@ if os.sep == "\\": path = path.replace("\\", "/") print path ' - python_path=`$PYTHON -c "$python_cmd"` - AC_MSG_RESULT([$python_path]) - if test -z "$python_path" ; then - AC_MSG_ERROR([cannot find Python include path]) - fi + python_path=`$PYTHON -c "$python_cmd"` + AC_MSG_RESULT([$python_path]) + if test -z "$python_path" ; then + AC_MSG_ERROR([cannot find Python include path]) + fi - AC_SUBST(PYTHON_CPPFLAGS,[-I$python_path]) + AC_SUBST(PYTHON_CPPFLAGS,[-I$python_path]) - # Check for Python headers usability - python_save_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS" - AC_CHECK_HEADERS([Python.h], [], - [AC_MSG_ERROR([cannot find usable Python headers])]) - CPPFLAGS="$python_save_CPPFLAGS" + # Check for Python headers usability + python_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS" + AC_CHECK_HEADERS([Python.h], [], + [AC_MSG_ERROR([cannot find usable Python headers])]) + CPPFLAGS="$python_save_CPPFLAGS" - # Only set this on mingw and cygwin hosts, (only implemented - # for mingw host, for crosscompiling you need to trick this) + # Only set this on mingw and cygwin hosts, (only implemented + # for mingw host, for crosscompiling you need to trick this) - PYTHON_LDFLAGS="" - case $host_os in - *mingw* | *cygwin* ) - AC_MSG_CHECKING([for Python LDFLAGS]) + PYTHON_LDFLAGS="" + case $host_os in + *mingw* | *cygwin* ) + AC_MSG_CHECKING([for Python LDFLAGS]) - python_cmd=' + python_cmd=' import distutils.sysconfig import os path = distutils.sysconfig.get_config_var("LIBPL") @@ -82,30 +98,31 @@ if path == None: if os.sep == "\\": path = path.replace("\\", "/") print path -' - python_stdlib_path=`$PYTHON -c "$python_cmd"` - - python_version_nodot=`echo $PYTHON_VERSION | sed "s,\.,,"` - libpython_name="python$PYTHON_VERSION" - - # Standard install of python for win32 has libpython24.a - # instead of libpython2.4.a so we check for the library - # without the dot in the version number. - - python_stdlib_filename=`find $python_stdlib_path -type f -name libpython$python_version_nodot.* -print | sed "1q"` - if test -n "$python_stdlib_filename" ; then - libpython_name="python$python_version_nodot" - fi - - PYTHON_LDFLAGS="-L$python_stdlib_path -l$libpython_name" - AC_MSG_RESULT($PYTHON_LDFLAGS) - # Replace all backslashes in PYTHON Paths with forward slashes - pythondir=`echo $pythondir |sed 's,\\\\,/,g'` - pkgpythondir=`echo $pkgpythondir |sed 's,\\\\,/,g'` - pyexecdir=`echo $pyexecdir |sed 's,\\\\,/,g'` - pkgpyexecdir=`echo $pkgpyexecdir |sed 's,\\\\,/,g'` - ;; - esac - - AC_SUBST([PYTHON_LDFLAGS]) +' + python_stdlib_path=`$PYTHON -c "$python_cmd"` + + python_version_nodot=`echo $PYTHON_VERSION | sed "s,\.,,"` + libpython_name="python$PYTHON_VERSION" + + # Standard install of python for win32 has libpython24.a + # instead of libpython2.4.a so we check for the library + # without the dot in the version number. + + python_stdlib_filename=`find $python_stdlib_path -type f -name libpython$python_version_nodot.* -print | sed "1q"` + if test -n "$python_stdlib_filename" ; then + libpython_name="python$python_version_nodot" + fi + + PYTHON_LDFLAGS="-L$python_stdlib_path -l$libpython_name" + AC_MSG_RESULT($PYTHON_LDFLAGS) + # Replace all backslashes in PYTHON Paths with forward slashes + pythondir=`echo $pythondir |sed 's,\\\\,/,g'` + pkgpythondir=`echo $pkgpythondir |sed 's,\\\\,/,g'` + pyexecdir=`echo $pyexecdir |sed 's,\\\\,/,g'` + pkgpyexecdir=`echo $pkgpyexecdir |sed 's,\\\\,/,g'` + ;; + esac + + AC_SUBST(PYTHON_LDFLAGS) + fi ]) diff --git a/gsm-receiver/config/gr_scripting.m4 b/gsm-receiver/config/gr_scripting.m4 index 86870e7..e030a81 100644 --- a/gsm-receiver/config/gr_scripting.m4 +++ b/gsm-receiver/config/gr_scripting.m4 @@ -24,7 +24,7 @@ AC_DEFUN([GR_SCRIPTING],[ AC_REQUIRE([AC_PROG_CXX]) AC_REQUIRE([AC_PROG_LIBTOOL]) - SWIG_PROG(1.3.23) + SWIG_PROG(1.3.31) SWIG_ENABLE_CXX SWIG_PYTHON ]) diff --git a/gsm-receiver/config/gr_set_md_cpu.m4 b/gsm-receiver/config/gr_set_md_cpu.m4 index ebc1fad..b9c570e 100644 --- a/gsm-receiver/config/gr_set_md_cpu.m4 +++ b/gsm-receiver/config/gr_set_md_cpu.m4 @@ -1,5 +1,5 @@ dnl -dnl Copyright 2003 Free Software Foundation, Inc. +dnl Copyright 2003,2008 Free Software Foundation, Inc. dnl dnl This file is part of GNU Radio dnl @@ -28,17 +28,17 @@ AC_DEFUN([GR_SET_MD_CPU],[ AC_MSG_CHECKING([for machine dependent speedups]) case "$cf_with_md_cpu" in - x86 | i[[3-7]]86) MD_CPU=x86 MD_SUBCPU=x86 ;; - x86_64) MD_CPU=x86 MD_SUBCPU=x86_64 ;; -# sparc) MD_CPU=sparc ;; - *) MD_CPU=generic ;; + x86 | i[[3-7]]86) MD_CPU=x86 MD_SUBCPU=x86 ;; + x86_64) MD_CPU=x86 MD_SUBCPU=x86_64 ;; + powerpc*) MD_CPU=powerpc ;; + *) MD_CPU=generic ;; esac AC_MSG_RESULT($MD_CPU) AC_SUBST(MD_CPU) AC_SUBST(MD_SUBCPU) - AM_CONDITIONAL(MD_CPU_x86, test $MD_CPU = x86) - AM_CONDITIONAL(MD_SUBCPU_x86_64, test $MD_SUBCPU = x86_64) - AM_CONDITIONAL(MD_CPU_generic, test $MD_CPU = generic) + AM_CONDITIONAL(MD_CPU_x86, test "$MD_CPU" = "x86") + AM_CONDITIONAL(MD_SUBCPU_x86_64, test "$MD_SUBCPU" = "x86_64") + AM_CONDITIONAL(MD_CPU_powerpc, test "$MD_CPU" = "powerpc") + AM_CONDITIONAL(MD_CPU_generic, test "$MD_CPU" = "generic") ]) - diff --git a/gsm-receiver/config/gr_standalone.m4 b/gsm-receiver/config/gr_standalone.m4 new file mode 100644 index 0000000..44d9235 --- /dev/null +++ b/gsm-receiver/config/gr_standalone.m4 @@ -0,0 +1,119 @@ +dnl +dnl Copyright 2008,2009 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 along +dnl with this program; if not, write to the Free Software Foundation, Inc., +dnl 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +dnl + +dnl +dnl GR_STANDALONE([package],[version]) +dnl +dnl Handles the bulk of the configure.ac work for an out-of-tree build +dnl +dnl N.B., this is an m4_define because if it were an AC_DEFUN it would +dnl get called too late to be useful. + +m4_define([GR_STANDALONE], +[ + AC_CONFIG_SRCDIR([config/gr_standalone.m4]) + AM_CONFIG_HEADER(config.h) + + AC_CANONICAL_BUILD + AC_CANONICAL_HOST + AC_CANONICAL_TARGET + + AM_INIT_AUTOMAKE + + dnl Remember if the user explicity set CXXFLAGS + if test -n "${CXXFLAGS}"; then + user_set_cxxflags=yes + fi + + LF_CONFIGURE_CC + LF_CONFIGURE_CXX + GR_LIB64 dnl check for lib64 suffix after choosing compilers + + dnl The three macros above are known to override CXXFLAGS if the user + dnl didn't specify them. Though I'm sure somebody thought this was + dnl a good idea, it makes it hard to use other than -g -O2 when compiling + dnl selected files. Thus we "undo" the damage here... + dnl + dnl If the user specified CXXFLAGS, we use them. Otherwise when compiling + dnl the output of swig use use -O1 if we're using g++. + dnl See Makefile.common for the rest of the magic. + if test "$user_set_cxxflags" != yes; then + autoconf_default_CXXFLAGS="$CXXFLAGS" + if test "$GXX" = yes; then + case "$host_cpu" in + powerpc*) + dnl "-O1" is broken on the PPC for some reason + dnl (at least as of g++ 4.1.1) + swig_CXXFLAGS="-g1 -O2 -Wno-strict-aliasing -Wno-parentheses" + ;; + *) + swig_CXXFLAGS="-g -O1 -Wno-strict-aliasing -Wno-parentheses" + ;; + esac + fi + fi + AC_SUBST(autoconf_default_CXXFLAGS) + AC_SUBST(swig_CXXFLAGS) + + dnl add ${prefix}/lib${gr_libdir_suffix}/pkgconfig to the head of the PKG_CONFIG_PATH + if test x${PKG_CONFIG_PATH} = x; then + PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig + else + PKG_CONFIG_PATH=${prefix}/lib${gr_libdir_suffix}/pkgconfig:${PKG_CONFIG_PATH} + fi + export PKG_CONFIG_PATH + + LF_SET_WARNINGS + GR_SET_GPROF + GR_SET_PROF + AM_PROG_AS + AC_PROG_LN_S + AC_PROG_MAKE_SET + AC_PROG_INSTALL + AC_PATH_PROG([RM_PROG], [rm]) + + AC_LIBTOOL_WIN32_DLL + AC_ENABLE_SHARED dnl do build shared libraries + AC_DISABLE_STATIC dnl don't build static libraries + m4_ifdef([LT_INIT],[LT_INIT],[AC_PROG_LIBTOOL]) + dnl GR_FORTRAN + + GR_NO_UNDEFINED dnl do we need the -no-undefined linker flag + GR_SCRIPTING dnl Locate python, SWIG, etc + + dnl Checks for header files. + AC_HEADER_STDC + + dnl Checks for typedefs, structures, and compiler characteristics. + AC_C_CONST + AC_C_INLINE + AC_TYPE_SIZE_T + AC_HEADER_TIME + AC_C_BIGENDIAN + + dnl Check for Mingw support + GR_PWIN32 + + AC_CHECK_PROG([XMLTO],[xmlto],[yes],[]) + AM_CONDITIONAL([HAS_XMLTO], [test x$XMLTO = xyes]) + + PKG_CHECK_MODULES(GNURADIO_CORE, gnuradio-core >= 3) + LIBS="$LIBS $GNURADIO_CORE_LIBS" +]) diff --git a/gsm-receiver/config/gr_x86_64.m4 b/gsm-receiver/config/gr_subversion.m4 index 3f56c06..849d7a9 100644 --- a/gsm-receiver/config/gr_x86_64.m4 +++ b/gsm-receiver/config/gr_subversion.m4 @@ -1,5 +1,5 @@ dnl -dnl Copyright 2005 Free Software Foundation, Inc. +dnl Copyright 2007 Free Software Foundation, Inc. dnl dnl This file is part of GNU Radio dnl @@ -19,21 +19,18 @@ dnl the Free Software Foundation, Inc., 51 Franklin Street, dnl Boston, MA 02110-1301, USA. dnl -# GR_X86_64() +# GR_SUBVERSION() # -# Checks to see if we're on a x86_64 machine, and if so, ensure -# that libdir ends in "64" -# -AC_DEFUN([GR_X86_64],[ - AC_REQUIRE([AC_CANONICAL_HOST]) - if test "$host_cpu" = "x86_64"; then - AC_MSG_CHECKING([libdir for lib64 suffix]) - t=${libdir##*/lib} - if test "$t" != 64 && test -d /lib64 && ! test -L /lib64; then - libdir=${libdir}64 - AC_MSG_RESULT([no. Setting libdir to $libdir]) - else - AC_MSG_RESULT([yes]) - fi - fi +# Test for presence of subversion, and create variables for +# current repository version and last changed date. + +AC_DEFUN([GR_SUBVERSION],[ + AC_PATH_PROG([SVN],[svn]) + if test "$SVN" != "" -a -d .svn ; then + SVNVERSION=`$SVN info . | grep '^Revision' | cut -f 2- -d ' '` + SVNDATE=`$SVN info . | grep 'Last Changed Date' | cut -f 4-6 -d ' '` + fi + + AC_SUBST(SVNVERSION) + AC_SUBST(SVNDATE) ]) diff --git a/gsm-receiver/config/lf_cc.m4 b/gsm-receiver/config/lf_cc.m4 index b9d1c9c..b75e1a4 100644 --- a/gsm-receiver/config/lf_cc.m4 +++ b/gsm-receiver/config/lf_cc.m4 @@ -36,7 +36,6 @@ AC_DEFUN([LF_CONFIGURE_CC],[ AC_REQUIRE([AC_PROG_CPP])dnl AC_REQUIRE([AC_AIX])dnl AC_REQUIRE([AC_ISC_POSIX])dnl - AC_REQUIRE([AC_MINIX])dnl AC_REQUIRE([AC_HEADER_STDC])dnl ]) diff --git a/gsm-receiver/config/lf_cxx.m4 b/gsm-receiver/config/lf_cxx.m4 index c581c9b..dfc6bfb 100644 --- a/gsm-receiver/config/lf_cxx.m4 +++ b/gsm-receiver/config/lf_cxx.m4 @@ -37,11 +37,6 @@ AC_DEFUN([LF_CONFIGURE_CXX],[ # ----------------------------------------------------------------------- # This macro tests the C++ compiler for various portability problem. -# 1. Defines CXX_HAS_NO_BOOL if the compiler does not support the bool -# data type -# 2. Defines CXX_HAS_BUGGY_FOR_LOOPS if the compiler has buggy -# scoping for the for-loop -# 3. Defines USE_ASSERT if the user wants to use assertions # ----------------------------------------------------------------------- @@ -56,32 +51,6 @@ AC_DEFUN([LF_CXX_PORTABILITY],[ AC_LANG_SAVE AC_LANG_CPLUSPLUS - dnl Check whether we have bool - AC_MSG_CHECKING(whether C++ has bool) - AC_TRY_RUN([main() { bool b1=true; bool b2=false; }], - [ AC_MSG_RESULT(yes) ], - [ AC_MSG_RESULT(no) - AC_DEFINE(CXX_HAS_NO_BOOL,[],[Define if C++ is missing bool type]) ], - [ AC_MSG_WARN(Don't cross-compile)] - ) - - dnl Test whether C++ has buggy for-loops - AC_MSG_CHECKING(whether C++ has buggy scoping in for-loops) - AC_TRY_COMPILE([#include <iostream.h>], [ - for (int i=0;i<10;i++) { } - for (int i=0;i<10;i++) { } -], [ AC_MSG_RESULT(no) ], - [ AC_MSG_RESULT(yes) - AC_DEFINE(CXX_HAS_BUGGY_FOR_LOOPS,[],[Define if for loop scoping is broken]) ]) - - dnl Test whether the user wants to enable assertions - AC_MSG_CHECKING(whether user wants assertions) - AC_ARG_ENABLE(assert, - [ --disable-assert don't use cpp.h assert], - [ AC_DEFINE(NDEBUG,[],[Define to disable asserts (don't doit!)]) - AC_MSG_RESULT(no) ], - [ AC_MSG_RESULT(yes) ], - ) dnl Test whether C++ has std::isnan AC_MSG_CHECKING(whether C++ has std::isnan) @@ -96,26 +65,3 @@ AC_DEFUN([LF_CXX_PORTABILITY],[ AC_LANG_RESTORE ]) -AH_BOTTOM([// Workaround for compilers with buggy for-loop scoping -// That's quite a few compilers actually including recent versions of -// Dec Alpha cxx, HP-UX CC and SGI CC. -// The trivial "if" statement provides the correct scoping to the -// for loop - -#ifdef CXX_HAS_BUGGY_FOR_LOOPS -#undef for -#define for if(1) for -#endif -]) - -AH_BOTTOM([// If the C++ compiler we use doesn't have bool, then -// the following is a near-perfect work-around. -// You must make sure your code does not depend on "int" and "bool" -// being two different types, in overloading for instance. - -#ifdef CXX_HAS_NO_BOOL -#define bool int -#define true 1 -#define false 0 -#endif -]) diff --git a/gsm-receiver/config/pkg.m4 b/gsm-receiver/config/pkg.m4 index 770f062..80bdfed 100644 --- a/gsm-receiver/config/pkg.m4 +++ b/gsm-receiver/config/pkg.m4 @@ -1,68 +1,188 @@ -dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) -dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page -dnl also defines GSTUFF_PKG_ERRORS on error -AC_DEFUN([PKG_CHECK_MODULES], [ - succeeded=no - - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - dnl If PKG_CONFIG_PATH is not already set, add /usr/local/lib/pkgconfig. - dnl If it's set, assume the user knows what they're doing. - dnl This should help avoid failures while looking for fftw3f - if test -z "$PKG_CONFIG_PATH"; then - export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" - fi - - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - AC_MSG_CHECKING(for $2) - - if $PKG_CONFIG --exists "$2" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING($1_CFLAGS) - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` - AC_MSG_RESULT($$1_CFLAGS) - - AC_MSG_CHECKING($1_LIBS) - $1_LIBS=`$PKG_CONFIG --libs "$2"` - AC_MSG_RESULT($$1_LIBS) - - AC_MSG_CHECKING($1_INCLUDEDIR) - $1_INCLUDEDIR=`$PKG_CONFIG --variable=includedir "$2"` - AC_MSG_RESULT($$1_INCLUDEDIR) - else - $1_CFLAGS="" - $1_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# +# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. +# Copyright © 2008 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 of the License, 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 program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.18]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi + +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# +# Similar to PKG_CHECK_MODULES, make sure that the first instance of +# this or PKG_CHECK_MODULES is called, or make sure to call +# PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_ifval([$2], [$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$PKG_CONFIG"; then + if test -n "$$1"; then + pkg_cv_[]$1="$$1" + else + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + fi +else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# E.g., +# PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) +# defines: +# +# GSTUFF_LIBS +# GSTUFF_CFLAGS +# GSTUFF_INCLUDEDIR +# GSTUFF_CPPFLAGS # the -I, -D and -U's out of CFLAGS +# +# see pkg-config man page also defines GSTUFF_PKG_ERRORS on error +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_INCLUDEDIR], [includedir for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) + +if test x$cross_compiling = xyes +then + _PKG_CONFIG([$1][_LIBS], [libs-only-l --static], [$2]) +else + _PKG_CONFIG([$1][_LIBS], [libs --static], [$2]) +fi + +_PKG_CONFIG([$1][_INCLUDEDIR], [variable=includedir], [$2]) + + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + ifelse([$4], , [AC_MSG_ERROR(dnl +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT +])], + [AC_MSG_RESULT([no]) + $4]) +elif test $pkg_failed = untried; then + ifelse([$4], , [AC_MSG_FAILURE(dnl +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. - AC_SUBST($1_CFLAGS) - AC_SUBST($1_LIBS) - AC_SUBST($1_INCLUDEDIR) - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi +_PKG_TEXT - if test $succeeded = yes; then - ifelse([$3], , :, [$3]) - else - ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) - fi -]) +To get pkg-config, see <http://pkg-config.freedesktop.org/>.])], + [$4]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + $1[]_INCLUDEDIR=$pkg_cv_[]$1[]_INCLUDEDIR + $1[]_CPPFLAGS="" + for flag in $$1[]_CFLAGS; do + case $flag in + -I* | -D* | -U*) $1[]_CPPFLAGS="$$1[]_CPPFLAGS $flag" ;; + esac + done + pkg_cv_[]$1[]_CPPFLAGS=$$1[]_CPPFLAGS + AC_SUBST($1[]_CPPFLAGS) + AC_MSG_RESULT([yes]) + ifelse([$3], , :, [$3]) +fi[]dnl +])# PKG_CHECK_MODULES diff --git a/gsm-receiver/config/usrp_fusb_tech.m4 b/gsm-receiver/config/usrp_fusb_tech.m4 index b5a930b..db85724 100644 --- a/gsm-receiver/config/usrp_fusb_tech.m4 +++ b/gsm-receiver/config/usrp_fusb_tech.m4 @@ -1,5 +1,5 @@ dnl -dnl Copyright 2003 Free Software Foundation, Inc. +dnl Copyright 2003,2008 Free Software Foundation, Inc. dnl dnl This file is part of GNU Radio dnl @@ -19,38 +19,56 @@ dnl the Free Software Foundation, Inc., 51 Franklin Street, dnl Boston, MA 02110-1301, USA. dnl -AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[ - AC_REQUIRE([AC_CANONICAL_HOST]) - AC_ARG_WITH(fusb-tech, - [ --with-fusb-tech=OS set fast usb technique (auto)], - [cf_with_fusb_tech="$withval"], - [cf_with_fusb_tech="$host_os"]) - - - AC_CHECK_HEADER([linux/usbdevice_fs.h], - [x_have_usbdevice_fs_h=yes], - [x_have_usbdevice_fs_h=no]) - - AC_MSG_CHECKING([for fast usb technique to use]) - case "$cf_with_fusb_tech" in - linux*) if test x${x_have_usbdevice_fs_h} = xyes; - then - FUSB_TECH=linux - else - FUSB_TECH=generic - fi ;; +# $1 is $enable_usrp: +# yes : do these tests +# no : do not do these tests +# "" : do these tests - darwin*) FUSB_TECH=darwin ;; - cygwin*|win*|mingw*) FUSB_TECH=win32 ;; - *) FUSB_TECH=generic ;; - esac +AC_DEFUN([USRP_SET_FUSB_TECHNIQUE],[ + AC_ARG_WITH([fusb-tech], + AC_HELP_STRING([--with-fusb-tech=OS], + [Set fast USB technique (default=auto)]), + [cf_with_fusb_tech="$withval"], + [cf_with_fusb_tech="$host_os"]) + if test [x]$1 != xno; then + case "$cf_with_fusb_tech" in + linux*) + AC_CHECK_HEADER([linux/usbdevice_fs.h], + [x_have_usbdevice_fs_h=yes], + [x_have_usbdevice_fs_h=no]) + if test x${x_have_usbdevice_fs_h} = xyes; then + FUSB_TECH=linux + else + FUSB_TECH=generic + fi + ;; + darwin*) + FUSB_TECH=darwin + ;; + cygwin*|win*|mingw*) + FUSB_TECH=win32 + ;; + *bsd*) + AC_MSG_CHECKING([for RA/WB]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <dev/usb/usb.h>]], + [[struct usb_bulk_ra_wb_opt o; + ioctl(0, USB_SET_BULK_RA, &o);]])], + [FUSB_TECH=ra_wb], + [FUSB_TECH=generic]) + ;; + *) + FUSB_TECH=generic + ;; + esac - AC_MSG_RESULT($FUSB_TECH) - AC_SUBST(FUSB_TECH) + AC_MSG_CHECKING([for fast usb technique to use]) + AC_MSG_RESULT($FUSB_TECH) + AC_SUBST(FUSB_TECH) + fi - AM_CONDITIONAL(FUSB_TECH_darwin, test $FUSB_TECH = darwin) - AM_CONDITIONAL(FUSB_TECH_win32, test $FUSB_TECH = win32) - AM_CONDITIONAL(FUSB_TECH_generic, test $FUSB_TECH = generic) - AM_CONDITIONAL(FUSB_TECH_linux, test $FUSB_TECH = linux) + AM_CONDITIONAL(FUSB_TECH_darwin, test x$FUSB_TECH = xdarwin) + AM_CONDITIONAL(FUSB_TECH_win32, test x$FUSB_TECH = xwin32) + AM_CONDITIONAL(FUSB_TECH_generic, test x$FUSB_TECH = xgeneric) + AM_CONDITIONAL(FUSB_TECH_linux, test x$FUSB_TECH = xlinux) + AM_CONDITIONAL(FUSB_TECH_ra_wb, test x$FUSB_TECH = xra_wb) ]) - diff --git a/gsm-receiver/config/usrp_libusb.m4 b/gsm-receiver/config/usrp_libusb.m4 index 9fe4753..cb3130c 100644 --- a/gsm-receiver/config/usrp_libusb.m4 +++ b/gsm-receiver/config/usrp_libusb.m4 @@ -1,43 +1,48 @@ -# Check for libusb support. -*- Autoconf -*- - -# Copyright 2003 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 3, 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 program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Boston, MA -# 02110-1301, USA. - -AC_DEFUN([USRP_LIBUSB], -[ - AC_REQUIRE([AC_CANONICAL_HOST]) - AC_LANG_PUSH(C) +dnl Copyright 2003,2008 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([USRP_LIBUSB], [ + libusbok=yes + PKG_CHECK_MODULES(USB, libusb, [], [ + AC_LANG_PUSH(C) + + AC_CHECK_HEADERS([usb.h], [], [libusbok=no; AC_MSG_RESULT([USRP requires libusb. usb.h not found. See http://libusb.sf.net])]) + + save_LIBS="$LIBS" + case "$host_os" in + darwin*) + LIBS="$LIBS -lIOKit" + ;; + *) ;; + esac - AC_CHECK_HEADERS([usb.h], - [], - [ AC_MSG_ERROR([USRP requires libusb. usb.h not found, stop. See http://libusb.sf.net]) ] - ) + AC_SEARCH_LIBS(usb_bulk_write, [usb], [USB_LIBS="$LIBS"], [libusbok=no; AC_MSG_RESULT([USRP requires libusb. usb_bulk_write not found. See http://libusb.sf.net])]) - save_LIBS="$LIBS" - case "$host_os" in - darwin*) LIBS="$LIBS -lIOKit" ;; - *) ;; - esac - AC_SEARCH_LIBS(usb_bulk_write, [usb], - [ USB_LIBS="$LIBS" ], - [ AC_MSG_ERROR([USRP requires libusb. usb_bulk_write not found, stop. See http://libusb.sf.net]) ] - ) LIBS="$save_LIBS" - AC_LANG_POP - AC_SUBST(USB_LIBS) + AC_LANG_POP + ]) + + if test x$libusbok = xyes; then + AC_SUBST(USB_LIBS) + ifelse([$1], , :, [$1]) + else + ifelse([$2], , :, [$2]) + fi ]) diff --git a/gsm-receiver/config/usrp_sdcc.m4 b/gsm-receiver/config/usrp_sdcc.m4 index 37ce7c3..86f6429 100644 --- a/gsm-receiver/config/usrp_sdcc.m4 +++ b/gsm-receiver/config/usrp_sdcc.m4 @@ -19,49 +19,57 @@ AC_DEFUN([USRP_SDCC], [ + sdccok=yes AC_CHECK_PROG(XCC, sdcc, sdcc -mmcs51 --no-xinit-opt,no) AC_CHECK_PROG(XAS, asx8051, asx8051 -plosgff,no) if test "$XCC" = "no" -o "$XAS" = "no" ; then - AC_MSG_ERROR([USRP requires sdcc. sdcc not found, stop. See http://sdcc.sf.net]) - fi + AC_MSG_RESULT([USRP requires sdcc. sdcc not found. See http://sdcc.sf.net]) + sdccok=no + else + sdcc_version_min=$1 - sdcc_version_min=$1 + sdcc_version=`sdcc --version 2>&1 | \ + sed 's/\(SDCC.* \)\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)\( .*$\)/\2/'` - sdcc_version=`sdcc --version 2>&1 | \ - sed 's/\(SDCC.* \)\([[0-9]]*\.[[0-9]]*\.[[0-9]]*\)\( .*$\)/\2/'` + AC_MSG_CHECKING([sdcc_version "$sdcc_version"]) - AC_MSG_CHECKING([sdcc_version "$sdcc_version"]) + sdcc_major_version=`echo $sdcc_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sdcc_minor_version=`echo $sdcc_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sdcc_micro_version=`echo $sdcc_version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - sdcc_major_version=`echo $sdcc_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - sdcc_minor_version=`echo $sdcc_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - sdcc_micro_version=`echo $sdcc_version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + sdcc_major_min=`echo $sdcc_version_min | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sdcc_minor_min=`echo $sdcc_version_min | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sdcc_micro_min=`echo $sdcc_version_min | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - sdcc_major_min=`echo $sdcc_version_min | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - sdcc_minor_min=`echo $sdcc_version_min | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - sdcc_micro_min=`echo $sdcc_version_min | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + sdcc_version_proper=`expr \ + "$sdcc_major_version" \> "$sdcc_major_min" \| \ + "$sdcc_major_version" \= "$sdcc_major_min" \& \ + "$sdcc_minor_version" \> "$sdcc_minor_min" \| \ + "$sdcc_major_version" \= "$sdcc_major_min" \& \ + "$sdcc_minor_version" \= "$sdcc_minor_min" \& \ + "$sdcc_micro_version" \>= "$sdcc_micro_min" ` - sdcc_version_proper=`expr \ - "$sdcc_major_version" \> "$sdcc_major_min" \| \ - "$sdcc_major_version" \= "$sdcc_major_min" \& \ - "$sdcc_minor_version" \> "$sdcc_minor_min" \| \ - "$sdcc_major_version" \= "$sdcc_major_min" \& \ - "$sdcc_minor_version" \= "$sdcc_minor_min" \& \ - "$sdcc_micro_version" \>= "$sdcc_micro_min" ` + if test "$sdcc_version_proper" = "1" ; then + AC_MSG_RESULT([$sdcc_major_version.$sdcc_minor_version.$sdcc_micro_version]) + else + sdccok=no + AC_MSG_RESULT([USRP requires sdcc >= $sdcc_version_min. sdcc not found. See http://sdcc.sf.net]) + fi - if test "$sdcc_version_proper" = "1" ; then - AC_MSG_RESULT([$sdcc_major_version.$sdcc_minor_version.$sdcc_micro_version]) - else - AC_MSG_ERROR([USRP requires sdcc >= $sdcc_version_min. sdcc not found, stop. See http://sdcc.sf.net]) + AC_SUBST(XCC) + AC_SUBST(XAS) fi - AC_SUBST(XCC) - AC_SUBST(XAS) - + if test $sdccok = yes; then + ifelse([$2], , :, [$2]) + else + ifelse([$3], , :, [$3]) + fi ]) |