diff --git a/CMakeLists.txt b/CMakeLists.txt index 1055ee623..a854a74aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index b0142a14a..0958a6efc 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -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 diff --git a/package/darwin/libstdc++.6.dylib.bz2 b/package/darwin/libstdc++.6.dylib.bz2 deleted file mode 100644 index a25b10b26..000000000 Binary files a/package/darwin/libstdc++.6.dylib.bz2 and /dev/null differ diff --git a/package/darwin/osx32/.gitignore b/package/darwin/osx32/.gitignore new file mode 100644 index 000000000..e67764bf4 --- /dev/null +++ b/package/darwin/osx32/.gitignore @@ -0,0 +1 @@ +libstdc++* diff --git a/package/darwin/osx64/.gitignore b/package/darwin/osx64/.gitignore new file mode 100644 index 000000000..e67764bf4 --- /dev/null +++ b/package/darwin/osx64/.gitignore @@ -0,0 +1 @@ +libstdc++*