summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/Makefile.in31
-rw-r--r--source3/configure.in47
-rw-r--r--source3/library-versions.in1
3 files changed, 75 insertions, 4 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 4c1fef4be3..edda70af35 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -141,6 +141,7 @@ CODEPAGEDIR = @codepagedir@
# the directory where pid files go
PIDDIR = @piddir@
+LIBTALLOC=bin/libtalloc.a @LIBTALLOC_SHARED@
LIBSMBCLIENT=bin/libsmbclient.a @LIBSMBCLIENT_SHARED@
LIBSMBSHAREMODES=bin/libsmbsharemodes.a @LIBSMBSHAREMODES_SHARED@
LIBADDNS=bin/libaddns.a @LIBADDNS_SHARED@
@@ -203,7 +204,7 @@ EVERYTHING_PROGS = bin/debug2html@EXEEXT@ bin/smbfilter@EXEEXT@ \
bin/log2pcap@EXEEXT@ bin/sharesec@EXEEXT@ bin/ndrdump@EXEEXT@ \
bin/vlp@EXEEXT@
-SHLIBS = @LIBWBCLIENT@ @LIBSMBCLIENT@ @LIBSMBSHAREMODES@ @LIBADDNS@ @LIBNETAPI@
+SHLIBS = @LIBTALLOC@ @LIBWBCLIENT@ @LIBSMBCLIENT@ @LIBSMBSHAREMODES@ @LIBADDNS@ @LIBNETAPI@
PAM_MODULES = @PAM_MODULES@
@@ -295,6 +296,9 @@ NSS_WRAPPER_OBJ = @NSS_WRAPPER_OBJS@
TALLOC_OBJ = lib/talloc/talloc.o
+LIBTALLOC_OBJ0 = $(TALLOC_OBJ)
+LIBTALLOC_OBJ = $(LIBTALLOC_OBJ0)
+
LIBSAMBAUTIL_OBJ = $(TALLOC_OBJ) \
$(LIBREPLACE_OBJ) \
$(SOCKET_WRAPPER_OBJ) \
@@ -1110,7 +1114,7 @@ idl:
#####################################################################
-everything: all libsmbclient libnetapi debug2html smbfilter talloctort replacetort modules torture \
+everything: all libtalloc libsmbclient libnetapi debug2html smbfilter talloctort replacetort modules torture \
$(EVERYTHING_PROGS)
.SUFFIXES:
@@ -1436,6 +1440,16 @@ bin/ldbdel: $(BINARY_PREREQS) $(LDBDEL_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
@POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) \
$(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @WINBIND_LIBS@
+bin/libtalloc.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBTALLOC_OBJ)
+ @echo Linking shared library $@
+ @$(SHLD_DSO) $(LIBTALLOC_OBJ) \
+ @SONAMEFLAG@`basename $@`.$(SONAME_VER)
+ @ln -s -f `basename $@` $@.$(SONAME_VER)
+
+bin/libtalloc.a: $(BINARY_PREREQS) $(LIBTALLOC_OBJ0)
+ @echo Linking non-shared library $@
+ @-$(AR) -rc $@ $(LIBTALLOC_OBJ0)
+
bin/libwbclient.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBWBCLIENT_OBJ)
@echo Linking shared library $@
@$(SHLD_DSO) $(LIBWBCLIENT_OBJ) \
@@ -1499,6 +1513,7 @@ bin/libbigballofmud.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBBIGBALLOFMUD_OBJ)
# it can be fixed or if they just can't be called from a static
# library.
+libtalloc: $(LIBTALLOC)
libsmbclient: $(LIBSMBCLIENT)
libsmbsharemodes: $(LIBSMBSHAREMODES)
libaddns: $(LIBADDNS)
@@ -1868,6 +1883,7 @@ bin/timelimit@EXEEXT@: script/tests/timelimit.o
install: installservers installbin @INSTALL_CIFSMOUNT@ @INSTALL_CIFSSPNEGO@ installman \
installscripts installdat installmodules @SWAT_INSTALL_TARGETS@ \
+ @INSTALL_LIBTALLOC@ \
@INSTALL_LIBSMBCLIENT@ @INSTALL_PAM_MODULES@ \
@INSTALL_LIBSMBSHAREMODES@ @INSTALL_LIBWBCLIENT@ @INSTALL_LIBNETAPI@
@@ -1936,6 +1952,12 @@ installclientlib: installdirs libsmbclient
@$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) ${prefix}/include
-$(INSTALLCMD) -m $(INSTALLPERMS_DATA) $(srcdir)/include/libsmbclient.h $(DESTDIR)${prefix}/include
+installlibtalloc: installdirs libtalloc
+ @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(LIBDIR)
+ -$(INSTALLLIBCMD_SH) bin/libtalloc.@SHLIBEXT@ $(DESTDIR)$(LIBDIR)
+ -$(INSTALLLIBCMD_A) bin/libtalloc.a $(DESTDIR)$(LIBDIR)
+ -$(INSTALLCMD) -m $(INSTALLPERMS_DATA) $(srcdir)/lib/talloc/talloc.h $(DESTDIR)${prefix}/include
+
installlibsmbsharemodes: installdirs libsmbsharemodes
@$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(LIBDIR)
-$(INSTALLLIBCMD_SH) bin/libsmbsharemodes.@SHLIBEXT@ $(DESTDIR)$(LIBDIR)
@@ -1993,7 +2015,7 @@ showlayout:
@echo " swatdir: $(SWATDIR)"
-uninstall: uninstallman uninstallservers uninstallbin @UNINSTALL_CIFSMOUNT@ @UNINSTALL_CIFSSPNEGO@ uninstallscripts uninstalldat uninstallswat uninstallmodules @UNINSTALL_LIBSMBCLIENT@ @UNINSTALL_PAM_MODULES@ @UNINSTALL_LIBSMBSHAREMODES@ @UNINSTALL_LIBNETAPI@
+uninstall: uninstallman uninstallservers uninstallbin @UNINSTALL_CIFSMOUNT@ @UNINSTALL_CIFSSPNEGO@ uninstallscripts uninstalldat uninstallswat uninstallmodules @UNINSTALL_LIBTALLOC@ @UNINSTALL_LIBSMBCLIENT@ @UNINSTALL_PAM_MODULES@ @UNINSTALL_LIBSMBSHAREMODES@ @UNINSTALL_LIBNETAPI@
uninstallman:
@$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(srcdir) C
@@ -2064,7 +2086,8 @@ clean: delheaders
../testsuite/*/*.o \
*/*.@SHLIBEXT@ */*/*.@SHLIBEXT@ */*/*/*.@SHLIBEXT@ \
$(TOPFILES) $(BIN_PROGS) $(SBIN_PROGS) $(ROOT_SBIN_PROGS) \
- $(MODULES) $(TORTURE_PROGS) $(LIBSMBCLIENT) $(LIBADDNS) \
+ $(MODULES) $(TORTURE_PROGS) \
+ $(LIBTALLOC) $(LIBSMBCLIENT) $(LIBADDNS) \
$(LIBSMBSHAREMODES) $(EVERYTHING_PROGS) $(LIBNETAPI) \
bin/libwbclient.so.0 bin/timelimit \
.headers.stamp */src/*.o proto_exists
diff --git a/source3/configure.in b/source3/configure.in
index 9e4692b696..e424492716 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -322,6 +322,11 @@ AC_SUBST(UNINSTALL_LIBADDNS)
AC_SUBST(LIBADDNS_SHARED)
AC_SUBST(LIBADDNS)
+AC_SUBST(INSTALL_LIBTALLOC)
+AC_SUBST(UNINSTALL_LIBTALLOC)
+AC_SUBST(LIBTALLOC_SHARED)
+AC_SUBST(LIBTALLOC)
+
AC_SUBST(INSTALL_LIBWBCLIENT)
AC_SUBST(UNINSTALL_LIBWBCLIENT)
AC_SUBST(LIBWBCLIENT_SHARED)
@@ -5114,6 +5119,48 @@ if test $enable_static = yes; then
fi
#################################################
+# should we build libtalloc?
+INSTALL_LIBTALLOC=
+UNINSTALL_LIBTALLOC=
+LIBTALLOC_SHARED=
+LIBTALLOC=
+
+AC_MSG_CHECKING(whether to build the libtalloc shared library)
+AC_ARG_WITH(libtalloc,
+[AS_HELP_STRING([--with-libtalloc],
+ [Build the libtalloc shared library (default=yes if shared libs supported)])],
+[
+case "$withval" in
+ *)
+ AC_MSG_RESULT(no)
+ ;;
+ yes)
+ samba_cv_with_libtalloc=yes
+ ;;
+esac
+],
+[
+# if unspecified, default is to built it if possible.
+samba_cv_with_libtalloc=yes
+]
+)
+
+if test x"$samba_cv_with_libtalloc" = "xyes" -a $BLDSHARED = true; then
+ LIBTALLOC_SHARED=bin/libtalloc.$SHLIBEXT
+ LIBTALLOC=libtalloc
+ 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
+ LIBTALLOC=libtalloc
+fi
+INSTALL_LIBTALLOC=installlibtalloc
+UNINSTALL_LIBTALLOC=uninstalllibtalloc
+
+
+#################################################
# should we build libnetapi?
INSTALL_LIBNETAPI=
UNINSTALL_LIBNETAPI=
diff --git a/source3/library-versions.in b/source3/library-versions.in
index cdd1807e23..2d69d3e02c 100644
--- a/source3/library-versions.in
+++ b/source3/library-versions.in
@@ -2,6 +2,7 @@
## Basic script for defining the major and minor library revision numbers
## Makefile_target:major:minor
##
+bin/libtalloc.@SHLIBEXT@:1:0
bin/libsmbclient.@SHLIBEXT@:0:1
bin/libsmbsharemodes.@SHLIBEXT@:0:2
bin/libaddns.@SHLIBEXT@:0:1