macos-setup: more cleanups.

Fix/update/expand some comments.

Do uninstalls for dependencies using CMake more similarly.

For LZ4, as it comes with a Makefile rather than any
autotools/CMake/etc. configuration, "make distclean" might not be
necessary, so, as it's not supported, just do "make clean".

For libssh, do all removes in the uninstall in a single command, and use
$DO_RM, so that it uses sudo iff /usr/local isn't writable by us.  In
addition, remove the build directory as the equivalent of "make
distclean".

As with libssh, so with brotli.

(backported from commit 02c5f50009)
This commit is contained in:
Guy Harris 2020-12-13 00:44:24 -08:00
parent 6b950fe6f0
commit 67f0d0ed73
1 changed files with 24 additions and 14 deletions

View File

@ -60,7 +60,8 @@ XZ_VERSION=5.2.3
LZIP_VERSION=1.19
#
# CMake is required to do the build.
# CMake is required to do the build - and to build some of the
# dependencies.
#
# Sigh. CMake versions 3.7 and later fail on Lion due to issues with
# Lion's libc++, and CMake 3.5 and 3.6 have an annoying "Make sure the
@ -1372,9 +1373,12 @@ uninstall_lz4() {
cd lz4-$installed_lz4_version
$DO_MAKE_UNINSTALL || exit 1
#
# lz4 uses cmake and doesn't support "make distclean"
# lz4's Makefile doesn't support "make distclean"; just do
# "make clean". Perhaps not using autotools means that
# there's no need for "make distclean".
#
# make distclean || exit 1
make clean || exit 1
cd ..
rm lz4-$installed_lz4_version-done
@ -1529,17 +1533,20 @@ uninstall_libssh() {
echo "Uninstalling libssh:"
cd libssh-$installed_libssh_version
#
# libssh uses cmake and doesn't support "make uninstall"
# libssh uses cmake and doesn't support "make uninstall";
# just remove what we know it installs.
#
# $DO_MAKE_UNINSTALL || exit 1
sudo rm -rf /usr/local/lib/libssh*
sudo rm -rf /usr/local/include/libssh
sudo rm -rf /usr/local/lib/pkgconfig/libssh*
sudo rm -rf /usr/local/lib/cmake/libssh
$DO_RM -rf /usr/local/lib/libssh* \
/usr/local/include/libssh \
/usr/local/lib/pkgconfig/libssh* \
/usr/local/lib/cmake/libssh || exit 1
#
# libssh uses cmake and doesn't support "make distclean"
# libssh uses cmake and doesn't support "make distclean";
# just remove the entire build directory.
#
# make distclean || exit 1
rm -rf build || exit 1
cd ..
rm libssh-$installed_libssh_version-done
@ -1885,17 +1892,20 @@ uninstall_brotli() {
echo "Uninstalling brotli:"
cd brotli-$installed_brotli_version
#
# brotli uses cmake on macOS and doesn't support "make uninstall"
# brotli uses cmake on macOS and doesn't support "make uninstall";
# just remove what we know it installs.
#
# $DO_MAKE_UNINSTALL || exit 1
sudo rm -rf /usr/local/bin/brotli
sudo rm -rf /usr/local/lib/libbrotli*
sudo rm -rf /usr/local/include/brotli
sudo rm -rf /usr/local/lib/pkgconfig/libbrotli*
$DO_RM -rf /usr/local/bin/brotli \
/usr/local/lib/libbrotli* \
/usr/local/include/brotli \
/usr/local/lib/pkgconfig/libbrotli* || exit 1
#
# brotli uses cmake on macOS and doesn't support "make distclean"
# brotli uses cmake on macOS and doesn't support "make distclean";
# just remove the enire build directory.
#
# make distclean || exit 1
rm -rf build_dir || exit 1
cd ..
rm brotli-$installed_brotli_version-done