depend-cleanup.sh: Generalise lib32 code and avoid duplication
By passing through _ALL_libcompats we can avoid hard-coding the list of libcompats in depend-cleanup.sh. This cleanup also makes clean_dep shorter by using a loop instead of handling each case explicitly (at the expense of slightly tweaked logging). Reviewed by: brooks, jhb Differential Revision: https://reviews.freebsd.org/D41187
This commit is contained in:
parent
64140bb529
commit
81805ec300
@ -1026,6 +1026,7 @@ _sanity_check: .PHONY .MAKE
|
|||||||
_cleanobj_fast_depend_hack: .PHONY
|
_cleanobj_fast_depend_hack: .PHONY
|
||||||
@echo ">>> Deleting stale dependencies...";
|
@echo ">>> Deleting stale dependencies...";
|
||||||
MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} \
|
MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} \
|
||||||
|
ALL_libcompats=${_ALL_libcompats:Q} \
|
||||||
sh ${.CURDIR}/tools/build/depend-cleanup.sh ${OBJTOP}
|
sh ${.CURDIR}/tools/build/depend-cleanup.sh ${OBJTOP}
|
||||||
|
|
||||||
_worldtmp: .PHONY
|
_worldtmp: .PHONY
|
||||||
|
@ -73,6 +73,10 @@ if [ -z "${MACHINE_ARCH+set}" ]; then
|
|||||||
err "MACHINE_ARCH not set"
|
err "MACHINE_ARCH not set"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "${ALL_libcompats+set}" ]; then
|
||||||
|
err "ALL_libcompats not set"
|
||||||
|
fi
|
||||||
|
|
||||||
run()
|
run()
|
||||||
{
|
{
|
||||||
if [ "$VERBOSE" ]; then
|
if [ "$VERBOSE" ]; then
|
||||||
@ -88,18 +92,15 @@ run()
|
|||||||
# $3 source extension
|
# $3 source extension
|
||||||
clean_dep()
|
clean_dep()
|
||||||
{
|
{
|
||||||
if egrep -qw "$2\.$3" "$OBJTOP"/$1/.depend.$2.*o 2>/dev/null; then
|
for libcompat in "" $ALL_libcompats; do
|
||||||
echo "Removing stale dependencies and objects for $2.$3"
|
dirprfx=${libcompat:+obj-lib${libcompat}/}
|
||||||
run rm -f \
|
if egrep -qw "$2\.$3" "$OBJTOP"/$dirprfx$1/.depend.$2.*o 2>/dev/null; then
|
||||||
"$OBJTOP"/$1/.depend.$2.* \
|
echo "Removing stale ${libcompat:+lib${libcompat} }dependencies and objects for $2.$3"
|
||||||
"$OBJTOP"/$1/$2.*o
|
run rm -f \
|
||||||
fi
|
"$OBJTOP"/$dirprfx$1/.depend.$2.* \
|
||||||
if egrep -qw "$2\.$3" "$OBJTOP"/obj-lib32/$1/.depend.$2.*o 2>/dev/null; then
|
"$OBJTOP"/$dirprfx$1/$2.*o
|
||||||
echo "Removing 32-bit stale dependencies and objects for $2.$3"
|
fi
|
||||||
run rm -f \
|
done
|
||||||
"$OBJTOP"/obj-lib32/$1/.depend.$2.* \
|
|
||||||
"$OBJTOP"/obj-lib32/$1/$2.*o
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Date Rev Description
|
# 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" \
|
egrep -qw "cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c" \
|
||||||
"$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o; then
|
"$OBJTOP"/cddl/lib/libzfs/.depend.libzfs_changelist.o; then
|
||||||
echo "Removing old ZFS tree"
|
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
|
fi
|
||||||
|
|
||||||
# 20200916 WARNS bumped, need bootstrapped crunchgen stubs
|
# 20200916 WARNS bumped, need bootstrapped crunchgen stubs
|
||||||
@ -134,7 +138,10 @@ fi
|
|||||||
# 20210108 821aa63a0940 non-widechar version of ncurses removed
|
# 20210108 821aa63a0940 non-widechar version of ncurses removed
|
||||||
if [ -e "$OBJTOP"/lib/ncurses/ncursesw ]; then
|
if [ -e "$OBJTOP"/lib/ncurses/ncursesw ]; then
|
||||||
echo "Removing stale ncurses objects"
|
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
|
fi
|
||||||
|
|
||||||
# 20210608 f20893853e8e move from atomic.S to atomic.c
|
# 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
|
# 20230623 b077aed33b7b OpenSSL 3.0 update
|
||||||
if [ -f "$OBJTOP"/secure/lib/libcrypto/aria.o ]; then
|
if [ -f "$OBJTOP"/secure/lib/libcrypto/aria.o ]; then
|
||||||
echo "Removing old OpenSSL 1.1.1 tree"
|
echo "Removing old OpenSSL 1.1.1 tree"
|
||||||
run rm -rf "$OBJTOP"/secure/lib/libcrypto \
|
for libcompat in "" $ALL_libcompats; do
|
||||||
"$OBJTOP"/secure/lib/libssl \
|
dirprfx=${libcompat:+obj-lib${libcompat}/}
|
||||||
"$OBJTOP"/obj-lib32/secure/lib/libcrypto \
|
run rm -rf "$OBJTOP"/${dirprfx}secure/lib/libcrypto \
|
||||||
"$OBJTOP"/obj-lib32/secure/lib/libssl
|
"$OBJTOP"/${dirprfx}secure/lib/libssl
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 20230714 ee8b0c436d72 replace ffs/fls implementations with clang builtins
|
# 20230714 ee8b0c436d72 replace ffs/fls implementations with clang builtins
|
||||||
|
Loading…
Reference in New Issue
Block a user