gdb install script: remove build artifacts and strip gdb binary after build to save some disk space

This commit is contained in:
Michael Rodler 2018-04-20 15:03:23 +02:00 committed by Yan
parent 985c884a96
commit 407a2a80d6

View file

@ -13,17 +13,31 @@ find_latest_gdb_version() {
} }
VERSION=$(find_latest_gdb_version) VERSION=$(find_latest_gdb_version)
echo $VERSION > gdb_version
rm -rf "gdb" || true
curl "https://ftp.gnu.org/gnu/gdb/gdb-$VERSION.tar.gz" | tar xz curl "https://ftp.gnu.org/gnu/gdb/gdb-$VERSION.tar.gz" | tar xz
cd "gdb-$VERSION" mv "gdb-$VERSION" "gdb"
set +x
# move to ctftools virtual env # move to ctftools virtual env
source ctf-tools-venv-activate source ctf-tools-venv-activate
set -x
PREFIX=$(pwd)
pushd ./gdb
./configure \ ./configure \
--prefix=$(dirname $PWD) \ --prefix=$PREFIX \
--with-python=$(which python) \ --with-python=$(which python) \
--enable-targets=all \ --enable-targets=all \
--with-guile=guile-2.0 --with-guile=guile-2.0
make -j $(nproc) make -j $(nproc)
make install make install
# remove build artifacts
make clean
popd
# reduce binary size a little...
strip bin/gdb || true
strip bin/gdbserver || true