Duke
1 year ago
1 changed files with 61 additions and 0 deletions
@ -0,0 +1,61 @@ |
|||||
|
package=libcxx |
||||
|
$(package)_version=$(native_clang_version) |
||||
|
$(package)_msys2_version=15.0.7-3 |
||||
|
|
||||
|
ifneq ($(canonical_host),$(build)) |
||||
|
ifneq ($(host_os),mingw32) |
||||
|
# Clang is provided pre-compiled for a bunch of targets; fetch the one we need
|
||||
|
# and stage its copies of the static libraries.
|
||||
|
$(package)_download_path=$(native_clang_download_path) |
||||
|
$(package)_download_file_aarch64_linux=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz |
||||
|
$(package)_file_name_aarch64_linux=clang-llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz |
||||
|
$(package)_sha256_hash_aarch64_linux=8ca4d68cf103da8331ca3f35fe23d940c1b78fb7f0d4763c1c059e352f5d1bec |
||||
|
$(package)_download_file_linux=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz |
||||
|
$(package)_file_name_linux=clang-llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz |
||||
|
$(package)_sha256_hash_linux=38bc7f5563642e73e69ac5626724e206d6d539fbef653541b34cae0ba9c3f036 |
||||
|
|
||||
|
# Starting from LLVM 14.0.0, some Clang binary tarballs store libc++ in a
|
||||
|
# target-specific subdirectory.
|
||||
|
define $(package)_stage_cmds |
||||
|
mkdir -p $($(package)_staging_prefix_dir)/lib && \
|
||||
|
(test ! -f lib/*/libc++.a || cp lib/*/libc++.a $($(package)_staging_prefix_dir)/lib) && \
|
||||
|
(test ! -f lib/*/libc++abi.a || cp lib/*/libc++abi.a $($(package)_staging_prefix_dir)/lib) && \
|
||||
|
(test ! -f lib/libc++.a || cp lib/libc++.a $($(package)_staging_prefix_dir)/lib) && \
|
||||
|
(test ! -f lib/libc++abi.a || cp lib/libc++abi.a $($(package)_staging_prefix_dir)/lib) |
||||
|
endef |
||||
|
|
||||
|
else |
||||
|
# For Windows cross-compilation, use the MSYS2 binaries.
|
||||
|
# Starting from LLVM 15.0.0, libc++abi is provided by libc++.
|
||||
|
$(package)_download_path=https://repo.msys2.org/mingw/x86_64 |
||||
|
$(package)_download_file=mingw-w64-x86_64-libc++-$($(package)_msys2_version)-any.pkg.tar.zst |
||||
|
$(package)_file_name=mingw-w64-x86_64-libcxx-$($(package)_msys2_version)-any.pkg.tar.zst |
||||
|
$(package)_sha256_hash=8c14da21fa9622cc7450b22467452c6c933a03cee526cf8744faea3d4674035b |
||||
|
|
||||
|
define $(package)_stage_cmds |
||||
|
mkdir -p $($(package)_staging_prefix_dir)/lib && \
|
||||
|
mv include/ $($(package)_staging_prefix_dir) && \
|
||||
|
cp lib/libc++.a $($(package)_staging_prefix_dir)/lib && \
|
||||
|
cp lib/libc++abi.a $($(package)_staging_prefix_dir)/lib |
||||
|
endef |
||||
|
endif |
||||
|
|
||||
|
else |
||||
|
# For native compilation, use the static libraries from native_clang.
|
||||
|
# We explicitly stage them so that subsequent dependencies don't link to the
|
||||
|
# shared libraries distributed with Clang.
|
||||
|
define $(package)_fetch_cmds |
||||
|
endef |
||||
|
|
||||
|
define $(package)_extract_cmds |
||||
|
endef |
||||
|
|
||||
|
define $(package)_stage_cmds |
||||
|
mkdir -p $($(package)_staging_prefix_dir)/lib && \
|
||||
|
(test ! -f $(build_prefix)/lib/*/libc++.a || cp $(build_prefix)/lib/*/libc++.a $($(package)_staging_prefix_dir)/lib) && \
|
||||
|
(test ! -f $(build_prefix)/lib/*/libc++abi.a || cp $(build_prefix)/lib/*/libc++abi.a $($(package)_staging_prefix_dir)/lib) && \
|
||||
|
(test ! -f $(build_prefix)/lib/libc++.a || cp $(build_prefix)/lib/libc++.a $($(package)_staging_prefix_dir)/lib) && \
|
||||
|
(test ! -f $(build_prefix)/lib/libc++abi.a || cp $(build_prefix)/lib/libc++abi.a $($(package)_staging_prefix_dir)/lib) |
||||
|
endef |
||||
|
|
||||
|
endif |
Loading…
Reference in new issue