summaryrefslogtreecommitdiff
path: root/games-util/dfhack/files/dfhack-0.42.04_alpha2/01-compile-static-libraries-as.patch
diff options
context:
space:
mode:
Diffstat (limited to 'games-util/dfhack/files/dfhack-0.42.04_alpha2/01-compile-static-libraries-as.patch')
-rw-r--r--games-util/dfhack/files/dfhack-0.42.04_alpha2/01-compile-static-libraries-as.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/games-util/dfhack/files/dfhack-0.42.04_alpha2/01-compile-static-libraries-as.patch b/games-util/dfhack/files/dfhack-0.42.04_alpha2/01-compile-static-libraries-as.patch
new file mode 100644
index 00000000..e46454ec
--- /dev/null
+++ b/games-util/dfhack/files/dfhack-0.42.04_alpha2/01-compile-static-libraries-as.patch
@@ -0,0 +1,65 @@
+Compile static libraries as PIC.
+
+From: eroen <eroen@occam.eroen.eu>
+
+Otherwise, we get position dependent textrels in the shared libraries
+that link against them, which is slightly bad for performance (and very
+bad for portability).
+
+Cross-platform support for handling this was added in cmake 2.8.9.
+---
+ CMakeLists.txt | 2 +-
+ depends/md5/CMakeLists.txt | 3 ++-
+ depends/tinyxml/CMakeLists.txt | 3 ++-
+ depends/tthread/CMakeLists.txt | 3 ++-
+ 4 files changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 891a130..5a3df20 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -18,7 +18,7 @@ endif(CMAKE_CONFIGURATION_TYPES)
+ OPTION(BUILD_DOCS "Choose whether to build the documentation (requires python and Sphinx)." OFF)
+
+ ## some generic CMake magic
+-cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
++cmake_minimum_required(VERSION 2.8.9 FATAL_ERROR)
+ project(dfhack)
+
+ macro(CHECK_GCC COMPILER_PATH)
+diff --git a/depends/md5/CMakeLists.txt b/depends/md5/CMakeLists.txt
+index 69e0cf0..df14e3c 100644
+--- a/depends/md5/CMakeLists.txt
++++ b/depends/md5/CMakeLists.txt
+@@ -1,3 +1,4 @@
+ project(dfhack-md5)
+ ADD_LIBRARY(dfhack-md5 STATIC EXCLUDE_FROM_ALL md5.cpp md5wrapper.cpp)
+-IDE_FOLDER(dfhack-md5 "Depends")
+\ No newline at end of file
++set_target_properties(dfhack-md5 PROPERTIES POSITION_INDEPENDENT_CODE True)
++IDE_FOLDER(dfhack-md5 "Depends")
+diff --git a/depends/tinyxml/CMakeLists.txt b/depends/tinyxml/CMakeLists.txt
+index 7d92492..f97f4bc 100644
+--- a/depends/tinyxml/CMakeLists.txt
++++ b/depends/tinyxml/CMakeLists.txt
+@@ -1,3 +1,4 @@
+ project(dfhack-tinyxml)
+ ADD_LIBRARY(dfhack-tinyxml STATIC EXCLUDE_FROM_ALL tinystr.cpp tinyxml.cpp tinyxmlerror.cpp tinyxmlparser.cpp)
+-IDE_FOLDER(dfhack-tinyxml "Depends")
+\ No newline at end of file
++set_target_properties(dfhack-tinyxml PROPERTIES POSITION_INDEPENDENT_CODE True)
++IDE_FOLDER(dfhack-tinyxml "Depends")
+diff --git a/depends/tthread/CMakeLists.txt b/depends/tthread/CMakeLists.txt
+index fa1a578..4c892ca 100644
+--- a/depends/tthread/CMakeLists.txt
++++ b/depends/tthread/CMakeLists.txt
+@@ -1,6 +1,7 @@
+ PROJECT(dfhack-tinythread)
+ ADD_LIBRARY(dfhack-tinythread STATIC EXCLUDE_FROM_ALL tinythread.cpp tinythread.h fast_mutex.h)
++set_target_properties(dfhack-tinythread PROPERTIES POSITION_INDEPENDENT_CODE True)
+ if(UNIX)
+ target_link_libraries(dfhack-tinythread pthread)
+ endif()
+-IDE_FOLDER(dfhack-tinythread "Depends")
+\ No newline at end of file
++IDE_FOLDER(dfhack-tinythread "Depends")