Hi Jens,

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.

Samba should build fine on most systems.
What operating system and gcc / ld version do you use ?

Your patches don't seem right, please show your ./configure output.

1) For SHLD the LDSHFLAGS parameter is used. It should get set to -shared.

2) cups-config is coming from the cups installation. It's created when you run
configure at the cups source. You can specify the directories there. If you install
cups from a rpm it should also be correct.

3) Not true. sys/acl.h gets included in includes.h
Configure obviously didn't find the acl includes.

4) Where did you install the acl headers ?
For most systems Samba should be able to find the acl headers and libraries itself.

It looks like you have a fairly non-standard system or moved your software packages all around :-)
...Juergen

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:

----------schnipp----------
--- 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 @@
LIBS=@LIBS@
LDAPLIBS=@LDAPLIBS@
CC=@CC@
-SHLD=@SHLD@ CFLAGS=@CFLAGS@
CPPFLAGS=@CPPFLAGS@
LDFLAGS=@LDFLAGS@
+SHLD=@SHLD@ $(LDFLAGS)
AWK=@AWK@
DYNEXP=@DYNEXP@

@@ -695,7 +695,7 @@
@echo Linking $@
@$(CC) $(FLAGS) -o $@ $(TDBDUMP_OBJ)

-install: installbin installman installscripts installcp installswat
+install: installbin installman installscripts installcp installswat installclientlib

installdirs:
$(SHELL) $(srcdir)/install-sh -d -m $(INSTALLPERMS) $(BASEDIR)
@@ -723,7 +723,7 @@
@$(SHELL) $(srcdir)/script/installswat.sh $(SWATDIR) $(srcdir)

installclientlib:
- -$(INSTALLCMD) bin/libsmbclient.so
+ -$(INSTALLCMD) bin/libsmbclient.* $(LIBDIR)/
-$(INSTALLCMD) -d ${prefix}/include
-$(INSTALLCMD) include/libsmbclient.h ${prefix}/include

----------schnapp----------


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:

----------schnipp----------
--- 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
- AC_DEFINE(HAVE_CUPS)
- CFLAGS="$CFLAGS `$CUPS_CONFIG --cflags`"
- LDFLAGS="$LDFLAGS `$CUPS_CONFIG --ldflags`"
- LIBS="$LIBS `$CUPS_CONFIG --libs`"
- fi
+ AC_HAVE_LIBRARY(cups, [
+ 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]))
+ ])
fi

############################################
----------schnapp----------


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

----------schnipp----------
--- 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
----------schnapp----------

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


Regards,
jens.


Reply via email to