Blob Blame History Raw
#
# set -o errexit -o noglob are assumed.
#

pkg_configure() {
	if [ -x "${PKG_CONFIGURE}" ]; then
		if [ -n "${PKG_PKG_CONFIG}" ]; then
			export PKG_CONFIG="${PKG_PKG_CONFIG}";
		fi;
		if [ -n "${PKG_PKG_CONFIG_PATH}" ]; then
			export PKG_CONFIG_PATH="${PKG_PKG_CONFIG_PATH}";
		fi;
		if [ -n "${PKG_PYTHON}" ]; then
			export PYTHON="${PKG_PYTHON}";
		fi;
		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};
		unset PKG_CONFIG PKG_CONFIG_PATH PYTHON;
	fi;
};

# vim:filetype=sh