summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_install_strip.subr
blob: e94609eb5a1daac1d1a0fc8e0d3b5ab753dd6b54 (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
#
# set -o errexit -o noglob are assumed.
#

pkg_install_strip() {
	local _tree_root="${PKG_DESTDIR}" _bin_path="";
	if [ -e "${_tree_root}" ]\
	&& [ "${BUILD}" = release ]\
	&& [ "${PKG_BUILD_TYPE}" = native ]; then
		if [ "${PKG_NAME%_minipix}" != "${PKG_NAME}" ]\
		&& [ "${ARG_DEBUG_MINIPIX:-0}" -eq 1 ]; then
			return;
		fi;
		for _bin_path in $(find "${_tree_root}" -perm /a=x -type f); do
			if objdump -sj .debug_info "${_bin_path}" >/dev/null 2>&1; then
				ex_rtl_log_msg info "Stripping ${_bin_path}...";
				ex_rtl_log_msg vnfo "${PKG_TARGET}-strip ${_bin_path}";
				${PKG_TARGET}-strip ${_bin_path};
			fi;
		done;
	fi;
};

# vim:filetype=sh