Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
Lucio Andrés Illanes Albornoz 2b85d0
# set +o errexit -o noglob is assumed.
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
pkg_configure_autotools() {
Lucio Andrés Illanes Albornoz 2b85d0
	local _config_cache="" _fname="" _subdir_tgt="";
Lucio Andrés Illanes Albornoz 2b85d0
	if ex_rtl_exists_any "${PKG_BASE_DIR}/${PKG_SUBDIR}"							\
Lucio Andrés Illanes Albornoz 2b85d0
			"config.guess" "configure.ac" "configure.in" "configure";
Lucio Andrés Illanes Albornoz 2b85d0
	then	ex_rtl_export_vars PKG_CONFIG "${PKG_PKG_CONFIG}" PKG_CONFIG_PATH "${PKG_PKG_CONFIG_PATH}";
Lucio Andrés Illanes Albornoz (arab, vxp) d01c02
		if [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure.ac" ]\
Lucio Andrés Illanes Albornoz (arab, vxp) d01c02
		&& [ ! -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure" ]; then
Lucio Andrés Illanes Albornoz 2b85d0
			for _fname in bootstrap bootstrap.sh autogen.sh; do
Lucio Andrés Illanes Albornoz 2b85d0
				if [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/${_fname}" ]; then
Lucio Andrés Illanes Albornoz 2b85d0
					for _subdir_tgt in \
Lucio Andrés Illanes Albornoz 2b85d0
							"${PKG_BASE_DIR}/${PKG_SUBDIR}/build-aux"		\
Lucio Andrés Illanes Albornoz 2b85d0
							"${PKG_BASE_DIR}/${PKG_SUBDIR}";
Lucio Andrés Illanes Albornoz 2b85d0
					do	if [ -e "${_subdir_tgt}" ]; then
Lucio Andrés Illanes Albornoz 2b85d0
							ex_rtl_fileop install -m 0700				\
Lucio Andrés Illanes Albornoz 2b85d0
								"${MIDIPIX_BUILD_PWD}/etc/config.sub"		\
Lucio Andrés Illanes Albornoz 2b85d0
								"${_subdir_tgt}/config.sub" || return "${?}" && break;
Lucio Andrés Illanes Albornoz (arab, vxp) b19456
						fi;
Lucio Andrés Illanes Albornoz (arab, vxp) b19456
					done;
Lucio Andrés Illanes Albornoz 2b85d0
					(ex_rtl_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" &&			\
Lucio Andrés Illanes Albornoz 2b85d0
						/bin/sh "${_fname}") || return "${?}" && break;
Lucio Andrés Illanes Albornoz (arab, vxp) b19456
				fi;
Lucio Andrés Illanes Albornoz (arab, vxp) b19456
			done;
Lucio Andrés Illanes Albornoz 2b85d0
			(ex_rtl_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && autoconf) || return "${?}";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		fi;
Lucio Andrés Illanes Albornoz 2b85d0
		for _fname in $(find "${PKG_BASE_DIR}/${PKG_SUBDIR}" -name config.sub); do
Lucio Andrés Illanes Albornoz 2b85d0
			if ! ex_rtl_fileop mv "${_fname}" "${_fname}.orig"\
Lucio Andrés Illanes Albornoz 2b85d0
			|| ! ex_rtl_fileop install -m 0700 "${MIDIPIX_BUILD_PWD}/etc/config.sub" "${_fname}"; then
Lucio Andrés Illanes Albornoz 2b85d0
				return 1;
Lucio Andrés Illanes Albornoz 2b85d0
			fi;
Lucio Andrés Illanes Albornoz 2b85d0
		done
Lucio Andrés Illanes Albornoz (arab, vxp) a2f293
		if [ "${PKG_BUILD_TYPE}" != host ]; then
Lucio Andrés Illanes Albornoz 2b85d0
			if ! ex_rtl_fileop touch "${PKG_BUILD_DIR}/config.cache"; then
Lucio Andrés Illanes Albornoz 2b85d0
				return 1;
Lucio Andrés Illanes Albornoz 2b85d0
			else	for _config_cache in \
Lucio Andrés Illanes Albornoz 2b85d0
						"${PKG_CONFIG_CACHE}"						\
Lucio Andrés Illanes Albornoz 2b85d0
						"${PKG_CONFIG_CACHE_LOCAL}"					\
Lucio Andrés Illanes Albornoz 2b85d0
						"${PKG_CONFIG_CACHE_EXTRA}";
Lucio Andrés Illanes Albornoz 2b85d0
				do	echo "${_config_cache}"							|\
Lucio Andrés Illanes Albornoz 2b85d0
						tr " " "\n" >> "${PKG_BUILD_DIR}/config.cache" || return "${?}";
Lucio Andrés Illanes Albornoz 2b85d0
				done;
Lucio Andrés Illanes Albornoz 2b85d0
				sed -i"" "s,%PREFIX%,${PKG_PREFIX},g" "${PKG_BUILD_DIR}/config.cache" || return "${?}";
Lucio Andrés Illanes Albornoz (arab, vxp) 8a4338
			fi;
Lucio Andrés Illanes Albornoz (arab, vxp) a2f293
		fi;
Lucio Andrés Illanes Albornoz 2b85d0
		ex_rtl_export_vars -u PKG_CONFIG "${PKG_PKG_CONFIG}" PKG_CONFIG_PATH "${PKG_PKG_CONFIG_PATH}";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
# vim:filetype=sh