Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
#
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) c27bea
#
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
pkg_install_make() {
e9fa07
	local	_pim_group_name="${1}" _pim_pkg_name="${2}" _pim_restart_at="${3}"
e9fa07
		_pim_libtool="" _pim_rc=0 _pim_subdir="";
e9fa07
Lucio Andrés Illanes Albornoz e1d469
	case "${PKG_LIBTOOL:-}" in
e9fa07
	"")	_pim_libtool=""; ;;
e9fa07
	none)	_pim_libtool=""; ;;
e9fa07
	*)	_pim_libtool="${PKG_LIBTOOL}"; ;;
Lucio Andrés Illanes Albornoz e1d469
	esac;
e9fa07
e9fa07
	for _pim_subdir in ${PKG_MAKE_SUBDIRS:-:}; do
e9fa07
		if [ "${_pim_subdir}" = ":" ]; then
e9fa07
			_pim_subdir="";
Lucio Andrés Illanes Albornoz 522027
		fi;
e9fa07
e9fa07
		if [ "${#_pim_libtool}" -gt 0 ]; then
e9fa07
			export MAKE="make LIBTOOL=${_pim_libtool}";
Lucio Andrés Illanes Albornoz 7ab7cc
		fi;
e9fa07
1cbe20
		if [ "${PKG_MAKEFLAGS_INSTALL_LIST:+1}" = 1 ]; then
1cbe20
			rtl_run_cmdlineV ":" "${PKG_MAKE}"				\
1cbe20
				"${PKG_MAKEFLAGS_INSTALL_LIST}"				\
1cbe20
				"${PKG_MAKEFLAGS_INSTALL_EXTRA_LIST:-}"			\
1cbe20
				${PKG_MAKEFLAGS_PARALLELISE:-}				\
1cbe20
				AR="${PKG_AR}"						\
1cbe20
				CC="${PKG_CC}"						\
1cbe20
				RANLIB="${PKG_RANLIB}"					\
1cbe20
				${PKG_RANLIB_INSTALL:+"RANLIB=${PKG_RANLIB_INSTALL}"}	\
1cbe20
				${_pim_libtool:+"LIBTOOL=${_pim_libtool}"}		\
1cbe20
				"${PKG_MAKE_INSTALL_VNAME:-DESTDIR}=${PKG_DESTDIR}/"	\
1cbe20
				"${PKG_INSTALL_TARGET:-install}"			\
1cbe20
				${_pim_subdir:+-C "${_pim_subdir}"};
1cbe20
			_pim_rc="${?}";
1cbe20
		elif [ "${PKG_MAKEFLAGS_INSTALL_EXTRA_LIST:+1}" = 1 ]; then
1cbe20
			rtl_run_cmdlineV ":" "${PKG_MAKE}"				\
1cbe20
				${PKG_MAKEFLAGS_INSTALL:-}				\
1cbe20
				"${PKG_MAKEFLAGS_INSTALL_EXTRA_LIST}"			\
1cbe20
				${PKG_MAKEFLAGS_PARALLELISE:-}				\
1cbe20
				AR="${PKG_AR}"						\
1cbe20
				CC="${PKG_CC}"						\
1cbe20
				RANLIB="${PKG_RANLIB}"					\
1cbe20
				${PKG_RANLIB_INSTALL:+"RANLIB=${PKG_RANLIB_INSTALL}"}	\
1cbe20
				${_pim_libtool:+"LIBTOOL=${_pim_libtool}"}		\
1cbe20
				"${PKG_MAKE_INSTALL_VNAME:-DESTDIR}=${PKG_DESTDIR}/"	\
1cbe20
				"${PKG_INSTALL_TARGET:-install}"			\
1cbe20
				${_pim_subdir:+-C "${_pim_subdir}"};
1cbe20
			_pim_rc="${?}";
1cbe20
		else
1cbe20
			rtl_run_cmdlineV ":" "${PKG_MAKE}"				\
1cbe20
				${PKG_MAKEFLAGS_INSTALL:-}				\
1cbe20
				${PKG_MAKEFLAGS_INSTALL_EXTRA:-}			\
1cbe20
				${PKG_MAKEFLAGS_PARALLELISE:-}				\
1cbe20
				AR="${PKG_AR}"						\
1cbe20
				CC="${PKG_CC}"						\
1cbe20
				RANLIB="${PKG_RANLIB}"					\
1cbe20
				${PKG_RANLIB_INSTALL:+"RANLIB=${PKG_RANLIB_INSTALL}"}	\
1cbe20
				${_pim_libtool:+"LIBTOOL=${_pim_libtool}"}		\
1cbe20
				"${PKG_MAKE_INSTALL_VNAME:-DESTDIR}=${PKG_DESTDIR}/"	\
1cbe20
				"${PKG_INSTALL_TARGET:-install}"			\
1cbe20
				${_pim_subdir:+-C "${_pim_subdir}"};
1cbe20
			_pim_rc="${?}";
1cbe20
		fi;
e9fa07
e9fa07
		if [ "${#_pim_libtool}" -gt 0 ]; then
Lucio Andrés Illanes Albornoz 7ab7cc
			unset MAKE;
Lucio Andrés Illanes Albornoz 7ab7cc
		fi;
e9fa07
e9fa07
		if [ "${_pim_rc}" -ne 0 ]; then
Lucio Andrés Illanes Albornoz 522027
			return 1;
Lucio Andrés Illanes Albornoz 522027
		fi;
Lucio Andrés Illanes Albornoz 522027
	done;
e9fa07
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
};
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
64844b
# vim:filetype=sh textwidth=0