Skip to content

Instantly share code, notes, and snippets.

@agentzh

agentzh/build.sh Secret

Created January 23, 2021 00:53
Show Gist options
  • Save agentzh/eb08b14ff999a64021e9b7f39de8c030 to your computer and use it in GitHub Desktop.
Save agentzh/eb08b14ff999a64021e9b7f39de8c030 to your computer and use it in GitHub Desktop.
#!/bin/bash
#export LD_LIBRARY_PATH=/opt/dyninst/lib:/opt/dwarf/lib
prefix=/opt/stap
elfutils_dir=$HOME/git/elfutils
jobs=$(nproc)
clean_build=$1
#clean_build=1
sudo rm -rf $prefix || exit 1
if [ -n "$clean_build" ]; then
if false; then
cd $elfutils_dir
autoreconf -vif || exit 1
cd -
fi
#make clean
./configure \
--prefix=$prefix --disable-docs --disable-publican \
--disable-refdocs \
CC='ccache gcc -fdiagnostics-color=always' CXX='ccache g++ -fdiagnostics-color=always' \
CFLAGS="-g -O0 -U_FORTIFY_SOURCE -I/opt/elfutils/include" \
CXXFLAGS='-g -O0 -U_FORTIFY_SOURCE -I/opt/elfutils/include' \
LDFLAGS='-Wl,-rpath,/opt/elfutils/lib -L/opt/elfutils/lib' \
|| exit 1 #LDFLAGS="-Wl,-rpath,$LD_LIBRARY_PATH" V=1
#--with-dyninst=/opt/dyninst
fi
if [ -z "$clean_build" ]; then
time make V=1 -j$jobs || exit 1
else
time make V=1 -j$jobs || exit 1
fi
sudo make install || exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment