summaryrefslogtreecommitdiffhomepage
path: root/subr.rtl
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2021-05-12 22:10:38 +0100
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2021-05-12 22:10:38 +0100
commitb9a71579b82cd54980ff641af504bc8ad96473b1 (patch)
treee8dc1e7f2044995415ae2e21e67a60da7fe9a13b /subr.rtl
parentb7c3731e3e4104b444a0061ba4505b9bbb533906 (diff)
downloadmidipix_build-b9a71579b82cd54980ff641af504bc8ad96473b1.tar.bz2
midipix_build-b9a71579b82cd54980ff641af504bc8ad96473b1.tar.xz
Implements CMake support.
etc/README.md: updated. groups/{000.host_tools,010.host_deps,200.native_packages,800.minipix}.group:${*_SOFORT_NATIVE_{C,CXX,LD}FLAGS}: merged into midipix.env. groups/010.host_deps.group:{clang,cmake_host,libzip,llvm}_host:${PKG_CMAKE_ARGS_EXTRA}: added. groups/010.host_deps.group:cmake_host:${PKG_CONFIGURE_TYPE}: configure w/ cmake. groups/010.host_deps.group:cmake_host:${PKG_INSTALL_FILES}: added. groups/010.host_deps.group:expat_host:${PKG_CONFIGURE_TYPE}: configure w/ autotools. groups/010.host_deps.group:python[23]_host:${PKG_{ENV_VARS_EXTRA,SOFORT_FORCE}}: removed. groups/010.host_deps.group:python[23]_host:${PKG_CONFIGURE_TYPE}: configure w/ sofort. groups/010.host_deps.group:python[23]_host:${PKG_SOFORT_NATIVE_CC}: removed. groups/221.native_packages_dev.group:python[23]:${PKG_SOFORT_FORCE}: removed. groups/221.native_packages_dev.group:python[23]:${PKG_CONFIGURE_TYPE}: configure w/ sofort. groups/231.native_packages_etc.group:{cmake,minizip,openjpeg,tdnf,xpdf}:${PKG_CMAKE_ARGS_EXTRA}: added. groups/231.native_packages_etc.group:cmake:${PKG_CONFIGURE_ARGS}: removed. groups/231.native_packages_etc.group:utf8proc:${PKG_IN_TREE}: don't build in-tree. groups/251.native_packages_lib.group:lib{jpeg_turbo,solv,ssh,zip}:${PKG_CMAKE_ARGS_EXTRA}: added. midipix.env:${DEFAULT_BUILD_VARS}: adds ${PKG_{CMAKE{,_{ARGS{,_EXTRA},LISTFILE}},CONFIGURE_TYPE},SOFORT_NATIVE_{C{C,XX},{C,CXX,LD}FLAGS,LD}}. midipix.env:${DEFAULT_BUILD_VARS}: removes ${PKG_SOFORT_FORCE}. midipix.env:${DEFAULT_{CMAKE_LISTFILE,{CROSS,HOST,NATIVE}_CMAKE}}: added. subr.rtl/rtl_complex.subr:rtl_export_vars(): ignore values during -u. subr.rtl/rtl_platform.subr:rtl_set_vars(): updated. subr/ex_pkg_env.subr:exp_pkg_env_set(): always convert ${PKG_{AR,CC,CXX,PKG_CONFIG,RANLIB}} to absolute pathnames. subr/ex_pkg_env.subr:ex_pkg_env_sofort(): merged into subr/pkg_configure.subr. subr/ex_pkg_restart.subr:ex_pkg_process_restart_spec(): remove extraneous echo. subr/pkg_configure.subr:pkgp_configure_{cmake,sofort}(): initial implementation. subr/pkg_configure.subr:pkg_configure(): attempt configuration using autotools, sofort, or cmake. subr/pkg_configure_autotools.subr: skip if ${PKG_CONFIGURE_TYPE} is set and not "autotools". subr/pkg_fetch_clean.subr: fix typo. vars/{clang_host,cmake{,_host},lib{jpeg_turbo,solv,ssh,zip{,_host}},llvm_host,lolcode,minizip,openjpeg,tdnf,xpdf}.vars: deleted.
Diffstat (limited to 'subr.rtl')
-rw-r--r--subr.rtl/rtl_complex.subr16
-rw-r--r--subr.rtl/rtl_platform.subr14
2 files changed, 15 insertions, 15 deletions
diff --git a/subr.rtl/rtl_complex.subr b/subr.rtl/rtl_complex.subr
index 61637f69..f315fd90 100644
--- a/subr.rtl/rtl_complex.subr
+++ b/subr.rtl/rtl_complex.subr
@@ -4,15 +4,15 @@
rtl_export_vars() {
local _unsetfl=0; [ "x${1}" = "x-u" ] && { _unsetfl=1; shift; };
+
while [ "${#}" -ge 2 ]; do
- if [ -n "${2}" ]; then
- if [ "${_unsetfl:-0}" -eq 0 ]; then
- rtl_set_var_unsafe "${1}" "${2}"; export "${1}";
- else
- unset "${1}";
- fi;
- fi;
- shift 2;
+ if [ "${2:+1}" = 1 ]\
+ || [ "${_unsetfl}" -eq 1 ]; then
+ case "${_unsetfl}" in
+ 0) rtl_set_var_unsafe "${1}" "${2}"; export "${1}"; ;;
+ 1) unset "${1}"; ;;
+ esac;
+ fi; shift 2;
done;
};
diff --git a/subr.rtl/rtl_platform.subr b/subr.rtl/rtl_platform.subr
index c8137e56..ac411c87 100644
--- a/subr.rtl/rtl_platform.subr
+++ b/subr.rtl/rtl_platform.subr
@@ -108,17 +108,17 @@ rtl_run_cmd_unsplit() {
rtl_set_vars() {
local _vars_set_vname="${1}" _vname_dst="${2}" _vname_src_tmpls="${3}" \
_vars_set_old="" _vars_set_tmp="" _vname_src="";
+
for _vname_src in $(rtl_toupper "${_vname_src_tmpls}"); do
_vname_src="${_vname_src}_${_vname_dst}";
- _vval_src="$(rtl_get_var_unsafe "${_vname_src}")";
- if [ -n "${_vval_src}" ]; then
- rtl_set_var_unsafe "PKG_${_vname_dst}" "${_vval_src}";
- _vars_set_tmp="$(rtl_lconcat "${_vars_set_tmp}" "PKG_${_vname_dst}")";
+ eval _vval_src='${'"${_vname_src}"':-}';
+ if [ "${_vval_src:+1}" = 1 ]; then
+ eval PKG_${_vname_dst}='${_vval_src}';
+ _vars_set_tmp="${_vars_set_tmp:+${_vars_set_tmp} }PKG_${_vname_dst}";
fi;
done;
- _vars_set_old="$(rtl_get_var_unsafe "${_vars_set_vname}")";
- rtl_set_var_unsafe "${_vars_set_vname}" \
- "$(rtl_lconcat "${_vars_set_old}" "${_vars_set_tmp}")";
+ eval _vars_set_old='${'"${_vars_set_vname}"'}';
+ rtl_set_var_unsafe "${_vars_set_vname}" "${_vars_set_old:+${_vars_set_old} }${_vars_set_tmp}";
};
# vim:filetype=sh