#!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later # SPDX-FileCopyrightText: 2021 Alyssa Ross set -ue prefix=/usr/local bindir= unrecognized= for arg; do if [ "$arg" = "--help" ]; then cat <&2 exit 64 # EX_USAGE fi done bindir="${bindir:-$prefix/bin}" echo "// Generated by $0${*:+ $*}" > config.h.tmp echo "#define PREFIX \"$prefix\"" >> config.h.tmp echo "#define BINDIR \"$bindir\"" >> config.h.tmp mv config.h.tmp config.h sed -e "s#@PREFIX@#$prefix#g" -e "s#@BINDIR@#$bindir#g" Makefile.in > Makefile.tmp mv Makefile.tmp Makefile if [ -n "$unrecognized" ]; then echo "Warning: unrecognized options:$unrecognized" >&2 fi