#
# set +o errexit -o noglob -o nounset is assumed.
#
pkg_configure() {
local _libtool="" _rc=0;
if [ -x "${PKG_CONFIGURE:-}" ]; then
case "${PKG_LIBTOOL:-}" in
"") _libtool=""; ;;
none) _libtool=""; ;;
*) _libtool="${PKG_LIBTOOL}"; ;;
esac;
rtl_export_vars \
PKG_CONFIG "${PKG_PKG_CONFIG:-}" \
PKG_CONFIG_LIBDIR "${PKG_PKG_CONFIG_LIBDIR:-}" \
PYTHON "${PKG_PYTHON:-}" \
${_libtool:+MAKE} ${_libtool:+"make LIBTOOL=${_libtool}"};
AR="${PKG_AR}" \
CC="${PKG_CC}" \
RANLIB="${PKG_RANLIB}" \
CFLAGS="${PKG_CFLAGS_CONFIGURE:-}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}" \
CPPFLAGS="${PKG_CFLAGS_CONFIGURE:-}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}" \
CXXFLAGS="${PKG_CXXFLAGS_CONFIGURE:-}${PKG_CXXFLAGS_CONFIGURE_EXTRA:+ ${PKG_CXXFLAGS_CONFIGURE_EXTRA}}" \
LDFLAGS="${PKG_LDFLAGS_CONFIGURE:-}${PKG_LDFLAGS_CONFIGURE_EXTRA:+ ${PKG_LDFLAGS_CONFIGURE_EXTRA}}" \
"${PKG_CONFIGURE}" ${PKG_CONFIGURE_ARGS:-} ${PKG_CONFIGURE_ARGS_EXTRA:-} ${PKG_CONFIGURE_ARGS_EXTRA_DEBUG:-};
_rc="${?}"
rtl_export_vars -u \
PKG_CONFIG "${PKG_PKG_CONFIG:-}" \
PKG_CONFIG_LIBDIR "${PKG_PKG_CONFIG_LIBDIR:-}" \
PYTHON "${PKG_PYTHON:-}" \
${_libtool:+MAKE} ${_libtool:+"make LIBTOOL=${_libtool}"};
return "${_rc}";
fi;
};
# vim:filetype=sh