summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--006.musl.full.build4
-rw-r--r--007.gcc.full.build8
-rw-r--r--100.perk.build8
-rwxr-xr-xbuild.sh3
-rw-r--r--build.subr172
-rw-r--r--build.vars217
-rw-r--r--pkg.build160
7 files changed, 280 insertions, 292 deletions
diff --git a/006.musl.full.build b/006.musl.full.build
index 0b97e62e..7ce817c6 100644
--- a/006.musl.full.build
+++ b/006.musl.full.build
@@ -34,7 +34,7 @@ elif [ "x${3}" = "xfull" ]; then
set_build_dir musl-${PKG_MUSL_VERSION} cross;
fi;
if ! is_build_script_done configure; then
- rm_if_exists -m -c ${BUILD_DIR};
+ rm_if_exists -m -c ${PKG_BUILD_DIR};
../lazy/lazy \
-a ${ARCH} \
-c gcc \
@@ -45,7 +45,7 @@ if ! is_build_script_done configure; then
-x config;
set_build_script_done configure clean -build;
else
- cd ${BUILD_DIR};
+ cd ${PKG_BUILD_DIR};
fi;
if ! is_build_script_done clean; then
make ${MAKEFLAGS} clean;
diff --git a/007.gcc.full.build b/007.gcc.full.build
index 3af5c15c..3e80eb27 100644
--- a/007.gcc.full.build
+++ b/007.gcc.full.build
@@ -7,7 +7,7 @@
if [ "x${3}" = "xruntime" ]\
|| [ "x${3}" = "xfull" ]; then
set_build_dir cbb-gcc-${PKG_GCC_VERSION} cross;
- cd ${BUILD_DIR};
+ cd ${PKG_BUILD_DIR};
if [ "x${3}" = "xruntime" ]; then
# GCC, compiler runtime.
if ! is_build_script_done build; then
@@ -51,7 +51,7 @@ else
cbb_sysroot_for_libgcc=${PREFIX_LVL} \
cbb_target=${TARGET} \
cbb_neutral_libiberty=no \
- cbb_xgcc_for_specs=${WORKDIR}/${BUILD_DIR}/gcc/xgcc;
+ cbb_xgcc_for_specs=${WORKDIR}/${PKG_BUILD_DIR}/gcc/xgcc;
GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PREFIX_LVL}";
elif [ "x${3}" = "xnative" ]; then
# GCC, native.
@@ -87,7 +87,7 @@ else
--with-mpfr=${PREFIX_LVL} \
--with-sysroot=";
fi;
- rm_if_exists -m -c ${BUILD_DIR};
+ rm_if_exists -m -c ${PKG_BUILD_DIR};
../cbb-gcc-${PKG_GCC_VERSION}/configure \
--disable-bootstrap \
--disable-libmudflap \
@@ -114,7 +114,7 @@ else
${_configure_args};
set_build_script_done configure clean -build;
else
- cd ${BUILD_DIR};
+ cd ${PKG_BUILD_DIR};
fi;
if ! is_build_script_done clean; then
make ${MAKEFLAGS} clean;
diff --git a/100.perk.build b/100.perk.build
index cded5a9a..b7ad3583 100644
--- a/100.perk.build
+++ b/100.perk.build
@@ -9,11 +9,11 @@ if ! is_build_script_done fetch; then
fi;
set_build_dir ${2} native;
if ! is_build_script_done configure1; then
- rm_if_exists -m -c ${BUILD_DIR};
+ rm_if_exists -m -c ${PKG_BUILD_DIR};
../perk/configure;
set_build_script_done configure1 clean1 -build1;
else
- cd ${BUILD_DIR};
+ cd ${PKG_BUILD_DIR};
fi;
if ! is_build_script_done clean1; then
make ${MAKEFLAGS} clean;
@@ -29,11 +29,11 @@ if ! is_build_script_done install1; then
fi;
set_build_dir ${2} cross;
if ! is_build_script_done configure2; then
- rm_if_exists -m -c ../${BUILD_DIR};
+ rm_if_exists -m -c ../${PKG_BUILD_DIR};
../perk/configure --target=${TARGET};
set_build_script_done configure2 clean2 -build2;
else
- cd ../${BUILD_DIR};
+ cd ../${PKG_BUILD_DIR};
fi;
if ! is_build_script_done clean2; then
make ${MAKEFLAGS} clean;
diff --git a/build.sh b/build.sh
index 98813165..bb9857f2 100755
--- a/build.sh
+++ b/build.sh
@@ -8,6 +8,7 @@ clear_env_with_except HOME PATH SHELL TERM USER;
check_path_vars PREFIX PREFIX_NATIVE WORKDIR;
check_prereqs git make mktemp openssl sed sort tar tr wget;
log_msg info "Build started by ${BUILD_USER:=${USER}}@${BUILD_HNAME:=$(hostname)} at ${BUILD_DATE:=$(date %Y-%m-%d-%H-%M-%S)}.";
+touch ${PREFIX}/BUILD_IN_PROGRESS;
log_env_vars ${LOG_ENV_VARS};
(mkdir -p ${PREFIX} ${PREFIX_NATIVE} ${PREFIX_TARGET} ${WORKDIR};
BUILD_NFINI=${BUILD_NSKIP:=${BUILD_NFAIL:=${BUILD_NBUILT:=0}}};
@@ -83,6 +84,8 @@ if [ $(( ${BUILD_NFINI} + ${BUILD_NSKIP} )) -ge 0 ]\
rm -rf ${PREFIX_BASENAME}/lib;
mv ${PREFIX_BASENAME}/lib.bak ${PREFIX_BASENAME}/lib); wait;
fi;
+[ -f ${PREFIX}/BUILD_IN_PROGRESS ] &&\
+ rm -f ${PREFIX}/BUILD_IN_PROGRESS;
exit ${BUILD_SCRIPT_RC})} 2>&1 | tee build.log;
# vim:filetype=sh
diff --git a/build.subr b/build.subr
index fc6ee404..2c7fd0c0 100644
--- a/build.subr
+++ b/build.subr
@@ -15,15 +15,25 @@ get_postfix() { echo "${1#*${2}}"; };
get_prefix() { echo "${1%${2}*}"; };
match_any() { [ "x${1#*${2}*}" != "x${1}" ]; };
match_start() { [ "x${1#${2}}" != "x${1}" ]; };
-push_IFS() { _IFS="${IFS}"; IFS="${1}"; };
-pop_IFS() { IFS="${_IFS}"; unset _IFS; };
-set_build_dir() { BUILD_DIR=${1}-${2}-${TARGET}; };
+push_IFS() { _pI_IFS="${IFS}"; IFS="${1}"; };
+pop_IFS() { IFS="${_pI_IFS}"; unset _pI_IFS; };
+set_build_dir() { PKG_BUILD_DIR=${1}-${2}-${TARGET}; };
split() { push_IFS "${1}"; set -- ${2}; pop_IFS; echo "${*}"; };
+test_cmd() { command -v "${1}" >/dev/null; };
unsplit() { push_IFS "${1}"; shift; set -- "${@}"; echo "${*}"; pop_IFS; };
+export_vars_subst() {
+ _evs_pfx=${1}; _evs_pfx_new=${2}; shift 2;
+ while [ ${#} -gt 0 ]; do
+ if [ -n "${_evs_vval:=$(get_var ${_evs_pfx}${1})}" ]; then
+ export "${_evs_pfx_new}${1}=${_evs_vval}";
+ fi; unset _evs_vval; shift;
+ done; unset _evs_pfx _evs_pfx_new;
+};
+
rm_if_exists() {
- set_flag_vars_from_args "$@"; shift ${_nshift:-0};
+ set_flag_vars_from_args "$@"; shift ${_sfvfa_nshift:-0};
[ -d ${1} ] && rm -rf ${1}; [ -f ${1} ] && rm -f ${1};
[ ${_arg_m:-0} -eq 1 ] && mkdir ${1};
[ ${_arg_c:-0} -eq 1 ] && cd ${1};
@@ -31,26 +41,26 @@ rm_if_exists() {
};
set_flag_vars_from_args() {
- unset _flag_vars _nshift;
+ unset _sfvfa_flag_vars _sfvfa_nshift;
while [ ${#} -gt 1 ]; do
if [ "x${1%[a-z]}" = "x-" ]; then
set_var _arg_${1#-} 1;
- _flag_vars="${_flag_vars:+${_flag_vars} }_arg_${1#-}";
- : $((_nshift+=1));
+ _sfvfa_flag_vars="${_sfvfa_flag_vars:+${_sfvfa_flag_vars} }_arg_${1#-}";
+ : $((_sfvfa_nshift+=1));
fi; shift;
done;
};
unset_flag_vars_from_args() {
- set -- ${_flag_vars}; while [ ${#} -gt 0 ]; do
- unset ${1}; shift; done; unset _flag_vars _nshift;
+ set -- ${_sfvfa_flag_vars}; while [ ${#} -gt 0 ]; do
+ unset ${1}; shift; done; unset _sfvfa_flag_vars _sfvfa_nshift;
};
set_env_vars() {
- _val_new="${1}"; shift;
+ _sev_val_new="${1}"; shift;
while [ ${#} -gt 1 ]; do
- [ -z "${_val_new}" ] && unset ${1} ||\
- export "${1}=${_val_new}"; shift;
- done; unset _val_new;
+ [ -z "${_sev_val_new}" ] && unset ${1} ||\
+ export "${1}=${_sev_val_new}"; shift;
+ done; unset _sev_val_new;
};
@@ -59,25 +69,24 @@ set_env_vars() {
apply_patches() {
(rm_if_exists -m -c ${2}-patches-extra;
wget -c -nd -np -r -R \*.htm\* -R \*.sig ${1};
- for _patch_fname in \
+ for _ap_patch_fname in \
$(find . -type f -not -iname \*.sig | sort); do
- patch -b -d ../${2} -p0 \
- < ${_patch_fname};
- done; unset _patch_fname);
+ patch -b -d ../${2} -p0 < ${_ap_patch_fname};
+ done; unset _ap_patch_fname);
};
# Check whether all supplied arguments contain non-empty valid values.
check_path_vars() {
while [ ${#} -gt 0 ]; do
- unset _val;
- if [ -z "${_val:=$(get_var "${1}")}" ]; then
+ if [ -z "${_cpv_val:=$(get_var "${1}")}" ]; then
log_msg failexit "Error: variable \`${1}' is empty or unset.";
- elif match_any "${_val}" " "; then
+ elif match_any "${_cpv_val}" " "; then
log_msg failexit "Error: variable \`${1}' contains one or more whitespace characters.";
else
shift;
fi;
- done; unset _val;
+ unset _cpv_val;
+ done;
};
# Check whether all supplied command names resolve.
@@ -92,15 +101,15 @@ check_prereqs() {
# Clear the environment by unsetting each exported variable except
# for those named by the caller.
clear_env_with_except() {
- _vfilter="${*}"; _unset_cmds="$(mktemp -q)";
- export | while read _vspec; do
- set -- ${_vspec}; shift;
- if ! match_list "${_vfilter}" " " \
+ _cewe_vfilter="${*}"; _cewe_unset_cmds="$(mktemp -q)";
+ export | while read _cewe_vspec; do
+ set -- ${_cewe_vspec}; shift;
+ if ! match_list "${_cewe_vfilter}" " " \
$(get_prefix_lrg ${1} =); then
- echo unset $(get_prefix_lrg ${1} =) >> ${_unset_cmds};
+ echo unset $(get_prefix_lrg ${1} =) >> ${_cewe_unset_cmds};
fi;
- done; . "${_unset_cmds}"; rm -f "${_unset_cmds}" 2>/dev/null;
- unset _vfilter _vspec;
+ done; . "${_cewe_unset_cmds}"; rm -f "${_cewe_unset_cmds}" 2>/dev/null;
+ unset _cewe_vfilter _cewe_vspec;
};
fetch() {
@@ -147,37 +156,37 @@ is_build_script_done() {
fi;
};
set_build_script_done() {
- _script_fname=${SCRIPT_FNAME##*/};
- _done_fname=${WORKDIR}/.${_script_fname%.build};
+ _sbsd_script_fname=${SCRIPT_FNAME##*/};
+ _sbsd_done_fname=${WORKDIR}/.${_sbsd_script_fname%.build};
while [ $# -ge 1 ]; do
if [ "x${1#-}" != "x${1}" ]; then
- rm -f ${_done_fname}.${1#-};
+ rm -f ${_sbsd_done_fname}.${1#-};
else
- touch ${_done_fname}.${1};
- log_msg info "Finished build step ${1} of build script \`${_script_fname}'.";
+ touch ${_sbsd_done_fname}.${1};
+ log_msg info "Finished build step ${1} of build script \`${_sbsd_script_fname}'.";
fi; shift;
- done;
- unset _script_fname _done_fname;
+ done; unset _sbsd_script_fname _sbsd_done_fname;
};
log_env_vars() {
log_msg info "Variables for this build:";
- while [ ${_nvar:=0} -lt ${#} ]; do
- _arg="$(eval echo \${${_nvar}})"; _arg="${_arg%%=*}";
- if [ ${#_arg} -gt ${_arg_len_max:=0} ]; then
- _arg_len_max=${#_arg};
- fi; : $((_nvar+=1));
- done; unset _nvar _arg;
+ while [ ${_lev_nvar:=0} -lt ${#} ]; do
+ _lev_arg="$(eval echo \${${_lev_nvar}})";
+ _lev_arg="${_lev_arg%%=*}";
+ if [ ${#_lev_arg} -gt ${_lev_arg_len_max:=0} ]; then
+ _lev_arg_len_max=${#_lev_arg};
+ fi; : $((_lev_nvar+=1));
+ done; unset _lev_nvar _lev_arg;
while [ ${#} -gt 0 ]; do
- log_msg info "$(printf \
- "%${_arg_len_max}.${_arg_len_max}s=%s" \
+ log_msg info "$(printf \
+ "%${_lev_arg_len_max}.${_lev_arg_len_max}s=%s" \
"${1%%=*}" "$(get_var ${1#*=})")";
shift;
- done; unset _arg_len_max;
+ done; unset _lev_arg_len_max;
};
log_msg() {
- _lvl=${1}; shift;
- case ${_lvl} in
+ _lm_lvl=${1}; shift;
+ case ${_lm_lvl} in
failexit) printf "\033[${LOG_MSG_FAIL_COLOUR}m"; ;;
fail) printf "\033[${LOG_MSG_FAIL_COLOUR}m"; ;;
info) printf "\033[${LOG_MSG_INFO_COLOUR}m"; ;;
@@ -187,65 +196,64 @@ log_msg() {
printf "==> %s %s %s\033[0m\n" "$(date "${TIMESTAMP_FMT}")" "${1}" "$*";
else
printf "==> %s %s\033[0m\n" "$(date "${TIMESTAMP_FMT}")" "${1}";
- fi; [ ${_lvl} = failexit ] && exit 1 || unset _lvl;
+ fi; [ ${_lm_lvl} = failexit ] && exit 1 || unset _lm_lvl;
};
match_list() {
- _cmp="${3}"; push_IFS "${2}"; set -- ${1}; pop_IFS;
+ _ml_cmp="${3}"; push_IFS "${2}"; set -- ${1}; pop_IFS;
while [ ${#} -gt 0 ]; do
- if [ "x${1}" = "x${_cmp}" ]; then
- unset _cmp; return 0;
+ if [ "x${1}" = "x${_ml_cmp}" ]; then
+ unset _ml_cmp; return 0;
fi; shift;
- done; unset _cmp; return 1;
+ done; unset _ml_cmp; return 1;
};
parse_args_into_vars() {
- _arg0="${1}"; _args_valid="${2}"; shift 2;
+ _paiv_arg0="${1}"; _paiv_args_valid="${2}"; shift 2;
while [ $# -gt 0 ]; do
case "${1}" in
- --*) _aname="${1#--}";
- if ! match_list "${_args_valid}" , "${_aname%%=*}"; then
- log_msg failexit "Unknown parameter --${_aname%%=*} specified.";
- elif match_start "${_aname}" "*="; then
- _aval="$(get_postfix "${_aname}" =)";
- _aname="$(get_prefix_lrg "${_aname}" =)";
+ --*) _paiv_aname="${1#--}";
+ if ! match_list "${_paiv_args_valid}" , "${_paiv_aname%%=*}"; then
+ log_msg failexit "Unknown parameter --${_paiv_aname%%=*} specified.";
+ elif match_start "${_paiv_aname}" "*="; then
+ _paiv_aval="$(get_postfix "${_paiv_aname}" =)";
+ _paiv_aname="$(get_prefix_lrg "${_paiv_aname}" =)";
else
- _aval=1;
+ _paiv_aval=1;
fi;
- set_var $(echo arg_${_aname} | tr a-z- A-Z_) "${_aval}";
+ set_var $(echo arg_${_paiv_aname} | tr a-z- A-Z_) "${_paiv_aval}";
shift; ;;
*=*) set_var "$(get_prefix_lrg "${1}" =)"\
"$(get_postfix "${1}" =)"; shift; ;;
*) log_msg failexit "Invalid or unknown command line argument \`${1}'."; ;;
esac;
- done; unset _arg0 _args_valid _aname _aval;
+ done; unset _paiv_arg0 _paiv_args_valid _paiv_aname _paiv_aval;
};
parse_with_pkg_name() {
- PKG_NAME=${1}; shift;
- while [ $# -ge 0 ]; do
+ PKG_LVL=${1}; PKG_NAME=${2}; shift 2;
+ while [ ${#} -ge 0 ]; do
if [ "x${PKG_NAME}" = "x${1}" ]; then
- _pkg_NAME=$(echo "${PKG_NAME}" | tr a-z A-Z);
- for _vname in ${PKG_VARS}; do
- _vNAME=$(echo "${_vname}" | tr a-z A-Z);
- if [ -n "${_vval:=$(get_var PKG_${_pkg_NAME}_${_vNAME})}" ]; then
- export PKG_${_vNAME}="${_vval}";
- if [ "x${_vname#[A-Z]}" != "x${_vname}" ]; then
- export ${_vname}="${_vval}";
- fi;
- else
- unset PKG_${_vNAME};
- fi; unset _vval;
- done; unset _pkg_NAME _vname _vNAME;
- if [ -z "${PKG_URL}" ]; then
- return 1;
- else
- [ -z "${PKG_FNAME}" ] && PKG_FNAME=${PKG_URL##*/};
- [ -z "${PKG_SUBDIR}" ] && PKG_SUBDIR=${PKG_FNAME%%.tar*};
- return 0;
- fi;
+ export_vars_subst PKG_LVL${PKG_LVL}_ PKG_ ${PKG_BUILD_VARS};
+ export_vars_subst PKG_$(echo ${PKG_NAME} | tr a-z A-Z)_ PKG_ ${PKG_BUILD_VARS};
+ [ -z "${PKG_URL}" ] && return 1;
+ [ -z "${PKG_FNAME}" ] && PKG_FNAME=${PKG_URL##*/};
+ [ -z "${PKG_SUBDIR}" ] && PKG_SUBDIR=${PKG_FNAME%%.tar*};
+ [ -n "${PKG_ENV_VARS_EXTRA}" ] && export ${PKG_ENV_VARS_EXTRA};
+ return 0;
fi; shift;
done; return 1;
};
+run_cmd_unsplit() {
+ _rcu_cmd=${1}; shift;
+ while [ ${#} -gt 0 ]; do
+ [ -n "${1}" ] &&\
+ _rcu_cmdline="${_rcu_cmdline:+${_rcu_cmdline},}${1}";
+ shift;
+ done;
+ push_IFS ,; ${_rcu_cmd} ${_rcu_cmdline}; _rcu_rc=$?; pop_IFS;
+ unset _rcu_cmd _rcu_cmdline; return ${_rcu_rc};
+};
+
# vim:filetype=sh
diff --git a/build.vars b/build.vars
index 11900606..9c2b707b 100644
--- a/build.vars
+++ b/build.vars
@@ -9,201 +9,204 @@
#
: ${ARCH:=nt64};
-: ${CFLAGS_LVL0:=-O0};
-: ${CFLAGS_LVL1:=-g3 -O0};
-: ${CFLAGS_LVL2:=-g3 -O0};
-: ${CFLAGS_LVL3:=-g3 -O0};
+: ${CFLAGS_DEFAULT:=-g3 -O0};
: ${GITROOT:=git://midipix.org};
: ${GITROOT_HEAD:=git://midipix.org};
: ${HOST_NATIVE:=x86_64-nt64-midipix};
-: ${LOG_ENV_VARS:="HOME PATH SHELL USER CFLAGS_LVL0 CFLAGS_LVL1 CFLAGS_LVL2 CFLAGS_LVL3 GITROOT GITROOT_HEAD PREFIX PREFIX_NATIVE PREFIX_TARGET PREFIX_LVL0 PREFIX_LVL1 PREFIX_LVL2 PREFIX_LVL3 WORKDIR MAKEFLAGS"};
+: ${LOG_ENV_VARS:="HOME PATH SHELL USER GITROOT GITROOT_HEAD PKG_LVL0_CFLAGS_CONFIGURE PKG_LVL1_CFLAGS_CONFIGURE PKG_LVL2_CFLAGS_CONFIGURE PKG_LVL3_CFLAGS_CONFIGURE PREFIX PREFIX_NATIVE PREFIX_TARGET PREFIX_LVL0 PREFIX_LVL1 PREFIX_LVL2 PREFIX_LVL3 WORKDIR MAKEFLAGS"};
: ${LOG_MSG_FAIL_COLOUR:=91};
: ${LOG_MSG_INFO_COLOUR:=93};
: ${LOG_MSG_SUCC_COLOUR:=92};
+: ${MAKEFLAGS_DEFAULT:=-j8};
: ${PREFIX:=${HOME}/midipix};
: ${PREFIX_NATIVE:=${PREFIX}/native};
: ${TARGET:=x86_64-nt64-midipix};
-: ${PKG_VARS:="build_dir build_type configure_args configure_args_extra git_args_extra install_target makeflags_build_extra makeflags_install_extra no_clean no_config_cache no_configure no_destdir no_libtool_midipix no_patch_local patches_extra_url prefix prefix_extra unset_vars_build sha256sum subdir url url_type version AR CC CFLAGS LD LDFLAGS MAKEFLAGS PREFIX RANLIB"};
: ${PREFIX_TARGET:=${PREFIX}/${TARGET}};
: ${PREFIX_LVL0:=${PREFIX_TARGET}};
: ${PREFIX_LVL1:=${PREFIX_NATIVE}};
: ${PREFIX_LVL2:=${PREFIX_NATIVE}};
: ${PREFIX_LVL3:=${PREFIX_NATIVE}};
: ${WORKDIR:=${PREFIX}/tmp};
-: ${MAKEFLAGS:="-j8${MAKEFLAGS:+ ${MAKEFLAGS}}"};
export PATH="${PREFIX}/bin${PATH:+:${PATH}}";
: ${TIMESTAMP_FMT:="%Y/%m/%d %H:%M:%S"};
: ${WGET_ARGS:="-N --no-check-certificate"};
+: ${PKG_BUILD_NAMES:="apk_tools bash binutils binutils_host bzip2 coreutils dalist dash diffutils findutils gawk git gmp grep gzip less libelf libressl libz make mpc mpfr ncurses ntapi ntcon ntctty openssh patch pemagine popt psxscl psxstub psxtypes rsync sed tar util_linux which xz"};
+: ${PKG_BUILD_VARS:="AR_BUILD AR_CONFIGURE BUILD_DIR BUILD_TYPE CC_BUILD CC_CONFIGURE CC_INSTALL CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA CFLAGS_INSTALL_EXTRA CONFIGURE_ARGS CONFIGURE_ARGS_EXTRA ENV_VARS_EXTRA GIT_ARGS_EXTRA INSTALL_TARGET LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE_EXTRA LDFLAGS_INSTALL_EXTRA LIBTOOL_MIDIPIX MAKEFLAGS_BUILD MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA NO_CLEAN PATCHES_EXTRA_URL PREFIX_EXTRA RANLIB_INSTALL SHA256SUM SUBDIR URL URL_TYPE VERSION"};
+: ${PKG_LVL0_CFLAGS_CONFIGURE:=-O0};
: ${PKG_LVL0_CONFIGURE_ARGS:="-C --host=${HOST_NATIVE} --prefix= --target=${TARGET}"};
-: ${PKG_LVL1_CONFIGURE_ARGS:="--host=${HOST_NATIVE} --target=${TARGET}"};
+: ${PKG_LVL0_MAKEFLAGS_BUILD:=${MAKEFLAGS}};
+: ${PKG_LVL1_CFLAGS_CONFIGURE:=${CFLAGS_DEFAULT}};
+: ${PKG_LVL1_CONFIGURE_ARGS:="--host=${HOST_NATIVE} --prefix=/ --target=${TARGET}"};
+: ${PKG_LVL1_MAKEFLAGS_BUILD:=${MAKEFLAGS}};
+: ${PKG_LVL1_MAKEFLAGS_INSTALL:=DESTDIR=${PREFIX_LVL1}};
: ${PKG_LVL2_BUILD_TYPE:=cross};
+: ${PKG_LVL2_CFLAGS_CONFIGURE:=${CFLAGS_DEFAULT}};
: ${PKG_LVL2_CONFIGURE_ARGS:="--prefix=${PREFIX_LVL2} --host=${HOST_NATIVE}"};
-: ${PKG_LVL2_NO_CONFIG_CACHE:=1};
-: ${PKG_LVL2_NO_DESTDIR:=1};
-: ${PKG_LVL2_NO_EXTRACT:=1};
+: ${PKG_LVL2_ENV_VARS_EXTRA:="CFLAGS_PATH=-I${PREFIX_LVL2}/include LDFLAGS_PATH=-L${PREFIX_LVL2}/lib"};
+: ${PKG_LVL2_MAKEFLAGS_BUILD:=${MAKEFLAGS}};
: ${PKG_LVL2_URL_TYPE:=git};
-: ${PKG_LVL2_UNSET_VARS_BUILD:="CC LD CFLAGS LDFLAGS PREFIX"};
-: ${PKG_LVL2_CFLAGS_PATH:=-I${PREFIX_LVL2}/include};
-: ${PKG_LVL2_LDFLAGS_PATH:=-L${PREFIX_LVL2}/include};
+: ${PKG_LVL3_CFLAGS_CONFIGURE:=${CFLAGS_DEFAULT}};
+: ${PKG_LVL3_MAKEFLAGS_BUILD:=${MAKEFLAGS}};
+: ${PKG_LVL3_MAKEFLAGS_INSTALL:=DESTDIR=${PREFIX_LVL3}};
: ${PKG_LVL3_CONFIGURE_ARGS:="-C --host=${HOST_NATIVE} --prefix= --target=${TARGET}"};
: ${PKG_APK_TOOLS_VERSION:=2.6.6};
-: ${PKG_APK_TOOLS_BUILD_DIR:=apk-tools-${PKG_APK_TOOLS_VERSION}};
-: ${PKG_APK_TOOLS_URL:=http://git.alpinelinux.org/cgit/apk-tools/snapshot/apk-tools-${PKG_APK_TOOLS_VERSION}.tar.bz2};
-: ${PKG_APK_TOOLS_CFLAGS:=-I${PREFIX_LVL3}/include};
-: ${PKG_APK_TOOLS_LDFLAGS:=-L${PREFIX_LVL3}/lib};
-: ${PKG_APK_TOOLS_MAKEFLAGS:=CROSS_COMPILE=${HOST_NATIVE}- LUAAPK= PKG_CONFIG_PATH=${PREFIX_LVL3}/lib/pkgconfig VERBOSE=1};
-: ${PKG_APK_TOOLS_NO_CONFIGURE:=1};
: ${PKG_APK_TOOLS_SHA256SUM:=7e5e86c856ce236c7fd54605ee0b1dbf59920398d3b33f9f6ff0e5f98e6828af};
-: ${PKG_BZIP2_AR:=${HOST_NATIVE}-ar};
-: ${PKG_BZIP2_CC:=${HOST_NATIVE}-gcc};
-: ${PKG_BZIP2_RANLIB:=${HOST_NATIVE}-ranlib};
-: ${PKG_BZIP2_MAKEFLAGS_BUILD_EXTRA:=-f Makefile-libbz2_so};
-: ${PKG_BZIP2_NO_CLEAN:=1};
-: ${PKG_BZIP2_NO_CONFIGURE:=1};
-: ${PKG_BZIP2_NO_DESTDIR:=1};
-: ${PKG_BZIP2_PREFIX:=${PREFIX_LVL3}};
-: ${PKG_BZIP2_SHA256SUM:=a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd};
+: ${PKG_APK_TOOLS_URL:=http://git.alpinelinux.org/cgit/apk-tools/snapshot/apk-tools-${PKG_APK_TOOLS_VERSION}.tar.bz2};
+: ${PKG_APK_TOOLS_CFLAGS_CONFIGURE_EXTRA:=-I${PREFIX_LVL3}/include};
+: ${PKG_APK_TOOLS_LDFLAGS_CONFIGURE_EXTRA:=-L${PREFIX_LVL3}/lib};
+: ${PKG_APK_TOOLS_MAKEFLAGS_BUILD_EXTRA:=CROSS_COMPILE=${HOST_NATIVE}- LUAAPK= PKG_CONFIG_PATH=${PREFIX_LVL3}/lib/pkgconfig VERBOSE=1};
: ${PKG_BZIP2_VERSION:=1.0.6};
-: ${PKG_BZIP2_BUILD_DIR:=bzip2-${PKG_BZIP2_VERSION}};
+: ${PKG_BZIP2_SHA256SUM:=a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd};
: ${PKG_BZIP2_URL:=http://www.bzip.org/1.0.6/bzip2-${PKG_BZIP2_VERSION}.tar.gz};
-: ${PKG_BASH_CONFIGURE_ARGS_EXTRA:=--without-bash-malloc};
-: ${PKG_BASH_LDFLAGS:=-L${PREFIX_LVL3}/lib};
-: ${PKG_BASH_SHA256SUM:=afc687a28e0e24dc21b988fa159ff9dbcf6b7caa92ade8645cc6d5605cd024d4};
+: ${PKG_BZIP2_AR_BUILD:=${HOST_NATIVE}-ar};
+: ${PKG_BZIP2_BUILD_DIR:=bzip2-${PKG_BZIP2_VERSION}};
+: ${PKG_BZIP2_CC_BUILD:=${HOST_NATIVE}-gcc};
+: ${PKG_BZIP2_CC_INSTALL:=${HOST_NATIVE}-gcc};
+: ${PKG_BZIP2_CFLAGS_BUILD_EXTRA:=${PKG_LVL3_CFLAGS_CONFIGURE}};
+: ${PKG_BZIP2_MAKEFLAGS_BUILD_EXTRA:=-f Makefile-libbz2_so};
+: ${PKG_BZIP2_NO_CLEAN:=1};
+: ${PKG_BZIP2_MAKEFLAGS_INSTALL_EXTRA:=PREFIX=${PREFIX_LVL3}};
+: ${PKG_BZIP2_RANLIB_INSTALL:=${HOST_NATIVE}-ranlib};
: ${PKG_BASH_VERSION:=4.3};
-: ${PKG_BASH_PATCHES_EXTRA_URL:=https://ftp.gnu.org/gnu/bash/bash-${PKG_BASH_VERSION}-patches/};
+: ${PKG_BASH_SHA256SUM:=afc687a28e0e24dc21b988fa159ff9dbcf6b7caa92ade8645cc6d5605cd024d4};
: ${PKG_BASH_URL:=https://ftp.gnu.org/gnu/bash/bash-${PKG_BASH_VERSION}.tar.gz};
-: ${PKG_BINUTILS_CONFIGURE_ARGS_EXTRA:=--with-libelf=${PREFIX_NATIVE} --with-gmp=${PREFIX_NATIVE} --with-mpc=${PREFIX_NATIVE} --with-mpfr=${PREFIX_NATIVE} --with-sysroot=/};
-: ${PKG_BINUTILS_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa};
+: ${PKG_BASH_CONFIGURE_ARGS_EXTRA:=--without-bash-malloc};
+: ${PKG_BASH_LDFLAGS_CONFIGURE_EXTRA:=-L${PREFIX_LVL3}/lib};
+: ${PKG_BASH_PATCHES_EXTRA_URL:=https://ftp.gnu.org/gnu/bash/bash-${PKG_BASH_VERSION}-patches/};
: ${PKG_BINUTILS_VERSION:=2.24.51};
+: ${PKG_BINUTILS_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa};
: ${PKG_BINUTILS_URL:=ftp://sourceware.org/pub/binutils/snapshots/binutils-${PKG_BINUTILS_VERSION}.tar.bz2};
-: ${PKG_BINUTILS_HOST_BUILD_TYPE:=cross};
-: ${PKG_BINUTILS_HOST_CONFIGURE_ARGS:=--disable-werror --prefix=${PREFIX} --target=${TARGET} --with-sysroot=${PREFIX_TARGET}};
-: ${PKG_BINUTILS_HOST_NO_DESTDIR:=1};
-: ${PKG_BINUTILS_HOST_NO_CONFIG_CACHE:=1};
-: ${PKG_BINUTILS_HOST_NO_LIBTOOL_MIDIPIX:=1};
-: ${PKG_BINUTILS_HOST_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa};
+: ${PKG_BINUTILS_CONFIGURE_ARGS_EXTRA:=--with-libelf=${PREFIX_NATIVE} --with-gmp=${PREFIX_NATIVE} --with-mpc=${PREFIX_NATIVE} --with-mpfr=${PREFIX_NATIVE} --with-sysroot=/};
: ${PKG_BINUTILS_HOST_VERSION:=2.24.51};
+: ${PKG_BINUTILS_HOST_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa};
: ${PKG_BINUTILS_HOST_URL:=ftp://sourceware.org/pub/binutils/snapshots/binutils-${PKG_BINUTILS_VERSION}.tar.bz2};
-: ${PKG_COREUTILS_SHA256SUM:=ec43ca5bcfc62242accb46b7f121f6b684ee21ecd7d075059bf650ff9e37b82d};
+: ${PKG_BINUTILS_HOST_BUILD_TYPE:=cross};
+: ${PKG_BINUTILS_HOST_CONFIGURE_ARGS:=--disable-werror --prefix=${PREFIX} --target=${TARGET} --with-sysroot=${PREFIX_LVL0}};
: ${PKG_COREUTILS_VERSION:=8.23};
+: ${PKG_COREUTILS_SHA256SUM:=ec43ca5bcfc62242accb46b7f121f6b684ee21ecd7d075059bf650ff9e37b82d};
: ${PKG_COREUTILS_URL:=https://ftp.gnu.org/gnu/coreutils/coreutils-${PKG_COREUTILS_VERSION}.tar.xz};
: ${PKG_DASH_VERSION:=0.5.8};
: ${PKG_DASH_URL:=http://gondor.apana.org.au/~herbert/dash/files/dash-${PKG_DASH_VERSION}.tar.gz};
-: ${PKG_DIFFUTILS_SHA256SUM:=a25e89a8ab65fded1731e4186be1bb25cda967834b6df973599cdcd5abdfc19c};
: ${PKG_DIFFUTILS_VERSION:=3.3};
+: ${PKG_DIFFUTILS_SHA256SUM:=a25e89a8ab65fded1731e4186be1bb25cda967834b6df973599cdcd5abdfc19c};
: ${PKG_DIFFUTILS_URL:=https://ftp.gnu.org/gnu/diffutils/diffutils-${PKG_DIFFUTILS_VERSION}.tar.xz};
-: ${PKG_FINDUTILS_CFLAGS:=-Dendpwent=setpwent};
-: ${PKG_FINDUTILS_SHA256SUM:=0de3cf625a5c9f154eee3171e072515ffdde405244dd00502af617ac57b73ae2};
: ${PKG_FINDUTILS_VERSION:=4.5.14};
+: ${PKG_FINDUTILS_SHA256SUM:=0de3cf625a5c9f154eee3171e072515ffdde405244dd00502af617ac57b73ae2};
: ${PKG_FINDUTILS_URL:=http://alpha.gnu.org/gnu/findutils/findutils-${PKG_FINDUTILS_VERSION}.tar.gz};
-: ${PKG_GAWK_SHA256SUM:=e3cf55e91e31ea2845f8338bedd91e40671fc30e4d82ea147d220e687abda625};
+: ${PKG_FINDUTILS_CFLAGS_CONFIGURE_EXTRA:=-Dendpwent=setpwent};
: ${PKG_GAWK_VERSION:=4.1.3};
+: ${PKG_GAWK_SHA256SUM:=e3cf55e91e31ea2845f8338bedd91e40671fc30e4d82ea147d220e687abda625};
: ${PKG_GAWK_URL:=https://ftp.gnu.org/gnu/gawk/gawk-${PKG_GAWK_VERSION}.tar.xz};
: ${PKG_GCC_VERSION:=4.6.4};
-: ${PKG_GIT_SUBDIR:=git};
-: ${PKG_GIT_BUILD_DIR:=${PKG_GIT_SUBDIR}};
-: ${PKG_GIT_AR:=${HOST_NATIVE}-ar};
-: ${PKG_GIT_CC:=${HOST_NATIVE}-gcc};
-: ${PKG_GIT_CFLAGS:=-I. -I${PREFIX_LVL3}/include};
-: ${PKG_GIT_LDFLAGS:=-L${PREFIX_LVL3}/lib};
-: ${PKG_GIT_MAKEFLAGS:=NO_CURL=1 NO_PERL=1 prefix=${PREFIX_LVL3} V=99};
+: ${PKG_GIT_AR_BUILD:=${HOST_NATIVE}-ar};
+: ${PKG_GIT_BUILD_DIR:=git};
+: ${PKG_GIT_CC_BUILD:=${HOST_NATIVE}-gcc};
+: ${PKG_GIT_CC_INSTALL:=${HOST_NATIVE}-gcc};
+: ${PKG_GIT_CFLAGS_BUILD_EXTRA:=-I. -I${PREFIX_LVL3}/include};
+: ${PKG_GIT_CFLAGS_INSTALL_EXTRA:=-I. -I${PREFIX_LVL3}/include};
: ${PKG_GIT_GIT_ARGS_EXTRA:=--branch v2.7.1};
-: ${PKG_GIT_NO_CONFIGURE:=1};
-: ${PKG_GIT_NO_DESTDIR:=1};
-: ${PKG_GIT_RANLIB:=${HOST_NATIVE}-ranlib};
+: ${PKG_GIT_LDFLAGS_BUILD_EXTRA:=-L${PREFIX_LVL3}/lib};
+: ${PKG_GIT_LDFLAGS_INSTALL_EXTRA:=-L${PREFIX_LVL3}/lib};
+: ${PKG_GIT_MAKEFLAGS_BUILD_EXTRA:=NO_CURL=1 NO_PERL=1 prefix=${PREFIX_LVL3} V=99};
+: ${PKG_GIT_MAKEFLAGS_INSTALL_EXTRA:=NO_CURL=1 NO_PERL=1 prefix=${PREFIX_LVL3} V=99};
+: ${PKG_GIT_RANLIB_INSTALL:=${HOST_NATIVE}-ranlib};
+: ${PKG_GIT_SUBDIR:=git};
: ${PKG_GIT_URL:=https://github.com/git/git.git};
: ${PKG_GIT_URL_TYPE:=git};
-: ${PKG_GMP_CONFIGURE_ARGS_EXTRA:=--disable-assembly};
-: ${PKG_GMP_PREFIX_EXTRA:=${PREFIX_TARGET}};
-: ${PKG_GMP_SHA256SUM:=752079520b4690531171d0f4532e40f08600215feefede70b24fabdc6f1ab160};
: ${PKG_GMP_VERSION:=5.1.3};
+: ${PKG_GMP_SHA256SUM:=752079520b4690531171d0f4532e40f08600215feefede70b24fabdc6f1ab160};
: ${PKG_GMP_URL:=https://gmplib.org/download/gmp/gmp-${PKG_GMP_VERSION}.tar.bz2};
-: ${PKG_GREP_SHA256SUM:=ca91d22f017bfcb503d4bc3b44295491c89a33a3df0c3d8b8614f2d3831836eb};
+: ${PKG_GMP_CONFIGURE_ARGS_EXTRA:=--disable-assembly};
+: ${PKG_GMP_LIBTOOL_MIDIPIX:=1};
+: ${PKG_GMP_PREFIX_EXTRA:=DESTDIR=${PREFIX_TARGET}};
: ${PKG_GREP_VERSION:=2.22};
+: ${PKG_GREP_SHA256SUM:=ca91d22f017bfcb503d4bc3b44295491c89a33a3df0c3d8b8614f2d3831836eb};
: ${PKG_GREP_URL:=https://ftp.gnu.org/gnu/grep/grep-${PKG_GREP_VERSION}.tar.xz};
-: ${PKG_GZIP_CC:=${HOST_NATIVE}-gcc};
-: ${PKG_GZIP_CFLAGS:=-g3 -O0 -I${PREFIX_NATIVE}/include};
-: ${PKG_GZIP_LDFLAGS:=--sysroot=${PREFIX_NATIVE}};
-: ${PKG_GZIP_PKG_CONFIGURE_ARGS:=--host=${HOST_NATIVE} --prefix= --target=${TARGET}};
-: ${PKG_GZIP_SHA256SUM:=1ca41818a23c9c59ef1d5e1d00c0d5eaa2285d931c0fb059637d7c0cc02ad967};
: ${PKG_GZIP_VERSION:=1.2.4};
+: ${PKG_GZIP_SHA256SUM:=1ca41818a23c9c59ef1d5e1d00c0d5eaa2285d931c0fb059637d7c0cc02ad967};
: ${PKG_GZIP_URL:=https://ftp.gnu.org/gnu/gzip/gzip-${PKG_GZIP_VERSION}.tar.gz};
-: ${PKG_LESS_LDFLAGS:=-L${PREFIX_LVL3}/lib};
-: ${PKG_LESS_SHA256SUM:=3fa38f2cf5e9e040bb44fffaa6c76a84506e379e47f5a04686ab78102090dda5};
+: ${PKG_GZIP_CC_BUILD:=${HOST_NATIVE}-gcc};
+: ${PKG_GZIP_CFLAGS_CONFIGURE_EXTRA:=-I${PREFIX_NATIVE}/include};
+: ${PKG_GZIP_LDFLAGS_CONFIGURE_EXTRA:=--sysroot=${PREFIX_NATIVE}};
+: ${PKG_GZIP_CONFIGURE_ARGS:=--host=${HOST_NATIVE} --prefix= --target=${TARGET}};
: ${PKG_LESS_VERSION:=481};
+: ${PKG_LESS_SHA256SUM:=3fa38f2cf5e9e040bb44fffaa6c76a84506e379e47f5a04686ab78102090dda5};
: ${PKG_LESS_URL:=http://www.greenwoodsoftware.com/less/less-${PKG_LESS_VERSION}.tar.gz};
-: ${PKG_LIBELF_CC:=${HOST_NATIVE}-gcc};
-: ${PKG_LIBELF_NO_DESTDIR:=1};
-: ${PKG_LIBELF_NO_LIBTOOL_MIDIPIX:=1};
-: ${PKG_LIBELF_PREFIX:=${PREFIX_NATIVE}};
-: ${PKG_LIBELF_SHA256SUM:=591a9b4ec81c1f2042a97aa60564e0cb79d041c52faa7416acb38bc95bd2c76d};
+: ${PKG_LESS_LDFLAGS_CONFIGURE_EXTRA:=-L${PREFIX_LVL3}/lib};
: ${PKG_LIBELF_VERSION:=0.8.13};
+: ${PKG_LIBELF_SHA256SUM:=591a9b4ec81c1f2042a97aa60564e0cb79d041c52faa7416acb38bc95bd2c76d};
: ${PKG_LIBELF_URL:=http://www.mr511.de/software/libelf-${PKG_LIBELF_VERSION}.tar.gz};
-: ${PKG_LIBRESSL_CFLAGS:=-D__MIDIPIX};
-: ${PKG_LIBRESSL_CONFIGURE_ARGS_EXTRA:=--disable-asm};
-: ${PKG_LIBRESSL_SHA256SUM:=1ee19994cffd047d40f63ba149115dba18a681b0cc923beec301bf424b58d64f};
+: ${PKG_LIBELF_CC_CONFIGURE:=${HOST_NATIVE}-gcc};
+: ${PKG_LIBELF_CONFIGURE_ARGS:="--host=${HOST_NATIVE} --prefix=${PREFIX_LVL1} --target=${TARGET}"};
+: ${PKG_LIBELF_MAKEFLAGS_INSTALL:=};
+: ${PKG_LIBFFI_LIBTOOL_MIDIPIX:=1};
: ${PKG_LIBRESSL_VERSION:=2.2.6};
+: ${PKG_LIBRESSL_SHA256SUM:=1ee19994cffd047d40f63ba149115dba18a681b0cc923beec301bf424b58d64f};
: ${PKG_LIBRESSL_URL:=http://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${PKG_LIBRESSL_VERSION}.tar.gz};
-: ${PKG_LIBZ_CONFIGURE_ARGS:=--host=${HOST_NATIVE} --prefix= --target=${TARGET}};
-: ${PKG_LIBZ_SHA256SUM:=33e65f22ec3d3e3f87436e53f82eb114054cd3aa373dc0480625dd92806fd9a0};
+: ${PKG_LIBRESSL_CFLAGS_CONFIGURE_EXTRA:=-D__MIDIPIX};
+: ${PKG_LIBRESSL_CONFIGURE_ARGS_EXTRA:=--disable-asm};
+: ${PKG_LIBRESSL_LIBTOOL_MIDIPIX:=1};
: ${PKG_LIBZ_VERSION:=1.2.8.2015.05.20};
+: ${PKG_LIBZ_SHA256SUM:=33e65f22ec3d3e3f87436e53f82eb114054cd3aa373dc0480625dd92806fd9a0};
: ${PKG_LIBZ_URL:=https://sortix.org/libz/release/libz-${PKG_LIBZ_VERSION}.tar.gz};
-: ${PKG_MAKE_SHA256SUM:=f3e69023771e23908f5d5592954d8271d3d6af09693cecfd29cee6fde8550dc8};
+: ${PKG_LIBZ_CONFIGURE_ARGS:=--host=${HOST_NATIVE} --prefix= --target=${TARGET}};
: ${PKG_MAKE_VERSION:=3.81};
+: ${PKG_MAKE_SHA256SUM:=f3e69023771e23908f5d5592954d8271d3d6af09693cecfd29cee6fde8550dc8};
: ${PKG_MAKE_URL:=https://ftp.gnu.org/gnu/make/make-${PKG_MAKE_VERSION}.tar.bz2};
-: ${PKG_MPC_CONFIGURE_ARGS_EXTRA:=--with-gmp=${PREFIX_NATIVE} --with-mpfr=${PREFIX_NATIVE}};
-: ${PKG_MPC_PREFIX_EXTRA:=${PREFIX_TARGET}};
-: ${PKG_MPC_SHA256SUM:=ed5a815cfea525dc778df0cb37468b9c1b554aaf30d9328b1431ca705b7400ff};
: ${PKG_MPC_VERSION:=1.0.1};
+: ${PKG_MPC_SHA256SUM:=ed5a815cfea525dc778df0cb37468b9c1b554aaf30d9328b1431ca705b7400ff};
: ${PKG_MPC_URL:=ftp://ftp.gnu.org/gnu/mpc/mpc-${PKG_MPC_VERSION}.tar.gz};
-: ${PKG_MPFR_CONFIGURE_ARGS_EXTRA:=--with-gmp=${PREFIX_NATIVE}};
-: ${PKG_MPFR_PREFIX_EXTRA:=${PREFIX_TARGET}};
-: ${PKG_MPFR_SHA256SUM:=79c73f60af010a30a5c27a955a1d2d01ba095b72537dab0ecaad57f5a7bb1b6b};
+: ${PKG_MPC_CONFIGURE_ARGS_EXTRA:=--with-gmp=${PREFIX_NATIVE} --with-mpfr=${PREFIX_NATIVE}};
+: ${PKG_MPC_LIBTOOL_MIDIPIX:=1};
+: ${PKG_MPC_PREFIX_EXTRA:=DESTDIR=${PREFIX_TARGET}};
: ${PKG_MPFR_VERSION:=3.1.2};
+: ${PKG_MPFR_SHA256SUM:=79c73f60af010a30a5c27a955a1d2d01ba095b72537dab0ecaad57f5a7bb1b6b};
: ${PKG_MPFR_URL:=ftp://ftp.gnu.org/gnu/mpfr/mpfr-${PKG_MPFR_VERSION}.tar.bz2};
-: ${PKG_MUSL_SHA256SUM:=720b83c7e276b4b679c0bffe9509340d5f81fd601508e607e708177df0d31c0e};
+: ${PKG_MPFR_CONFIGURE_ARGS_EXTRA:=--with-gmp=${PREFIX_NATIVE}};
+: ${PKG_MPFR_LIBTOOL_MIDIPIX:=1};
+: ${PKG_MPFR_PREFIX_EXTRA:=DESTDIR=${PREFIX_TARGET}};
: ${PKG_MUSL_VERSION:=1.1.12};
+: ${PKG_MUSL_SHA256SUM:=720b83c7e276b4b679c0bffe9509340d5f81fd601508e607e708177df0d31c0e};
: ${PKG_MUSL_URL:=http://www.musl-libc.org/releases/musl-${PKG_MUSL_VERSION}.tar.gz};
-: ${PKG_NCURSES_CONFIGURE_ARGS_EXTRA:=--with-pkg-config --with-pkg-config-libdir=${PREFIX_LVL3}/lib/pkgconfig --enable-pc-files --enable-widec --with-shared};
-: ${PKG_NCURSES_MAKEFLAGS_INSTALL_EXTRA:=PKG_CONFIG_LIBDIR=/lib/pkgconfig};
-: ${PKG_NCURSES_SHA256SUM:=f551c24b30ce8bfb6e96d9f59b42fbea30fa3a6123384172f9e7284bcf647260};
: ${PKG_NCURSES_VERSION:=6.0};
+: ${PKG_NCURSES_SHA256SUM:=f551c24b30ce8bfb6e96d9f59b42fbea30fa3a6123384172f9e7284bcf647260};
: ${PKG_NCURSES_URL:=https://ftp.gnu.org/gnu/ncurses/ncurses-${PKG_NCURSES_VERSION}.tar.gz};
-: ${PKG_OPENSSH_CFLAGS:=-I${PREFIX_LVL3}/include};
-: ${PKG_OPENSSH_INSTALL_TARGET:=install-nokeys};
-: ${PKG_OPENSSH_LDFLAGS:=-L${PREFIX_LVL3}/lib};
-: ${PKG_OPENSSH_SHA256SUM:=dd75f024dcf21e06a0d6421d582690bf987a1f6323e32ad6619392f3bfde6bbd};
+: ${PKG_NCURSES_CONFIGURE_ARGS_EXTRA:=--with-pkg-config --with-pkg-config-libdir=${PREFIX_LVL3}/lib/pkgconfig --enable-pc-files --enable-widec --with-shared};
+: ${PKG_NCURSES_MAKEFLAGS_INSTALL_EXTRA:=PKG_CONFIG_LIBDIR=/lib/pkgconfig};
: ${PKG_OPENSSH_VERSION:=7.1p2};
+: ${PKG_OPENSSH_SHA256SUM:=dd75f024dcf21e06a0d6421d582690bf987a1f6323e32ad6619392f3bfde6bbd};
: ${PKG_OPENSSH_URL:=http://artfiles.org/openbsd/OpenSSH/portable/openssh-${PKG_OPENSSH_VERSION}.tar.gz};
-: ${PKG_OPENSSH_UNSET_VARS_BUILD:=CFLAGS LDFLAGS};
-: ${PKG_PATCH_SHA256SUM:=59c29f56faa0a924827e6a60c6accd6e2900eae5c6aaa922268c717f06a62048};
+: ${PKG_OPENSSH_CFLAGS_CONFIGURE_EXTRA:=-I${PREFIX_LVL3}/include};
+: ${PKG_OPENSSH_INSTALL_TARGET:=install-nokeys};
+: ${PKG_OPENSSH_LDFLAGS_CONFIGURE_EXTRA:=-L${PREFIX_LVL3}/lib};
: ${PKG_PATCH_VERSION:=2.7};
+: ${PKG_PATCH_SHA256SUM:=59c29f56faa0a924827e6a60c6accd6e2900eae5c6aaa922268c717f06a62048};
: ${PKG_PATCH_URL:=https://ftp.gnu.org/gnu/patch/patch-${PKG_PATCH_VERSION}.tar.gz};
-: ${PKG_RSYNC_UNSET_VARS_BUILD:="CFLAGS LDFLAGS"};
-: ${PKG_RSYNC_CFLAGS:=-I${PREFIX_LVL3}/include};
-: ${PKG_RSYNC_CONFIGURE_ARGS_EXTRA:=--with-included-popt --with-included-zlib};
-: ${PKG_RSYNC_LDFLAGS:=-L${PREFIX_LVL3}/lib};
: ${PKG_RSYNC_VERSION:=3.1.2};
+: ${PKG_RSYNC_SHA256SUM:=ecfa62a7fa3c4c18b9eccd8c16eaddee4bd308a76ea50b5c02a5840f09c0a1c2};
: ${PKG_RSYNC_URL:=https://download.samba.org/pub/rsync/src/rsync-${PKG_RSYNC_VERSION}.tar.gz};
-: ${PKG_TAR_SHA256SUM:=6a6b65bac00a127a508533c604d5bf1a3d40f82707d56f20cefd38a05e8237de};
+: ${PKG_RSYNC_CFLAGS_CONFIGURE_EXTRA:=-I${PREFIX_LVL3}/include};
+: ${PKG_RSYNC_CONFIGURE_ARGS_EXTRA:=--with-included-popt --with-included-zlib};
+: ${PKG_RSYNC_LDFLAGS_CONFIGURE_EXTRA:=-L${PREFIX_LVL3}/lib};
: ${PKG_TAR_VERSION:=1.28};
+: ${PKG_TAR_SHA256SUM:=6a6b65bac00a127a508533c604d5bf1a3d40f82707d56f20cefd38a05e8237de};
: ${PKG_TAR_URL:=https://ftp.gnu.org/gnu/tar/tar-${PKG_TAR_VERSION}.tar.gz};
-: ${PKG_SED_SHA256SUM:=f048d1838da284c8bc9753e4506b85a1e0cc1ea8999d36f6995bcb9460cddbd7};
: ${PKG_SED_VERSION:=4.2.2};
+: ${PKG_SED_SHA256SUM:=f048d1838da284c8bc9753e4506b85a1e0cc1ea8999d36f6995bcb9460cddbd7};
: ${PKG_SED_URL:=https://ftp.gnu.org/gnu/sed/sed-${PKG_SED_VERSION}.tar.bz2};
-: ${PKG_UTIL_LINUX_CFLAGS:=-I${PREFIX_LVL3}/include};
-: ${PKG_UTIL_LINUX_LDFLAGS:=-I${PREFIX_LVL3}/lib};
-: ${PKG_UTIL_LINUX_CONFIGURE_ARGS_EXTRA:=--disable-agetty --disable-wall --disable-write};
-: ${PKG_UTIL_LINUX_UNSET_VARS_BUILD:=CFLAGS LDFLAGS};
-: ${PKG_UTIL_LINUX_SHA256SUM:=133c14f625d40e90e73e9d200faf3f2ce87937b99f923c84e5504ac0badc71d6};
: ${PKG_UTIL_LINUX_VERSION:=2.27.1};
+: ${PKG_UTIL_LINUX_SHA256SUM:=133c14f625d40e90e73e9d200faf3f2ce87937b99f923c84e5504ac0badc71d6};
: ${PKG_UTIL_LINUX_URL:=https://www.kernel.org/pub/linux/utils/util-linux/v2.27/util-linux-${PKG_UTIL_LINUX_VERSION}.tar.gz};
-: ${PKG_WHICH_SHA256SUM:=f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad};
+: ${PKG_UTIL_LINUX_CFLAGS_CONFIGURE_EXTRA:=-I${PREFIX_LVL3}/include};
+: ${PKG_UTIL_LINUX_CONFIGURE_ARGS_EXTRA:=--disable-agetty --disable-wall --disable-write};
+: ${PKG_UTIL_LINUX_LDFLAGS_CONFIGURE_EXTRA:=-I${PREFIX_LVL3}/lib};
: ${PKG_WHICH_VERSION:=2.21};
+: ${PKG_WHICH_SHA256SUM:=f4a245b94124b377d8b49646bf421f9155d36aa7614b6ebf83705d3ffc76eaad};
: ${PKG_WHICH_URL:=https://ftp.gnu.org/gnu/which/which-${PKG_WHICH_VERSION}.tar.gz};
: ${PKG_XZ_VERSION:=5.2.2};
+: ${PKG_XZ_SHA256SUM:=73df4d5d34f0468bd57d09f2d8af363e95ed6cc3a4a86129d2f2c366259902a2};
: ${PKG_XZ_URL:=http://tukaani.org/xz/xz-${PKG_XZ_VERSION}.tar.gz};
: ${PKG_DALIST_URL:=${GITROOT_HEAD}/dalist};
diff --git a/pkg.build b/pkg.build
index f8a3f567..97e1a3f4 100644
--- a/pkg.build
+++ b/pkg.build
@@ -2,27 +2,7 @@
# . ./build.vars and set -o errexit are assumed.
#
-# Order for build level 2 (runtime:) psxtypes pemagine dalist ntapi psxscl ntcon ntctty
-parse_with_pkg_name ${2} \
- apk_tools bash binutils binutils_host bzip2 coreutils \
- dalist dash diffutils findutils gawk git gmp \
- grep gzip less libelf libressl libz make mpc mpfr \
- ncurses ntapi ntcon ntctty openssh patch pemagine \
- popt psxscl psxstub psxtypes rsync sed tar util_linux \
- which xz;
-case "${SCRIPT_FNAME%[0-9][0-9]*}" in
-1) _configure_args="--host=${HOST_NATIVE} --prefix=${PKG_PREFIX:-/} --target=${TARGET}";
- PKG_NO_CONFIG_CACHE=1; ;;
-2)
- _configure_args="--prefix=${PREFIX_LVL} --host=${HOST_NATIVE}";
- PKG_BUILD_TYPE=cross; PKG_URL_TYPE=git;
- PKG_NO_CONFIG_CACHE=${PKG_NO_DESTDIR:=${PKG_NO_EXTRACT:=${PKG_NO_LIBTOOL_MIDIPIX:=1}}};
- PKG_UNSET_VARS_BUILD="CC LD CFLAGS LDFLAGS PREFIX";
- export CFLAGS_PATH=-I${PREFIX_LVL}/include;
- export LDFLAGS_PATH=-L${PREFIX_LVL}/lib;
- ;;
-*) _configure_args=${PKG_CONFIGURE_ARGS:--C --host=${HOST_NATIVE} --prefix= --target=${TARGET}}; ;;
-esac;
+parse_with_pkg_name ${SCRIPT_FNAME%[0-9][0-9]*} ${2} ${PKG_BUILD_NAMES};
if ! is_build_script_done fetch; then
if [ "x${PKG_URL_TYPE:-wget}" = "xwget" ]; then
rm_if_exists $(get_basename ${PKG_URL});
@@ -30,117 +10,111 @@ if ! is_build_script_done fetch; then
else
rm_if_exists ${PKG_SUBDIR};
fetch_git ${PKG_SUBDIR} ${PKG_URL} "${PKG_GIT_ARGS_EXTRA}";
- PKG_NO_EXTRACT=1;
fi;
set_build_script_done fetch -extract;
-else
- [ "x${PKG_URL_TYPE:-wget}" = "xwget" ] || PKG_NO_EXTRACT=1;
fi;
-if command -v pkg_${PKG_NAME}_finish >/dev/null; then
+if test_cmd pkg_${PKG_NAME}_finish; then
pkg_${PKG_NAME}_finish; exit 0;
-elif [ ${PKG_NO_EXTRACT:-0} -eq 0 ] &&\
+elif [ "x${PKG_URL_TYPE:-wget}" = "xwget" ] &&\
! is_build_script_done extract; then
rm_if_exists ${PKG_SUBDIR};
tar -axf ${PKG_FNAME};
set_build_script_done extract -build_dir;
fi;
-if [ -n "${PKG_BUILD_DIR}" ]; then
- BUILD_DIR=${PKG_BUILD_DIR};
-else
+if [ -z "${PKG_BUILD_DIR}" ]; then
set_build_dir ${PKG_SUBDIR} ${PKG_BUILD_TYPE:-native};
fi;
if ! is_build_script_done build_dir; then
- [ ${PKG_SUBDIR} != ${BUILD_DIR} ] &&\
- rm_if_exists -m ${BUILD_DIR};
+ [ ${PKG_SUBDIR} != ${PKG_BUILD_DIR} ] &&\
+ rm_if_exists -m ${PKG_BUILD_DIR};
set_build_script_done build_dir -patch;
fi;
if ! is_build_script_done patch; then
- [ -f portage/${PKG_SUBDIR}.midipix.patch ] && \
- patch -b -d ${PKG_SUBDIR} -p1 \
- < portage/${PKG_SUBDIR}.midipix.patch;
- [ ${PKG_NO_PATCH_LOCAL:-0} -eq 0 ] && \
- [ -f ${_PWD}/${PKG_SUBDIR}.local.patch ] && \
- patch -b -d ${PKG_SUBDIR} -p1 \
- < ${_PWD}/${PKG_SUBDIR}.local.patch;
+ for PATCH_FNAME in portage/${PKG_SUBDIR}.midipix.patch \
+ ${_PWD}/${PKG_SUBDIR}.local.patch; do
+ [ -r ${PATCH_FNAME} ] &&\
+ patch -b -d ${PKG_SUBDIR} -p1 < ${PATCH_FNAME};
+ done; unset PATCH_FNAME;
if [ -n "${PKG_PATCHES_EXTRA_URL}" ]; then
apply_patches ${PKG_PATCHES_EXTRA_URL} ${PKG_SUBDIR};
if [ -n "${PKG_PATCHES_EXTRA_MANIFEST}" ]; then
compare_hash_manifest ${PKG_PATCHES_EXTRA_MANIFEST};
fi;
fi;
- [ ${PKG_NO_CONFIG_CACHE:-0} -eq 0 ] &&\
- cp portage/config.cache ${BUILD_DIR}/;
- [ ${PKG_NO_LIBTOOL_MIDIPIX:-0} -eq 0 ] && \
+ [ -x ${PKG_SUBDIR}/configure ] && \
+ cp portage/config.cache ${PKG_BUILD_DIR}/;
+ [ ${PKG_LIBTOOL_MIDIPIX:-0} -eq 1 ] && \
cp portage/libtool.midipix ${PKG_SUBDIR}/;
set_build_script_done patch -configure;
fi;
-cd ${BUILD_DIR};
-if [ ${PKG_NO_CONFIGURE:-0} -eq 0 ]\
+cd ${PKG_BUILD_DIR};
+if [ -x ../${PKG_SUBDIR}/configure ]\
&& ! is_build_script_done configure; then
- command -v pkg_${PKG_NAME}_configure_pre >/dev/null \
- && pkg_${PKG_NAME}_configure_pre;
+ if test_cmd pkg_${PKG_NAME}_configure_pre; then
+ pkg_${PKG_NAME}_configure_pre;
+ fi;
+ AR="${PKG_AR_CONFIGURE}" CC="${PKG_CC_CONFIGURE}"\
+ CFLAGS="${PKG_CFLAGS_CONFIGURE}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}"\
+ LDFLAGS="${PKG_LDFLAGS_CONFIGURE}${PKG_LDFLAGS_CONFIGURE_EXTRA:+ ${PKG_LDFLAGS_CONFIGURE_EXTRA}}"\
../${PKG_SUBDIR}/configure \
- ${_configure_args} \
- ${PKG_CONFIGURE_ARGS_EXTRA};
+ ${PKG_CONFIGURE_ARGS} ${PKG_CONFIGURE_ARGS_EXTRA};
set_build_script_done configure clean -build;
else
set_build_script_done clean;
fi;
if [ ${PKG_NO_CLEAN:-0} -eq 0 ]\
&& ! is_build_script_done clean; then
- make ${MAKEFLAGS} clean;
+ make clean;
set_build_script_done clean -build;
fi;
if ! is_build_script_done build; then
- if [ -n "${PKG_UNSET_VARS_BUILD}" ]; then
- unset ${PKG_UNSET_VARS_BUILD}
- fi;
- make ${PKG_MAKEFLAGS_BUILD_EXTRA:+${PKG_MAKEFLAGS_BUILD_EXTRA}}\
- ${MAKEFLAGS} \
- ${AR:+AR=${AR}} \
- ${CC:+CC=${CC}} ${CFLAGS:+"CFLAGS=${CFLAGS}"} \
- ${LD:+LD=${LD}} ${LDFLAGS:+"LDFLAGS=${LDFLAGS}"}\
- ${RANLIB:+RANLIB=${RANLIB}};
- set_build_script_done build -install1;
+ run_cmd_unsplit make \
+ ${PKG_MAKEFLAGS_BUILD} \
+ ${PKG_MAKEFLAGS_BUILD_EXTRA} \
+ "${PKG_AR_BUILD:+AR=${PKG_AR_BUILD}}" \
+ "${PKG_CC_BUILD:+CC=${PKG_CC_BUILD}}" \
+ "${PKG_CFLAGS_BUILD:+CFLAGS=${PKG_CFLAGS_BUILD}}"\
+ "${PKG_CFLAGS_BUILD_EXTRA:+CFLAGS+=${PKG_CFLAGS_BUILD_EXTRA}}"\
+ "${PKG_LDFLAGS_BUILD:+LDFLAGS=${PKG_LDFLAGS_BUILD}}"\
+ "${PKG_LDFLAGS_BUILD_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_BUILD_EXTRA}}";
+ set_build_script_done build -install;
fi;
-if ! is_build_script_done install1; then
- if command -v pkg_${PKG_NAME}_install >/dev/null; then
+if ! is_build_script_done install; then
+ if test_cmd pkg_${PKG_NAME}_install; then
pkg_${PKG_NAME}_install;
- elif [ ${PKG_NO_DESTDIR:-0} -eq 0 ]; then
- make ${PKG_MAKEFLAGS_INSTALL_EXTRA:+${PKG_MAKEFLAGS_INSTALL_EXTRA}}\
- ${MAKEFLAGS} \
- ${AR:+AR=${AR}} \
- ${CC:+CC=${CC}} ${CFLAGS:+"CFLAGS=${CFLAGS}"} \
- ${LD:+LD=${LD}} ${LDFLAGS:+"LDFLAGS=${LDFLAGS}"}\
- ${RANLIB:+RANLIB=${RANLIB}} \
- DESTDIR=${PREFIX_LVL} \
- ${PKG_INSTALL_TARGET:-install};
- elif [ -n "${PKG_MAKEFLAGS}" ]; then
- make ${PKG_MAKEFLAGS} \
- ${CC:+CC=${CC}} ${CFLAGS:+"CFLAGS=${CFLAGS}"} \
- ${LD:+LD=${LD}} ${LDFLAGS:+"LDFLAGS=${LDFLAGS}"}\
- ${PKG_INSTALL_TARGET:-install};
else
- make ${PKG_MAKEFLAGS_INSTALL_EXTRA:+${PKG_MAKEFLAGS_INSTALL_EXTRA}}\
- ${MAKEFLAGS} \
- ${AR:+AR=${AR}} \
- ${CC:+CC=${CC}} ${CFLAGS:+"CFLAGS=${CFLAGS}"} \
- ${LD:+LD=${LD}} ${LDFLAGS:+"LDFLAGS=${LDFLAGS}"}\
- ${PREFIX:+PREFIX=${PREFIX}} \
- ${RANLIB:+RANLIB=${RANLIB}} \
- ${PKG_INSTALL_TARGET:-install};
+ run_cmd_unsplit make \
+ ${PKG_MAKEFLAGS_INSTALL} \
+ ${PKG_MAKEFLAGS_INSTALL_EXTRA} \
+ "${PKG_AR_INSTALL:+AR=${PKG_AR_INSTALL}}"\
+ "${PKG_CC_INSTALL:+CC=${PKG_CC_INSTALL}}"\
+ "${PKG_CC_INSTALL:+CC=${PKG_CC_INSTALL}}"\
+ "${PKG_CFLAGS_INSTALL:+CFLAGS=${PKG_CFLAGS_INSTALL}}"\
+ "${PKG_CFLAGS_INSTALL_EXTRA:+CFLAGS+=${PKG_CFLAGS_INSTALL_EXTRA}}"\
+ "${PKG_LDFLAGS_INSTALL:+LDFLAGS=${PKG_LDFLAGS_INSTALL}}"\
+ "${PKG_LDFLAGS_INSTALL_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_INSTALL_EXTRA}}"\
+ "${PKG_RANLIB_INSTALL:+RANLIB=${PKG_RANLIB_INSTALL}}"\
+ ${PKG_INSTALL_TARGET:=install};
+ if [ -n "${PKG_PREFIX_EXTRA}" ]; then
+ run_cmd_unsplit make \
+ ${PKG_MAKEFLAGS_INSTALL} \
+ ${PKG_MAKEFLAGS_INSTALL_EXTRA} \
+ "${PKG_AR_INSTALL:+AR=${PKG_AR_INSTALL}}"\
+ "${PKG_CC_INSTALL:+CC=${PKG_CC_INSTALL}}"\
+ "${PKG_CC_INSTALL:+CC=${PKG_CC_INSTALL}}"\
+ "${PKG_CFLAGS_INSTALL:+CFLAGS=${PKG_CFLAGS_INSTALL}}"\
+ "${PKG_CFLAGS_INSTALL_EXTRA:+CFLAGS+=${PKG_CFLAGS_INSTALL_EXTRA}}"\
+ "${PKG_LDFLAGS_INSTALL:+LDFLAGS=${PKG_LDFLAGS_INSTALL}}"\
+ "${PKG_LDFLAGS_INSTALL_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_INSTALL_EXTRA}}"\
+ "${PKG_RANLIB_INSTALL:+RANLIB=${PKG_RANLIB_INSTALL}}"\
+ ${PKG_PREFIX_EXTRA} \
+ ${PKG_INSTALL_TARGET:=install};
+ fi;
+ if test_cmd pkg_${PKG_NAME}_install_post; then
+ pkg_${PKG_NAME}_install_post;
+ fi;
fi;
- set_build_script_done install1 -install2 -finish;
-fi;
-if [ -n "${PKG_PREFIX_EXTRA}" ]\
-&& ! is_build_script_done install2; then
- make DESTDIR=${PKG_PREFIX_EXTRA} install;
- set_build_script_done install2 -install3 -finish;
-fi;
-if command -v pkg_${PKG_NAME}_install_post >/dev/null\
-&& ! is_build_script_done install3; then
- pkg_${PKG_NAME}_install_post;
- set_build_script_done install3 -finish;
+ set_build_script_done install -finish;
fi;
set_build_script_done finish;