summaryrefslogtreecommitdiffhomepage
path: root/subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2017-11-19 01:26:03 +0000
committerLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2017-11-19 01:26:03 +0000
commite5b1c079072a63b9d22a4be64fb420cbb653c1da (patch)
treeca486a5b7cca93cd24d77ee8acce4959147efabb /subr
parent48fd1448870357a4f9eadb7086b4b4f7d0590fdd (diff)
downloadmidipix_build-e5b1c079072a63b9d22a4be64fb420cbb653c1da.tar.bz2
midipix_build-e5b1c079072a63b9d22a4be64fb420cbb653c1da.tar.xz
vars/build.vars, subr/pkg_setup_env.subr: automatically infer ${PKG_{SUB,BUILD_}DIR} from ${PKG_URLS_GIT}.
Diffstat (limited to 'subr')
-rw-r--r--subr/pkg_setup_env.subr9
1 files changed, 8 insertions, 1 deletions
diff --git a/subr/pkg_setup_env.subr b/subr/pkg_setup_env.subr
index 6c9deb86..591edfdc 100644
--- a/subr/pkg_setup_env.subr
+++ b/subr/pkg_setup_env.subr
@@ -44,12 +44,19 @@ pkg_setup_env() {
else
[ -n "${PKG_ENV_VARS_EXTRA}" ] && set_env_vars_with_sep : "${PKG_ENV_VARS_EXTRA}";
[ -z "${PKG_FNAME}" ] && PKG_FNAME="${PKG_URL##*/}";
- [ -z "${PKG_SUBDIR}" ] && PKG_SUBDIR="${PKG_FNAME%%.t*}";
[ -z "${PKG_TARGET}" ] && PKG_TARGET="${TARGET}";
[ -z "${MIDIPIX_BUILD_PWD}" ] && MIDIPIX_BUILD_PWD="$(pwd)";
+ if [ -z "${PKG_SUBDIR}" ]; then
+ if [ -n "${PKG_URLS_GIT}" ]; then
+ PKG_SUBDIR="${PKG_URLS_GIT%%=*}";
+ else
+ PKG_SUBDIR="${PKG_FNAME%%.t*}";
+ fi;
+ fi;
if [ -z "${PKG_BUILD_DIR}" ]; then
set_build_dir "${PKG_SUBDIR}" "${PKG_BUILD_TYPE:-native}";
fi;
+
if [ "${PKG_BUILD_TYPE}" = "host" ]; then
export AR="ar";
export CC="gcc";