From 7c061d35817b0cbc58f693e82899927aa0818b9b Mon Sep 17 00:00:00 2001 From: Richard Shaw Date: Mon, 20 Feb 2017 11:25:27 -0600 Subject: [PATCH] Add patch to deal with c++11 on EL6. --- codec2-el6_gnu11.patch | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 codec2-el6_gnu11.patch diff --git a/codec2-el6_gnu11.patch b/codec2-el6_gnu11.patch new file mode 100644 index 0000000..2b133e7 --- /dev/null +++ b/codec2-el6_gnu11.patch @@ -0,0 +1,31 @@ +Index: codec2-dev/CMakeLists.txt +=================================================================== +--- codec2-dev/CMakeLists.txt (revision 3026) ++++ codec2-dev/CMakeLists.txt (working copy) +@@ -52,18 +52,21 @@ + endif() + + # Set default C++ flags. +-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -g -O3 -std=gnu11") ++include(CheckCCompilerFlag) ++set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -g -O3") ++CHECK_C_COMPILER_FLAG("-std=gnu11" COMPILER_SUPPORTS_GNU11) ++if(COMPILER_SUPPORTS_GNU11) ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11") ++else() ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") ++endif() + # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-function") + + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS}") +-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS}") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS}") +-set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS}") + + # -fPIC is implied on MinGW... + if(NOT WIN32) +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + endif() +