Add Utility scripts, bootstrap & build-debug.sh

This commit is contained in:
S David 2022-08-15 02:15:44 -04:00
parent e332e3ec0a
commit aa6bfd528e
3 changed files with 82 additions and 0 deletions

49
bootstrap.sh Executable file
View File

@ -0,0 +1,49 @@
#!/bin/sh
die()
{
rc=${2:-255}
echo "Error: ${1}"
exit ${rc}
}
cmdecho()
{
need_to_die=1
if [ "${1}" == "--optional" ] || [ "${1}" == "-o" ]; then
echo "optional"
need_to_die=0
shift;
fi
echo "$ ${@}"
if [ ${need_to_die} -ne 0 ]; then
${@} || die "${1} returned error code ${?}"
else
${@}
fi
#return ${?}
}
cmdecho git config -f .gitmodules submodule.third_party/FakeIt.shallow true
cmdecho -o git submodule update --init --recursive
if [ ${?} -ne 0 ]; then
cmdecho rm -rf third_party/FakeIt
cmdecho git submodule update --init --recursive
fi
if [ "x$1" == "x-f" ] || [ ! -x ./configure ]; then
cmdecho autoreconf -iv
fi
if [ ! -x ./configure ]; then
die "./configure does not exist. Check configure.ac and the autotools!"
fi
#cmdecho ./rebuild-qtforms.sh

20
build-debug.sh Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
BASE_DIR="$(cd "$(dirname "$0")"; pwd)";
die() {
echo "An error has occured. Stopping"
return 1
}
mkdir -pv $BASE_DIR/debug
cd $BASE_DIR/debug
. $BASE_DIR/debug.env
if [ ! -f ${PWD}/config.status ]; then
${BASE_DIR}/configure $@ || die
fi
# build with NICE=15 so as to not hog the processor
nice -n 15 make -j 1 V=1 check all

13
debug.env Normal file
View File

@ -0,0 +1,13 @@
#!/bin/sh
CFLAGS="-Og -ggdb ${CFLAGS}"
CXXFLAGS=" ${CFLAGS} ${CXXFLAGS}"
CPPFLAGS="-isystem /usr/local/include"
CPPFLAGS="${CPPFLAGS} -DQW_DEBUG"
export CC
export CXX
export CFLAGS
export CXXFLAGS
export CPPFLAGS