| 1 |
OSX_MIN_VERSION=12.0 |
| 2 |
OSX_SDK_VERSION=12.0 |
| 3 |
XCODE_VERSION=12.2 |
| 4 |
XCODE_BUILD_ID=12B45b |
| 5 |
LD64_VERSION=711 |
| 6 |
|
| 7 |
OSX_SDK=$(host_prefix)/native/SDK |
| 8 |
|
| 9 |
darwin_native_toolchain=darwin_sdk |
| 10 |
|
| 11 |
|
| 12 |
clang_prog=clang |
| 13 |
clangxx_prog=clang++ |
| 14 |
llvm_config_prog=llvm-config |
| 15 |
|
| 16 |
llvm_lib_dir=$(shell $(llvm_config_prog) --libdir) |
| 17 |
|
| 18 |
darwin_AR=llvm-ar |
| 19 |
darwin_DSYMUTIL=dsymutil |
| 20 |
darwin_NM=llvm-nm |
| 21 |
darwin_OBJDUMP=llvm-objdump |
| 22 |
darwin_RANLIB=llvm-ranlib |
| 23 |
darwin_STRIP=llvm-strip |
| 24 |
darwin_LIBTOOL=llvm-libtool-darwin |
| 25 |
|
| 26 |
# Flag explanations: |
| 27 |
# |
| 28 |
# -mlinker-version |
| 29 |
# |
| 30 |
# Ensures that modern linker features are enabled. See here for more |
| 31 |
# details: https://github.com/bitcoin/bitcoin/pull/19407. |
| 32 |
# |
| 33 |
# -B$(build_prefix)/bin |
| 34 |
# |
| 35 |
# Explicitly point to our binaries (e.g. cctools) so that they are |
| 36 |
# ensured to be found and preferred over other possibilities. |
| 37 |
# |
| 38 |
# -isysroot$(OSX_SDK) -nostdlibinc |
| 39 |
# |
| 40 |
# Disable default include paths built into the compiler as well as |
| 41 |
# those normally included for libc and libc++. The only path that |
| 42 |
# remains implicitly is the clang resource dir. |
| 43 |
# |
| 44 |
# -iwithsysroot / -iframeworkwithsysroot |
| 45 |
# |
| 46 |
# Adds the desired paths from the SDK |
| 47 |
# |
| 48 |
|
| 49 |
darwin_CC_=--target=$(host) \ |
| 50 |
-isysroot$(OSX_SDK) -nostdlibinc \ |
| 51 |
-iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks |
| 52 |
darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \ |
| 53 |
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \ |
| 54 |
-u LIBRARY_PATH \ |
| 55 |
$(clang_prog) $(darwin_CC_) |
| 56 |
|
| 57 |
darwin_CXX_=--target=$(host) \ |
| 58 |
-isysroot$(OSX_SDK) -nostdlibinc \ |
| 59 |
-iwithsysroot/usr/include/c++/v1 \ |
| 60 |
-iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks |
| 61 |
darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \ |
| 62 |
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \ |
| 63 |
-u LIBRARY_PATH \ |
| 64 |
$(clangxx_prog) $(darwin_CXX_) |
| 65 |
|
| 66 |
darwin_CFLAGS=-pipe -mmacosx-version-min=$(OSX_MIN_VERSION) -mlinker-version=$(LD64_VERSION) |
| 67 |
darwin_CXXFLAGS=-pipe -mmacosx-version-min=$(OSX_MIN_VERSION) -mlinker-version=$(LD64_VERSION) |
| 68 |
darwin_LDFLAGS=-Wl,-platform_version,macos,$(OSX_MIN_VERSION),$(OSX_SDK_VERSION) -fuse-ld=lld |
| 69 |
darwin_ARFLAGS=cr |
| 70 |
|
| 71 |
darwin_release_CFLAGS=-O2 |
| 72 |
darwin_release_CXXFLAGS=$(darwin_release_CFLAGS) |
| 73 |
|
| 74 |
darwin_debug_CFLAGS=-O1 |
| 75 |
darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS) |
| 76 |
|
| 77 |
darwin_cmake_system=Darwin |