-
Notifications
You must be signed in to change notification settings - Fork 36
/
build-toolchain.yml
47 lines (46 loc) · 1.42 KB
/
build-toolchain.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
parameters:
- name: config
type: string
- name: arch
type: string
- name: pkg
type: string
steps:
- script: |
set -e
sudo apt-get update
sudo apt-get install -y gcc g++ gperf bison flex texinfo help2man make libncurses5-dev \
python3-dev autoconf automake libtool libtool-bin gawk wget bzip2 xz-utils unzip \
patch rsync meson ninja-build
displayName: 'Prepare dependencies'
- script: |
set -e
wget http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-1.26.0.tar.bz2
tar -xjf crosstool-ng-1.26.0.tar.bz2
cd crosstool-ng-1.26.0
./configure --prefix=`pwd`/out
make
make install
displayName: 'Setup crosstool-ng'
- script: |
set -e
export PATH=$PATH:`pwd`/crosstool-ng-1.26.0/out/bin
mkdir toolchain-dir
cd toolchain-dir
cat ../${{ parameters.config }} > .config
ct-ng build
displayName: 'Build toolchain'
- script: |
set -e
chmod 0755 -R `pwd`/toolchain-dir/${{ parameters.pkg }}
./sysroot-scripts/sysroot-creator.sh build ${{ parameters.arch }} \
`pwd`/toolchain-dir/${{ parameters.pkg }}/${{ parameters.pkg }}/sysroot
displayName: 'Install additional libraries'
- script: |
set -e
cd toolchain-dir
tar -czf ${{ parameters.pkg }}.tar.gz ${{ parameters.pkg }}
displayName: 'Create pipeline asset'
- publish: toolchain-dir/${{ parameters.pkg }}.tar.gz
artifact: ${{ parameters.arch }}
displayName: 'Publish artifact'