aboutsummaryrefslogtreecommitdiff
path: root/tools/build/depend-cleanup.sh
diff options
context:
space:
mode:
authorJessica Clarke <jrtc27@FreeBSD.org>2023-07-27 04:10:47 +0000
committerJessica Clarke <jrtc27@FreeBSD.org>2023-07-27 04:10:47 +0000
commit81805ec30074363e5d7d7add37b3ccf4f1eb396b (patch)
treeef66bf0400769f674da11a9797efdd7815486b5a /tools/build/depend-cleanup.sh
parent64140bb529eaaebd3cb972deb3d03eae1320d265 (diff)
downloadsrc-81805ec30074363e5d7d7add37b3ccf4f1eb396b.tar.gz
src-81805ec30074363e5d7d7add37b3ccf4f1eb396b.zip
Diffstat (limited to 'tools/build/depend-cleanup.sh')
-rwxr-xr-xtools/build/depend-cleanup.sh44
1 files changed, 26 insertions, 18 deletions
diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh
index 39ab518d5dc9..687f04f57f8c 100755
--- a/tools/build/depend-cleanup.sh
+++ b/tools/build/depend-cleanup.sh
@@ -73,6 +73,10 @@ if [ -z "${MACHINE_ARCH+set}" ]; then
err "MACHINE_ARCH not set"
fi
+if [ -z "${ALL_libcompats+set}" ]; then
+ err "ALL_libcompats not set"
+fi
+
run()
{
if [ "$VERBOSE" ]; then
@@ -88,18 +92,15 @@ run()
# $3 source extension
clean_dep()
{
- if egrep -qw "$2\.$3" "$OBJTOP"/$1/.depend.$2.*o 2>/dev/null; then
- echo "Removing stale dependencies and objects for $2.$3"
- run rm -f \
- "$OBJTOP"/$1/.depend.$2.* \
- "$OBJTOP"/$1/$2.*o
- fi
- if egrep -qw "$2\.$3" "$OBJTOP"/obj-lib32/$1/.depend.$2.*o 2>/dev/null; then
- echo "Removing 32-bit stale dependencies and objects for $2.$3"
- run rm -f \
- "$OBJTOP"/obj-lib32/$1/.depend.$2.* \
- "$OBJTOP"/obj-lib32/$1/$2.*o
- fi
+ for libcompat in "" $ALL_libcompats; do
+ dirprfx=${libcompat:+obj-lib${libcompat}/}
+ if egrep -qw "$2\.$3" "$OBJTOP"/$dirprfx$1/.depend.$2.*o 2>/dev/null; then
+ echo "Removing stale ${libcompat:+lib${libcompat} }dependencies and objects for $2.$3"
+ run rm -f \
+ "$OBJTOP"/$dirprfx$1/.depend.$2.* \
+ "$OBJTOP"/$dirprfx$1/$2.*o
+ fi
+ done
}
# Date Rev Description
@@ -113,7 +114,10 @@ if [ -e "$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o ] && \
egrep -qw "cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c" \
"$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o; then
echo "Removing old ZFS tree"
- run rm -rf "$OBJTOP"/cddl "$OBJTOP"/obj-lib32/cddl
+ for libcompat in "" $ALL_libcompats; do
+ dirprfx=${libcompat:+obj-lib${libcompat}/}
+ run rm -rf "$OBJTOP"/${dirprfx}cddl
+ done
fi
# 20200916 WARNS bumped, need bootstrapped crunchgen stubs
@@ -134,7 +138,10 @@ fi
# 20210108 821aa63a0940 non-widechar version of ncurses removed
if [ -e "$OBJTOP"/lib/ncurses/ncursesw ]; then
echo "Removing stale ncurses objects"
- run rm -rf "$OBJTOP"/lib/ncurses "$OBJTOP"/obj-lib32/lib/ncurses
+ for libcompat in "" $ALL_libcompats; do
+ dirprfx=${libcompat:+obj-lib${libcompat}/}
+ run rm -rf "$OBJTOP"/${dirprfx}lib/ncurses
+ done
fi
# 20210608 f20893853e8e move from atomic.S to atomic.c
@@ -183,10 +190,11 @@ clean_dep lib/libc kqueue1 S
# 20230623 b077aed33b7b OpenSSL 3.0 update
if [ -f "$OBJTOP"/secure/lib/libcrypto/aria.o ]; then
echo "Removing old OpenSSL 1.1.1 tree"
- run rm -rf "$OBJTOP"/secure/lib/libcrypto \
- "$OBJTOP"/secure/lib/libssl \
- "$OBJTOP"/obj-lib32/secure/lib/libcrypto \
- "$OBJTOP"/obj-lib32/secure/lib/libssl
+ for libcompat in "" $ALL_libcompats; do
+ dirprfx=${libcompat:+obj-lib${libcompat}/}
+ run rm -rf "$OBJTOP"/${dirprfx}secure/lib/libcrypto \
+ "$OBJTOP"/${dirprfx}secure/lib/libssl
+ done
fi
# 20230714 ee8b0c436d72 replace ffs/fls implementations with clang builtins