Fix two problems observed on SunOS: - don't try to find a python executable when running for pkgsrc - use g++ instead of gcc for linking c++ libraries, patch from http://public.kitware.com/pipermail/cmake/2011-July/045300.htmldiff -r1.35 -r1.36 pkgsrc/devel/cmake/distinfo
(hans)
@@ -1,10 +1,11 @@ | @@ -1,10 +1,11 @@ | |||
1 | $NetBSD: distinfo,v 1.35 2012/01/08 17:44:23 adam Exp $ | 1 | $NetBSD: distinfo,v 1.36 2012/02/16 18:32:25 hans Exp $ | |
2 | 2 | |||
3 | SHA1 (cmake-2.8.7.tar.gz) = d206182b454f4d1ddeb0f11d7d1be8a66e5c2464 | 3 | SHA1 (cmake-2.8.7.tar.gz) = d206182b454f4d1ddeb0f11d7d1be8a66e5c2464 | |
4 | RMD160 (cmake-2.8.7.tar.gz) = 13b188e75152feef4e5692807e3a9e7c34b26fe3 | 4 | RMD160 (cmake-2.8.7.tar.gz) = 13b188e75152feef4e5692807e3a9e7c34b26fe3 | |
5 | Size (cmake-2.8.7.tar.gz) = 5667409 bytes | 5 | Size (cmake-2.8.7.tar.gz) = 5667409 bytes | |
6 | SHA1 (patch-Modules_FindX11.cmake) = a75a6834a376a51a314989b9996a5208cc0682ab | 6 | SHA1 (patch-Modules_FindX11.cmake) = a75a6834a376a51a314989b9996a5208cc0682ab | |
7 | SHA1 (patch-Modules_Platform_SunOS.cmake) = a873f937568744208fec90f80ebb67ca3150b49a | |||
7 | SHA1 (patch-Utilities_KWIML_CMakeLists.txt) = 4e8cef0eab2ad8cb27cd7076e077bb5e7425a95c | 8 | SHA1 (patch-Utilities_KWIML_CMakeLists.txt) = 4e8cef0eab2ad8cb27cd7076e077bb5e7425a95c | |
8 | SHA1 (patch-aa) = 1af37a3f7bd8423785acff80d7b89c75018e5cab | 9 | SHA1 (patch-aa) = 1af37a3f7bd8423785acff80d7b89c75018e5cab | |
9 | SHA1 (patch-ab) = ef595be6f88f74622d1ef0d850a626882bf9c80a | 10 | SHA1 (patch-ab) = 85b3bf0d51d5235f57195c82fb3888d08b3d4099 | |
10 | SHA1 (patch-ac) = 1f11e98d50127fae12286708215a90f118b2d2bc | 11 | SHA1 (patch-ac) = 1f11e98d50127fae12286708215a90f118b2d2bc |
$NetBSD: patch-Modules_Platform_SunOS.cmake,v 1.1 2012/02/16 18:32:25 hans Exp $
Don't use gcc to link c++ libraries on SunOS,
unless we are really using a gcc lacking libstdc++.
See http://public.kitware.com/pipermail/cmake/2011-July/045300.html
--- Modules/Platform/SunOS.cmake.orig 2011-10-04 18:09:24.000000000 +0200
+++ Modules/Platform/SunOS.cmake 2012-01-11 17:50:43.768105308 +0100
@@ -5,12 +5,20 @@ IF(CMAKE_SYSTEM MATCHES "SunOS-4.*")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
ENDIF(CMAKE_SYSTEM MATCHES "SunOS-4.*")
+# Take the default c++ shared library creation rule from the
+# CMakeDefaultMakeRuleVariables.cmake file unless using GCC and libstdc++.so
+# does not exist, in which case fall back to the old implementation;
+# using gcc to invoke the linker.
IF(CMAKE_COMPILER_IS_GNUCXX)
IF(CMAKE_COMPILER_IS_GNUCC)
- SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
- "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
- ELSE(CMAKE_COMPILER_IS_GNUCC)
- # Take default rule from CMakeDefaultMakeRuleVariables.cmake.
+ EXECUTE_PROCESS(
+ COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=libstdc++.so
+ OUTPUT_VARIABLE SHARED_LIBSTDCXX_FILENAME
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ IF(NOT EXISTS "${SHARED_LIBSTDCXX_FILENAME}")
+ SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+ "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+ ENDIF(NOT EXISTS "${SHARED_LIBSTDCXX_FILENAME}")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
INCLUDE(Platform/UnixPaths)
@@ -1,24 +1,28 @@ | @@ -1,24 +1,28 @@ | |||
1 | $NetBSD: patch-ab,v 1.11 2011/10/15 07:24:31 adam Exp $ | 1 | $NetBSD: patch-ab,v 1.12 2012/02/16 18:32:25 hans Exp $ | |
2 | 2 | |||
3 | --- Modules/FindPythonInterp.cmake.orig 2011-10-04 16:09:24.000000000 +0000 | 3 | --- Modules/FindPythonInterp.cmake.orig 2011-10-04 16:09:24.000000000 +0000 | |
4 | +++ Modules/FindPythonInterp.cmake | 4 | +++ Modules/FindPythonInterp.cmake | |
5 | @@ -29,11 +29,18 @@ | 5 | @@ -26,14 +26,20 @@ | |
6 | # Search for the current active python version first | 6 | # (To distribute this file outside of CMake, substitute the full | |
7 | find_program(PYTHON_EXECUTABLE NAMES python) | 7 | # License text for the above reference.) | |
8 | 8 | |||
9 | -# Search for the current active python version first | |||
10 | -find_program(PYTHON_EXECUTABLE NAMES python) | |||
9 | +# for pkgsrc: force Python version (set in pyversion.mk) | 11 | +# for pkgsrc: force Python version (set in pyversion.mk) | |
10 | +IF(DEFINED PYVERSSUFFIX) | 12 | +IF(DEFINED PYVERSSUFFIX) | |
11 | + SET(_VERSIONS ${PYVERSSUFFIX}) | 13 | + SET(_VERSIONS ${PYVERSSUFFIX}) | |
12 | +ELSE(DEFINED PYVERSSUFFIX) | 14 | +ELSE(DEFINED PYVERSSUFFIX) | |
13 | + SET(_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) | 15 | + SET(_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) | |
16 | + # Search for the current active python version first | |||
17 | + find_program(PYTHON_EXECUTABLE NAMES python) | |||
14 | +ENDIF(DEFINED PYVERSSUFFIX) | 18 | +ENDIF(DEFINED PYVERSSUFFIX) | |
15 | + | 19 | ||
16 | # Set up the versions we know about, in the order we will search. Always add | 20 | # Set up the versions we know about, in the order we will search. Always add | |
17 | # the user supplied additional versions to the front. | 21 | # the user supplied additional versions to the front. | |
18 | set(_Python_VERSIONS | 22 | set(_Python_VERSIONS | |
19 | ${Python_ADDITIONAL_VERSIONS} | 23 | ${Python_ADDITIONAL_VERSIONS} | |
20 | - 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) | 24 | - 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5) | |
21 | + ${_VERSIONS}) | 25 | + ${_VERSIONS}) | |
22 | 26 | |||
23 | # Search for newest python version if python executable isn't found | 27 | # Search for newest python version if python executable isn't found | |
24 | if(NOT PYTHON_EXECUTABLE) | 28 | if(NOT PYTHON_EXECUTABLE) |