.so versions for libraries
Alan Coopersmith
Alan.Coopersmith at Sun.COM
Sat Jul 16 03:16:35 EST 2005
As promised earlier, an example for the library so revisions.
I chose libXext mainly because it builds faster than libX11,
but has different revs on different platforms already.
The following diffs seem to do the right thing on Solaris.
For OpenBSD, I chose to be lazy and only set the version listed
for OpenBSD 3.1.6 and later. I don't know if the older versions
are still in widespread enough use to include here, if so it would
simply be another case or if statement inside the OpenBSD block.
A general guide for other libraries, using Xext as an example:
- Look in the monolith xc/lib/<library>/Imakefile for what
SoRev is defined to be, for instance:
#define SoRev SOXEXTREV
- Look in xc/config/cf/X11.tmpl for a line mapping the SoRev
definition to a Shared<libname>Rev defintion, such as:
SharedLibReferences(EXTENSION,Xext,$(XEXTLIBSRC),SOXEXTREV,SharedXextRev)
- Look in each xc/config/cf/*Lib.tmpl for what Shared<libname>Rev is
defined to on each OS, and X11.tmpl for the default rev:
OpenBSDLib.tmpl:# ifndef SharedXextRev
OpenBSDLib.tmpl:# define SharedXextRev 7.0
OpenBSDLib.tmpl:# ifndef SharedXextRev
OpenBSDLib.tmpl:# define SharedXextRev 8.0
README: SharedXextRev version number for libXext.so
X11.tmpl:#ifndef SharedXextRev
X11.tmpl:#define SharedXextRev 6.4
necLib.tmpl:#ifndef SharedXextRev
necLib.tmpl:#define SharedXextRev 4.10
os2Lib.tmpl:#define SharedXextRev /**/
sunLib.tmpl:#ifndef SharedXextRev
sunLib.tmpl:#define SharedXextRev 4.50
sunLib.tmpl:#ifndef SharedXextRev
sunLib.tmpl:# define SharedXextRev 0
sv3Lib.tmpl:#ifndef SharedXextRev
sv3Lib.tmpl:#define SharedXextRev 6.0
As you can see, for now I've ignored NEC, OS/2, and SysVR3, and only chose
the recent OpenBSD version and the Solaris version (i.e. not
OSMajorVersion <= 4 in sunLib.tmpl). These could be added later, but I don't
think are required for RC0. I also preserved the 6.4.1 version as default
that was previously specified in the Makefile.am, instead of the 6.4 that's in
the monolith, since we weren't sure in our earlier discussions if any
platforms treat anything but the major number as significant.
diff -u -r1.3 configure.ac
--- configure.ac 19 May 2005 00:22:32 -0000 1.3
+++ configure.ac 15 Jul 2005 16:57:15 -0000
@@ -14,6 +14,16 @@
AM_CONFIG_HEADER([config.h])
+# Determine .so library version per platform
+# based on SharedXextRev in monolith xc/config/cf/*Lib.tmpl
+AC_CANONICAL_HOST
+case $host_os in
+ openbsd*) XEXT_SOREV=8:0 ;;
+ solaris*) XEXT_SOREV=0 ;;
+ *) XEXT_SOREV=6:4:1 ;;
+esac
+AC_SUBST(XEXT_SOREV)
+
# Checks for programs.
AC_PROG_LIBTOOL
AC_PROG_CC
cvs diff: Diffing man
cvs diff: Diffing src
Index: src/Makefile.am
===================================================================
RCS file: /cvs/xorg/lib/Xext/src/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- src/Makefile.am 9 Jul 2005 06:17:03 -0000 1.2
+++ src/Makefile.am 15 Jul 2005 16:57:15 -0000
@@ -2,7 +2,7 @@
AM_CFLAGS=$(XEXT_CFLAGS)
-libXext_la_LDFLAGS = -version-number 6:4:1 -no-undefined
+libXext_la_LDFLAGS = -version-number $(XEXT_SOREV) -no-undefined
libXext_la_LIBADD = $(XEXT_LIBS)
--
-Alan Coopersmith- alan.coopersmith at sun.com
Sun Microsystems, Inc. - X Window System Engineering
More information about the xorg-modular
mailing list