--- root/build/unix/makelib.sh	Fri Mar 28 16:09:38 2003
+++ root.new/build/unix/makelib.sh	Fri Mar 28 12:07:52 2003
@@ -26,6 +26,24 @@
 
 rm -f $LIB
 
+if [ $PLATFORM = "macosx" ]; then
+   # We need beside the shared library (.dylib) a bundle (.so) to load
+   LDFLAGS="`[ -d /sw/lib ] && echo -L/sw/lib` -ldl"
+   BUNDLE=`echo $LIB | sed s/.dylib/.so/`
+   if [ "x`echo $SOFLAGS | grep -- '-g'`" != "x" ]; then
+      opt=-g
+   else
+      opt=-O
+   fi
+   echo $LD $opt -bundle -flat_namespace -undefined suppress -o $BUNDLE \
+	$OBJS $LDFLAGS $EXTRA
+   $LD $opt -bundle -flat_namespace -undefined suppress -o $BUNDLE \
+	$OBJS $LDFLAGS $EXTRA
+   if [ "x$MAJOR" != "x" ]; then
+       EXTRA="${EXTRA} -compatibility_version ${MAJOR} -current_version ${MAJOR}.${MINOR}.${REVIS}"
+   fi
+fi
+
 if [ $PLATFORM = "aix" ]; then
    makeshared="/usr/ibmcxx/bin/makeC++SharedLib"
 fi
@@ -58,34 +76,17 @@
    $LD $SOFLAGS $LDFLAGS -o $LIB `lorder $OBJS | tsort -q` $EXTRA
    # for elf:  echo $PLATFORM: $LD $SOFLAGS$SONAME $LDFLAGS -o $LIB $OBJS
    # for elf:  $LD $SOFLAGS$SONAME $LDFLAGS -o $LIB `lorder $OBJS | tsort -q`
-elif [ $PLATFORM = "macosx" ]; then
-   # We need two library files: a .dylib to link to and a .so to load
-   BUNDLE=`echo $LIB | sed s/.dylib/.so/`
-   echo $LD $SOFLAGS$SONAME -o $LIB $OBJS \
-	`[ -d /sw/lib ] && echo -L/sw/lib` -ldl $EXTRA
-   $LD $SOFLAGS$SONAME -o $LIB $OBJS \
-	`[ -d /sw/lib ] && echo -L/sw/lib` -ldl $EXTRA
-   if [ "x`echo $SOFLAGS | grep -- '-g'`" != "x" ]; then
-      opt=-g
-   else
-      opt=-O
-   fi
-   echo $LD $opt -bundle -flat_namespace -undefined suppress -o $BUNDLE \
-	$OBJS `[ -d /sw/lib ] && echo -L/sw/lib` -ldl $EXTRA
-   $LD $opt -bundle -flat_namespace -undefined suppress -o $BUNDLE \
-	$OBJS `[ -d /sw/lib ] && echo -L/sw/lib` -ldl $EXTRA
 elif [ $LD = "KCC" ]; then
    echo $LD $LDFLAGS -o $LIB $OBJS $EXTRA
    $LD $LDFLAGS -o $LIB $OBJS $EXTRA
 else
-   if [ "x$MAJOR" = "x" ] ; then
-      echo $LD $SOFLAGS$SONAME $LDFLAGS -o $LIB $OBJS $EXTRA
-      $LD $SOFLAGS$SONAME $LDFLAGS -o $LIB $OBJS $EXTRA
-   else
-      echo $LD $SOFLAGS$SONAME.$MAJOR.$MINOR $LDFLAGS -o $LIB.$MAJOR.$MINOR $OBJS $EXTRA
-      $LD $SOFLAGS$SONAME.$MAJOR.$MINOR $LDFLAGS \
-         -o $LIB.$MAJOR.$MINOR $OBJS $EXTRA
+   if [ "x$MAJOR" != "x" ]; then
+     # add versioning information into shlibs name
+     SONAME=`echo $SONAME | sed "s/.*\./&${MAJOR}./"`
+     LIB=`echo $LIB | sed "s/\/*.*\/.*\./&${MAJOR}.${MINOR}./"`
    fi
+   echo $LD $SOFLAGS$SONAME $LDFLAGS -o $LIB $OBJS $EXTRA
+   $LD $SOFLAGS$SONAME $LDFLAGS -o $LIB $OBJS $EXTRA
 fi
 
 linkstat=$?
@@ -93,9 +94,9 @@
    exit $linkstat
 fi
 
-if [ "x$MAJOR" != "x" ] && [ -f $LIB.$MAJOR.$MINOR ]; then
-   ln -fs $SONAME.$MAJOR.$MINOR $LIB.$MAJOR
-   ln -fs $SONAME.$MAJOR        $LIB
+if [ "x$MAJOR" != "x" ] && [ -f $LIB ]; then
+   ln -fs `echo $SONAME | sed "s/.*\./&${MINOR}./"` `echo $LIB | sed "s/\.${MINOR}//"`
+   ln -fs $SONAME `echo $LIB | sed "s/\.${MAJOR}\.${MINOR}//"`
 fi
 
 if [ $PLATFORM = "hpux" ]; then
--- root/Makefile	Fri Mar 28 16:09:35 2003
+++ root.new/Makefile	Fri Mar 28 11:33:43 2003
@@ -458,11 +458,13 @@
 	   $(INSTALL) $(ALLEXECS)               $(DESTDIR)$(BINDIR); \
 	   echo "Installing libraries in $(DESTDIR)$(LIBDIR)"; \
 	   $(INSTALLDIR)                        $(DESTDIR)$(LIBDIR); \
-	   vers=`sed 's|\(.*\)\..*/.*|\1|' < build/version_number` ; \
+	   major=`sed 's|\(.*\)\.\(.*\)/.*|\1|' < build/version_number` ; \
+	   minor=`sed 's|\(.*\)\.\(.*\)/.*|\2|' < build/version_number` ; \
 	   for lib in $(ALLLIBS) $(CINTLIB); do \
 	      rm -f $(DESTDIR)$(LIBDIR)/`basename $$lib` ; \
-	      rm -f $(DESTDIR)$(LIBDIR)/`basename $$lib`.$$vers ; \
-	      $(INSTALL) $$lib*                 $(DESTDIR)$(LIBDIR); \
+	      rm -f $(DESTDIR)$(LIBDIR)/`basename $$lib $(SOEXT)`$$major.$(SOEXT) ; \
+	      rm -f $(DESTDIR)$(LIBDIR)/`basename $$lib $(SOEXT)`$$major.$$minor.$(SOEXT) ; \
+	      $(INSTALL) `echo $$lib | sed "s/$(SOEXT)//"`* $(DESTDIR)$(LIBDIR); \
 	   done ; \
 	   echo "Installing headers in $(DESTDIR)$(INCDIR)"; \
 	   $(INSTALLDIR)                        $(DESTDIR)$(INCDIR); \
@@ -551,8 +553,12 @@
 	      test "x`ls $(DESTDIR)$(BINDIR)`" = "x" ; then \
 	      rm -rf $(DESTDIR)$(BINDIR); \
 	   fi ; \
-	   for lib in $(ALLLIBS) $(CINTLIB); do \
-	      rm -f $(DESTDIR)$(LIBDIR)/`basename $$lib`* ; \
+	   major=`sed 's|\(.*\)\.\(.*\)/.*|\1|' < build/version_number` ; \
+	   minor=`sed 's|\(.*\)\.\(.*\)/.*|\2|' < build/version_number` ; \
+           for lib in $(ALLLIBS) $(CINTLIB); do \
+	      rm -f $(DESTDIR)$(LIBDIR)/`basename $$lib` ; \
+	      rm -f $(DESTDIR)$(LIBDIR)/`basename $$lib $(SOEXT)`$$major.$(SOEXT) ; \
+	      rm -f $(DESTDIR)$(LIBDIR)/`basename $$lib $(SOEXT)`$$major.$$minor.$(SOEXT) ; \
 	   done ; \
 	   if test -d $(DESTDIR)$(LIBDIR) && \
 	      test "x`ls $(DESTDIR)$(LIBDIR)`" = "x" ; then \
