macos-setup: clean up uninstallation of snappy.

For a CMake build done in a subdirectory of the source directory, the
equivalent of "make distclean" is "rm -rf {that subdirectory}".  Make it
so.

When uninstalling the stuff snappy installs with "rm -rf", use $DO_RM,
so it's done with sudo iff /usr/local isn't writable by us, just as
"make uninstall" is done with $DO_MAKE_UNINSTALL so it's done with sudo
iff /usr/local isn't writable by us.

Fix up the list of what to remove, now that we're building snappy as a
shared library, so that it removes shared libraries rather than the
non-existent static library.

Update a comment while we're at it, as Lua isn't the only dependency
that doesn't support "make uninstall".


(cherry picked from commit 7d01e3a74e)
This commit is contained in:
Guy Harris 2020-12-13 07:47:27 +00:00
parent dec868cb42
commit 303ee87fd2
1 changed files with 15 additions and 13 deletions

View File

@ -1383,22 +1383,24 @@ uninstall_snappy() {
cd snappy-$installed_snappy_version
#
# snappy uses cmake and doesn't support "make uninstall" or
# "make distclean"
# "make distclean". For "make uninstall, we just remove
# what we know it installs; for "make disclean", we just
# remove the entire build directory.
#
# $DO_MAKE_UNINSTALL || exit 1
# make distclean || exit 1
cd build_dir
make clean || exit 1
cd ..
sudo rm -f /usr/local/lib/libsnappy.a \
/usr/local/include/snappy-c.h \
/usr/local/include/snappy-sinksource.h \
/usr/local/include/snappy.h \
/usr/local/include/snappy-stubs-public.h \
/usr/local/lib/cmake/Snappy/SnappyTargets.cmake \
/usr/local/lib/cmake/Snappy/SnappyTargets-noconfig.cmake \
/usr/local/lib/cmake/Snappy/SnappyConfig.cmake \
/usr/local/lib/cmake/Snappy/SnappyConfigVersion.cmake
rm -rf build_dir || exit 1
$DO_RM -f /usr/local/lib/libsnappy.1.1.8.dylib \
/usr/local/lib/libsnappy.1.dylib \
/usr/local/lib/libsnappy.dylib \
/usr/local/include/snappy-c.h \
/usr/local/include/snappy-sinksource.h \
/usr/local/include/snappy-stubs-public.h \
/usr/local/include/snappy.h \
/usr/local/lib/cmake/Snappy/SnappyConfig.cmake \
/usr/local/lib/cmake/Snappy/SnappyConfigVersion.cmake \
/usr/local/lib/cmake/Snappy/SnappyTargets-noconfig.cmake \
/usr/local/lib/cmake/Snappy/SnappyTargets.cmake || exit 1
cd ..
rm snappy-$installed_snappy_version-done