From 287fc41d5f82ff3236aa270689bd55278e2c841a Mon Sep 17 00:00:00 2001 From: jcorgan Date: Fri, 25 Aug 2006 23:58:20 +0000 Subject: [PATCH] Implements ticket:28. See BuildConfiguration for documentation. Merged developer branch jcorgan/ticket-28 into trunk. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3417 221aa14e-8319-0410-a670-987f0aec2ac5 --- Makefile.am | 4 +- config/Makefile.am | 1 + config/grc_build.m4 | 50 +++++++++++++++++ config/grc_ezdop.m4 | 29 +++++----- config/grc_gnuradio_core.m4 | 19 +++---- config/grc_gnuradio_examples.m4 | 9 ++-- config/grc_gr_atsc.m4 | 11 ++-- config/grc_gr_audio_alsa.m4 | 17 +++--- config/grc_gr_audio_jack.m4 | 17 +++--- config/grc_gr_audio_oss.m4 | 21 ++++---- config/grc_gr_audio_osx.m4 | 17 +++--- config/grc_gr_audio_portaudio.m4 | 15 +++--- config/grc_gr_audio_windows.m4 | 17 +++--- config/grc_gr_comedi.m4 | 17 +++--- config/grc_gr_error_correcting_codes.m4 | 11 ++-- config/grc_gr_ezdop.m4 | 15 +++--- config/grc_gr_gsm_fr_vocoder.m4 | 11 ++-- config/grc_gr_radar.m4 | 11 ++-- config/grc_gr_radio_astronomy.m4 | 11 ++-- config/grc_gr_trellis.m4 | 11 ++-- config/grc_gr_usrp.m4 | 20 ++++--- config/grc_gr_video_sdl.m4 | 18 +++---- config/grc_gr_wxgui.m4 | 10 ++-- config/grc_mblock.m4 | 19 +++++-- config/grc_pmt.m4 | 11 ++-- config/grc_usrp.m4 | 72 +++++++++++-------------- config/macosx_audiounit.m4 | 20 ++----- configure.ac | 47 ++++++++-------- 28 files changed, 281 insertions(+), 250 deletions(-) create mode 100644 config/grc_build.m4 diff --git a/Makefile.am b/Makefile.am index 32a7d437..c71c77bd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,5 +26,5 @@ EXTRA_DIST = \ configure \ config.h.in -SUBDIRS = @subdirs@ -DIST_SUBDIRS = @subdirs@ @failed_subdirs@ +SUBDIRS = @build_dirs@ +DIST_SUBDIRS = @build_dirs@ @skipped_dirs@ diff --git a/config/Makefile.am b/config/Makefile.am index f2ad470e..571d311d 100644 --- a/config/Makefile.am +++ b/config/Makefile.am @@ -31,6 +31,7 @@ m4macros = \ cppunit.m4 \ gr_as.m4 \ gr_boost.m4 \ + grc_build.m4 \ grc_gnuradio_core.m4 \ grc_gnuradio_examples.m4 \ grc_gr_atsc.m4 \ diff --git a/config/grc_build.m4 b/config/grc_build.m4 new file mode 100644 index 00000000..e36b2548 --- /dev/null +++ b/config/grc_build.m4 @@ -0,0 +1,50 @@ +dnl 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 2, 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., 59 Temple Place - Suite 330, +dnl Boston, MA 02111-1307, USA. + +# Create --enable-foo argument for named component, create variables as needed +# $1 is component name +AC_DEFUN([GRC_ENABLE],[ + AC_ARG_ENABLE([$1],[ --enable-$1 Fail build if $1 fails configuration],[], + [[enable_]m4_bpatsubst($1,-,_)=$enable_all_components]) +]) + +# Conditionally build named component. +# $1 is component name +# $2 is executed if configuration passes and build is desired +# Use $passed=no to indicate configuration failure +# Any other value of $passed, including blank, assumes success +AC_DEFUN([GRC_BUILD_CONDITIONAL],[ + if test x$passed = xno; then + skipped_dirs="$skipped_dirs $1" + if test x$[enable_]m4_bpatsubst($1,-,_) = xyes; then + AC_MSG_ERROR([Component $1 has errors, stopping.]) + else + AC_MSG_RESULT([Not building component $1.]) + fi + else + if test x$[enable_]m4_bpatsubst($1,-,_) != xno; then + $2 + build_dirs="$build_dirs $1" + AC_MSG_RESULT([Component $1 passed configuration checks, building.]) + else + skipped_dirs="$skipped_dirs $1" + AC_MSG_RESULT([Component $1 passed configuration checks, but not building.]) + fi + fi +]) diff --git a/config/grc_ezdop.m4 b/config/grc_ezdop.m4 index 40336c0e..3ba733ce 100644 --- a/config/grc_ezdop.m4 +++ b/config/grc_ezdop.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_EZDOP],[ - AC_CONFIG_SRCDIR([ezdop/src/host/ezdop/ezdop.h]) + GRC_ENABLE([ezdop]) AC_CONFIG_FILES([ \ ezdop/Makefile \ @@ -31,32 +31,37 @@ AC_DEFUN([GRC_EZDOP],[ ezdop/src/host/tests/Makefile \ ]) - succeeded=yes + passed=yes # Firmware build requires Atmel AVR microcontroller port of GCC AC_PATH_PROG([AVRGCC], [avr-gcc -v], [no]) if test x$AVRGCC = xno; then - succeeded=no + passed=no + AC_MSG_RESULT([ezdop requires avr-gcc, not found.]) fi # ...and binutils AC_PATH_PROG([AVROBJCOPY], [avr-objcopy], [no]) if test x$AVROBJCOPY = xno; then - succeeded=no + passed=no + AC_MSG_RESULT([ezdop requires avr binutils, not found.]) fi # ...and standard library (test not working yet) - #AC_CHECK_HEADERS([avr/io.h],[],[succeeded=no]) + #AC_CHECK_HEADERS([avr/io.h],[], + # [passed=no;AC_MSG_RESULT([ezdop requires avr glibc, not found.])]) # Device access is via libftdi AC_LANG_PUSH(C) - AC_CHECK_HEADERS([ftdi.h],[],[succeeded=no]) + AC_CHECK_HEADERS([ftdi.h],[], + [passed=no;AC_MSG_RESULT([ezdop requires ftdi.h, not found.])]) save_LIBS="$LIBS" - AC_SEARCH_LIBS([ftdi_init], [ftdi],[FTDI_LIBS="$LIBS"],[succeeded=no]) + AC_SEARCH_LIBS([ftdi_init], [ftdi],[FTDI_LIBS="$LIBS"], + [passed=no;AC_MSG_RESULT([ezdop requires libftdi, not found.])]) LIBS="$save_LIBS" AC_LANG_POP - - if test x$succeeded = xyes; then + + GRC_BUILD_CONDITIONAL([ezdop],[ EZDOP_INCLUDES='-I$(top_srcdir)/ezdop/src/host/ezdop/ -I$(top_srcdir)/ezdop/src/firmware/' EZDOP_LIBS='-lezdop' AC_SUBST(FTDI_LIBS) @@ -64,9 +69,5 @@ AC_DEFUN([GRC_EZDOP],[ AC_SUBST(EZDOP_LIBS) AC_SUBST(AVRGCC) AC_SUBST(AVROBJCOPY) - - subdirs="$subdirs ezdop" - else - failed="$failed ezdop" - fi + ]) ]) diff --git a/config/grc_gnuradio_core.m4 b/config/grc_gnuradio_core.m4 index 04d2e29d..9fab4c2a 100644 --- a/config/grc_gnuradio_core.m4 +++ b/config/grc_gnuradio_core.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GNURADIO_CORE],[ - AC_CONFIG_SRCDIR([gnuradio-core/src/lib/runtime/gr_vmcircbuf.cc]) + GRC_ENABLE([gnuradio-core]) AC_CONFIG_FILES([ \ gnuradio-core/Makefile @@ -51,13 +51,14 @@ AC_DEFUN([GRC_GNURADIO_CORE],[ gnuradio-core/src/python/gnuradio/gruimpl/Makefile \ gnuradio-core/src/tests/Makefile \ gnuradio-core/src/utils/Makefile \ - ]) + ]) + + passed=yes + 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]) - 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]) - - dnl kludge up initial swig dependency file - AC_CONFIG_COMMANDS([swig_deps], [touch gnuradio-core/src/lib/swig/gnuradio_swig_python.d]) - - subdirs="$subdirs gnuradio-core" + dnl kludge up initial swig dependency file + AC_CONFIG_COMMANDS([swig_deps], [touch gnuradio-core/src/lib/swig/gnuradio_swig_python.d]) + ]) ]) diff --git a/config/grc_gnuradio_examples.m4 b/config/grc_gnuradio_examples.m4 index 649dd27a..6c7e809a 100644 --- a/config/grc_gnuradio_examples.m4 +++ b/config/grc_gnuradio_examples.m4 @@ -18,9 +18,9 @@ # Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GNURADIO_EXAMPLES],[ - AC_CONFIG_SRCDIR([gnuradio-examples/README]) + GRC_ENABLE([gnuradio-examples]) - AC_CONFIG_FILES([\ + AC_CONFIG_FILES([ \ gnuradio-examples/Makefile \ gnuradio-examples/python/Makefile \ gnuradio-examples/python/audio/Makefile \ @@ -30,7 +30,8 @@ AC_DEFUN([GRC_GNURADIO_EXAMPLES],[ gnuradio-examples/python/mc4020/Makefile \ gnuradio-examples/python/usrp/Makefile \ gnuradio-examples/python/multi_usrp/Makefile \ - ]) + ]) - subdirs="$subdirs gnuradio-examples" + passed=yes + GRC_BUILD_CONDITIONAL([gnuradio-examples]) ]) diff --git a/config/grc_gr_atsc.m4 b/config/grc_gr_atsc.m4 index 2f38ad3c..f49ca7c7 100644 --- a/config/grc_gr_atsc.m4 +++ b/config/grc_gr_atsc.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_ATSC],[ - AC_CONFIG_SRCDIR([gr-atsc/src/lib/atsc.i]) + GRC_ENABLE([gr-atsc]) AC_CONFIG_FILES([\ gr-atsc/Makefile \ @@ -29,8 +29,9 @@ AC_DEFUN([GRC_GR_ATSC],[ gr-atsc/src/python/run_tests \ ]) - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_atsc], [chmod +x gr-atsc/src/python/run_tests]) - - subdirs="$subdirs gr-atsc" + passed=yes + GRC_BUILD_CONDITIONAL([gr-atsc],[ + dnl run_tests is created from run_tests.in. Make it executable. + AC_CONFIG_COMMANDS([run_tests_atsc], [chmod +x gr-atsc/src/python/run_tests]) + ]) ]) diff --git a/config/grc_gr_audio_alsa.m4 b/config/grc_gr_audio_alsa.m4 index 32b1e16b..8b08c9f8 100644 --- a/config/grc_gr_audio_alsa.m4 +++ b/config/grc_gr_audio_alsa.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_AUDIO_ALSA],[ - AC_CONFIG_SRCDIR([gr-audio-alsa/src/audio_alsa.i]) + GRC_ENABLE([gr-audio-alsa]) AC_CONFIG_FILES([ \ gr-audio-alsa/Makefile \ @@ -26,16 +26,13 @@ AC_DEFUN([GRC_GR_AUDIO_ALSA],[ gr-audio-alsa/src/run_tests \ ]) - succeeded=yes - PKG_CHECK_MODULES(ALSA, alsa >= 0.9,[],[succeeded=no]) - if test $succeeded = yes; then - AC_SUBST(ALSA_LIBS) + passed=yes + PKG_CHECK_MODULES(ALSA, alsa >= 0.9,[], + [passed=no;AC_MSG_RESULT([gr-audio-alsa requires package alsa, not found.])]) + GRC_BUILD_CONDITIONAL([gr-audio-alsa],[ + AC_SUBST(ALSA_LIBS) 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]) - subdirs="$subdirs gr-audio-alsa" - else - AC_MSG_RESULT([failed: $ALSA_PKG_ERRORS]) - failed="$failed gr-audio-alsa" - fi + ]) ]) diff --git a/config/grc_gr_audio_jack.m4 b/config/grc_gr_audio_jack.m4 index d8431309..f4795ff3 100644 --- a/config/grc_gr_audio_jack.m4 +++ b/config/grc_gr_audio_jack.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_AUDIO_JACK],[ - AC_CONFIG_SRCDIR([gr-audio-jack/src/audio_jack.i]) + GRC_ENABLE([gr-audio-jack]) AC_CONFIG_FILES([ \ gr-audio-jack/Makefile \ @@ -26,16 +26,13 @@ AC_DEFUN([GRC_GR_AUDIO_JACK],[ gr-audio-jack/src/run_tests \ ]) - succeeded=yes - PKG_CHECK_MODULES(JACK, jack >= 0.8,[],[succeeded=no]) - if test $succeeded = yes; then - AC_SUBST(JACK_LIBS) + passed=yes + PKG_CHECK_MODULES(JACK, jack >= 0.8,[], + [passed=no;AC_MSG_RESULT([gr-audio-jack requires package jack, not found.])]) + GRC_BUILD_CONDITIONAL([gr-audio-jack],[ + AC_SUBST(JACK_LIBS) dnl run_tests is created from run_tests.in. Make it executable. AC_CONFIG_COMMANDS([run_tests_jack], [chmod +x gr-audio-jack/src/run_tests]) - subdirs="$subdirs gr-audio-jack" - else - AC_MSG_RESULT([failed: $JACK_PKG_ERRORS]) - failed="$failed gr-audio-jack" - fi + ]) ]) diff --git a/config/grc_gr_audio_oss.m4 b/config/grc_gr_audio_oss.m4 index 0bee883f..c4963cf3 100644 --- a/config/grc_gr_audio_oss.m4 +++ b/config/grc_gr_audio_oss.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_AUDIO_OSS],[ - AC_CONFIG_SRCDIR([gr-audio-oss/src/audio_oss.i]) + GRC_ENABLE([gr-audio-oss]) AC_CONFIG_FILES([ \ gr-audio-oss/Makefile \ @@ -26,27 +26,24 @@ AC_DEFUN([GRC_GR_AUDIO_OSS],[ gr-audio-oss/src/run_tests \ ]) - succeeded=yes - + passed=yes case $target in *-*-netbsd*) - AC_HAVE_LIBRARY(ossaudio,[],[succeeded=no]) - if test $succeeded = yes; then + AC_HAVE_LIBRARY(ossaudio,[], + [passed=no;AC_MSG_RESULT([gr-audio-oss requires library ossaudio, not found.])]) + if test x$passed != xno; then OSS_LIBS=-lossaudio AC_MSG_RESULT([Using OSS library $OSS_LIBS]) fi ;; *) - AC_CHECK_HEADER(sys/soundcard.h,[],[succeeded=no]) + AC_CHECK_HEADER(sys/soundcard.h,[], + [passed=no;AC_MSG_RESULT([gr-audio-oss requires sys/soundcard.h, not found.])]) esac - if test $succeeded = yes; then + GRC_BUILD_CONDITIONAL([gr-audio-oss],[ AC_SUBST(OSS_LIBS) dnl run_tests is created from run_tests.in. Make it executable. AC_CONFIG_COMMANDS([run_tests_oss], [chmod +x gr-audio-oss/src/run_tests]) - subdirs="$subdirs gr-audio-oss" - else - AC_MSG_RESULT([failed: $OSS_PKG_ERRORS]) - failed="$failed gr-audio-oss" - fi + ]) ]) diff --git a/config/grc_gr_audio_osx.m4 b/config/grc_gr_audio_osx.m4 index 0f45ff62..66ba0622 100644 --- a/config/grc_gr_audio_osx.m4 +++ b/config/grc_gr_audio_osx.m4 @@ -18,21 +18,20 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_AUDIO_OSX],[ - AC_CONFIG_SRCDIR([gr-audio-osx/src/audio_osx.i]) - + GRC_ENABLE([gr-audio-osx]) + AC_CONFIG_FILES([ \ gr-audio-osx/Makefile \ gr-audio-osx/src/Makefile \ gr-audio-osx/src/run_tests \ ]) - succeeded=yes - MACOSX_AUDIOUNIT([],[succeeded=no]) - if test $succeeded = yes; then + passed=yes + MACOSX_AUDIOUNIT([], + [passed=no;AC_MSG_RESULT([gr-audio-osx requires AudioUnit, not found.])]) + + GRC_BUILD_CONDITIONAL([gr-audio-osx],[ dnl run_tests is created from run_tests.in. Make it executable. AC_CONFIG_COMMANDS([run_tests_osx], [chmod +x gr-audio-osx/src/run_tests]) - subdirs="$subdirs gr-audio-osx" - else - failed="$failed gr-audio-osx" - fi + ]) ]) diff --git a/config/grc_gr_audio_portaudio.m4 b/config/grc_gr_audio_portaudio.m4 index 19dfaa2a..fc9e5c5e 100644 --- a/config/grc_gr_audio_portaudio.m4 +++ b/config/grc_gr_audio_portaudio.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_AUDIO_PORTAUDIO],[ - AC_CONFIG_SRCDIR([gr-audio-portaudio/src/audio_portaudio.i]) + GRC_ENABLE([gr-audio-portaudio]) AC_CONFIG_FILES([ \ gr-audio-portaudio/Makefile \ @@ -26,16 +26,13 @@ AC_DEFUN([GRC_GR_AUDIO_PORTAUDIO],[ gr-audio-portaudio/src/run_tests \ ]) - succeeded=yes - PKG_CHECK_MODULES(PORTAUDIO, portaudio-2.0 >= 19,[],[succeeded=no]) + passed=yes + PKG_CHECK_MODULES(PORTAUDIO, portaudio-2.0 >= 19,[], + [passed=no;AC_MSG_RESULT([gr-audio-portaudio requires package portaudio, not found.])]) - if test $succeeded = yes; then + GRC_BUILD_CONDITIONAL([gr-audio-portaudio],[ AC_SUBST(PORTAUDIO_LIBS) dnl run_tests is created from run_tests.in. Make it executable. AC_CONFIG_COMMANDS([run_tests_portaudio], [chmod +x gr-audio-portaudio/src/run_tests]) - subdirs="$subdirs gr-audio-portaudio" - else - AC_MSG_RESULT([failed: $PORTAUDIO_PKG_ERRORS]) - failed="$failed gr-audio-portaudio" - fi + ]) ]) diff --git a/config/grc_gr_audio_windows.m4 b/config/grc_gr_audio_windows.m4 index 64d482e8..79aa5784 100644 --- a/config/grc_gr_audio_windows.m4 +++ b/config/grc_gr_audio_windows.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_AUDIO_WINDOWS],[ - AC_CONFIG_SRCDIR([gr-audio-windows/src/audio_windows.i]) + GRC_ENABLE([gr-audio-windows]) AC_CONFIG_FILES([ \ gr-audio-windows/Makefile \ @@ -26,17 +26,14 @@ AC_DEFUN([GRC_GR_AUDIO_WINDOWS],[ gr-audio-windows/src/run_tests \ ]) - succeeded=yes - AC_HAVE_LIBRARY(winmm,[],[succeeded=no]) + passed=yes + AC_HAVE_LIBRARY(winmm,[], + [passed=no;AC_MSG_RESULT([gr-audio-windows requires library winmm, not found.])]) - if test $succeeded = yes; then + GRC_BUILD_CONDITIONAL([gr-audio-windows],[ WINAUDIO_LIBS=-lwinmm AC_SUBST(WINAUDIO_LIBS) - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_windows], [chmod +x gr-audio-windows/src/run_tests]) - subdirs="$subdirs gr-audio-windows" - else - failed="$failed gr-audio-windows" - fi + AC_CONFIG_COMMANDS([run_tests_audio_windows], [chmod +x gr-audio-windows/src/run_tests]) + ]) ]) diff --git a/config/grc_gr_comedi.m4 b/config/grc_gr_comedi.m4 index 22e98cd6..062885d0 100644 --- a/config/grc_gr_comedi.m4 +++ b/config/grc_gr_comedi.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_COMEDI],[ - AC_CONFIG_SRCDIR([gr-comedi/src/comedi.i]) + GRC_ENABLE([gr-comedi]) AC_CONFIG_FILES([ \ gr-comedi/Makefile \ @@ -26,16 +26,13 @@ AC_DEFUN([GRC_GR_COMEDI],[ gr-comedi/src/run_tests \ ]) - succeeded=yes - PKG_CHECK_MODULES(COMEDI, comedilib >= 0.7,[],[succeeded=no]) - if test $succeeded = yes; then - AC_SUBST(COMEDI_LIBS) + passed=yes + PKG_CHECK_MODULES(COMEDI, comedilib >= 0.7,[], + [passed=no;AC_MSG_RESULT([gr-comedi requires comedilib, not found.])]) + GRC_BUILD_CONDITIONAL([gr-comedi],[ + AC_SUBST(COMEDI_LIBS) dnl run_tests is created from run_tests.in. Make it executable. AC_CONFIG_COMMANDS([run_tests_comedi], [chmod +x gr-comedi/src/run_tests]) - subdirs="$subdirs gr-comedi" - else - AC_MSG_WARN([$COMEDI_PKG_ERRORS]) - failed="$failed gr-comedi" - fi + ]) ]) diff --git a/config/grc_gr_error_correcting_codes.m4 b/config/grc_gr_error_correcting_codes.m4 index 63048005..94275b84 100644 --- a/config/grc_gr_error_correcting_codes.m4 +++ b/config/grc_gr_error_correcting_codes.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_ERROR_CORRECTING_CODES],[ - AC_CONFIG_SRCDIR([gr-error-correcting-codes/src/lib/ecc.i]) + GRC_ENABLE([gr-error-correcting-codes]) AC_CONFIG_FILES([\ gr-error-correcting-codes/Makefile \ @@ -31,8 +31,9 @@ AC_DEFUN([GRC_GR_ERROR_CORRECTING_CODES],[ gr-error-correcting-codes/src/python/run_tests \ ]) - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_error_correcting_codes], [chmod +x gr-error-correcting-codes/src/python/run_tests]) - - subdirs="$subdirs gr-error-correcting-codes" + passed=yes + GRC_BUILD_CONDITIONAL([gr-error-correcting-codes],[ + dnl run_tests is created from run_tests.in. Make it executable. + AC_CONFIG_COMMANDS([run_tests_error_correcting_codes], [chmod +x gr-error-correcting-codes/src/python/run_tests]) + ]) ]) diff --git a/config/grc_gr_ezdop.m4 b/config/grc_gr_ezdop.m4 index 42988aa5..23822f5d 100644 --- a/config/grc_gr_ezdop.m4 +++ b/config/grc_gr_ezdop.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_EZDOP],[ - AC_CONFIG_SRCDIR([gr-ezdop/src/lib/ezdop.i]) + GRC_ENABLE([gr-ezdop]) AC_CONFIG_FILES([ \ gr-ezdop/Makefile \ @@ -28,21 +28,18 @@ AC_DEFUN([GRC_GR_EZDOP],[ gr-ezdop/src/python/run_tests \ ]) + passed=yes # Don't do gr-ezdop if ezdop failed # There *has* to be a better way to check if a value is in a string - succeeded=yes - for dir in $failed + for dir in $skipped_dirs do if test $dir = ezdop; then - succeeded=no + passed=no fi done - if test $succeeded = yes; then + GRC_BUILD_CONDITIONAL([gr-ezdop],[ dnl run_tests is created from run_tests.in. Make it executable. AC_CONFIG_COMMANDS([run_tests_ezdop], [chmod +x gr-ezdop/src/python/run_tests]) - subdirs="$subdirs gr-ezdop" - else - failed="$failed gr-ezdop" - fi + ]) ]) diff --git a/config/grc_gr_gsm_fr_vocoder.m4 b/config/grc_gr_gsm_fr_vocoder.m4 index 3349dcc7..3d99fb51 100644 --- a/config/grc_gr_gsm_fr_vocoder.m4 +++ b/config/grc_gr_gsm_fr_vocoder.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_GSM_FR_VOCODER],[ - AC_CONFIG_SRCDIR([gr-gsm-fr-vocoder/src/lib/gsm_full_rate.i]) + GRC_ENABLE([gr-gsm-fr-vocoder]) AC_CONFIG_FILES([\ gr-gsm-fr-vocoder/Makefile \ @@ -29,8 +29,9 @@ AC_DEFUN([GRC_GR_GSM_FR_VOCODER],[ gr-gsm-fr-vocoder/src/python/run_tests \ ]) - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_gsm], [chmod +x gr-gsm-fr-vocoder/src/python/run_tests]) - - subdirs="$subdirs gr-gsm-fr-vocoder" + passed=yes + GRC_BUILD_CONDITIONAL([gr-gsm-fr-vocoder],[ + dnl run_tests is created from run_tests.in. Make it executable. + AC_CONFIG_COMMANDS([run_tests_gsm], [chmod +x gr-gsm-fr-vocoder/src/python/run_tests]) + ]) ]) diff --git a/config/grc_gr_radar.m4 b/config/grc_gr_radar.m4 index 139d9fe2..e1b5a1f6 100644 --- a/config/grc_gr_radar.m4 +++ b/config/grc_gr_radar.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_RADAR],[ - AC_CONFIG_SRCDIR([gr-radar/src/python/usrp_rx_radar.py]) + GRC_ENABLE([gr-radar]) AC_CONFIG_FILES([\ gr-radar/Makefile \ @@ -29,8 +29,9 @@ AC_DEFUN([GRC_GR_RADAR],[ gr-radar/src/python/run_tests \ ]) - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_radar], [chmod +x gr-radar/src/python/run_tests]) - - subdirs="$subdirs gr-radar" + passed=yes + GRC_BUILD_CONDITIONAL([gr-radar],[ + dnl run_tests is created from run_tests.in. Make it executable. + AC_CONFIG_COMMANDS([run_tests_radar], [chmod +x gr-radar/src/python/run_tests]) + ]) ]) diff --git a/config/grc_gr_radio_astronomy.m4 b/config/grc_gr_radio_astronomy.m4 index 0b445dbc..16744d5e 100644 --- a/config/grc_gr_radio_astronomy.m4 +++ b/config/grc_gr_radio_astronomy.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_RADIO_ASTRONOMY],[ - AC_CONFIG_SRCDIR([gr-radio-astronomy/src/lib/ra.i]) + GRC_ENABLE([gr-radio-astronomy]) AC_CONFIG_FILES([\ gr-radio-astronomy/Makefile \ @@ -28,8 +28,9 @@ AC_DEFUN([GRC_GR_RADIO_ASTRONOMY],[ gr-radio-astronomy/src/python/run_tests \ ]) - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_astronomy], [chmod +x gr-radio-astronomy/src/python/run_tests]) - - subdirs="$subdirs gr-radio-astronomy" + passed=yes + GRC_BUILD_CONDITIONAL([gr-radio-astronomy],[ + dnl run_tests is created from run_tests.in. Make it executable. + AC_CONFIG_COMMANDS([run_tests_astronomy], [chmod +x gr-radio-astronomy/src/python/run_tests]) + ]) ]) diff --git a/config/grc_gr_trellis.m4 b/config/grc_gr_trellis.m4 index 93cb5876..9137574b 100644 --- a/config/grc_gr_trellis.m4 +++ b/config/grc_gr_trellis.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_TRELLIS],[ - AC_CONFIG_SRCDIR([gr-trellis/src/lib/trellis.i]) + GRC_ENABLE([gr-trellis]) AC_CONFIG_FILES([\ gr-trellis/Makefile \ @@ -29,8 +29,9 @@ AC_DEFUN([GRC_GR_TRELLIS],[ gr-trellis/src/python/run_tests \ ]) - dnl run_tests is created from run_tests.in. Make it executable. - AC_CONFIG_COMMANDS([run_tests_gr_trellis], [chmod +x gr-trellis/src/python/run_tests]) - - subdirs="$subdirs gr-trellis" + passed=yes + GRC_BUILD_CONDITIONAL([gr-trellis],[ + dnl run_tests is created from run_tests.in. Make it executable. + AC_CONFIG_COMMANDS([run_tests_gr_trellis], [chmod +x gr-trellis/src/python/run_tests]) + ]) ]) diff --git a/config/grc_gr_usrp.m4 b/config/grc_gr_usrp.m4 index 13aa2cb4..5039f524 100644 --- a/config/grc_gr_usrp.m4 +++ b/config/grc_gr_usrp.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_USRP],[ - AC_CONFIG_SRCDIR([gr-usrp/src/usrp1.i]) + GRC_ENABLE([gr-usrp]) AC_CONFIG_FILES([ \ gr-usrp/Makefile \ @@ -26,21 +26,19 @@ AC_DEFUN([GRC_GR_USRP],[ gr-usrp/src/run_tests \ ]) - # Don't do gr-usrp if usrp failed + passed=yes + # Don't do gr-usrp if usrp skipped # There *has* to be a better way to check if a value is in a string - succeeded=yes - for dir in $failed + for dir in $skipped_dirs do - if test $dir = usrp; then - succeeded=no + if test x$dir = xusrp; then + AC_MSG_RESULT([Component gr-usrp requires usrp, which is not being built.]) + passed=no fi done - if test $succeeded = yes; then + GRC_BUILD_CONDITIONAL([gr-usrp],[ dnl run_tests is created from run_tests.in. Make it executable. AC_CONFIG_COMMANDS([run_tests_usrp], [chmod +x gr-usrp/src/run_tests]) - subdirs="$subdirs gr-usrp" - else - failed="$failed gr-usrp" - fi + ]) ]) diff --git a/config/grc_gr_video_sdl.m4 b/config/grc_gr_video_sdl.m4 index b0ca9434..f764b0b5 100644 --- a/config/grc_gr_video_sdl.m4 +++ b/config/grc_gr_video_sdl.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_VIDEO_SDL],[ - AC_CONFIG_SRCDIR([gr-video-sdl/src/video_sdl.i]) + GRC_ENABLE([gr-video-sdl]) AC_CONFIG_FILES([ \ gr-video-sdl/Makefile \ @@ -26,21 +26,15 @@ AC_DEFUN([GRC_GR_VIDEO_SDL],[ gr-video-sdl/src/run_tests \ ]) - succeeded=yes - dnl Check for SDL + passed=yes SDL_VERSION=1.2.0 - AM_PATH_SDL($SDL_VERSION,[],[succeeded=no]) + AM_PATH_SDL($SDL_VERSION,[], + [passed=no;AC_MSG_RESULT([gr-video-sdl requires library sdl, not found.])]) - if test $succeeded = yes; then - #AM_CFLAGS="$AM_CFLAGS $SDL_CFLAGS" - #AM_LDFLAGS="$AM_LDFLAGS $SDL_LIBS" + GRC_BUILD_CONDITIONAL([gr-video-sdl],[ AC_SUBST(SDL_CFLAGS) AC_SUBST(SDL_LIBS) - dnl run_tests is created from run_tests.in. Make it executable. AC_CONFIG_COMMANDS([run_tests_sdl], [chmod +x gr-video-sdl/src/run_tests]) - subdirs="$subdirs gr-video-sdl" - else - failed="$failed gr-video-sdl" - fi + ]) ]) diff --git a/config/grc_gr_wxgui.m4 b/config/grc_gr_wxgui.m4 index f48fb2ab..c9eaec40 100644 --- a/config/grc_gr_wxgui.m4 +++ b/config/grc_gr_wxgui.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_GR_WXGUI],[ - AC_CONFIG_SRCDIR([gr-wxgui/src/python/stdgui.py]) + GRC_ENABLE([gr-wxgui]) AC_CONFIG_FILES([ \ gr-wxgui/Makefile \ @@ -26,9 +26,13 @@ AC_DEFUN([GRC_GR_WXGUI],[ gr-wxgui/src/python/Makefile \ ]) + # FIXME: this breaks pkgsrc by calling python without a version number + # gdt--patch welcome :-) if python -c 'import wx'; then - subdirs="$subdirs gr-wxgui" + passed=yes else - failed="$failed gr-wxgui" + passed=no fi + + GRC_BUILD_CONDITIONAL([gr-wxgui]) ]) diff --git a/config/grc_mblock.m4 b/config/grc_mblock.m4 index b98fb790..a46875ea 100644 --- a/config/grc_mblock.m4 +++ b/config/grc_mblock.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_MBLOCK],[ - AC_CONFIG_SRCDIR([mblock/src/lib/mb_mblock.h]) + GRC_ENABLE([mblock]) AC_CONFIG_FILES([\ mblock/Makefile \ @@ -27,8 +27,19 @@ AC_DEFUN([GRC_MBLOCK],[ mblock/src/lib/Makefile ]) - dnl run_tests is created from run_tests.in. Make it executable. - dnl AC_CONFIG_COMMANDS([run_tests_mblock], [chmod +x mblock/src/python/run_tests]) + passed=yes + # Don't do mblock if pmt skipped + # There *has* to be a better way to check if a value is in a string + for dir in $skipped_dirs + do + if test x$dir = xpmt; then + AC_MSG_RESULT([Component mblock requires pmt, which is not being built.]) + passed=no + fi + done - subdirs="$subdirs mblock" + GRC_BUILD_CONDITIONAL([mblock],[ + dnl run_tests is created from run_tests.in. Make it executable. + dnl AC_CONFIG_COMMANDS([run_tests_mblock], [chmod +x mblock/src/python/run_tests]) + ]) ]) diff --git a/config/grc_pmt.m4 b/config/grc_pmt.m4 index 7484b745..db8396e5 100644 --- a/config/grc_pmt.m4 +++ b/config/grc_pmt.m4 @@ -18,7 +18,7 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_PMT],[ - AC_CONFIG_SRCDIR([pmt/src/lib/pmt.h]) + GRC_ENABLE([pmt]) AC_CONFIG_FILES([\ pmt/Makefile \ @@ -27,8 +27,9 @@ AC_DEFUN([GRC_PMT],[ pmt/src/lib/Makefile ]) - dnl run_tests is created from run_tests.in. Make it executable. - dnl AC_CONFIG_COMMANDS([run_tests_pmt], [chmod +x pmt/src/python/run_tests]) - - subdirs="$subdirs pmt" + passed=yes + GRC_BUILD_CONDITIONAL([pmt],[ + dnl run_tests is created from run_tests.in. Make it executable. + dnl AC_CONFIG_COMMANDS([run_tests_pmt], [chmod +x pmt/src/python/run_tests]) + ]) ]) diff --git a/config/grc_usrp.m4 b/config/grc_usrp.m4 index 88290f7a..2468ad39 100644 --- a/config/grc_usrp.m4 +++ b/config/grc_usrp.m4 @@ -18,57 +18,47 @@ dnl the Free Software Foundation, Inc., 59 Temple Place - Suite 330, dnl Boston, MA 02111-1307, USA. AC_DEFUN([GRC_USRP],[ - AC_CONFIG_SRCDIR([usrp/host/lib/usrp_prims.h]) + GRC_ENABLE([usrp]) AC_CONFIG_FILES([ \ - usrp/Makefile \ - usrp/usrp.pc \ - usrp/usrp.iss \ - usrp/doc/Doxyfile \ - usrp/doc/Makefile \ - usrp/doc/other/Makefile \ - usrp/host/Makefile \ - usrp/host/misc/Makefile \ - usrp/host/lib/Makefile \ - usrp/host/lib/std_paths.h \ - usrp/host/swig/Makefile \ - usrp/host/apps/Makefile \ - usrp/firmware/Makefile \ - usrp/firmware/include/Makefile \ - usrp/firmware/lib/Makefile \ - usrp/firmware/src/Makefile \ - usrp/firmware/src/common/Makefile \ - usrp/firmware/src/usrp2/Makefile \ - usrp/fpga/Makefile \ - usrp/fpga/rbf/Makefile \ + usrp/Makefile \ + usrp/usrp.pc \ + usrp/usrp.iss \ + usrp/doc/Doxyfile \ + usrp/doc/Makefile \ + usrp/doc/other/Makefile \ + usrp/host/Makefile \ + usrp/host/misc/Makefile \ + usrp/host/lib/Makefile \ + usrp/host/lib/std_paths.h \ + usrp/host/swig/Makefile \ + usrp/host/apps/Makefile \ + usrp/firmware/Makefile \ + usrp/firmware/include/Makefile \ + usrp/firmware/lib/Makefile \ + usrp/firmware/src/Makefile \ + usrp/firmware/src/common/Makefile \ + usrp/firmware/src/usrp2/Makefile \ + usrp/fpga/Makefile \ + usrp/fpga/rbf/Makefile \ ]) - AC_CHECK_PROG([XMLTO],[xmlto],[yes],[]) - AM_CONDITIONAL(HAS_XMLTO, test x$XMLTO = xyes) - # gnulib. # FIXME: this needs to fail gracefully and continue, not implemented yet UTILS_FUNC_MKSTEMP - succeeded=yes - dnl Checks for library functions. - USRP_LIBUSB([],[succeeded=no]) - USRP_SET_FUSB_TECHNIQUE([],[succeeded=no]) - - dnl check for firmware cross compilation tools - dnl check for SDCC 2.4.0 - USRP_SDCC([2.4.0],[],[succeeded=no]) - + # These checks don't fail + AC_CHECK_PROG([XMLTO],[xmlto],[yes],[]) + AM_CONDITIONAL([HAS_XMLTO], [test x$XMLTO = xyes]) + AC_C_BIGENDIAN + AC_CHECK_HEADERS([byteswap.h]) AC_CHECK_FUNCS([getrusage sched_setscheduler]) AC_CHECK_FUNCS([sigaction snprintf]) - dnl we use these to handle possible byteswapping to and from the USRP. - AC_CHECK_HEADERS([byteswap.h]) - AC_C_BIGENDIAN + passed=yes + USRP_LIBUSB([],[passed=no;AC_MSG_RESULT([Unable to configure USB dependency.])]) + USRP_SET_FUSB_TECHNIQUE([],[passed=no;AC_MSG_RESULT([Unable to set fast USB technique.])]) + USRP_SDCC([2.4.0],[],[passed=no;AC_MSG_RESULT([Unable to find firmware compiler.])]) - if test $succeeded = yes; then - subdirs="$subdirs usrp" - else - failed="$failed usrp" - fi + GRC_BUILD_CONDITIONAL([usrp]) ]) diff --git a/config/macosx_audiounit.m4 b/config/macosx_audiounit.m4 index 313feb3b..8b0d63a0 100644 --- a/config/macosx_audiounit.m4 +++ b/config/macosx_audiounit.m4 @@ -22,24 +22,14 @@ AC_DEFUN([MACOSX_AUDIOUNIT], darwin*);; *) audiounitok=no - AC_MSG_WARN([gr-audio-osx requires darwin or MacOS X.]) + AC_MSG_RESULT([gr-audio-osx requires darwin or MacOS X.]) esac - AC_CHECK_HEADERS([AudioUnit/AudioUnit.h], - [], - [ - audiounitok=no, - AC_MSG_WARN([gr-audio-osx requires AudioUnit/AudioUnit.h, which is available on MacOS X.]) - ] - ) + AC_CHECK_HEADERS([AudioUnit/AudioUnit.h],[], + [audiounitok=no;AC_MSG_RESULT([gr-audio-osx requires AudioUnit/AudioUnit.h, which is available on MacOS X.])]) - AC_CHECK_HEADERS([AudioToolbox/AudioToolbox.h], - [], - [ - audiounitok=no, - AC_MSG_WARN([gr-audio-osx requires AudioToolbox/AudioToolbox.h, which is available on MacOS X.]) - ] - ) + AC_CHECK_HEADERS([AudioToolbox/AudioToolbox.h],[], + [audiounitok=no;AC_MSG_RESULT([gr-audio-osx requires AudioToolbox/AudioToolbox.h, which is available on MacOS X.])]) if test $audiounitok = yes; then ifelse([$1], , :, [$1]) diff --git a/configure.ac b/configure.ac index dcec3b0e..4495898b 100644 --- a/configure.ac +++ b/configure.ac @@ -23,6 +23,7 @@ AM_CONFIG_HEADER(config.h) AC_CANONICAL_HOST AC_CANONICAL_TARGET([]) AM_INIT_AUTOMAKE(gnuradio,2.8svn) +AC_CONFIG_SRCDIR([gnuradio-core/src/lib/runtime/gr_vmcircbuf.cc]) GR_X86_64 dnl check for lib64 suffix LF_CONFIGURE_CC @@ -149,7 +150,12 @@ AC_SUBST(DEFINES) dnl Component specific configuration dnl The order of the GR_ macros determines the order of compilation -subdirs="config" +AC_ARG_ENABLE( + [all-components], + [ --enable-all-components Build all components or stop on failed dependencies] +) + +build_dirs="config" GRC_GNURADIO_CORE GRC_GNURADIO_EXAMPLES GRC_USRP @@ -158,55 +164,54 @@ GRC_GR_AUDIO_ALSA GRC_GR_AUDIO_JACK GRC_GR_AUDIO_OSS GRC_GR_AUDIO_OSX -GRC_GR_AUDIO_PORTAUDIO dnl ***NOT TESTED*** -GRC_GR_AUDIO_WINDOWS dnl ***NOT TESTED*** +GRC_GR_AUDIO_PORTAUDIO +GRC_GR_AUDIO_WINDOWS GRC_GR_ATSC GRC_GR_COMEDI -dnl GRC_GR_ERROR_CORRECTING_CODES dnl disabled until fix for ticket:36 +GRC_GR_ERROR_CORRECTING_CODES GRC_GR_GSM_FR_VOCODER GRC_GR_RADAR GRC_GR_RADIO_ASTRONOMY +GRC_GR_TRELLIS GRC_GR_VIDEO_SDL GRC_GR_WXGUI GRC_PMT GRC_MBLOCK dnl this must come after GRC_PMT -GRC_GR_TRELLIS GRC_EZDOP GRC_GR_EZDOP dnl this must come after GRC_EZDOP -dnl Has list of successfully configured components -AC_SUBST([subdirs],$subdirs) -AC_SUBST([failed_subdirs], $failed) +# Each component is now either to be built, was skipped, or failed dependencies +AC_SUBST([build_dirs], [$build_dirs]) +AC_SUBST([skipped_dirs], [$skipped_dirs]) AC_CONFIG_FILES([\ - Makefile \ - config/Makefile + Makefile \ + config/Makefile ]) AC_OUTPUT echo -echo "*******************************************************************" +echo "*********************************************************************" echo The following GNU Radio components have been successfully configured: echo -for dir in $subdirs +for dir in $build_dirs do echo $dir done echo -if test "$failed" != ""; then - echo However, the following components did not configure successfully due to - echo missing dependencies: +echo You my now run the 'make' command to build these components. +echo +if test "$skipped_dirs" != ""; then + echo "*********************************************************************" + echo The following components were skipped either because you asked not + echo to build them or they didn\'t pass configuration checks: echo - for dir in $failed + for dir in $skipped_dirs do echo $dir done echo - echo You may still run the 'make' command to build the successfully configured - echo components. + echo These components will not be built. echo - #exit 1 fi -echo You my now run the 'make' command to build these packages. -echo -- 2.30.2