2018-03-18 16:01:56 -06:00
|
|
|
package=native_cctools
|
2022-05-03 16:03:28 -06:00
|
|
|
$(package)_version=04663295d0425abfac90a42440a7ec02d7155fea
|
|
|
|
$(package)_download_path=https://github.com/tpoechtrager/cctools-port/archive
|
2021-06-30 15:57:09 -06:00
|
|
|
$(package)_download_file=$($(package)_version).tar.gz
|
|
|
|
$(package)_file_name=$(package)-$($(package)_version).tar.gz
|
2022-05-03 16:03:28 -06:00
|
|
|
$(package)_sha256_hash=70a7189418c2086d20c299c5d59250cf5940782c778892ccc899c66516ed240e
|
2018-03-18 16:01:56 -06:00
|
|
|
$(package)_build_subdir=cctools
|
|
|
|
$(package)_clang_version=3.7.1
|
|
|
|
$(package)_clang_download_path=http://llvm.org/releases/$($(package)_clang_version)
|
|
|
|
$(package)_clang_download_file=clang+llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz
|
|
|
|
$(package)_clang_file_name=clang-llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz
|
|
|
|
$(package)_clang_sha256_hash=99b28a6b48e793705228a390471991386daa33a9717cd9ca007fcdde69608fd9
|
|
|
|
$(package)_extra_sources=$($(package)_clang_file_name)
|
2019-11-18 00:58:22 -07:00
|
|
|
$(package)_patches=skip_otool.patch
|
2022-05-03 16:03:28 -06:00
|
|
|
$(package)_dependencies=native_libtapi
|
2018-03-18 16:01:56 -06:00
|
|
|
|
|
|
|
define $(package)_fetch_cmds
|
|
|
|
$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \
|
|
|
|
$(call fetch_file,$(package),$($(package)_clang_download_path),$($(package)_clang_download_file),$($(package)_clang_file_name),$($(package)_clang_sha256_hash))
|
|
|
|
endef
|
|
|
|
|
|
|
|
define $(package)_extract_cmds
|
|
|
|
mkdir -p $($(package)_extract_dir) && \
|
|
|
|
echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
|
|
|
echo "$($(package)_clang_sha256_hash) $($(package)_source_dir)/$($(package)_clang_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
|
|
|
$(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
|
|
|
|
mkdir -p toolchain/bin toolchain/lib/clang/3.5/include && \
|
|
|
|
tar --strip-components=1 -C toolchain -xf $($(package)_source_dir)/$($(package)_clang_file_name) && \
|
|
|
|
rm -f toolchain/lib/libc++abi.so* && \
|
|
|
|
echo "#!/bin/sh" > toolchain/bin/$(host)-dsymutil && \
|
|
|
|
echo "exit 0" >> toolchain/bin/$(host)-dsymutil && \
|
|
|
|
chmod +x toolchain/bin/$(host)-dsymutil && \
|
|
|
|
tar --strip-components=1 -xf $($(package)_source)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define $(package)_set_vars
|
2022-05-03 16:03:28 -06:00
|
|
|
$(package)_config_opts=--target=$(host) --disable-lto-support --with-libtapi=$(host_prefix)
|
2018-03-18 16:01:56 -06:00
|
|
|
$(package)_ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib
|
|
|
|
$(package)_cc=$($(package)_extract_dir)/toolchain/bin/clang
|
|
|
|
$(package)_cxx=$($(package)_extract_dir)/toolchain/bin/clang++
|
|
|
|
endef
|
|
|
|
|
2019-11-18 00:58:22 -07:00
|
|
|
# If clang gets updated to a version with a fix for https://reviews.llvm.org/D50559
|
|
|
|
# then the patch that skips otool can be removed.
|
2018-03-18 16:01:56 -06:00
|
|
|
define $(package)_preprocess_cmds
|
2019-11-18 00:58:22 -07:00
|
|
|
patch -p0 < $($(package)_patch_dir)/skip_otool.patch && \
|
2018-03-18 16:01:56 -06:00
|
|
|
cd $($(package)_build_subdir); ./autogen.sh && \
|
|
|
|
sed -i.old "/define HAVE_PTHREADS/d" ld64/src/ld/InputFiles.h
|
|
|
|
endef
|
|
|
|
|
|
|
|
define $(package)_config_cmds
|
|
|
|
$($(package)_autoconf)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define $(package)_build_cmds
|
|
|
|
$(MAKE)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define $(package)_stage_cmds
|
|
|
|
$(MAKE) DESTDIR=$($(package)_staging_dir) install && \
|
2019-04-09 11:23:28 -06:00
|
|
|
cp $($(package)_extract_dir)/cctools/misc/install_name_tool $($(package)_staging_prefix_dir)/bin/ &&\
|
2018-03-18 16:01:56 -06:00
|
|
|
cd $($(package)_extract_dir)/toolchain && \
|
|
|
|
mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include && \
|
|
|
|
mkdir -p $($(package)_staging_prefix_dir)/bin $($(package)_staging_prefix_dir)/include && \
|
|
|
|
cp bin/clang $($(package)_staging_prefix_dir)/bin/ &&\
|
|
|
|
cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin/ &&\
|
|
|
|
cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \
|
|
|
|
cp -rf lib/clang/$($(package)_clang_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include/ && \
|
|
|
|
cp bin/llvm-dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \
|
|
|
|
if `test -d include/c++/`; then cp -rf include/c++/ $($(package)_staging_prefix_dir)/include/; fi && \
|
|
|
|
if `test -d lib/c++/`; then cp -rf lib/c++/ $($(package)_staging_prefix_dir)/lib/; fi
|
|
|
|
endef
|