blob: 853d785c56da3a4ebd2f5a7f80669b8d25b0ce88 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
#
# set -o errexit -o noglob are assumed.
#
ex_pkg_env() {
local _vname;
if [ -z "${PKG_URL}" ]\
&& [ -z "${PKG_URLS_GIT}" ]\
&& [ -z "${PKG_VERSION}" ]\
&& ! ex_test_cmd "pkg_${PKG_NAME}_all"; then
ex_log_msg failexit "Error: package \`${PKG_NAME}' missing in build.vars.";
return 1;
else
[ -z "${MIDIPIX_BUILD_PWD}" ] && MIDIPIX_BUILD_PWD="$(pwd)";
[ -z "${PKG_FNAME}" ] && PKG_FNAME="${PKG_URL##*/}";
[ -z "${PKG_TARGET}" ] && PKG_TARGET="${TARGET}";
case "${PKG_BASE_DIR}" in
?*) ;;
*) PKG_BASE_DIR="${WORKDIR}/${PKG_NAME}-${PKG_BUILD_TYPE:-native}-${PKG_TARGET}";
if [ -n "${ARG_RESTART}" ]\
&& [ -z "${ARG_RESTART_AT}" ]; then
ex_build_fileop rm "${PKG_BASE_DIR}";
fi; ;;
esac;
ex_build_fileop mkdir "${PKG_BASE_DIR}";
ex_build_fileop cd "${PKG_BASE_DIR}";
PKG_DESTDIR="${PKG_BASE_DIR}/destdir";
case "${PKG_BUILD_TYPE}" in
host) export AR="ar";
export CC="gcc";
export CXX="g++";
export RANLIB="ranlib"; ;;
*) export AR="${PKG_TARGET}-ar";
export CC="${PKG_TARGET}-gcc";
export CXX="${PKG_TARGET}-g++";
export RANLIB="${PKG_TARGET}-ranlib";
if [ -x "${PREFIX}/bin/${TARGET}-pkg-config" ]; then
export PKGCONFIG="${PREFIX}/bin/${TARGET}-pkg-config";
export PKG_CONFIG="${PREFIX}/bin/${TARGET}-pkg-config";
export PKG_CONFIG_LIBDIR="${PKG_PREFIX}/lib/pkgconfig";
fi;
;;
esac;
export LIBTOOL="${PKG_SLIBTOOL:-slibtool}";
export MAKE="make LIBTOOL=${PKG_SLIBTOOL:-slibtool}";
case "${PKG_SUBDIR}" in
?*) ;;
*) case "${PKG_URLS_GIT}" in
?*) PKG_SUBDIR="${PKG_URLS_GIT%%=*}"; ;;
*) case "${PKG_FNAME}" in
*.t*) PKG_SUBDIR="${PKG_FNAME%%.t*}"; ;;
*) PKG_SUBDIR="${PKG_NAME}"; ;;
esac; ;;
esac; ;;
esac;
ex_push_IFS :;
for _vname in ${PKG_ENV_VARS_EXTRA}; do
export "${_vname}";
done; ex_pop_IFS;
if [ -n "${PKG_ENV_VARS}" ]\
&& [ "${PKG_NO_LOG_VARS:-0}" -eq 0 ]; then
PKG_ENV_VARS="$(echo "${PKG_ENV_VARS}" | tr " " "\n" | sort | tr "\n" " ")";
ex_log_env_vars "build" ${PKG_ENV_VARS};
fi;
fi;
};
# vim:filetype=sh
|