summaryrefslogtreecommitdiffhomepage
path: root/subr
diff options
context:
space:
mode:
Diffstat (limited to 'subr')
-rw-r--r--subr/pkg_install_libs.subr21
-rw-r--r--subr/pkg_setup_env.subr9
2 files changed, 23 insertions, 7 deletions
diff --git a/subr/pkg_install_libs.subr b/subr/pkg_install_libs.subr
index 29ec8915..c12369ea 100644
--- a/subr/pkg_install_libs.subr
+++ b/subr/pkg_install_libs.subr
@@ -2,6 +2,17 @@
# set -o errexit -o noglob are assumed.
#
+pkgp_install_lib_check() {
+ local _so_path="${1}" _so_ver="${1##*.so}";
+ while [ -n "${_so_ver}" ]; do
+ if [ "${_so_ver#[0-9].}" = "${_so_ver}" ]; then
+ return 0;
+ else
+ _so_ver="${_so_ver#[0-9].}";
+ fi;
+ done; return 1;
+};
+
pkgp_install_lib_link() {
local _so_path="${1}" _so_dir="${2}" _lib_name="${3}" \
_lib_link_tgt _lib_link_path;
@@ -11,7 +22,7 @@ pkgp_install_lib_link() {
if [ -n "${_lib_link_tgt}" ]; then
_lib_link_path="${_so_path%.so*}.lib.a";
build_fileop rm "${_lib_link_path}";
- build_fileop ln_symbolic "${_lib_link_tgt}" \
+ build_fileop ln_symbolic "$(basename "${_lib_link_tgt}")" \
"${_lib_link_path}";
fi;
};
@@ -21,11 +32,9 @@ pkg_install_libs() {
if [ "${PKG_BUILD_TYPE}" != "host" ]; then
for _so_src_path in \
$(find "${PWD}/../destdir" \
- \( -name "*.so" \
- -or -name "*.so.[0-9]*" \
- -or -name "*.so.[0-9]*.[0-9]*" \
- -or -name "*.so.[0-9]*.[0-9]*.[0-9]*" \) -print);
- do if [ "$(readlink -f "${_so_src_path}")" = "/dev/null" ]; then
+ \( -name "*.so" -or -name "*.so.*" \) -print);
+ do if ! pkgp_install_lib_check "${_so_src_path}" \
+ || [ "$(readlink -f "${_so_src_path}")" = "/dev/null" ]; then
continue;
else case "${_so_src_path}" in
*.so) _lib_src_path="${_so_src_path%%.so}.lib.a"; ;;
diff --git a/subr/pkg_setup_env.subr b/subr/pkg_setup_env.subr
index 6f2ef2cb..a02b1a60 100644
--- a/subr/pkg_setup_env.subr
+++ b/subr/pkg_setup_env.subr
@@ -16,7 +16,14 @@ pkg_setup_env() {
[ -n "${PKG_ENV_VARS_EXTRA}" ] && set_env_vars_with_sep : "${PKG_ENV_VARS_EXTRA}";
[ -z "${PKG_FNAME}" ] && PKG_FNAME="${PKG_URL##*/}";
[ -z "${PKG_TARGET}" ] && PKG_TARGET="${TARGET}";
- [ -z "${PKG_BASE_DIR}" ] && PKG_BASE_DIR="${WORKDIR}/${PKG_NAME}-${PKG_BUILD_TYPE:-native}-${PKG_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
+ build_fileop rm "${PKG_BASE_DIR}";
+ fi; ;;
+ esac;
case "${PKG_BUILD_TYPE}" in
host) export AR="ar";
export CC="gcc";