#!/bin/sh
#
# bootstrap
# This file is part of slide-switch.
#
# Copyright (C) 2016-2019 The slide-switch authors
# https://github.com/jefferyto/openwrt-slide-switch
#
# slide-switch is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# slide-switch is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with slide-switch.  If not, see <http://www.gnu.org/licenses/>.
#

set -o errexit

me=$(basename "$0")

if autoreconf --version >/dev/null 2>&1; then
	autoreconf --install --verbose "$@"
else
	echo "$me: running: aclocal $@"
	aclocal "$@"

	echo "$me: running: autoconf $@"
	autoconf "$@"

	echo "$me: running: automake --add-missing --copy $@"
	automake --add-missing --copy "$@"
fi

echo
echo "Ready for \`cd build && ../configure && make && make install'"
