Skip to content
Snippets Groups Projects
Commit 4da588ad authored by Filippo Cremonese's avatar Filippo Cremonese
Browse files

Added macos toolchain

parent 42c54eba
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,8 @@
#@ load("/components/toolchain/arch/win32.lib.yml", "win32_toolchain_components")
#@ load("/components/toolchain/arch/win64.lib.yml", "win64_toolchain_components")
#@ load("/components/macos/macos.lib.yml", "macos_toolchain_components")
#@ load("/global_options.lib.yml", "options")
components:
......@@ -68,4 +70,6 @@ components:
_: #@ template.replace(win64_toolchain_components)
_: #@ template.replace(win32_toolchain_components)
_: #@ template.replace(macos_toolchain_components)
options: #@ options
#@ load("/lib/make.lib.yml", "make")
#@ load("/lib/cmake.lib.yml", "cmake_base_configuration")
#@ load("/lib/shell.lib.yml", "expand_args")
#@ source_url = "https://codeload.github.com/tpoechtrager/cctools-port/tar.gz/1e3f614aff4eaae01b6cc4d29c3237c93f3322f8"
---
#@ def prefixes():
- x86-64
- i686
#@ end
#@yaml/text-templated-strings
---
#@ def _macosx_clang_components():
#@ for prefix in prefixes():
macos/(@= prefix @)-clang:
builds:
default:
configure: ""
install: |
rm -f "${TMP_ROOT}${ORCHESTRA_ROOT}/bin/(@= prefix @)-apple-darwin11-clang"
cp support/add-sysroot-wrapper.sh "${TMP_ROOT}${ORCHESTRA_ROOT}/bin/(@= prefix @)-apple-darwin11-clang"
rm -f "${TMP_ROOT}${ORCHESTRA_ROOT}/bin/(@= prefix @)-apple-darwin11-clang++"
cp support/add-sysroot-wrapper.sh "${TMP_ROOT}${ORCHESTRA_ROOT}/bin/(@= prefix @)-apple-darwin11-clang++"
dependencies:
- macos/sdk
- clang-release
- macos/(@= prefix @)-ld64
#@ end
#@ end
---
#@ macosx_clang_components = _macosx_clang_components()
#@ load("/lib/make.lib.yml", "make")
#@ source_url = "https://codeload.github.com/tpoechtrager/cctools-port/tar.gz/1e3f614aff4eaae01b6cc4d29c3237c93f3322f8"
#@ source_url = "https://github.com/tpoechtrager/cctools-port/archive/cctools-877.8-ld64-253.9-1.tar.gz"
---
#@ def prefixes():
- x86-64
- i686
- arm
- aarch64
#@ end
#@yaml/text-templated-strings
---
#@ def _ld64_components():
#@ for prefix in prefixes():
macos/(@= prefix @)-ld64:
builds:
default:
configure: |
mkdir -p "$BUILD_DIR"
# extract.sh --into "$BUILD_DIR" --save-as "cctools-port.tar.gz" "(@= source_url @)"
# extract.sh --into "$BUILD_DIR" "(@= source_url @)"
git clone --depth 1 https://github.com/tpoechtrager/cctools-port.git "$BUILD_DIR"
cd "$BUILD_DIR/cctools"
./autogen.sh
autoconf --force
libtoolize --force
./configure \
--prefix="$ORCHESTRA_ROOT" \
--target=(@= prefix.replace("-", "_") @)-apple-darwin11 \
--enable-tapi-support \
CC="clang" \
CXX="clang++" \
OBJC="clang" \
CXXFLAGS="-I${BUILD_DIR}/include" \
LDFLAGS="-L${BUILD_DIR}/lib"
install: |
cd "$BUILD_DIR/cctools"
(@= make @)
(@= make @) install
dependencies:
- macos/libtapi
- clang-release
- toolchain/host/gcc
#@ end
#@ end
---
#@ ld64_components = _ld64_components()
#@ load("/lib/make.lib.yml", "make")
#@ load("/lib/cmake.lib.yml", "cmake_base_configuration")
#@ load("/lib/shell.lib.yml", "expand_args")
#@ clang_source_url = "https://opensource.apple.com/tarballs/clang/clang-800.0.42.1.tar.gz"
#@ libtapi_source_url = "https://opensource.apple.com/tarballs/tapi/tapi-1.30.tar.gz"
#@yaml/text-templated-strings
---
#@ def _libtapi_component():
builds:
default:
configure: |
mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"
extract.sh --into "$BUILD_DIR" "(@= clang_source_url @)"
extract.sh --into "$BUILD_DIR/src/projects/libtapi" "(@= libtapi_source_url @)"
sed -i 's|NOT APPLE|FALSE|' src/projects/libtapi/CMakeLists.txt
sed -i 's|^|#include <limits>\n|' src/projects/libtapi/include/tapi/Core/ArchitectureSupport.h
cmake src/ \
(@= expand_args(cmake_base_configuration(cmake_build_type="Release")) @) \
-DLLVM_INCLUDE_TESTS=OFF
install: |
cd "$BUILD_DIR"
(@= make @) libtapi
mkdir -p "${TMP_ROOT}${ORCHESTRA_ROOT}/lib"
mkdir -p "${TMP_ROOT}${ORCHESTRA_ROOT}/include"
rm -rf "${TMP_ROOT}${ORCHESTRA_ROOT}/include/tapi/"
cp lib/libtapi.so "${TMP_ROOT}${ORCHESTRA_ROOT}/lib/"
cp -ar src/projects/libtapi/include/tapi/ "${TMP_ROOT}${ORCHESTRA_ROOT}/include/"
cp -a projects/libtapi/include/tapi/Version.inc "${TMP_ROOT}${ORCHESTRA_ROOT}/include/tapi/"
dependencies:
- cmake
- clang-release
- toolchain/host/gcc
#@ end
---
#@ libtapi_component = _libtapi_component()
#@ load("@ytt:template", "template")
#@ load("/components/macos/libtapi.lib.yml", "libtapi_component")
#@ load("/components/macos/sdk.lib.yml", "macosx_sdk_component")
#@ load("/components/macos/ld64.lib.yml", "ld64_components")
#@ load("/components/macos/clang.lib.yml", "macosx_clang_components")
#@ def _macos_toolchain_components():
macos/libtapi: #@ libtapi_component
macos/sdk: #@ macosx_sdk_component
_ : #@ template.replace(ld64_components)
_ : #@ template.replace(macosx_clang_components)
#@ end
---
#@ macos_toolchain_components = _macos_toolchain_components()
#@ sdk_archive_name = "Xcode_9.xip-MacOSX.sdk.tar.gz"
#@yaml/text-templated-strings
---
#@ def _macosx_sdk_component():
builds:
default:
configure: ""
install: |
echo "TODO: macosx sdk" && exit 1
create-package.sh Xcode_9.xip
extract.sh --into "${TMP_ROOT}${ORCHESTRA_ROOT}" --src-archive-dir "$SDK_ARCHIVE_DIR" "(@= sdk_archive_name @)"
dependencies:
- cmake
- clang-release
- toolchain/host/gcc
additional_path: "$ORCHESTRA/helpers/repackage-apple-sdk"
#@ end
---
#@ macosx_sdk_component = _macosx_sdk_component()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment