Blame subr/pkg_build.subr

Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
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 (arab, vxp) 570129
pkg_build() {
Lucio Andrés Illanes Albornoz 7ab7cc
	local _libtool="" _makeflags_verbosity="${PKG_MAKEFLAGS_VERBOSITY:-none}" _no_autoconf="" _rc=0 _subdir="";
Lucio Andrés Illanes Albornoz e1d469
	case "${PKG_LIBTOOL:-}" in
Lucio Andrés Illanes Albornoz e1d469
	"")	_libtool=""; ;;
Lucio Andrés Illanes Albornoz e1d469
	none)	_libtool=""; ;;
Lucio Andrés Illanes Albornoz e1d469
	*)	_libtool="${PKG_LIBTOOL}"; ;;
Lucio Andrés Illanes Albornoz e1d469
	esac;
Lucio Andrés Illanes Albornoz 175e92
	if [ "${_makeflags_verbosity}" = "none" ]; then
Lucio Andrés Illanes Albornoz 175e92
		_makeflags_verbosity="";
Lucio Andrés Illanes Albornoz 175e92
	fi;
Lucio Andrés Illanes Albornoz e1d469
	if [ ! -x "${PKG_CONFIGURE:-}" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) d5afb4
		_no_autoconf=1;
Lucio Andrés Illanes Albornoz (arab, vxp) d5afb4
	fi;
Lucio Andrés Illanes Albornoz 522027
	for _subdir in ${PKG_MAKE_SUBDIRS:-:}; do
Lucio Andrés Illanes Albornoz 522027
		if [ "${_subdir}" = ":" ]; then
Lucio Andrés Illanes Albornoz 522027
			_subdir="";
Lucio Andrés Illanes Albornoz 522027
		fi;
Lucio Andrés Illanes Albornoz 7ab7cc
		if [ "${#_libtool}" -gt 0 ]; then
Lucio Andrés Illanes Albornoz 7ab7cc
			export MAKE="make LIBTOOL=${_libtool}";
Lucio Andrés Illanes Albornoz 7ab7cc
		fi;
Lucio Andrés Illanes Albornoz 522027
		# N.B.	We only specify CC= here if the current package does not use GNU
Lucio Andrés Illanes Albornoz 522027
		#	autoconf as it often abuses it by appending -std={gnu99,...} to it
Lucio Andrés Illanes Albornoz 522027
		#	instead of amending CFLAGS.
Lucio Andrés Illanes Albornoz 7ab7cc
		rtl_run_cmd_unsplit "${PKG_MAKE}"						\
Lucio Andrés Illanes Albornoz 522027
			${PKG_MAKEFLAGS_BUILD:-}						\
Lucio Andrés Illanes Albornoz 522027
			${PKG_MAKEFLAGS_BUILD_EXTRA:-}						\
Lucio Andrés Illanes Albornoz 522027
			"AR=${PKG_AR}" "${_no_autoconf:+CC=${PKG_CC}}" "RANLIB=${PKG_RANLIB}"	\
Lucio Andrés Illanes Albornoz 522027
			"${PKG_CFLAGS_BUILD:+CFLAGS=${PKG_CFLAGS_BUILD}}"			\
Lucio Andrés Illanes Albornoz 522027
			"${PKG_CFLAGS_BUILD_EXTRA:+CFLAGS+=${PKG_CFLAGS_BUILD_EXTRA}}"		\
Lucio Andrés Illanes Albornoz 522027
			"${PKG_CPPFLAGS_BUILD:+CPPFLAGS=${PKG_CPPFLAGS_BUILD}}"			\
Lucio Andrés Illanes Albornoz 522027
			"${PKG_CPPFLAGS_BUILD_EXTRA:+CPPFLAGS+=${PKG_CPPFLAGS_BUILD_EXTRA}}"	\
Lucio Andrés Illanes Albornoz 522027
			"${PKG_CXXFLAGS_BUILD:+CXXFLAGS=${PKG_CXXFLAGS_BUILD}}"			\
Lucio Andrés Illanes Albornoz 522027
			"${PKG_CXXFLAGS_BUILD_EXTRA:+CXXFLAGS+=${PKG_CXXFLAGS_BUILD_EXTRA}}"	\
Lucio Andrés Illanes Albornoz 522027
			"${PKG_LDFLAGS_BUILD:+LDFLAGS=${PKG_LDFLAGS_BUILD}}"			\
Lucio Andrés Illanes Albornoz 522027
			"${PKG_LDFLAGS_BUILD_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_BUILD_EXTRA}}"	\
Lucio Andrés Illanes Albornoz 522027
			"${PKG_PKG_CONFIG:+PKG_CONFIG=${PKG_PKG_CONFIG}}"			\
Lucio Andrés Illanes Albornoz 522027
			"${PKG_PKG_CONFIG_LIBDIR:+PKG_CONFIG_LIBDIR=${PKG_PKG_CONFIG_LIBDIR}}"	\
Lucio Andrés Illanes Albornoz 522027
			${_libtool:+"LIBTOOL=${_libtool}"}					\
Lucio Andrés Illanes Albornoz 522027
			${_makeflags_verbosity}							\
Lucio Andrés Illanes Albornoz 7ab7cc
			${_subdir:+-C "${_subdir}"}; _rc="${?}";
Lucio Andrés Illanes Albornoz 7ab7cc
		if [ "${#_libtool}" -gt 0 ]; then
Lucio Andrés Illanes Albornoz 7ab7cc
			unset MAKE;
Lucio Andrés Illanes Albornoz 7ab7cc
		fi;
Lucio Andrés Illanes Albornoz 7ab7cc
		if [ "${_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;
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