midipix / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone

Blame subr/pkg_configure_autotools.subr

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 c6d6e0
	if 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 c6d6e0
	then	rtl_export_vars PKG_CONFIG "${PKG_PKG_CONFIG}" PKG_CONFIG_PATH "${PKG_PKG_CONFIG_PATH}";
Lucio Andrés Illanes Albornoz bf9edf
		if [ "${PKG_FORCE_AUTORECONF:-0}" -eq 1 ]\
Lucio Andrés Illanes Albornoz bf9edf
		&& ! (cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && autoreconf -fiv); then
Lucio Andrés Illanes Albornoz bf9edf
			return 1;
Lucio Andrés Illanes Albornoz bf9edf
		fi;
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 bf9edf
							if ! rtl_fileop install -m 0700				\
Lucio Andrés Illanes Albornoz bf9edf
									"${MIDIPIX_BUILD_PWD}/etc/config.sub"	\
Lucio Andrés Illanes Albornoz bf9edf
									"${_subdir_tgt}/config.sub"; then
Lucio Andrés Illanes Albornoz bf9edf
								return 1;
Lucio Andrés Illanes Albornoz bf9edf
							else
Lucio Andrés Illanes Albornoz bf9edf
								break;
Lucio Andrés Illanes Albornoz bf9edf
							fi;
Lucio Andrés Illanes Albornoz (arab, vxp) b19456
						fi;
Lucio Andrés Illanes Albornoz (arab, vxp) b19456
					done;
Lucio Andrés Illanes Albornoz bf9edf
					if ! (rtl_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" &&			\
Lucio Andrés Illanes Albornoz bf9edf
							/bin/sh "${_fname}"); then
Lucio Andrés Illanes Albornoz bf9edf
						return 1;
Lucio Andrés Illanes Albornoz bf9edf
					else
Lucio Andrés Illanes Albornoz bf9edf
						break;
Lucio Andrés Illanes Albornoz bf9edf
					fi;
Lucio Andrés Illanes Albornoz (arab, vxp) b19456
				fi;
Lucio Andrés Illanes Albornoz (arab, vxp) b19456
			done;
Lucio Andrés Illanes Albornoz bf9edf
			if ! (rtl_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && autoconf); then
Lucio Andrés Illanes Albornoz bf9edf
				return 1;
Lucio Andrés Illanes Albornoz bf9edf
			fi;
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 c6d6e0
			if ! rtl_fileop mv "${_fname}" "${_fname}.orig"\
Lucio Andrés Illanes Albornoz c6d6e0
			|| ! 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 c6d6e0
			if ! 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 bf9edf
				do	if ! echo "${_config_cache}"						|\
Lucio Andrés Illanes Albornoz bf9edf
							tr " " "\n" >> "${PKG_BUILD_DIR}/config.cache"; then
Lucio Andrés Illanes Albornoz bf9edf
						return 1;
Lucio Andrés Illanes Albornoz bf9edf
					fi;
Lucio Andrés Illanes Albornoz 2b85d0
				done;
Lucio Andrés Illanes Albornoz bf9edf
				if ! sed -i"" "s,%PREFIX%,${PKG_PREFIX},g" "${PKG_BUILD_DIR}/config.cache"; then
Lucio Andrés Illanes Albornoz bf9edf
					return 1;
Lucio Andrés Illanes Albornoz bf9edf
				fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 8a4338
			fi;
Lucio Andrés Illanes Albornoz (arab, vxp) a2f293
		fi;
Lucio Andrés Illanes Albornoz c6d6e0
		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