-
Notifications
You must be signed in to change notification settings - Fork 39
/
build.sh
executable file
·58 lines (48 loc) · 1.37 KB
/
build.sh
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
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
set -e
CONTAINER=pdbg-build
Dockerfile=$(cat << EOF
FROM ubuntu:18.04
RUN apt-get update && apt-get install --no-install-recommends -yy \
make \
gcc-arm-linux-gnueabi \
libc-dev-armel-cross \
gcc-powerpc64le-linux-gnu \
libc-dev-ppc64el-cross \
autoconf \
automake \
libtool \
git \
device-tree-compiler
RUN groupadd -g ${GROUPS} ${USER} && useradd -d ${HOME} -m -u ${UID} -g ${GROUPS} ${USER}
USER ${USER}
ENV HOME ${HOME}
RUN /bin/bash
EOF
)
docker pull ubuntu:18.04
docker build -t ${CONTAINER} - <<< "${Dockerfile}"
RUN="docker run --rm=true --user=${USER} -w ${PWD} -v ${HOME}:${HOME} -t ${CONTAINER}"
${RUN} ./bootstrap.sh
# Out-of-tree build, arm
# TODO: clean up when the build fails
SRCDIR=$PWD
TEMPDIR=`mktemp -d ${HOME}/pdbgobjXXXXXX`
RUN_TMP="docker run --rm=true --user=${USER} -w ${TEMPDIR} -v ${HOME}:${HOME} -t ${CONTAINER}"
${RUN_TMP} ${SRCDIR}/configure --host=arm-linux-gnueabi
${RUN_TMP} make
rm -rf ${TEMPDIR}
# In-tree build, arm
${RUN} ./configure --host=arm-linux-gnueabi
${RUN} make
${RUN} make clean
# In-tree build, powerpc64le
${RUN} ./configure --host=powerpc64le-linux-gnu
${RUN} make
${RUN} make clean
# In-tree build, amd64
# TODO: work out how to install a amd64 compiler if we are building on a eg.
# ppc machine in a way that still works when we're on amd64
${RUN} ./configure --host=x86-64-linux-gnu
${RUN} make
${RUN} make clean