Download non-broken libstdc++ on OS X

develop
lethosor 2016-07-27 21:43:38 -04:00
parent 828fee532a
commit 42c620bb9c
5 changed files with 29 additions and 6 deletions

@ -193,7 +193,7 @@ elseif(WIN32)
add_definitions(-DWIN32)
endif()
#### expose depends ####
#### download depends ####
if(WIN32)
# Download zlib on Windows
@ -237,6 +237,31 @@ if(WIN32)
endif()
endif()
if(APPLE)
# libstdc++ (GCC 4.8.5 for OS X 10.6)
# fixes crash-on-unwind bug in DF's libstdc++
set(LIBSTDCXX_DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/package/darwin/osx${DFHACK_BUILD_ARCH})
# check for existence of uncompressed library
if(NOT EXISTS ${LIBSTDCXX_DOWNLOAD_DIR}/libstdc++.6.dylib)
if(${DFHACK_BUILD_ARCH} STREQUAL "64")
message("Downloading osx64-libstdcxx.6.dylib.gz")
file(DOWNLOAD "https://github.com/DFHack/dfhack-bin/releases/download/0.43.05/osx64-libstdcxx.6.dylib.gz"
${LIBSTDCXX_DOWNLOAD_DIR}/libstdc++.6.dylib.gz
EXPECTED_MD5 "cf26ed588be8e83c8e3a49919793b416")
execute_process(COMMAND gunzip ${LIBSTDCXX_DOWNLOAD_DIR}/libstdc++.6.dylib.gz)
else()
message("Downloading osx32-libstdcxx.6.dylib.gz")
file(DOWNLOAD "https://github.com/DFHack/dfhack-bin/releases/download/0.43.05/osx32-libstdcxx.6.dylib.gz"
${LIBSTDCXX_DOWNLOAD_DIR}/libstdc++.6.dylib.gz
EXPECTED_MD5 "40f3d83871b114f0279240626311621b")
execute_process(COMMAND gunzip ${LIBSTDCXX_DOWNLOAD_DIR}/libstdc++.6.dylib.gz)
endif()
endif()
endif()
#### expose depends ####
# find and make available libz
if(NOT UNIX) # Windows
# zlib is in here so 32-bit and 64-bit builds in the same source tree are possible

@ -360,12 +360,8 @@ IF(UNIX)
DESTINATION .)
install(PROGRAMS ${dfhack_SOURCE_DIR}/package/darwin/dfhack-run
DESTINATION .)
OPTION(INSTALL_NEW_LIBSTDCXX "Install a version of libstdc++ from GCC 4.5.4 to fix various crashes" ON)
IF(INSTALL_NEW_LIBSTDCXX)
execute_process(COMMAND bunzip2 --keep --force ${dfhack_SOURCE_DIR}/package/darwin/libstdc++.6.dylib.bz2)
install(PROGRAMS ${dfhack_SOURCE_DIR}/package/darwin/libstdc++.6.dylib
install(PROGRAMS ${dfhack_SOURCE_DIR}/package/darwin/osx${DFHACK_BUILD_ARCH}/libstdc++.6.dylib
DESTINATION ./hack/)
ENDIF(INSTALL_NEW_LIBSTDCXX)
else()
# On linux, copy our version of the df launch script which sets LD_PRELOAD
install(PROGRAMS ${dfhack_SOURCE_DIR}/package/linux/dfhack

@ -0,0 +1 @@
libstdc++*

@ -0,0 +1 @@
libstdc++*