summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-07-07 00:41:23 +0200
committerMichael Adam <obnox@samba.org>2008-07-07 20:34:02 +0200
commitfc54fc52f49c523ec355c882ea72fc2ebed3b67d (patch)
treea52c643412dcce5e2c9dab4f79c74bbf1163557f
parent175497e14b469c2f8d8724a3cc63585c23cd87e3 (diff)
downloadsamba-fc54fc52f49c523ec355c882ea72fc2ebed3b67d.tar.gz
samba-fc54fc52f49c523ec355c882ea72fc2ebed3b67d.tar.bz2
samba-fc54fc52f49c523ec355c882ea72fc2ebed3b67d.zip
build: handle libsmbsharemodes by SMB_LIBRARY() and correctly create SONAME file.
Create libsmbsharemodes.so as a symlink. Michael (This used to be commit 1157048146084e9ab34d7c2e77e8d00b22df53a4)
-rw-r--r--source3/Makefile.in38
-rw-r--r--source3/configure.in48
2 files changed, 30 insertions, 56 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 04159ccb03..24dba90c5b 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1522,7 +1522,7 @@ bin/ldbdel: $(BINARY_PREREQS) $(LDBDEL_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIB
MKSYMS_SH = $(srcdir)/script/mksyms.sh
-SHLIBS = libtalloc libtdb @LIBWBCLIENT@ libsmbclient @LIBSMBSHAREMODES@ @LIBADDNS@ libnetapi
+SHLIBS = libtalloc libtdb @LIBWBCLIENT@ libsmbclient libsmbsharemodes @LIBADDNS@ libnetapi
shlibs: $(SHLIBS)
@@ -1905,16 +1905,28 @@ 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_SHARED_TARGET_SONAME=$(LIBSMBSHAREMODES_SHARED_TARGET).$(LIBSMBSHAREMODES_SOVER)
+LIBSMBSHAREMODES_STATIC_TARGET=@LIBSMBSHAREMODES_STATIC_TARGET@
+LIBSMBSHAREMODES=$(LIBSMBSHAREMODES_STATIC_TARGET) @LIBSMBSHAREMODES_SHARED@
+#LIBSMBSHAREMODES_SYMS=$(srcdir)/exports/libsmbsharemodes.@SYMSEXT@
+LIBSMBSHAREMODES_HEADERS=$(srcdir)/include/smb_share_modes.h
+
LIBSMBSHAREMODES=bin/libsmbsharemodes.a @LIBSMBSHAREMODES_SHARED@
-bin/libsmbsharemodes.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBSMBSHAREMODES_OBJ) @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
+$(LIBSMBSHAREMODES_SHARED_TARGET_SONAME): $(BINARY_PREREQS) $(LIBSMBSHAREMODES_OBJ) @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
@echo Linking shared library $@
@$(SHLD_DSO) $(LIBSMBSHAREMODES_OBJ) \
$(LIBS) @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ \
$(KRB5LIBS) $(LDAP_LIBS) \
- @SONAMEFLAG@`basename $@`.$(SONAME_VER)
+ @SONAMEFLAG@`basename $@`
-bin/libsmbsharemodes.a: $(BINARY_PREREQS) $(LIBSMBSHAREMODES_OBJ)
+$(LIBSMBSHAREMODES_SHARED_TARGET): $(LIBSMBSHAREMODES_SHARED_TARGET_SONAME)
+ @rm -f $@
+ @ln -s -f `basename $(LIBSMBSHAREMODES_SHARED_TARGET_SONAME)` $@
+
+$(LIBSMBSHAREMODES_STATIC_TARGET): $(BINARY_PREREQS) $(LIBSMBSHAREMODES_OBJ)
@echo Linking non-shared library $@
@-$(AR) -rc $@ $(LIBSMBSHAREMODES_OBJ)
@@ -1922,13 +1934,21 @@ libsmbsharemodes: $(LIBSMBSHAREMODES)
installlibsmbsharemodes:: installdirs libsmbsharemodes
@$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(LIBDIR)
- -$(INSTALLLIBCMD_SH) bin/libsmbsharemodes.@SHLIBEXT@ $(DESTDIR)$(LIBDIR)
- -$(INSTALLLIBCMD_A) bin/libsmbsharemodes.a $(DESTDIR)$(LIBDIR)
- -$(INSTALLCMD) -m $(INSTALLPERMS_DATA) $(srcdir)/include/smb_share_modes.h $(DESTDIR)${prefix}/include
+ -$(INSTALLLIBCMD_SH) $(LIBSMBSHAREMODES_SHARED_TARGET_SONAME) $(DESTDIR)$(LIBDIR)
+ @rm -f $(DESTDIR)$(LIBDIR)/`basename $(LIBSMBSHAREMODES_SHARED_TARGET)`
+ -if test -e $(LIBSMBSHAREMODES_SHARED_TARGET_SONAME) ; then \
+ ln -s -f `basename $(LIBSMBSHAREMODES_SHARED_TARGET_SONAME)` \
+ $(DESTDIR)$(LIBDIR)/`basename $(LIBSMBSHAREMODES_SHARED_TARGET)` ; \
+ fi
+ -$(INSTALLLIBCMD_A) $(LIBSMBSHAREMODES_STATIC_TARGET) $(DESTDIR)$(LIBDIR)
+ @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) ${prefix}/include
+ -$(INSTALLCMD) -m $(INSTALLPERMS_DATA) $(LIBSMBSHAREMODES_HEADERS) $(DESTDIR)${prefix}/include
uninstalllibsmbsharemodes::
- -$(UNINSTALLLIBCMD_SH) $(DESTDIR)$(LIBDIR)/libsmbsharemodes.@SHLIBEXT@
- -$(UNINSTALLLIBCMD_A) $(DESTDIR)$(LIBDIR)/libsmbsharemodes.a
+ -rm -f $(DESTDIR)$(LIBDIR)/`basename $(LIBSMBSHAREMODES_SHARED_TARGET)`
+ -$(UNINSTALLLIBCMD_SH) $(DESTDIR)$(LIBDIR)/`basename $(LIBSMBSHAREMODES_SHARED_TARGET_SONAME)`
+ -$(UNINSTALLLIBCMD_A) $(DESTDIR)$(LIBDIR)/`basename $(LIBSMBSHAREMODES_STATIC_TARGET)`
+ -rm -f $(DESTDIR)${prefix}/include/smb_share_modes.h
#-------------------------------------------------------------------
diff --git a/source3/configure.in b/source3/configure.in
index 2ac44b36f0..b5c372974c 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -95,11 +95,6 @@ AC_SUBST(WINBIND_LIBS)
AC_SUBST(LIBSAMBAUTIL_SHARED)
-AC_SUBST(INSTALL_LIBSMBSHAREMODES)
-AC_SUBST(UNINSTALL_LIBSMBSHAREMODES)
-AC_SUBST(LIBSMBSHAREMODES_SHARED)
-AC_SUBST(LIBSMBSHAREMODES)
-
AC_SUBST(PRINT_LIBS)
AC_SUBST(AUTH_LIBS)
AC_SUBST(ACL_LIBS)
@@ -4686,6 +4681,7 @@ SMB_LIBRARY(talloc)
SMB_LIBRARY(tdb)
SMB_LIBRARY(netapi)
SMB_LIBRARY(smbclient)
+SMB_LIBRARY(smbsharemodes)
#################################################
@@ -4721,48 +4717,6 @@ AC_ARG_WITH(libaddns,
)
-INSTALL_LIBSMBSHAREMODES=
-LIBSMBSHAREMODES_SHARED=
-LIBSMBSHAREMODES=
-AC_MSG_CHECKING(whether to build the libsmbsharemodes shared library)
-AC_ARG_WITH(libsmbsharemodes,
-[AS_HELP_STRING([--with-libsmbsharemodes], [Build the libsmbsharemodes shared library (default=yes if shared libs supported)])],
-[ case "$withval" in
- no)
- AC_MSG_RESULT(no)
- ;;
- *)
- if test $BLDSHARED = true; then
- LIBSMBSHAREMODES_SHARED=bin/libsmbsharemodes.$SHLIBEXT
- LIBSMBSHAREMODES=libsmbsharemodes
- AC_MSG_RESULT(yes)
- else
- enable_static=yes
- AC_MSG_RESULT(no shared library support -- will supply static library)
- fi
- if test $enable_static = yes; then
- LIBSMBSHAREMODES=libsmbsharemodes
- fi
- INSTALL_LIBSMBSHAREMODES=installlibsmbsharemodes
- UNINSTALL_LIBSMBSHAREMODES=uninstalllibsmbsharemodes
- ;;
- esac ],
-[
-# if unspecified, default is to build it if possible.
- if test $BLDSHARED = true; then
- LIBSMBSHAREMODES_SHARED=bin/libsmbsharemodes.$SHLIBEXT
- LIBSMBSHAREMODES=libsmbsharemodes
- AC_MSG_RESULT(yes)
- else
- enable_static=yes
- AC_MSG_RESULT(no shared library support -- will supply static library)
- fi
- if test $enable_static = yes; then
- LIBSMBSHAREMODES=libsmbsharemodes
- fi]
- INSTALL_LIBSMBSHAREMODES=installlibsmbsharemodes
-)
-
#################################################
# these tests are taken from the GNU fileutils package