[PATCH] Change how samba (head) builds libsmbclient

Paul_GreenVOS at vos.stratus.com Paul_GreenVOS at vos.stratus.com
Mon Jan 27 03:55:42 GMT 2003


The following patch changes the build process for samba (head)
to build libsmbclient.so if and only if the operating system
supports shared libraries.  Today the build process tries to
build libsmbclient.so even when the configure script has already
determined that shared libraries aren't supported.

In the case where libsmbclient.so is requested, either
explicitly or implicitly and cannot be built, the script
substitutes libsmbclient.a.

As before, if libsmbclient is suppressed
(--without-libsmbclient), then neither file is built.

I have tested this patch on Stratus VOS (which does not support
shared libraries) and on Solaris 2.8 (which does support them).
Samba (head) configures and builds as expected on each system.

I looked in vain for any mention of libsmbclient in the
documentation files, so I'm not proposing any documentation
changes.

I have recently been given an account on cvs.samba.org to help
out with rsync maintenance.  I would be happy to apply this
patch and monitor its health on the build farm if (a) someone
experienced approves the patch and (b) someone with the proper
access grants me access to the samba cvs tree.  Further, I
promise not to apply any unaudited patches.  As with rsync, my
primary interest and focus is on build problems, not on
main-line development.

Patch for samba_3_0 branch to follow.

### START OF PATCH (samba head) ###

diff -urp old/samba/source/Makefile.in new/samba/source/Makefile.in
--- old/samba/source/Makefile.in	Thu Jan 23 08:28:15 2003
+++ new/samba/source/Makefile.in	Sun Jan 26 18:09:42 2003
@@ -30,6 +30,8 @@ AUTHLIBS=@AUTHLIBS@
 LINK=$(CC) $(FLAGS) $(LDFLAGS)
 
 INSTALLCMD=@INSTALL@
+INSTALLCLIENTCMD_SH=@INSTALLCLIENTCMD_SH@
+INSTALLCLIENTCMD_A=@INSTALLCLIENTCMD_A@
 
 VPATH=@srcdir@
 srcdir=@srcdir@
@@ -892,7 +894,7 @@ bin/libbigballofmud. at SHLIBEXT@: $(LIBBIG
 	$(SHLD) $(LDSHFLAGS) -o $@ $(LIBBIGBALLOFMUD_PICOBJS) $(LIBS) \
 		@SONAMEFLAG@`basename $@`.$(LIBBIGBALLOFMUD_MAJOR)
 
-libsmbclient: bin/libsmbclient.a bin/libsmbclient. at SHLIBEXT@
+libsmbclient: bin/libsmbclient.a @LIBSMBCLIENT_SHARED@
 
 bin/librpc_lsarpc. at SHLIBEXT@: $(RPC_LSA_OBJ)
 	@echo "Linking $@"
@@ -1051,7 +1053,8 @@ installswat: installdirs
 	@$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
 
 installclientlib:
-	-$(INSTALLCMD) bin/libsmbclient. at SHLIBEXT@ $(DESTDIR)${prefix}/lib
+	-$(INSTALLCLIENTCMD_SH) bin/libsmbclient. at SHLIBEXT@ $(DESTDIR)${prefix}/lib
+	-$(INSTALLCLIENTCMD_A) bin/libsmbclient.a $(DESTDIR)${prefix}/lib
 	-$(INSTALLCMD) -d $(DESTDIR)${prefix}/include
 	-$(INSTALLCMD) include/libsmbclient.h $(DESTDIR)${prefix}/include
 
diff -urp old/samba/source/configure.in new/samba/source/configure.in
--- old/samba/source/configure.in	Sat Jan 25 21:45:46 2003
+++ new/samba/source/configure.in	Sun Jan 26 18:07:32 2003
@@ -140,6 +140,8 @@ AC_SUBST(PICFLAG)
 AC_SUBST(PICSUFFIX)
 AC_SUBST(POBAD_CC)
 AC_SUBST(SHLIBEXT)
+AC_SUBST(INSTALLCLIENTCMD_SH)
+AC_SUBST(INSTALLCLIENTCMD_A)
 AC_SUBST(LIBSMBCLIENT_SHARED)
 AC_SUBST(LIBSMBCLIENT)
 AC_SUBST(PRINTLIBS)
@@ -1080,13 +1082,6 @@ if test $ac_cv_shlib_works = no; then
 fi
 fi
 
-# this updates our target list if we can build shared libs
-if test $BLDSHARED = true; then
-   LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
-else
-   LIBSMBCLIENT_SHARED=
-fi
-
 ################
 
 AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
@@ -2523,26 +2518,42 @@ AC_ARG_WITH(manpages-langs,
 #################################################
 # should we build libsmbclient?
 
+INSTALLCLIENTCMD_SH=:
+INSTALLCLIENTCMD_A=:
 LIBSMBCLIENT_SHARED=
 LIBSMBCLIENT=
 AC_MSG_CHECKING(whether to build the libsmbclient shared library)
 AC_ARG_WITH(libsmbclient,
-[  --with-libsmbclient     Build the libsmbclient shared library (default=yes)],
+[  --with-libsmbclient     Build the libsmbclient shared library (default=yes if shared libs supported)],
 [ case "$withval" in
   no) 
      AC_MSG_RESULT(no)
      ;;
   *)
      if test $BLDSHARED = true; then
+        INSTALLCLIENTCMD_SH="\$(INSTALLCMD)"
         LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
         LIBSMBCLIENT=libsmbclient
         AC_MSG_RESULT(yes)
      else
-        AC_MSG_RESULT(no shared library support)
+        INSTALLCLIENTCMD_A="\$(INSTALLCMD)"
+        LIBSMBCLIENT=libsmbclient
+        AC_MSG_RESULT(no shared library support -- will supply static library)
      fi
      ;;
   esac ],
-  AC_MSG_RESULT(yes)
+[
+# if unspecified, default is to built it iff possible.
+  if test $BLDSHARED = true; then
+     INSTALLCLIENTCMD_SH="\$(INSTALLCMD)"
+     LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
+     LIBSMBCLIENT=libsmbclient
+     AC_MSG_RESULT(yes)
+  else
+     INSTALLCLIENTCMD_A="\$(INSTALLCMD)"
+     LIBSMBCLIENT=libsmbclient
+     AC_MSG_RESULT(no shared library support -- will supply static library)
+  fi]
 )
 
 
### END OF PATCH (samba head) ###

Thanks
PG
--
Paul Green                  | Mail: Paul.Green at stratus.com
Senior Technical Consultant | Voice: +1 978-461-7557
Stratus Technologies        | FAX: +1 978-461-3610
Maynard, MA  01754          | Disclaimer: I speak for myself, not Stratus.




More information about the samba-technical mailing list