build: set SONAME version of libraries from configure, not using library-versions
authorMichael Adam <obnox@samba.org>
Mon, 7 Jul 2008 15:35:08 +0000 (17:35 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 18 Aug 2008 13:01:31 +0000 (15:01 +0200)
This sets the library versions (previously gotten from library-versions
file during make) already at configure time.

For library "foo", the version is stored in the LIBFOO_SOVER configure
variable.  For all libraries except libwbclient, this is done through the
call of SMB_LIBRARY().

NOTE: Currently the versions are hard-coded in the SMB_LIBRARY() calls in
configure.in, but this change makes it easier to retrieve the version from
the libraries source dir at configure time, e.g. for talloc and tdb.

Michael
(cherry picked from commit 3c300f9f8cffb5af32e291ec75007ab98fe96561)
(cherry picked from commit 6a6b90f4c56f040d19c60122c914b7a7ce64a3c6)

source/Makefile.in
source/configure.in

index 50e24c9572b99633ba643ee99f6dcdf8bbdb7ee9..98038b38a3ad36bc44762a90fe9ccab1a7601210 100644 (file)
@@ -1532,7 +1532,7 @@ LIBTALLOC_OBJ0 = $(TALLOC_OBJ)
 LIBTALLOC_OBJ = $(LIBTALLOC_OBJ0) $(LIBREPLACE_OBJ)
 
 LIBTALLOC_SHARED_TARGET=@LIBTALLOC_SHARED_TARGET@
-LIBTALLOC_SOVER=$(shell grep \^$(LIBTALLOC_SHARED_TARGET) $(builddir)/library-versions | cut -d: -f2)
+LIBTALLOC_SOVER=@LIBTALLOC_SOVER@
 LIBTALLOC_SHARED_TARGET_SONAME=$(LIBTALLOC_SHARED_TARGET).$(LIBTALLOC_SOVER)
 LIBTALLOC_STATIC_TARGET=@LIBTALLOC_STATIC_TARGET@
 LIBTALLOC=$(LIBTALLOC_STATIC_TARGET) @LIBTALLOC_SHARED@
@@ -1592,7 +1592,7 @@ LIBTDB_OBJ0 = @TDB_OBJS@
 LIBTDB_OBJ = $(LIBTDB_OBJ0) $(LIBREPLACE_OBJ)
 
 LIBTDB_SHARED_TARGET=@LIBTDB_SHARED_TARGET@
-LIBTDB_SOVER=$(shell grep \^$(LIBTDB_SHARED_TARGET) $(builddir)/library-versions | cut -d: -f2)
+LIBTDB_SOVER=@LIBTDB_SOVER@
 LIBTDB_SHARED_TARGET_SONAME=$(LIBTDB_SHARED_TARGET).$(LIBTDB_SOVER)
 LIBTDB_STATIC_TARGET=@LIBTDB_STATIC_TARGET@
 LIBTDB=$(LIBTDB_STATIC_TARGET) @LIBTDB_SHARED@
@@ -1661,7 +1661,7 @@ LIBWBCLIENT_OBJ = $(LIBWBCLIENT_OBJ0) \
                  @LIBTALLOC_STATIC@ $(LIBREPLACE_OBJ)
 
 LIBWBCLIENT_SHARED_TARGET=@LIBWBCLIENT_SHARED_TARGET@
-LIBWBCLIENT_SOVER=$(shell grep \^$(LIBWBCLIENT_SHARED_TARGET) $(builddir)/library-versions | cut -d: -f2)
+LIBWBCLIENT_SOVER=@LIBWBCLIENT_SOVER@
 LIBWBCLIENT_SHARED_TARGET_SONAME=$(LIBWBCLIENT_SHARED_TARGET).$(LIBWBCLIENT_SOVER)
 LIBWBCLIENT_STATIC_TARGET=@LIBWBCLIENT_STATIC_TARGET@
 LIBWBCLIENT=@LIBWBCLIENT_STATIC@ @LIBWBCLIENT_SHARED@
@@ -1719,7 +1719,7 @@ uninstalllibwbclient::
 LIBADDNS_OBJ = $(LIBADDNS_OBJ0) @LIBTALLOC_STATIC@
 
 LIBADDNS_SHARED_TARGET=@LIBADDNS_SHARED_TARGET@
-LIBADDNS_SOVER=$(shell grep \^$(LIBADDNS_SHARED_TARGET) $(builddir)/library-versions | cut -d: -f2)
+LIBADDNS_SOVER=@LIBADDNS_SOVER@
 LIBADDNS_SHARED_TARGET_SONAME=$(LIBADDNS_SHARED_TARGET).$(LIBADDNS_SOVER)
 LIBADDNS_STATIC_TARGET=@LIBADDNS_STATIC_TARGET@
 LIBADDNS=$(LIBADDNS_STATIC_TARGET) @LIBADDNS_SHARED@
@@ -1789,7 +1789,7 @@ LIBNETAPI_OBJ  = $(LIBNETAPI_OBJ1) $(LIBNET_OBJ) \
                 $(DCUTIL_OBJ) $(LIBADS_OBJ) $(PRIVILEGES_BASIC_OBJ)
 
 LIBNETAPI_SHARED_TARGET=@LIBNETAPI_SHARED_TARGET@
-LIBNETAPI_SOVER=$(shell grep \^$(LIBNETAPI_SHARED_TARGET) $(builddir)/library-versions | cut -d: -f2)
+LIBNETAPI_SOVER=@LIBNETAPI_SOVER@
 LIBNETAPI_SHARED_TARGET_SONAME=$(LIBNETAPI_SHARED_TARGET).$(LIBNETAPI_SOVER)
 LIBNETAPI_STATIC_TARGET=@LIBNETAPI_STATIC_TARGET@
 LIBNETAPI=$(LIBNETAPI_STATIC_TARGET) @LIBNETAPI_SHARED@
@@ -1869,7 +1869,7 @@ LIBSMBCLIENT_OBJ0 = \
 LIBSMBCLIENT_OBJ = $(LIBSMBCLIENT_OBJ0) @LIBWBCLIENT_STATIC@
 
 LIBSMBCLIENT_SHARED_TARGET=@LIBSMBCLIENT_SHARED_TARGET@
-LIBSMBCLIENT_SOVER=$(shell grep \^$(LIBSMBCLIENT_SHARED_TARGET) $(builddir)/library-versions | cut -d: -f2)
+LIBSMBCLIENT_SOVER=@LIBSMBCLIENT_SOVER@
 LIBSMBCLIENT_SHARED_TARGET_SONAME=$(LIBSMBCLIENT_SHARED_TARGET).$(LIBSMBCLIENT_SOVER)
 LIBSMBCLIENT_STATIC_TARGET=@LIBSMBCLIENT_STATIC_TARGET@
 LIBSMBCLIENT=$(LIBSMBCLIENT_STATIC_TARGET) @LIBSMBCLIENT_SHARED@
@@ -1931,7 +1931,7 @@ uninstallclientlib:: uninstalllibsmbclient
 LIBSMBSHAREMODES_OBJ = libsmb/smb_share_modes.o @LIBTDB_STATIC@
 
 LIBSMBSHAREMODES_SHARED_TARGET=@LIBSMBSHAREMODES_SHARED_TARGET@
-LIBSMBSHAREMODES_SOVER=$(shell grep \^$(LIBSMBSHAREMODES_SHARED_TARGET) $(builddir)/library-versions | cut -d: -f2)
+LIBSMBSHAREMODES_SOVER=@LIBSMBSHAREMODES_SOVER@
 LIBSMBSHAREMODES_SHARED_TARGET_SONAME=$(LIBSMBSHAREMODES_SHARED_TARGET).$(LIBSMBSHAREMODES_SOVER)
 LIBSMBSHAREMODES_STATIC_TARGET=@LIBSMBSHAREMODES_STATIC_TARGET@
 LIBSMBSHAREMODES=$(LIBSMBSHAREMODES_STATIC_TARGET) @LIBSMBSHAREMODES_SHARED@
index fe3f51f0cd92994f1917a0ed7efcf19c063f5109..50c7ceb34a8e4aa1fbdc8193aa09b52fa0bb7a0b 100644 (file)
@@ -86,6 +86,7 @@ AC_SUBST(LIBWBCLIENT_SHARED_TARGET)
 AC_SUBST(LIBWBCLIENT_SHARED)
 AC_SUBST(LIBWBCLIENT_STATIC_TARGET)
 AC_SUBST(LIBWBCLIENT_STATIC)
+AC_SUBST(LIBWBCLIENT_SOVER)
 AC_SUBST(LIBWBCLIENT)
 AC_SUBST(WINBIND_LIBS)
 
@@ -4660,12 +4661,19 @@ LINK_LIBNETAPI=STATIC
 
 LINK_LIBSMBCLIENT=STATIC
 
-SMB_LIBRARY(talloc)
-SMB_LIBRARY(tdb)
-SMB_LIBRARY(netapi)
-SMB_LIBRARY(smbclient)
-SMB_LIBRARY(smbsharemodes)
-SMB_LIBRARY(addns, no, [undefined API])
+#
+#  The library versions are hardcoded here
+#  and filled into the LIBFOO_SOVER variable.
+#
+#  TODO: for talloc and tdb (at least), these should
+#  be extracted from their respective source directories
+#
+SMB_LIBRARY(talloc, 1)
+SMB_LIBRARY(tdb, 1)
+SMB_LIBRARY(netapi, 0)
+SMB_LIBRARY(smbclient, 0)
+SMB_LIBRARY(smbsharemodes, 0)
+SMB_LIBRARY(addns, 0, no, [undefined API])
 
 
 
@@ -5602,6 +5610,7 @@ fi
 
 LIBWBCLIENT_SHARED_TARGET=bin/libwbclient.$SHLIBEXT
 LIBWBCLIENT_STATIC_TARGET=bin/libwbclient.a
+LIBWBCLIENT_SOVER=0
 if test $BLDSHARED = true -a x"$HAVE_WINBIND" = x"yes" -a x"$BUILD_LIBWBCLIENT_SHARED" = x"yes"; then
        NSS_MODULES="${WINBIND_NSS} ${WINBIND_WINS_NSS}"
        ## Only worry about libwbclient if we have shared library support