At 2025-01-20T16:43:34-0600, G. Branden Robinson wrote: > I'm attaching the current version of my "make-groff-fast" script,[1] > which I run _all the time_.
Take a drink and/or claim your wager winnings. Regards, Branden
#!/bin/sh
set -e
: ${TAG:=HEAD}
: ${DESTDIR:=$HOME/groff-$TAG}
PROGNAME=${0##*/}
: ${CORES:=1}
COMMON_FLAGS="-Wall -Wextra -Wformat=2 \
-Wformat-overflow \
-Walloc-zero \
-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 \
-flto=auto \
-O0 -Og \
-ggdb
-D_FORTIFY_SOURCE=2"
CFLAGS="$COMMON_FLAGS \
-Wmissing-prototypes \
-Wold-style-definition \
-Wstrict-prototypes \
-Wold-style-declaration \
-Wformat=2 -D_FORTIFY_SOURCE=2"
CXXFLAGS="$COMMON_FLAGS \
-fcheck-new \
-Wredundant-decls \
-std=c++98 -pedantic -pedantic-errors -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
./bootstrap
SOURCE_DIR=.
if [ $? -eq 0 ]
then
if [ -z "$IN_TREE" ]
then
SOURCE_DIR=..
mkdir build && \
cd build
fi
else
exit 1
fi
test $? -eq 0 \
&& $SOURCE_DIR/configure --prefix=$DESTDIR \
&& make -j $CORES check \
&& make install install-doc \
&& (cd $DESTDIR && find . -type f | sort) >| ../payload-$TAG.new \
&& diff -u $SOURCE_DIR/payload-$TAG $SOURCE_DIR/payload-$TAG.new \
&& make uninstall
# vim:set ai et sw=4 ts=4 tw=80:
signature.asc
Description: PGP signature
