2024-11-02 16:33:59 +00:00
|
|
|
OSX_MIN_VERSION=11.0
|
2022-06-02 12:50:33 +00:00
|
|
|
OSX_SDK_VERSION=11.0
|
|
|
|
XCODE_VERSION=12.2
|
|
|
|
XCODE_BUILD_ID=12B45b
|
2024-11-02 16:33:59 +00:00
|
|
|
LD64_VERSION=711
|
2022-06-02 12:50:33 +00:00
|
|
|
|
2023-03-16 01:44:40 +00:00
|
|
|
OSX_SDK=$(host_prefix)/native/SDK
|
2022-06-02 12:50:33 +00:00
|
|
|
|
2023-03-16 01:44:40 +00:00
|
|
|
darwin_native_toolchain=darwin_sdk
|
2022-06-02 12:50:33 +00:00
|
|
|
|
|
|
|
|
2024-11-02 16:33:59 +00:00
|
|
|
clang_prog=clang
|
|
|
|
clangxx_prog=clang++
|
|
|
|
llvm_config_prog=llvm-config
|
2022-06-02 12:50:33 +00:00
|
|
|
|
2024-11-02 16:33:59 +00:00
|
|
|
llvm_lib_dir=$(shell $(llvm_config_prog) --libdir)
|
2022-06-02 12:50:33 +00:00
|
|
|
|
2024-11-02 16:33:59 +00:00
|
|
|
darwin_AR=llvm-ar
|
|
|
|
darwin_DSYMUTIL=dsymutil
|
|
|
|
darwin_NM=llvm-nm
|
|
|
|
darwin_OBJDUMP=llvm-objdump
|
|
|
|
darwin_RANLIB=llvm-ranlib
|
|
|
|
darwin_STRIP=llvm-strip
|
|
|
|
darwin_LIBTOOL=llvm-libtool-darwin
|
2022-06-02 12:50:33 +00:00
|
|
|
|
|
|
|
# Flag explanations:
|
|
|
|
#
|
|
|
|
# -mlinker-version
|
|
|
|
#
|
|
|
|
# Ensures that modern linker features are enabled. See here for more
|
|
|
|
# details: https://github.com/bitcoin/bitcoin/pull/19407.
|
|
|
|
#
|
|
|
|
# -B$(build_prefix)/bin
|
|
|
|
#
|
|
|
|
# Explicitly point to our binaries (e.g. cctools) so that they are
|
|
|
|
# ensured to be found and preferred over other possibilities.
|
|
|
|
#
|
2023-06-26 11:49:59 +00:00
|
|
|
# -isysroot$(OSX_SDK) -nostdlibinc
|
2022-06-02 12:50:33 +00:00
|
|
|
#
|
2023-06-26 11:49:59 +00:00
|
|
|
# Disable default include paths built into the compiler as well as
|
|
|
|
# those normally included for libc and libc++. The only path that
|
|
|
|
# remains implicitly is the clang resource dir.
|
2022-06-02 12:50:33 +00:00
|
|
|
#
|
2023-06-26 11:49:59 +00:00
|
|
|
# -iwithsysroot / -iframeworkwithsysroot
|
2022-06-02 12:50:33 +00:00
|
|
|
#
|
2023-06-26 11:49:59 +00:00
|
|
|
# Adds the desired paths from the SDK
|
2022-06-02 12:50:33 +00:00
|
|
|
#
|
2023-06-26 11:49:59 +00:00
|
|
|
|
2024-11-02 16:33:59 +00:00
|
|
|
darwin_CC_=--target=$(host) \
|
2023-06-26 11:49:59 +00:00
|
|
|
-isysroot$(OSX_SDK) -nostdlibinc \
|
|
|
|
-iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks
|
2022-06-02 12:50:33 +00:00
|
|
|
darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
|
|
|
|
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
|
|
|
|
-u LIBRARY_PATH \
|
2023-05-28 09:36:16 +00:00
|
|
|
$(clang_prog) $(darwin_CC_)
|
|
|
|
|
2024-11-02 16:33:59 +00:00
|
|
|
darwin_CXX_=--target=$(host) \
|
|
|
|
-isysroot$(OSX_SDK) -nostdlibinc \
|
|
|
|
-iwithsysroot/usr/include/c++/v1 \
|
|
|
|
-iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks
|
2022-06-02 12:50:33 +00:00
|
|
|
darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
|
|
|
|
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
|
|
|
|
-u LIBRARY_PATH \
|
2023-05-28 09:36:16 +00:00
|
|
|
$(clangxx_prog) $(darwin_CXX_)
|
2022-06-02 12:50:33 +00:00
|
|
|
|
2024-11-02 16:33:59 +00:00
|
|
|
darwin_CFLAGS=-pipe -mmacosx-version-min=$(OSX_MIN_VERSION) -mlinker-version=$(LD64_VERSION)
|
|
|
|
darwin_CXXFLAGS=-pipe -mmacosx-version-min=$(OSX_MIN_VERSION) -mlinker-version=$(LD64_VERSION)
|
|
|
|
darwin_LDFLAGS=-Wl,-platform_version,macos,$(OSX_MIN_VERSION),$(OSX_SDK_VERSION) -fuse-ld=lld
|
2022-12-21 15:15:22 +00:00
|
|
|
darwin_ARFLAGS=cr
|
2022-06-02 12:50:33 +00:00
|
|
|
|
|
|
|
darwin_release_CFLAGS=-O2
|
|
|
|
darwin_release_CXXFLAGS=$(darwin_release_CFLAGS)
|
|
|
|
|
|
|
|
darwin_debug_CFLAGS=-O1
|
|
|
|
darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS)
|
|
|
|
|
|
|
|
darwin_cmake_system=Darwin
|