diff --git a/source/Makefile b/source/Makefile index 66b0921..b9e4e86 100644 --- a/source/Makefile +++ b/source/Makefile @@ -260,8 +260,8 @@ $(DESTDIR)$(sbindir)/%: bin/% installdirs uninstallbin:: uninstalllib:: - @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(SHARED_LIBS) - #@$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) $(STATIC_LIBS) + @$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) "$(SHLIBEXT)" $(SHARED_LIBS) + #@$(SHELL) $(srcdir)/script/uninstalllib.sh $(DESTDIR)$(libdir) "$(STLIBEXT)" $(STATIC_LIBS) uninstallheader:: @$(SHELL) $(srcdir)/script/uninstallheader.sh $(DESTDIR)$(includedir) $(PUBLIC_HEADERS) diff --git a/source/script/installlib.sh b/source/script/installlib.sh index 962c956..cc9ff0b 100755 --- a/source/script/installlib.sh +++ b/source/script/installlib.sh @@ -15,7 +15,9 @@ for p in $*; do mv $LIBDIR/$p2 $LIBDIR/$p2.old fi cp $p $LIBDIR/ - ln -sf $p2 $LIBDIR/$lnname + if [ $p2 != $lnname ]; then + ln -sf $p2 $LIBDIR/$lnname + fi done cat << EOF diff --git a/source/script/uninstalllib.sh b/source/script/uninstalllib.sh index 9c45b2c..f5ae395 100755 --- a/source/script/uninstalllib.sh +++ b/source/script/uninstalllib.sh @@ -3,6 +3,9 @@ # 4 July 96 Dan.Shearer@UniSA.edu.au LIBDIR=$1 +SHLIBEXT=$2 + +shift shift if [ ! -d $LIBDIR ]; then @@ -13,16 +16,19 @@ fi for p in $*; do p2=`basename $p` - if [ -f $LIBDIR/$p2 ]; then + lnname=`echo $p2 | sed -e "s/\.$SHLIBEXT.*/.$SHLIBEXT/"` + if [[ -f $LIBDIR/$p2 || -L $LIBDIR/$lnname ]]; then echo Removing $LIBDIR/$p2 rm -f $LIBDIR/$p2 if [ -f $LIBDIR/$p2 ]; then echo Cannot remove $LIBDIR/$p2 ... does $USER have privileges? fi + if [ -L $LIBDIR/$lnname ]; then + rm -f $LIBDIR/$lnname + fi fi done - cat << EOF ====================================================================== The shared libraries have been uninstalled. You may restore the libraries using