Blame configure

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