summaryrefslogtreecommitdiffhomepage
path: root/subr/post_strip.subr
blob: b1d5d01ba94617e9cd2e3822df19a99129600f53 (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
25
26
27
#
# set -o errexit -o noglob are assumed.
#

postp_strip_files() {
	local _pname="${1}";
	for __ in $(find "${_pname}" -perm -0100 \( -type f -or -type l \)); do
		if objdump -sj .debug_info "${__}" >/dev/null 2>&1; then
			log_msg vnfo "${TARGET}-strip ${__}";
			set +o errexit; ${TARGET}-strip ${__}; set -o errexit;
		fi;
	done;
};

post_strip() {
	local __;
	if [ "${BUILD}" = release ]; then
		log_msg info "Stripping ${PREFIX_NATIVE}/bin...";
		postp_strip_files ${PREFIX_NATIVE}/bin;
	fi;
	if [ ${ARG_DEBUG_MINIPIX:-0} -eq 0 ]; then
		log_msg info "Stripping ${PREFIX_MINIPIX}/bin...";
		postp_strip_files ${PREFIX_MINIPIX}/bin;
	fi;
};

# vim:filetype=sh