Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
8d7a8a
# Copyright (c) 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 LucĂ­a Andrea Illanes Albornoz <lucia@luciaillanes.de>
Lucio Andrés Illanes Albornoz e1d469
# set +o errexit -o noglob -o nounset is assumed.
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz b9a715
pkgp_configure_autotools() {
b70ff5
	local _ppca_rc=0;
Lucio Andrés Illanes Albornoz b9a715
Lucio Andrés Illanes Albornoz b9a715
	if ! [ -x "${PKG_CONFIGURE:-}" ]; then
e9fa07
		_ppca_rc=2;
Lucio Andrés Illanes Albornoz b9a715
	elif [ -d "${PKG_BASE_DIR}/${PKG_SUBDIR}/sofort" ]\
e9fa07
	||   [ "${PKG_CONFIGURE_TYPE:-}" = "sofort" ];
e9fa07
	then
e9fa07
		_ppca_rc=2;
Lucio Andrés Illanes Albornoz b9a715
	else
01b005
		ex_rtl_configure								\
b70ff5
			"${PKG_AR}" "${PKG_CC}" "${PKG_CONFIGURE}" "${PKG_CXX}" "${PKG_LD}"	\
b70ff5
			"${PKG_LIBTOOL}" "${PKG_PKG_CONFIG}" "${PKG_PYTHON:-}" "${PKG_RANLIB}"	\
b70ff5
			--									\
b70ff5
			"${PKG_CONFIGURE_ARGS:-}" "${PKG_CONFIGURE_ARGS_EXTRA:-}"		\
b70ff5
			"${PKG_CONFIGURE_ARGS_LIST:-}" "${PKG_CONFIGURE_ARGS_EXTRA_LIST:-}"	\
b70ff5
			--									\
b70ff5
			"${PKG_CFLAGS_CONFIGURE:-}" "${PKG_CFLAGS_CONFIGURE_EXTRA:-}"		\
b70ff5
			"${PKG_CPPFLAGS_CONFIGURE:-}" "${PKG_CPPFLAGS_CONFIGURE_EXTRA:-}"	\
b70ff5
			"${PKG_CXXFLAGS_CONFIGURE:-}" "${PKG_CXXFLAGS_CONFIGURE_EXTRA:-}"	\
b70ff5
			"${PKG_LDFLAGS_CONFIGURE:-}" "${PKG_LDFLAGS_CONFIGURE_EXTRA:-}"		\
b70ff5
			"${PKG_PKG_CONFIG_LIBDIR:-}"						\
b70ff5
			;
b70ff5
		_ppca_rc=$((${?} ? 1 : ${_ppca_rc}));
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
	fi;
e9fa07
e9fa07
	return "${_ppca_rc}";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz b9a715
pkgp_configure_cmake() {
b70ff5
	local _ppcc_build_type="" _ppcc_rc=0 _ppcc_system_name="" _ppcc_system_processor="";
Lucio Andrés Illanes Albornoz b9a715
Lucio Andrés Illanes Albornoz b9a715
	if [ "${PKG_CMAKE_LISTFILE:+1}" != 1 ]\
Lucio Andrés Illanes Albornoz b9a715
	|| ! [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/${PKG_CMAKE_LISTFILE}" ]; then
e9fa07
		_ppcc_rc=2;
Lucio Andrés Illanes Albornoz b9a715
	else
Lucio Andrés Illanes Albornoz b9a715
		case "${BUILD_KIND}" in
07bfbd
		debug)		_ppcc_build_type="Debug"; ;;
07bfbd
		release)	_ppcc_build_type="Release"; ;;
07bfbd
		*)		return 1; ;;
Lucio Andrés Illanes Albornoz b9a715
		esac;
Lucio Andrés Illanes Albornoz b9a715
Lucio Andrés Illanes Albornoz b9a715
		case "${PKG_BUILD_TYPE}" in
Lucio Andrés Illanes Albornoz b9a715
		native)
b70ff5
			_ppcc_system_name="Midipix";
Lucio Andrés Illanes Albornoz b9a715
			case "${ARCH}" in
b70ff5
			nt32)	_ppcc_system_processor="i686"; ;;
b70ff5
			nt64)	_ppcc_system_processor="x86_64"; ;;
b70ff5
			esac;
Lucio Andrés Illanes Albornoz b9a715
		esac;
Lucio Andrés Illanes Albornoz b9a715
01b005
		ex_rtl_configure_cmake								\
405fe0
			"${PKG_AR}" "${PKG_CC}" "${ARG_CCACHE:-}" "${PKG_CMAKE}" "${PKG_CXX}"	\
b70ff5
			"${PKG_LD}" "${PKG_PKG_CONFIG}" "${PKG_PYTHON:-}" "${PKG_RANLIB}"	\
b70ff5
			--									\
acadce
			"${_ppcc_build_type}" "${PKG_BUILD_TYPE}" "${PKG_CMAKE_ARGS:-}"		\
07bfbd
			"${PKG_CMAKE_ARGS_EXTRA:-}" "${PKG_PREFIX}"				\
07bfbd
			"${PKG_BASE_DIR}/${PKG_SUBDIR}" "${_ppcc_system_name}"			\
b70ff5
			"${_ppcc_system_processor}"						\
b70ff5
			--									\
b70ff5
			"${PKG_CFLAGS_CONFIGURE:-}" "${PKG_CFLAGS_CONFIGURE_EXTRA:-}"		\
b70ff5
			"${PKG_CPPFLAGS_CONFIGURE:-}" "${PKG_CPPFLAGS_CONFIGURE_EXTRA:-}"	\
b70ff5
			"${PKG_CXXFLAGS_CONFIGURE:-}" "${PKG_CXXFLAGS_CONFIGURE_EXTRA:-}"	\
b70ff5
			"${PKG_LDFLAGS_CONFIGURE:-}" "${PKG_LDFLAGS_CONFIGURE_EXTRA:-}"		\
b70ff5
			"${PKG_PKG_CONFIG_LIBDIR:-}"						\
b70ff5
			;
b70ff5
		_ppcc_rc=$((${?} ? 1 : ${_ppcc_rc}));
Lucio Andrés Illanes Albornoz b9a715
	fi;
e9fa07
e9fa07
	return "${_ppcc_rc}";
Lucio Andrés Illanes Albornoz b9a715
};
Lucio Andrés Illanes Albornoz b9a715
Lucio Andrés Illanes Albornoz b9a715
pkgp_configure_sofort() {
070932
	local _ppcs_rc=0;
Lucio Andrés Illanes Albornoz b9a715
Lucio Andrés Illanes Albornoz b9a715
	if ! [ -x "${PKG_CONFIGURE:-}" ]; then
e9fa07
		_ppcs_rc=2;
Lucio Andrés Illanes Albornoz b9a715
	elif ! [ -d "${PKG_BASE_DIR}/${PKG_SUBDIR}/sofort" ]\
Lucio Andrés Illanes Albornoz b9a715
	&&   ! [ "${PKG_CONFIGURE_TYPE:-}" = "sofort" ]; then
e9fa07
		_ppcs_rc=2;
Lucio Andrés Illanes Albornoz b9a715
	else
070932
		ex_rtl_configure_sofort									\
070932
			"${PKG_AR}" "${PKG_CC}" "${PKG_CONFIGURE}" "${PKG_CXX}"				\
070932
			"${PKG_LD}" "${PKG_RANLIB}"							\
070932
			--										\
070932
			"${PKG_NATIVE_AR:-}" "${PKG_NATIVE_CC:-}" "${PKG_NATIVE_CXX:-}"			\
070932
			"${PKG_NATIVE_LD:-}" "${PKG_NATIVE_RANLIB:-}"					\
070932
			--										\
070932
			"${PKG_CONFIGURE_ARGS:-}" "${PKG_CONFIGURE_ARGS_EXTRA:-}"			\
070932
			--										\
070932
			"${PKG_CFLAGS_CONFIGURE:-}" "${PKG_CFLAGS_CONFIGURE_EXTRA:-}"			\
070932
			"${PKG_CPPFLAGS_CONFIGURE:-}" "${PKG_CPPFLAGS_CONFIGURE_EXTRA:-}"		\
070932
			"${PKG_CXXFLAGS_CONFIGURE:-}" "${PKG_CXXFLAGS_CONFIGURE_EXTRA:-}"		\
070932
			"${PKG_LDFLAGS_CONFIGURE:-}" "${PKG_LDFLAGS_CONFIGURE_EXTRA:-}"			\
070932
			--										\
070932
			"${PKG_SOFORT_NATIVE_CFLAGS:-}" "${PKG_SOFORT_NATIVE_CFLAGS_EXTRA:-}"		\
070932
			"${PKG_SOFORT_NATIVE_CPPFLAGS:-}" "${PKG_SOFORT_NATIVE_CPPFLAGS_EXTRA:-}"	\
070932
			"${PKG_SOFORT_NATIVE_CXXFLAGS:-}" "${PKG_SOFORT_NATIVE_CXXFLAGS_EXTRA:-}"	\
070932
			"${PKG_SOFORT_NATIVE_LDFLAGS:-}" "${PKG_SOFORT_NATIVE_LDFLAGS_EXTRA:-}"		\
070932
			;
e9fa07
		_ppcs_rc=$((${?} ? 1 : ${_ppcs_rc}));
Lucio Andrés Illanes Albornoz b9a715
	fi;
e9fa07
e9fa07
	return "${_ppcs_rc}";
Lucio Andrés Illanes Albornoz b9a715
};
Lucio Andrés Illanes Albornoz b9a715
Lucio Andrés Illanes Albornoz b9a715
pkg_configure() {
e9fa07
	local	_pc_group_name="${1}" _pc_pkg_name="${2}" _pc_restart_at="${3}"	\
e9fa07
		_pc_rc=0 _pc_type="";
Lucio Andrés Illanes Albornoz b9a715
070932
	for _pc_type in autotools cmake sofort; do
Lucio Andrés Illanes Albornoz b9a715
		if [ "${PKG_CONFIGURE_TYPE:+1}" = 1 ]\
e9fa07
		&& [ "${PKG_CONFIGURE_TYPE}" != "${_pc_type}" ]; then
Lucio Andrés Illanes Albornoz b9a715
			continue;
Lucio Andrés Illanes Albornoz b9a715
		else
e9fa07
			pkgp_configure_${_pc_type} "${@}"; _pc_rc="${?}";
e9fa07
			case "${_pc_rc}" in
e9fa07
			0|1)	return "${_pc_rc}"; ;;
e9fa07
			2)	_pc_rc=0; continue; ;;
Lucio Andrés Illanes Albornoz b9a715
			esac;
Lucio Andrés Illanes Albornoz b9a715
		fi;
Lucio Andrés Illanes Albornoz b9a715
	done;
e9fa07
	return "${_pc_rc}";
Lucio Andrés Illanes Albornoz b9a715
};
Lucio Andrés Illanes Albornoz b9a715
Lucio Andrés Illanes Albornoz b9a715
# vim:filetype=sh textwidth=0