diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bee523a4..8974c8aae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ SET(CMAKE_SYSTEM_NAME Linux) SET(CMAKE_SYSTEM_PROCESSOR "x86-64") + + # This allows setting the compiler with -DCMAKE_C_COMPILER when configuring. if (NOT DEFINED CMAKE_C_COMPILER) find_program(CMAKE_C_COMPILER NAMES diff --git a/cmake/darling_lib.cmake b/cmake/darling_lib.cmake index b42bfaaf2..0c38c210e 100644 --- a/cmake/darling_lib.cmake +++ b/cmake/darling_lib.cmake @@ -20,6 +20,8 @@ FUNCTION(add_darling_library name) SUFFIX ".dylib" NO_SONAME TRUE) + set_target_properties(${name} PROPERTIES PREFIX "lib") + set_property(TARGET ${name} APPEND_STRING PROPERTY LINK_FLAGS " ${CMAKE_SHARED_LINKER_FLAGS} -nostdlib") diff --git a/cmake/use_ld64.cmake b/cmake/use_ld64.cmake index 81ae60519..5e92eaa55 100644 --- a/cmake/use_ld64.cmake +++ b/cmake/use_ld64.cmake @@ -1,6 +1,4 @@ -set(dylib_paths "") FUNCTION(use_ld64 target) - get_property(ld_dylib_paths GLOBAL PROPERTY ld_dylib_paths) set_property(TARGET ${target} APPEND_STRING PROPERTY LINK_FLAGS " -B ${CMAKE_BINARY_DIR}/src/external/cctools-port/cctools/ld64/src/ \ -B ${CMAKE_BINARY_DIR}/src/external/cctools-port/cctools/misc/ \ @@ -59,27 +57,53 @@ FUNCTION(use_ld64 target) -Wl,-dylib_file,/usr/lib/libcrypto.0.9.8.dylib:${CMAKE_BINARY_DIR}/src/external/openssl/src/libcrypto.0.9.8.dylib \ -Wl,-dylib_file,/usr/lib/native/libGL.dylib:${CMAKE_BINARY_DIR}/src/native/libGL.dylib \ -Wl,-dylib_file,/System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage:${CMAKE_BINARY_DIR}/src/CoreImage/CoreImage \ --Wl,-dylib_file,/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo:${CMAKE_BINARY_DIR}/src/CoreVideo/CoreVideo \ -${ld_dylib_paths}") +-Wl,-dylib_file,/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents:${CMAKE_BINARY_DIR}/src/CoreServices/FSEvents \ +-Wl,-dylib_file,/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices:${CMAKE_BINARY_DIR}/src/CoreServices/LaunchServices \ +-Wl,-dylib_file,/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib\ +:${CMAKE_BINARY_DIR}/src/Accelerate/vecLib/vMisc/libvMisc.dylib \ +-Wl,-dylib_file,/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib\ +:${CMAKE_BINARY_DIR}/src/Accelerate/vecLib/vDSP/libvDSP.dylib \ +-Wl,-dylib_file,/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib\ +:${CMAKE_BINARY_DIR}/src/Accelerate/vecLib/BLAS/libBLAS.dylib \ +-Wl,-dylib_file,/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib\ +:${CMAKE_BINARY_DIR}/src/Accelerate/vecLib/LAPACK/libLAPACK.dylib \ +-Wl,-dylib_file,/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib\ +:${CMAKE_BINARY_DIR}/src/Accelerate/vecLib/LinearAlgebra/libLinearAlgebra.dylib \ +-Wl,-dylib_file,/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib\ +:${CMAKE_BINARY_DIR}/src/Accelerate/vecLib/SparseBLAS/libSparseBLAS.dylib \ +-Wl,-dylib_file,/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib\ +:${CMAKE_BINARY_DIR}/src/Accelerate/vecLib/Quadrature/libQuadrature.dylib \ +-Wl,-dylib_file,/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib\ +:${CMAKE_BINARY_DIR}/src/Accelerate/vecLib/BNNS/libBNNS.dylib \ +-Wl,-dylib_file,/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib\ +:${CMAKE_BINARY_DIR}/src/Accelerate/vecLib/Sparse/libSparse.dylib \ +-Wl,-dylib_file,/System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync:${CMAKE_BINARY_DIR}/src/ColorSync/ColorSync \ +-Wl,-dylib_file,/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS\ +:${CMAKE_BINARY_DIR}/src/ApplicationServices/ATS/ATS \ +-Wl,-dylib_file,/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy\ +:${CMAKE_BINARY_DIR}/src/ApplicationServices/ColorSyncLegacy/ColorSyncLegacy \ +-Wl,-dylib_file,/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices\ +:${CMAKE_BINARY_DIR}/src/ApplicationServices/HIServices/HIServices \ +-Wl,-dylib_file,/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis\ +:${CMAKE_BINARY_DIR}/src/ApplicationServices/LangAnalysis/LangAnalysis \ +-Wl,-dylib_file,/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore\ +:${CMAKE_BINARY_DIR}/src/ApplicationServices/PrintCore/PrintCore \ +-Wl,-dylib_file,/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD\ +:${CMAKE_BINARY_DIR}/src/ApplicationServices/QD/QD \ +-Wl,-dylib_file,/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis\ +:${CMAKE_BINARY_DIR}/src/ApplicationServices/SpeechSynthesis/SpeechSynthesis \ +-Wl,-dylib_file,/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices:${CMAKE_BINARY_DIR}/src/CoreServices/CoreServices \ +-Wl,-dylib_file,/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices:${CMAKE_BINARY_DIR}/src/ApplicationServices/ApplicationServices \ +-Wl,-dylib_file,/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics:${CMAKE_BINARY_DIR}/src/external/cocotron/CoreGraphics/CoreGraphics \ +-Wl,-dylib_file,/System/Library/Frameworks/CoreText.framework/Versions/A/CoreText:${CMAKE_BINARY_DIR}/src/external/cocotron/CoreText/CoreText \ +-Wl,-dylib_file,/System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO:${CMAKE_BINARY_DIR}/src/ImageIO/ImageIO \ +-Wl,-dylib_file,/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo:${CMAKE_BINARY_DIR}/src/CoreVideo/CoreVideo") add_dependencies(${target} x86_64-apple-darwin11-ld) ENDFUNCTION(use_ld64) -function(reexport reexporter reexportee) +function(reexport reexporter reexportee reexportee_output) add_dependencies(${reexporter} ${reexportee}) - set(reexportee_binary_dir "$") - set(reexportee_output_name "$") - #message("binary dir: ${reexportee_binary_dir}, output name: ${reexportee_output_name}") - if(NOT DEFINED reexportee_output_name) - set(reexportee_output_name "$") - if(NOT DEFINED reexportee_output_name) - message(FATAL_ERROR "failed to get reexportee path") - endif(NOT DEFINED reexportee_output_name) - endif(NOT DEFINED reexportee_output_name) - set(reexportee_output "${reexportee_binary_dir}/${reexportee_output_name}") - set(reexportee_install_name "$") - set_property(TARGET ${reexporter} APPEND PROPERTY - LINK_OPTIONS " -Wl,-reexport_library,${reexportee_output} ") - #set_property(GLOBAL APPEND_STRING PROPERTY ld_dylib_paths " -Wl,-dylib_file,${reexportee_install_name}:${reexportee_output} ") + set_property(TARGET ${reexporter} APPEND_STRING PROPERTY LINK_FLAGS " -Wl,-reexport_library,${reexportee_output} ") endfunction(reexport) diff --git a/src/Accelerate/CMakeLists.txt b/src/Accelerate/CMakeLists.txt index f4bdeb480..ee47233c8 100644 --- a/src/Accelerate/CMakeLists.txt +++ b/src/Accelerate/CMakeLists.txt @@ -16,4 +16,5 @@ add_framework(Accelerate DEPENDENCIES system ) -reexport(Accelerate vecLib) + +reexport(Accelerate vecLib ${CMAKE_CURRENT_BINARY_DIR}/vecLib/vecLib) diff --git a/src/Accelerate/vecLib/CMakeLists.txt b/src/Accelerate/vecLib/CMakeLists.txt index 8e8994bb9..892d90a1f 100644 --- a/src/Accelerate/vecLib/CMakeLists.txt +++ b/src/Accelerate/vecLib/CMakeLists.txt @@ -45,14 +45,15 @@ add_framework(vecLib Sparse system ) -reexport(vecLib vMisc) -reexport(vecLib vDSP) -reexport(vecLib BLAS) -reexport(vecLib LAPACK) -reexport(vecLib LinearAlgebra) -reexport(vecLib SparseBLAS) -reexport(vecLib Quadrature) -reexport(vecLib BNNS) -reexport(vecLib Sparse) + +reexport(vecLib vMisc ${CMAKE_CURRENT_BINARY_DIR}/vMisc/libvMisc.dylib) +reexport(vecLib vDSP ${CMAKE_CURRENT_BINARY_DIR}/vDSP/libvDSP.dylib) +reexport(vecLib BLAS ${CMAKE_CURRENT_BINARY_DIR}/BLAS/libBLAS.dylib) +reexport(vecLib LAPACK ${CMAKE_CURRENT_BINARY_DIR}/LAPACK/libLAPACK.dylib) +reexport(vecLib LinearAlgebra ${CMAKE_CURRENT_BINARY_DIR}/LinearAlgebra/libLinearAlgebra.dylib) +reexport(vecLib SparseBLAS ${CMAKE_CURRENT_BINARY_DIR}/SparseBLAS/libSparseBLAS.dylib) +reexport(vecLib Quadrature ${CMAKE_CURRENT_BINARY_DIR}/Quadrature/libQuadrature.dylib) +reexport(vecLib BNNS ${CMAKE_CURRENT_BINARY_DIR}/BNNS/libBNNS.dylib) +reexport(vecLib Sparse ${CMAKE_CURRENT_BINARY_DIR}/Sparse/libSparse.dylib) InstallSymlink(Accelerate.framework/Versions/A/Frameworks/vecLib.framework ${CMAKE_INSTALL_PREFIX}/libexec/darling/System/Library/Frameworks/vecLib.framework) diff --git a/src/ApplicationServices/CMakeLists.txt b/src/ApplicationServices/CMakeLists.txt index fda4a8db3..bf13f71c0 100644 --- a/src/ApplicationServices/CMakeLists.txt +++ b/src/ApplicationServices/CMakeLists.txt @@ -20,18 +20,31 @@ add_framework(ApplicationServices system CoreServices CoreFoundation ) -reexport(ApplicationServices CoreGraphics) -reexport(ApplicationServices CoreText) -reexport(ApplicationServices ImageIO) -reexport(ApplicationServices ColorSync) -reexport(ApplicationServices ATS) -reexport(ApplicationServices ColorSyncLegacy) -reexport(ApplicationServices CoreServices) -reexport(ApplicationServices HIServices) -reexport(ApplicationServices LangAnalysis) -reexport(ApplicationServices PrintCore) -reexport(ApplicationServices QD) -reexport(ApplicationServices SpeechSynthesis) +set(CoreGraphics_BUILD ${CMAKE_BINARY_DIR}/src/external/cocotron/CoreGraphics/CoreGraphics) +set(CoreText_BUILD ${CMAKE_BINARY_DIR}/src/external/cocotron/CoreText/CoreText) +set(CoreServices_BUILD ${CMAKE_BINARY_DIR}/src/CoreServices/CoreServices) +set(ImageIO_BUILD ${CMAKE_BINARY_DIR}/src/ImageIO/ImageIO) +set(ColorSync_BUILD ${CMAKE_BINARY_DIR}/src/ColorSync/ColorSync) +set(ATS_BUILD ${CMAKE_BINARY_DIR}/src/ApplicationServices/ATS/ATS) +set(ColorSyncLegacy_BUILD ${CMAKE_BINARY_DIR}/src/ApplicationServices/ColorSyncLegacy/ColorSyncLegacy) +set(HIServices_BUILD ${CMAKE_BINARY_DIR}/src/ApplicationServices/HIServices/HIServices) +set(LangAnalysis_BUILD ${CMAKE_BINARY_DIR}/src/ApplicationServices/LangAnalysis/LangAnalysis) +set(PrintCore_BUILD ${CMAKE_BINARY_DIR}/src/ApplicationServices/PrintCore/PrintCore) +set(QD_BUILD ${CMAKE_BINARY_DIR}/src/ApplicationServices/QD/QD) +set(SpeechSynthesis_BUILD ${CMAKE_BINARY_DIR}/src/ApplicationServices/SpeechSynthesis/SpeechSynthesis) + +reexport(ApplicationServices CoreGraphics ${CoreGraphics_BUILD}) +reexport(ApplicationServices CoreText ${CoreText_BUILD}) +reexport(ApplicationServices ImageIO ${ImageIO_BUILD}) +reexport(ApplicationServices ColorSync ${ColorSync_BUILD}) +reexport(ApplicationServices ATS ${ATS_BUILD}) +reexport(ApplicationServices ColorSyncLegacy ${ColorSyncLegacy_BUILD}) +reexport(ApplicationServices CoreServices ${CoreServices_BUILD}) +reexport(ApplicationServices HIServices ${HIServices_BUILD}) +reexport(ApplicationServices LangAnalysis ${LangAnalysis_BUILD}) +reexport(ApplicationServices PrintCore ${PrintCore_BUILD}) +reexport(ApplicationServices QD ${QD_BUILD}) +reexport(ApplicationServices SpeechSynthesis ${SpeechSynthesis_BUILD}) InstallSymlink(../../../../ColorSync.framework ${CMAKE_INSTALL_PREFIX}/libexec/darling/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework) diff --git a/src/ApplicationServices/LangAnalysis/CMakeLists.txt b/src/ApplicationServices/LangAnalysis/CMakeLists.txt index edd2e9382..4e8aebe2d 100644 --- a/src/ApplicationServices/LangAnalysis/CMakeLists.txt +++ b/src/ApplicationServices/LangAnalysis/CMakeLists.txt @@ -7,6 +7,7 @@ add_framework(LangAnalysis FAT CURRENT_VERSION VERSION "A" + PARENT ApplicationServices SOURCES src/LangAnalysis.c diff --git a/src/CoreServices/CMakeLists.txt b/src/CoreServices/CMakeLists.txt index 79fdcf75e..cb3b3293f 100644 --- a/src/CoreServices/CMakeLists.txt +++ b/src/CoreServices/CMakeLists.txt @@ -100,9 +100,12 @@ add_framework(CoreServices ${EXTRA_LIBS} ) -reexport(CoreServices FSEvents) -reexport(CoreServices LaunchServices) -reexport(CoreServices CFNetwork) +set(FSEvents_BUILD ${CMAKE_BINARY_DIR}/src/CoreServices/FSEvents) +set(LaunchServices_BUILD ${CMAKE_BINARY_DIR}/src/CoreServices/LaunchServices) +set(CFNetwork_BUILD ${CMAKE_BINARY_DIR}/src/external/cfnetwork/src/CFNetwork) +reexport(CoreServices FSEvents ${FSEvents_BUILD}) +reexport(CoreServices LaunchServices ${LaunchServices_BUILD}) +reexport(CoreServices CFNetwork ${CFNetwork_BUILD}) install(FILES SystemVersion.plist DESTINATION "libexec/darling/System/Library/CoreServices") diff --git a/src/external/cocotron b/src/external/cocotron index 83d0fec4c..4fa8477fd 160000 --- a/src/external/cocotron +++ b/src/external/cocotron @@ -1 +1 @@ -Subproject commit 83d0fec4c4b9cf9bd233addc7f72a9f5c0acd8d3 +Subproject commit 4fa8477fddb83ec05aefaedd4ad022ad4d3fb5ca