diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-09-25 23:05:20 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-09-26 06:06:25 +0000 |
commit | 92a0cb85f350d547b0816e1bdaee131768390d00 (patch) | |
tree | 4fbee111baee998bd56df19ab8b05c0f99e4fffe /macosx-setup.sh | |
parent | 82d1a85ad28773a5f591bfa80d04fd0c2267e420 (diff) |
Renaming libtool* to glibtool* might require root permission.
Define DO_MV as "mv" or "sudo mv", depending on whether the user has
write access to /usr/local/bin, and use it to rename libtool* to
glibtool* and vice versa.
Change-Id: Ifbef4daa4521852bc200522743df9d23e7f0d1c2
Reviewed-on: https://code.wireshark.org/review/4295
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'macosx-setup.sh')
-rwxr-xr-x | macosx-setup.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/macosx-setup.sh b/macosx-setup.sh index 9beff19be2..8e75650fff 100755 --- a/macosx-setup.sh +++ b/macosx-setup.sh @@ -378,8 +378,8 @@ uninstall() { if [ ! -z "$installed_libtool_version" ] ; then echo "Uninstalling GNU libtool:" cd libtool-$installed_libtool_version - mv /usr/local/bin/glibtool /usr/local/bin/libtool - mv /usr/local/bin/glibtoolize /usr/local/bin/libtoolize + $DO_MV /usr/local/bin/glibtool /usr/local/bin/libtool + $DO_MV /usr/local/bin/glibtoolize /usr/local/bin/libtoolize $DO_MAKE_UNINSTALL || exit 1 make distclean || exit 1 cd .. @@ -433,10 +433,12 @@ then DO_MAKE_INSTALL="make install" DO_MAKE_UNINSTALL="make uninstall" DO_RM="rm" + DO_MV="mv" else DO_MAKE_INSTALL="sudo make install" DO_MAKE_UNINSTALL="sudo make uninstall" DO_RM="sudo rm" + DO_MV="sudo mv" fi # @@ -778,8 +780,8 @@ if [ "$LIBTOOL_VERSION" -a ! -f libtool-$LIBTOOL_VERSION-done ] ; then ./configure || exit 1 make $MAKE_BUILD_OPTS || exit 1 $DO_MAKE_INSTALL || exit 1 - mv /usr/local/bin/libtool /usr/local/bin/glibtool - mv /usr/local/bin/libtoolize /usr/local/bin/glibtoolize + $DO_MV /usr/local/bin/libtool /usr/local/bin/glibtool + $DO_MV /usr/local/bin/libtoolize /usr/local/bin/glibtoolize cd .. touch libtool-$LIBTOOL_VERSION-done fi |