#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
#
# Regenerate the autotools build system from a fresh checkout.
# Run this once after cloning; afterwards, ./configure && make is enough.

set -eu

cd "$(dirname "$0")"

if ! command -v autoreconf >/dev/null 2>&1; then
    echo "error: autoreconf not found. Install GNU autoconf/automake/libtool." >&2
    exit 1
fi

echo "==> autoreconf -fi"
autoreconf -fi

echo "==> ready. Next: ./configure [--enable-debug] && make -j"
