Skip to content

Commit

Permalink
Docker: Use names arguments in build scripts
Browse files Browse the repository at this point in the history
This also correctly passed the number of build jobs to
build_elfutils.sh.
  • Loading branch information
hainest committed Dec 23, 2023
1 parent c4c4ade commit 12a1f5b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
4 changes: 3 additions & 1 deletion docker/Dockerfile.ubuntu
Expand Up @@ -41,5 +41,7 @@ RUN apt-get -qq update && \
libomp-dev

COPY docker/build_elfutils.sh docker/dependencies.versions /
RUN bash build_elfutils.sh ${build_elfutils}

RUN bash build_elfutils.sh --from-source ${build_elfutils} --jobs ${build_jobs}

RUN rm build_elfutils.sh dependencies.versions
14 changes: 12 additions & 2 deletions docker/build_elfutils.sh
Expand Up @@ -2,7 +2,17 @@

set -e

if test x"$1" != xyes; then
jobs=1 # run builds with N jobs (same as 'make -jN')
source=no # push images after building

while [[ "$#" -gt 0 ]]; do
case $1 in
-j|--jobs) jobs="$2"; shift 2; ;;
-s|--from-source) source="$2"; shift 2; ;;
esac
done

if test "$source" = "no"; then
apt install -qq -y --no-install-recommends elfutils libelf-dev libdw-dev libdebuginfod-dev
exit
fi
Expand All @@ -18,6 +28,6 @@ cd elfutils-${version}/
mkdir build
cd build
../configure --enable-libdebuginfod --disable-debuginfod
make install
make install -j ${jobs}
cd /
rm -rf elfutils-${version}/ elfutils-${version}.tar

0 comments on commit 12a1f5b

Please sign in to comment.