mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-21 13:13:33 +00:00
90 lines
3.4 KiB
Diff
90 lines
3.4 KiB
Diff
diff a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake
|
|
--- a/cmake/modules/SetUpMacOS.cmake
|
|
+++ b/cmake/modules/SetUpMacOS.cmake
|
|
@@ -8,17 +8,10 @@ set(ROOT_ARCHITECTURE macosx)
|
|
set(ROOT_PLATFORM macosx)
|
|
|
|
if (CMAKE_SYSTEM_NAME MATCHES Darwin)
|
|
- EXECUTE_PROCESS(COMMAND sw_vers "-productVersion"
|
|
- COMMAND cut -d . -f 1-2
|
|
- OUTPUT_VARIABLE MACOSX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
-
|
|
MESSAGE(STATUS "Found a macOS system ${MACOSX_VERSION}")
|
|
|
|
- if(MACOSX_VERSION VERSION_GREATER 10.7 AND ${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
|
|
set(libcxx ON CACHE BOOL "Build using libc++" FORCE)
|
|
- endif()
|
|
|
|
- if(MACOSX_VERSION VERSION_GREATER 10.4)
|
|
#TODO: check haveconfig and rpath -> set rpath true
|
|
#TODO: check Thread, define link command
|
|
#TODO: more stuff check configure script
|
|
@@ -37,23 +30,7 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin)
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
|
|
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
|
|
SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m64")
|
|
- else()
|
|
- MESSAGE(STATUS "Found a 32bit system")
|
|
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
|
|
- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
|
|
- SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m32")
|
|
- endif()
|
|
- endif()
|
|
-
|
|
- if(MACOSX_VERSION VERSION_GREATER 10.6)
|
|
- set(MACOSX_SSL_DEPRECATED ON)
|
|
- endif()
|
|
- if(MACOSX_VERSION VERSION_GREATER 10.7)
|
|
- set(MACOSX_ODBC_DEPRECATED ON)
|
|
- endif()
|
|
- if(MACOSX_VERSION VERSION_GREATER 10.8)
|
|
- set(MACOSX_GLU_DEPRECATED ON)
|
|
- endif()
|
|
+ endif()
|
|
|
|
if (CMAKE_COMPILER_IS_GNUCXX)
|
|
message(STATUS "Found GNU compiler collection")
|
|
@@ -115,7 +92,6 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin)
|
|
endif()
|
|
|
|
#---Set Linker flags----------------------------------------------------------------------
|
|
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mmacosx-version-min=${MACOSX_VERSION}")
|
|
else (CMAKE_SYSTEM_NAME MATCHES Darwin)
|
|
MESSAGE(FATAL_ERROR "There is no setup for this this Apple system up to now. Don't know waht to do. Stop cmake at this point.")
|
|
endif (CMAKE_SYSTEM_NAME MATCHES Darwin)
|
|
diff a/config/root-config.in b/config/root-config.in
|
|
--- a/config/root-config.in
|
|
+++ b/config/root-config.in
|
|
@@ -312,12 +312,6 @@ macosxicc)
|
|
;;
|
|
macosx64|macosxarm64)
|
|
# MacOS X with gcc (GNU cc v4.x) in 64 bit mode
|
|
- macosx_major=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 1 | sed -e 's/^[[:space:]]*//'`
|
|
- macosx_minor=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2`
|
|
- # cannot find the one linked to libGraf if relocated after built
|
|
- if [ $macosx_major -eq 10 -a $macosx_minor -le 4 ]; then
|
|
- rootlibs="$rootlibs -lfreetype"
|
|
- fi
|
|
auxcflags="${cxxversionflag} -m64"
|
|
auxldflags="-m64"
|
|
auxlibs="-lm -ldl"
|
|
@@ -378,18 +372,11 @@ freebsd* | openbsd* | linux*)
|
|
done
|
|
;;
|
|
macosx*)
|
|
- if [ \( $macosx_major -eq 10 -a $macosx_minor -ge 5 \) -o $macosx_major -gt 10 ]; then
|
|
auxcflags="-pthread $auxcflags"
|
|
auxlibs="-lpthread $auxlibs"
|
|
- else
|
|
- auxcflags="-D_REENTRANT $auxcflags"
|
|
- auxlibs="-lpthread $auxlibs"
|
|
- fi
|
|
for f in $features ; do
|
|
if test "x$f" = "xrpath" ; then
|
|
- if [ \( $macosx_major -eq 10 -a $macosx_minor -ge 5 \) -o $macosx_major -gt 10 ]; then
|
|
auxlibs="-Wl,-rpath,$libdir $auxlibs"
|
|
- fi
|
|
fi
|
|
if test "x$f" = "xlibcxx" ; then
|
|
auxcflags="-stdlib=libc++ $auxcflags"
|