From 67f0d0ed735afb10c651c70a3770226aa8166a90 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 13 Dec 2020 00:44:24 -0800 Subject: [PATCH] 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 02c5f500090261947b3e9a65dafff83a71edb17b) --- tools/macos-setup.sh | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/tools/macos-setup.sh b/tools/macos-setup.sh index cc8183c646..55179f1915 100755 --- a/tools/macos-setup.sh +++ b/tools/macos-setup.sh @@ -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