[packages/codeblocks] - fix building with gcc 6 - rel 3
baggins
baggins at pld-linux.org
Sat Apr 22 01:38:20 CEST 2017
commit e06de1c1baa3232f24e55e848b88e664a61139fb
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Sat Apr 22 01:37:57 2017 +0200
- fix building with gcc 6
- rel 3
codeblocks.spec | 5 +-
gcc6.patch | 240 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 244 insertions(+), 1 deletion(-)
---
diff --git a/codeblocks.spec b/codeblocks.spec
index cbda56f..1d7e31b 100644
--- a/codeblocks.spec
+++ b/codeblocks.spec
@@ -3,7 +3,7 @@ Summary: An open source, cross platform, free C++ IDE
Summary(pl.UTF-8): Wieloplatformowe, darmowe IDE do C++ o otwartych źródłach
Name: codeblocks
Version: 16.01
-Release: 2
+Release: 3
License: GPL v3
Group: X11/Development/Tools
Source0: http://download.sourceforge.net/codeblocks/%{name}_%{version}.tar.gz
@@ -11,6 +11,7 @@ Source0: http://download.sourceforge.net/codeblocks/%{name}_%{version}.tar.gz
Patch0: %{name}-FHS-plugins.patch
Patch2: %{name}-ac.patch
Patch3: %{name}-pwd.patch
+Patch4: gcc6.patch
URL: http://www.codeblocks.org/
BuildRequires: autoconf >= 2.50
BuildRequires: automake
@@ -133,6 +134,7 @@ instalować ten pakiet tylko w celu pisania wtyczek do Code::Blocks.
%patch0 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
#hardcode libdir, continue of patch0
sed -i 's|@libdir@|%{_libdir}|' src/sdk/configmanager.cpp
@@ -146,6 +148,7 @@ sed -i 's/1\.0svn/%{version}/g' revision.m4
%{__autoconf}
%{__autoheader}
%{__automake}
+export CXXFLAGS="%{rpmcxxflags} -std=c++11"
%configure \
--with-wx-config=wx-gtk2-unicode-config \
--with-contrib-plugins=all
diff --git a/gcc6.patch b/gcc6.patch
new file mode 100644
index 0000000..4305e0b
--- /dev/null
+++ b/gcc6.patch
@@ -0,0 +1,240 @@
+From 70289a879f7a48a47dd0219cc5d3a9a1dee076a8 Mon Sep 17 00:00:00 2001
+From: Jens Lody <jens at codeblocks.org>
+Date: Wed, 27 Jul 2016 02:09:07 +0200
+Subject: Workaround for gcc6 optimization bug.
+
+
+diff --git a/configure.ac b/configure.ac
+index 7f80a3f..f178ee2 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -276,6 +276,7 @@ esac
+
+ CB_GCC_VERSION
+ AM_CONDITIONAL([HAVE_GCC48], [test $GCC_MAJOR_VERSION -gt 4 -o $GCC_MAJOR_VERSION -eq 4 -a $GCC_MINOR_VERSION -ge 8])
++AM_CONDITIONAL([HAVE_GCC6], [test $GCC_MAJOR_VERSION -ge 6])
+
+ AC_MSG_CHECKING([for wxWidgets >= 2.9.0])
+ AM_CONDITIONAL([HAVE_WX29], [test $wx_config_major_version -gt 2 -o $wx_config_major_version -eq 2 -a $wx_config_minor_version -ge 9])
+diff --git a/src/sdk/wxpropgrid/Makefile.am b/src/sdk/wxpropgrid/Makefile.am
+index 2b1a107..f427fb4 100644
+--- a/src/sdk/wxpropgrid/Makefile.am
++++ b/src/sdk/wxpropgrid/Makefile.am
+@@ -3,6 +3,10 @@ AM_CPPFLAGS = $(WX_CXXFLAGS) \
+ -DEXPORT_LIB \
+ -DwxPG_SUPPORT_TOOLTIPS
+
++if HAVE_GCC6
++AM_CPPFLAGS += -fno-delete-null-pointer-checks
++endif
++
+ noinst_LTLIBRARIES = libwxpropgrid.la
+
+ libwxpropgrid_la_SOURCES = ./src/advprops.cpp \
+From 6350b94c5379563ac2a861de8c2c197208782435 Mon Sep 17 00:00:00 2001
+From: jenslody <jenslody at 2a5c6006-c6dd-42ca-98ab-0921f2732cef>
+Date: Sun, 17 Apr 2016 21:31:25 +0000
+Subject: * Fix variable declarations, that conflict with internal
+ compiler-defines, so C::B is compilable with gcc6 .
+
+git-svn-id: https://svn.code.sf.net/p/codeblocks/code/trunk@10833 2a5c6006-c6dd-42ca-98ab-0921f2732cef
+
+diff --git a/src/include/prep.h b/src/include/prep.h
+index 5843bb8..6397900 100644
+--- a/src/include/prep.h
++++ b/src/include/prep.h
+@@ -102,9 +102,9 @@ template<typename T>inline void DeleteArray(T*& p){delete[] p; p = nullptr;}
+ platform::id
+ Value of type platform::identifier describing the target platform
+
+- platform::windows, platform::macosx, platform::linux
++ platform::windows, platform::macosx, platform::Linux
+ platform::freebsd, platform::netbsd, platform::openbsd
+- platform::darwin, platform::solaris, platform::unix
++ platform::darwin, platform::solaris, platform::Unix
+ Boolean value that evaluates to true if the target platform is the same as the variable's name, false otherwise.
+ Using the platform booleans is equivalent to using platform::id, but results in nicer code.
+
+@@ -185,13 +185,13 @@ namespace platform
+
+ const bool windows = (id == platform_windows);
+ const bool macosx = (id == platform_macosx);
+- const bool linux = (id == platform_linux);
++ const bool Linux = (id == platform_linux);
+ const bool freebsd = (id == platform_freebsd);
+ const bool netbsd = (id == platform_netbsd);
+ const bool openbsd = (id == platform_openbsd);
+ const bool darwin = (id == platform_darwin);
+ const bool solaris = (id == platform_solaris);
+- const bool unix = (linux | freebsd | netbsd | openbsd | darwin | solaris);
++ const bool Unix = (Linux | freebsd | netbsd | openbsd | darwin | solaris);
+
+ const int bits = 8*sizeof(void*);
+
+diff --git a/src/plugins/compilergcc/compilergcc.cpp b/src/plugins/compilergcc/compilergcc.cpp
+index 1c255b6..e8b8443 100644
+--- a/src/plugins/compilergcc/compilergcc.cpp
++++ b/src/plugins/compilergcc/compilergcc.cpp
+@@ -871,7 +871,7 @@ void CompilerGCC::DoRegisterCompilers()
+ CompilerFactory::RegisterCompiler(new CompilerGDC);
+ CompilerFactory::RegisterCompiler(new CompilerGNUFortran);
+ CompilerFactory::RegisterCompiler(new CompilerG95);
+- if (platform::windows || platform::linux || nonPlatComp)
++ if (platform::windows || platform::Linux || nonPlatComp)
+ CompilerFactory::RegisterCompiler(new CompilerGNUARM);
+
+ // register pure XML compilers
+@@ -925,7 +925,7 @@ void CompilerGCC::DoRegisterCompilers()
+ else if (test == wxT("macosx"))
+ val = platform::macosx;
+ else if (test == wxT("linux"))
+- val = platform::linux;
++ val = platform::Linux;
+ else if (test == wxT("freebsd"))
+ val = platform::freebsd;
+ else if (test == wxT("netbsd"))
+@@ -937,7 +937,7 @@ void CompilerGCC::DoRegisterCompilers()
+ else if (test == wxT("solaris"))
+ val = platform::solaris;
+ else if (test == wxT("unix"))
+- val = platform::unix;
++ val = platform::Unix;
+ }
+ if (val)
+ CompilerFactory::RegisterCompiler(
+diff --git a/src/plugins/contrib/lib_finder/processingdlg.cpp b/src/plugins/contrib/lib_finder/processingdlg.cpp
+index 77ccfd2..03c93cf 100644
+--- a/src/plugins/contrib/lib_finder/processingdlg.cpp
++++ b/src/plugins/contrib/lib_finder/processingdlg.cpp
+@@ -423,7 +423,7 @@ void ProcessingDlg::CheckFilter(
+ }
+ }
+
+- if ( platform::linux )
++ if ( platform::Linux )
+ {
+ if ( Platform==_T("lin") || Platform==_T("linux") )
+ {
+@@ -477,7 +477,7 @@ void ProcessingDlg::CheckFilter(
+ }
+ }
+
+- if ( platform::unix )
++ if ( platform::Unix )
+ {
+ if ( Platform==_T("unix") || Platform==_T("un*x") )
+ {
+diff --git a/src/plugins/projectsimporter/msvc10loader.cpp b/src/plugins/projectsimporter/msvc10loader.cpp
+index 6a88e79..19f692b 100644
+--- a/src/plugins/projectsimporter/msvc10loader.cpp
++++ b/src/plugins/projectsimporter/msvc10loader.cpp
+@@ -50,7 +50,7 @@ MSVC10Loader::MSVC10Loader(cbProject* project) :
+ //ctor
+ if (platform::windows)
+ m_PlatformName = _T("Win32");
+- else if (platform::linux)
++ else if (platform::Linux)
+ m_PlatformName = _T("Linux");
+ else if (platform::macosx)
+ m_PlatformName = _T("MacOSX");
+diff --git a/src/plugins/projectsimporter/msvc7loader.cpp b/src/plugins/projectsimporter/msvc7loader.cpp
+index 568357f..a2f56f8 100644
+--- a/src/plugins/projectsimporter/msvc7loader.cpp
++++ b/src/plugins/projectsimporter/msvc7loader.cpp
+@@ -39,7 +39,7 @@ MSVC7Loader::MSVC7Loader(cbProject* project)
+ //ctor
+ if (platform::windows)
+ m_PlatformName = _T("Win32");
+- else if (platform::linux)
++ else if (platform::Linux)
+ m_PlatformName = _T("Linux");
+ else if (platform::macosx)
+ m_PlatformName = _T("MacOSX");
+diff --git a/src/sdk/compileoptionsbase.cpp b/src/sdk/compileoptionsbase.cpp
+index 20b7e77..700d39c 100644
+--- a/src/sdk/compileoptionsbase.cpp
++++ b/src/sdk/compileoptionsbase.cpp
+@@ -64,7 +64,7 @@ bool CompileOptionsBase::SupportsCurrentPlatform() const
+ {
+ if(platform::windows)
+ return m_Platform & spWindows;
+- if(platform::unix)
++ if(platform::Unix)
+ return m_Platform & spUnix;
+ if(platform::macosx)
+ return m_Platform & spMac;
+diff --git a/src/sdk/compiler.cpp b/src/sdk/compiler.cpp
+index 7b29618..45ed969 100644
+--- a/src/sdk/compiler.cpp
++++ b/src/sdk/compiler.cpp
+@@ -1149,7 +1149,7 @@ bool Compiler::EvalXMLCondition(const wxXmlNode* node)
+ else if (test == wxT("macosx"))
+ val = platform::macosx;
+ else if (test == wxT("linux"))
+- val = platform::linux;
++ val = platform::Linux;
+ else if (test == wxT("freebsd"))
+ val = platform::freebsd;
+ else if (test == wxT("netbsd"))
+@@ -1161,7 +1161,7 @@ bool Compiler::EvalXMLCondition(const wxXmlNode* node)
+ else if (test == wxT("solaris"))
+ val = platform::solaris;
+ else if (test == wxT("unix"))
+- val = platform::unix;
++ val = platform::Unix;
+ }
+ else if (node->GetAttribute(wxT("exec"), &test))
+ {
+diff --git a/src/sdk/compiletargetbase.cpp b/src/sdk/compiletargetbase.cpp
+index 85f57ed..19c5647 100644
+--- a/src/sdk/compiletargetbase.cpp
++++ b/src/sdk/compiletargetbase.cpp
+@@ -264,7 +264,7 @@ void CompileTargetBase::GenerateTargetFilename(wxString& filename) const
+ {
+ wxString prefix = wxEmptyString;
+ // On linux, "lib" is the common prefix for this platform
+- if (platform::linux)
++ if (platform::Linux)
+ prefix = wxT("lib");
+ // FIXME (Morten#5#): What about Mac (Windows is OK)?!
+
+diff --git a/src/sdk/configmanager.cpp b/src/sdk/configmanager.cpp
+index 15a931e..4b6cbfc 100644
+--- a/src/sdk/configmanager.cpp
++++ b/src/sdk/configmanager.cpp
+@@ -261,11 +261,11 @@ void CfgMgrBldr::SwitchTo(const wxString& fileName)
+
+ if (platform::windows)
+ info.append(_T("\n\t Windows "));
+- if (platform::linux)
++ if (platform::Linux)
+ info.append(_T("\n\t Linux "));
+ if (platform::macosx)
+ info.append(_T("\n\t Mac OS X "));
+- if (platform::unix)
++ if (platform::Unix)
+ info.append(_T("\n\t Unix "));
+
+ info.append(platform::unicode ? _T("Unicode ") : _T("ANSI "));
+diff --git a/src/sdk/editormanager.cpp b/src/sdk/editormanager.cpp
+index 0a9ab0f..929ae82 100644
+--- a/src/sdk/editormanager.cpp
++++ b/src/sdk/editormanager.cpp
+@@ -1845,7 +1845,7 @@ void EditorManager::CollectDefines(CodeBlocksEvent& event)
+ defines.Add(wxT("__WXOSX_MAC__"));
+ defines.Add(wxT("__APPLE__"));
+ }
+- else if (platform::linux)
++ else if (platform::Linux)
+ {
+ defines.Add(wxT("LINUX"));
+ defines.Add(wxT("linux"));
+@@ -1880,7 +1880,7 @@ void EditorManager::CollectDefines(CodeBlocksEvent& event)
+ defines.Add(wxT("__SUNOS__"));
+ defines.Add(wxT("__SOLARIS__"));
+ }
+- if (platform::unix)
++ if (platform::Unix)
+ {
+ defines.Add(wxT("unix"));
+ defines.Add(wxT("__unix"));
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/codeblocks.git/commitdiff/e06de1c1baa3232f24e55e848b88e664a61139fb
More information about the pld-cvs-commit
mailing list