RFE: build

Jens Elkner elkner at imsgroup.de
Sun Jan 5 02:21:02 GMT 2003


'Juergen Hasch wrote:'
> 
Hi Juergen,
> 
> >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 ?

Linux/Slackware (all mentionend packages not installed for the system,
but compiled and installed to a proto dir - i.e. make install prefix=$PROTO
DEST_DIR=$PROTO or something like that)

GNU ld version 2.13.1
gcc version 2.95.3 20010315 (release)

> Your patches don't seem right, please show your ./configure output.
  
Well, depends on the point of view of course ;-). IMHO, one should be
able to compile a "package" WITHOUT beeing root. But if the build
process does not allow to redefine search pathes for includes, libs
etc. one has to be root, to install the required stuff in the expected
places ... :((((((((

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

And that is exactly the problem! It is set only to "-shared" and not to
"-shared $LDFLAGS". So if I do not apply the Makefile.in patch
I get for build:

Linking libsmbclient shared library bin/libsmbclient.so
gcc  -shared -o bin/libsmbclient.so libsmb/libsmbclient.po lib/charcnv.po lib/charset.po lib/debug.po lib/fault.po lib/getsmbpass.po lib/interface.po lib/kanji.po lib/md4.po lib/interfaces.po lib/pidfile.po lib/replace.po lib/signal.po lib/system.po lib/sendfile.po lib/time.po lib/ufc.po lib/genrand.po lib/username.po lib/util_getent.po lib/access.po lib/smbrun.po lib/bitmap.po lib/crc32.po lib/snprintf.po lib/wins_srv.po lib/util_str.po lib/util_sid.po lib/util_unistr.po lib/util_file.po lib/util.po lib/util_sock.po lib/util_sec.po smbd/ssl.po lib/talloc.po lib/hash.po lib/substitute.po lib/fsusage.po lib/ms_fnmatch.po lib/select.po lib/error.po lib/messages.po lib/pam_errors.po nsswitch/wb_client.po nsswitch/wb_common.po tdb/tdb.po tdb/spinlock.po tdb/tdbutil.po  libsmb/clientgen.po libsmb/cliconnect.po libsmb/clifile.po libsmb/clirap.po libsmb/clierror.po libsmb/climessage.po libsmb/clireadwrite.po libsmb/clilist.po libsmb/cliprint.po libsmb/clitrans.po libsmb/clisecdesc.!
po libsmb/clidgram.po libsmb/namequery.po libsmb/nmblib.po libsmb/clistr.po libsmb/nterr.po libsmb/smbdes.po libsmb/smbencrypt.po libsmb/smberr.po libsmb/credentials.po libsmb/pwd_cache.po libsmb/clioplock.po libsmb/errormap.po libsmb/doserr.po libsmb/passchange.po libsmb/unexpected.po rpc_parse/parse_prs.po rpc_parse/parse_sec.po rpc_parse/parse_misc.po libsmb/namecache.po param/loadparm.po param/params.po  ubiqx/ubi_BinTree.po ubiqx/ubi_Cache.po ubiqx/ubi_SplayTree.po ubiqx/ubi_dLinkList.po ubiqx/ubi_sLinkList.po ubiqx/debugparse.po -lacl -lcups  -lnsl \
-Wl,-soname=`basename bin/libsmbclient.so`.0

/usr/bin/ld: cannot find -lacl
collect2: ld returned 1 exit status
make: *** [bin/libsmbclient.so] Error 1


The current ksh build function I use is:

doMake() {
        cd ${TMPBUILD}/source
        export  CFLAGS="-I${ROOT4BUILD}/usr/include" \
                CPPFLAGS="$CFLAGS" \
                LDFLAGS="-L${ROOT4BUILD}/usr/lib" \
                LDSHFLAGS="-shared $LDFLAGS"

	# to make the summary.c conftest happy
        export LD_LIBRARY_PATH="${ROOT4BUILD}/usr/lib:$LD_LIBRARY_PATH"

        autoconf
        ./configure --prefix=/opt/samba \
                --with-lockdir=/var/lock \
                --with-piddir=/var/run \
                --with-logfilebase=/var/log/samba \
                --enable-cups \
                --with-readline=${ROOT4BUILD}/usr \
                --with-libsmbclient \
                --with-acl-support  \
                --with-smbmount \
                --with-quotas \
                --with-included-popt
        echo "make log goes to $MAKELOG"
        make >$MAKELOG
}

So, one should really be able to give the compiler a hint, where to find
the required libs. Remember the case, if an admin has installed the 
production stuff in /usr and another more recent version in /usr/local.
Without the patch, the compiler will always use /usr/lib/libacl instead
of the new one in /usr/local or wherever...

BTW: One could patch the configure stuff instead of the Makefile stuff,
but this would lead to less flexibility as well ...
  
> 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.

And that´s exactly the point. "if you install it" - I do not want to
install it on the system, where smb is build ... Furthermore, why should
the smb stuff linked against the same libs, libcups was linked to?
Perhaps cups has (not yet) its own mechanism, to find the libs it needs ...

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

Ooops. Magically it works now. So the smb_acls.h patch is probably
a relict from the first try, when I had not set CPPFLAGS.

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

Of course, IF they are installed. But not neccessarily, if you have just
build or installed them in a location for testing, only ...
  
> It looks like you have a fairly non-standard system or moved your 
> software packages all around :-)

Neither a non-standard nor a "moved packages" system. Just a clean
"build" system ;-)

Regards,
jens.
-- 
+---[ Jens Elkner ]---------[ IMS GmbH, Abt. Server/Netzwerkmanagement ]--+
| Sandtorstr. 23                       +49 391 54486 19230                |
| 39106 Magdeburg                       elkner at imsgroup.de                |
| GERMANY                             http://www.imsgroup.de/             |
+-------------------------------------------------------------------------+



More information about the samba-technical mailing list