Blame configure

38579a
#!/bin/sh
38579a
8360a8
# project-agnostic ./configure script, written by hand.
8360a8
# this file is covered by COPYING.SOFORT.
8360a8
38579a
set -eu
38579a
38579a
trap config_failure 1 2 EXIT
38579a
38579a
# before we begin...
38579a
mb_path="$PATH"
38579a
mb_script="$0"
38579a
mb_success=no
38579a
38579a
usage()
38579a
{
38579a
	cat "$mb_project_dir"/config.usage
38579a
38579a
	if [ _$mb_use_custom_cfgdefs = _yes ]; then
38579a
		printf '\n\n%s%s\n' \
38579a
			" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" \
38579a
			"^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
38579a
38579a
		printf '%s%s\n' \
38579a
			"| Listed above are configure's common switches " \
38579a
			"and environment variables.     |"
38579a
38579a
		printf '%s%s\n' \
38579a
			"| Found below are project-specific variables " \
38579a
			"and other customization options. |"
38579a
38579a
		printf '%s%s\n\n\n' \
38579a
			" ___________________________________________" \
38579a
			"__________________________________"
38579a
38579a
		cat "$mb_project_dir"/project/config/cfgdefs.usage
38579a
	fi
38579a
38579a
	exit 0
38579a
}
38579a
38579a
error_msg()
38579a
{
38579a
	printf '%s\n' "$@" >&2
38579a
}
38579a
38579a
warning_msg()
38579a
{
38579a
	printf '%s\n' "$@" >&2
38579a
}
38579a
82c35d
output_step_prolog()
82c35d
{
480842
	mb_line_dots='.................................'
480842
	mb_line_dots="${mb_line_dots}.${mb_line_dots}"
480842
	mb_step_desc="${mb_package} : ${1##*/} : ${2}()  "
82c35d
	mb_step_dlen="$((${#mb_line_dots} - ${#mb_step_desc}))"
ba10e0
ba10e0
	printf "configure step: ${2}()\n" >&3
480842
	printf "%s%${mb_step_dlen}.${mb_step_dlen}s  " "${mb_step_desc}" "${mb_line_dots}"
82c35d
}
82c35d
82c35d
output_step_epilog()
82c35d
{
82c35d
	printf 'OK.\n'
82c35d
}
82c35d
82c35d
output_script_status()
82c35d
{
82c35d
	mb_step_name="${1##*/} : ${2}"
82c35d
	mb_step_desc="${mb_package} : ${mb_step_name}"
ba10e0
ba10e0
	printf "configure info: ${2}\n" >&3
82c35d
	printf "%s\n" "${mb_step_desc}"
82c35d
}
82c35d
82c35d
output_section_break()
82c35d
{
6df457
	printf ' ..\n'
82c35d
}
82c35d
38579a
verify_safe_path()
38579a
{
38579a
	case "$mb_safe_path_name" in
38579a
		-*)
38579a
			error_msg "$mb_safe_path_desc may not begin with a hyphen."
38579a
			exit 2
38579a
			;;
38579a
38579a
		*\ *)
38579a
			error_msg "$mb_safe_path_desc may not contain spaces."
38579a
			exit 2
38579a
			;;
38579a
	esac
38579a
}
38579a
ba10e0
init_log()
ba10e0
{
ba10e0
	exec 3> config.log
ba10e0
ba10e0
	printf "This is config.log, generated by sofort's configure script.\n\n" >&3
ba10e0
	printf '$ %s' "$mb_script" >&3
ba10e0
}
ba10e0
38579a
init_vars()
38579a
{
38579a
	mb_project_dir=$(cd -- "${mb_script%/*}/" ; pwd -P)
38579a
	mb_pwd=$(pwd -P)
38579a
38579a
	mb_safe_path_desc='project directory'
38579a
	mb_safe_path_name="$mb_project_dir"
38579a
	verify_safe_path
38579a
38579a
	mb_safe_path_desc='working directory'
38579a
	mb_safe_path_name="$mb_pwd"
38579a
	verify_safe_path
38579a
38579a
	mb_custom_cfgdefs_args=''
38579a
	mb_custom_cfgdefs_space=''
38579a
1d3c3c
	mb_srcinfo='$(PROJECT_DIR)/project/srcdist/srcinfo.in'
1d3c3c
	mb_srcsite='localhost'
1d3c3c
1d3c3c
	mb_pgprkey='!!VARIABLE_NOT_SET!!'
1d3c3c
	mb_pgpskey='!!VARIABLE_NOT_SET!!'
1d3c3c
38579a
	sfrt_impl_dir=$mb_project_dir/sofort
38579a
	sfrt_config_dir=$sfrt_impl_dir/config
38579a
	sfrt_core_dir=$sfrt_impl_dir/core
38579a
	sfrt_config_vars=$sfrt_config_dir/config.vars
38579a
	sfrt_flag_vars=$sfrt_config_dir/flag.vars
9a06ee
	sfrt_opt_vars=$sfrt_config_dir/opt.vars
38579a
	sfrt_cfgdefs_in=$sfrt_config_dir/cfgdefs.in
38579a
38579a
	mb_make_vars=$(< "$sfrt_config_vars" \
38579a
		grep -v -e '^#' -e '^$' | tr '[:lower:]' '[:upper:]')
38579a
38579a
	mb_impl_vars=$(< "$sfrt_config_vars" \
38579a
		grep -v -e '^#' -e '^$' | sed 's/^/mb_/g')
38579a
38579a
	mb_proj_vars=$(< "$sfrt_config_vars" \
38579a
		grep -v -e '^#' -e '^$' | sed 's/^/mb_default_/g')
38579a
38579a
	mb_flag_vars=$(< "$sfrt_flag_vars" \
38579a
		grep -v -e '^#' -e '^$')
38579a
38579a
	mb_vars="$mb_make_vars $mb_impl_vars $mb_proj_vars $mb_flag_vars"
38579a
38579a
	for mb_var in $(printf '%s' "$mb_vars") ; do
38579a
		mb_expr=$mb_var='${'$mb_var':-}'
38579a
		eval "$mb_expr"
38579a
	done
38579a
38579a
	# ccenv
38579a
	. $mb_project_dir/sofort/ccenv/ccenv.sh
38579a
38579a
	if ! [ -L ./ccenv ]; then
38579a
		if [ -d ./ccenv ]; then
38579a
			rm -f ./ccenv/host.mk
38579a
			rm -f ./ccenv/native.mk
38579a
			rmdir ./ccenv
38579a
		fi
38579a
	fi
38579a
38579a
	# config.project
38579a
	if [ -z "$mb_config" ]; then
b77552
		mb_config="$mb_project_dir/config.project"
b77552
	fi
b77552
b77552
	. "$mb_config"
b77552
9d9f05
	# config.project make preferences
9d9f05
	if [ -z "${MAKE}" ]; then
9d9f05
		MAKE="$mb_make"
9d9f05
	fi
9d9f05
9d9f05
	if [ -z "${MAKEMODE}" ]; then
9d9f05
		MAKEMODE="$mb_makemode"
9d9f05
	fi
9d9f05
fbe823
fbe823
	if [ -z "$mb_makefile" ]; then
fbe823
		mb_makefile='Makefile'
fbe823
	fi
fbe823
427a69
	# project-specific initialization
427a69
	if [ _$mb_use_custom_cfginit = _yes ]; then
427a69
		. "$mb_project_dir/project/config/cfginit.sh"
427a69
	fi
427a69
b77552
	# package
b77552
	if [ -z "$mb_package" ]; then
b77552
		error_msg "$mb_script: incomplete information in $mb_config."
b77552
		error_msg "$mb_script: \$mb_package not set."
b77552
		exit 1
38579a
	fi
38579a
7edd04
	if [ -z "${NICKNAME}" ]; then
7edd04
		NICKNAME="$mb_nickname"
7edd04
	fi
7edd04
c4a16f
	# srcinfo
c4a16f
	if [ -n "$SOURCE_DIR" ]; then
c4a16f
		mb_source_dir_set=yes
c4a16f
	fi
c4a16f
82c35d
	# step prolog
82c35d
	output_step_prolog ${mb_script} 'init_vars'
82c35d
38579a
	# project
38579a
	mb_nickname=$NICKNAME
38579a
	mb_source_dir=$SOURCE_DIR
38579a
38579a
	# dirs
38579a
	mb_prefix=$PREFIX
38579a
	mb_exec_prefix=$EXEC_PREFIX
38579a
	mb_bindir=$BINDIR
38579a
	mb_sbindir=$SBINDIR
38579a
	mb_libdir=$LIBDIR
38579a
	mb_includedir=$INCLUDEDIR
38579a
	mb_oldincludedir=$OLDINCLUDEDIR
38579a
	mb_mandir=$MANDIR
38579a
	mb_docdir=$DOCDIR
38579a
	mb_libexecdir=$LIBEXECDIR
38579a
38579a
	mb_sysconfdir=$SYSCONFDIR
38579a
	mb_sharedstatedir=$SHAREDSTATEDIR
38579a
	mb_localstatedir=$LOCALSTATEDIR
38579a
	mb_runstatedir=$RUNSTATEDIR
38579a
	mb_datarootdir=$DATAROOTDIR
38579a
	mb_datadir=$DATADIR
38579a
	mb_infodir=$INFODIR
38579a
	mb_localedir=$LOCALEDIR
38579a
	mb_htmldir=$HTMLDIR
38579a
	mb_dvidir=$DVIDIR
38579a
	mb_pdfdir=$PDFDIR
38579a
	mb_psdir=$PSDIR
38579a
cfb7a8
	# make
cfb7a8
	mb_make=$MAKE
f16ba0
	mb_makemode=$MAKEMODE
38579a
38579a
	# build
38579a
	mb_build=$BUILD
38579a
	mb_cchost=$CCHOST
38579a
	mb_cfghost=$CFGHOST
38579a
	mb_arch=$ARCH
38579a
	mb_compiler=$COMPILER
38579a
	mb_toolchain=$TOOLCHAIN
38579a
	mb_sysroot=$SYSROOT
38579a
	mb_cross_compile=$CROSS_COMPILE
38579a
	mb_shell=$SHELL
38579a
38579a
	# switches
38579a
	mb_cflags=$CFLAGS
38579a
	mb_cflags_debug=$CFLAGS_DEBUG
38579a
	mb_cflags_common=$CFLAGS_COMMON
38579a
	mb_cflags_cmdline=$CFLAGS_CMDLINE
38579a
	mb_cflags_config=$CFLAGS_CONFIG
38579a
	mb_cflags_sysroot=$CFLAGS_SYSROOT
38579a
	mb_cflags_os=$CFLAGS_OS
38579a
	mb_cflags_site=$CFLAGS_SITE
38579a
	mb_cflags_path=$CFLAGS_PATH
38579a
	mb_cflags_strict=$CFLAGS_STRICT
38579a
	mb_cflags_util=$CFLAGS_UTIL
38579a
	mb_cflags_last=$CFLAGS_LAST
38579a
	mb_cflags_once=$CFLAGS_ONCE
38579a
38579a
	mb_ldflags=$LDFLAGS
38579a
	mb_ldflags_debug=$LDFLAGS_DEBUG
38579a
	mb_ldflags_common=$LDFLAGS_COMMON
38579a
	mb_ldflags_cmdline=$LDFLAGS_CMDLINE
38579a
	mb_ldflags_config=$LDFLAGS_CONFIG
38579a
	mb_ldflags_sysroot=$LDFLAGS_SYSROOT
38579a
	mb_ldflags_path=$LDFLAGS_PATH
38579a
	mb_ldflags_strict=$LDFLAGS_STRICT
38579a
	mb_ldflags_util=$LDFLAGS_UTIL
38579a
	mb_ldflags_last=$LDFLAGS_LAST
38579a
	mb_ldflags_once=$LDFLAGS_ONCE
38579a
38579a
	mb_pe_subsystem=$PE_SUBSYSTEM
38579a
	mb_pe_image_base=$PE_IMAGE_BASE
38579a
38579a
	# overrides
38579a
	mb_user_cc=$CC
38579a
	mb_user_cpp=$CPP
38579a
	mb_user_cxx=$CXX
38579a
38579a
	mb_native_cc=$NATIVE_CC
38579a
	mb_native_cpp=$NATIVE_CPP
38579a
	mb_native_cxx=$NATIVE_CXX
38579a
38579a
	mb_native_host=$NATIVE_HOST
38579a
	mb_native_cfghost=$NATIVE_CFGHOST
38579a
	mb_native_cflags=$NATIVE_CFLAGS
38579a
	mb_native_ldflags=$NATIVE_LDFLAGS
38579a
38579a
	mb_native_pe_subsystem=$NATIVE_PE_SUBSYSTEM
38579a
	mb_native_pe_image_base=$NATIVE_PE_IMAGE_BASE
82c35d
82c35d
	# step epilog
82c35d
	output_step_epilog
38579a
}
38579a
38579a
38579a
verify_build_directory()
38579a
{
82c35d
	output_step_prolog ${mb_script} 'verify_build_directory'
82c35d
38579a
	if [ "$mb_project_dir" = "$mb_pwd" ]; then
38579a
		if [ _$mb_require_out_of_tree = _yes ]; then
38579a
			error_msg "$mb_package: out-of-tree builds are required."
38579a
			error_msg "please invoke configure again from a clean build directory."
38579a
			exit 1
38579a
		else
38579a
			mb_project_dir='.'
38579a
		fi
38579a
	fi
38579a
f3bdd7
	if [ -f "$mb_pwd/Makefile.common" ]; then
f3bdd7
		error_msg
f3bdd7
		error_msg "$mb_package: the file-name Makefile.common is reserved for bootstrapping projects."
f3bdd7
		error_msg "$mb_package: please remove or rename the file manually and then re-run configure."
f3bdd7
		exit 1
f3bdd7
	fi
f3bdd7
fbe823
	rm -f Makefile Makefile.host Makefile.tmp Makefile.failed $mb_makefile
82c35d
82c35d
	output_step_epilog
38579a
}
38579a
38579a
38579a
verify_source_directory()
38579a
{
82c35d
	output_step_prolog ${mb_script} 'verify_source_directory'
82c35d
e81850
	if [ _"$mb_source_dir" != _${mb_source_dir##* } ]; then
e81850
		error_msg "source directory path contains spaces, aborting."
e81850
		exit 1
e81850
	fi
e81850
e81850
	eval mb_source_dir=$(printf '%s' "$mb_source_dir")
e81850
38579a
	if [ -z "$mb_source_dir" ]; then
38579a
		if [ _$mb_require_source_dir = _yes ]; then
38579a
			error_msg "$mb_package: specifying an external source directory is required."
38579a
			error_msg "you can set the source directory either via --source-dir=<path>,"
38579a
			error_msg "or by setting the SOURCE_DIR variable."
38579a
			exit 1
38579a
		fi
38579a
	fi
82c35d
82c35d
	output_step_epilog
38579a
}
38579a
38579a
c4a16f
verify_source_info()
c4a16f
{
c4a16f
	output_step_prolog ${mb_script} 'verify_source_info'
c4a16f
c4a16f
	if [ "${mb_source_dir_set:-}" = yes ]; then
c4a16f
		if [ -n "$mb_rawball" ] || [ -n "$mb_modball" ] || [ -n "$mb_srcball" ]; then
c4a16f
			error_msg "$mb_package: conflicting arguments: --rawball/--modball/--srcball arguments"
c4a16f
			error_msg "may not be used together with an explicit source-dir argument or variable."
c4a16f
			exit 1
c4a16f
		fi
c4a16f
	fi
c4a16f
c4a16f
	if [ -n "$mb_srcball" ]; then
c4a16f
		eval mb_srcball=$(printf '%s' "$mb_srcball")
c4a16f
c4a16f
		if [ -n "$mb_rawball" ] || [ -n "$mb_modball" ]; then
c4a16f
			error_msg "$mb_package: conflicting arguments: --rawball and/or --modball arguments"
c4a16f
			error_msg "may not be used together with an explicitly --srcball argument."
c4a16f
			exit 1
c4a16f
		fi
c4a16f
c4a16f
		if [ -z "$mb_srcball_sha256" ]; then
c4a16f
			error_msg "$mb_package: --srcball-sha256 must be provided"
c4a16f
			error_msg "in conjunction with --srcball."
c4a16f
			exit 1
c4a16f
		fi
c4a16f
c4a16f
		mb_srcball_sha256_test=$(sha256sum "$mb_srcball")
c4a16f
		mb_srcball_sha256_test="${mb_srcball_sha256_test%% *}"
c4a16f
c4a16f
		if [ "$mb_srcball_sha256_test" != "$mb_srcball_sha256" ]; then
c4a16f
			error_msg "$mb_package: sha256 signature of srcball $mb_srcball does not match!"
c4a16f
			exit 1
c4a16f
		fi
c4a16f
c4a16f
		mb_srcball_topdir=$(xz -c -d "$mb_srcball" | pax | sed -n '1,1p')
c4a16f
		mb_source_dir="./srctree/$mb_package/${mb_srcball_topdir%/}"
c4a16f
c4a16f
		mb_srcball_dirname=$(cd -- "${mb_srcball%/*}" ; pwd -P)
c4a16f
		mb_srcball_basename=${mb_srcball##*/}
c4a16f
		mb_srcball="$mb_srcball_dirname/$mb_srcball_basename"
c4a16f
c4a16f
		mkdir -p "./srctree/$mb_package"
c4a16f
		mb_dummy=$(cd -- "./srctree/$mb_package"; xz -c -d "$mb_srcball" | pax -r)
c4a16f
		mb_source_dir=$(cd -- $mb_source_dir; pwd -P)
c4a16f
	fi
c4a16f
c4a16f
	if [ -z "$mb_rawball" ] && [ -n "$mb_modball" ]; then
c4a16f
		error_msg "$mb_package: conflicting arguments: --modball argument may only be used"
c4a16f
		error_msg "together with an explicit --rawball argument."
c4a16f
		exit 1
c4a16f
	fi
c4a16f
c4a16f
	if [ -n "$mb_modball" ]; then
c4a16f
		eval mb_modball=$(printf '%s' "$mb_modball")
c4a16f
c4a16f
		if [ -z "$mb_modball_sha256" ]; then
c4a16f
			error_msg "$mb_package: --modball-sha256 must be provided"
c4a16f
			error_msg "in conjunction with --modball."
c4a16f
			exit 1
c4a16f
		fi
c4a16f
c4a16f
		mb_modball_sha256_test=$(sha256sum "$mb_modball")
c4a16f
		mb_modball_sha256_test="${mb_modball_sha256_test%% *}"
c4a16f
c4a16f
		if [ "$mb_modball_sha256_test" != "$mb_modball_sha256" ]; then
c4a16f
			error_msg "$mb_package: sha256 signature of modball $mb_modball does not match!"
c4a16f
			exit 1
c4a16f
		fi
c4a16f
	fi
c4a16f
c4a16f
	if [ -n "$mb_rawball" ]; then
c4a16f
		eval mb_rawball=$(printf '%s' "$mb_rawball")
c4a16f
c4a16f
		if [ -z "$mb_rawball_sha256" ]; then
c4a16f
			error_msg "$mb_package: --rawball-sha256 must be provided."
c4a16f
			error_msg "in conjunction with --rawball."
c4a16f
			exit 1
c4a16f
		fi
c4a16f
c4a16f
		mb_rawball_sha256_test=$(sha256sum "$mb_rawball")
c4a16f
		mb_rawball_sha256_test="${mb_rawball_sha256_test%% *}"
c4a16f
c4a16f
		if [ "$mb_rawball_sha256_test" != "$mb_rawball_sha256" ]; then
c4a16f
			error_msg "$mb_package: sha256 signature of rawball $mb_rawball does not match!"
c4a16f
			exit 1
c4a16f
		fi
c4a16f
c4a16f
		mb_rawball_topdir=$(xz -c -d "$mb_rawball" | pax | sed -n '1,1p')
c4a16f
		mb_source_dir="./srctree/$mb_package/${mb_rawball_topdir%/}"
c4a16f
c4a16f
		mb_rawball_dirname=$(cd -- "${mb_rawball%/*}" ; pwd -P)
c4a16f
		mb_rawball_basename=${mb_rawball##*/}
c4a16f
		mb_rawball="$mb_rawball_dirname/$mb_rawball_basename"
c4a16f
c4a16f
		mkdir -p "./srctree/$mb_package"
c4a16f
		mb_dummy=$(cd -- "./srctree/$mb_package"; xz -c -d "$mb_rawball" | pax -r)
c4a16f
		mb_source_dir=$(cd -- $mb_source_dir; pwd -P)
c4a16f
	fi
c4a16f
c4a16f
	if [ -n "$mb_modball" ]; then
c4a16f
		mb_modball_dirname=$(cd -- "${mb_modball%/*}" ; pwd -P)
c4a16f
		mb_modball_basename=${mb_modball##*/}
c4a16f
		mb_modball="$mb_modball_dirname/$mb_modball_basename"
c4a16f
c4a16f
		mb_modball_topdir="./modtree/$mb_package/$mb_modball_sha256"
c4a16f
		mkdir -p "$mb_modball_topdir"
c4a16f
		mb_modball_topdir=$(cd -- $mb_modball_topdir; pwd -P)
c4a16f
		mb_dummy=$(cd -- "$mb_modball_topdir"; xz -c -d "$mb_modball" | pax -r)
c4a16f
c4a16f
		if [ -d "$mb_modball_topdir/overlay" ]; then
c4a16f
			mb_dummy=$(cd -- "$mb_modball_topdir/overlay"; \
c4a16f
				cp -p -P -R . "$mb_source_dir")
c4a16f
		fi
c4a16f
c4a16f
		if [ -d "$mb_modball_topdir/patches" ]; then
c4a16f
			mb_dummy=$(cd -- "$mb_source_dir";                        \
c4a16f
				for p in $mb_modball_topdir/patches/*.patch; do  \
c4a16f
					patch -p1 < $p;                         \
c4a16f
				done);
c4a16f
		fi
c4a16f
	fi
c4a16f
c4a16f
	output_step_epilog
c4a16f
}
c4a16f
c4a16f
38579a
common_defaults()
38579a
{
82c35d
	# step prolog
82c35d
	output_step_prolog ${mb_script} 'common_defaults'
82c35d
38579a
	# project-specific config definitions
38579a
	if [ _$mb_use_custom_cfgdefs = _yes ]; then
38579a
		cat $sfrt_cfgdefs_in > cfgdefs.mk
38579a
	else
38579a
		printf '%s %s\n\n' \
38579a
				'# this project does not include' \
38579a
				'a custom config step.'           \
38579a
			> cfgdefs.mk
38579a
		cat $sfrt_cfgdefs_in >> cfgdefs.mk
38579a
38579a
		if [ -f $mb_project_dir/project/cfgdefs.in ]; then
38579a
			cat $mb_project_dir/project/cfgdefs.in >> cfgdefs.mk
38579a
		fi
38579a
	fi
38579a
38579a
	# user build-time overrides
38579a
	touch usrdefs.mk
38579a
38579a
	# git
38579a
	if [ -n "$mb_source_dir" ]; then
38579a
		if [ -d "$mb_source_dir/.git" ]; then
38579a
			mb_git_reference_index="\$(SOURCE_DIR)/.git/index"
38579a
		fi
38579a
	elif [ -d "$mb_project_dir/.git" ]; then
38579a
		mb_git_reference_index="\$(PROJECT_DIR)/.git/index"
38579a
	fi
38579a
38579a
	# project
38579a
	[ -n "$mb_nickname" ] 		|| mb_nickname=$mb_package
38579a
	[ -n "$mb_source_dir" ] 	|| mb_source_dir=$mb_project_dir
38579a
	[ -n "$mb_avoid_version" ] 	|| mb_avoid_version='no'
38579a
38579a
	# pkgconfig
38579a
	[ -n "$mb_pkgname" ]		|| mb_pkgname="$mb_default_pkgname"
38579a
	[ -n "$mb_pkgdesc" ]		|| mb_pkgdesc="$mb_default_pkgdesc"
38579a
	[ -n "$mb_pkgusrc" ]		|| mb_pkgusrc="$mb_default_pkgusrc"
38579a
	[ -n "$mb_pkgrepo" ]		|| mb_pkgrepo="$mb_default_pkgrepo"
38579a
	[ -n "$mb_pkgpsrc" ]		|| mb_pkgpsrc="$mb_default_pkgpsrc"
38579a
	[ -n "$mb_pkgdurl" ]		|| mb_pkgdurl="$mb_default_pkgdurl"
88a270
	[ -n "$mb_pkgbugs" ]		|| mb_pkgbugs="$mb_default_pkgbugs"
88a270
	[ -n "$mb_pkghome" ]		|| mb_pkghome="$mb_default_pkghome"
38579a
	[ -n "$mb_pkgdefs" ]		|| mb_pkgdefs="$mb_default_pkgdefs"
38579a
	[ -n "$mb_pkglibs" ]		|| mb_pkglibs="$mb_default_pkglibs"
38579a
c4a16f
	# srcinfo
c4a16f
	[ -n "$mb_rawball" ]		|| mb_rawball="$mb_default_rawball"
c4a16f
	[ -n "$mb_rawball_url" ]	|| mb_rawball_url="$mb_default_rawball_url"
c4a16f
	[ -n "$mb_rawball_sha256" ]	|| mb_rawball_sha256="$mb_default_rawball_sha256"
c4a16f
	[ -n "$mb_modball" ]		|| mb_modball="$mb_default_modball"
c4a16f
	[ -n "$mb_modball_url" ]	|| mb_modball_url="$mb_default_modball_url"
c4a16f
	[ -n "$mb_modball_sha256" ]	|| mb_modball_sha256="$mb_default_modball_sha256"
c4a16f
	[ -n "$mb_srcball" ]		|| mb_srcball="$mb_default_srcball"
c4a16f
	[ -n "$mb_srcball_url" ]	|| mb_srcball_url="$mb_default_srcball_url"
c4a16f
	[ -n "$mb_srcball_sha256" ]	|| mb_srcball_sha256="$mb_default_srcball_sha256"
c4a16f
38579a
	# dirs
38579a
	[ -n "$mb_prefix" ] 		|| [ -n "$mb_prefix_set" ] \
38579a
					|| mb_prefix='/usr/local'
38579a
38579a
	[ -n "$mb_exec_prefix" ] 	|| [ -n "$mb_exec_prefix_set" ]	\
38579a
					|| mb_exec_prefix=$mb_prefix
38579a
38579a
	[ -n "$mb_bindir" ] 		|| [ -n "$mb_bindir_set" ] \
38579a
					|| [ -n "$mb_bindir_basename" ] \
38579a
					|| mb_bindir=$mb_exec_prefix/bin
38579a
38579a
	[ -n "$mb_bindir" ] 		|| [ -n "$mb_bindir_set" ] \
38579a
					|| mb_bindir=$mb_exec_prefix/$mb_bindir_basename
38579a
38579a
	[ -n "$mb_sbindir" ] 		|| mb_sbindir=$mb_exec_prefix/sbin
38579a
	[ -n "$mb_libdir" ] 		|| mb_libdir=$mb_exec_prefix/lib
38579a
	[ -n "$mb_includedir" ]		|| mb_includedir=$mb_prefix/include
38579a
	[ -n "$mb_oldincludedir" ]	|| mb_oldincludedir=$mb_prefix/include
38579a
	[ -n "$mb_datarootdir" ] 	|| mb_datarootdir=$mb_prefix/share
38579a
	[ -n "$mb_mandir" ] 		|| mb_mandir=$mb_datarootdir/man
69aab9
	[ -n "$mb_docdir" ] 		|| mb_docdir=$mb_datarootdir/doc/'$(PACKAGE)'
38579a
	[ -n "$mb_libexecdir" ]		|| mb_libexecdir=$mb_exec_prefix/libexec
38579a
38579a
	[ -n "$mb_sysconfdir" ] 	|| mb_sysconfdir=$mb_exec_prefix/etc
38579a
	[ -n "$mb_sharedstatedir" ] 	|| mb_sharedstatedir=$mb_prefix/com
38579a
	[ -n "$mb_localstatedir" ] 	|| mb_localstatedir=$mb_prefix/var
38579a
	[ -n "$mb_runstatedir" ] 	|| mb_runstatedir=$mb_localstatedir/run
38579a
	[ -n "$mb_datarootdir" ] 	|| mb_datarootdir=$mb_prefix/share
38579a
	[ -n "$mb_datadir" ] 		|| mb_datadir=$mb_datarootdir
38579a
	[ -n "$mb_infodir" ] 		|| mb_infodir=$mb_datarootdir/info
38579a
	[ -n "$mb_localedir" ] 		|| mb_localedir=$mb_datarootdir/locale
38579a
	[ -n "$mb_htmldir" ] 		|| mb_htmldir=$mb_docdir
38579a
	[ -n "$mb_dvidir" ] 		|| mb_dvidir=$mb_docdir
38579a
	[ -n "$mb_pdfdir" ] 		|| mb_pdfdir=$mb_docdir
38579a
	[ -n "$mb_psdir" ] 		|| mb_psdir=$mb_docdir
38579a
38579a
	# switches
38579a
	[ -n "$mb_cflags_debug" ]	|| mb_cflags_debug=$mb_default_cflags_debug
38579a
	[ -n "$mb_cflags_common" ]	|| mb_cflags_common=$mb_default_cflags_common
38579a
	[ -n "$mb_cflags_cmdline" ]	|| mb_cflags_cmdline=$mb_default_cflags_cmdline
38579a
	[ -n "$mb_cflags_config" ]	|| mb_cflags_config=$mb_default_cflags_config
38579a
	[ -n "$mb_cflags_sysroot" ]	|| mb_cflags_sysroot=$mb_default_cflags_sysroot
38579a
	[ -n "$mb_cflags_os" ]		|| mb_cflags_os=$mb_default_cflags_os
38579a
	[ -n "$mb_cflags_site" ]	|| mb_cflags_site=$mb_default_cflags_site
38579a
	[ -n "$mb_cflags_path" ]	|| mb_cflags_path=$mb_default_cflags_path
38579a
	[ -n "$mb_cflags_strict" ]	|| mb_cflags_strict=$mb_default_cflags_strict
38579a
	[ -n "$mb_cflags_util" ]	|| mb_cflags_util=$mb_default_cflags_util
38579a
	[ -n "$mb_cflags_last" ]	|| mb_cflags_last=$mb_default_cflags_last
38579a
	[ -n "$mb_cflags_once" ]	|| mb_cflags_once=$mb_default_cflags_once
38579a
38579a
	[ -n "$mb_ldflags_debug" ]	|| mb_ldflags_debug=$mb_default_ldflags_debug
38579a
	[ -n "$mb_ldflags_common" ]	|| mb_ldflags_common=$mb_default_ldflags_common
38579a
	[ -n "$mb_ldflags_cmdline" ]	|| mb_ldflags_cmdline=$mb_default_ldflags_cmdline
38579a
	[ -n "$mb_ldflags_config" ]	|| mb_ldflags_config=$mb_default_ldflags_config
38579a
	[ -n "$mb_ldflags_sysroot" ]	|| mb_ldflags_sysroot=$mb_default_ldflags_sysroot
38579a
	[ -n "$mb_ldflags_path" ]	|| mb_ldflags_path=$mb_default_ldflags_path
38579a
	[ -n "$mb_ldflags_strict" ]	|| mb_ldflags_strict=$mb_default_ldflags_strict
38579a
	[ -n "$mb_ldflags_util" ]	|| mb_ldflags_util=$mb_default_ldflags_util
38579a
	[ -n "$mb_ldflags_last" ]	|| mb_ldflags_last=$mb_default_ldflags_last
38579a
	[ -n "$mb_ldflags_once" ]	|| mb_ldflags_once=$mb_default_ldflags_once
38579a
38579a
	# native switches
38579a
	[ -n "$mb_native_cflags" ]	|| mb_native_cflags=$mb_default_native_cflags
38579a
	[ -n "$mb_native_ldflags" ]	|| mb_native_ldflags=$mb_default_native_ldflags
38579a
38579a
	# config
38579a
	[ -n "$mb_all_static" ]		|| mb_all_static='no'
38579a
	[ -n "$mb_all_shared" ]		|| mb_all_shared='no'
38579a
	[ -n "$mb_disable_frontend" ]	|| mb_disable_frontend='no'
38579a
	[ -n "$mb_disable_static" ]	|| mb_disable_static='no'
38579a
	[ -n "$mb_disable_shared" ]	|| mb_disable_shared='no'
38579a
38579a
	# host/target
38579a
	[ -n "$mb_host" ] 		|| mb_host=$mb_target
38579a
	[ -n "$mb_target" ] 		|| mb_target=$mb_host
38579a
38579a
	# sysroot
38579a
	if [ -n "$mb_sysroot" ]; then
38579a
		if [ -z "$mb_cflags_sysroot" ]; then
38579a
			mb_cflags_sysroot="--sysroot=$mb_sysroot"
38579a
		fi
38579a
38579a
		if [ -z "$mb_ldflags_sysroot" ]; then
38579a
			mb_ldflags_sysroot="--sysroot=$mb_sysroot"
38579a
		fi
38579a
	fi
38579a
38579a
	# debug
38579a
	if [ _$mb_debug = _yes ]; then
38579a
		if [ -z "$mb_cflags_debug" ]; then
38579a
			mb_cflags_debug='-g3 -O0'
38579a
		fi
38579a
	fi
38579a
cfb7a8
	# make
cfb7a8
	if [ -z "$mb_make" ]; then
cfb7a8
		mb_make='make'
cfb7a8
	fi
cfb7a8
f16ba0
	if [ -z "$mb_makemode" ]; then
f16ba0
		mb_makemode='posix'
297da7
297da7
		printf '%s\n%s\n%s\n\n%s\n\n'        \
297da7
				'ifeq (a,b)'          \
297da7
				'VAR = val'            \
297da7
				'endif'                 \
297da7
				'all:'                   \
297da7
			| ${mb_make} -s -f - 2>/dev/null  \
297da7
		&& mb_makemode='modern'
297da7
f16ba0
	fi
f16ba0
38579a
	# shell
38579a
	if [ -z "$mb_shell" ]; then
38579a
		mb_shell='/bin/sh'
38579a
	fi
38579a
38579a
	# inherited cflags & ldflags
38579a
	mb_cflags_cmdline="$mb_cflags_cmdline $mb_cflags"
38579a
	mb_ldflags_cmdline="$mb_ldflags_cmdline $mb_ldflags"
82c35d
41e60c
	# add the prefix's library directory to the linker library path
41e60c
	mb_ldflags_last="$mb_ldflags_last -L$mb_libdir"
41e60c
82c35d
	# step epilog
82c35d
	output_step_epilog
38579a
}
38579a
38579a
38579a
config_flags()
38579a
{
82c35d
	# step prolog
82c35d
	output_step_prolog ${mb_script} 'config_flags'
82c35d
38579a
	mb_ldflags_tmp=" $mb_ldflags "
38579a
	mb_ldflags_libs=$(printf '%s' "$mb_ldflags_tmp" | sed 's/ -static / /g')
38579a
38579a
	if [ "$mb_ldflags_tmp" != "$mb_ldflags_libs" ]; then
38579a
		mb_ldflags="$mb_ldflags_libs"
38579a
		mb_ldflags_util="$mb_ldflags_util -static"
38579a
	fi
38579a
38579a
	# ccstrict
38579a
	if [ _$mb_ccstrict = _yes ]; then
38579a
		mb_cflags_strict='-Wall -Werror -Wextra -Wundef'
38579a
	fi
38579a
38579a
	# ldstrict
38579a
	if [ _$mb_ldstrict = _yes ]; then
38579a
		mb_ldflags_strict='-Wl,--no-undefined'
38579a
	fi
82c35d
82c35d
	# step epilog
82c35d
	output_step_epilog
38579a
}
38579a
38579a
9a06ee
config_opts()
9a06ee
{
9a06ee
	if [ "$mb_avoid_version" = 'yes' ]; then
9a06ee
		mb_version_opt='none'
9a06ee
	else
9a06ee
		mb_version_opt='used'
9a06ee
	fi
f47142
f47142
	if [ "$mb_custom_install_headers" = 'yes' ]; then
f47142
		mb_install_headers_opt='custom'
f47142
	else
f47142
		mb_install_headers_opt='default'
f47142
	fi
f47142
f47142
	if [ "$mb_disable_static" = 'yes' ]; then
f47142
		mb_static_library_opt='disabled'
f47142
	else
f47142
		mb_static_library_opt='enabled'
f47142
	fi
f47142
f47142
	if [ "$mb_disable_shared" = 'yes' ]; then
f47142
		mb_shared_library_opt='disabled'
f47142
	else
f47142
		mb_shared_library_opt='enabled'
f47142
	fi
f47142
f47142
	if [ "$mb_disable_frontend" = 'yes' ]; then
f47142
		mb_app_frontend_opt='disabled'
f47142
	else
f47142
		mb_app_frontend_opt='enabled'
f47142
	fi
f47142
f47142
	if [ "$mb_all_static" = 'yes' ]; then
f47142
		mb_app_linking_opt='all_static'
f47142
f47142
	elif [ "$mb_all_shared" = 'yes' ]; then
f47142
		mb_app_linking_opt='all_shared'
f47142
f47142
	else
f47142
		mb_app_linking_opt='default'
f47142
	fi
9a06ee
}
9a06ee
38579a
config_copy()
38579a
{
82c35d
	output_step_prolog ${mb_script} 'config_copy'
82c35d
d3c057
	mb_var_defs=
d3c057
	mb_sed_substs=
f45cd6
	mb_template="${1:-$mb_project_dir/Makefile.in}"
d3c057
9a06ee
	mb_vars=$(cut -d'=' -f1 "$sfrt_config_vars" "$sfrt_opt_vars" \
d3c057
		| grep -v '^#');
d3c057
d3c057
	for __var in $(printf '%s' "$mb_vars"); do
d3c057
		mb_sed_subst=$(printf '%s %s%s%s'  \
d3c057
				'-e' "'s^@$__var@"  \
d3c057
				"^___${__var}___"    \
d3c057
				"^g'")
d3c057
d3c057
		mb_sed_substs="$mb_sed_substs $mb_sed_subst"
d3c057
d3c057
		mb_var_def=$(printf '%s%s="${%s}"' "-D" "___${__var}___" "mb_${__var}")
d3c057
		eval mb_var_defs='"$mb_var_defs "$mb_var_def'
d3c057
	done
d3c057
f45cd6
	eval sed $mb_sed_substs $mb_template         \
f45cd6
			| eval m4 $mb_var_defs -      \
f45cd6
			| sed -e 's/[[:blank:]]*$//g'  \
d3c057
		> $mb_pwd/Makefile.tmp
82c35d
82c35d
	output_step_epilog
38579a
}
38579a
38579a
38579a
config_ccenv()
38579a
{
38579a
	mkdir -p ./ccenv
38579a
	touch ./ccenv/host.mk
38579a
	touch ./ccenv/native.mk
38579a
82c35d
	output_section_break
38579a
	ccenv_set_host_variables
82c35d
82c35d
	output_section_break
38579a
	ccenv_set_native_variables
38579a
82c35d
	output_section_break
38579a
	config_copy
38579a
}
38579a
c90a33
config_custom_cfgdefs()
c90a33
{
c90a33
	. $mb_project_dir/project/config/cfgdefs.sh
c90a33
}
c90a33
38579a
config_custom()
38579a
{
38579a
	if [ _$mb_use_custom_cfgdefs = _yes ]; then
82c35d
		output_section_break
82c35d
		output_script_status ${mb_script} \
ba10e0
			'invoking project-specific cfgdefs.sh'
82c35d
c90a33
		eval config_custom_cfgdefs "$mb_custom_cfgdefs_args"
82c35d
82c35d
		output_section_break
1dd392
1dd392
		if [ -f "$mb_project_dir/project/config/Makefile.in" ]; then
1dd392
			config_copy "$mb_project_dir/project/config/Makefile.in"
1dd392
			mv $mb_pwd/Makefile.tmp Makefile
1dd392
		fi
1dd392
38579a
		config_copy
38579a
	fi
38579a
38579a
	if [ _$mb_use_custom_usrdefs = _yes ]; then
82c35d
		output_section_break
82c35d
		output_script_status ${mb_scirpt} \
ba10e0
			'invoking project-specific usrdefs.sh'
82c35d
38579a
		. $mb_project_dir/project/usrdefs.sh
82c35d
		output_section_break
38579a
	fi
38579a
}
38579a
38579a
38579a
config_cfghost()
38579a
{
82c35d
	output_step_prolog ${mb_script} 'config_cfghost'
82c35d
38579a
	if [ -z "$mb_cfghost" ]; then
38579a
		mb_cfghost=$mb_cchost
38579a
	fi
38579a
38579a
	sed		-e 's^@cchost@^'"$mb_cchost"'^g'     \
38579a
			-e 's^@cfghost@^'"$mb_cfghost"'^g'   \
38579a
		$mb_pwd/Makefile.tmp > $mb_pwd/Makefile.host
38579a
38579a
	rm  $mb_pwd/Makefile.tmp
fbe823
	mv  $mb_pwd/Makefile.host $mb_pwd/$mb_makefile
82c35d
82c35d
	output_step_epilog
38579a
}
38579a
38579a
38579a
config_host()
38579a
{
82c35d
	output_step_prolog ${mb_script} 'config_host'
82c35d
fbe823
	# verify configuration for the host's (cross-)compiler
cfb7a8
	${mb_make} -s host.tag       \
fbe823
		-f "$mb_makefile"     \
fbe823
		&& output_step_epilog  \
82c35d
		&& return 0
38579a
fbe823
	# should never happen
38579a
	error_msg "configure was able to generate a Makefile for the selected host,"
38579a
	error_msg "however the host-targeting compiler was found to be missing"
38579a
	error_msg "at least one of the required headers or features."
38579a
	exit 2
38579a
}
38579a
38579a
427a69
config_fini()
427a69
{
427a69
	# project-specific post-configuration steps
427a69
	if [ _$mb_use_custom_cfgfini = _yes ]; then
427a69
		. "$mb_project_dir/project/config/cfgfini.sh"
427a69
	fi
427a69
}
427a69
427a69
38579a
config_status()
38579a
{
82c35d
	output_script_status ${mb_script} \
82c35d
		'configuration completed successfully.'
82c35d
	printf '\n'
38579a
}
38579a
38579a
38579a
config_failure()
38579a
{
38579a
	if [ _$mb_success = _yes ]; then
38579a
		return 0
38579a
	fi
38579a
ba10e0
	printf 'configure info: exiting due to an error.\n' >&3
ba10e0
38579a
	exit 2
38579a
}
38579a
38579a
38579a
config_success()
38579a
{
38579a
	trap '' EXIT
38579a
	mb_success=yes
38579a
	exit 0
38579a
}
38579a
38579a
38579a
# one: init
471f7b
mb_args_defs=
471f7b
mb_args_text=
471f7b
mb_args_idx=0
471f7b
471f7b
init_log
ba10e0
ba10e0
for arg ; do
471f7b
	mb_args_idx=$((mb_args_idx+1))
471f7b
471f7b
	mb_arg_def=$(printf '%s%s="${%s}"' "-D_" "${mb_args_idx}" "${mb_args_idx}")
471f7b
	eval mb_args_defs='"$mb_args_defs "$mb_arg_def'
471f7b
471f7b
	mb_args_text="$mb_args_text '_$((mb_args_idx))'"
ba10e0
done
ba10e0
471f7b
printf "$mb_args_text\n\n" | eval m4 $mb_args_defs - >&3
471f7b
471f7b
if [ $mb_args_idx -gt 1 ]; then
471f7b
	printf '$ %s' "$mb_script" >&3
471f7b
471f7b
	mb_args_idx=0
471f7b
	mb_args_text=
471f7b
471f7b
	for arg; do
471f7b
		mb_args_idx=$((mb_args_idx+1))
471f7b
		mb_args_text="$mb_args_text"$(printf ' \\\\\n\t%s_%d%s' "'" "$mb_args_idx" "'")
471f7b
	done
471f7b
471f7b
	printf "$mb_args_text\n\n" | eval m4 $mb_args_defs - >&3
471f7b
fi
471f7b
38579a
init_vars
38579a
verify_build_directory
38579a
38579a
38579a
# two: args
38579a
for arg ; do
38579a
	case "$arg" in
38579a
		--help)
38579a
			usage
38579a
			;;
38579a
		--help=ccenv)
38579a
			ccenv_usage
38579a
			;;
38579a
38579a
		# ccenv
38579a
		--cross-compile=*)
38579a
			mb_cross_compile=${arg#*=}
38579a
			;;
38579a
		--compiler=*)
38579a
			mb_compiler=${arg#*=}
38579a
			;;
38579a
		--toolchain=*)
38579a
			mb_toolchain=${arg#*=}
38579a
			;;
38579a
		--zealous)
38579a
			mb_agnostic=yes
38579a
			mb_zealous=
38579a
			;;
38579a
		--zealous=*)
38579a
			mb_zealous=${arg#*=}
38579a
			;;
38579a
		--ccenv=*)
38579a
			mb_ccenv=${arg#*=}
38579a
			;;
38579a
38579a
		# dirs
38579a
		--prefix=*)
38579a
			mb_prefix_set=yes
38579a
			mb_prefix=${arg#*=}
38579a
			;;
38579a
		--exec-prefix=*)
38579a
			mb_exec_prefix_set=yes
38579a
			mb_exec_prefix=${arg#*=}
38579a
			;;
38579a
		--bindir=*)
38579a
			mb_bindir_set=yes
38579a
			mb_bindir=${arg#*=}
38579a
			;;
38579a
		--sbindir=*)
38579a
			mb_sbindir=${arg#*=}
38579a
			;;
38579a
		--libdir=*)
38579a
			mb_libdir=${arg#*=}
38579a
			;;
38579a
		--includedir=*)
38579a
			mb_includedir=${arg#*=}
38579a
			;;
38579a
		--oldincludedir=*)
38579a
			mb_oldincludedir=${arg#*=}
38579a
			;;
38579a
		--mandir=*)
38579a
			mb_mandir=${arg#*=}
38579a
			;;
38579a
		--libexecdir=*)
38579a
			mb_libexecdir=${arg#*=}
38579a
			;;
38579a
38579a
38579a
		--sysconfdir=*)
38579a
			mb_sysconfdir=${arg#*=}
38579a
			;;
38579a
		--sharedstatedir=*)
38579a
			mb_sharedstatedir=${arg#*=}
38579a
			;;
38579a
		--localstatedir=*)
38579a
			mb_localstatedir=${arg#*=}
38579a
			;;
38579a
		--runstatedir=*)
38579a
			mb_runstatedir=${arg#*=}
38579a
			;;
38579a
		--datarootdir=*)
38579a
			mb_datarootdir=${arg#*=}
38579a
			;;
38579a
		--datadir=*)
38579a
			mb_datadir=${arg#*=}
38579a
			;;
38579a
		--infodir=*)
38579a
			mb_infodir=${arg#*=}
38579a
			;;
38579a
		--localedir=*)
38579a
			mb_localedir=${arg#*=}
38579a
			;;
38579a
		--htmldir=*)
38579a
			mb_htmldir=${arg#*=}
38579a
			;;
38579a
		--dvidir=*)
38579a
			mb_dvidir=${arg#*=}
38579a
			;;
38579a
		--pdfdir=*)
38579a
			mb_pdfdir=${arg#*=}
38579a
			;;
38579a
		--psdir=*)
38579a
			mb_psdir=${arg#*=}
38579a
			;;
38579a
cfb7a8
		#make
cfb7a8
		--make=*)
cfb7a8
			mb_make=${arg#*=}
cfb7a8
			;;
38579a
f16ba0
		--makemode=*)
f16ba0
			mb_makemode=${arg#*=}
f16ba0
			;;
f16ba0
38579a
		# build
38579a
		--build=*)
38579a
			mb_build=${arg#*=}
38579a
			;;
38579a
		--host=*)
38579a
			mb_host=${arg#*=}
38579a
			;;
38579a
		--cchost=*)
38579a
			mb_cchost=${arg#*=}
38579a
			;;
38579a
		--cfghost=*)
38579a
			mb_cfghost=${arg#*=}
38579a
			;;
38579a
		--target=*)
38579a
			mb_target=${arg#*=}
38579a
			;;
38579a
		--arch=*)
38579a
			mb_arch=${arg#*=}
38579a
			;;
38579a
		--sysroot=*)
38579a
			mb_sysroot=${arg#*=}
38579a
			;;
38579a
		--shell=*)
38579a
			mb_shell=${arg#*=}
38579a
			;;
38579a
		--debug)
38579a
			mb_debug=yes
38579a
			;;
38579a
38579a
		# config
38579a
		--all-static)
38579a
			mb_all_static=yes
38579a
			mb_all_shared=no
38579a
			;;
38579a
		--all-shared)
38579a
			mb_all_shared=yes
38579a
			mb_all_static=no
38579a
			;;
38579a
		--disable-frontend)
38579a
			mb_disable_frontend=yes
38579a
			;;
38579a
		--disable-app)
38579a
			mb_disable_frontend=yes
38579a
			;;
38579a
		--enable-frontend)
38579a
			mb_disable_frontend='no'
38579a
			;;
38579a
		--enable-app)
38579a
			mb_disable_frontend='no'
38579a
			;;
38579a
		--disable-static)
38579a
			mb_disable_static=yes
38579a
			;;
38579a
		--disable-shared)
38579a
			mb_disable_shared=yes
38579a
			;;
38579a
		--enable-static)
38579a
			mb_disable_static='no'
38579a
			;;
38579a
		--enable-shared)
38579a
			mb_disable_shared='no'
38579a
			;;
38579a
38579a
		# convenience
38579a
		--strict)
38579a
			mb_ccstrict=yes
38579a
			mb_ldstrict=yes
38579a
			;;
38579a
		--ccstrict)
38579a
			mb_ccstrict=yes
38579a
			;;
38579a
		--ldstrict)
38579a
			mb_ldstrict=yes
38579a
			;;
38579a
38579a
		# project
38579a
		--nickname=*)
38579a
			mb_nickname=${arg#*=}
38579a
			;;
38579a
		--program-prefix=*)
38579a
			mb_program_prefix=${arg#*=}
38579a
			;;
38579a
		--avoid-version)
38579a
			mb_avoid_version=yes
38579a
			;;
38579a
		--source-dir=*)
38579a
			mb_source_dir=${arg#*=}
c4a16f
			mb_source_dir_set=yes
38579a
			;;
38579a
		--srcdir=*)
38579a
			mb_source_dir=${arg#*=}
c4a16f
			mb_source_dir_set=yes
38579a
			;;
38579a
38579a
		# pkgconfig
38579a
		--pkgname=*)
38579a
			mb_pkgname=${arg#*=}
38579a
			;;
38579a
38579a
		--pkgdesc=*)
38579a
			mb_pkgdesc=${arg#*=}
38579a
			;;
38579a
38579a
		--pkgusrc=*)
38579a
			mb_pkgusrc=${arg#*=}
38579a
			;;
38579a
38579a
		--pkgrepo=*)
38579a
			mb_pkgrepo=${arg#*=}
38579a
			;;
38579a
38579a
		--pkgpsrc=*)
38579a
			mb_pkgpsrc=${arg#*=}
38579a
			;;
38579a
38579a
		--pkgdurl=*)
38579a
			mb_pkgdurl=${arg#*=}
38579a
			;;
38579a
88a270
		--pkgbugs=*)
88a270
			mb_pkgbugs=${arg#*=}
88a270
			;;
88a270
88a270
		--pkghome=*)
88a270
			mb_pkghome=${arg#*=}
88a270
			;;
88a270
38579a
		--pkgdefs=*)
38579a
			mb_pkgdefs=${arg#*=}
38579a
			;;
38579a
38579a
		--pkglibs=*)
38579a
			mb_pkglibs=${arg#*=}
38579a
			;;
38579a
c4a16f
		# srcinfo
1d3c3c
		--srcinfo=*)
1d3c3c
			mb_srcinfo=${arg#*=}
1d3c3c
			;;
1d3c3c
1d3c3c
		--srcsite=*)
1d3c3c
			mb_srcsite=${arg#*=}
1d3c3c
			;;
1d3c3c
1d3c3c
		--pgprkey=*)
1d3c3c
			mb_pgprkey=${arg#*=}
1d3c3c
			;;
1d3c3c
1d3c3c
		--pgpskey=*)
1d3c3c
			mb_pgpskey=${arg#*=}
1d3c3c
			;;
1d3c3c
c4a16f
		--rawball=*)
c4a16f
			mb_rawball=${arg#*=}
c4a16f
			;;
c4a16f
c4a16f
		--rawball-url=*)
c4a16f
			mb_rawball_url=${arg#*=}
c4a16f
			;;
c4a16f
c4a16f
		--rawball-sha256=*)
c4a16f
			mb_rawball_sha256=${arg#*=}
c4a16f
			;;
c4a16f
c4a16f
		--modball=*)
c4a16f
			mb_modball=${arg#*=}
c4a16f
			;;
c4a16f
c4a16f
		--modball-url=*)
c4a16f
			mb_modball_url=${arg#*=}
c4a16f
			;;
c4a16f
c4a16f
		--modball-sha256=*)
c4a16f
			mb_modball_sha256=${arg#*=}
c4a16f
			;;
c4a16f
c4a16f
		--srcball=*)
c4a16f
			mb_srcball=${arg#*=}
c4a16f
			;;
c4a16f
c4a16f
		--srcball-url=*)
c4a16f
			mb_srcball_url=${arg#*=}
c4a16f
			;;
c4a16f
c4a16f
		--srcball-sha256=*)
c4a16f
			mb_srcball_sha256=${arg#*=}
c4a16f
			;;
c4a16f
38579a
		# compatibility
38579a
		--enable-dependency-tracking)
38579a
			;;
38579a
		--disable-dependency-tracking)
38579a
			;;
38579a
38579a
		*)
38579a
			if [ _$mb_use_custom_cfgdefs = _yes ]; then
38579a
				mb_escaped_arg=\'$(printf '%s\n' "$arg" | sed -e "s/'/'\\\\''/g")\'
38579a
				mb_escaped_arg="$mb_custom_cfgdefs_space$mb_escaped_arg"
38579a
				mb_custom_cfgdefs_args="$mb_custom_cfgdefs_args$mb_escaped_arg"
38579a
				mb_custom_cfgdefs_space=' '
38579a
			else
38579a
				error_msg ${arg#}: "unsupported config argument."
38579a
				exit 2
38579a
			fi
38579a
			;;
38579a
	esac
38579a
38579a
	mb_safe_path_desc='source directory'
38579a
	mb_safe_path_name="$mb_source_dir"
38579a
	verify_safe_path
38579a
done
38579a
38579a
38579a
38579a
# three: validation
38579a
verify_source_directory
c4a16f
verify_source_info
38579a
38579a
if ! [ -z "$mb_program_prefix" ]; then
38579a
	error_msg "--program-prefix is not yet fully support (must be null)."
38579a
fi
38579a
38579a
38579a
38579a
# four: defaults
38579a
common_defaults
38579a
38579a
38579a
# five: config
38579a
config_flags
9a06ee
config_opts
38579a
config_copy
38579a
config_ccenv
38579a
config_custom
38579a
config_cfghost
38579a
config_host
427a69
config_fini
38579a
config_status
38579a
38579a
38579a
# all done
38579a
config_success