diff options
author | rakuco <rakuco@FreeBSD.org> | 2012-05-29 02:48:02 +0800 |
---|---|---|
committer | rakuco <rakuco@FreeBSD.org> | 2012-05-29 02:48:02 +0800 |
commit | 21baf7373d8bb6d75ecd7e44910067efcabf14b7 (patch) | |
tree | 263135fe8732239be6816dbf09b7ceabe03659cc /devel/kdevelop-kde4 | |
parent | ad4a39d0b169f41b053a25a766208f014680aaa7 (diff) | |
download | freebsd-ports-gnome-21baf7373d8bb6d75ecd7e44910067efcabf14b7.tar.gz freebsd-ports-gnome-21baf7373d8bb6d75ecd7e44910067efcabf14b7.tar.zst freebsd-ports-gnome-21baf7373d8bb6d75ecd7e44910067efcabf14b7.zip |
Add my upstream commit to fix the build with clang and our old base libstdc++.
Diffstat (limited to 'devel/kdevelop-kde4')
-rw-r--r-- | devel/kdevelop-kde4/files/patch-git_e37294e | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/devel/kdevelop-kde4/files/patch-git_e37294e b/devel/kdevelop-kde4/files/patch-git_e37294e new file mode 100644 index 000000000000..3e6f61866c52 --- /dev/null +++ b/devel/kdevelop-kde4/files/patch-git_e37294e @@ -0,0 +1,132 @@ +commit e37294eaa6694e4cf93012569f5ef947651f50e3 +Author: Raphael Kubo da Costa <rakuco@FreeBSD.org> +Date: Mon May 28 15:40:15 2012 -0300 + + Look for ext/hash_map and unordered_map instead of checking gcc's version. + + Follow-up to commits 9f8e8f662974a1035ea64f0ab9404b8858a02a57 and + 5c59bd61b1df1b963959f086c5202689c084e0f3. The decision of whether to + include <ext/hash_map> or <unordered_map> for gcc/clang was based on + whether gcc > 4.3 was installed or whether clang was being used. The + latter implicitly assumed a recent enough libstdc++ version (ie. >= + 4.3) was being used, which might not be the case on systems such as + FreeBSD and possibly OS X. + + Instead of checking for compiler versions, we now look for these + headers: CMake first detects whether <unordered_map> is present and, + in case it is not, it looks for <ext/hash_map>. The checks in + languages/cpp/parser/parser.h have been updated as well. This should + cover all the cases being previously detected, as well as fix the + checks for FreeBSD and other systems where the build was failing + before with clang. + + Reviewed-by: Millian Wolff + REVIEW: 105067 + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8a3be21..ce2a828 100644 +--- ./CMakeLists.txt ++++ ./CMakeLists.txt +@@ -34,6 +34,20 @@ add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS) + + include_directories(${KDevelop_SOURCE_DIR} ${KDevelop_BINARY_DIR} ${KDE4_INCLUDES} ) + ++# TODO: Remove when LTS for g++ < 4.3 has ended. ++# See also: languages/cpp/parser/parser.h ++if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ++ include(CheckIncludeFileCXX) ++ check_include_file_cxx(unordered_map HAVE_UNORDERED_MAP) ++ ++ if(HAVE_UNORDERED_MAP) ++ message(STATUS "Enabling c++0x support for unordered map") ++ add_definitions( -std=c++0x ) # For unordered_map ++ else(HAVE_UNORDERED_MAP) ++ check_include_file_cxx(ext/hash_map HAVE_EXT_HASH_MAP) ++ endif(HAVE_UNORDERED_MAP) ++endif(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") ++ + # create config.h + include (ConfigureChecks.cmake) + configure_file (config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h ) +diff --git a/config.h.cmake b/config.h.cmake +index 0c41fe4..d76b3df 100644 +--- ./config.h.cmake ++++ ./config.h.cmake +@@ -8,4 +8,10 @@ + /* Valgrind presence */ + #cmakedefine HAVE_VALGRIND_H 1 + ++/* Whether <unordered_map> exists */ ++#cmakedefine HAVE_UNORDERED_MAP 1 ++ ++/* Whether <ext/hash_map> exists */ ++#cmakedefine HAVE_EXT_HASH_MAP 1 ++ + #endif // KDEVELOP_CONFIG_H +diff --git a/languages/cpp/CMakeLists.txt b/languages/cpp/CMakeLists.txt +index 1577a7b..94a9bec 100644 +--- ./languages/cpp/CMakeLists.txt ++++ ./languages/cpp/CMakeLists.txt +@@ -9,22 +9,6 @@ include_directories( + + add_definitions( -DKDE_DEFAULT_DEBUG_AREA=9007 ) + +-if(CMAKE_COMPILER_IS_GNUCXX) +- # TODO: Remove when LTS for g++ < 4.3 has ended. +- # See also: languages/cpp/parser/parser.h +- macro_ensure_version("4.3.0" "${_gcc_version}" GCC_IS_NEWER_THAN_4_3) +- if (GCC_IS_NEWER_THAN_4_3) +- message(STATUS "Enabling c++0x support for unordered map") +- add_definitions( -std=c++0x ) # For unordered_map +- else(GCC_IS_NEWER_THAN_4_3) +- add_definitions( -DGXX_LT_4_3 ) +- endif (GCC_IS_NEWER_THAN_4_3) +-endif(CMAKE_COMPILER_IS_GNUCXX) +-if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +- # TODO: version check? +- add_definitions( -std=c++0x ) +-endif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +- + add_subdirectory(parser) + add_subdirectory(cppduchain) + add_subdirectory(tests) +diff --git a/languages/cpp/parser/parser.h b/languages/cpp/parser/parser.h +index c519891..f498868 100644 +--- ./languages/cpp/parser/parser.h ++++ ./languages/cpp/parser/parser.h +@@ -20,6 +20,8 @@ + #ifndef PARSER_H + #define PARSER_H + ++#include "config.h" ++ + #include "ast.h" + #include "lexer.h" + #include "commentparser.h" +@@ -30,18 +32,18 @@ + #include <cppparserexport.h> + #include "commentformatter.h" + +-#ifdef Q_CC_MSVC +-#include <hash_map> +-using namespace stdext; ++#if defined(HAVE_UNORDERED_MAP) // CXX-0 ++#include <unordered_map> ++template <class Key, class Data> ++class hash_map : public std::unordered_map<Key, Data> { }; + +-#elif defined GXX_LT_4_3 ++#elif defined(HAVE_EXT_HASH_MAP) + #include <ext/hash_map> + using namespace __gnu_cxx; + +-#else // CXX-0 +-#include <unordered_map> +-template <class Key, class Data> +-class hash_map : public std::unordered_map<Key, Data> { }; ++#elif defined(Q_CC_MSVC) ++#include <hash_map> ++using namespace stdext; + #endif + + class TokenStream; |