bootstrap (1544B)
1 #!/bin/sh 2 # This file is in the public domain. 3 4 set -eu 5 6 if ! git --version >/dev/null; then 7 echo "git not installed" 8 exit 1 9 fi 10 11 # Make sure that "git pull" et al. also update 12 # submodules to avoid accidental rollbacks. 13 git config --local submodule.recurse true 14 15 # Beware: We only want to update submodules to the commit hash 16 # stored in git, otherwise builds based on tags will not be 17 # reproducible. 18 echo "$0: Updating submodules" 19 echo | git submodule update --init --force 20 21 ./contrib/check-prebuilt 22 23 # This is more portable than `which' but comes with 24 # the caveat of not(?) properly working on busybox's ash: 25 existence() 26 { 27 command -v "$1" >/dev/null 2>&1 28 } 29 30 set -x 31 32 if existence uncrustify; then 33 echo "Installing uncrustify hook and configuration" 34 # Install uncrustify format symlink (if possible) 35 ln -s contrib/uncrustify.cfg uncrustify.cfg 2> /dev/null || true 36 # Install pre-commit hook (if possible) 37 ln -s ../../contrib/uncrustify_precommit .git/hooks/pre-commit 2> /dev/null || true 38 else 39 echo "Uncrustify not detected, hook not installed. Please install uncrustify if you plan on doing development" 40 fi 41 42 # Generate Makefile.am in contrib/ 43 cd contrib 44 rm -f Makefile.am 45 find wallet-core/challenger/ -type f -printf ' %p \\\n' | sort > Makefile.am.ext 46 # Remove extra '\' at the end of the file 47 truncate -s -2 Makefile.am.ext 48 cat Makefile.am.in Makefile.am.ext >> Makefile.am 49 # Prevent accidental editing of the generated Makefile.am 50 chmod -w Makefile.am 51 cd .. 52 53 54 echo "$0: Running autoreconf" 55 autoreconf -if