#!/usr/bin/env bash
# $Id$
#
# bootstrap --- regenerate the autotools machinery for BSPPFit.
#
# Copyright (C) 2026 Peter Felecan
# Assisted by Claude Sonnet 5 (Anthropic)
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Run this once after a fresh checkout (or after editing configure.ac
# / Makefile.am files) to produce 'configure' and the 'Makefile.in'
# files. Then run ./configure as usual.

set -euo pipefail

# Refuse to run from anywhere other than the project root.
if [[ ! -f configure.ac ]]
then
{
	echo "bootstrap: must be run from the project root (configure.ac not found)" >&2
	exit 1
}
fi

# --install copies (or symlinks) auxiliary build files; --symlink
# uses symlinks during development so that updates to system-wide
# autotools data are picked up without re-bootstrapping.
exec autoreconf --install --symlink --verbose
