Project import/gnuradio - Diff bc40201808...8b3f007142

... ... --- a/.abf.yml
... ... +++ b/.abf.yml
... ... @@ -1,2 +1,2 @@
1 1
sources:
2
  gnuradio-3.7.9.2.tar.gz: db7aa4f1e6d79e5d74aa549794db7ea681cf9a50
2
  gnuradio-3.7.11.tar.gz: 574df5079b02cfcd80f03930d90a20b2fa9cfcb8
view file @ 8b3f007142
... ... --- /dev/null
... ... +++ b/gnuradio-3.7.11-cppunit.patch
... ... @@ -0,0 +1,96 @@
1
From 296be93db3396bef243c4a6dd54061de07f36079 Mon Sep 17 00:00:00 2001
2
From: Michael Dickens <michael.dickens@ettus.com>
3
Date: Mon, 14 Aug 2017 15:17:49 -0400
4
Subject: [PATCH] cmake: Fix for CppUnit and C++11
5
6
If CppUnit version >= 1.14.0, try to switch to C++11. Otherwise, use C++98 as before. Requires that FindCppUnit return the CppUnit version if found.
7
---
8
 CMakeLists.txt                  | 37 +++++++++++++++++++++++++++----------
9
 cmake/Modules/FindCppUnit.cmake |  7 +++++++
10
 2 files changed, 34 insertions(+), 10 deletions(-)
11
12
diff --git a/CMakeLists.txt b/CMakeLists.txt
13
index 650cfe3ac4..6bfb24e3e4 100644
14
--- a/CMakeLists.txt
15
+++ b/CMakeLists.txt
16
@@ -56,31 +56,35 @@ IF (NOT MSVC)
17
     SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O2")
18
 ENDIF()
19
 
20
-# Set C/C++ standard for all targets
21
-# NOTE: Starting with cmake v3.1 this should be used:
22
-# set(CMAKE_C_STANDARD 90)
23
-# set(CMAKE_CXX_STANDARD 98)
24
+# Configure C++ standard if not externally specified (will actually be
25
+# set after CppUnit check below). Use the variable CMAKE_CXX_STANDARD
26
+# since it will actually be used for this purposes starting in CMake 3.1.
27
 
28
 IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
29
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
30
+    SET(CMAKE_CXX_STANDARD 98)
31
 ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
32
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
33
+    SET(CMAKE_CXX_STANDARD 98)
34
 ELSEIF(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
35
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
36
+    SET(CMAKE_CXX_STANDARD 98)
37
 ELSE()
38
     message(warning "C++ standard could not be set because compiler is not GNU, Clang or MSVC.")
39
 ENDIF()
40
 
41
 IF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
42
-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
43
+    SET(CMAKE_C_STANDARD 99)
44
 ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
45
-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
46
+    SET(CMAKE_C_STANDARD 99)
47
 ELSEIF(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
48
-    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
49
+    SET(CMAKE_C_STANDARD 11)
50
 ELSE()
51
     message(warning "C standard could not be set because compiler is not GNU, Clang or MSVC.")
52
 ENDIF()
53
 
54
+# if cmake version is < 3.1, explicitly set C standard to use.
55
+IF(${CMAKE_VERSION} VERSION_LESS "3.1")
56
+    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c${CMAKE_C_STANDARD}")
57
+ENDIF()
58
+
59
 # Set cmake policies.
60
 # This will suppress developer warnings during the cmake process that can occur
61
 # if a newer cmake version than the minimum is used.
62
@@ -306,6 +310,19 @@ GR_REGISTER_COMPONENT("testing-support" ENABLE_TESTING
63
     CPPUNIT_FOUND
64
 )
65
 
66
+# check if CppUnit version is 1.14.0 or greater; requires c++11 ...
67
+
68
+if(CPPUNIT_FOUND AND NOT "${CPPUNIT_VERSION}" VERSION_LESS "1.14.0")
69
+    message(WARNING "\nWarning: CppUnit version is ${CPPUNIT_VERSION} which requires C++11 for building. Trying to set CMake internally to use C++11 ...")
70
+    SET(CMAKE_CXX_STANDARD 11)
71
+endif()
72
+
73
+# if cmake version is < 3.1, explicitly set C++ standard to use.
74
+
75
+if(${CMAKE_VERSION} VERSION_LESS "3.1")
76
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++${CMAKE_CXX_STANDARD}")
77
+endif()
78
+
79
 ########################################################################
80
 # Add optional dlls specified in DLL_PATHS
81
 ########################################################################
82
diff --git a/cmake/Modules/FindCppUnit.cmake b/cmake/Modules/FindCppUnit.cmake
83
index f93ade3412..4e9469f9f6 100644
84
--- a/cmake/Modules/FindCppUnit.cmake
85
+++ b/cmake/Modules/FindCppUnit.cmake
86
@@ -37,3 +37,10 @@ LIST(APPEND CPPUNIT_LIBRARIES ${CMAKE_DL_LIBS})
87
 INCLUDE(FindPackageHandleStandardArgs)
88
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(CPPUNIT DEFAULT_MSG CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS)
89
 MARK_AS_ADVANCED(CPPUNIT_LIBRARIES CPPUNIT_INCLUDE_DIRS)
90
+
91
+
92
+# set version to be useable by calling script
93
+
94
+IF(CPPUNIT_FOUND)
95
+    set(CPPUNIT_VERSION ${PC_CPPUNIT_VERSION} CACHE INTERNAL "CppUnit Version" FORCE)
96
+ENDIF()
view file @ 8b3f007142
... ... --- /dev/null
... ... +++ b/gnuradio-3.7.11-gcc-7-compile-fix.patch
... ... @@ -0,0 +1,49 @@
1
diff --git a/gnuradio-runtime/lib/math/qa_fxpt.h b/gnuradio-runtime/lib/math/qa_fxpt.h
2
index 58a6f02..6020e47 100644
3
--- a/gnuradio-runtime/lib/math/qa_fxpt.h
4
+++ b/gnuradio-runtime/lib/math/qa_fxpt.h
5
@@ -25,6 +25,7 @@
6
 
7
 #include <cppunit/extensions/HelperMacros.h>
8
 #include <cppunit/TestCase.h>
9
+#include <memory>
10
 
11
 class qa_fxpt : public CppUnit::TestCase
12
 {
13
diff --git a/gnuradio-runtime/lib/math/qa_fxpt_nco.h b/gnuradio-runtime/lib/math/qa_fxpt_nco.h
14
index 1b2cdae..1755904 100644
15
--- a/gnuradio-runtime/lib/math/qa_fxpt_nco.h
16
+++ b/gnuradio-runtime/lib/math/qa_fxpt_nco.h
17
@@ -25,6 +25,7 @@
18
 
19
 #include <cppunit/extensions/HelperMacros.h>
20
 #include <cppunit/TestCase.h>
21
+#include <memory>
22
 
23
 class qa_fxpt_nco : public CppUnit::TestCase
24
 {
25
diff --git a/gnuradio-runtime/lib/math/qa_fxpt_vco.h b/gnuradio-runtime/lib/math/qa_fxpt_vco.h
26
index 72693f3..76e0b6d 100644
27
--- a/gnuradio-runtime/lib/math/qa_fxpt_vco.h
28
+++ b/gnuradio-runtime/lib/math/qa_fxpt_vco.h
29
@@ -25,6 +25,7 @@
30
 
31
 #include <cppunit/extensions/HelperMacros.h>
32
 #include <cppunit/TestCase.h>
33
+#include <memory>
34
 
35
 class qa_fxpt_vco : public CppUnit::TestCase
36
 {
37
diff --git a/gr-fec/include/gnuradio/fec/polar_decoder_common.h b/gr-fec/include/gnuradio/fec/polar_decoder_common.h
38
index 13b25ea..8a3d65d 100644
39
--- a/gr-fec/include/gnuradio/fec/polar_decoder_common.h
40
+++ b/gr-fec/include/gnuradio/fec/polar_decoder_common.h
41
@@ -68,7 +68,7 @@ namespace gr {
42
         bool set_frame_size(unsigned int frame_size){return false;};
43
 
44
       private:
45
-        static BOOST_CONSTEXPR_OR_CONST float D_LLR_FACTOR;
46
+        static const float D_LLR_FACTOR;
47
         unsigned int d_frozen_bit_counter;
48
 
49
       protected:
... ... --- a/gnuradio.spec
... ... +++ b/gnuradio.spec
... ... @@ -45,14 +45,14 @@
45 45
%define libwxgui	%mklibname %{name}-wxgui %{major}
46 46
%define devwxgui	%mklibname %{name}-wxgui -d
47 47
48
%define volk_major	1.2.2
48
%define volk_major	1.3
49 49
%define libvolk		%mklibname volk %{volk_major}
50 50
%define devvolk		%mklibname volk -d
51 51
52 52
Summary:	Software defined radio framework
53 53
Name:		gnuradio
54
Version:	3.7.9.2
55
Release:	3
54
Version:	3.7.11
55
Release:	1
56 56
License:	GPLv3+
57 57
Group:		Communications
58 58
Url:		http://www.gnuradio.org
... ... @@ -65,6 +65,8 @@ Source10: %{name}.rpmlintrc
65 65
Patch0:		gnuradio-3.7.1-mga-cmakelists.patch
66 66
Patch1:		gnuradio-3.7.9-ubu-FindGSL.cmake.patch
67 67
Patch2:		gnuradio-3.7.9.2-docbook-dtd45.patch
68
Patch3:		gnuradio-3.7.11-gcc-7-compile-fix.patch
69
Patch4:		gnuradio-3.7.11-cppunit.patch
68 70
BuildRequires:	cmake
69 71
BuildRequires:	docbook-dtd45-xml
70 72
BuildRequires:	doxygen
... ... @@ -271,7 +273,6 @@ This package contains header files needed by developers.
273 273
274 274
%files -n %{devatsc}
275 275
%{_includedir}/%{name}/atsc/*.h
276
%{_includedir}/%{name}/atsc/CMakeLists.txt
277 276
%{_libdir}/pkgconfig/%{name}-atsc.pc
278 277
%{_libdir}/lib%{name}-atsc*.so
279 278
... ... @@ -1322,7 +1323,7 @@ Exec=xdg-open /usr/share/doc/%{name}-%{version}/html/index.html
1323 1323
Icon=%{name}-grc
1324 1324
Terminal=false
1325 1325
Type=Application
1326
Categories=System;Documentation;X-Mageia-CrossDesktop;
1326
Categories=System;Documentation;
1327 1327
X-Desktop-File-Install-Version=0.19
1328 1328
EOF
1329 1329