Re: [AD] sonames

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


#include <hallo.h>
Thomas Fjellstrom wrote on Tue Oct 16, 2001 um 06:36:15PM:
> On October 16, 2001 05:57 pm, you wrote:
> > Non-Unix people can skip this.
> >
> > Now that the next WIP is going to be beta, we should actually have
> > sonames for our libs :-) I'm thinking of the following simple system:
> >
> > `liballegro.so.39' for the remainder of the 3.9.x series (just one!)

Not good, SONAME stands for binary compatibility. Since we cannot
guarantee it in WIP releases, SONAME must change.

> > `liballegro.so.40' for the entire 4.0.x series
> > etc.

Oh, I guess I did not send my Debian modifications to upstream, tsts. I
used a simple hack to map the $(major_release) number to the soname, and
this works fine since 3.9.35 or so. See attachment.
Oh, and I modified umodules.c to read modules from a uniq
directory.  Doing this way, it is possible to install multiple
versions of the library at the same time and applications use the right
library and modules, without needing to recompile them each time or
compiling staticaly just because the ABI may break again.

> > The high numbers seem to be unconventional, but that's about it.
> > What have the Debian packages been using?
> 
> should it not look a little more like:
> 
> liballegro.so.3.9.39

That is an apropriate lib name for SONAME=3, MINOR=9.39. ldconfig would
symlink it to liballegro.so.3 and the applications would use this
library. When 3.9.40 gets major changes and is no longer compatible,
ldconfig would still think it is a newer version of liballegro.so.3 and
symlink 3.9.40 to it. When the application loads -> *BANG*.

> liballegro.so.4.0.0
> liballegro.so.4.0.1

And that for SONAME=4, MINOR=0.x

> liballegro.so    -> link to newest major ver (liballegro.so.3/4)

That symlink should (must?) point to the shared library created in the
same build as liballeg.a. Debian policy requires it, I do not remember
for which reason exactly, but it better to do it this way.

> liballegro.so.3 -> link to newest release in the 3.*

Not a good idea because of compatibility, see above.

> liballegro.so.4 -> link to newest stable release in the 4.*

Why not. Stable is stable, and when the API/ABI do not break
compatibility, the SONAME does not have to be changed.

Gruss/Regards,
Eduard.
-- 
'Und dann muß man den Computer herunterladen, sonst stürzt er ab.'
                                                 (Harald Schmidt)
--- allegro3938-3938.orig/src/unix/umodules.c
+++ allegro3938-3938/src/unix/umodules.c
@@ -42,7 +42,7 @@
 /* where to look for modules.lst */
 static char *module_path[] =
 {
-   "/usr/local/lib/allegro/", "/usr/lib/allegro/", NULL
+   "/usr/lib/allegro3938/", "/usr/local/lib/allegro/", "/usr/lib/allegro/", NULL
 };
 
--- allegro3938-3938.orig/misc/deplib.sh
+++ allegro3938-3938/misc/deplib.sh
@@ -23,7 +23,7 @@
     echo "\$(LIBDIR)/${sharelib}: ${shareobj}"
     echo "	rm -f \$@"
     # gf: This bit is obviously gcc-specific
-    echo "	gcc -shared -o \$@ ${shareobj} \$(LDFLAGS) \$(LIBS)"
+    echo "	gcc -shared -o \$@ ${shareobj} \$(LDFLAGS) -Wl,-soname,liballeg-\$(shared_version).so.\$(shared_major) \$(LIBS)"
     echo ""
     echo "\$(LIBDIR)/${unsharelib}: ${unshareobj}"
     echo "	rm -f \$@"
@@ -186,15 +186,15 @@
     # Normal library.
     echo "\$(OBJDIR)/alleg/$name\$(OBJ): \$(srcdir)/$file$includes"
     if test "$ext" = "c"; then
-      echo "	\$(COMPILE_NORMAL) -c \$(srcdir)/$file -o \$(OBJDIR)/alleg/$name\$(OBJ)"
+      echo "	\$(COMPILE_NORMAL)  \$(ALLEGRO_SHAREDLIB_CFLAGS) -c \$(srcdir)/$file -o \$(OBJDIR)/alleg/$name\$(OBJ)"
     else
-      echo "	\$(COMPILE_S_NORMAL) -c \$(srcdir)/$file -o \$(OBJDIR)/alleg/$name\$(OBJ)"
+      echo "	\$(COMPILE_S_NORMAL) \$(ALLEGRO_SHAREDLIB_CFLAGS) -c \$(srcdir)/$file -o \$(OBJDIR)/alleg/$name\$(OBJ)"
     fi
     echo "\$(OBJDIR)/shared/alleg/$name\$(OBJ): \$(srcdir)/$file$includes"
     if test "$ext" = "c"; then
       echo "	\$(COMPILE_NORMAL) \$(ALLEGRO_SHAREDLIB_CFLAGS) -c \$(srcdir)/$file -o \$(OBJDIR)/shared/alleg/$name\$(OBJ)"
     else
-      echo "	\$(COMPILE_S_NORMAL) -c \$(srcdir)/$file -o \$(OBJDIR)/shared/alleg/$name\$(OBJ)"
+      echo "	\$(COMPILE_S_NORMAL) \$(ALLEGRO_SHAREDLIB_CFLAGS) -c \$(srcdir)/$file -o \$(OBJDIR)/shared/alleg/$name\$(OBJ)"
     fi
     echo ""


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/