01b005
#
01b005
# Copyright (c) 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 LucĂ­a Andrea Illanes Albornoz <lucia@luciaillanes.de>
01b005
# set +o errexit -o noglob -o nounset is assumed.
01b005
#
01b005
# Package {configure,make} command execution
01b005
#
01b005
01b005
#
01b005
# ex_rtl_configure() - run configure script
01b005
# @_ar:				ar(1) command name or pathname
01b005
# @_cc:				C compiler command name or pathname
01b005
# @_configure:			configure script command name or pathname
01b005
# @_cxx:			C++ compiler command name or pathname
01b005
# @_ld:				ld(1) command name or pathname
01b005
# @_libtool:			libtool(1) command name or pathname or "none"
01b005
# @_pkg_config:			pkg-config(1) command name or pathname
01b005
# @_python:			python command name or pathname
01b005
# @_ranlib:			ranlib(1) command name or pathname
01b005
# @--:				(ignored)
01b005
# @_flags:			configure script flags as a whitespace-separated list
01b005
# @_flags_extra:		extra configure script flags as a whitespace-separated likst
01b005
# @_flags_list:			configure script flags as a :-separated list
01b005
# @_flags_extra_list:		extra configure script flags as a :-separated list
01b005
# @--:				(ignored)
01b005
# @_cflags:			$CFLAGS
01b005
# @_cflags_extra:		extra $CFLAGS
01b005
# @_cppflags:			$CPPFLAGS
01b005
# @_cppflags_extra:		extra $CPPFLAGS
01b005
# @_cxxflags:			$CXXFLAGS
01b005
# @_cxxflags_extra:		extra $CXXFLAGS
01b005
# @_ldflags:			$LDFLAGS
01b005
# @_ldflags_extra:		extra $LDFLAGS
01b005
# @_pkg_config_libdir:		pkg-config(1) search directory
01b005
#
01b005
# Returns:			zero (0) on success, non-zero (>0) on failure
01b005
#
01b005
ex_rtl_configure() {
01b005
	local	_erc_ar="${1}" _erc_cc="${2}" _erc_configure="${3}" _erc_cxx="${4}" _erc_ld="${5}"	\
01b005
		_erc_libtool="${6}" _erc_pkg_config="${7}" _erc_python="${8}" _erc_ranlib="${9}"	\
01b005
		_erc_ignored="${10}"									\
01b005
		_erc_flags="${11}" _erc_flags_extra="${12}"						\
01b005
		_erc_flags_list="${13}" _erc_flags_extra_list="${14}"					\
01b005
		_erc_ignored="${15}"									\
01b005
		_erc_cflags="${16}" _erc_cflags_extra="${17}" _erc_cppflags="${18}"			\
01b005
		_erc_cppflags_extra="${19}" _erc_cxxflags="${20}" _erc_cxxflags_extra="${21}"	\
01b005
		_erc_ldflags="${22}" _erc_ldflags_extra="${23}" _erc_pkg_config_libdir="${24}"	\
01b005
		_erc_rc=0;
01b005
01b005
	case "${_erc_libtool:-}" in
01b005
	none) _erc_libtool=""; ;;
01b005
	esac;
01b005
01b005
	[ "${_erc_cflags_extra:+1}" = 1 ] && _erc_cflags="${_erc_cflags:+${_erc_cflags} }${_erc_cflags_extra}";
01b005
	[ "${_erc_cppflags_extra:+1}" = 1 ] && _erc_cppflags="${_erc_cppflags:+${_erc_cppflags} }${_erc_cppflags_extra}";
01b005
	[ "${_erc_cxxflags_extra:+1}" = 1 ] && _erc_cxxflags="${_erc_cxxflags:+${_erc_cxxflags} }${_erc_cxxflags_extra}";
01b005
	[ "${_erc_ldflags_extra:+1}" = 1 ] && _erc_ldflags="${_erc_ldflags:+${_erc_ldflags} }${_erc_ldflags_extra}";
01b005
01b005
(
01b005
	if [ "${_erc_libtool:+1}" = 1 ]; then
01b005
		export MAKE="make LIBTOOL=${_erc_libtool}";
01b005
	fi;
01b005
01b005
	[ "${_erc_ar:+1}" = 1 ] && export AR="${_erc_ar}";
01b005
	[ "${_erc_cc:+1}" = 1 ] && export CC="${_erc_cc}";
01b005
	[ "${_erc_cxx:+1}" = 1 ] && export CXX="${_erc_cxx}";
01b005
	[ "${_erc_ld:+1}" = 1 ] && export LD="${_erc_ld}";
01b005
	[ "${_erc_libtool:+1}" = 1 ] && export LIBTOOL="${_erc_libtool}";
01b005
	[ "${_erc_pkg_config:+1}" = 1 ] && export PKG_CONFIG="${_erc_pkg_config}";
01b005
	[ "${_erc_python:+1}" = 1 ] && export PYTHON="${_erc_python}";
01b005
	[ "${_erc_ranlib:+1}" = 1 ] && export RANLIB="${_erc_ranlib}";
01b005
01b005
	[ "${_erc_cflags:+1}" = 1 ] && export CFLAGS="${_erc_cflags}";
01b005
	[ "${_erc_cppflags:+1}" = 1 ] && export CPPFLAGS="${_erc_cppflags}";
01b005
	[ "${_erc_cxxflags:+1}" = 1 ] && export CXXFLAGS="${_erc_cxxflags}";
01b005
	[ "${_erc_ldflags:+1}" = 1 ] && export LDFLAGS="${_erc_ldflags}";
01b005
	[ "${_erc_pkg_config_libdir:+1}" = 1 ] && export PKG_CONFIG_LIBDIR="${_erc_pkg_config_libdir}";
01b005
01b005
	if [ "${_erc_flags_list:+1}" = 1 ]; then
01b005
		rtl_run_cmdlineV ":" "${_erc_configure}"	\
01b005
			"${_erc_flags_list}"			\
01b005
			"${_erc_flags_extra_list:-}"		\
01b005
			;
01b005
		exit "${?}";
01b005
	elif [ "${_erc_flags_extra_list:+1}" = 1 ]; then
01b005
		rtl_run_cmdlineV ":" "${_erc_configure}"	\
01b005
			${_erc_flags:-}				\
01b005
			"${_erc_flags_extra_list:-}"		\
01b005
			;
01b005
		exit "${?}";
01b005
	else
01b005
		rtl_run_cmdlineV ":" "${_erc_configure}"	\
01b005
			${_erc_flags:-}				\
01b005
			${_erc_flags_extra:-}			\
01b005
			;
01b005
		exit "${?}";
01b005
	fi;
01b005
);
01b005
	_erc_rc="${?}";
01b005
01b005
	return "${_erc_rc}";
01b005
};
01b005
01b005
#
070932
# ex_rtl_configure_cmake() - configure CMake build
01b005
# @_ar:				ar(1) command name or pathname
01b005
# @_cc:				C compiler command name or pathname
01b005
# @_cmake:			CMake command name or pathname
01b005
# @_cxx:			C++ compiler command name or pathname
01b005
# @_ld:				ld(1) command name or pathname
01b005
# @_pkg_config:			pkg-config(1) command name or pathname
01b005
# @_python:			python command name or pathname
01b005
# @_ranlib:			ranlib(1) command name or pathname
01b005
# @--:				(ignored)
07bfbd
# @_build_kind:			build kind (Debug, Release)
01b005
# @_build_type:			CMake build type (host, cross, native)
01b005
# @_cmake_args:			additional CMake arguments as a whitespace-separated list
01b005
# @_cmake_args_extra:		additional CMake extra arguments as a whitespace-separated likst
01b005
# @_prefix:			build prefix pathname
01b005
# @_subdir:			CMake build directory pathname
01b005
# @_system_name:		CMake system name
01b005
# @_system_processor:		CMake system processor
01b005
# @--:				(ignored)
01b005
# @_cflags:			$CFLAGS
01b005
# @_cflags_extra:		extra $CFLAGS
01b005
# @_cppflags:			$CPPFLAGS
01b005
# @_cppflags_extra:		extra $CPPFLAGS
01b005
# @_cxxflags:			$CXXFLAGS
01b005
# @_cxxflags_extra:		extra $CXXFLAGS
01b005
# @_ldflags:			$LDFLAGS
01b005
# @_ldflags_extra:		extra $LDFLAGS
01b005
# @_pkg_config_libdir:		pkg-config(1) search directory
01b005
#
01b005
# Returns:			zero (0) on success, non-zero (>0) on failure
01b005
#
01b005
ex_rtl_configure_cmake() {
ff8dc6
	local	_ercc_ar="${1}" _ercc_cc="${2}" _ercc_cmake="${3}"					\
ff8dc6
		_ercc_cxx="${4}" _ercc_ld="${5}" _ercc_pkg_config="${6}" _ercc_python="${7}"		\
ff8dc6
		_ercc_ranlib="${8}"									\
ff8dc6
		_ercc_ignored="${9}"									\
ff8dc6
		_ercc_build_kind="${10}" _ercc_build_type="${11}"					\
ff8dc6
		_ercc_cmake_args="${12}" _ercc_cmake_args_extra="${13}"					\
ff8dc6
		_ercc_prefix="${14}" _ercc_subdir="${15}"						\
ff8dc6
		_ercc_system_name="${16}" _ercc_system_processor="${17}"				\
ff8dc6
		_ercc_ignored="${18}"									\
ff8dc6
		_ercc_cflags="${19}" _ercc_cflags_extra="${20}" _ercc_cppflags="${21}"			\
ff8dc6
		_ercc_cppflags_extra="${22}" _ercc_cxxflags="${23}" _ercc_cxxflags_extra="${24}"	\
ff8dc6
		_ercc_ldflags="${25}" _ercc_ldflags_extra="${26}" _ercc_pkg_config_libdir="${27}"	\
01b005
		_ercc_cmd_name="" _ercc_cmake_args_auto="" _ercc_rc=0 _ercc_vname="" _ercc_vval=""
01b005
01b005
	[ "${_ercc_cflags_extra:+1}" = 1 ] && _ercc_cflags="${_ercc_cflags:+${_ercc_cflags} }${_ercc_cflags_extra}";
01b005
	[ "${_ercc_cppflags_extra:+1}" = 1 ] && _ercc_cppflags="${_ercc_cppflags:+${_ercc_cppflags} }${_ercc_cppflags_extra}";
01b005
	[ "${_ercc_cxxflags_extra:+1}" = 1 ] && _ercc_cxxflags="${_ercc_cxxflags:+${_ercc_cxxflags} }${_ercc_cxxflags_extra}";
01b005
	[ "${_ercc_ldflags_extra:+1}" = 1 ] && _ercc_ldflags="${_ercc_ldflags:+${_ercc_ldflags} }${_ercc_ldflags_extra}";
01b005
01b005
(
01b005
	[ "${_ercc_pkg_config:+1}" = 1 ] && export PKG_CONFIG="${_ercc_pkg_config}";
01b005
	[ "${_ercc_pkg_config_libdir:+1}" = 1 ] && export PKG_CONFIG_LIBDIR="${_ercc_pkg_config_libdir}";
01b005
	[ "${_ercc_python:+1}" = 1 ] && export PYTHON="${_ercc_python}";
01b005
01b005
	for _ercc_vname in ar cc cxx ld pkg_config ranlib; do
ff8dc6
		_ercc_vname="_ercc_${_ercc_vname}";
01b005
01b005
		if eval [ '"${'"${_ercc_vname}"':+1}"' = 1 ]\
01b005
		&& eval [ '"${'"${_ercc_vname}"'#/}"' = '"${'"${_ercc_vname}"'}"' ]; then
01b005
			eval _ercc_cmd_name="\${${_ercc_vname}% *}";
01b005
			eval _ercc_vval="\${${_ercc_vname}#* }";
01b005
			eval ${_ercc_vname}='$(which "${_ercc_cmd_name}")' || return 1;
01b005
		fi;
01b005
	done;
01b005
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_AR=${_ercc_ar}" "|";
07bfbd
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_BUILD_TYPE=${_ercc_build_kind}" "|";
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_C_COMPILER=${_ercc_cc}" "|";
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_C_FLAGS=${_ercc_cflags}" "|";
07bfbd
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_COMMAND=${_ercc_cmake}" "|";
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_CPP_FLAGS=${_ercc_cppflags}" "|";
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_CXX_COMPILER=${_ercc_cxx}" "|";
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_CXX_FLAGS=${_ercc_cxxflags}" "|";
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_EXE_LINKER_FLAGS=${_ercc_ldflags}" "|";
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_FIND_ROOT_PATH=${_ercc_prefix}" "|";
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_INSTALL_PREFIX=" "|";
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_LINKER=${_ercc_ld}" "|";
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_MODULE_LINKER_FLAGS=${_ercc_ldflags}" "|";
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_RANLIB=${_ercc_ranlib}" "|";
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_SHARED_LINKER_FLAGS=${_ercc_ldflags}" "|";
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_SYSTEM_PROCESSOR=${_ercc_system_processor}" "|";
107e29
	rtl_lconcat \$_ercc_cmake_args_auto "-DPKG_CONFIG_EXECUTABLE=${_ercc_pkg_config}" "|";
01b005
01b005
	case "${_ercc_build_type}" in
01b005
	native)
107e29
		rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_SYSROOT=${_ercc_prefix}" "|";
107e29
		rtl_lconcat \$_ercc_cmake_args_auto "-DCMAKE_SYSTEM_NAME=${_ercc_system_name}" "|";
01b005
		;;
01b005
	esac;
01b005
07bfbd
	rtl_llift \$_ercc_cmake_args " 
07bfbd
" "|";
07bfbd
	rtl_llift \$_ercc_cmake_args_extra " 
07bfbd
" "|";
07bfbd
107e29
	rtl_run_cmdlineV "|" "${_ercc_cmake}"	\
01b005
		"${_ercc_cmake_args_auto}"	\
01b005
		${_ercc_cmake_args:-}		\
01b005
		${_ercc_cmake_args_extra:-}	\
01b005
		"${_ercc_subdir}";
01b005
	exit "${?}";
01b005
);
01b005
	_ercc_rc="${?}";
01b005
01b005
	return "${_ercc_rc}";
01b005
};
01b005
01b005
#
01b005
# ex_rtl_configure_prepare() - prepare configure script for running
01b005
# @_build_type:			build type (host, native)
01b005
# @_builddir:			build directory pathname
01b005
# @_config_cache:		optional configuration cache directives
01b005
# @_config_cache_local:		optional local configuration cache directives
01b005
# @_config_cache_extra:		optional extra configuration cache directives
01b005
# @_config_guess_fname:		config.guess file pathname
01b005
# @_config_sub_global_fname:	global config.sub file pathname
01b005
# @_copy_config_guess:		copy config.guess (copy) or keep local config.guess (keep)
01b005
# @_force_autoreconf:		1 to force reconfiguration if already configured, 0 otherwise
01b005
# @_subdir:			subdirectory pathname
01b005
# @_pkg_config:			pkg-config(1) command name or pathname
01b005
# @_pkg_config_libdir:		pkg-config(1) search directory
01b005
# @_prefix:			prefix pathname
01b005
#
01b005
# Returns:			zero (0) on success, non-zero (>0) on failure
01b005
#
01b005
ex_rtl_configure_prepare() {
01b005
	local	_ercp_build_type="${1}" _ercp_builddir="${2}" _ercp_config_cache="${3}"		\
01b005
		_ercp_config_cache_local="${4}" _ercp_config_cache_extra="${5}"			\
01b005
		_ercp_config_guess_fname="${6}" _ercp_config_sub_global_fname="${7}"		\
01b005
		_ercp_copy_config_guess=="${8}" _ercp_force_autoreconf="${9}"			\
01b005
		_ercp_subdir="${10}" _ercp_pkg_config="${11}" _ercp_pkg_config_libdir="${12}"	\
01b005
		_ercp_prefix="${13}";
01b005
01b005
	if rtl_exists_any "${_ercp_subdir}"	\
01b005
			"configure.ac"		\
01b005
			"configure.in"		\
01b005
			"configure";
01b005
	then
01b005
		rtl_export_vars							\
01b005
			PKG_CONFIG		"${_ercp_pkg_config}"		\
01b005
			PKG_CONFIG_LIBDIR	"${_ercp_pkg_config_libdir}";
01b005
01b005
		if [ "${_ercp_force_autoreconf:-0}" -eq 1 ]\
01b005
		&& ! (cd "${_ercp_subdir}" && autoreconf -fiv); then
01b005
			return 1;
01b005
		fi;
01b005
01b005
		if [ -e "${_ercp_subdir}/configure.ac" ]\
01b005
		&& [ ! -e "${_ercp_subdir}/configure" ]; then
01b005
			for _ercp_fname in bootstrap bootstrap.sh autogen.sh; do
01b005
				if [ -e "${_ercp_subdir}/${_ercp_fname}" ]; then
01b005
					for _ercp_subdir_tgt in 			\
01b005
							"${_ercp_subdir}/build-aux"	\
01b005
							"${_ercp_subdir}";
01b005
					do	if [ -e "${_ercp_subdir_tgt}" ]; then
01b005
							if ! rtl_fileop install -m 0700				\
01b005
									"${_ercp_config_sub_global_fname}"	\
01b005
									"${_ercp_subdir_tgt}/config.sub"; then
01b005
								return 1;
01b005
							fi;
01b005
01b005
							if [ "${_ercp_copy_config_guess}" = "copy" ]; then
01b005
								if ! rtl_fileop install -m 0700			\
01b005
										"${_ercp_config_guess_fname}"	\
01b005
										"${_ercp_subdir_tgt}/config.guess"; then
01b005
									return 1;
01b005
								else
01b005
									break;
01b005
								fi;
01b005
							fi;
01b005
						fi;
01b005
					done;
01b005
01b005
					if ! (rtl_fileop cd "${_ercp_subdir}" &&	\
01b005
							/bin/sh "${_ercp_fname}"); then
01b005
						return 1;
01b005
					else
01b005
						break;
01b005
					fi;
01b005
				fi;
01b005
			done;
01b005
01b005
			if ! (rtl_fileop cd "${_ercp_subdir}" && autoconf); then
01b005
				return 1;
01b005
			fi;
01b005
		fi;
01b005
01b005
		for _ercp_fname in $(find "${_ercp_subdir}" -name config.sub); do
01b005
			if ! rtl_fileop mv "${_ercp_fname}" "${_ercp_fname}.orig"\
01b005
			|| ! rtl_fileop install -m 0700 "${_ercp_config_sub_global_fname}" "${_ercp_fname}"; then
01b005
				return 1;
01b005
			fi;
01b005
		done;
01b005
01b005
		if [ "${_ercp_copy_config_guess}" = "copy" ]; then
01b005
			for _ercp_fname in $(find "${_ercp_subdir}" -name config.guess); do
01b005
				if ! rtl_fileop mv "${_ercp_fname}" "${_ercp_fname}.orig"\
01b005
				|| ! rtl_fileop install -m 0700 "${_ercp_config_guess_fname}" "${_ercp_fname}"; then
01b005
					return 1;
01b005
				fi;
01b005
			done;
01b005
		fi;
01b005
01b005
		if [ "${_ercp_build_type}" != host ]; then
01b005
			if ! rtl_fileop touch "${_ercp_builddir}/config.cache"; then
01b005
				return 1;
01b005
			else
01b005
				for _ercp_config_cache in 			\
01b005
						"${_ercp_config_cache:-}"	\
01b005
						"${_ercp_config_cache_local:-}"	\
01b005
						"${_ercp_config_cache_extra:-}";
01b005
				do
01b005
					if [ "${_ercp_config_cache:+1}" = 1 ]\
01b005
					&& ! printf "%s\n" "${_ercp_config_cache}" |\
01b005
							tr " " "\n" >> "${_ercp_builddir}/config.cache"; then
01b005
						return 1;
01b005
					fi;
01b005
				done;
01b005
01b005
				if ! sed -i"" "s,%PREFIX%,${_ercp_prefix},g" "${_ercp_builddir}/config.cache"; then
01b005
					return 1;
01b005
				fi;
01b005
			fi;
01b005
		fi;
01b005
01b005
		rtl_export_vars -u						\
01b005
			PKG_CONFIG		"${_ercp_pkg_config}"		\
01b005
			PKG_CONFIG_LIBDIR	"${_ercp_pkg_config_libdir}";
01b005
	fi;
01b005
01b005
	return 0;
01b005
};
01b005
070932
#
070932
# ex_rtl_configure_sofort() - configure sofort build
070932
# @_ar:				ar(1) command name or pathname
070932
# @_cc:				C compiler command name or pathname
070932
# @_configure:			configure script command name or pathname
070932
# @_cxx:			C++ compiler command name or pathname
070932
# @_ld:				ld(1) command name or pathname
070932
# @_ranlib:			ranlib(1) command name or pathname
070932
# @--:				(ignored)
070932
# @_native_ar:			native ar(1) command name or pathname
070932
# @_native_cc:			native C compiler command name or pathname
070932
# @_native_cxx:			native C++ compiler command name or pathname
070932
# @_native_ld:			native ld(1) command name or pathname
070932
# @_native_ranlib:		native ranlib(1) command name or pathname
070932
# @--:				(ignored)
070932
# @_flags:			configure script flags as a whitespace-separated list
070932
# @_flags_extra:		extra configure script flags as a whitespace-separated likst
070932
# @--:				(ignored)
070932
# @_cflags:			$CFLAGS
070932
# @_cflags_extra:		extra $CFLAGS
070932
# @_cppflags:			$CPPFLAGS
070932
# @_cppflags_extra:		extra $CPPFLAGS
070932
# @_cxxflags:			$CXXFLAGS
070932
# @_cxxflags_extra:		extra $CXXFLAGS
070932
# @_ldflags:			$LDFLAGS
070932
# @_ldflags_extra:		extra $LDFLAGS
070932
# @--:				(ignored)
070932
# @_native_cflags:		native $CFLAGS
070932
# @_native_cflags_extra:	native extra $CFLAGS
070932
# @_native_cppflags:		native $CPPFLAGS
070932
# @_native_cppflags_extra:	native extra $CPPFLAGS
070932
# @_native_cxxflags:		native $CXXFLAGS
070932
# @_native_cxxflags_extra:	native extra $CXXFLAGS
070932
# @_native_ldflags:		native $LDFLAGS
070932
# @_native_ldflags_extra:	native extra $LDFLAGS
070932
#
070932
# Returns:		zero (0) on success, non-zero (>0) on failure
070932
#
070932
ex_rtl_configure_sofort() {
070932
	local	_ercs_ar="${1}" _ercs_cc="${2}" _ercs_configure="${3}" _ercs_cxx="${4}" _ercs_ld="${5}" _ercs_ranlib="${6}"	\
070932
		_ercs_ignored="${7}"												\
070932
		_ercs_native_ar="${8}" _ercs_native_cc="${9}" _ercs_native_cxx="${10}" _ercs_native_ld="${11}"			\
070932
		_ercs_native_ranlib="${12}"											\
070932
		_ercs_ignored="${13}"												\
070932
		_ercs_flags="${14}" _ercs_flags_extra="${15}"									\
070932
		_ercs_ignored="${16}"												\
070932
		_ercs_cflags="${17}" _ercs_cflags_extra="${18}" _ercs_cppflags="${19}"						\
070932
		_ercs_cppflags_extra="${20}" _ercs_cxxflags="${21}" _ercs_cxxflags_extra="${22}"				\
070932
		_ercs_ldflags="${23}" _ercs_ldflags_extra="${24}"								\
070932
		_ercs_ignored="${25}"												\
070932
		_ercs_native_cflags="${26}" _ercs_native_cflags_extra="${27}" _ercs_native_cppflags="${28}"			\
070932
		_ercs_native_cppflags_extra="${29}" _ercs_native_cxxflags="${30}" _ercs_native_cxxflags_extra="${31}"		\
070932
		_ercs_native_ldflags="${32}" _ercs_native_ldflags_extra="${33}"							\
070932
		_ercs_vname="" _ercs_rc=0;
070932
070932
	[ "${_ercs_cflags_extra:+1}" = 1 ] && _ercs_cflags="${_ercs_cflags:+${_ercs_cflags} }${_ercs_cflags_extra}";
070932
	[ "${_ercs_cppflags_extra:+1}" = 1 ] && _ercs_cppflags="${_ercs_cppflags:+${_ercs_cppflags} }${_ercs_cppflags_extra}";
070932
	[ "${_ercs_cxxflags_extra:+1}" = 1 ] && _ercs_cxxflags="${_ercs_cxxflags:+${_ercs_cxxflags} }${_ercs_cxxflags_extra}";
070932
	[ "${_ercs_ldflags_extra:+1}" = 1 ] && _ercs_ldflags="${_ercs_ldflags:+${_ercs_ldflags} }${_ercs_ldflags_extra}";
070932
070932
	[ "${_ercs_native_cflags_extra:+1}" = 1 ] && _ercs_native_cflags="${_ercs_native_cflags:+${_ercs_native_cflags} }${_ercs_native_cflags_extra}";
070932
	[ "${_ercs_native_cppflags_extra:+1}" = 1 ] && _ercs_native_cppflags="${_ercs_native_cppflags:+${_ercs_native_cppflags} }${_ercs_native_cppflags_extra}";
070932
	[ "${_ercs_native_cxxflags_extra:+1}" = 1 ] && _ercs_native_cxxflags="${_ercs_native_cxxflags:+${_ercs_native_cxxflags} }${_ercs_native_cxxflags_extra}";
070932
	[ "${_ercs_native_ldflags_extra:+1}" = 1 ] && _ercs_native_ldflags="${_ercs_native_ldflags:+${_ercs_native_ldflags} }${_ercs_native_ldflags_extra}";
070932
070932
(
070932
	[ "${_ercs_ar:+1}" = 1 ] && export AR="${_ercs_ar}";
070932
	[ "${_ercs_cc:+1}" = 1 ] && export CC="${_ercs_cc}";
070932
	[ "${_ercs_cxx:+1}" = 1 ] && export CXX="${_ercs_cxx}";
070932
	[ "${_ercs_ld:+1}" = 1 ] && export LD="${_ercs_ld}";
070932
	[ "${_ercs_ranlib:+1}" = 1 ] && export RANLIB="${_ercs_ranlib}";
070932
070932
	[ "${_ercs_native_ar:+1}" = 1 ] && export NATIVE_AR="${_ercs_native_ar}";
070932
	[ "${_ercs_native_cc:+1}" = 1 ] && export NATIVE_CC="${_ercs_native_cc}";
070932
	[ "${_ercs_native_cxx:+1}" = 1 ] && export NATIVE_CXX="${_ercs_native_cxx}";
070932
	[ "${_ercs_native_ld:+1}" = 1 ] && export NATIVE_LD="${_ercs_native_ld}";
070932
	[ "${_ercs_native_ranlib:+1}" = 1 ] && export NATIVE_RANLIB="${_ercs_native_ranlib}";
070932
070932
	[ "${_ercs_cflags:+1}" = 1 ] && export CFLAGS="${_ercs_cflags}" CFLAGS_SHARED="${_ercs_cflags}" CFLAGS_STATIC="${_ercs_cflags}";
070932
	[ "${_ercs_cppflags:+1}" = 1 ] && export CPPFLAGS="${_ercs_cppflags}" CPPFLAGS_SHARED="${_ercs_cppflags}" CPPFLAGS_STATIC="${_ercs_cppflags}";
070932
	[ "${_ercs_cxxflags:+1}" = 1 ] && export CXXFLAGS="${_ercs_cxxflags}" CXXFLAGS_SHARED="${_ercs_cxxflags}" CXXFLAGS_STATIC="${_ercs_cxxflags}";
070932
	[ "${_ercs_ldflags:+1}" = 1 ] && export LDFLAGS="${_ercs_ldflags}" LDFLAGS_SHARED="${_ercs_ldflags}" LDFLAGS_STATIC="${_ercs_ldflags}";
070932
070932
	[ "${_ercs_native_cflags:+1}" = 1 ] && export NATIVE_CFLAGS="${_ercs_native_cflags}";
070932
	[ "${_ercs_native_cppflags:+1}" = 1 ] && export NATIVE_CPPFLAGS="${_ercs_native_cppflags}";
070932
	[ "${_ercs_native_cxxflags:+1}" = 1 ] && export NATIVE_CXXFLAGS="${_ercs_native_cxxflags}";
070932
	[ "${_ercs_native_ldflags:+1}" = 1 ] && export NATIVE_LDFLAGS="${_ercs_native_ldflags}";
070932
070932
	"${_ercs_configure}"		\
070932
		${_ercs_flags:-}	\
070932
		${_ercs_flags_extra:-};
070932
	exit $((${?} ? 1 : ${_ercs_rc}));
070932
);
070932
	_ercs_rc="${?}";
070932
070932
	return "${_ercs_rc}";
070932
};
070932
01b005
# vim:filetype=sh textwidth=0