summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-02-13 14:43:56 +0100
committerMichael Adam <obnox@samba.org>2008-02-13 14:45:13 +0100
commit574dce7c0e7f0c869ec3404a2c2a898f57b436be (patch)
tree2f07b94874fc35f873570912fc896fec19a8880a
parent120939d5d6ec0bae3a92b18ac3707fd9d3f36e46 (diff)
downloadsamba-574dce7c0e7f0c869ec3404a2c2a898f57b436be.tar.gz
samba-574dce7c0e7f0c869ec3404a2c2a898f57b436be.tar.bz2
samba-574dce7c0e7f0c869ec3404a2c2a898f57b436be.zip
Link in libnetapi as shared or static library (same mechanism as talloc).
This, too, can be turned to static linking by providing the configure parameter --with-static-libs=netapi. Michael (This used to be commit a4c773de0fbd303f633e120e817b4c88fcff2064)
-rw-r--r--source3/Makefile.in24
-rw-r--r--source3/configure.in77
2 files changed, 53 insertions, 48 deletions
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 5302fce384..c42b3c3465 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -144,11 +144,15 @@ PIDDIR = @piddir@
LIBTALLOC_SHARED_TARGET=@LIBTALLOC_SHARED_TARGET@
LIBTALLOC_STATIC_TARGET=@LIBTALLOC_STATIC_TARGET@
LIBTALLOC=$(LIBTALLOC_STATIC_TARGET) @LIBTALLOC_SHARED@
+
LIBSMBCLIENT=bin/libsmbclient.a @LIBSMBCLIENT_SHARED@
LIBSMBSHAREMODES=bin/libsmbsharemodes.a @LIBSMBSHAREMODES_SHARED@
LIBADDNS=bin/libaddns.a @LIBADDNS_SHARED@
LIBWBCLIENT=@LIBWBCLIENT_SHARED@
-LIBNETAPI=bin/libnetapi.a @LIBNETAPI_SHARED@
+
+LIBNETAPI_SHARED_TARGET=@LIBNETAPI_SHARED_TARGET@
+LIBNETAPI_STATIC_TARGET=@LIBNETAPI_STATIC_TARGET@
+LIBNETAPI=$(LIBNETAPI_STATIC_TARGET) @LIBNETAPI_SHARED@
FLAGS1 = $(CFLAGS) @FLAGS1@ @SAMBA_CPPFLAGS@ $(CPPFLAGS)
FLAGS2 =
@@ -206,7 +210,7 @@ EVERYTHING_PROGS = bin/debug2html@EXEEXT@ bin/smbfilter@EXEEXT@ \
bin/log2pcap@EXEEXT@ bin/sharesec@EXEEXT@ bin/ndrdump@EXEEXT@ \
bin/vlp@EXEEXT@
-SHLIBS = libtalloc @LIBWBCLIENT@ @LIBSMBCLIENT@ @LIBSMBSHAREMODES@ @LIBADDNS@ @LIBNETAPI@
+SHLIBS = libtalloc @LIBWBCLIENT@ @LIBSMBCLIENT@ @LIBSMBSHAREMODES@ @LIBADDNS@ libnetapi
PAM_MODULES = @PAM_MODULES@
@@ -803,7 +807,7 @@ NET_OBJ = $(NET_OBJ1) $(PARAM_WITHOUT_REG_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) \
$(SMBLDAP_OBJ) $(DCUTIL_OBJ) $(SERVER_MUTEX_OBJ) \
$(AFS_OBJ) $(AFS_SETTOKEN_OBJ) $(REGFIO_OBJ) $(READLINE_OBJ) \
$(LDB_OBJ) $(LIBGPO_OBJ) @BUILD_INIPARSER@ $(DISPLAY_SEC_OBJ) \
- $(REG_API_OBJ) $(DISPLAY_DSDCINFO_OBJ) $(LIBNETAPI_OBJ1) $(LIBNET_OBJ) \
+ $(REG_API_OBJ) $(DISPLAY_DSDCINFO_OBJ) @LIBNETAPI_STATIC@ $(LIBNET_OBJ) \
$(WBCOMMON_OBJ) @LIBWBCLIENT_STATIC@
CUPS_OBJ = client/smbspool.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
@@ -1254,7 +1258,7 @@ bin/net@EXEEXT@: $(BINARY_PREREQS) $(NET_OBJ) @BUILD_POPT@ @LIBWBCLIENT_SHARED@
@echo Linking $@
@$(CC) $(FLAGS) -o $@ $(NET_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
@POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) \
- $(PASSDB_LIBS) $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @INIPARSERLIBS@ @WINBIND_LIBS@
+ $(PASSDB_LIBS) $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) @INIPARSERLIBS@ @WINBIND_LIBS@ @LIBNETAPI_LIBS@
bin/profiles@EXEEXT@: $(BINARY_PREREQS) $(PROFILES_OBJ) @BUILD_POPT@
@echo Linking $@
@@ -1473,13 +1477,13 @@ bin/libaddns.a: $(BINARY_PREREQS) $(LIBADDNS_OBJ)
@echo Linking non-shared library $@
@-$(AR) -rc $@ $(LIBADDNS_OBJ)
-bin/libnetapi.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBNETAPI_OBJ) @LIBWBCLIENT_SHARED@
+$(LIBNETAPI_SHARED_TARGET): $(BINARY_PREREQS) $(LIBNETAPI_OBJ) @LIBWBCLIENT_SHARED@
@echo Linking shared library $@
@$(SHLD_DSO) $(LIBNETAPI_OBJ) @LIBWBCLIENT_SHARED@ $(LIBS) \
$(LDAP_LIBS) $(KRB5LIBS) $(NSCD_LIBS) \
@SONAMEFLAG@`basename $@`.$(SONAME_VER)
-bin/libnetapi.a: $(BINARY_PREREQS) $(LIBNETAPI_OBJ1)
+$(LIBNETAPI_STATIC_TARGET): $(BINARY_PREREQS) $(LIBNETAPI_OBJ1)
@echo Linking non-shared library $@
@-$(AR) -rc $@ $(LIBNETAPI_OBJ1)
@@ -1888,7 +1892,7 @@ install: installservers installbin @INSTALL_CIFSMOUNT@ @INSTALL_CIFSSPNEGO@ inst
installscripts installdat installmodules @SWAT_INSTALL_TARGETS@ \
installlibtalloc \
@INSTALL_LIBSMBCLIENT@ @INSTALL_PAM_MODULES@ \
- @INSTALL_LIBSMBSHAREMODES@ @INSTALL_LIBWBCLIENT@ @INSTALL_LIBNETAPI@
+ @INSTALL_LIBSMBSHAREMODES@ @INSTALL_LIBWBCLIENT@ installlibnetapi
install-everything: install installmodules
@@ -1981,8 +1985,8 @@ installlibwbclient: installdirs libwbclient
installlibnetapi: installdirs libnetapi
@$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(LIBDIR)
- -$(INSTALLLIBCMD_SH) bin/libnetapi.@SHLIBEXT@ $(DESTDIR)$(LIBDIR)
- -$(INSTALLLIBCMD_A) bin/libnetapi.a $(DESTDIR)$(LIBDIR)
+ -$(INSTALLLIBCMD_SH) $(LIBNETAPI_SHARED_TARGET) $(DESTDIR)$(LIBDIR)
+ -$(INSTALLLIBCMD_A) $(LIBNETAPI_STATIC_TARGET) $(DESTDIR)$(LIBDIR)
-$(INSTALLCMD) -m $(INSTALLPERMS_DATA) $(srcdir)/lib/netapi/netapi.h $(DESTDIR)${prefix}/include
installpammodules: $(PAM_MODULES)
@@ -2019,7 +2023,7 @@ showlayout:
@echo " swatdir: $(SWATDIR)"
-uninstall: uninstallman uninstallservers uninstallbin @UNINSTALL_CIFSMOUNT@ @UNINSTALL_CIFSSPNEGO@ uninstallscripts uninstalldat uninstallswat uninstallmodules uninstalllibtalloc @UNINSTALL_LIBSMBCLIENT@ @UNINSTALL_PAM_MODULES@ @UNINSTALL_LIBSMBSHAREMODES@ @UNINSTALL_LIBNETAPI@
+uninstall: uninstallman uninstallservers uninstallbin @UNINSTALL_CIFSMOUNT@ @UNINSTALL_CIFSSPNEGO@ uninstallscripts uninstalldat uninstallswat uninstallmodules uninstalllibtalloc @UNINSTALL_LIBSMBCLIENT@ @UNINSTALL_PAM_MODULES@ @UNINSTALL_LIBSMBSHAREMODES@ uninstalllibnetapi
uninstallman:
@$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(srcdir) C
diff --git a/source3/configure.in b/source3/configure.in
index cde3c0b76e..34b6465d45 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -354,10 +354,13 @@ AC_SUBST(INSTALL_LIBSMBSHAREMODES)
AC_SUBST(UNINSTALL_LIBSMBSHAREMODES)
AC_SUBST(LIBSMBSHAREMODES_SHARED)
AC_SUBST(LIBSMBSHAREMODES)
-AC_SUBST(INSTALL_LIBNETAPI)
-AC_SUBST(UNINSTALL_LIBNETAPI)
+
+AC_SUBST(LIBNETAPI_SHARED_TARGET)
+AC_SUBST(LIBNETAPI_STATIC_TARGET)
AC_SUBST(LIBNETAPI_SHARED)
-AC_SUBST(LIBNETAPI)
+AC_SUBST(LIBNETAPI_STATIC)
+AC_SUBST(LIBNETAPI_LIBS)
+
AC_SUBST(PRINT_LIBS)
AC_SUBST(AUTH_LIBS)
AC_SUBST(ACL_LIBS)
@@ -5209,49 +5212,47 @@ fi
#################################################
# should we build libnetapi?
-INSTALL_LIBNETAPI=
-UNINSTALL_LIBNETAPI=
+LIBNETAPI_SHARED_TARGET=bin/libnetapi.$SHLIBEXT
+LIBNETAPI_STATIC_TARGET=bin/libnetapi.a
LIBNETAPI_SHARED=
-LIBNETAPI=
+LIBNETAPI_STATIC=
+LIBNETAPI_LIBS=
+
AC_MSG_CHECKING(whether to build the libnetapi shared library)
AC_ARG_WITH(libnetapi,
[AS_HELP_STRING([--with-libnetapi], [Build the libnetapi shared library (default=yes if shared libs supported)])],
-[ case "$withval" in
- *)
- AC_MSG_RESULT(no)
- ;;
- yes)
- if test $BLDSHARED = true; then
- LIBNETAPI_SHARED=bin/libnetapi.$SHLIBEXT
- LIBNETAPI=libnetapi
- 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
- LIBNETAPI=libnetapi
- fi
- INSTALL_LIBNETAPI=installlibnetapi
- UNINSTALL_LIBNETAPI=uninstalllibnetapi
- ;;
- esac ],
+[
+case "$withval" in
+ *)
+ AC_MSG_RESULT(no)
+ ;;
+ yes)
+ samba_cv_with_libnetapi=yes
+ ;;
+esac
+],
[
# if unspecified, default is to build it if possible.
- if test $BLDSHARED = true; then
- LIBNETAPI_SHARED=bin/libnetapi.$SHLIBEXT
- LIBNETAPI=libnetapi
- 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
- LIBNETAPI=libnetapi
- fi]
- INSTALL_LIBNETAPI=installlibnetapi
+samba_cv_with_libnetapi=yes
+]
)
+if test x"$samba_cv_with_libnetapi" = x"yes" -a $BLDSHARED = true; then
+ LIBNETAPI_SHARED=$LIBNETAPI_SHARED_TARGET
+ AC_MSG_RESULT(yes)
+ if test x"$LIB_NETAPI" = x"STATIC" ; then
+ LIBNETAPI_STATIC=$LIBNETAPI_STATIC_TARGET
+ else
+ LIBNETAPI_LIBS=-lnetapi
+ fi
+else
+ enable_static=yes
+ AC_MSG_RESULT(no shared library support -- will supply static library)
+fi
+if test x"$enable_static" = x"yes"; then
+ LIBNETAPI_STATIC=$LIBNETAPI_STATIC_TARGET
+fi
+
#################################################
# should we build libaddns?
INSTALL_LIBADDNS=