#! /bin/bash
#########################################################################
#									#
#	acmbuild is automatically generated,				#
#		please do not modify!					#
#									#
#########################################################################

#########################################################################
#									#
# Author: Copyright (C) 2018-2019, 2021, 2023  Mark Grant		#
#									#
# Released under the GPLv3 only.					#
# SPDX-License-Identifier: GPL-3.0-only					#
#									#
# Purpose:								#
# Wrapper script to bootstrap.sh which simplifies the AutoTools		#
# distribution build.							#
#									#
# Syntax:	acmbuild	Parameters as per boostrap.sh		#
#									#
# Exit Codes:	0 - success						#
#		1 - failure						#
#		Exit codes from bootstrap.sh				#
#									#
# Further Info:								#
#									#
#########################################################################


##################
# Init variables #
##################
# shellcheck disable=SC2034  # Unused variable left, possibly useful
readonly version=1.1.0		# set version variable
# shellcheck disable=SC2034  # Unused variable left, possibly useful
readonly packageversion=1.7.5	# Version of the complete package


#############
# Functions #
#############

# Standard function to tidy up and return exit code.
# Parameters - 	$1 is the exit code.
# No return value.
script_exit()
{
	exit "$1"
}

# Standard trap exit function.
# No parameters.
# No return value.
# shellcheck disable=SC2317  # Do not warn about unreachable commands in trap
# functions, they are legitimate.
trap_exit()
{
	local exit_code=$?
	local msg

	msg="Script terminating with exit code $exit_code due to trap received."
	output "$msg" 1 0
	script_exit "$exit_code"
}

# Setup trap.
trap trap_exit SIGHUP SIGINT SIGQUIT SIGTERM


########
# Main #
########

/usr/libexec/acmbuild/bootstrap.sh "$@"
script_exit $?

