diff options
author | Matthias Maennich <maennich@google.com> | 2019-06-10 14:41:49 +0100 |
---|---|---|
committer | Matthias Maennich <maennich@google.com> | 2019-06-10 14:41:49 +0100 |
commit | 2f2937cb8a5effb8f173384a82095b5fa38e4669 (patch) | |
tree | b54738c485134225749352c37c7582020df64d8b /abi | |
parent | c561e76004b4a9eef818c0f4d762798909c02e1b (diff) |
abi/bootstrap: build elfutils from source as well
The elfutils version used may make a difference for the produced abi
results. Hence, also build them from scratch.
Change-Id: Id96276746907d69470da00157569d455bc353c1f
Signed-off-by: Matthias Maennich <maennich@google.com>
Diffstat (limited to 'abi')
-rw-r--r-- | abi/.gitignore | 1 | ||||
-rwxr-xr-x | abi/bootstrap | 41 |
2 files changed, 33 insertions, 9 deletions
diff --git a/abi/.gitignore b/abi/.gitignore index 6ddc8a7..cbfa6e6 100644 --- a/abi/.gitignore +++ b/abi/.gitignore @@ -1,3 +1,4 @@ abigail-* +elfutils-* *.pyc __pycache__ diff --git a/abi/bootstrap b/abi/bootstrap index dace036..bad822e 100755 --- a/abi/bootstrap +++ b/abi/bootstrap @@ -14,11 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +ELFUTILS_VERSION=elfutils-0.176 ABIGAIL_VERSION=fb70149c NUM_CORES=$(cat /proc/cpuinfo | grep -c proc) BASE_DIR=$(readlink -f $(dirname $0)) OUT_DIR="${BASE_DIR}/abigail-inst/${ABIGAIL_VERSION}" + +ELFUTILS_SRC="${BASE_DIR}/elfutils-src" LIBABIGAIL_SRC="${BASE_DIR}/abigail-src" # Check output dir. @@ -29,19 +32,34 @@ fi set -x -PACKAGES="autoconf elfutils libtool libxml2-dev libdw-dev pkg-config python3" +PACKAGES="autoconf libtool libxml2-dev pkg-config python3" # Install the dependencies. if ! dpkg -s ${PACKAGES} > /dev/null 2>&1 ; then sudo apt-get install --yes ${PACKAGES} fi -# Assert minimum package versions -if ! dpkg --compare-versions \ - $(dpkg-query --showformat='${Version}' --show libdw-dev) ge 0.165 ; then - echo "ERROR: Minimum version of v0.165 for libdw-dev not met!" - exit 1 +# Acquire elfutils sources +if [ ! -d "${ELFUTILS_SRC}" ]; then + git clone git://sourceware.org/git/elfutils.git "${ELFUTILS_SRC}" +else + git -C ${ELFUTILS_SRC} fetch fi +git -C ${ELFUTILS_SRC} checkout ${ELFUTILS_VERSION} + +# Build elfutils +pushd "${ELFUTILS_SRC}" + #git clean -dfx + autoreconf -i --force + mkdir -p build/ + pushd build/ + ../configure --prefix="${OUT_DIR}" --enable-maintainer-mode + make -j${NUM_CORES} + make -j${NUM_CORES} install + popd +popd + +# Acquire libabigail sources if [ ! -d "${LIBABIGAIL_SRC}" ]; then git clone git://sourceware.org/git/libabigail.git "${LIBABIGAIL_SRC}" else @@ -56,9 +74,13 @@ pushd "${LIBABIGAIL_SRC}" autoreconf -i --force mkdir -p build/ pushd build/ - ../configure --prefix="${OUT_DIR}" --enable-cxx11=yes --disable-shared -# make -j${NUM_CORES} - make -j${NUM_CORES} install-exec + ../configure --prefix="${OUT_DIR}" \ + --enable-cxx11=yes \ + --disable-shared \ + "CPPFLAGS=-I${OUT_DIR}/include" \ + "LDFLAGS=-L${OUT_DIR}/lib" + make -j${NUM_CORES} + make -j${NUM_CORES} install popd popd @@ -68,5 +90,6 @@ echo echo "Note: Export following environment before running the executables:" echo echo "export PATH=\"${OUT_DIR}/bin:\${PATH}\"" +echo "export LD_LIBRARY_PATH=\"${OUT_DIR}/lib:\${LD_LIBRARY_PATH}\"" echo echo |