RFE: build

elkner at linofee.org elkner at linofee.org
Sat Jan 4 23:06:00 GMT 2003


I just tried to build samba 2.2.7a with cups and acl, but it did
not work out of the box without fixing source/Makefile.in,
source/configure.in and include/smb_acls.h.

If you have the time, please have a look at the following patches:

1) Makefile.in:
   we need to pass LDFLAGS to the $SHLD (i.e. usually "gcc -shared"),
   otherwise the linker may not find required libs or link the binary
   against a lib in the "default" LD_LIBRARY_PATH and not against the
   lib[s], which the user wants to. Furthermore it installs the
   libsmbclient libs in $(LIBDIR) and ,perhaps not so smart, it adds
   installclientlib to the install target:

--- samba-2.2.7a/source/Makefile.in.orig	Tue Dec 10 15:58:00 2002
+++ samba-2.2.7a/source/Makefile.in	Sat Jan  4 18:33:24 2003
@@ -11,10 +11,10 @@
@@ -695,7 +695,7 @@
 	@echo Linking $@
 	@$(CC) $(FLAGS) -o $@ $(TDBDUMP_OBJ)
-install: installbin installman installscripts installcp installswat
+install: installbin installman installscripts installcp installswat installclientlib
 	$(SHELL) $(srcdir)/install-sh -d -m $(INSTALLPERMS) $(BASEDIR)
@@ -723,7 +723,7 @@
 	@$(SHELL) $(srcdir)/script/installswat.sh $(SWATDIR) $(srcdir)
-	-$(INSTALLCMD) bin/libsmbclient.so
+	-$(INSTALLCMD) bin/libsmbclient.* $(LIBDIR)/
 	-$(INSTALLCMD) -d ${prefix}/include
 	-$(INSTALLCMD) include/libsmbclient.h ${prefix}/include

2) CUPS: IMHO, using "pseudo intelligent" tools like cups-config is not
   very smart! What, if a user has moved its installation e.g. from /usr
   to /usr/local? Is he required, to fix cups-config manually as well?

   Nevertheless, configure allows the user to define the include and
   lib path for openssl, why not for cups? If one just wants to
   build the package, the current approach does not work, since it
   assumes, that cups is installed on the system. Also it does not
   make sense, to link smb binaries agains e.g. against -lssl -lcrypto
   (LIBS="$LIBS `$CUPS_CONFIG --libs`") if it is not required. 
   smb depends on cups, but not on openssl (if not configured).
   If libcups depends on openssl, it is the task of libcups[package],
   to find resolve/satisfy calls to a library, not required by smb
   itself. Otherwise, to be consequent, smb should be linked explizit
   against libattr, which is not required by smb but by libacl ...

   So my suggestion is:

--- samba-2.2.7a/source/configure.in.orig	Tue Dec 10 02:01:00 2002
+++ samba-2.2.7a/source/configure.in	Sat Jan  4 16:35:21 2003
@@ -491,14 +491,12 @@
 [  --enable-cups           Turn on CUPS support (default=auto)])
 if test x$enable_cups != xno; then
-	AC_PATH_PROG(CUPS_CONFIG, cups-config)
-        if test "x$CUPS_CONFIG" != x; then
-		LIBS="$LIBS `$CUPS_CONFIG --libs`"
-        fi
+		AC_TRY_CPP([#include "cups/cups.h"
+			#include "cups/language.h"],
+			[ AC_DEFINE(HAVE_CUPS) LIBS="-lcups $LIBS"],
+			AC_MSG_WARN([cups headers not found - cups support disabled]))
+	])

3) POSIX acl support lacks the acl.h include. So we need:

--- samba-2.2.7a/source/include/smb_acls.h.orig	Fri Feb  1 23:13:09 2002
+++ samba-2.2.7a/source/include/smb_acls.h	Sat Jan  4 06:29:54 2003
@@ -25,7 +25,7 @@
 #include "includes.h"
 #if defined(HAVE_POSIX_ACLS)
+#include <sys/acl.h>
 /* This is an identity mapping (just remove the SMB_). */
 #define SMB_ACL_TAG_T               acl_tag_t

4) Things, which may improve the build process: 
   otherwise one has always to set CFLAGS, CPPFLAGS, LDFLAGS and
   LD_LIBRARY_PATH before building smb...

+---[ Jens Elkner ]--------------------------------------------------------+
| Walther-Rathenau-Str. 58                 elkner at linofee.org              |
| 39104 Magdeburg   GERMANY              http://www.linofee.org/           |

More information about the samba-technical mailing list