Created
May 23, 2017 16:46
-
-
Save semenko/f817594cc2b130a74613004821812522 to your computer and use it in GitHub Desktop.
Build samba from git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PATH="/usr/lib/ccache:$PATH" | |
die() { echo "$@" 1>&2 ; exit 1; } | |
if [ -z $1 ]; then | |
die "Run with a git tag, e.g.: $0 v4-2-test" | |
fi | |
echo "Updating samba4 to tag '$1'" | |
read -p "Press [enter] to continue..." | |
cd samba4 && git show --summary >> ../working-samba.txt && git fetch && git checkout $1 && git pull && git reset --hard HEAD && sleep 1 && git clean -x -f -d | |
echo "Configure and build samba?" | |
read -p "Press [enter] to continue..." | |
#if [ "$1" == debug ]; then | |
# echo "*** BUILDING DEBUG ***" | |
# sleep 1 | |
# ./configure --enable-debug && export CPPFLAGS="-g" && make -j8 | |
#elif [ "$1" == asan ]; then | |
# echo "*** Building DEBUG **** with *** ASAN ***" | |
# sleep 1 | |
# ./configure --enable-debug --address-sanitizer && export CPPFLAGS="-g -fsanitize=address -fno-omit-frame-pointer" LDFLAGS="-fsanitize=address" && make -j8 | |
# ./configure --enable-debug && export CPPFLAGS="-g -fsanitize=address -fno-omit-frame-pointer" LDFLAGS="-fsanitize=address" && make -j8 | |
# fi | |
echo "Building for debug + some opt, with -Og -g" | |
sleep 1 | |
./configure --enable-debug && export CPPFLAGS="-Og g" && make -j8 | |
echo "Samba4 built. Kill & install samba?" | |
read -p "Press [enter] to continue..." | |
killall samba ; make install && sleep 1 && nice -n -1 /usr/local/samba/sbin/samba |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment