You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

native_cctools.mk 3.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package=native_cctools
  2. $(package)_version=807d6fd1be5d2224872e381870c0a75387fe05e6
  3. $(package)_download_path=https://github.com/theuni/cctools-port/archive
  4. $(package)_file_name=$($(package)_version).tar.gz
  5. $(package)_sha256_hash=a09c9ba4684670a0375e42d9d67e7f12c1f62581a27f28f7c825d6d7032ccc6a
  6. $(package)_build_subdir=cctools
  7. $(package)_clang_version=3.7.1
  8. $(package)_clang_download_path=http://llvm.org/releases/$($(package)_clang_version)
  9. $(package)_clang_download_file=clang+llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz
  10. $(package)_clang_file_name=clang-llvm-$($(package)_clang_version)-x86_64-linux-gnu-ubuntu-14.04.tar.xz
  11. $(package)_clang_sha256_hash=99b28a6b48e793705228a390471991386daa33a9717cd9ca007fcdde69608fd9
  12. $(package)_extra_sources=$($(package)_clang_file_name)
  13. define $(package)_fetch_cmds
  14. $(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \
  15. $(call fetch_file,$(package),$($(package)_clang_download_path),$($(package)_clang_download_file),$($(package)_clang_file_name),$($(package)_clang_sha256_hash))
  16. endef
  17. define $(package)_extract_cmds
  18. mkdir -p $($(package)_extract_dir) && \
  19. echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \
  20. echo "$($(package)_clang_sha256_hash) $($(package)_source_dir)/$($(package)_clang_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \
  21. $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \
  22. mkdir -p toolchain/bin toolchain/lib/clang/3.5/include && \
  23. tar --strip-components=1 -C toolchain -xf $($(package)_source_dir)/$($(package)_clang_file_name) && \
  24. rm -f toolchain/lib/libc++abi.so* && \
  25. echo "#!/bin/sh" > toolchain/bin/$(host)-dsymutil && \
  26. echo "exit 0" >> toolchain/bin/$(host)-dsymutil && \
  27. chmod +x toolchain/bin/$(host)-dsymutil && \
  28. tar --strip-components=1 -xf $($(package)_source)
  29. endef
  30. define $(package)_set_vars
  31. $(package)_config_opts=--target=$(host) --disable-lto-support
  32. $(package)_ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib
  33. $(package)_cc=$($(package)_extract_dir)/toolchain/bin/clang
  34. $(package)_cxx=$($(package)_extract_dir)/toolchain/bin/clang++
  35. endef
  36. define $(package)_preprocess_cmds
  37. cd $($(package)_build_subdir); ./autogen.sh && \
  38. sed -i.old "/define HAVE_PTHREADS/d" ld64/src/ld/InputFiles.h
  39. endef
  40. define $(package)_config_cmds
  41. $($(package)_autoconf)
  42. endef
  43. define $(package)_build_cmds
  44. $(MAKE)
  45. endef
  46. define $(package)_stage_cmds
  47. $(MAKE) DESTDIR=$($(package)_staging_dir) install && \
  48. cd $($(package)_extract_dir)/toolchain && \
  49. mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include && \
  50. mkdir -p $($(package)_staging_prefix_dir)/bin $($(package)_staging_prefix_dir)/include && \
  51. cp bin/clang $($(package)_staging_prefix_dir)/bin/ &&\
  52. cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin/ &&\
  53. cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \
  54. cp -rf lib/clang/$($(package)_clang_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_clang_version)/include/ && \
  55. cp bin/llvm-dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \
  56. if `test -d include/c++/`; then cp -rf include/c++/ $($(package)_staging_prefix_dir)/include/; fi && \
  57. if `test -d lib/c++/`; then cp -rf lib/c++/ $($(package)_staging_prefix_dir)/lib/; fi
  58. endef