diff options
-rw-r--r-- | CMakeLists.txt | 33 | ||||
-rw-r--r-- | cmake/Modules/CMakeOverloads.cmake | 69 | ||||
-rw-r--r-- | cmake/Modules/FindCppUnit.cmake | 7 | ||||
-rw-r--r-- | gr-blocks/lib/tuntap_pdu_impl.cc | 2 | ||||
-rw-r--r-- | gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc | 7 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/pub_msg_sink.h | 2 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/pub_sink.h | 2 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/pull_msg_source.h | 2 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/pull_source.h | 2 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/push_msg_sink.h | 2 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/push_sink.h | 2 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/rep_msg_sink.h | 2 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/rep_sink.h | 2 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/req_msg_source.h | 2 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/req_source.h | 2 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/sub_msg_source.h | 2 | ||||
-rw-r--r-- | gr-zeromq/include/gnuradio/zeromq/sub_source.h | 2 |
17 files changed, 121 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 006463298b..5691d74176 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,17 +56,16 @@ IF (NOT MSVC) SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O2") ENDIF() -# Set C/C++ standard for all targets -# NOTE: Starting with cmake v3.1 this should be used: -# set(CMAKE_C_STANDARD 90) -# set(CMAKE_CXX_STANDARD 98) +# Configure C++ standard if not externally specified (will actually be +# set after CppUnit check below). Use the variable CMAKE_CXX_STANDARD +# since it will actually be used for this purposes starting in CMake 3.1. IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") + SET(CMAKE_CXX_STANDARD 98) ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") + SET(CMAKE_CXX_STANDARD 98) ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98") + SET(CMAKE_CXX_STANDARD 98) ELSE() message(warning "C++ standard could not be set because compiler is not GNU, Clang or MSVC.") ENDIF() @@ -81,6 +80,7 @@ ELSE() message(warning "C standard could not be set because compiler is not GNU, Clang or MSVC.") ENDIF() + # Set cmake policies. # This will suppress developer warnings during the cmake process that can occur # if a newer cmake version than the minimum is used. @@ -118,6 +118,12 @@ set(EXPORT_FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake) file(WRITE ${EXPORT_FILE}) #blank the file (subdirs will append) ######################################################################## +# Incorporate CMake function/macros overloading. +######################################################################## + +include(CMakeOverloads) + +######################################################################## # Compiler specific setup ######################################################################## include(GrMiscUtils) #compiler flag check @@ -310,6 +316,19 @@ GR_REGISTER_COMPONENT("testing-support" ENABLE_TESTING CPPUNIT_FOUND ) +# check if CppUnit version is 1.14.0 or greater; requires c++11 ... + +if(CPPUNIT_FOUND AND NOT "${CPPUNIT_VERSION}" VERSION_LESS "1.14.0") + message(WARNING "\nWarning: CppUnit version is ${CPPUNIT_VERSION} which requires C++11 for building. Trying to set CMake internally to use C++11 ...") + SET(CMAKE_CXX_STANDARD 11) +endif() + +# if cmake version is < 3.1, explicitly set C++ standard to use. + +if(${CMAKE_VERSION} VERSION_LESS "3.1") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++${CMAKE_CXX_STANDARD}") +endif() + ######################################################################## # Add optional dlls specified in DLL_PATHS ######################################################################## diff --git a/cmake/Modules/CMakeOverloads.cmake b/cmake/Modules/CMakeOverloads.cmake new file mode 100644 index 0000000000..450d44c95a --- /dev/null +++ b/cmake/Modules/CMakeOverloads.cmake @@ -0,0 +1,69 @@ +# Copyright 2017 Free Software Foundation, Inc. +# +# This file is part of GNU Radio +# +# GNU Radio is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# GNU Radio is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Radio; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. + +######################################################################## +# This file contains functions that override those provided by CMake. +# We do this to allow for more generic use of these functions than as +# provided by CMake. +######################################################################## + +if(DEFINED __INCLUDED_CMAKE_OVERLOADS) + return() +endif() +set(__INCLUDED_CMAKE_OVERLOADS TRUE) + +# overload INCLUDE_DIRECTORIES to be a little smarter +# +# NOTE: moving all include directories to either BEFORE (internal to +# source or build) or AFTER (external to source or build) will work in +# general. The primary time it could fail is when include ordering is +# required to find a specific version of a header when multiple of the +# same name are available in the various include directories. This +# situation seems like it's unlikely, so we ignore it here. + +macro(INCLUDE_DIRECTORIES) + # for each provided include directory ... + foreach(inc_dir ${ARGN}) + + # is this dir the literal string "BEFORE" or "AFTER"? + string(FIND ${inc_dir} BEFORE IS_BEFORE) + string(FIND ${inc_dir} AFTER IS_AFTER) + if(NOT ${IS_BEFORE} EQUAL 0 AND NOT ${IS_AFTER} EQUAL 0) + + # not "BEFORE" or "AFTER"; a real directory. + # get absolute path of this include directory + get_filename_component(inc_dir_abs ${inc_dir} ABSOLUTE) + + # is this include directory located within the SOURCE or BUILD? + string(FIND ${inc_dir_abs} ${CMAKE_SOURCE_DIR} IS_IN_SOURCE) + string(FIND ${inc_dir_abs} ${CMAKE_BINARY_DIR} IS_IN_BINARY) + if(${IS_IN_SOURCE} EQUAL 0 OR ${IS_IN_BINARY} EQUAL 0) + # yes: local SOURCE or BINARY; internal. + # call the overloaded INCLUDE_DIRECTORIES, + # prepending this internal directory. + _include_directories(BEFORE ${inc_dir_abs}) + else() + # no: not SOURCE or BUILD; must be external. + # call the overloaded INCLUDE_DIRECTORIES, + # appending this external directory. + _include_directories(AFTER ${inc_dir_abs}) + endif() + endif() + endforeach() +endmacro(INCLUDE_DIRECTORIES) diff --git a/cmake/Modules/FindCppUnit.cmake b/cmake/Modules/FindCppUnit.cmake index f93ade3412..4e9469f9f6 100644 --- a/cmake/Modules/FindCppUnit.cmake +++ b/cmake/Modules/FindCppUnit.cmake @@ -37,3 +37,10 @@ LIST(APPEND CPPUNIT_LIBRARIES ${CMAKE_DL_LIBS}) INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) MARK_AS_ADVANCED(CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS) + + +# set version to be useable by calling script + +IF(CPPUNIT_FOUND) + set(CPPUNIT_VERSION ${PC_CPPUNIT_VERSION} CACHE INTERNAL "CppUnit Version" FORCE) +ENDIF() diff --git a/gr-blocks/lib/tuntap_pdu_impl.cc b/gr-blocks/lib/tuntap_pdu_impl.cc index 391b33937a..7bd0889d5e 100644 --- a/gr-blocks/lib/tuntap_pdu_impl.cc +++ b/gr-blocks/lib/tuntap_pdu_impl.cc @@ -57,7 +57,7 @@ namespace gr { : block("tuntap_pdu", io_signature::make (0, 0, 0), io_signature::make (0, 0, 0)), - stream_pdu_base(MTU), + stream_pdu_base(istunflag ? MTU : MTU + 14), d_dev(dev), d_istunflag(istunflag) { diff --git a/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc b/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc index aa581aeda8..f92f9fa6d8 100644 --- a/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc +++ b/gr-dtv/lib/dvbt/dvbt_reference_signals_impl.cc @@ -908,7 +908,12 @@ namespace gr { //Clause 4.6.2.9 set_tps_bits(39, 38, config.d_transmission_mode); //Clause 4.6.2.10 - set_tps_bits(47, 40, config.d_cell_id); + if (d_frame_index % 2) { + set_tps_bits(47, 40, config.d_cell_id & 0xff); + } + else { + set_tps_bits(47, 40, (config.d_cell_id >> 8) & 0xff); + } //These bits are set to zero set_tps_bits(53, 48, 0); //Clause 4.6.2.11 diff --git a/gr-zeromq/include/gnuradio/zeromq/pub_msg_sink.h b/gr-zeromq/include/gnuradio/zeromq/pub_msg_sink.h index 8cf4bcfab4..fb046ca84b 100644 --- a/gr-zeromq/include/gnuradio/zeromq/pub_msg_sink.h +++ b/gr-zeromq/include/gnuradio/zeromq/pub_msg_sink.h @@ -49,7 +49,7 @@ namespace gr { * \brief Return a shared_ptr to a new instance of zeromq::pub_msg_sink. * * \param address ZMQ socket address specifier - * \param timeout Receive timeout in seconds, default is 100ms, 1us increments + * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments */ static sptr make(char *address, int timeout=100); }; diff --git a/gr-zeromq/include/gnuradio/zeromq/pub_sink.h b/gr-zeromq/include/gnuradio/zeromq/pub_sink.h index e87c5522f9..3fecc10b59 100644 --- a/gr-zeromq/include/gnuradio/zeromq/pub_sink.h +++ b/gr-zeromq/include/gnuradio/zeromq/pub_sink.h @@ -51,7 +51,7 @@ namespace gr { * \param itemsize Size of a stream item in bytes. * \param vlen Vector length of the input items. Note that one vector is one item. * \param address ZMQ socket address specifier. - * \param timeout Receive timeout in seconds, default is 100ms, 1us increments. + * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments. * \param pass_tags Whether sink will serialize and pass tags over the link. * \param hwm High Watermark to configure the socket to (-1 => zmq's default) */ diff --git a/gr-zeromq/include/gnuradio/zeromq/pull_msg_source.h b/gr-zeromq/include/gnuradio/zeromq/pull_msg_source.h index 17495152b8..13857ead5f 100644 --- a/gr-zeromq/include/gnuradio/zeromq/pull_msg_source.h +++ b/gr-zeromq/include/gnuradio/zeromq/pull_msg_source.h @@ -46,7 +46,7 @@ namespace gr { * \brief Return a shared_ptr to a new instance of gr::zeromq::pull_msg_source. * * \param address ZMQ socket address specifier - * \param timeout Receive timeout in seconds, default is 100ms, 1us increments + * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments * */ static sptr make(char *address, int timeout=100); diff --git a/gr-zeromq/include/gnuradio/zeromq/pull_source.h b/gr-zeromq/include/gnuradio/zeromq/pull_source.h index 07cf6af128..ecfe508b0a 100644 --- a/gr-zeromq/include/gnuradio/zeromq/pull_source.h +++ b/gr-zeromq/include/gnuradio/zeromq/pull_source.h @@ -48,7 +48,7 @@ namespace gr { * \param itemsize Size of a stream item in bytes. * \param vlen Vector length of the input items. Note that one vector is one item. * \param address ZMQ socket address specifier. - * \param timeout Receive timeout in seconds, default is 100ms, 1us increments. + * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments. * \param pass_tags Whether source will look for and deserialize tags. * \param hwm High Watermark to configure the socket to (-1 => zmq's default) */ diff --git a/gr-zeromq/include/gnuradio/zeromq/push_msg_sink.h b/gr-zeromq/include/gnuradio/zeromq/push_msg_sink.h index 3ce6ebbdc0..941ad549f5 100644 --- a/gr-zeromq/include/gnuradio/zeromq/push_msg_sink.h +++ b/gr-zeromq/include/gnuradio/zeromq/push_msg_sink.h @@ -48,7 +48,7 @@ namespace gr { * \brief Return a shared_ptr to a new instance of gr::zeromq::push_msg_sink * * \param address ZMQ socket address specifier - * \param timeout Receive timeout in seconds, default is 100ms, 1us increments + * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments * */ static sptr make(char *address, int timeout=100); diff --git a/gr-zeromq/include/gnuradio/zeromq/push_sink.h b/gr-zeromq/include/gnuradio/zeromq/push_sink.h index e2260aa3f6..f81dcaa941 100644 --- a/gr-zeromq/include/gnuradio/zeromq/push_sink.h +++ b/gr-zeromq/include/gnuradio/zeromq/push_sink.h @@ -52,7 +52,7 @@ namespace gr { * \param itemsize Size of a stream item in bytes. * \param vlen Vector length of the input items. Note that one vector is one item. * \param address ZMQ socket address specifier. - * \param timeout Receive timeout in seconds, default is 100ms, 1us increments. + * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments. * \param pass_tags Whether sink will serialize and pass tags over the link. * \param hwm High Watermark to configure the socket to (-1 => zmq's default) */ diff --git a/gr-zeromq/include/gnuradio/zeromq/rep_msg_sink.h b/gr-zeromq/include/gnuradio/zeromq/rep_msg_sink.h index 97f3d831ad..d11550d149 100644 --- a/gr-zeromq/include/gnuradio/zeromq/rep_msg_sink.h +++ b/gr-zeromq/include/gnuradio/zeromq/rep_msg_sink.h @@ -48,7 +48,7 @@ namespace gr { * \brief Return a shared_ptr to a new instance of zeromq::rep_msg_sink. * * \param address ZMQ socket address specifier - * \param timeout Receive timeout in seconds, default is 100ms, 1us increments + * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments * */ static sptr make(char *address, int timeout=100); diff --git a/gr-zeromq/include/gnuradio/zeromq/rep_sink.h b/gr-zeromq/include/gnuradio/zeromq/rep_sink.h index 220bd34416..c1d2d370fc 100644 --- a/gr-zeromq/include/gnuradio/zeromq/rep_sink.h +++ b/gr-zeromq/include/gnuradio/zeromq/rep_sink.h @@ -50,7 +50,7 @@ namespace gr { * \param itemsize Size of a stream item in bytes. * \param vlen Vector length of the input items. Note that one vector is one item. * \param address ZMQ socket address specifier. - * \param timeout Receive timeout in seconds, default is 100ms, 1us increments. + * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments. * \param pass_tags Whether sink will serialize and pass tags over the link. * \param hwm High Watermark to configure the socket to (-1 => zmq's default) */ diff --git a/gr-zeromq/include/gnuradio/zeromq/req_msg_source.h b/gr-zeromq/include/gnuradio/zeromq/req_msg_source.h index 05d80b8e7f..28ac9f84f3 100644 --- a/gr-zeromq/include/gnuradio/zeromq/req_msg_source.h +++ b/gr-zeromq/include/gnuradio/zeromq/req_msg_source.h @@ -46,7 +46,7 @@ namespace gr { * \brief Return a shared_ptr to a new instance of zeromq::req_msg_source. * * \param address ZMQ socket address specifier - * \param timeout Receive timeout in seconds, default is 100ms, 1us increments + * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments * */ static sptr make(char *address, int timeout=100); diff --git a/gr-zeromq/include/gnuradio/zeromq/req_source.h b/gr-zeromq/include/gnuradio/zeromq/req_source.h index 461f653b43..103da90f71 100644 --- a/gr-zeromq/include/gnuradio/zeromq/req_source.h +++ b/gr-zeromq/include/gnuradio/zeromq/req_source.h @@ -48,7 +48,7 @@ namespace gr { * \param itemsize Size of a stream item in bytes. * \param vlen Vector length of the input items. Note that one vector is one item. * \param address ZMQ socket address specifier. - * \param timeout Receive timeout in seconds, default is 100ms, 1us increments. + * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments. * \param pass_tags Whether source will look for and deserialize tags. * \param hwm High Watermark to configure the socket to (-1 => zmq's default) */ diff --git a/gr-zeromq/include/gnuradio/zeromq/sub_msg_source.h b/gr-zeromq/include/gnuradio/zeromq/sub_msg_source.h index d06a83c1fd..5c91d1e1ed 100644 --- a/gr-zeromq/include/gnuradio/zeromq/sub_msg_source.h +++ b/gr-zeromq/include/gnuradio/zeromq/sub_msg_source.h @@ -46,7 +46,7 @@ namespace gr { * \brief Return a shared_ptr to a new instance of gr::zeromq::sub_msg_source. * * \param address ZMQ socket address specifier - * \param timeout Receive timeout in seconds, default is 100ms, 1us increments + * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments * */ static sptr make(char *address, int timeout=100); diff --git a/gr-zeromq/include/gnuradio/zeromq/sub_source.h b/gr-zeromq/include/gnuradio/zeromq/sub_source.h index def3a703e6..990c74cabd 100644 --- a/gr-zeromq/include/gnuradio/zeromq/sub_source.h +++ b/gr-zeromq/include/gnuradio/zeromq/sub_source.h @@ -48,7 +48,7 @@ namespace gr { * \param itemsize Size of a stream item in bytes. * \param vlen Vector length of the input items. Note that one vector is one item. * \param address ZMQ socket address specifier. - * \param timeout Receive timeout in seconds, default is 100ms, 1us increments. + * \param timeout Receive timeout in milliseconds, default is 100ms, 1us increments. * \param pass_tags Whether source will look for and deserialize tags. * \param hwm High Watermark to configure the socket to (-1 => zmq's default) */ |