#!/bin/sh set -e PROGNAME=${0##*/} : ${CORES:=1} COMMON_FLAGS="-Wall -Wextra -Wformat=2 \ -Wstringop-overflow=4 \ -Wshadow=global -Wredundant-decls \ -Wunused \ -Wunused-parameter \ -fsanitize=signed-integer-overflow \ -fsanitize-undefined-trap-on-error \ -fstack-protector-strong -fno-common \ -fstack-clash-protection \ -ftrapv \ -funsigned-char \ -fvar-tracking-assignments \ -ggdb" CFLAGS="$COMMON_FLAGS -Og \ -Wmissing-prototypes \ -Wold-style-definition \ -Wstrict-prototypes \ -Wold-style-declaration \ -Wformat=2 -D_FORTIFY_SOURCE=2" CXXFLAGS="$COMMON_FLAGS -Og \ -fcheck-new \ -Wredundant-decls \ -std=c++98 -pedantic -Wformat=2 -D_FORTIFY_SOURCE=2" export CFLAGS CXXFLAGS if [ $# -gt 1 ]; then echo "$PROGNAME: error: expected 0 or 1 arguments, got $#" >&2 exit 1 fi if [ -n "$1" ]; then if expr "$1" - 0 >/dev/null 2>&1; then CORES=$1 else echo "$PROGNAME: usage error: argument \"$1\" should be number of" \ "cores" >&2 exit 2 fi fi if ! test -f ./test-groff.in; then echo "$PROGNAME: error: ./test-groff.in not found" >&2 exit 3 fi set -x if [ -n "$IN_TREE" ] then test -f Makefile && make distclean else test -d ./build && (cd build && make distclean) test -d build && rm -r build fi if [ -z "$IN_TREE" ] then ./bootstrap && \ mkdir build && \ cd build && \ ../configure && make -j $CORES && \ make check else ./bootstrap && \ ./configure && \ make -j $CORES && \ make check fi # vim:set ai et sw=4 ts=4 tw=80: