]> git.pld-linux.org Git - packages/samba.git/commitdiff
- lib64 (AMD64) patch for samba
authorJacek Konieczny <jajcus@pld-linux.org>
Tue, 30 Dec 2003 13:20:22 +0000 (13:20 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    samba-lib64.patch -> 1.1

samba-lib64.patch [new file with mode: 0644]

diff --git a/samba-lib64.patch b/samba-lib64.patch
new file mode 100644 (file)
index 0000000..fe503b5
--- /dev/null
@@ -0,0 +1,7104 @@
+diff -durN samba-3.0.1.orig/source/Makefile.in samba-3.0.1/source/Makefile.in
+--- samba-3.0.1.orig/source/Makefile.in        2003-12-10 22:59:18.000000000 +0100
++++ samba-3.0.1/source/Makefile.in     2004-12-30 13:53:05.263072472 +0100
+@@ -1243,9 +1243,9 @@
+       @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
+ installclientlib: installdirs libsmbclient
+-      @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)${prefix}/lib
+-      -$(INSTALLCLIENTCMD_SH) bin/libsmbclient.@SHLIBEXT@ $(DESTDIR)${prefix}/lib
+-      -$(INSTALLCLIENTCMD_A) bin/libsmbclient.a $(DESTDIR)${prefix}/lib
++      @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)${prefix}/lib64
++      -$(INSTALLCLIENTCMD_SH) bin/libsmbclient.@SHLIBEXT@ $(DESTDIR)${prefix}/lib64
++      -$(INSTALLCLIENTCMD_A) bin/libsmbclient.a $(DESTDIR)${prefix}/lib64
+       @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)${prefix}/include
+       -$(INSTALLCMD) $(srcdir)/include/libsmbclient.h $(DESTDIR)${prefix}/include
+diff -durN samba-3.0.1.orig/source/Makefile.in~ samba-3.0.1/source/Makefile.in~
+--- samba-3.0.1.orig/source/Makefile.in~       1970-01-01 01:00:00.000000000 +0100
++++ samba-3.0.1/source/Makefile.in~    2003-12-10 22:59:18.000000000 +0100
+@@ -0,0 +1,1463 @@
++#########################################################################
++# Makefile.in for Samba - rewritten for autoconf support
++# Copyright Andrew Tridgell 1992-1998
++# Copyright (C) 2001 by Martin Pool <mbp@samba.org>
++# Copyright Andrew Bartlett 2002
++# Copyright (C) 2003 Jim McDonough <jmcd@us.ibm.com>
++# Copyright (C) 2002-2003 Jelmer Vernooij <jelmer@samba.org>
++###########################################################################
++
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++
++LIBS=@LIBS@
++CC=@CC@
++SHLD=@SHLD@
++CFLAGS=@CFLAGS@
++CPPFLAGS=@CPPFLAGS@
++EXEEXT=@EXEEXT@
++LDFLAGS=@LDFLAGS@
++AR=@AR@
++LDSHFLAGS=@LDSHFLAGS@ @LDFLAGS@
++WINBIND_NSS_LDSHFLAGS=@WINBIND_NSS_LDSHFLAGS@ @LDFLAGS@
++AWK=@AWK@
++DYNEXP=@DYNEXP@
++PYTHON=@PYTHON@
++PERL=@PERL@
++
++TERMLDFLAGS=@TERMLDFLAGS@
++TERMLIBS=@TERMLIBS@
++PRINT_LIBS=@PRINT_LIBS@
++AUTH_LIBS=@AUTH_LIBS@
++ACL_LIBS=@ACL_LIBS@
++PASSDB_LIBS=@PASSDB_LIBS@
++IDMAP_LIBS=@IDMAP_LIBS@
++KRB5LIBS=@KRB5_LIBS@
++LDAP_LIBS=@LDAP_LIBS@
++
++LINK=$(CC) $(FLAGS) $(LDFLAGS)
++
++INSTALLCMD=@INSTALL@
++INSTALLCLIENTCMD_SH=@INSTALLCLIENTCMD_SH@
++INSTALLCLIENTCMD_A=@INSTALLCLIENTCMD_A@
++
++VPATH=@srcdir@
++srcdir=@abs_srcdir@
++builddir=@abs_builddir@
++SHELL=/bin/sh
++DESTDIR=/
++
++# XXX: Perhaps this should be @SHELL@ instead -- apparently autoconf
++# will search for a POSIX-compliant shell, and that might not be
++# /bin/sh on some platforms.  I guess it's not a big problem -- mbp
++
++# See the autoconf manual "Installation Directory Variables" for a
++# discussion of the subtle use of these variables.
++
++BASEDIR= @prefix@
++BINDIR = @bindir@
++# sbindir is mapped to bindir when compiling SAMBA in 2.0.x compatibility mode.
++SBINDIR = @sbindir@
++LIBDIR = @libdir@
++VFSLIBDIR = $(LIBDIR)/vfs
++PDBLIBDIR = $(LIBDIR)/pdb
++RPCLIBDIR = $(LIBDIR)/rpc
++IDMAPLIBDIR = $(LIBDIR)/idmap
++CHARSETLIBDIR = $(LIBDIR)/charset
++AUTHLIBDIR = $(LIBDIR)/auth
++CONFIGDIR = @configdir@
++VARDIR = @localstatedir@
++MANDIR = @mandir@
++
++# The permissions to give the executables
++INSTALLPERMS = 0755
++
++# set these to where to find various files
++# These can be overridden by command line switches (see smbd(8))
++# or in smb.conf (see smb.conf(5))
++LOGFILEBASE = @logfilebase@
++CONFIGFILE = $(CONFIGDIR)/smb.conf
++LMHOSTSFILE = $(CONFIGDIR)/lmhosts
++
++# This is where smbpasswd et al go
++PRIVATEDIR = @privatedir@
++
++SMB_PASSWD_FILE = $(PRIVATEDIR)/smbpasswd
++PRIVATE_DIR = $(PRIVATEDIR)
++
++# This is where SWAT images and help files go
++SWATDIR = @swatdir@
++
++# the directory where lock files go
++LOCKDIR = @lockdir@
++
++# the directory where pid files go
++PIDDIR = @piddir@
++# man pages language(s)
++man_langs = "@manlangs@"
++
++LIBSMBCLIENT=bin/libsmbclient.a @LIBSMBCLIENT_SHARED@
++LIBSMBCLIENT_MAJOR=0
++LIBSMBCLIENT_MINOR=1
++
++
++FLAGS1 = $(CFLAGS) @FLAGS1@ -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper  -I. $(CPPFLAGS) -I$(srcdir)
++FLAGS2 = 
++FLAGS3 = 
++FLAGS4 = 
++FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4)
++FLAGS  = $(ISA) $(FLAGS5) 
++
++PASSWD_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" -DPRIVATE_DIR=\"$(PRIVATE_DIR)\"
++PATH_FLAGS1 = -DCONFIGFILE=\"$(CONFIGFILE)\"  -DSBINDIR=\"$(SBINDIR)\"
++PATH_FLAGS2 = $(PATH_FLAGS1) -DBINDIR=\"$(BINDIR)\" -DDRIVERFILE=\"$(DRIVERFILE)\" 
++PATH_FLAGS3 = $(PATH_FLAGS2) -DLMHOSTSFILE=\"$(LMHOSTSFILE)\" 
++PATH_FLAGS4 = $(PATH_FLAGS3) -DSWATDIR=\"$(SWATDIR)\"  -DLOCKDIR=\"$(LOCKDIR)\" -DPIDDIR=\"$(PIDDIR)\"
++PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\"$(LIBDIR)\" \
++            -DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"@SHLIBEXT@\"
++PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\"$(CONFIGDIR)\"
++PATH_FLAGS = $(PATH_FLAGS6) $(PASSWD_FLAGS)
++
++# Note that all executable programs now provide for an optional executable suffix.
++
++SBIN_PROGS = bin/smbd@EXEEXT@ bin/nmbd@EXEEXT@ bin/swat@EXEEXT@ @EXTRA_SBIN_PROGS@
++
++BIN_PROGS1 = bin/smbclient@EXEEXT@ bin/net@EXEEXT@ bin/smbspool@EXEEXT@ \
++      bin/testparm@EXEEXT@ bin/testprns@EXEEXT@ bin/smbstatus@EXEEXT@ 
++BIN_PROGS2 = bin/smbcontrol@EXEEXT@ bin/smbtree@EXEEXT@ bin/tdbbackup@EXEEXT@ \
++      bin/nmblookup@EXEEXT@ bin/pdbedit@EXEEXT@ bin/tdbdump@EXEEXT@
++BIN_PROGS3 = bin/smbpasswd@EXEEXT@ bin/rpcclient@EXEEXT@ bin/smbcacls@EXEEXT@ \
++      bin/profiles@EXEEXT@ bin/ntlm_auth@EXEEXT@ \
++      bin/smbcquotas@EXEEXT@
++
++# editreg removed from standard build until it is portable. It needs a major rewrite to 
++# achieve this (tridge)
++# bin/editreg@EXEEXT@
++
++TORTURE_PROGS = bin/smbtorture@EXEEXT@ bin/msgtest@EXEEXT@ \
++      bin/masktest@EXEEXT@ bin/locktest@EXEEXT@ \
++      bin/locktest2@EXEEXT@ bin/nsstest@EXEEXT@ bin/vfstest@EXEEXT@
++
++BIN_PROGS = $(BIN_PROGS1) $(BIN_PROGS2) $(BIN_PROGS3) @EXTRA_BIN_PROGS@
++
++EVERYTHING_PROGS = bin/debug2html@EXEEXT@ bin/smbfilter@EXEEXT@ bin/talloctort@EXEEXT@ \
++      bin/log2pcap@EXEEXT@
++
++SHLIBS = @SHLIB_PROGS@ @LIBSMBCLIENT@
++
++SCRIPTS = $(srcdir)/script/smbtar $(builddir)/script/findsmb
++
++VFS_MODULES = @VFS_MODULES@
++PDB_MODULES = @PDB_MODULES@
++RPC_MODULES = @RPC_MODULES@
++IDMAP_MODULES = @IDMAP_MODULES@
++CHARSET_MODULES = @CHARSET_MODULES@
++AUTH_MODULES = @AUTH_MODULES@
++MODULES = $(VFS_MODULES) $(PDB_MODULES) $(RPC_MODULES) $(IDMAP_MODULES) $(CHARSET_MODULES) $(AUTH_MODULES)
++
++######################################################################
++# object file lists
++######################################################################
++
++TDBBASE_OBJ = tdb/tdb.o tdb/spinlock.o
++TDB_OBJ = $(TDBBASE_OBJ) tdb/tdbutil.o tdb/tdbback.o
++
++SMBLDAP_OBJ = @SMBLDAP@
++
++LIB_OBJ = lib/version.o lib/charcnv.o lib/debug.o lib/fault.o \
++          lib/getsmbpass.o lib/interface.o lib/md4.o \
++          lib/interfaces.o lib/pidfile.o lib/replace.o lib/replace1.o \
++          lib/signal.o lib/system.o lib/sendfile.o lib/time.o \
++        lib/ufc.o lib/genrand.o lib/username.o \
++        lib/util_getent.o lib/util_pw.o lib/access.o lib/smbrun.o \
++        lib/bitmap.o lib/crc32.o lib/snprintf.o lib/dprintf.o \
++        lib/xfile.o lib/wins_srv.o \
++        lib/util_str.o lib/clobber.o lib/util_sid.o lib/util_uuid.o \
++        lib/util_unistr.o lib/util_file.o lib/data_blob.o \
++        lib/util.o lib/util_sock.o lib/sock_exec.o lib/util_sec.o \
++        lib/talloc.o lib/hash.o lib/substitute.o lib/fsusage.o \
++        lib/ms_fnmatch.o lib/select.o lib/messages.o \
++        lib/tallocmsg.o lib/dmallocmsg.o libsmb/smb_signing.o \
++        lib/md5.o lib/hmacmd5.o lib/iconv.o lib/smbpasswd.o \
++        nsswitch/wb_client.o nsswitch/wb_common.o \
++        lib/pam_errors.o intl/lang_tdb.o lib/account_pol.o \
++        lib/adt_tree.o lib/gencache.o $(TDB_OBJ) \
++        lib/module.o lib/ldap_escape.o @CHARSET_STATIC@ \
++        lib/privileges.o lib/secdesc.o lib/secace.o lib/secacl.o
++
++LIB_SMBD_OBJ = lib/system_smbd.o lib/util_smbd.o 
++
++READLINE_OBJ = lib/readline.o
++
++# Also depends on  $(SECRETS_OBJ) $(LIBSAMBA_OBJ)
++# Be sure to include them into your application
++POPT_LIB_OBJ = lib/popt_common.o 
++
++UBIQX_OBJ = ubiqx/ubi_BinTree.o ubiqx/ubi_Cache.o ubiqx/ubi_SplayTree.o \
++            ubiqx/ubi_dLinkList.o ubiqx/ubi_sLinkList.o 
++
++PARAM_OBJ = dynconfig.o param/loadparm.o param/params.o
++
++KRBCLIENT_OBJ = libads/kerberos.o
++
++LIBADS_OBJ = libads/ldap.o libads/ldap_printer.o libads/sasl.o \
++           libads/krb5_setpw.o libads/ldap_user.o \
++           libads/ads_struct.o libads/ads_status.o \
++             libads/disp_sec.o libads/ads_utils.o libads/ldap_utils.o \
++           libads/ads_ldap.o libads/authdata.o
++
++LIBADS_SERVER_OBJ = libads/util.o libads/kerberos_verify.o
++
++SECRETS_OBJ = passdb/secrets.o
++
++LIBNMB_OBJ = libsmb/unexpected.o libsmb/namecache.o libsmb/nmblib.o \
++           libsmb/namequery.o libsmb/conncache.o 
++
++LIBSAMBA_OBJ = libsmb/nterr.o libsmb/smbdes.o libsmb/smbencrypt.o libsmb/ntlmssp.o libsmb/ntlmssp_parse.o libsmb/ntlmssp_sign.o
++
++LIBSMB_OBJ = libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o \
++           libsmb/clikrb5.o libsmb/clispnego.o libsmb/asn1.o \
++           libsmb/clirap.o libsmb/clierror.o libsmb/climessage.o \
++           libsmb/clireadwrite.o libsmb/clilist.o libsmb/cliprint.o \
++           libsmb/clitrans.o libsmb/clisecdesc.o libsmb/clidgram.o \
++           libsmb/clistr.o lib/util_seaccess.o \
++           libsmb/cliquota.o libsmb/clifsinfo.o \
++             libsmb/smberr.o libsmb/credentials.o libsmb/pwd_cache.o \
++           libsmb/clioplock.o libsmb/errormap.o libsmb/clirap2.o \
++           libsmb/passchange.o libsmb/doserr.o \
++           $(RPC_PARSE_OBJ1) $(LIBSAMBA_OBJ) $(LIBNMB_OBJ) 
++
++LIBMSRPC_OBJ = rpc_client/cli_lsarpc.o rpc_client/cli_samr.o \
++             rpc_client/cli_netlogon.o rpc_client/cli_srvsvc.o \
++             rpc_client/cli_wkssvc.o rpc_client/cli_dfs.o \
++             rpc_client/cli_reg.o rpc_client/cli_pipe.o \
++             rpc_client/cli_spoolss.o rpc_client/cli_spoolss_notify.o  \
++             rpc_client/cli_ds.o rpc_client/cli_echo.o \
++             rpc_client/cli_shutdown.o
++
++REGOBJS_OBJ = registry/reg_objects.o
++REGISTRY_OBJ = registry/reg_frontend.o registry/reg_cachehook.o registry/reg_printing.o \
++               registry/reg_db.o 
++
++RPC_LSA_OBJ = rpc_server/srv_lsa.o rpc_server/srv_lsa_nt.o
++
++RPC_NETLOG_OBJ = rpc_server/srv_netlog.o rpc_server/srv_netlog_nt.o
++
++RPC_SAMR_OBJ = rpc_server/srv_samr.o rpc_server/srv_samr_nt.o \
++               rpc_server/srv_samr_util.o
++
++RPC_REG_OBJ =  rpc_server/srv_reg.o rpc_server/srv_reg_nt.o
++
++RPC_LSA_DS_OBJ =  rpc_server/srv_lsa_ds.o rpc_server/srv_lsa_ds_nt.o
++
++RPC_SVC_OBJ = rpc_server/srv_srvsvc.o rpc_server/srv_srvsvc_nt.o
++
++RPC_WKS_OBJ =  rpc_server/srv_wkssvc.o rpc_server/srv_wkssvc_nt.o
++
++RPC_DFS_OBJ =  rpc_server/srv_dfs.o rpc_server/srv_dfs_nt.o
++RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o 
++
++RPC_PIPE_OBJ = rpc_server/srv_pipe_hnd.o rpc_server/srv_util.o \
++               rpc_server/srv_pipe.o rpc_server/srv_lsa_hnd.o
++
++RPC_ECHO_OBJ = rpc_server/srv_echo.o rpc_server/srv_echo_nt.o
++
++RPC_SERVER_OBJ = @RPC_STATIC@ $(RPC_PIPE_OBJ)
++
++# this includes only the low level parse code, not stuff
++# that requires knowledge of security contexts
++RPC_PARSE_OBJ1 = rpc_parse/parse_prs.o rpc_parse/parse_sec.o \
++               rpc_parse/parse_misc.o
++
++RPC_PARSE_OBJ = rpc_parse/parse_lsa.o rpc_parse/parse_net.o \
++                rpc_parse/parse_reg.o rpc_parse/parse_rpc.o \
++                rpc_parse/parse_samr.o rpc_parse/parse_srv.o \
++                rpc_parse/parse_wks.o rpc_parse/parse_ds.o \
++              rpc_parse/parse_spoolss.o rpc_parse/parse_dfs.o \
++              rpc_parse/parse_echo.o rpc_parse/parse_shutdown.o \
++              $(REGOBJS_OBJ)
++
++
++RPC_CLIENT_OBJ = rpc_client/cli_pipe.o 
++
++LOCKING_OBJ = locking/locking.o locking/brlock.o locking/posix.o
++
++PASSDB_GET_SET_OBJ = passdb/pdb_get_set.o
++
++PASSDB_OBJ = $(PASSDB_GET_SET_OBJ) passdb/passdb.o passdb/pdb_interface.o \
++              passdb/machine_sid.o passdb/util_sam_sid.o passdb/pdb_compat.o \
++              passdb/privileges.o passdb/lookup_sid.o @PDB_STATIC@ 
++
++XML_OBJ = passdb/pdb_xml.o
++MYSQL_OBJ = passdb/pdb_mysql.o
++DEVEL_HELP_WEIRD_OBJ = modules/weird.o
++CP850_OBJ = modules/CP850.o
++CP437_OBJ = modules/CP437.o
++CHARSET_MACOSXFS_OBJ = modules/charset_macosxfs.o
++
++GROUPDB_OBJ = groupdb/mapping.o
++
++PROFILE_OBJ = profile/profile.o
++PROFILES_OBJ = utils/profiles.o
++EDITREG_OBJ = utils/editreg.o
++
++OPLOCK_OBJ = smbd/oplock.o smbd/oplock_irix.o smbd/oplock_linux.o
++
++NOTIFY_OBJ = smbd/notify.o smbd/notify_hash.o smbd/notify_kernel.o
++
++VFS_AUDIT_OBJ = modules/vfs_audit.o
++VFS_EXTD_AUDIT_OBJ = modules/vfs_extd_audit.o
++VFS_FAKE_PERMS_OBJ = modules/vfs_fake_perms.o
++VFS_RECYCLE_OBJ = modules/vfs_recycle.o
++VFS_NETATALK_OBJ = modules/vfs_netatalk.o
++VFS_DEFAULT_QUOTA_OBJ = modules/vfs_default_quota.o
++VFS_READONLY_OBJ = modules/vfs_readonly.o modules/getdate.o
++VFS_CAP_OBJ = modules/vfs_cap.o
++
++PLAINTEXT_AUTH_OBJ = auth/pampass.o auth/pass_check.o
++
++SLCACHE_OBJ = libsmb/samlogon_cache.o
++
++DCUTIL_OBJ  = libsmb/namequery_dc.o libsmb/trustdom_cache.o libsmb/trusts_util.o
++
++AUTH_BUILTIN_OBJ = auth/auth_builtin.o
++AUTH_DOMAIN_OBJ = auth/auth_domain.o
++AUTH_SAM_OBJ = auth/auth_sam.o
++AUTH_RHOSTS_OBJ = auth/auth_rhosts.o
++AUTH_SERVER_OBJ = auth/auth_server.o
++AUTH_UNIX_OBJ = auth/auth_unix.o
++AUTH_WINBIND_OBJ = auth/auth_winbind.o
++
++AUTH_OBJ = auth/auth.o @AUTH_STATIC@ auth/auth_util.o auth/auth_compat.o \
++         auth/auth_ntlmssp.o \
++         $(PLAINTEXT_AUTH_OBJ) $(SLCACHE_OBJ) $(DCUTIL_OBJ)
++
++MANGLE_OBJ = smbd/mangle.o smbd/mangle_hash.o smbd/mangle_map.o smbd/mangle_hash2.o
++
++SMBD_OBJ_MAIN = smbd/server.o
++
++BUILDOPT_OBJ = smbd/build_options.o
++
++SMBD_OBJ_SRV = smbd/files.o smbd/chgpasswd.o smbd/connection.o \
++             smbd/utmp.o smbd/session.o \
++               smbd/dfree.o smbd/dir.o smbd/password.o smbd/conn.o smbd/fileio.o \
++               smbd/ipc.o smbd/lanman.o smbd/negprot.o \
++               smbd/message.o smbd/nttrans.o smbd/pipes.o \
++               smbd/reply.o smbd/sesssetup.o smbd/trans2.o smbd/uid.o \
++             smbd/dosmode.o smbd/filename.o smbd/open.o smbd/close.o \
++             smbd/blocking.o smbd/sec_ctx.o smbd/srvstr.o \
++             smbd/vfs.o smbd/vfs-wrap.o smbd/statcache.o \
++               smbd/posix_acls.o lib/sysacls.o lib/server_mutex.o \
++             smbd/process.o smbd/service.o smbd/error.o \
++             printing/printfsp.o \
++               lib/sysquotas.o smbd/change_trust_pw.o smbd/fake_file.o \
++             smbd/quotas.o smbd/ntquotas.o lib/afs.o \
++             $(MANGLE_OBJ) @VFS_STATIC@
++
++SMBD_OBJ_BASE = $(PARAM_OBJ) $(SMBD_OBJ_SRV) $(MSDFS_OBJ) $(LIBSMB_OBJ) \
++              $(RPC_SERVER_OBJ) $(RPC_PARSE_OBJ) $(SECRETS_OBJ) \
++              $(LOCKING_OBJ) $(PASSDB_OBJ) $(PRINTING_OBJ) $(PROFILE_OBJ) \
++              $(LIB_OBJ) $(PRINTBACKEND_OBJ) $(OPLOCK_OBJ) \
++              $(NOTIFY_OBJ) $(GROUPDB_OBJ) $(AUTH_OBJ) \
++              $(LIBMSRPC_OBJ) \
++              $(LIBADS_OBJ) $(KRBCLIENT_OBJ) $(LIBADS_SERVER_OBJ) \
++              $(LIB_SMBD_OBJ) $(REGISTRY_OBJ) $(POPT_LIB_OBJ) \
++              $(UBIQX_OBJ) $(BUILDOPT_OBJ) $(SMBLDAP_OBJ)
++
++PRINTING_OBJ = printing/pcap.o printing/print_svid.o \
++                              printing/print_cups.o printing/print_generic.o \
++                              printing/lpq_parse.o printing/load.o
++
++PRINTBACKEND_OBJ = printing/printing.o printing/nt_printing.o printing/notify.o \
++              printing/printing_db.o
++
++MSDFS_OBJ = msdfs/msdfs.o 
++
++SMBD_OBJ = $(SMBD_OBJ_BASE) $(SMBD_OBJ_MAIN)
++NMBD_OBJ1 = nmbd/asyncdns.o nmbd/nmbd.o nmbd/nmbd_become_dmb.o \
++            nmbd/nmbd_become_lmb.o nmbd/nmbd_browserdb.o \
++            nmbd/nmbd_browsesync.o nmbd/nmbd_elections.o \
++            nmbd/nmbd_incomingdgrams.o nmbd/nmbd_incomingrequests.o \
++            nmbd/nmbd_lmhosts.o nmbd/nmbd_logonnames.o nmbd/nmbd_mynames.o \
++            nmbd/nmbd_namelistdb.o nmbd/nmbd_namequery.o \
++            nmbd/nmbd_nameregister.o nmbd/nmbd_namerelease.o \
++            nmbd/nmbd_nodestatus.o nmbd/nmbd_packets.o \
++            nmbd/nmbd_processlogon.o nmbd/nmbd_responserecordsdb.o \
++            nmbd/nmbd_sendannounce.o nmbd/nmbd_serverlistdb.o \
++            nmbd/nmbd_subnetdb.o nmbd/nmbd_winsproxy.o nmbd/nmbd_winsserver.o \
++            nmbd/nmbd_workgroupdb.o nmbd/nmbd_synclists.o
++
++NMBD_OBJ = $(NMBD_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(UBIQX_OBJ) \
++           $(PROFILE_OBJ) $(LIB_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ)
++
++WREPL_OBJ1 = wrepld/server.o wrepld/process.o wrepld/parser.o wrepld/socket.o \
++             wrepld/partners.o
++
++WREPL_OBJ = $(WREPL_OBJ1)  $(PARAM_OBJ) $(UBIQX_OBJ) \
++          $(PROFILE_OBJ) $(LIB_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) \
++          $(LIBSAMBA_OBJ)
++
++SWAT_OBJ1 = web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o \
++           web/swat.o web/neg_lang.o 
++
++SWAT_OBJ = $(SWAT_OBJ1) $(PARAM_OBJ) $(PRINTING_OBJ) $(LIBSMB_OBJ) \
++         $(LOCKING_OBJ) $(PASSDB_OBJ) $(SECRETS_OBJ) $(KRBCLIENT_OBJ) \
++         $(UBIQX_OBJ) $(LIB_OBJ) $(GROUPDB_OBJ) $(PLAINTEXT_AUTH_OBJ) \
++         $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) lib/dummyroot.o
++
++SMBSH_OBJ = smbwrapper/smbsh.o smbwrapper/shared.o \
++            $(PARAM_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
++
++STATUS_OBJ = utils/status.o $(LOCKING_OBJ) $(PARAM_OBJ) \
++             $(UBIQX_OBJ) $(PROFILE_OBJ) $(LIB_OBJ) $(POPT_LIB_OBJ) \
++           $(SECRETS_OBJ) $(LIBSAMBA_OBJ) lib/dummyroot.o libsmb/errormap.o 
++
++SMBCONTROL_OBJ = utils/smbcontrol.o $(LOCKING_OBJ) $(PARAM_OBJ) \
++      $(UBIQX_OBJ) $(PROFILE_OBJ) $(LIB_OBJ) $(POPT_LIB_OBJ) \
++      $(SECRETS_OBJ) $(LIBSAMBA_OBJ) \
++      printing/notify.o printing/printing_db.o lib/dummyroot.o libsmb/errormap.o
++
++SMBTREE_OBJ = utils/smbtree.o $(LOCKING_OBJ) $(PARAM_OBJ) \
++             $(UBIQX_OBJ) $(PROFILE_OBJ) $(LIB_OBJ) $(LIBSMB_OBJ) \
++           $(KRBCLIENT_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) 
++
++TESTPARM_OBJ = utils/testparm.o \
++               $(PARAM_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) $(POPT_LIB_OBJ) \
++             $(SECRETS_OBJ) $(LIBSAMBA_OBJ)
++
++TESTPRNS_OBJ = utils/testprns.o $(PARAM_OBJ) $(PRINTING_OBJ) $(UBIQX_OBJ) \
++               $(LIB_OBJ)
++
++SMBPASSWD_OBJ = utils/smbpasswd.o $(PARAM_OBJ) $(SECRETS_OBJ) \
++              $(LIBSMB_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ)\
++                $(UBIQX_OBJ) $(LIB_OBJ) $(KRBCLIENT_OBJ) \
++              $(SMBLDAP_OBJ) lib/dummyroot.o
++
++PDBEDIT_OBJ = utils/pdbedit.o $(PARAM_OBJ) $(PASSDB_OBJ) $(LIBSAMBA_OBJ) \
++              $(UBIQX_OBJ) $(LIB_OBJ) $(GROUPDB_OBJ) $(SECRETS_OBJ) \
++              $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) lib/dummyroot.o
++
++RPCCLIENT_OBJ1 = rpcclient/rpcclient.o rpcclient/cmd_lsarpc.o \
++               rpcclient/cmd_samr.o rpcclient/cmd_spoolss.o \
++               rpcclient/cmd_netlogon.o rpcclient/cmd_srvsvc.o \
++               rpcclient/cmd_dfs.o rpcclient/cmd_reg.o \
++               rpcclient/display_sec.o rpcclient/cmd_ds.o \
++               rpcclient/cmd_echo.o rpcclient/cmd_shutdown.o
++
++RPCCLIENT_OBJ = $(RPCCLIENT_OBJ1) \
++             $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) \
++             $(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(LIBMSRPC_OBJ) \
++             $(READLINE_OBJ) $(GROUPDB_OBJ) $(KRBCLIENT_OBJ) \
++           $(LIBADS_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ) \
++           $(SMBLDAP_OBJ) $(DCUTIL_OBJ) lib/dummyroot.o
++
++PAM_WINBIND_PICOBJ = nsswitch/pam_winbind.@PICSUFFIX@ \
++      nsswitch/wb_common.@PICSUFFIX@ lib/replace1.@PICSUFFIX@ \
++      lib/snprintf.@PICSUFFIX@
++
++SMBW_OBJ1 = smbwrapper/smbw.o \
++              smbwrapper/smbw_dir.o smbwrapper/smbw_stat.o \
++              smbwrapper/realcalls.o smbwrapper/shared.o \
++              smbwrapper/smbw_cache.o
++
++SMBW_OBJ = $(SMBW_OBJ1) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(PARAM_OBJ) \
++                $(UBIQX_OBJ) $(LIB_OBJ)
++
++SMBWRAPPER_OBJ1 = smbwrapper/wrapped.o
++
++SMBWRAPPER_OBJ = $(SMBW_OBJ) $(SMBWRAPPER_OBJ1)
++
++LIBSMBCLIENT_OBJ = libsmb/libsmbclient.o libsmb/libsmb_compat.o \
++                 libsmb/libsmb_cache.o \
++                 $(PARAM_OBJ) $(LIB_OBJ) \
++                 $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(UBIQX_OBJ) \
++                 $(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_GET_SET_OBJ)
++
++# This shared library is intended for linking with unit test programs
++# to test Samba internals.  It's called libbigballofmud.so to
++# discourage casual usage.
++
++LIBBIGBALLOFMUD_MAJOR = 0
++
++LIBBIGBALLOFMUD_OBJ = $(PARAM_OBJ) $(LIB_OBJ) $(UBIQX_OBJ) $(SECRETS_OBJ) \
++      $(LIBSMB_OBJ) $(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_OBJ) \
++      $(GROUPDB_OBJ) $(KRBCLIENT_OBJ) $(SMBLDAP_OBJ) lib/dummyroot.o
++
++LIBBIGBALLOFMUD_PICOBJS = $(LIBBIGBALLOFMUD_OBJ:.o=.@PICSUFFIX@)
++
++CLIENT_OBJ1 = client/client.o client/clitar.o 
++
++CLIENT_OBJ = $(CLIENT_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) \
++           $(LIB_OBJ) $(KRBCLIENT_OBJ) \
++             $(READLINE_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ)
++
++NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_ads_cldap.o utils/net_help.o \
++         utils/net_rap.o utils/net_rpc.o utils/net_rpc_samsync.o \
++         utils/net_rpc_join.o utils/net_time.o utils/net_lookup.o \
++         utils/net_cache.o utils/net_groupmap.o utils/net_idmap.o \
++         utils/net_status.o
++
++NET_OBJ = $(NET_OBJ1) $(PARAM_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) \
++        $(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
++        $(KRBCLIENT_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) \
++        $(LIBMSRPC_OBJ) $(IDMAP_OBJ) \
++        $(LIBADS_OBJ) $(LIBADS_SERVER_OBJ) $(POPT_LIB_OBJ) \
++        $(SMBLDAP_OBJ) $(DCUTIL_OBJ) lib/dummyroot.o lib/server_mutex.o lib/afs.o
++
++CUPS_OBJ = client/smbspool.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) \
++        $(LIB_OBJ) $(KRBCLIENT_OBJ) $(SECRETS_OBJ)
++
++MOUNT_OBJ = client/smbmount.o \
++             $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) 
++
++MNT_OBJ = client/smbmnt.o lib/version.o lib/snprintf.o
++
++UMOUNT_OBJ = client/smbumount.o
++
++NMBLOOKUP_OBJ = utils/nmblookup.o $(PARAM_OBJ) $(UBIQX_OBJ) $(LIBNMB_OBJ) \
++               $(LIB_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) $(LIBSAMBA_OBJ)
++
++SMBTORTURE_OBJ1 = torture/torture.o torture/nbio.o torture/scanner.o torture/utable.o \
++              torture/denytest.o torture/mangle_test.o 
++
++SMBTORTURE_OBJ = $(SMBTORTURE_OBJ1) $(PARAM_OBJ) \
++      $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
++
++MASKTEST_OBJ = torture/masktest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
++                 $(UBIQX_OBJ) $(LIB_OBJ)
++
++MSGTEST_OBJ = torture/msgtest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
++                 $(UBIQX_OBJ) $(LIB_OBJ)
++
++LOCKTEST_OBJ = torture/locktest.o $(PARAM_OBJ) $(LOCKING_OBJ) $(KRBCLIENT_OBJ) \
++                         $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
++
++NSSTEST_OBJ = torture/nsstest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
++                 $(UBIQX_OBJ) $(LIB_OBJ)
++
++VFSTEST_OBJ = torture/cmd_vfs.o torture/vfstest.o $(SMBD_OBJ_BASE) $(READLINE_OBJ)
++
++SMBICONV_OBJ = $(PARAM_OBJ) torture/smbiconv.o $(LIB_OBJ) $(UBIQX_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) $(LIBSAMBA_OBJ)
++
++LOG2PCAP_OBJ = utils/log2pcaphex.o
++
++LOCKTEST2_OBJ = torture/locktest2.o $(PARAM_OBJ) $(LOCKING_OBJ) $(LIBSMB_OBJ) \
++              $(KRBCLIENT_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
++
++SMBCACLS_OBJ = utils/smbcacls.o $(PARAM_OBJ) $(LOCKING_OBJ) $(LIBSMB_OBJ) \
++                         $(KRBCLIENT_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) $(RPC_PARSE_OBJ) \
++                         $(PASSDB_GET_SET_OBJ) $(LIBMSRPC_OBJ) $(SECRETS_OBJ) \
++                         $(POPT_LIB_OBJ) $(DCUTIL_OBJ) $(LIBADS_OBJ)
++
++SMBCQUOTAS_OBJ = utils/smbcquotas.o $(LOCKING_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
++              $(PARAM_OBJ) \
++              $(UBIQX_OBJ) $(LIB_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_GET_SET_OBJ) \
++              $(LIBMSRPC_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ)
++
++TALLOCTORT_OBJ = lib/talloctort.o $(PARAM_OBJ) $(LIB_OBJ) $(UBIQX_OBJ)
++
++RPCTORTURE_OBJ = torture/rpctorture.o \
++             rpcclient/display.o \
++             rpcclient/cmd_lsarpc.o \
++             rpcclient/cmd_wkssvc.o \
++             rpcclient/cmd_samr.o \
++             rpcclient/cmd_srvsvc.o \
++             rpcclient/cmd_netlogon.o \
++             $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) $(KRBCLIENT_OBJ) \
++             $(RPC_CLIENT_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_GET_SET_OBJ)
++
++DEBUG2HTML_OBJ = utils/debug2html.o ubiqx/debugparse.o
++
++SMBFILTER_OBJ = utils/smbfilter.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
++                 $(UBIQX_OBJ) $(LIB_OBJ) $(KRBCLIENT_OBJ) 
++
++PROTO_OBJ = $(SMBD_OBJ_MAIN) \
++          $(SMBD_OBJ_SRV) $(NMBD_OBJ1) $(SWAT_OBJ1) $(LIB_OBJ) $(LIBSMB_OBJ) \
++          $(SMBW_OBJ1) $(SMBWRAPPER_OBJ1) $(SMBTORTURE_OBJ1) $(RPCCLIENT_OBJ1) \
++          $(LIBMSRPC_OBJ) $(RPC_CLIENT_OBJ) \
++          $(RPC_PIPE_OBJ) $(RPC_PARSE_OBJ) $(KRBCLIENT_OBJ) \
++          $(AUTH_OBJ) $(PARAM_OBJ) $(LOCKING_OBJ) $(SECRETS_OBJ) \
++          $(PRINTING_OBJ) $(PRINTBACKEND_OBJ) $(OPLOCK_OBJ) $(NOTIFY_OBJ) \
++          $(PASSDB_OBJ) $(GROUPDB_OBJ) $(MSDFS_OBJ) \
++          $(READLINE_OBJ) $(PROFILE_OBJ) $(LIBADS_OBJ) $(LIBADS_SERVER_OBJ) \
++          $(LIB_SMBD_OBJ) $(SAM_OBJ) $(REGISTRY_OBJ) $(POPT_LIB_OBJ) \
++          $(RPC_LSA_OBJ) $(RPC_NETLOG_OBJ) $(RPC_SAMR_OBJ) $(RPC_REG_OBJ) $(RPC_LSA_DS_OBJ) \
++          $(RPC_SVC_OBJ) $(RPC_WKS_OBJ) $(RPC_DFS_OBJ) $(RPC_SPOOLSS_OBJ) \
++          $(RPC_ECHO_OBJ) $(SMBLDAP_OBJ) $(IDMAP_OBJ) libsmb/spnego.o
++
++WINBIND_WINS_NSS_OBJ = nsswitch/wins.o $(PARAM_OBJ) $(UBIQX_OBJ) \
++      $(LIBSMB_OBJ) $(LIB_OBJ) $(NSSWINS_OBJ) $(KRBCLIENT_OBJ)
++
++WINBIND_WINS_NSS_PICOBJS = $(WINBIND_WINS_NSS_OBJ:.o=.@PICSUFFIX@)
++
++PICOBJS = $(SMBWRAPPER_OBJ:.o=.@PICSUFFIX@)
++LIBSMBCLIENT_PICOBJS = $(LIBSMBCLIENT_OBJ:.o=.@PICSUFFIX@)
++
++PAM_SMBPASS_OBJ_0 = pam_smbpass/pam_smb_auth.o pam_smbpass/pam_smb_passwd.o \
++               pam_smbpass/pam_smb_acct.o pam_smbpass/support.o \
++               lib/dummyroot.o $(PARAM_OBJ) $(LIB_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
++               $(SECRETS_OBJ) $(UBIQX_OBJ) $(SMBLDAP_OBJ) $(LIBSAMBA_OBJ)
++
++PAM_SMBPASS_PICOOBJ = $(PAM_SMBPASS_OBJ_0:.o=.@PICSUFFIX@)
++
++IDMAP_OBJ     = sam/idmap.o sam/idmap_util.o @IDMAP_STATIC@
++
++WINBINDD_OBJ1 = \
++              nsswitch/winbindd.o       \
++              nsswitch/winbindd_user.o  \
++              nsswitch/winbindd_group.o \
++              nsswitch/winbindd_util.o  \
++              nsswitch/winbindd_cache.o \
++              nsswitch/winbindd_pam.o   \
++              nsswitch/winbindd_sid.o   \
++              nsswitch/winbindd_misc.o  \
++              nsswitch/winbindd_cm.o \
++              nsswitch/winbindd_wins.o \
++              nsswitch/winbindd_rpc.o \
++              nsswitch/winbindd_ads.o \
++              nsswitch/winbindd_dual.o \
++              nsswitch/winbindd_acct.o
++
++WINBINDD_OBJ = \
++              $(WINBINDD_OBJ1) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
++              $(PARAM_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) \
++              $(LIBSMB_OBJ) $(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) \
++              $(PROFILE_OBJ) $(SLCACHE_OBJ) $(SMBLDAP_OBJ) \
++              $(SECRETS_OBJ) $(LIBADS_OBJ) $(KRBCLIENT_OBJ) $(POPT_LIB_OBJ) \
++              $(DCUTIL_OBJ) $(IDMAP_OBJ) lib/dummyroot.o
++
++WBINFO_OBJ = nsswitch/wbinfo.o $(LIBSAMBA_OBJ) $(PARAM_OBJ) $(LIB_OBJ) \
++              $(UBIQX_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ)
++
++WINBIND_NSS_OBJ = nsswitch/wb_common.o lib/replace1.o @WINBIND_NSS_EXTRA_OBJS@
++
++WINBIND_NSS_PICOBJS = $(WINBIND_NSS_OBJ:.o=.@PICSUFFIX@) lib/snprintf.@PICSUFFIX@
++
++POPT_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
++          popt/popthelp.o popt/poptparse.o
++
++TDBBACKUP_OBJ = tdb/tdbbackup.o tdb/tdbback.o lib/snprintf.o $(TDBBASE_OBJ)
++
++TDBDUMP_OBJ = tdb/tdbdump.o $(TDBBASE_OBJ)
++
++NTLM_AUTH_OBJ = utils/ntlm_auth.o $(LIBSAMBA_OBJ) $(POPT_LIB_OBJ) \
++              libsmb/asn1.o libsmb/spnego.o libsmb/clikrb5.o libads/kerberos.o \
++              libads/kerberos_verify.o $(SECRETS_OBJ) lib/server_mutex.o \
++              libads/authdata.o rpc_parse/parse_prs.o rpc_parse/parse_misc.o \
++              libsmb/doserr.o
++
++######################################################################
++# now the rules...
++######################################################################
++all : SHOWFLAGS proto_exists $(SBIN_PROGS) $(BIN_PROGS) $(SHLIBS) \
++      $(MODULES) @EXTRA_ALL_TARGETS@
++
++pam_smbpass : SHOWFLAGS bin/pam_smbpass.@SHLIBEXT@
++
++smbwrapper : SHOWFLAGS @SMBWRAPPER@
++
++torture : SHOWFLAGS $(TORTURE_PROGS)
++
++smbtorture : SHOWFLAGS bin/smbtorture@EXEEXT@
++
++masktest : SHOWFLAGS bin/masktest@EXEEXT@
++
++msgtest : SHOWFLAGS bin/msgtest@EXEEXT@
++
++locktest : SHOWFLAGS bin/locktest@EXEEXT@
++
++smbcacls : SHOWFLAGS bin/smbcacls@EXEEXT@
++
++smbcquotas : SHOWFLAGS bin/smbcquotas@EXEEXT@
++
++locktest2 : SHOWFLAGS bin/locktest2@EXEEXT@
++
++rpctorture : SHOWFLAGS bin/rpctorture@EXEEXT@
++
++debug2html : SHOWFLAGS bin/debug2html@EXEEXT@
++
++smbfilter : SHOWFLAGS bin/smbfilter@EXEEXT@
++
++talloctort : SHOWFLAGS bin/talloctort@EXEEXT@
++
++nsswitch : SHOWFLAGS bin/winbindd@EXEEXT@ bin/wbinfo@EXEEXT@ @WINBIND_NSS@ \
++      @WINBIND_WINS_NSS@ nsswitch/pam_winbind.@SHLIBEXT@
++
++wins : SHOWFLAGS @WINBIND_WINS_NSS@
++
++modules: SHOWFLAGS proto_exists $(MODULES)
++
++everything: all libsmbclient debug2html smbfilter talloctort modules torture \
++      $(EVERYTHING_PROGS)
++
++.SUFFIXES:
++.SUFFIXES: .c .o .@PICSUFFIX@ .lo
++
++SHOWFLAGS:
++      @echo "Using FLAGS = $(FLAGS)"
++      @echo "      LIBS = $(LIBS)"
++      @echo "      LDSHFLAGS = $(LDSHFLAGS)"
++      @echo "      LDFLAGS = $(LDFLAGS)"
++
++MAKEDIR = || exec false; \
++        if test -d "$$dir"; then :; else \
++        echo mkdir "$$dir"; \
++        mkdir -p "$$dir" >/dev/null 2>&1 || \
++        test -d "$$dir" || \
++        mkdir "$$dir" || \
++        exec false; fi || exec false
++
++.c.o:
++      @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
++       dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
++      @echo Compiling $*.c
++      @$(CC) -I. -I$(srcdir) $(FLAGS) -c $< \
++        -o $@ 
++@BROKEN_CC@   -mv `echo $@ | sed 's%^.*/%%g'` $@
++
++# this adds support for precompiled headers. To use it, install a snapshot
++# of gcc-3.4 and run 'make pch' before you do the main build. 
++pch:
++      rm -f $(srcdir)/include/includes.h.gch
++      $(CC) -I. -I$(srcdir) $(FLAGS) -c $(srcdir)/include/includes.h -o $(srcdir)/include/includes.h.gch
++
++# These dependencies are only approximately correct: we want to make
++# sure Samba's paths are updated if ./configure is re-run.  Really it
++# would be nice if "make prefix=/opt/samba all" also rebuilt things,
++# but since we also require "make install prefix=/opt/samba" *not* to
++# rebuild it's a bit hard.
++
++dynconfig.o: dynconfig.c Makefile
++      @echo Compiling $*.c
++      @$(CC) $(FLAGS) $(PATH_FLAGS) -c $< -o $@ 
++
++dynconfig.@PICSUFFIX@: dynconfig.c Makefile
++      @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
++        dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
++      @echo Compiling $*.c with @PICFLAGS@
++      @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PICFLAGS@ -c $< -o $*.@PICSUFFIX@
++@BROKEN_CC@   -mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.@PICSUFFIX@$$%.o%'` $@
++@POBAD_CC@    @mv $*.@PICSUFFIX@.o $@
++
++lib/version.o: lib/version.c include/version.h
++      @echo Compiling $*.c
++      @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) -c $< -o $@ 
++
++lib/version.@PICSUFFIX@: lib/version.c include/version.h
++      @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
++        dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
++      @echo Compiling $*.c with @PICFLAGS@
++      @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PICFLAGS@ -c $< -o $*.@PICSUFFIX@
++@BROKEN_CC@   -mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.@PICSUFFIX@$$%.o%'` $@
++@POBAD_CC@    @mv $*.@PICSUFFIX@.o $@
++
++smbd/build_options.o: smbd/build_options.c Makefile include/config.h include/build_env.h include/proto.h
++      @echo Compiling $*.c
++      @$(CC) $(FLAGS) $(PATH_FLAGS) -c $< -o $@
++
++smbd/build_options.c: include/config.h.in script/mkbuildoptions.awk
++      @echo Generating $@
++      @dir=smbd $(MAKEDIR) && $(AWK) -f $(srcdir)/script/mkbuildoptions.awk > $(builddir)/smbd/build_options.c < $(srcdir)/include/config.h.in
++
++.c.@PICSUFFIX@: 
++      @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
++        dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
++      @echo Compiling $*.c with @PICFLAGS@
++      @$(CC) -I. -I$(srcdir) $(FLAGS) @PICFLAGS@ -c $< -o $*.@PICSUFFIX@
++@BROKEN_CC@   -mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.@PICSUFFIX@$$%.o%'` $@
++@POBAD_CC@    @mv $*.@PICSUFFIX@.o $@
++
++bin/.dummy:
++      @if (: >> $@ || : > $@) >/dev/null 2>&1; then :; else \
++        dir=bin $(MAKEDIR); fi
++      @: >> $@ || : > $@ # what a fancy emoticon!
++
++bin/smbd@EXEEXT@: $(SMBD_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(LDFLAGS) $(LDAP_LIBS) \
++              $(KRB5LIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) \
++              $(ACL_LIBS) $(PASSDB_LIBS) $(LIBS) @POPTLIBS@
++
++bin/nmbd@EXEEXT@: $(NMBD_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/wrepld@EXEEXT@: $(WREPL_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(WREPL_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@
++
++bin/swat@EXEEXT@: $(SWAT_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINT_LIBS) \
++        $(AUTH_LIBS) $(LIBS) $(PASSDB_LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/rpcclient@EXEEXT@: $(RPCCLIENT_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(PASSDB_LIBS) $(RPCCLIENT_OBJ) \
++              $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ \
++              $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/smbclient@EXEEXT@: $(CLIENT_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/net@EXEEXT@: $(NET_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(NET_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS)
++
++bin/profiles@EXEEXT@: $(PROFILES_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(PROFILES_OBJ) $(LDFLAGS) $(LIBS) @POPTLIBS@
++
++bin/editreg@EXEEXT@: $(EDITREG_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(EDITREG_OBJ) $(LDFLAGS) $(LIBS) @POPTLIBS@
++
++bin/smbspool@EXEEXT@: $(CUPS_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(CUPS_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/smbmount@EXEEXT@: $(MOUNT_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(MOUNT_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/smbmnt@EXEEXT@: $(MNT_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(MNT_OBJ) $(LDFLAGS) 
++
++bin/smbumount@EXEEXT@: $(UMOUNT_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(UMOUNT_OBJ) $(LDFLAGS)
++
++bin/testparm@EXEEXT@: $(TESTPARM_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(TESTPARM_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@
++
++bin/testprns@EXEEXT@: $(TESTPRNS_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(TESTPRNS_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINT_LIBS) $(LIBS)
++
++bin/smbstatus@EXEEXT@: $(STATUS_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(STATUS_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
++      @POPTLIBS@
++
++bin/smbcontrol@EXEEXT@: $(SMBCONTROL_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) -DUSING_SMBCONTROL $(FLAGS) -o $@ $(SMBCONTROL_OBJ) $(DYNEXP) \
++      $(LDFLAGS) $(LIBS) \
++      @POPTLIBS@
++
++bin/smbtree@EXEEXT@: $(SMBTREE_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(SMBTREE_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) 
++
++bin/smbpasswd@EXEEXT@: $(SMBPASSWD_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(SMBPASSWD_OBJ) $(LDFLAGS) $(PASSDB_LIBS) \
++              $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) 
++
++bin/pdbedit@EXEEXT@: $(PDBEDIT_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(PDBEDIT_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(PASSDB_LIBS) $(LDAP_LIBS)
++
++bin/samtest@EXEEXT@: $(SAMTEST_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(SAMTEST_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(PASSDB_LIBS) $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/nmblookup@EXEEXT@: $(NMBLOOKUP_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(NMBLOOKUP_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(LDAP_LIBS)
++
++bin/smbtorture@EXEEXT@: $(SMBTORTURE_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(SMBTORTURE_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(SECRETS_OBJ)
++
++bin/talloctort@EXEEXT@: $(TALLOCTORT_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(TALLOCTORT_OBJ) $(LDFLAGS) $(LIBS)
++
++bin/masktest@EXEEXT@: $(MASKTEST_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(MASKTEST_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(SECRETS_OBJ)
++
++bin/msgtest@EXEEXT@: $(MSGTEST_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(MSGTEST_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) 
++
++bin/smbcacls@EXEEXT@: $(SMBCACLS_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(SMBCACLS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/smbcquotas@EXEEXT@: $(SMBCQUOTAS_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(SMBCQUOTAS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/locktest@EXEEXT@: $(LOCKTEST_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(LOCKTEST_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/nsstest@EXEEXT@: $(NSSTEST_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(NSSTEST_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS)  $(LDAP_LIBS)
++
++bin/vfstest@EXEEXT@: $(VFSTEST_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(VFSTEST_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) $(ACL_LIBS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/smbiconv@EXEEXT@: $(SMBICONV_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(SMBICONV_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(DYNEXP) $(LIBS) @POPTLIBS@
++
++bin/log2pcap@EXEEXT@: $(LOG2PCAP_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(LOG2PCAP_OBJ) $(LDFLAGS) @POPTLIBS@ $(LIBS)
++
++bin/locktest2@EXEEXT@: $(LOCKTEST2_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(LOCKTEST2_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/rpctorture@EXEEXT@: $(RPCTORTURE_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(RPCTORTURE_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/debug2html@EXEEXT@: $(DEBUG2HTML_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(DEBUG2HTML_OBJ) $(LDFLAGS) $(LIBS)
++
++bin/smbfilter@EXEEXT@: $(SMBFILTER_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(SMBFILTER_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/smbw_sample@EXEEXT@: $(SMBW_OBJ) utils/smbw_sample.o bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(SMBW_OBJ) utils/smbw_sample.o $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/smbsh@EXEEXT@: $(SMBSH_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(SMBSH_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS)
++
++bin/smbwrapper.@SHLIBEXT@: $(PICOBJS) bin/.dummy
++      @echo Linking shared library $@
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(PICOBJS) $(LIBS) \
++              $(KRB5LIBS) $(LDAP_LIBS) \
++              @SONAMEFLAG@`basename $@`
++
++bin/libsmbclient.@SHLIBEXT@: $(LIBSMBCLIENT_PICOBJS)
++      @echo Linking libsmbclient shared library $@
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(LIBSMBCLIENT_PICOBJS) $(LDFLAGS) $(DYNEXP) $(LIBS) \
++              $(KRB5LIBS) $(LDAP_LIBS) \
++              @SONAMEFLAG@`basename $@`.$(LIBSMBCLIENT_MAJOR)
++
++bin/libsmbclient.a: $(LIBSMBCLIENT_PICOBJS)
++      @echo Linking libsmbclient non-shared library $@
++      @-$(AR) -rc $@ $(LIBSMBCLIENT_PICOBJS)
++
++# This is probably wrong for anything other than the GNU linker. 
++bin/libbigballofmud.@SHLIBEXT@: $(LIBBIGBALLOFMUD_PICOBJS)
++      @echo Linking bigballofmud shared library $@
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(LIBBIGBALLOFMUD_PICOBJS) $(LIBS) \
++              $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS) \
++              @SONAMEFLAG@`basename $@`.$(LIBBIGBALLOFMUD_MAJOR)
++      ln -snf libbigballofmud.so bin/libbigballofmud.so.0
++
++# It would be nice to build a static bigballofmud too, but when I try
++# I get linker errors about dl_open and similar things.  I'm not sure if
++# it can be fixed or if they just can't be called from a static
++# library.
++
++libsmbclient: $(LIBSMBCLIENT)
++
++bin/librpc_lsarpc.@SHLIBEXT@: $(RPC_LSA_OBJ)
++      @echo "Linking $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_LSA_OBJ) -lc \
++              @SONAMEFLAG@`basename $@`
++
++bin/librpc_samr.@SHLIBEXT@: $(RPC_SAMR_OBJ)
++      @echo "Linking $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SAMR_OBJ) -lc \
++              @SONAMEFLAG@`basename $@`
++
++bin/librpc_srvsvc.@SHLIBEXT@: $(RPC_SVC_OBJ)
++      @echo "Linking $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SVC_OBJ) -lc \
++              @SONAMEFLAG@`basename $@`
++
++bin/librpc_wkssvc.@SHLIBEXT@: $(RPC_WKS_OBJ)
++      @echo "Linking $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_WKS_OBJ) -lc \
++              @SONAMEFLAG@`basename $@`
++
++bin/librpc_NETLOGON.@SHLIBEXT@: $(RPC_NETLOG_OBJ)
++      @echo "Linking $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_NETLOG_OBJ) -lc \
++              @SONAMEFLAG@`basename $@`
++
++bin/librpc_winreg.@SHLIBEXT@: $(RPC_REG_OBJ)
++      @echo "Linking $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_REG_OBJ) -lc \
++              @SONAMEFLAG@`basename $@`
++
++bin/librpc_lsa_ds.@SHLIBEXT@: $(RPC_LSA_DS_OBJ)
++      @echo "Linking $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_LSA_DS_OBJ) -lc \
++              @SONAMEFLAG@`basename $@`
++
++bin/librpc_spoolss.@SHLIBEXT@: $(RPC_SPOOLSS_OBJ)
++      @echo "Linking $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SPOOLSS_OBJ) -lc \
++              @SONAMEFLAG@`basename $@`
++
++bin/librpc_netdfs.@SHLIBEXT@: $(RPC_DFS_OBJ)
++      @echo "Linking $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_DFS_OBJ) -lc \
++              @SONAMEFLAG@`basename $@`
++
++bin/librpc_echo.@SHLIBEXT@: $(RPC_ECHO_OBJ)
++      @echo "Linking $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_ECHO_OBJ) -lc \
++              @SONAMEFLAG@`basename $@`
++
++bin/winbindd@EXEEXT@: $(WINBINDD_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo "Linking $@"
++      @$(LINK) -o $@ $(WINBINDD_OBJ) $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS)
++
++# Please don't add .o files to libnss_winbind, libnss_wins, or the pam_winbind
++# libraries.  Add to the appropriate PICOBJ variable instead.
++
++@WINBIND_NSS@: $(WINBIND_NSS_PICOBJS)
++      @echo "Linking $@"
++      @$(SHLD) $(WINBIND_NSS_LDSHFLAGS) -o $@ $(WINBIND_NSS_PICOBJS) \
++              @WINBIND_NSS_EXTRA_LIBS@ @SONAMEFLAG@`basename $@`
++
++@WINBIND_WINS_NSS@: $(WINBIND_WINS_NSS_PICOBJS)
++      @echo "Linking $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(WINBIND_WINS_NSS_PICOBJS) \
++              $(LDAP_LIBS) $(KRB5LIBS) -lc \
++              @SONAMEFLAG@`basename $@`
++
++nsswitch/pam_winbind.@SHLIBEXT@: $(PAM_WINBIND_PICOBJ) bin/.dummy
++      @echo "Linking $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_WINBIND_PICOBJ) \
++              @SONAMEFLAG@`basename $@` -lpam
++
++bin/rhosts.@SHLIBEXT@: $(AUTH_RHOSTS_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_RHOSTS_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@`
++
++bin/builtin.@SHLIBEXT@: $(AUTH_BUILTIN_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_BUILTIN_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@`
++
++bin/domain.@SHLIBEXT@: $(AUTH_DOMAIN_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_DOMAIN_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@`
++
++bin/smbserver.@SHLIBEXT@: $(AUTH_SERVER_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_SERVER_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@`
++
++bin/winbind.@SHLIBEXT@: $(AUTH_WINBIND_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_WINBIND_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@`
++
++bin/unix.@SHLIBEXT@: $(AUTH_UNIX_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_UNIX_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@`
++
++bin/sam.@SHLIBEXT@: $(AUTH_SAM_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_SAM_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@`
++
++bin/mysql.@SHLIBEXT@: $(MYSQL_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(MYSQL_OBJ:.o=.@PICSUFFIX@) @MYSQL_LIBS@ \
++              @SONAMEFLAG@`basename $@`
++
++bin/ldapsam.@SHLIBEXT@: passdb/pdb_ldap.@PICSUFFIX@
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) $(LDAP_LIBS) -o $@ passdb/pdb_ldap.@PICSUFFIX@ \
++              @SONAMEFLAG@`basename $@`
++
++bin/tdbsam.@SHLIBEXT@: passdb/pdb_tdb.@PICSUFFIX@
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ passdb/pdb_tdb.@PICSUFFIX@ \
++              @SONAMEFLAG@`basename $@`
++
++bin/smbpasswd.@SHLIBEXT@: passdb/pdb_smbpasswd.@PICSUFFIX@
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ passdb/pdb_smbpasswd.@PICSUFFIX@ \
++              @SONAMEFLAG@`basename $@`
++
++bin/weird.@SHLIBEXT@: $(DEVEL_HELP_WEIRD_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(DEVEL_HELP_WEIRD_OBJ:.o=.@PICSUFFIX@) \
++              @SONAMEFLAG@`basename $@`
++
++bin/CP850.@SHLIBEXT@: $(CP850_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(CP850_OBJ:.o=.@PICSUFFIX@) \
++              @SONAMEFLAG@`basename $@`
++
++bin/CP437.@SHLIBEXT@: $(CP437_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(CP437_OBJ:.o=.@PICSUFFIX@) \
++              @SONAMEFLAG@`basename $@`
++
++bin/macosxfs.@SHLIBEXT@: $(CHARSET_MACOSXFS_OBJ:.o=.po)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(CHARSET_MACOSXFS_OBJ:.o=.po) \
++              -framework CoreFoundation @SONAMEFLAG@`basename $@`
++
++bin/xml.@SHLIBEXT@: $(XML_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(XML_OBJ:.o=.@PICSUFFIX@) @XML_LIBS@ \
++              @SONAMEFLAG@`basename $@`
++
++bin/audit.@SHLIBEXT@: $(VFS_AUDIT_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_AUDIT_OBJ:.o=.@PICSUFFIX@) \
++              @SONAMEFLAG@`basename $@`
++
++bin/extd_audit.@SHLIBEXT@: $(VFS_EXTD_AUDIT_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_EXTD_AUDIT_OBJ:.o=.@PICSUFFIX@) \
++              @SONAMEFLAG@`basename $@`
++
++bin/recycle.@SHLIBEXT@: $(VFS_RECYCLE_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_RECYCLE_OBJ:.o=.@PICSUFFIX@) \
++              @SONAMEFLAG@`basename $@`
++
++bin/netatalk.@SHLIBEXT@: $(VFS_NETATALK_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_NETATALK_OBJ:.o=.@PICSUFFIX@) \
++              @SONAMEFLAG@`basename $@`
++
++bin/fake_perms.@SHLIBEXT@: $(VFS_FAKE_PERMS_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_FAKE_PERMS_OBJ:.o=.@PICSUFFIX@) \
++              @SONAMEFLAG@`basename $@`
++
++bin/default_quota.@SHLIBEXT@: $(VFS_DEFAULT_QUOTA_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_DEFAULT_QUOTA_OBJ:.o=.@PICSUFFIX@) \
++              @SONAMEFLAG@`basename $@`
++
++bin/readonly.@SHLIBEXT@: $(VFS_READONLY_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_READONLY_OBJ:.o=.@PICSUFFIX@) \
++              @SONAMEFLAG@`basename $@`
++
++bin/cap.@SHLIBEXT@: $(VFS_CAP_OBJ:.o=.@PICSUFFIX@)
++      @echo "Building plugin $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_CAP_OBJ:.o=.@PICSUFFIX@) \
++              @SONAMEFLAG@`basename $@`
++
++bin/wbinfo@EXEEXT@: $(WBINFO_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(LINK) -o $@ $(WBINFO_OBJ) $(LIBS) @POPTLIBS@
++
++bin/ntlm_auth@EXEEXT@: $(NTLM_AUTH_OBJ) $(PARAM_OBJ) $(LIB_OBJ) \
++              $(UBIQX_OBJ) @BUILD_POPT@ bin/.dummy
++      @echo Linking $@
++      @$(LINK) -o $@ $(NTLM_AUTH_OBJ) $(PARAM_OBJ) $(LIB_OBJ) \
++              $(UBIQX_OBJ) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
++
++bin/pam_smbpass.@SHLIBEXT@: $(PAM_SMBPASS_PICOOBJ)
++      @echo "Linking shared library $@"
++      @$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_PICOOBJ) -lpam $(DYNEXP) $(LIBS) -lc $(LDAP_LIBS) $(KRB5LIBS)
++
++bin/libmsrpc.a: $(LIBMSRPC_PICOBJ)
++      @-$(AR) -rc $@ $(LIBMSRPC_PICOBJ) 
++
++bin/tdbbackup@EXEEXT@: $(TDBBACKUP_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(TDBBACKUP_OBJ)
++
++bin/tdbdump@EXEEXT@: $(TDBDUMP_OBJ) bin/.dummy
++      @echo Linking $@
++      @$(CC) $(FLAGS) -o $@ $(TDBDUMP_OBJ)
++
++bin/t_strcmp@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_strcmp.o
++      $(CC) $(FLAGS) -o $@ $(LIBS) torture/t_strcmp.o -L ./bin -lbigballofmud
++
++bin/t_stringoverflow@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_stringoverflow.o
++      $(CC) $(FLAGS) -o $@ torture/t_stringoverflow.o -L./bin -lbigballofmud
++
++bin/t_doschar@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_doschar.o
++      $(CC) $(FLAGS) -o $@ $(LIBS) torture/t_doschar.o -L ./bin -lbigballofmud
++bin/t_push_ucs2@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_push_ucs2.o
++      $(CC) $(FLAGS) -o $@ $(LIBS) torture/t_push_ucs2.o -L ./bin -lbigballofmud
++
++bin/t_snprintf@EXEEXT@: lib/snprintf.c
++      $(CC) $(FLAGS) -o $@ -DTEST_SNPRINTF lib/snprintf.c -lm
++install: installbin installman installscripts installdat installswat installmodules @INSTALLCLIENT@
++
++install-everything: install installmodules
++
++# DESTDIR is used here to prevent packagers wasting their time
++# duplicating the Makefile. Remove it and you will have the privelege
++# of package each samba release for muliple versions of multiple
++# distributions and operating systems, or at least supplying patches
++# to all the packaging files required for this, prior to committing
++# the removal of DESTDIR. Do not remove it even though you think it
++# is not used
++
++installdirs:
++      @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(PRIVATEDIR) $(DESTDIR)$(PIDDIR) $(DESTDIR)$(LOCKDIR) $(DESTDIR)$(MANDIR)
++
++installservers: all installdirs
++      @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(SBIN_PROGS)
++
++installbin: all installdirs
++      @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(SBIN_PROGS)
++      @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(BIN_PROGS)
++
++
++installmodules: modules installdirs
++      @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(VFSLIBDIR) $(VFS_MODULES)
++      @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(PDBLIBDIR) $(PDB_MODULES)
++      @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(RPCLIBDIR) $(RPC_MODULES)
++      @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(IDMAPLIBDIR) $(IDMAP_MODULES)
++      @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(CHARSETLIBDIR) $(CHARSET_MODULES)
++      @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(AUTHLIBDIR) $(AUTH_MODULES)
++      @# These symlinks are required for the 'probing' of modules. 
++      @# This mechanism should go at some point..
++      @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(PDBLIBDIR) ldapsam.@SHLIBEXT@ ldapsam_compat.@SHLIBEXT@
++      @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) rhosts.@SHLIBEXT@ hostsequiv.@SHLIBEXT@
++      @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) sam.@SHLIBEXT@ sam_ignoredomain.@SHLIBEXT@
++      @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) domain.@SHLIBEXT@ trustdomain.@SHLIBEXT@ ntdomain.@SHLIBEXT@
++      @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) builtin.@SHLIBEXT@ guest.@SHLIBEXT@ fixed_challenge.@SHLIBEXT@ name_to_ntstatus.@SHLIBEXT@
++
++installscripts: installdirs
++      @$(SHELL) $(srcdir)/script/installscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS)
++
++installdat: installdirs
++      @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(LIBDIR) $(srcdir)
++
++installmsg: installdirs
++      @$(SHELL) $(srcdir)/script/installmsg.sh $(DESTDIR)$(LIBDIR) $(srcdir)
++
++installswat: installdirs installmsg
++      @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
++
++installclientlib: installdirs libsmbclient
++      @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)${prefix}/lib
++      -$(INSTALLCLIENTCMD_SH) bin/libsmbclient.@SHLIBEXT@ $(DESTDIR)${prefix}/lib
++      -$(INSTALLCLIENTCMD_A) bin/libsmbclient.a $(DESTDIR)${prefix}/lib
++      @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)${prefix}/include
++      -$(INSTALLCMD) $(srcdir)/include/libsmbclient.h $(DESTDIR)${prefix}/include
++
++# Python extensions
++
++PYTHON_OBJS = $(PARAM_OBJ) $(LIB_OBJ) $(LIBSMB_OBJ) $(RPC_PARSE_OBJ) \
++      $(UBIQX_OBJ) $(LIBMSRPC_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
++      $(SECRETS_OBJ) $(KRBCLIENT_OBJ) $(SMBLDAP_OBJ) lib/dummyroot.o
++
++PYTHON_PICOBJS = $(PYTHON_OBJS:.o=.@PICSUFFIX@)
++
++python_ext: $(PYTHON_PICOBJS)
++      @if test -z "$(PYTHON)"; then \
++              echo Use the option --with-python to configure python; \
++              exit 1; \
++      fi
++      PYTHON_OBJS="$(PYTHON_PICOBJS)" \
++      PYTHON_CFLAGS="$(CFLAGS) $(CPPFLAGS) $(FLAGS)" \
++      LIBS="$(LIBS) $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS)" \
++              $(PYTHON) python/setup.py build
++
++python_install: $(PYTHON_PICOBJS)
++      @if test -z "$(PYTHON)"; then \
++              echo Use the option --with-python to configure python; \
++              exit 1; \
++      fi
++      PYTHON_OBJS="$(PYTHON_PICOBJS)" \
++      PYTHON_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \
++      LIBS="$(LIBS)" \
++              $(PYTHON) python/setup.py install
++
++python_clean:
++      @-if test -n "$(PYTHON)"; then $(PYTHON) python/setup.py clean; fi
++
++# revert to the previously installed version
++revert:
++      @$(SHELL) $(srcdir)/script/revert.sh $(SBINDIR) $(SBIN_PROGS) 
++      @$(SHELL) $(srcdir)/script/revert.sh $(BINDIR) $(BIN_PROGS) $(SCRIPTS)
++
++installman: installdirs
++      @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(MANDIR) $(srcdir) $(man_langs) "@ROFF@"
++
++.PHONY: showlayout
++
++showlayout: 
++      @echo "Samba will be installed into:"
++      @echo "  basedir:     $(BASEDIR)"
++      @echo "  bindir:      $(BINDIR)"
++      @echo "  sbindir:     $(SBINDIR)"
++      @echo "  libdir:      $(LIBDIR)"
++      @echo "  vardir:      $(VARDIR)"
++      @echo "  mandir:      $(MANDIR)"
++      @echo "  privatedir:  $(PRIVATE_DIR)"
++      @echo "  configdir:   $(CONFIGDIR)"
++      @echo "  lockdir:     $(LOCKDIR)"
++      @echo "  piddir:      $(PIDDIR)"
++
++
++uninstall: uninstallman uninstallbin uninstallscripts uninstallmodules
++
++uninstallman:
++      @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(srcdir) $(man_langs)
++
++uninstallbin:
++      @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(SBIN_PROGS)
++      @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(BIN_PROGS)
++
++uninstallmodules:
++      @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(VFSLIBDIR) $(DESTDIR)$(VFS_MODULES)
++      @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(PDBLIBDIR) $(DESTDIR)$(PDB_MODULES)
++      @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(RPCLIBDIR) $(DESTDIR)$(RPC_MODULES)
++      @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(CHARSETLIBDIR) $(DESTDIR)$(CHARSET_MODULES)
++      @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(AUTHLIBDIR) $(DESTDIR)$(AUTH_MODULES)
++
++uninstallscripts:
++      @$(SHELL) $(srcdir)/script/uninstallscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS)
++
++# Toplevel clean files
++TOPFILES=dynconfig.o dynconfig.@PICSUFFIX@
++
++clean: delheaders python_clean
++      -rm -f core */*~ *~ */*.o */*.@PICSUFFIX@ */*.@SHLIBEXT@ \
++              $(TOPFILES) $(BIN_PROGS) $(SBIN_PROGS) $(MODULES) $(TORTURE_PROGS) \
++              $(LIBSMBCLIENT) $(EVERYTHING_PROGS) .headers.stamp
++
++# Making this target will just make sure that the prototype files
++# exist, not necessarily that they are up to date.  Since they're
++# removed by "make clean" this will always be run when you do anything
++# afterwards.
++proto_exists: include/proto.h include/wrepld_proto.h include/build_env.h \
++      nsswitch/winbindd_proto.h web/swat_proto.h \
++      client/client_proto.h utils/net_proto.h smbd/build_options.c
++
++delheaders:
++      @echo Removing prototype headers
++      @rm -f include/proto.h include/build_env.h  include/wrepld_proto.h \
++              nsswitch/winbindd_proto.h web/swat_proto.h \
++              client/client_proto.h utils/net_proto.h \
++              smbd/build_options.c
++
++MKPROTO_SH = $(srcdir)/script/mkproto.sh
++
++include/proto.h: smbd/build_options.c
++      @echo Building include/proto.h
++      @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
++        -h _PROTO_H_ $(builddir)/include/proto.h \
++        $(PROTO_OBJ)
++
++include/build_env.h: script/build_env.sh
++      @echo Building include/build_env.h
++      @$(SHELL) $(srcdir)/script/build_env.sh $(srcdir) $(builddir) $(CC) \
++        > $(builddir)/include/build_env.h
++
++include/wrepld_proto.h:
++      @echo Building include/wrepld_proto.h
++      @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
++        -h _WREPLD_PROTO_H_ $(builddir)/include/wrepld_proto.h \
++        $(WREPL_OBJ1)
++
++nsswitch/winbindd_proto.h: 
++      @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
++        -h _WINBINDD_PROTO_H_ $(builddir)/nsswitch/winbindd_proto.h \
++        $(WINBINDD_OBJ1)
++
++web/swat_proto.h: 
++      @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
++        -h _SWAT_PROTO_H_ $(builddir)/web/swat_proto.h \
++        $(SWAT_OBJ1)
++
++client/client_proto.h: 
++      @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
++        -h _CLIENT_PROTO_H_ $(builddir)/client/client_proto.h \
++        $(CLIENT_OBJ1)
++
++utils/net_proto.h: 
++      @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
++        -h _CLIENT_PROTO_H_ $(builddir)/utils/net_proto.h \
++        $(NET_OBJ1)
++
++# "make headers" or "make proto" calls a subshell because we need to
++# make sure these commands are executed in sequence even for a
++# parallel make.
++headers: 
++      $(MAKE) delheaders; \
++      $(MAKE) smbd/build_options.c; \
++      $(MAKE) include/proto.h; \
++      $(MAKE) include/build_env.h; \
++      $(MAKE) include/wrepld_proto.h; \
++      $(MAKE) nsswitch/winbindd_proto.h; \
++      $(MAKE) web/swat_proto.h; \
++      $(MAKE) client/client_proto.h; \
++      $(MAKE) utils/net_proto.h
++
++proto: headers 
++
++.PHONY: headers proto
++
++etags:
++      etags `find $(srcdir) -name "*.[ch]" | grep -v /CVS/`
++
++ctags:
++      ctags `find $(srcdir) -name "*.[ch]" | grep -v /CVS/`
++
++realclean: clean delheaders
++      -rm -f config.log bin/.dummy script/findsmb
++
++distclean: realclean
++      -rm -f include/stamp-h
++      -rm -f include/config.h Makefile
++      -rm -f config.status config.cache so_locations
++      -rm -rf .deps TAGS
++
++realdistclean: distclean
++      -rm -f include/config.h.in
++      -rm -f include/version.h
++      -rm -f configure
++
++# this target is really just for my use. It only works on a limited
++# range of machines and is used to produce a list of potentially
++# dead (ie. unused) functions in the code. (tridge)
++finddead:
++      nm */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
++      nm */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
++      comm -13 nmused.txt nmfns.txt 
++
++
++# when configure.in is updated, reconfigure
++$(srcdir)/configure: $(srcdir)/configure.in
++      @echo "WARNING: you need to rerun ./autogen.sh"
++
++config.status: $(srcdir)/configure
++      @echo "WARNING: you need to run ./configure"
++
++Makefile: $(srcdir)/Makefile.in config.status
++      @echo "WARNING: you need to run ./config.status"
++
++######################################################################
++# Samba Testing Framework
++
++# FIXME: LD_LIBRARY_PATH is not portable, but in the absence of
++# libtool I don't know a better way to do it.  Perhaps we should fix
++# libbigballofmud to link statically?
++
++check: check-programs
++      LD_LIBRARY_PATH="`pwd`/bin:$$LD_LIBRARY_PATH" \
++      PATH="`pwd`/bin:$$PATH" \
++      python stf/standardcheck.py; \
++      if test -n "$(PYTHON)"; then \
++              python stf/pythoncheck.py; \
++      fi
++
++# These are called by the test suite and need to be built before
++# running it.  For the time being we don't build all of BIN_PROGS,
++# because they're not all needed.
++check-programs: bin/t_strcmp bin/t_push_ucs2 bin/smbcontrol bin/t_snprintf
+diff -durN samba-3.0.1.orig/source/aclocal.m4 samba-3.0.1/source/aclocal.m4
+--- samba-3.0.1.orig/source/aclocal.m4 2003-11-07 18:37:32.000000000 +0100
++++ samba-3.0.1/source/aclocal.m4      2004-12-30 13:54:05.767874344 +0100
+@@ -496,12 +496,12 @@
+   $1=[$]ac_new_flags
+ ])
+     
+-dnl Removes -L/usr/lib/? from given variable
++dnl Removes -L/usr/lib64/? from given variable
+ AC_DEFUN(LIB_REMOVE_USR_LIB,[
+   ac_new_flags=""
+   for i in [$]$1; do
+     case [$]i in
+-    -L/usr/lib|-L/usr/lib/) ;;
++    -L/usr/lib64|-L/usr/lib64/) ;;
+     *) ac_new_flags="[$]ac_new_flags [$]i" ;;
+     esac
+   done
+@@ -632,9 +632,9 @@
+ ])
+ dnl LIB_ADD_DIR(LDFLAGS, $LIBDIR)
+-dnl This function doesn't add -L/usr/lib into LDFLAGS
++dnl This function doesn't add -L/usr/lib64 into LDFLAGS
+ AC_DEFUN(LIB_ADD_DIR,[
+-if test "$2" != "/usr/lib" ; then
++if test "$2" != "/usr/lib64" ; then
+     $1="$$1 -L$2"
+ fi
+ ])
+diff -durN samba-3.0.1.orig/source/aclocal.m4~ samba-3.0.1/source/aclocal.m4~
+--- samba-3.0.1.orig/source/aclocal.m4~        1970-01-01 01:00:00.000000000 +0100
++++ samba-3.0.1/source/aclocal.m4~     2003-11-07 18:37:32.000000000 +0100
+@@ -0,0 +1,730 @@
++dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(cmd)]
++dnl if the cache file is inconsistent with the current host,
++dnl target and build system types, execute CMD or print a default
++dnl error message.
++AC_DEFUN(AC_VALIDATE_CACHE_SYSTEM_TYPE, [
++    AC_REQUIRE([AC_CANONICAL_SYSTEM])
++    AC_MSG_CHECKING([config.cache system type])
++    if { test x"${ac_cv_host_system_type+set}" = x"set" &&
++         test x"$ac_cv_host_system_type" != x"$host"; } ||
++       { test x"${ac_cv_build_system_type+set}" = x"set" &&
++         test x"$ac_cv_build_system_type" != x"$build"; } ||
++       { test x"${ac_cv_target_system_type+set}" = x"set" &&
++         test x"$ac_cv_target_system_type" != x"$target"; }; then
++      AC_MSG_RESULT([different])
++      ifelse($#, 1, [$1],
++              [AC_MSG_ERROR(["you must remove config.cache and restart configure"])])
++    else
++      AC_MSG_RESULT([same])
++    fi
++    ac_cv_host_system_type="$host"
++    ac_cv_build_system_type="$build"
++    ac_cv_target_system_type="$target"
++])
++
++
++dnl test whether dirent has a d_off member
++AC_DEFUN(AC_DIRENT_D_OFF,
++[AC_CACHE_CHECK([for d_off in dirent], ac_cv_dirent_d_off,
++[AC_TRY_COMPILE([
++#include <unistd.h>
++#include <sys/types.h>
++#include <dirent.h>], [struct dirent d; d.d_off;],
++ac_cv_dirent_d_off=yes, ac_cv_dirent_d_off=no)])
++if test $ac_cv_dirent_d_off = yes; then
++  AC_DEFINE(HAVE_DIRENT_D_OFF,1,[Whether dirent has a d_off member])
++fi
++])
++
++dnl Mark specified module as shared
++dnl SMB_MODULE(name,static_files,shared_files,subsystem,whatif-static,whatif-shared)
++AC_DEFUN(SMB_MODULE,
++[
++      AC_MSG_CHECKING([how to build $1])
++      if test "$[MODULE_][$1]"; then
++              DEST=$[MODULE_][$1]
++      elif test "$[MODULE_]translit([$4], [A-Z], [a-z])" -a "$[MODULE_DEFAULT_][$1]"; then
++              DEST=$[MODULE_]translit([$4], [A-Z], [a-z])
++      else
++              DEST=$[MODULE_DEFAULT_][$1]
++      fi
++      
++      if test x"$DEST" = xSHARED; then
++              AC_DEFINE([$1][_init], [init_module], [Whether to build $1 as shared module])
++              $4_MODULES="$$4_MODULES $3"
++              AC_MSG_RESULT([shared])
++              [$6]
++              string_shared_modules="$string_shared_modules $1"
++      elif test x"$DEST" = xSTATIC; then
++              [init_static_modules_]translit([$4], [A-Z], [a-z])="$[init_static_modules_]translit([$4], [A-Z], [a-z]) $1_init();"
++              string_static_modules="$string_static_modules $1"
++              $4_STATIC="$$4_STATIC $2"
++              AC_SUBST($4_STATIC)
++              [$5]
++              AC_MSG_RESULT([static])
++      else
++          string_ignored_modules="$string_ignored_modules $1"
++              AC_MSG_RESULT([not])
++      fi
++])
++
++AC_DEFUN(SMB_SUBSYSTEM,
++[
++      AC_SUBST($1_STATIC)
++      AC_SUBST($1_MODULES)
++      AC_DEFINE_UNQUOTED([static_init_]translit([$1], [A-Z], [a-z]), [{$init_static_modules_]translit([$1], [A-Z], [a-z])[}], [Static init functions])
++      ifelse([$2], , :, [rm -f $2])
++])
++
++dnl AC_PROG_CC_FLAG(flag)
++AC_DEFUN(AC_PROG_CC_FLAG,
++[AC_CACHE_CHECK(whether ${CC-cc} accepts -$1, ac_cv_prog_cc_$1,
++[echo 'void f(){}' > conftest.c
++if test -z "`${CC-cc} -$1 -c conftest.c 2>&1`"; then
++  ac_cv_prog_cc_$1=yes
++else
++  ac_cv_prog_cc_$1=no
++fi
++rm -f conftest*
++])])
++
++dnl see if a declaration exists for a function or variable
++dnl defines HAVE_function_DECL if it exists
++dnl AC_HAVE_DECL(var, includes)
++AC_DEFUN(AC_HAVE_DECL,
++[
++ AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[
++    AC_TRY_COMPILE([$2],[int i = (int)$1],
++        ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)])
++ if test x"$ac_cv_have_$1_decl" = x"yes"; then
++    AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL],1,[Whether $1() is available])
++ fi
++])
++
++
++dnl check for a function in a library, but don't
++dnl keep adding the same library to the LIBS variable.
++dnl AC_LIBTESTFUNC(lib,func)
++AC_DEFUN(AC_LIBTESTFUNC,
++[case "$LIBS" in
++  *-l$1*) AC_CHECK_FUNCS($2) ;;
++  *) AC_CHECK_LIB($1, $2) 
++     AC_CHECK_FUNCS($2)
++  ;;
++  esac
++])
++
++# AC_CHECK_LIB_EXT(LIBRARY, [EXT_LIBS], [FUNCTION],
++#              [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
++#              [ADD-ACTION-IF-FOUND],[OTHER-LIBRARIES])
++# ------------------------------------------------------
++#
++# Use a cache variable name containing both the library and function name,
++# because the test really is for library $1 defining function $3, not
++# just for library $1.  Separate tests with the same $1 and different $3s
++# may have different results.
++#
++# Note that using directly AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$3])
++# is asking for trouble, since AC_CHECK_LIB($lib, fun) would give
++# ac_cv_lib_$lib_fun, which is definitely not what was meant.  Hence
++# the AS_LITERAL_IF indirection.
++#
++# FIXME: This macro is extremely suspicious.  It DEFINEs unconditionally,
++# whatever the FUNCTION, in addition to not being a *S macro.  Note
++# that the cache does depend upon the function we are looking for.
++#
++# It is on purpose we used `ac_check_lib_ext_save_LIBS' and not just
++# `ac_save_LIBS': there are many macros which don't want to see `LIBS'
++# changed but still want to use AC_CHECK_LIB_EXT, so they save `LIBS'.
++# And ``ac_save_LIBS' is too tempting a name, so let's leave them some
++# freedom.
++AC_DEFUN([AC_CHECK_LIB_EXT],
++[
++AH_CHECK_LIB_EXT([$1])
++ac_check_lib_ext_save_LIBS=$LIBS
++LIBS="-l$1 $$2 $7 $LIBS"
++AS_LITERAL_IF([$1],
++      [AS_VAR_PUSHDEF([ac_Lib_ext], [ac_cv_lib_ext_$1])],
++      [AS_VAR_PUSHDEF([ac_Lib_ext], [ac_cv_lib_ext_$1''])])dnl
++
++m4_ifval([$3],
++ [
++    AH_CHECK_FUNC_EXT([$3])
++    AS_LITERAL_IF([$1],
++              [AS_VAR_PUSHDEF([ac_Lib_func], [ac_cv_lib_ext_$1_$3])],
++              [AS_VAR_PUSHDEF([ac_Lib_func], [ac_cv_lib_ext_$1''_$3])])dnl
++    AC_CACHE_CHECK([for $3 in -l$1], ac_Lib_func,
++      [AC_TRY_LINK_FUNC($3,
++                 [AS_VAR_SET(ac_Lib_func, yes);
++                AS_VAR_SET(ac_Lib_ext, yes)],
++                 [AS_VAR_SET(ac_Lib_func, no);
++                AS_VAR_SET(ac_Lib_ext, no)])
++      ])
++    AS_IF([test AS_VAR_GET(ac_Lib_func) = yes],
++        [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$3))])dnl
++    AS_VAR_POPDEF([ac_Lib_func])dnl
++ ],[
++    AC_CACHE_CHECK([for -l$1], ac_Lib_ext,
++      [AC_TRY_LINK_FUNC([main],
++                 [AS_VAR_SET(ac_Lib_ext, yes)],
++                 [AS_VAR_SET(ac_Lib_ext, no)])
++      ])
++ ])
++LIBS=$ac_check_lib_ext_save_LIBS
++
++AS_IF([test AS_VAR_GET(ac_Lib_ext) = yes],
++    [m4_default([$4], 
++        [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
++              case "$$2" in
++                  *-l$1*)
++                      ;;
++                  *)
++                      $2="-l$1 $$2"
++                      ;;
++              esac])
++              [$6]
++          ],
++          [$5])dnl
++AS_VAR_POPDEF([ac_Lib_ext])dnl
++])# AC_CHECK_LIB_EXT
++
++# AH_CHECK_LIB_EXT(LIBNAME)
++# ---------------------
++m4_define([AH_CHECK_LIB_EXT],
++[AH_TEMPLATE(AS_TR_CPP(HAVE_LIB$1),
++             [Define to 1 if you have the `]$1[' library (-l]$1[).])])
++
++# AC_CHECK_FUNCS_EXT(FUNCTION, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
++# -----------------------------------------------------------------
++dnl check for a function in a $LIBS and $OTHER_LIBS libraries variable.
++dnl AC_CHECK_FUNC_EXT(func,OTHER_LIBS,IF-TRUE,IF-FALSE)
++AC_DEFUN([AC_CHECK_FUNC_EXT],
++[
++    AH_CHECK_FUNC_EXT($1)     
++    ac_check_func_ext_save_LIBS=$LIBS
++    LIBS="$2 $LIBS"
++    AS_VAR_PUSHDEF([ac_var], [ac_cv_func_ext_$1])dnl
++    AC_CACHE_CHECK([for $1], ac_var,
++      [AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
++                [AS_VAR_SET(ac_var, yes)],
++                [AS_VAR_SET(ac_var, no)])])
++    LIBS=$ac_check_func_ext_save_LIBS
++    AS_IF([test AS_VAR_GET(ac_var) = yes], 
++          [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1])) $3], 
++          [$4])dnl
++AS_VAR_POPDEF([ac_var])dnl
++])# AC_CHECK_FUNC
++
++# AH_CHECK_FUNC_EXT(FUNCNAME)
++# ---------------------
++m4_define([AH_CHECK_FUNC_EXT],
++[AH_TEMPLATE(AS_TR_CPP(HAVE_$1),
++             [Define to 1 if you have the `]$1[' function.])])
++
++dnl Define an AC_DEFINE with ifndef guard.
++dnl AC_N_DEFINE(VARIABLE [, VALUE])
++define(AC_N_DEFINE,
++[cat >> confdefs.h <<\EOF
++[#ifndef] $1
++[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
++[#endif]
++EOF
++])
++
++dnl Add an #include
++dnl AC_ADD_INCLUDE(VARIABLE)
++define(AC_ADD_INCLUDE,
++[cat >> confdefs.h <<\EOF
++[#include] $1
++EOF
++])
++
++dnl Copied from libtool.m4
++AC_DEFUN(AC_PROG_LD_GNU,
++[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
++[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
++if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
++  ac_cv_prog_gnu_ld=yes
++else
++  ac_cv_prog_gnu_ld=no
++fi])
++])
++
++# Configure paths for LIBXML2
++# Toshio Kuratomi 2001-04-21
++# Adapted from:
++# Configure paths for GLIB
++# Owen Taylor     97-11-3
++
++dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
++dnl Test for XML, and define XML_CFLAGS and XML_LIBS
++dnl
++AC_DEFUN(AM_PATH_XML2,[ 
++AC_ARG_WITH(xml-prefix,
++            [  --with-xml-prefix=PFX   Prefix where libxml is installed (optional)],
++            xml_config_prefix="$withval", xml_config_prefix="")
++AC_ARG_WITH(xml-exec-prefix,
++            [  --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
++            xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
++AC_ARG_ENABLE(xmltest,
++              [  --disable-xmltest       Do not try to compile and run a test LIBXML program],,
++              enable_xmltest=yes)
++
++  if test x$xml_config_exec_prefix != x ; then
++     xml_config_args="$xml_config_args --exec-prefix=$xml_config_exec_prefix"
++     if test x${XML2_CONFIG+set} != xset ; then
++        XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
++     fi
++  fi
++  if test x$xml_config_prefix != x ; then
++     xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
++     if test x${XML2_CONFIG+set} != xset ; then
++        XML2_CONFIG=$xml_config_prefix/bin/xml2-config
++     fi
++  fi
++
++  AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
++  min_xml_version=ifelse([$1], ,2.0.0,[$1])
++  AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
++  no_xml=""
++  if test "$XML2_CONFIG" = "no" ; then
++    no_xml=yes
++  else
++    XML_CFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
++    XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
++    xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
++           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
++    xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
++           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
++    xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
++           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
++    if test "x$enable_xmltest" = "xyes" ; then
++      ac_save_CFLAGS="$CFLAGS"
++      ac_save_LIBS="$LIBS"
++      CFLAGS="$CFLAGS $XML_CFLAGS"
++      LIBS="$XML_LIBS $LIBS"
++dnl
++dnl Now check if the installed libxml is sufficiently new.
++dnl (Also sanity checks the results of xml2-config to some extent)
++dnl
++      rm -f conf.xmltest
++      AC_TRY_RUN([
++#include <stdlib.h>
++#include <stdio.h>
++#include <string.h>
++#include <libxml/xmlversion.h>
++
++int 
++main()
++{
++  int xml_major_version, xml_minor_version, xml_micro_version;
++  int major, minor, micro;
++  char *tmp_version;
++
++  system("touch conf.xmltest");
++
++  /* Capture xml2-config output via autoconf/configure variables */
++  /* HP/UX 9 (%@#!) writes to sscanf strings */
++  tmp_version = (char *)strdup("$min_xml_version");
++  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
++     printf("%s, bad version string from xml2-config\n", "$min_xml_version");
++     exit(1);
++   }
++   free(tmp_version);
++
++   /* Capture the version information from the header files */
++   tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
++   if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
++     printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
++     exit(1);
++   }
++   free(tmp_version);
++
++ /* Compare xml2-config output to the libxml headers */
++  if ((xml_major_version != $xml_config_major_version) ||
++      (xml_minor_version != $xml_config_minor_version) ||
++      (xml_micro_version != $xml_config_micro_version))
++    {
++      printf("*** libxml header files (version %d.%d.%d) do not match\n",
++         xml_major_version, xml_minor_version, xml_micro_version);
++      printf("*** xml2-config (version %d.%d.%d)\n",
++         $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
++      return 1;
++    } 
++/* Compare the headers to the library to make sure we match */
++  /* Less than ideal -- doesn't provide us with return value feedback, 
++   * only exits if there's a serious mismatch between header and library.
++   */
++    LIBXML_TEST_VERSION;
++
++    /* Test that the library is greater than our minimum version */
++    if ((xml_major_version > major) ||
++        ((xml_major_version == major) && (xml_minor_version > minor)) ||
++        ((xml_major_version == major) && (xml_minor_version == minor) &&
++        (xml_micro_version >= micro)))
++      {
++        return 0;
++       }
++     else
++      {
++        printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
++               xml_major_version, xml_minor_version, xml_micro_version);
++        printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
++           major, minor, micro);
++        printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
++        printf("***\n");
++        printf("*** If you have already installed a sufficiently new version, this error\n");
++        printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
++        printf("*** being found. The easiest way to fix this is to remove the old version\n");
++        printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
++        printf("*** correct copy of xml2-config. (In this case, you will have to\n");
++        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
++        printf("*** so that the correct libraries are found at run-time))\n");
++    }
++  return 1;
++}
++],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
++       CFLAGS="$ac_save_CFLAGS"
++       LIBS="$ac_save_LIBS"
++     fi
++  fi
++
++  if test "x$no_xml" = x ; then
++     AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
++     ifelse([$2], , :, [$2])     
++  else
++     AC_MSG_RESULT(no)
++     if test "$XML2_CONFIG" = "no" ; then
++       echo "*** The xml2-config script installed by LIBXML could not be found"
++       echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
++       echo "*** your path, or set the XML2_CONFIG environment variable to the"
++       echo "*** full path to xml2-config."
++     else
++       if test -f conf.xmltest ; then
++        :
++       else
++          echo "*** Could not run libxml test program, checking why..."
++          CFLAGS="$CFLAGS $XML_CFLAGS"
++          LIBS="$LIBS $XML_LIBS"
++          AC_TRY_LINK([
++#include <libxml/xmlversion.h>
++#include <stdio.h>
++],      [ LIBXML_TEST_VERSION; return 0;],
++        [ echo "*** The test program compiled, but did not run. This usually means"
++          echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
++          echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
++          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
++          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
++          echo "*** is required on your system"
++          echo "***"
++          echo "*** If you have an old version installed, it is best to remove it, although"
++          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
++        [ echo "*** The test program failed to compile or link. See the file config.log for the"
++          echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
++          echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
++          echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
++          CFLAGS="$ac_save_CFLAGS"
++          LIBS="$ac_save_LIBS"
++       fi
++     fi
++
++     XML_CFLAGS=""
++     XML_LIBS=""
++     ifelse([$3], , :, [$3])
++  fi
++  AC_SUBST(XML_CFLAGS)
++  AC_SUBST(XML_LIBS)
++  rm -f conf.xmltest
++])
++
++# =========================================================================
++# AM_PATH_MYSQL : MySQL library
++
++dnl AM_PATH_MYSQL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
++dnl Test for MYSQL, and define MYSQL_CFLAGS and MYSQL_LIBS
++dnl
++AC_DEFUN(AM_PATH_MYSQL,
++[dnl
++dnl Get the cflags and libraries from the mysql_config script
++dnl
++AC_ARG_WITH(mysql-prefix,[  --with-mysql-prefix=PFX   Prefix where MYSQL is installed (optional)],
++            mysql_prefix="$withval", mysql_prefix="")
++AC_ARG_WITH(mysql-exec-prefix,[  --with-mysql-exec-prefix=PFX Exec prefix where MYSQL is installed (optional)],
++            mysql_exec_prefix="$withval", mysql_exec_prefix="")
++
++  if test x$mysql_exec_prefix != x ; then
++     mysql_args="$mysql_args --exec-prefix=$mysql_exec_prefix"
++     if test x${MYSQL_CONFIG+set} != xset ; then
++        MYSQL_CONFIG=$mysql_exec_prefix/bin/mysql_config
++     fi
++  fi
++  if test x$mysql_prefix != x ; then
++     mysql_args="$mysql_args --prefix=$mysql_prefix"
++     if test x${MYSQL_CONFIG+set} != xset ; then
++        MYSQL_CONFIG=$mysql_prefix/bin/mysql_config
++     fi
++  fi
++
++  AC_REQUIRE([AC_CANONICAL_TARGET])
++  AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no)
++  AC_MSG_CHECKING(for MYSQL)
++  no_mysql=""
++  if test "$MYSQL_CONFIG" = "no" ; then
++    MYSQL_CFLAGS=""
++    MYSQL_LIBS=""
++    AC_MSG_RESULT(no)
++     ifelse([$2], , :, [$2])
++  else
++    MYSQL_CFLAGS=`$MYSQL_CONFIG $mysqlconf_args --cflags | sed -e "s/'//g"`
++    MYSQL_LIBS=`$MYSQL_CONFIG $mysqlconf_args --libs | sed -e "s/'//g"`
++    AC_MSG_RESULT(yes)
++    ifelse([$1], , :, [$1])
++  fi
++  AC_SUBST(MYSQL_CFLAGS)
++  AC_SUBST(MYSQL_LIBS)
++])
++
++dnl Removes -I/usr/include/? from given variable
++AC_DEFUN(CFLAGS_REMOVE_USR_INCLUDE,[
++  ac_new_flags=""
++  for i in [$]$1; do
++    case [$]i in
++    -I/usr/include|-I/usr/include/) ;;
++    *) ac_new_flags="[$]ac_new_flags [$]i" ;;
++    esac
++  done
++  $1=[$]ac_new_flags
++])
++    
++dnl Removes -L/usr/lib/? from given variable
++AC_DEFUN(LIB_REMOVE_USR_LIB,[
++  ac_new_flags=""
++  for i in [$]$1; do
++    case [$]i in
++    -L/usr/lib|-L/usr/lib/) ;;
++    *) ac_new_flags="[$]ac_new_flags [$]i" ;;
++    esac
++  done
++  $1=[$]ac_new_flags
++])
++
++dnl From Bruno Haible.
++
++AC_DEFUN(jm_ICONV,
++[
++  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
++  dnl those with the standalone portable libiconv installed).
++  AC_MSG_CHECKING(for iconv in $1)
++    jm_cv_func_iconv="no"
++    jm_cv_lib_iconv=""
++    jm_cv_giconv=no
++    jm_save_LIBS="$LIBS"
++    LIBS="$LIBS -lbiconv"
++    AC_TRY_LINK([#include <stdlib.h>
++#include <biconv.h>],
++        [iconv_t cd = iconv_open("","");
++         iconv(cd,NULL,NULL,NULL,NULL);
++         iconv_close(cd);],
++      jm_cv_func_iconv=yes
++      jm_cv_biconv=yes
++      jm_cv_include="biconv.h"
++      jm_cv_lib_iconv="biconv")
++      LIBS="$jm_save_LIBS"
++
++    dnl Check for include in funny place but no lib needed
++    if test "$jm_cv_func_iconv" != yes; then 
++      AC_TRY_LINK([#include <stdlib.h>
++#include <giconv.h>],
++        [iconv_t cd = iconv_open("","");
++         iconv(cd,NULL,NULL,NULL,NULL);
++         iconv_close(cd);],
++         jm_cv_func_iconv=yes
++         jm_cv_include="giconv.h"
++         jm_cv_giconv="yes"
++         jm_cv_lib_iconv="")
++
++      dnl Standard iconv.h include, lib in glibc or libc ...
++      if test "$jm_cv_func_iconv" != yes; then
++        AC_TRY_LINK([#include <stdlib.h>
++#include <iconv.h>],
++          [iconv_t cd = iconv_open("","");
++           iconv(cd,NULL,NULL,NULL,NULL);
++           iconv_close(cd);],
++           jm_cv_include="iconv.h"
++           jm_cv_func_iconv=yes
++           jm_cv_lib_iconv="")
++
++          if test "$jm_cv_lib_iconv" != yes; then
++            jm_save_LIBS="$LIBS"
++            LIBS="$LIBS -lgiconv"
++            AC_TRY_LINK([#include <stdlib.h>
++#include <giconv.h>],
++              [iconv_t cd = iconv_open("","");
++               iconv(cd,NULL,NULL,NULL,NULL);
++               iconv_close(cd);],
++              jm_cv_lib_iconv=yes
++              jm_cv_func_iconv=yes
++              jm_cv_include="giconv.h"
++              jm_cv_giconv=yes
++              jm_cv_lib_iconv="giconv")
++
++           LIBS="$jm_save_LIBS"
++
++        if test "$jm_cv_func_iconv" != yes; then
++          jm_save_LIBS="$LIBS"
++          LIBS="$LIBS -liconv"
++          AC_TRY_LINK([#include <stdlib.h>
++#include <iconv.h>],
++            [iconv_t cd = iconv_open("","");
++             iconv(cd,NULL,NULL,NULL,NULL);
++             iconv_close(cd);],
++            jm_cv_include="iconv.h"
++            jm_cv_func_iconv=yes
++            jm_cv_lib_iconv="iconv")
++          LIBS="$jm_save_LIBS"
++        fi
++      fi
++    fi
++  fi
++  if test "$jm_cv_func_iconv" = yes; then
++    if test "$jm_cv_giconv" = yes; then
++      AC_DEFINE(HAVE_GICONV, 1, [What header to include for iconv() function: giconv.h])
++      AC_MSG_RESULT(yes)
++      ICONV_FOUND=yes
++    else
++      if test "$jm_cv_biconv" = yes; then
++        AC_DEFINE(HAVE_BICONV, 1, [What header to include for iconv() function: biconv.h])
++        AC_MSG_RESULT(yes)
++        ICONV_FOUND=yes
++      else 
++        AC_DEFINE(HAVE_ICONV, 1, [What header to include for iconv() function: iconv.h])
++        AC_MSG_RESULT(yes)
++        ICONV_FOUND=yes
++      fi
++    fi
++  else
++    AC_MSG_RESULT(no)
++  fi
++])
++
++AC_DEFUN(rjs_CHARSET,[
++  dnl Find out if we can convert from $1 to UCS2-LE
++  AC_MSG_CHECKING([can we convert from $1 to UCS2-LE?])
++  AC_TRY_RUN([
++#include <$jm_cv_include>
++main(){
++    iconv_t cd = iconv_open("$1", "UCS-2LE");
++    if (cd == 0 || cd == (iconv_t)-1) {
++      return -1;
++    }
++    return 0;
++}
++  ],ICONV_CHARSET=$1,ICONV_CHARSET=no,ICONV_CHARSET=cross)
++  AC_MSG_RESULT($ICONV_CHARSET)
++])
++
++dnl CFLAGS_ADD_DIR(CFLAGS, $INCDIR)
++dnl This function doesn't add -I/usr/include into CFLAGS
++AC_DEFUN(CFLAGS_ADD_DIR,[
++if test "$2" != "/usr/include" ; then
++    $1="$$1 -I$2"
++fi
++])
++
++dnl LIB_ADD_DIR(LDFLAGS, $LIBDIR)
++dnl This function doesn't add -L/usr/lib into LDFLAGS
++AC_DEFUN(LIB_ADD_DIR,[
++if test "$2" != "/usr/lib" ; then
++    $1="$$1 -L$2"
++fi
++])
++
++dnl AC_ENABLE_SHARED - implement the --enable-shared flag
++dnl Usage: AC_ENABLE_SHARED[(DEFAULT)]
++dnl   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
++dnl   `yes'.
++AC_DEFUN([AC_ENABLE_SHARED],
++[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
++AC_ARG_ENABLE(shared,
++changequote(<<, >>)dnl
++<<  --enable-shared[=PKGS]    build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
++changequote([, ])dnl
++[p=${PACKAGE-default}
++case $enableval in
++yes) enable_shared=yes ;;
++no) enable_shared=no ;;
++*)
++  enable_shared=no
++  # Look at the argument we got.  We use all the common list separators.
++  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
++  for pkg in $enableval; do
++    if test "X$pkg" = "X$p"; then
++      enable_shared=yes
++    fi
++
++  done
++  IFS="$ac_save_ifs"
++  ;;
++esac],
++enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
++])
++
++dnl AC_ENABLE_STATIC - implement the --enable-static flag
++dnl Usage: AC_ENABLE_STATIC[(DEFAULT)]
++dnl   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
++dnl   `yes'.
++AC_DEFUN([AC_ENABLE_STATIC],
++[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
++AC_ARG_ENABLE(static,
++changequote(<<, >>)dnl
++<<  --enable-static[=PKGS]    build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
++changequote([, ])dnl
++[p=${PACKAGE-default}
++case $enableval in
++yes) enable_static=yes ;;
++no) enable_static=no ;;
++*)
++  enable_static=no
++  # Look at the argument we got.  We use all the common list separators.
++  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
++  for pkg in $enableval; do
++    if test "X$pkg" = "X$p"; then
++      enable_static=yes
++    fi
++  done
++  IFS="$ac_save_ifs"
++  ;;
++esac],
++enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
++])
++
++dnl AC_DISABLE_STATIC - set the default static flag to --disable-static
++AC_DEFUN([AC_DISABLE_STATIC],
++[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
++AC_ENABLE_STATIC(no)])
++
++dnl AC_TRY_RUN_STRICT(PROGRAM,CFLAGS,CPPFLAGS,LDFLAGS,
++dnl           [ACTION-IF-TRUE],[ACTION-IF-FALSE],
++dnl           [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
++AC_DEFUN( [AC_TRY_RUN_STRICT],
++[
++      old_CFLAGS="$CFLAGS";
++      CFLAGS="$2";
++      export CFLAGS;
++      old_CPPFLAGS="$CPPFLAGS";
++      CPPFLAGS="$3";
++      export CPPFLAGS;
++      old_LDFLAGS="$LDFLAGS";
++      LDFLAGS="$4";
++      export LDFLAGS;
++      AC_TRY_RUN([$1],[$5],[$6],[$7]);
++      CFLAGS="$old_CFLAGS";
++      old_CFLAGS="";
++      export CFLAGS;
++      CPPFLAGS="$old_CPPFLAGS";
++      old_CPPFLAGS="";
++      export CPPFLAGS;
++      LDFLAGS="$old_LDFLAGS";
++      old_LDFLAGS="";
++      export LDFLAGS;
++])
+diff -durN samba-3.0.1.orig/source/configure.in samba-3.0.1/source/configure.in
+--- samba-3.0.1.orig/source/configure.in       2003-12-15 04:36:25.000000000 +0100
++++ samba-3.0.1/source/configure.in    2004-12-30 13:56:21.871183496 +0100
+@@ -22,7 +22,7 @@
+     mandir="\${prefix}/share/man"
+     logfilebase="\${VARDIR}/log/samba"
+     privatedir="\${CONFIGDIR}/private"
+-    libdir="\${prefix}/lib/samba"
++    libdir="\${prefix}/lib64/samba"
+     swatdir="\${DATADIR}/samba/swat",
+     configdir="\${LIBDIR}"
+     logfilebase="\${VARDIR}"
+@@ -825,7 +825,7 @@
+     _cppflags=${CPPFLAGS}
+     # Add additional search path
+-    LDFLAGS="-L$with_readline/lib $LDFLAGS"
++    LDFLAGS="-L$with_readline/lib64 $LDFLAGS"
+     CPPFLAGS="-I$with_readline/include $CPPFLAGS"
+     AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
+@@ -836,7 +836,7 @@
+        AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
+       done
+       AC_CHECK_LIB(readline, rl_callback_handler_install,
+-       [TERMLDFLAGS="-L$with_readline/lib"
++       [TERMLDFLAGS="-L$with_readline/lib64"
+        TERMCPPFLAGS="-I$with_readline/include"
+        CPPFLAGS="-I$with_readline/include $CPPFLAGS"
+        TERMLIBS="-lreadline $TERMLIBS"
+@@ -1615,7 +1615,7 @@
+ ICONV_LOCATION=standard
+ LOOK_DIRS="/usr /usr/local /sw"
+ AC_ARG_WITH(libiconv,
+-[  --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include (default=auto) ],
++[  --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib64 and BASEDIR/include (default=auto) ],
+ [
+   if test "$withval" = "no" ; then
+     AC_MSG_ERROR([argument to --with-libiconv must be a directory])
+@@ -1635,7 +1635,7 @@
+     CPPFLAGS="$CPPFLAGS -I$i/include"
+ dnl This is here to handle -withval stuff for --with-libiconv
+ dnl Perhaps we should always add a -L
+-    LDFLAGS="$LDFLAGS -L$i/lib"
++    LDFLAGS="$LDFLAGS -L$i/lib64"
+     LIBS=
+     export LDFLAGS LIBS CPPFLAGS
+ dnl Try to find iconv(3)
+@@ -1643,7 +1643,7 @@
+     if test "$ICONV_FOUND" = yes; then
+       LDFLAGS=$save_LDFLAG
+-        LIB_ADD_DIR(LDFLAGS, "$i/lib")
++        LIB_ADD_DIR(LDFLAGS, "$i/lib64")
+         CFLAGS_ADD_DIR(CPPFLAGS, "$i/include")
+         LIBS="$save_LIBS"
+         ICONV_LOCATION=$i
+@@ -1655,7 +1655,7 @@
+         # check for iconv in libc
+         ic_save_LIBS="$LIBS"
+         if test x"$ICONV_PATH_SPEC" = "xyes" ; then
+-           LIBS="$LIBS -L$ICONV_LOCATION/lib"
++           LIBS="$LIBS -L$ICONV_LOCATION/lib64"
+         fi
+         if test x"$jm_cv_lib_iconv" != x; then
+            LIBS="$LIBS -l$jm_cv_lib_iconv"
+@@ -1719,7 +1719,7 @@
+            fi
+          dnl Add the flags we need to CPPFLAGS and LDFLAGS
+          CFLAGS_ADD_DIR(CPPFLAGS, "$i/include")
+-         LIB_ADD_DIR(LDFLAGS, "$i/lib")
++         LIB_ADD_DIR(LDFLAGS, "$i/lib64")
+          export CPPFLAGS
+            AC_DEFINE(HAVE_NATIVE_ICONV,1,[Whether to use native iconv])
+          AC_DEFINE_UNQUOTED(DEFAULT_DOS_CHARSET,$default_dos_charset,[Default dos charset name])
+@@ -2468,7 +2468,7 @@
+         AC_MSG_RESULT($withval)
+         KRB5_CFLAGS="-I$withval/include"
+         KRB5_CPPFLAGS="-I$withval/include"
+-        KRB5_LDFLAGS="-L$withval/lib"
++        KRB5_LDFLAGS="-L$withval/lib64"
+         FOUND_KRB5=yes
+         ;;
+       esac ],
+@@ -2481,10 +2481,10 @@
+     # see if this box has the SuSE location for the heimdal krb implementation
+     AC_MSG_CHECKING(for /usr/include/heimdal)
+     if test -d /usr/include/heimdal; then
+-      if test -f /usr/lib/heimdal/lib/libkrb5.a; then
++      if test -f /usr/lib64/heimdal/lib/libkrb5.a; then
+           KRB5_CFLAGS="-I/usr/include/heimdal"
+           KRB5_CPPFLAGS="-I/usr/include/heimdal"
+-          KRB5_LDFLAGS="-L/usr/lib/heimdal/lib"
++          KRB5_LDFLAGS="-L/usr/lib64/heimdal/lib"
+           AC_MSG_RESULT(yes)
+       else
+           KRB5_CFLAGS="-I/usr/include/heimdal"
+@@ -4261,7 +4261,7 @@
+ builddir=`pwd`
+ AC_SUBST(builddir)
+-dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
++dnl Remove -L/usr/lib64/? from LDFLAGS and LIBS
+ LIB_REMOVE_USR_LIB(LDFLAGS)
+ LIB_REMOVE_USR_LIB(LIBS)
+diff -durN samba-3.0.1.orig/source/configure.in~ samba-3.0.1/source/configure.in~
+--- samba-3.0.1.orig/source/configure.in~      1970-01-01 01:00:00.000000000 +0100
++++ samba-3.0.1/source/configure.in~   2003-12-15 04:36:25.000000000 +0100
+@@ -0,0 +1,4280 @@
++dnl Process this file with autoconf to produce a configure script.
++
++dnl We must use autotools 2.53 or above
++AC_PREREQ(2.53)
++AC_INIT(include/includes.h)
++AC_CONFIG_HEADER(include/config.h)
++
++AC_DISABLE_STATIC
++AC_ENABLE_SHARED
++
++#################################################
++# Directory handling stuff to support both the
++# legacy SAMBA directories and FHS compliant
++# ones...
++AC_PREFIX_DEFAULT(/usr/local/samba)
++
++AC_ARG_WITH(fhs, 
++[  --with-fhs              Use FHS-compliant paths (default=no)],
++    configdir="${sysconfdir}/samba"
++    lockdir="\${VARDIR}/lib/samba"
++    piddir="\${VARDIR}/run"
++    mandir="\${prefix}/share/man"
++    logfilebase="\${VARDIR}/log/samba"
++    privatedir="\${CONFIGDIR}/private"
++    libdir="\${prefix}/lib/samba"
++    swatdir="\${DATADIR}/samba/swat",
++    configdir="\${LIBDIR}"
++    logfilebase="\${VARDIR}"
++    lockdir="\${VARDIR}/locks"
++    piddir="\${VARDIR}/locks"
++    privatedir="\${prefix}/private"
++    swatdir="\${prefix}/swat")
++
++#################################################
++# set private directory location
++AC_ARG_WITH(privatedir,
++[  --with-privatedir=DIR   Where to put smbpasswd ($ac_default_prefix/private)],
++[ case "$withval" in
++  yes|no)
++  #
++  # Just in case anybody calls it without argument
++  #
++    AC_MSG_WARN([--with-privatedir called without argument - will use default])
++  ;;
++  * )
++    privatedir="$withval"
++    ;;
++  esac])
++
++#################################################
++# set lock directory location
++AC_ARG_WITH(lockdir,
++[  --with-lockdir=DIR      Where to put lock files ($ac_default_prefix/var/locks)],
++[ case "$withval" in
++  yes|no)
++  #
++  # Just in case anybody calls it without argument
++  #
++    AC_MSG_WARN([--with-lockdir called without argument - will use default])
++  ;;
++  * )
++    lockdir="$withval"
++    ;;
++  esac])
++
++#################################################
++# set pid directory location
++AC_ARG_WITH(piddir,
++[  --with-piddir=DIR       Where to put pid files ($ac_default_prefix/var/locks)],
++[ case "$withval" in
++  yes|no)
++  #
++  # Just in case anybody calls it without argument
++  #
++    AC_MSG_WARN([--with-piddir called without argument - will use default])
++  ;;
++  * )
++    piddir="$withval"
++    ;;
++  esac])
++
++#################################################
++# set SWAT directory location
++AC_ARG_WITH(swatdir,
++[  --with-swatdir=DIR      Where to put SWAT files ($ac_default_prefix/swat)],
++[ case "$withval" in
++  yes|no)
++  #
++  # Just in case anybody does it
++  #
++    AC_MSG_WARN([--with-swatdir called without argument - will use default])
++  ;;
++  * )
++    swatdir="$withval"
++    ;;
++  esac])
++
++#################################################
++# set configuration directory location
++AC_ARG_WITH(configdir,
++[  --with-configdir=DIR    Where to put configuration files (\$libdir)],
++[ case "$withval" in
++  yes|no)
++  #
++  # Just in case anybody does it
++  #
++    AC_MSG_WARN([--with-configdir called without argument - will use default])
++  ;;
++  * )
++    configdir="$withval"
++    ;;
++  esac])
++
++#################################################
++# set log directory location
++AC_ARG_WITH(logfilebase,
++[  --with-logfilebase=DIR  Where to put log files (\$(VARDIR))],
++[ case "$withval" in
++  yes|no)
++  #
++  # Just in case anybody does it
++  #
++    AC_MSG_WARN([--with-logfilebase called without argument - will use default])
++  ;;
++  * )
++    logfilebase="$withval"
++    ;;
++  esac])
++
++AC_ARG_WITH(cfenc,
++[  --with-cfenc=HEADERDIR  Use internal CoreFoundation encoding API
++                        for optimization (Mac OS X/Darwin only)],
++[
++# May be in source $withval/CoreFoundation/StringEncodings.subproj.
++# Should have been in framework $withval/CoreFoundation.framework/Headers.
++for d in \
++    $withval/CoreFoundation/StringEncodings.subproj \
++    $withval/StringEncodings.subproj \
++    $withval/CoreFoundation.framework/Headers \
++    $withval/Headers \
++    $withval
++do
++    if test -r $d/CFStringEncodingConverter.h; then
++        ln -sfh $d include/CoreFoundation
++    fi
++done
++])
++
++AC_SUBST(configdir)
++AC_SUBST(lockdir)
++AC_SUBST(piddir)
++AC_SUBST(logfilebase)
++AC_SUBST(privatedir)
++AC_SUBST(swatdir)
++AC_SUBST(bindir)
++AC_SUBST(sbindir)
++
++dnl Unique-to-Samba variables we'll be playing with.
++AC_SUBST(SHELL)
++AC_SUBST(LDSHFLAGS)
++AC_SUBST(SONAMEFLAG)
++AC_SUBST(SHLD)
++AC_SUBST(HOST_OS)
++AC_SUBST(PICFLAGS)
++AC_SUBST(PICSUFFIX)
++AC_SUBST(POBAD_CC)
++AC_SUBST(SHLIBEXT)
++AC_SUBST(INSTALLCLIENT)
++AC_SUBST(INSTALLCLIENTCMD_SH)
++AC_SUBST(INSTALLCLIENTCMD_A)
++AC_SUBST(LIBSMBCLIENT_SHARED)
++AC_SUBST(LIBSMBCLIENT)
++AC_SUBST(PRINT_LIBS)
++AC_SUBST(AUTH_LIBS)
++AC_SUBST(ACL_LIBS)
++AC_SUBST(PASSDB_LIBS)
++AC_SUBST(IDMAP_LIBS)
++AC_SUBST(KRB5_LIBS)
++AC_SUBST(LDAP_LIBS)
++AC_SUBST(SHLIB_PROGS)
++AC_SUBST(SMBWRAPPER)
++AC_SUBST(EXTRA_BIN_PROGS)
++AC_SUBST(EXTRA_SBIN_PROGS)
++AC_SUBST(EXTRA_ALL_TARGETS)
++
++AC_ARG_ENABLE(debug, 
++[  --enable-debug          Turn on compiler debugging information (default=no)],
++    [if eval "test x$enable_debug = xyes"; then
++      CFLAGS="${CFLAGS} -g"
++    fi])
++
++AC_ARG_ENABLE(developer, [  --enable-developer      Turn on developer warnings and debugging (default=no)],
++    [if eval "test x$enable_developer = xyes"; then
++        developer=yes
++      CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
++    fi])
++
++AC_ARG_ENABLE(krb5developer, [  --enable-krb5developer  Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)],
++    [if eval "test x$enable_krb5developer = xyes"; then
++        developer=yes
++      CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
++    fi])
++
++AC_ARG_ENABLE(dmalloc, [  --enable-dmalloc        Enable heap debugging [default=no]])
++
++if test "x$enable_dmalloc" = xyes
++then
++      AC_DEFINE(ENABLE_DMALLOC, 1, [Define to turn on dmalloc debugging])
++      AC_DEFINE(DMALLOC_FUNC_CHECK, 1, 
++                  [Define to check invariants around some common functions])
++      LIBS="$LIBS -ldmalloc"  
++fi
++
++dnl Checks for programs.
++
++##
++## for some reason this macro resets the CFLAGS
++## so save and restore
++##
++OLD_CFLAGS=${CFLAGS}
++AC_PROG_CC
++CFLAGS=${OLD_CFLAGS}
++
++OLD_CFLAGS=${CFLAGS}
++AC_PROG_CPP
++CFLAGS=${OLD_CFLAGS}
++
++AC_PROG_INSTALL
++AC_PROG_AWK
++AC_PATH_PROG(PERL, perl)
++
++AC_CHECK_TOOL(AR, ar)
++
++# compile with optimization and without debugging by default, but
++# allow people to set their own preference.
++if test "x$CFLAGS" = x
++then
++  CFLAGS="-O ${CFLAGS}"
++fi
++
++dnl Check if we use GNU ld
++LD=ld
++AC_PROG_LD_GNU
++
++dnl needed before AC_TRY_COMPILE
++AC_ISC_POSIX
++
++dnl look for executable suffix
++AC_EXEEXT
++
++dnl Check if C compiler understands -c and -o at the same time
++AC_PROG_CC_C_O
++if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
++      BROKEN_CC=
++else
++      BROKEN_CC=#
++fi
++AC_SUBST(BROKEN_CC)
++
++dnl Check if the C compiler understands -Werror
++AC_CACHE_CHECK([that the C compiler understands -Werror],samba_cv_HAVE_Werror, [
++ AC_TRY_RUN_STRICT([
++  int main(void)
++  {
++      return 0;
++  }],[-Werror],[$CPPFLAGS],[$LDFLAGS],
++  samba_cv_HAVE_Werror=yes,samba_cv_HAVE_Werror=no,samba_cv_HAVE_Werror=cross)])
++if test x"$samba_cv_HAVE_Werror" = x"yes"; then
++   Werror_FLAGS="-Werror"
++else 
++dnl Check if the C compiler understands -w2
++AC_CACHE_CHECK([that the C compiler understands -w2],samba_cv_HAVE_w2, [
++ AC_TRY_RUN_STRICT([
++  int main(void)
++  {
++      return 0;
++  }],[-w2],[$CPPFLAGS],[$LDFLAGS],
++  samba_cv_HAVE_w2=yes,samba_cv_HAVE_w2=no,samba_cv_HAVE_w2=cross)])
++if test x"$samba_cv_HAVE_w2" = x"yes"; then
++   Werror_FLAGS="-w2"
++fi
++fi
++
++dnl Check if the C compiler understands volatile (it should, being ANSI).
++AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
++    AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
++      samba_cv_volatile=yes,samba_cv_volatile=no)])
++if test x"$samba_cv_volatile" = x"yes"; then
++   AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile])
++fi
++
++UNAME_S=`(uname -s) 2>/dev/null` || UNAME_S="unknown"
++AC_MSG_CHECKING(uname -s)
++AC_MSG_RESULT(${UNAME_S})
++
++UNAME_R=`(uname -r) 2>/dev/null` || UNAME_R="unknown"
++AC_MSG_CHECKING(uname -r)
++AC_MSG_RESULT(${UNAME_R})
++
++UNAME_M=`(uname -m) 2>/dev/null` || UNAME_M="unknown"
++AC_MSG_CHECKING(uname -m)
++AC_MSG_RESULT(${UNAME_M})
++
++UNAME_P=`(uname -p) 2>/dev/null` || UNAME_P="unknown"
++AC_MSG_CHECKING(uname -p)
++AC_MSG_RESULT(${UNAME_P})
++
++AC_CANONICAL_SYSTEM
++
++dnl Add #include for broken IRIX header files
++  case "$host_os" in
++      *irix6*) AC_ADD_INCLUDE(<standards.h>)
++      ;;
++esac
++
++AC_VALIDATE_CACHE_SYSTEM_TYPE
++
++DYNEXP=
++
++dnl Add modules that have to be built by default here
++dnl These have to be built static:
++default_static_modules="pdb_smbpasswd pdb_tdbsam rpc_lsa rpc_samr rpc_reg rpc_lsa_ds rpc_wks rpc_net rpc_dfs rpc_srv rpc_spoolss auth_rhosts auth_sam auth_unix auth_winbind auth_server auth_domain auth_builtin"
++
++dnl These are preferably build shared, and static if dlopen() is not available
++default_shared_modules="vfs_recycle vfs_audit vfs_extd_audit vfs_netatalk vfs_fake_perms vfs_default_quota vfs_readonly vfs_cap charset_CP850 charset_CP437"
++
++if test "x$developer" = xyes; then
++   default_static_modules="$default_static_modules rpc_echo"
++   default_shared_modules="$default_shared_modules charset_weird"
++fi
++
++#
++# Config CPPFLAG settings for strange OS's that must be set
++# before other tests.
++#
++case "$host_os" in
++# Try to work out if this is the native HPUX compiler that uses the -Ae flag.
++    *hpux*)
++    
++      AC_PROG_CC_FLAG(Ae)
++      # mmap on HPUX is completely broken...
++      AC_DEFINE(MMAP_BLACKLIST, 1, [Whether MMAP is broken])
++      if test $ac_cv_prog_cc_Ae = yes; then
++        CPPFLAGS="$CPPFLAGS -Ae"
++      fi
++#
++# Defines needed for HPUX support.
++# HPUX has bigcrypt but (sometimes?) doesn't use it for
++# password hashing - hence the USE_BOTH_CRYPT_CALLS define.
++#
++      case `uname -r` in
++                      *9*|*10*)
++                              CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4 -DMAX_POSITIVE_LOCK_OFFSET=0x1ffffffffffLL"
++                              AC_DEFINE(USE_BOTH_CRYPT_CALLS, 1, [Whether to use both of HPUX' crypt calls])
++                              AC_DEFINE(_HPUX_SOURCE, 1, [Whether to use HPUX extensions])
++                              AC_DEFINE(_POSIX_SOURCE, 1, [Whether to use POSIX compatible functions])
++                              AC_DEFINE(_ALIGNMENT_REQUIRED,1,[Required alignment])
++                              AC_DEFINE(_MAX_ALIGNMENT,4,[Maximum alignment])
++                              ;;
++                      *11*)
++                              CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4 -DMAX_POSITIVE_LOCK_OFFSET=0x1ffffffffffLL"
++                              AC_DEFINE(USE_BOTH_CRYPT_CALLS, 1, [Whether to use both of HPUX' crypt calls])
++                              AC_DEFINE(_HPUX_SOURCE, 1, [Whether to use HPUX extensions])
++                              AC_DEFINE(_POSIX_SOURCE, 1, [Whether to use POSIX compatible functions])
++                              AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to use large file support])
++                              AC_DEFINE(_ALIGNMENT_REQUIRED, 1, [Required alignment])
++                              AC_DEFINE(_MAX_ALIGNMENT, 4, [Maximum alignment])
++                              ;;
++      esac
++      DYNEXP="-Wl,-E"
++      ;;
++
++#
++# CRAY Unicos has broken const handling
++       *unicos*)
++        AC_MSG_RESULT([disabling const])
++        CPPFLAGS="$CPPFLAGS -Dconst="
++        ;;
++      
++#
++# AIX4.x doesn't even admit to having large
++# files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
++#
++    *aix4*)
++        AC_MSG_RESULT([enabling large file support])
++      CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
++        AC_DEFINE(_LARGE_FILES, 1, [Whether to enable large file support])
++      ;;    
++#
++# Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
++# to the existance of large files..
++# Note that -D_LARGEFILE64_SOURCE is different from the Sun
++# recommendations on large file support, however it makes the
++# compile work using gcc 2.7 and 2.8, whereas using the Sun
++# recommendation makes the compile fail on gcc2.7. JRA.
++#
++# Solaris uses SYSV printing.  Make sure to set that here.  --jerry
++#
++      *solaris*)
++              AC_DEFINE(SYSV, 1, [Whether to enable System V compatibility])
++              case `uname -r` in
++                      5.0*|5.1*|5.2*|5.3*|5.5*)
++                              AC_MSG_RESULT([no large file support])
++                              ;;
++                      5.*)
++                      AC_MSG_RESULT([enabling large file support])
++                      if test "$ac_cv_prog_gcc" = yes; then
++                              ${CC-cc} -v >conftest.c 2>&1
++                              ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
++                              rm -fr conftest.c
++                              case "$ac_cv_gcc_compiler_version_number" in
++                                      *"gcc version 2.6"*|*"gcc version 2.7"*)
++                                              CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
++                                              AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
++                                              ;;
++                                      *)
++                                              CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
++                                              AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
++                                              AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
++                                              ;;
++                              esac
++                      else
++                              CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
++                              AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
++                              AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
++                      fi
++                      ;;
++              esac
++              ;;
++#
++# IRIX uses SYSV printing.  Make sure to set that here
++#
++      *irix*)
++              AC_DEFINE(SYSV, 1, [Whether to enable System V compatibility])
++              ;;
++      *freebsd*)
++              AC_DEFINE(FREEBSD, 1, [Whether the host os is FreeBSD])
++              ;;
++#
++# VOS may need to have POSIX support and System V compatibility enabled.
++#
++    *vos*)
++    case "$CPPFLAGS" in
++        *-D_POSIX_C_SOURCE*)
++              ;;
++        *)
++              CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=199506L"
++              AC_DEFINE(_POSIX_C_SOURCE, 199506L, [Whether to enable POSIX support])
++              ;;
++    esac
++    case "$CPPFLAGS" in
++        *-D_SYSV*|*-D_SVID_SOURCE*)
++              ;;
++        *)
++              CPPFLAGS="$CPPFLAGS -D_SYSV"
++              AC_DEFINE(_SYSV, 1, [Whether to enable System V compatibility])
++    esac
++    ;;
++#
++# Tests needed for SINIX large file support.
++#
++    *sysv4*)
++      if test $host = mips-sni-sysv4 ; then
++        AC_MSG_CHECKING([for LFS support])
++        old_CPPFLAGS="$CPPFLAGS"
++        CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
++        AC_TRY_RUN([
++#include <unistd.h>
++main () {
++#if _LFS64_LARGEFILE == 1
++exit(0);
++#else
++exit(1);
++#endif
++}], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross])
++        CPPFLAGS="$old_CPPFLAGS"
++        if test x$SINIX_LFS_SUPPORT = xyes ; then
++          CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
++                AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
++          CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS"
++          LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS"
++          LIBS="`getconf LFS64_LIBS` $LIBS"
++        fi
++      AC_MSG_RESULT([$SINIX_LFS_SUPPORT])
++      fi
++    ;;
++
++# Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
++#
++    *linux*)
++        AC_MSG_CHECKING([for LFS support])
++        old_CPPFLAGS="$CPPFLAGS"
++        CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
++       AC_TRY_RUN([
++#include <unistd.h>
++#include <sys/utsname.h>
++main() {
++#if _LFS64_LARGEFILE == 1
++       struct utsname uts;
++       char *release;
++       int major, minor;
++
++       /* Ensure this is glibc 2.2 or higher */
++#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
++       int libc_major = __GLIBC__;
++       int libc_minor = __GLIBC_MINOR__;
++
++       if (libc_major < 2)
++              exit(1);
++       if (libc_minor < 2)
++              exit(1);
++#endif
++
++       /* Ensure this is kernel 2.4 or higher */
++
++       uname(&uts);
++       release = strdup(uts.release);
++       major = atoi(strsep(&release, "."));
++       minor = atoi(strsep(&release, "."));
++
++       if (major > 2 || (major == 2 && minor > 3))
++               exit(0);
++       exit(1);
++#else
++       exit(1);
++#endif
++}
++], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross])
++      CPPFLAGS="$old_CPPFLAGS"
++      if test x$LINUX_LFS_SUPPORT = xyes ; then
++              CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
++              AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
++              AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
++              AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
++      fi
++      AC_MSG_RESULT([$LINUX_LFS_SUPPORT])
++      ;;
++
++#
++# MacOS X is the *only* system that uses compose character in utf8. This
++# is so horribly broken....
++#
++    *darwin*)
++              AC_DEFINE(BROKEN_UNICODE_COMPOSE_CHARACTERS, 1, [Does this system use unicode compose characters])
++# Add Fink directories for various packages, like dlcompat.
++# Note: iconv does that explicitly below, but other packages
++# don't.
++              CPPFLAGS="$CPPFLAGS -I/sw/include"
++              LDFLAGS="$LDFLAGS -L/sw/lib"
++
++# If we have dlsym_prepend_underscore (from Fink's dlcompat),
++# use that instead of plain dlsym.
++
++              AC_CHECK_LIB(dl,dlopen)
++              AC_CHECK_FUNCS(dlsym_prepend_underscore,[CPPFLAGS="$CPPFLAGS -Ddlsym=dlsym_prepend_underscore"])
++
++#Add a system specific charset module.
++
++              default_shared_modules="$default_shared_modules charset_macosxfs"
++              old_CPPFLAGS="$CPPFLAGS"
++              CPPFLAGS="-Iinclude $CPPFLAGS" 
++              AC_CHECK_HEADERS([CoreFoundation/CFStringEncodingConverter.h], [], [AC_CHECK_HEADERS([CFStringEncodingConverter.h])])
++              CPPFLAGS="$old_CPPFLAGS"
++              ;;
++    *hurd*)
++        AC_MSG_CHECKING([for LFS support])
++        old_CPPFLAGS="$CPPFLAGS"
++        CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
++        AC_TRY_RUN([
++#include <unistd.h>
++main () {
++#if _LFS64_LARGEFILE == 1
++exit(0);
++#else
++exit(1);
++#endif
++}], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross])
++        CPPFLAGS="$old_CPPFLAGS"
++        if test x$GLIBC_LFS_SUPPORT = xyes ; then
++          CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
++                AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
++          AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
++        fi
++      AC_MSG_RESULT([$GLIBC_LFS_SUPPORT])
++    ;;
++
++esac
++
++AC_INLINE
++AC_HEADER_STDC
++AC_HEADER_DIRENT
++AC_HEADER_TIME
++AC_HEADER_SYS_WAIT
++AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
++AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
++AC_CHECK_HEADERS(rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
++AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
++AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
++AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
++AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
++AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h dlfcn.h)
++AC_CHECK_HEADERS(sys/syslog.h syslog.h execinfo.h)
++AC_CHECK_HEADERS(langinfo.h locale.h)
++
++# In valgrind 1.0.x, it's just valgrind.h.  In 1.9.x+ there's a
++# subdirectory of headers.
++AC_CHECK_HEADERS(valgrind.h valgrind/valgrind.h valgrind/memcheck.h)
++
++#
++# HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
++# This causes configure to fail to detect it. Check for shadow separately on HPUX.
++#
++case "$host_os" in
++    *hpux*)
++              AC_TRY_COMPILE([#include <shadow.h>],[struct spwd testme],
++                      ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no)
++              if test x"$ac_cv_header_shadow_h" = x"yes"; then
++                 AC_DEFINE(HAVE_SHADOW_H,1,[Whether we have shadow.h])
++              fi
++      ;;
++esac
++AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
++AC_CHECK_HEADERS(nss.h nss_common.h nsswitch.h ns_api.h sys/security.h security/pam_appl.h security/pam_modules.h)
++AC_CHECK_HEADERS(stropts.h poll.h)
++AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
++AC_CHECK_HEADERS(sys/acl.h sys/attributes.h attr/xattr.h sys/cdefs.h glob.h)
++
++# For experimental utmp support (lastlog on some BSD-like systems)
++AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h)
++ 
++AC_CHECK_SIZEOF(int,cross)
++AC_CHECK_SIZEOF(long,cross)
++AC_CHECK_SIZEOF(short,cross)
++
++AC_C_CONST
++AC_C_INLINE
++AC_C_BIGENDIAN
++AC_C_CHAR_UNSIGNED
++
++AC_TYPE_SIGNAL
++AC_TYPE_UID_T
++AC_TYPE_MODE_T
++AC_TYPE_OFF_T
++AC_TYPE_SIZE_T
++AC_TYPE_PID_T
++AC_STRUCT_ST_RDEV
++AC_DIRENT_D_OFF
++AC_CHECK_TYPE(ino_t,unsigned)
++AC_CHECK_TYPE(loff_t,off_t)
++AC_CHECK_TYPE(offset_t,loff_t)
++AC_CHECK_TYPE(ssize_t, int)
++AC_CHECK_TYPE(wchar_t, unsigned short)
++
++############################################
++# for cups support we need libcups, and a handful of header files
++
++AC_ARG_ENABLE(cups,
++[  --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,1,[Whether we have CUPS])
++              CFLAGS="$CFLAGS `$CUPS_CONFIG --cflags`"
++              LDFLAGS="$LDFLAGS `$CUPS_CONFIG --ldflags`"
++              PRINT_LIBS="$PRINT_LIBS `$CUPS_CONFIG --libs`"
++        fi
++fi
++
++############################################
++# we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the plugin loading code
++AC_SEARCH_LIBS(dlopen, [dl])
++# dlopen/dlclose/dlsym/dlerror will be checked again later and defines will be set then
++
++############################################
++# check if the compiler can do immediate structures
++AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [
++    AC_TRY_COMPILE([
++#include <stdio.h>],
++[
++   typedef struct {unsigned x;} FOOBAR;
++   #define X_FOOBAR(x) ((FOOBAR) { x })
++   #define FOO_ONE X_FOOBAR(1)
++   FOOBAR f = FOO_ONE;   
++   static struct {
++      FOOBAR y; 
++      } f2[] = {
++              {FOO_ONE}
++      };   
++],
++      samba_cv_immediate_structures=yes,samba_cv_immediate_structures=no)])
++if test x"$samba_cv_immediate_structures" = x"yes"; then
++   AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures])
++fi
++
++############################################
++# check if the compiler can do immediate structures
++AC_CACHE_CHECK([if the compiler will optimize out function calls],samba_cv_optimize_out_funcation_calls, [
++    AC_TRY_LINK([
++#include <stdio.h>],
++[
++              if (0) {
++                 this_function_does_not_exist();
++              } else {
++                return 1;
++              }
++
++],
++      samba_cv_optimize_out_funcation_calls=yes,samba_cv_optimize_out_funcation_calls=no)])
++if test x"$samba_cv_optimize_out_funcation_calls" = x"yes"; then
++   AC_DEFINE(HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS,1,[Whether the compiler will optimize out function calls])
++fi
++
++############################################
++# check for unix domain sockets
++AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [
++    AC_TRY_COMPILE([
++#include <sys/types.h>
++#include <stdlib.h>
++#include <stddef.h>
++#include <sys/socket.h>
++#include <sys/un.h>],
++[
++  struct sockaddr_un sunaddr; 
++  sunaddr.sun_family = AF_UNIX;
++],
++      samba_cv_unixsocket=yes,samba_cv_unixsocket=no)])
++if test x"$samba_cv_unixsocket" = x"yes"; then
++   AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixscoket support])
++fi
++
++
++AC_CACHE_CHECK([for socklen_t type],samba_cv_socklen_t, [
++    AC_TRY_COMPILE([
++#include <sys/types.h>
++#if STDC_HEADERS
++#include <stdlib.h>
++#include <stddef.h>
++#endif
++#include <sys/socket.h>],[socklen_t i = 0],
++      samba_cv_socklen_t=yes,samba_cv_socklen_t=no)])
++if test x"$samba_cv_socklen_t" = x"yes"; then
++   AC_DEFINE(HAVE_SOCKLEN_T_TYPE,1,[Whether we have the variable type socklen_t])
++fi
++
++AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
++    AC_TRY_COMPILE([
++#include <sys/types.h>
++#if STDC_HEADERS
++#include <stdlib.h>
++#include <stddef.h>
++#endif
++#include <signal.h>],[sig_atomic_t i = 0],
++      samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
++if test x"$samba_cv_sig_atomic_t" = x"yes"; then
++   AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type])
++fi
++
++# stupid headers have the functions but no declaration. grrrr.
++AC_HAVE_DECL(errno, [#include <errno.h>])
++AC_HAVE_DECL(setresuid, [#include <unistd.h>])
++AC_HAVE_DECL(setresgid, [#include <unistd.h>])
++AC_HAVE_DECL(asprintf, [#include <stdio.h>])
++AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
++AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
++AC_HAVE_DECL(snprintf, [#include <stdio.h>])
++
++# and glibc has setresuid under linux but the function does
++# nothing until kernel 2.1.44! very dumb.
++AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
++    AC_TRY_RUN([#include <errno.h>
++main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
++      samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
++if test x"$samba_cv_have_setresuid" = x"yes"; then
++    AC_DEFINE(HAVE_SETRESUID,1,[Whether the system has setresuid])
++fi
++
++# Do the same check for setresguid...
++#
++AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
++    AC_TRY_RUN([#include <unistd.h>
++#include <errno.h>
++main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
++      samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
++if test x"$samba_cv_have_setresgid" = x"yes"; then
++    AC_DEFINE(HAVE_SETRESGID,1,[Whether the system has setresgid])
++fi
++
++AC_FUNC_MEMCMP
++
++###############################################
++# Readline included by default unless explicitly asked not to
++test "${with_readline+set}" != "set" && with_readline=yes
++
++# test for where we get readline() from
++AC_MSG_CHECKING(whether to use readline)
++AC_ARG_WITH(readline,
++[  --with-readline[=DIR]     Look for readline include/libs in DIR (default=auto) ],
++[  case "$with_readline" in
++  yes)
++    AC_MSG_RESULT(yes)
++
++    AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
++    AC_CHECK_HEADERS(readline/history.h)
++
++    AC_CHECK_HEADERS(readline.h readline/readline.h,[
++      for termlib in ncurses curses termcap terminfo termlib tinfo; do
++       AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
++      done
++      AC_CHECK_LIB(readline, rl_callback_handler_install,
++       [TERMLIBS="-lreadline $TERMLIBS"
++       AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline])
++       break], [TERMLIBS=], $TERMLIBS)])
++    ;;
++  no)
++    AC_MSG_RESULT(no)
++    ;;
++  *)
++    AC_MSG_RESULT(yes)
++
++    # Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
++    # alternate readline path
++    _ldflags=${LDFLAGS}
++    _cppflags=${CPPFLAGS}
++
++    # Add additional search path
++    LDFLAGS="-L$with_readline/lib $LDFLAGS"
++    CPPFLAGS="-I$with_readline/include $CPPFLAGS"
++
++    AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
++    AC_CHECK_HEADERS(readline/history.h)
++
++    AC_CHECK_HEADERS(readline.h readline/readline.h,[
++      for termlib in ncurses curses termcap terminfo termlib; do
++       AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
++      done
++      AC_CHECK_LIB(readline, rl_callback_handler_install,
++       [TERMLDFLAGS="-L$with_readline/lib"
++       TERMCPPFLAGS="-I$with_readline/include"
++       CPPFLAGS="-I$with_readline/include $CPPFLAGS"
++       TERMLIBS="-lreadline $TERMLIBS"
++       AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline])
++       break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)])
++
++    LDFLAGS=$_ldflags
++    ;;
++  esac],
++  AC_MSG_RESULT(no)
++)
++AC_SUBST(TERMLIBS)
++AC_SUBST(TERMLDFLAGS)
++
++# The readline API changed slightly from readline3 to readline4, so
++# code will generate warnings on one of them unless we have a few
++# special cases.
++AC_CHECK_LIB(readline, rl_completion_matches,
++           [AC_DEFINE(HAVE_NEW_LIBREADLINE, 1, 
++                      [Do we have rl_completion_matches?])],
++           [],
++           [$TERMLIBS])
++
++# The following test taken from the cvs sources
++# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
++# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
++# libsocket.so which has a bad implementation of gethostbyname (it
++# only looks in /etc/hosts), so we only look for -lsocket if we need
++# it.
++AC_CHECK_FUNCS(connect)
++if test x"$ac_cv_func_connect" = x"no"; then
++    case "$LIBS" in
++    *-lnsl*) ;;
++    *) AC_CHECK_LIB(nsl_s, printf) ;;
++    esac
++    case "$LIBS" in
++    *-lnsl*) ;;
++    *) AC_CHECK_LIB(nsl, printf) ;;
++    esac
++    case "$LIBS" in
++    *-lsocket*) ;;
++    *) AC_CHECK_LIB(socket, connect) ;;
++    esac
++    case "$LIBS" in
++    *-linet*) ;;
++    *) AC_CHECK_LIB(inet, connect) ;;
++    esac
++    dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
++    dnl has been cached.
++    if test x"$ac_cv_lib_socket_connect" = x"yes" || 
++       test x"$ac_cv_lib_inet_connect" = x"yes"; then
++        # ac_cv_func_connect=yes
++        # don't!  it would cause AC_CHECK_FUNC to succeed next time configure is run
++        AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()])
++    fi
++fi
++
++###############################################
++# test for where we get yp_get_default_domain() from
++AC_SEARCH_LIBS(yp_get_default_domain, [nsl])
++AC_CHECK_FUNCS(yp_get_default_domain)
++
++# Check if we have execl, if not we need to compile smbrun.
++AC_CHECK_FUNCS(execl)
++if test x"$ac_cv_func_execl" = x"no"; then
++    EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbrun\$(EXEEXT)"
++fi
++
++AC_CHECK_FUNCS(dlopen dlclose dlsym dlerror waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
++AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat setpgid)
++AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
++AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
++AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf realpath)
++AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64)
++AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
++AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
++AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
++AC_CHECK_FUNCS(syslog vsyslog timegm)
++AC_CHECK_FUNCS(setlocale nl_langinfo)
++# setbuffer, shmget, shm_open are needed for smbtorture
++AC_CHECK_FUNCS(setbuffer shmget shm_open backtrace_symbols)
++
++# syscall() is needed for smbwrapper.
++AC_CHECK_FUNCS(syscall)
++
++AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
++AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
++AC_CHECK_FUNCS(__getcwd _getcwd)
++AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
++AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
++AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
++AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
++AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
++AC_CHECK_FUNCS(getdirentries _write __write _fork __fork)
++AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
++AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
++AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
++AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
++AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
++
++#
++# 
++#
++case "$host_os" in
++    *linux*)
++       # glibc <= 2.3.2 has a broken getgrouplist
++       AC_TRY_RUN([
++#include <unistd.h>
++#include <sys/utsname.h>
++main() {
++       /* glibc up to 2.3 has a broken getgrouplist */
++#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
++       int libc_major = __GLIBC__;
++       int libc_minor = __GLIBC_MINOR__;
++
++       if (libc_major < 2)
++              exit(1);
++       if ((libc_major == 2) && (libc_minor <= 3))
++              exit(1);
++#endif
++       exit(0);
++}
++], [linux_getgrouplist_ok=yes], [linux_getgrouplist_ok=no])
++       if test x"$linux_getgrouplist_ok" = x"yes"; then
++          AC_DEFINE(HAVE_GETGROUPLIST, 1, [Have good getgrouplist])
++       fi
++       ;;
++    *)
++       AC_CHECK_FUNCS(getgrouplist)
++       ;;
++esac
++
++#
++# stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
++#
++
++if test x$ac_cv_func_stat64 = xno ; then
++  AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
++  AC_TRY_LINK([
++#if defined(HAVE_UNISTD_H)
++#include <unistd.h>
++#endif
++#include <sys/stat.h>
++], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes])
++  AC_MSG_RESULT([$ac_cv_func_stat64])
++  if test x$ac_cv_func_stat64 = xyes ; then
++    AC_DEFINE(HAVE_STAT64,1,[Whether stat64() is available])
++  fi
++fi
++
++if test x$ac_cv_func_lstat64 = xno ; then
++  AC_MSG_CHECKING([for lstat64 in <sys/stat.h>])
++  AC_TRY_LINK([
++#if defined(HAVE_UNISTD_H)
++#include <unistd.h>
++#endif
++#include <sys/stat.h>
++], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes])
++  AC_MSG_RESULT([$ac_cv_func_lstat64])
++  if test x$ac_cv_func_lstat64 = xyes ; then
++    AC_DEFINE(HAVE_LSTAT64,[Whether lstat64() is available])
++  fi
++fi
++
++if test x$ac_cv_func_fstat64 = xno ; then
++  AC_MSG_CHECKING([for fstat64 in <sys/stat.h>])
++  AC_TRY_LINK([
++#if defined(HAVE_UNISTD_H)
++#include <unistd.h>
++#endif
++#include <sys/stat.h>
++], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes])
++  AC_MSG_RESULT([$ac_cv_func_fstat64])
++  if test x$ac_cv_func_fstat64 = xyes ; then
++    AC_DEFINE(HAVE_FSTAT64,1,[Whether fstat64() is available])
++  fi
++fi
++
++#####################################
++# we might need the resolv library on some systems
++AC_CHECK_LIB(resolv, dn_expand)
++
++#
++# Check for the functions putprpwnam, set_auth_parameters,
++# getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
++# Needed for OSF1 and HPUX.
++#
++
++AC_LIBTESTFUNC(security, putprpwnam)
++AC_LIBTESTFUNC(sec, putprpwnam)
++
++AC_LIBTESTFUNC(security, set_auth_parameters)
++AC_LIBTESTFUNC(sec, set_auth_parameters)
++
++# UnixWare 7.x has its getspnam in -lgen
++AC_LIBTESTFUNC(gen, getspnam)
++
++AC_LIBTESTFUNC(security, getspnam)
++AC_LIBTESTFUNC(sec, getspnam)
++
++AC_LIBTESTFUNC(security, bigcrypt)
++AC_LIBTESTFUNC(sec, bigcrypt)
++
++AC_LIBTESTFUNC(security, getprpwnam)
++AC_LIBTESTFUNC(sec, getprpwnam)
++
++############################################
++# Check if we have libattr
++AC_SEARCH_LIBS(getxattr, [attr])
++AC_CHECK_FUNCS(getxattr lgetxattr fgetxattr listxattr llistxattr)
++AC_CHECK_FUNCS(flistxattr removexattr lremovexattr fremovexattr)
++AC_CHECK_FUNCS(setxattr lsetxattr fsetxattr)
++AC_CHECK_FUNCS(attr_get attr_list attr_set attr_remove)
++AC_CHECK_FUNCS(attr_getf attr_listf attr_setf attr_removef)
++
++# Assume non-shared by default and override below
++BLDSHARED="false"
++
++# these are the defaults, good for lots of systems
++HOST_OS="$host_os"
++LDSHFLAGS="-shared"
++SONAMEFLAG="#"
++SHLD="\${CC} \${CFLAGS}"
++PICFLAGS=""
++PICSUFFIX="po"
++POBAD_CC="#"
++SHLIBEXT="so"
++
++if test "$enable_shared" = "yes"; then
++  # this bit needs to be modified for each OS that is suported by
++  # smbwrapper. You need to specify how to created a shared library and
++  # how to compile C code to produce PIC object files
++
++  AC_MSG_CHECKING([ability to build shared libraries])
++
++  # and these are for particular systems
++  case "$host_os" in
++              *linux*)   AC_DEFINE(LINUX,1,[Whether the host os is linux])
++                      BLDSHARED="true"
++                      LDSHFLAGS="-shared" 
++                      DYNEXP="-Wl,--export-dynamic"
++                      PICFLAGS="-fPIC"
++                      SONAMEFLAG="-Wl,-soname="
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512)
++                      ;;
++              *solaris*) AC_DEFINE(SUNOS5,1,[Whether the host os is solaris])
++                      BLDSHARED="true"
++                      LDSHFLAGS="-G"
++                      SONAMEFLAG="-h "
++                      if test "${GCC}" = "yes"; then
++                              PICFLAGS="-fPIC"
++                              if test "${ac_cv_prog_gnu_ld}" = "yes"; then
++                                      DYNEXP="-Wl,-E"
++                              fi
++                      else
++                              PICFLAGS="-KPIC"
++                              ## ${CFLAGS} added for building 64-bit shared 
++                              ## libs using Sun's Compiler
++                              LDSHFLAGS="-G \${CFLAGS}"
++                              POBAD_CC=""
++                              PICSUFFIX="po.o"
++                      fi
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
++                      AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
++                      ;;
++              *sunos*) AC_DEFINE(SUNOS4,1,[Whether the host os is sunos4])
++                      BLDSHARED="true"
++                      LDSHFLAGS="-G"
++                      SONAMEFLAG="-Wl,-h,"
++                      PICFLAGS="-KPIC"   # Is this correct for SunOS
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512)
++                      AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
++                      ;;
++              *netbsd* | *freebsd*)  BLDSHARED="true"
++                      LDSHFLAGS="-shared"
++                      DYNEXP="-Wl,--export-dynamic"
++                      SONAMEFLAG="-Wl,-soname,"
++                      PICFLAGS="-fPIC -DPIC"
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
++                      AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
++                      ;;
++              *openbsd*)  BLDSHARED="true"
++                      LDSHFLAGS="-shared"
++                      DYNEXP="-Wl,-Bdynamic"
++                      SONAMEFLAG="-Wl,-soname,"
++                      PICFLAGS="-fPIC"
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
++                      AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
++                      ;;
++              *irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix])
++                      case "$host_os" in
++                      *irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6])
++                      ;;
++                      esac
++                      BLDSHARED="true"
++                      LDSHFLAGS="-set_version sgi1.0 -shared"
++                      SONAMEFLAG="-soname "
++                      SHLD="\${LD}"
++                      if test "${GCC}" = "yes"; then
++                              PICFLAGS="-fPIC"
++                      else 
++                              PICFLAGS="-KPIC"
++                      fi
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
++                      ;;
++              *aix*) AC_DEFINE(AIX,1,[Whether the host os is aix])
++                      BLDSHARED="true"
++                      LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry,-berok"
++                      DYNEXP="-Wl,-brtl,-bexpall"
++                      PICFLAGS="-O2"
++                      if test "${GCC}" != "yes"; then
++                              ## for funky AIX compiler using strncpy()
++                              CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000"
++                      fi
++
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE,[The size of a block])
++                      ;;
++              *hpux*) AC_DEFINE(HPUX,1,[Whether the host os is HPUX])
++                      SHLIBEXT="sl"
++                      # Use special PIC flags for the native HP-UX compiler.
++                      if test $ac_cv_prog_cc_Ae = yes; then
++                              BLDSHARED="true"
++                              SHLD="/usr/bin/ld"
++                              LDSHFLAGS="-B symbolic -b -z"
++                              SONAMEFLAG="+h "
++                              PICFLAGS="+z"
++                      elif test "${GCC}" = "yes"; then
++                              PICFLAGS="-fPIC"
++                      fi
++                      DYNEXP="-Wl,-E"
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,8192,[The size of a block])
++                      AC_DEFINE(POSIX_ACL_NEEDS_MASK,1,[Does a POSIX ACL need a mask element])
++                      ;;
++              *qnx*) AC_DEFINE(QNX,1,[Whether the host os is qnx])
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512)
++                      ;;
++              *osf*) AC_DEFINE(OSF1,1,[Whether the host os is osf1])
++                      BLDSHARED="true"
++                      LDSHFLAGS="-shared"
++                      SONAMEFLAG="-Wl,-soname,"
++                      PICFLAGS="-fPIC"
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512)
++                      AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
++                      ;;
++              *sco*) AC_DEFINE(SCO,1,[Whether the host os is sco unix])
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512)
++                      ;;
++              *unixware*) AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware])
++                      BLDSHARED="true"
++                      LDSHFLAGS="-shared"
++                      SONAMEFLAG="-Wl,-soname,"
++                      PICFLAGS="-KPIC"
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512)
++                      ;;
++              *next2*) AC_DEFINE(NEXT2,1,[Whether the host os is NeXT v2])
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512)
++                      ;;
++              *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man])
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512)
++                      ;;
++              *sysv4*) AC_DEFINE(SYSV,1,[Whether this is a system V system])
++                      case "$host" in
++                              *-univel-*)     if [ test "$GCC" != yes ]; then
++                                              AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available])
++                                      fi
++                                      LDSHFLAGS="-G"
++                                      DYNEXP="-Bexport"
++                              ;;
++                              *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX,1,[Whether the host os is reliantunix]);;
++                      esac
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512)
++                      ;;
++
++              *sysv5*) AC_DEFINE(SYSV,1,[Whether this is a system V system])
++                      if [ test "$GCC" != yes ]; then
++                              AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available])
++                      fi
++                      LDSHFLAGS="-G"
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512)
++                      ;;
++              *vos*) AC_DEFINE(STAT_ST_BLOCKSIZE,4096)
++                      BLDSHARED="false"
++                      LDSHFLAGS=""
++                      ;;
++
++              *darwin*)   AC_DEFINE(DARWINOS,1,[Whether the host os is Darwin/MacOSX])
++                      BLDSHARED="true"
++                      LDSHFLAGS="-bundle -flat_namespace -undefined suppress"
++                      SHLIBEXT="dylib"
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512)
++                      ;;
++
++              *)
++                      AC_DEFINE(STAT_ST_BLOCKSIZE,512)
++                      ;;
++  esac
++  AC_SUBST(DYNEXP)
++  AC_MSG_RESULT($BLDSHARED)
++  AC_MSG_CHECKING([linker flags for shared libraries])
++  AC_MSG_RESULT([$LDSHFLAGS])
++  AC_MSG_CHECKING([compiler flags for position-independent code])
++  AC_MSG_RESULT([$PICFLAGS])
++fi
++
++#######################################################
++# test whether building a shared library actually works
++if test $BLDSHARED = true; then
++AC_CACHE_CHECK([whether building shared libraries actually works], 
++               [ac_cv_shlib_works],[
++   ac_cv_shlib_works=no
++   # try building a trivial shared library
++   $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o \
++      shlib.$PICSUFFIX ${srcdir-.}/tests/shlib.c && \
++      $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" \
++      shlib.$PICSUFFIX && \
++      ac_cv_shlib_works=yes
++   rm -f "shlib.$SHLIBEXT" shlib.$PICSUFFIX
++])
++if test $ac_cv_shlib_works = no; then
++   BLDSHARED=false
++fi
++fi
++
++################
++
++AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
++AC_TRY_RUN([#include <stdio.h>
++main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
++samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
++if test x"$samba_cv_have_longlong" = x"yes"; then
++    AC_DEFINE(HAVE_LONGLONG,1,[Whether the host supports long long's])
++fi
++
++#
++# Check if the compiler supports the LL prefix on long long integers.
++# AIX needs this.
++
++AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
++    AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
++      samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
++if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
++   AC_DEFINE(COMPILER_SUPPORTS_LL,1,[Whether the compiler supports the LL prefix on long long integers])
++fi
++
++  
++AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
++AC_TRY_RUN([#include <stdio.h>
++#include <sys/stat.h>
++main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
++samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
++if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
++    AC_DEFINE(SIZEOF_OFF_T,8,[The size of the 'off_t' type])
++fi
++
++AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
++AC_TRY_RUN([
++#if defined(HAVE_UNISTD_H)
++#include <unistd.h>
++#endif
++#include <stdio.h>
++#include <sys/stat.h>
++main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
++samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
++if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
++    AC_DEFINE(HAVE_OFF64_T,1,[Whether off64_t is available])
++fi
++
++AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
++AC_TRY_RUN([#include <stdio.h>
++#include <sys/stat.h>
++main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
++samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
++if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
++    AC_DEFINE(SIZEOF_INO_T,8,[The size of the 'ino_t' type])
++fi
++
++AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
++AC_TRY_RUN([
++#if defined(HAVE_UNISTD_H)
++#include <unistd.h>
++#endif
++#include <stdio.h>
++#include <sys/stat.h>
++main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
++samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
++if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
++    AC_DEFINE(HAVE_INO64_T,1,[Whether the 'ino64_t' type is available])
++fi
++
++AC_CACHE_CHECK([for dev64_t],samba_cv_HAVE_DEV64_T,[
++AC_TRY_RUN([
++#if defined(HAVE_UNISTD_H)
++#include <unistd.h>
++#endif
++#include <stdio.h>
++#include <sys/stat.h>
++main() { struct stat64 st; dev64_t s; if (sizeof(dev_t) == sizeof(dev64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
++samba_cv_HAVE_DEV64_T=yes,samba_cv_HAVE_DEV64_T=no,samba_cv_HAVE_DEV64_T=cross)])
++if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then
++    AC_DEFINE(HAVE_DEV64_T,1,[Whether the 'dev64_t' type is available])
++fi
++
++AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
++AC_TRY_COMPILE([
++#if defined(HAVE_UNISTD_H)
++#include <unistd.h>
++#endif
++#include <sys/types.h>
++#include <dirent.h>],
++[struct dirent64 de;],
++samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
++if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes" && test x"$ac_cv_func_readdir64" = x"yes"; then
++    AC_DEFINE(HAVE_STRUCT_DIRENT64,1,[Whether the 'dirent64' struct is available])
++fi
++
++AC_CACHE_CHECK([for major macro],samba_cv_HAVE_DEVICE_MAJOR_FN,[
++AC_TRY_RUN([
++#if defined(HAVE_UNISTD_H)
++#include <unistd.h>
++#endif
++#include <sys/types.h>
++main() { dev_t dev; int i = major(dev); return 0; }],
++samba_cv_HAVE_DEVICE_MAJOR_FN=yes,samba_cv_HAVE_DEVICE_MAJOR_FN=no,samba_cv_HAVE_DEVICE_MAJOR_FN=cross)])
++if test x"$samba_cv_HAVE_DEVICE_MAJOR_FN" = x"yes"; then
++    AC_DEFINE(HAVE_DEVICE_MAJOR_FN,1,[Whether the major macro for dev_t is available])
++fi
++
++AC_CACHE_CHECK([for minor macro],samba_cv_HAVE_DEVICE_MINOR_FN,[
++AC_TRY_RUN([
++#if defined(HAVE_UNISTD_H)
++#include <unistd.h>
++#endif
++#include <sys/types.h>
++main() { dev_t dev; int i = minor(dev); return 0; }],
++samba_cv_HAVE_DEVICE_MINOR_FN=yes,samba_cv_HAVE_DEVICE_MINOR_FN=no,samba_cv_HAVE_DEVICE_MINOR_FN=cross)])
++if test x"$samba_cv_HAVE_DEVICE_MINOR_FN" = x"yes"; then
++    AC_DEFINE(HAVE_DEVICE_MINOR_FN,1,[Whether the minor macro for dev_t is available])
++fi
++
++AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
++AC_TRY_RUN([#include <stdio.h>
++main() { char c; c=250; exit((c > 0)?0:1); }],
++samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
++if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
++    AC_DEFINE(HAVE_UNSIGNED_CHAR,1,[Whether the 'unsigned char' type is available])
++fi
++
++AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <sys/socket.h>
++#include <netinet/in.h>],
++[struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
++samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
++if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
++    AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
++fi
++
++AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <dirent.h>
++void seekdir(DIR *d, long loc) { return; }],[return 0;],
++samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
++if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
++    AC_DEFINE(SEEKDIR_RETURNS_VOID,1,[Whether seekdir returns void])
++fi
++
++AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
++AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
++samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
++if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
++    AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro])
++fi
++
++AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
++AC_TRY_RUN([
++#include <sys/time.h>
++#include <unistd.h>
++main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
++           samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
++if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
++    AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available])
++fi
++
++AC_CACHE_CHECK([for va_copy],samba_cv_HAVE_VA_COPY,[
++AC_TRY_LINK([#include <stdarg.h>
++va_list ap1,ap2;], [va_copy(ap1,ap2);],
++samba_cv_HAVE_VA_COPY=yes,
++samba_cv_HAVE_VA_COPY=no)])
++if test x"$samba_cv_HAVE_VA_COPY" = x"yes"; then
++    AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
++else
++    AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE___VA_COPY,[
++    AC_TRY_LINK([#include <stdarg.h>
++    va_list ap1,ap2;], [__va_copy(ap1,ap2);],
++    samba_cv_HAVE___VA_COPY=yes,
++    samba_cv_HAVE___VA_COPY=no)])
++    if test x"$samba_cv_HAVE___VA_COPY" = x"yes"; then
++        AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
++    fi
++fi
++
++AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[
++AC_TRY_RUN([
++#include <sys/types.h>
++#include <stdarg.h>
++void foo(const char *format, ...) { 
++       va_list ap;
++       int len;
++       char buf[5];
++
++       va_start(ap, format);
++       len = vsnprintf(buf, 0, format, ap);
++       va_end(ap);
++       if (len != 5) exit(1);
++
++       va_start(ap, format);
++       len = vsnprintf(0, 0, format, ap);
++       va_end(ap);
++       if (len != 5) exit(1);
++
++       if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
++
++       exit(0);
++}
++main() { foo("hello"); }
++],
++samba_cv_HAVE_C99_VSNPRINTF=yes,samba_cv_HAVE_C99_VSNPRINTF=no,samba_cv_HAVE_C99_VSNPRINTF=cross)])
++if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
++    AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Whether there is a C99 compliant vsnprintf])
++fi
++
++AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
++AC_TRY_RUN([#include <sys/types.h>
++#include <dirent.h>
++main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
++if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
++di->d_name[0] == 0) exit(0); exit(1);} ],
++samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
++if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
++    AC_DEFINE(HAVE_BROKEN_READDIR,1,[Whether readdir() is broken])
++fi
++
++AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <utime.h>],
++[struct utimbuf tbuf;  tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
++samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
++if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
++    AC_DEFINE(HAVE_UTIMBUF,1,[Whether struct utimbuf is available])
++fi
++
++##############
++# Check utmp details, but only if our OS offers utmp.h
++if test x"$ac_cv_header_utmp_h" = x"yes"; then
++dnl  utmp and utmpx come in many flavours
++dnl  We need to check for many of them
++dnl  But we don't need to do each and every one, because our code uses
++dnl  mostly just the utmp (not utmpx) fields.
++
++AC_CHECK_FUNCS(pututline pututxline updwtmp updwtmpx getutmpx)
++
++AC_CACHE_CHECK([for ut_name in utmp],samba_cv_HAVE_UT_UT_NAME,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <utmp.h>],
++[struct utmp ut;  ut.ut_name[0] = 'a';],
++samba_cv_HAVE_UT_UT_NAME=yes,samba_cv_HAVE_UT_UT_NAME=no,samba_cv_HAVE_UT_UT_NAME=cross)])
++if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
++    AC_DEFINE(HAVE_UT_UT_NAME,1,[Whether the utmp struct has a property ut_name])
++fi 
++
++AC_CACHE_CHECK([for ut_user in utmp],samba_cv_HAVE_UT_UT_USER,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <utmp.h>],
++[struct utmp ut;  ut.ut_user[0] = 'a';],
++samba_cv_HAVE_UT_UT_USER=yes,samba_cv_HAVE_UT_UT_USER=no,samba_cv_HAVE_UT_UT_USER=cross)])
++if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
++    AC_DEFINE(HAVE_UT_UT_USER,1,[Whether the utmp struct has a property ut_user])
++fi 
++
++AC_CACHE_CHECK([for ut_id in utmp],samba_cv_HAVE_UT_UT_ID,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <utmp.h>],
++[struct utmp ut;  ut.ut_id[0] = 'a';],
++samba_cv_HAVE_UT_UT_ID=yes,samba_cv_HAVE_UT_UT_ID=no,samba_cv_HAVE_UT_UT_ID=cross)])
++if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
++    AC_DEFINE(HAVE_UT_UT_ID,1,[Whether the utmp struct has a property ut_id])
++fi 
++
++AC_CACHE_CHECK([for ut_host in utmp],samba_cv_HAVE_UT_UT_HOST,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <utmp.h>],
++[struct utmp ut;  ut.ut_host[0] = 'a';],
++samba_cv_HAVE_UT_UT_HOST=yes,samba_cv_HAVE_UT_UT_HOST=no,samba_cv_HAVE_UT_UT_HOST=cross)])
++if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
++    AC_DEFINE(HAVE_UT_UT_HOST,1,[Whether the utmp struct has a property ut_host])
++fi 
++
++AC_CACHE_CHECK([for ut_time in utmp],samba_cv_HAVE_UT_UT_TIME,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <utmp.h>],
++[struct utmp ut;  time_t t; ut.ut_time = t;],
++samba_cv_HAVE_UT_UT_TIME=yes,samba_cv_HAVE_UT_UT_TIME=no,samba_cv_HAVE_UT_UT_TIME=cross)])
++if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
++    AC_DEFINE(HAVE_UT_UT_TIME,1,[Whether the utmp struct has a property ut_time])
++fi 
++
++AC_CACHE_CHECK([for ut_tv in utmp],samba_cv_HAVE_UT_UT_TV,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <utmp.h>],
++[struct utmp ut;  struct timeval tv; ut.ut_tv = tv;],
++samba_cv_HAVE_UT_UT_TV=yes,samba_cv_HAVE_UT_UT_TV=no,samba_cv_HAVE_UT_UT_TV=cross)])
++if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
++    AC_DEFINE(HAVE_UT_UT_TV,1,[Whether the utmp struct has a property ut_tv])
++fi 
++
++AC_CACHE_CHECK([for ut_type in utmp],samba_cv_HAVE_UT_UT_TYPE,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <utmp.h>],
++[struct utmp ut;  ut.ut_type = 0;],
++samba_cv_HAVE_UT_UT_TYPE=yes,samba_cv_HAVE_UT_UT_TYPE=no,samba_cv_HAVE_UT_UT_TYPE=cross)])
++if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then
++    AC_DEFINE(HAVE_UT_UT_TYPE,1,[Whether the utmp struct has a property ut_type])
++fi 
++
++AC_CACHE_CHECK([for ut_pid in utmp],samba_cv_HAVE_UT_UT_PID,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <utmp.h>],
++[struct utmp ut;  ut.ut_pid = 0;],
++samba_cv_HAVE_UT_UT_PID=yes,samba_cv_HAVE_UT_UT_PID=no,samba_cv_HAVE_UT_UT_PID=cross)])
++if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then
++    AC_DEFINE(HAVE_UT_UT_PID,1,[Whether the utmp struct has a property ut_pid])
++fi 
++
++AC_CACHE_CHECK([for ut_exit in utmp],samba_cv_HAVE_UT_UT_EXIT,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <utmp.h>],
++[struct utmp ut;  ut.ut_exit.e_exit = 0;],
++samba_cv_HAVE_UT_UT_EXIT=yes,samba_cv_HAVE_UT_UT_EXIT=no,samba_cv_HAVE_UT_UT_EXIT=cross)])
++if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
++    AC_DEFINE(HAVE_UT_UT_EXIT,1,[Whether the utmp struct has a property ut_exit])
++fi 
++
++AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <utmp.h>],
++[struct utmp ut;  ut.ut_addr = 0;],
++samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)])
++if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
++    AC_DEFINE(HAVE_UT_UT_ADDR,1,[Whether the utmp struct has a property ut_addr])
++fi 
++
++if test x$ac_cv_func_pututline = xyes ; then
++  AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[
++  AC_TRY_COMPILE([#include <sys/types.h>
++#include <utmp.h>],
++  [struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);],
++  samba_cv_PUTUTLINE_RETURNS_UTMP=yes,samba_cv_PUTUTLINE_RETURNS_UTMP=no)])
++  if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then
++      AC_DEFINE(PUTUTLINE_RETURNS_UTMP,1,[Whether pututline returns pointer])
++  fi
++fi
++
++AC_CACHE_CHECK([for ut_syslen in utmpx],samba_cv_HAVE_UX_UT_SYSLEN,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <utmpx.h>],
++[struct utmpx ux;  ux.ut_syslen = 0;],
++samba_cv_HAVE_UX_UT_SYSLEN=yes,samba_cv_HAVE_UX_UT_SYSLEN=no,samba_cv_HAVE_UX_UT_SYSLEN=cross)])
++if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
++    AC_DEFINE(HAVE_UX_UT_SYSLEN,1,[Whether the utmpx struct has a property ut_syslen])
++fi 
++
++fi
++# end utmp details
++
++
++ICONV_LOCATION=standard
++LOOK_DIRS="/usr /usr/local /sw"
++AC_ARG_WITH(libiconv,
++[  --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include (default=auto) ],
++[
++  if test "$withval" = "no" ; then
++    AC_MSG_ERROR([argument to --with-libiconv must be a directory])
++  else
++     if test "$withval" != "yes" ; then
++      ICONV_PATH_SPEC=yes
++        LOOK_DIRS="$withval"
++     fi
++  fi
++])
++
++ICONV_FOUND="no"
++for i in $LOOK_DIRS ; do
++    save_LIBS=$LIBS
++    save_LDFLAGS=$LDFLAGS
++    save_CPPFLAGS=$CPPFLAGS
++    CPPFLAGS="$CPPFLAGS -I$i/include"
++dnl This is here to handle -withval stuff for --with-libiconv
++dnl Perhaps we should always add a -L
++    LDFLAGS="$LDFLAGS -L$i/lib"
++    LIBS=
++    export LDFLAGS LIBS CPPFLAGS
++dnl Try to find iconv(3)
++    jm_ICONV($i)
++
++    if test "$ICONV_FOUND" = yes; then
++      LDFLAGS=$save_LDFLAG
++        LIB_ADD_DIR(LDFLAGS, "$i/lib")
++        CFLAGS_ADD_DIR(CPPFLAGS, "$i/include")
++        LIBS="$save_LIBS"
++        ICONV_LOCATION=$i
++        export LDFLAGS LIBS CPPFLAGS
++dnl Now, check for a working iconv ... we want to do it here because
++dnl there might be a working iconv further down the list of LOOK_DIRS
++
++        ############
++        # check for iconv in libc
++        ic_save_LIBS="$LIBS"
++        if test x"$ICONV_PATH_SPEC" = "xyes" ; then
++           LIBS="$LIBS -L$ICONV_LOCATION/lib"
++        fi
++        if test x"$jm_cv_lib_iconv" != x; then
++           LIBS="$LIBS -l$jm_cv_lib_iconv"
++        fi
++dnl        AC_CACHE_CHECK([for working iconv],samba_cv_HAVE_NATIVE_ICONV,[
++      default_dos_charset=no
++      default_display_charset=no
++      default_unix_charset=no
++
++      # check for default dos charset name
++      for j in CP850 IBM850 ; do
++          rjs_CHARSET($j)
++          if test x"$ICONV_CHARSET" = x"$j"; then
++              default_dos_charset="\"$j\""
++              break
++          fi
++      done
++      # check for default display charset name
++      for j in ASCII 646 ; do
++          rjs_CHARSET($j)
++          if test x"$ICONV_CHARSET" = x"$j"; then
++              default_display_charset="\"$j\""
++              break
++          fi
++      done
++      # check for default unix charset name
++      for j in UTF-8 UTF8 ; do
++          rjs_CHARSET($j)
++          if test x"$ICONV_CHARSET" = x"$j"; then
++              default_unix_charset="\"$j\""
++              break
++          fi
++      done
++      
++      if test "$default_dos_charset" != "no" -a \
++              "$default_dos_charset" != "cross" -a \
++              "$default_display_charset" != "no" -a \ 
++              "$default_display_charset" != "cross" -a \
++              "$default_unix_charset" != "no" -a \
++              "$default_unix_charset" != "cross"
++      then
++              samba_cv_HAVE_NATIVE_ICONV=yes
++      else if test "$default_dos_charset" = "cross" -o \
++                   "$default_display_charset" = "cross" -o \
++                   "$default_unix_charset" = "cross"
++      then
++              samba_cv_HAVE_NATIVE_ICONV=cross
++      else
++              samba_cv_HAVE_NATIVE_ICONV=no
++      fi
++      fi
++dnl ])
++
++        LIBS="$ic_save_LIBS"
++        if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then
++         CPPFLAGS=$save_CPPFLAGS
++         LDFLAGS=$save_LDFLAGS
++         LIBS=$save_LIBS
++           if test x"$jm_cv_lib_iconv" != x; then
++              LIBS="$LIBS -l$jm_cv_lib_iconv"
++           fi
++         dnl Add the flags we need to CPPFLAGS and LDFLAGS
++         CFLAGS_ADD_DIR(CPPFLAGS, "$i/include")
++         LIB_ADD_DIR(LDFLAGS, "$i/lib")
++         export CPPFLAGS
++           AC_DEFINE(HAVE_NATIVE_ICONV,1,[Whether to use native iconv])
++         AC_DEFINE_UNQUOTED(DEFAULT_DOS_CHARSET,$default_dos_charset,[Default dos charset name])
++         AC_DEFINE_UNQUOTED(DEFAULT_DISPLAY_CHARSET,$default_display_charset,[Default display charset name])
++         AC_DEFINE_UNQUOTED(DEFAULT_UNIX_CHARSET,$default_unix_charset,[Default unix charset name])
++           break
++        fi
++dnl We didn't find a working iconv, so keep going
++    fi
++dnl We only need to clean these up here for the next pass through the loop
++    CPPFLAGS=$save_CPPFLAGS
++    LDFLAGS=$save_LDFLAGS
++    LIBS=$save_LIBS
++    export LDFLAGS LIBS CPPFLAGS
++done
++
++
++if test x"$ICONV_FOUND" = x"no" -o x"$samba_cv_HAVE_NATIVE_ICONV" != x"yes" ; then
++    AC_MSG_WARN([Sufficient support for iconv function was not found. 
++    Install libiconv from http://freshmeat.net/projects/libiconv/ for better charset compatibility!])
++   AC_DEFINE_UNQUOTED(DEFAULT_DOS_CHARSET,"ASCII",[Default dos charset name])
++   AC_DEFINE_UNQUOTED(DEFAULT_DISPLAY_CHARSET,"ASCII",[Default display charset name])
++   AC_DEFINE_UNQUOTED(DEFAULT_UNIX_CHARSET,"UTF8",[Default unix charset name])
++fi
++
++
++AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
++AC_TRY_RUN([
++#include <sys/types.h>
++#include <fcntl.h>
++#ifndef F_GETLEASE
++#define F_GETLEASE    1025
++#endif
++main() {
++       int fd = open("/dev/null", O_RDONLY);
++       return fcntl(fd, F_GETLEASE, 0) == -1;
++}
++],
++samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
++if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
++    AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX,1,[Whether to use linux kernel oplocks])
++fi
++
++AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[
++AC_TRY_RUN([
++#include <sys/types.h>
++#include <fcntl.h>
++#include <signal.h>
++#ifndef F_NOTIFY
++#define F_NOTIFY 1026
++#endif
++main() {
++              exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ?  1 : 0);
++}
++],
++samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)])
++if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
++    AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY,1,[Whether kernel notifies changes])
++fi
++
++AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
++AC_TRY_RUN([
++#include <sys/types.h>
++#include <fcntl.h>
++#include <signal.h>
++#include <sys/file.h>
++#ifndef LOCK_MAND
++#define LOCK_MAND     32
++#define LOCK_READ     64
++#endif
++main() {
++              exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
++}
++],
++samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)])
++if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
++    AC_DEFINE(HAVE_KERNEL_SHARE_MODES,1,[Whether the kernel supports share modes])
++fi
++
++
++
++
++AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <fcntl.h>],
++[oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
++samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)])
++if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
++    AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX,1,[Whether IRIX kernel oplock type definitions are available])
++fi
++
++AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
++AC_TRY_RUN([#include <sys/types.h>
++#include <sys/capability.h>
++main() {
++ cap_t cap;
++ if ((cap = cap_get_proc()) == NULL)
++   exit(1);
++ cap->cap_effective |= CAP_NETWORK_MGT;
++ cap->cap_inheritable |= CAP_NETWORK_MGT;
++ cap_set_proc(cap);
++ exit(0);
++}
++],
++samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
++if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
++    AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES,1,[Whether IRIX specific capabilities are available])
++fi
++
++#
++# Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
++# This is *really* broken but some systems (DEC OSF1) do this.... JRA.
++#
++
++AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#if defined(HAVE_RPC_RPC_H)
++#include <rpc/rpc.h>
++#endif],
++[int16 testvar;],
++samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
++if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
++    AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H,1,[Whether int16 typedef is included by rpc/rpc.h])
++fi
++
++AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#if defined(HAVE_RPC_RPC_H)
++#include <rpc/rpc.h>
++#endif],
++[uint16 testvar;],
++samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
++if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
++    AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H,1,[Whether uint16 typedef is included by rpc/rpc.h])
++fi
++
++AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#if defined(HAVE_RPC_RPC_H)
++#include <rpc/rpc.h>
++#endif],
++[int32 testvar;],
++samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
++if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
++    AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H,1,[Whether int32 typedef is included by rpc/rpc.h])
++fi
++
++AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#if defined(HAVE_RPC_RPC_H)
++#include <rpc/rpc.h>
++#endif],
++[uint32 testvar;],
++samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
++if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
++    AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H,1,[Whether uint32 typedef is included by rpc/rpc.h])
++fi
++
++dnl
++dnl Some systems (SCO) have a problem including
++dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
++dnl as a #define in <prot.h> and as part of an enum
++dnl in <rpc/rpc.h>.
++dnl
++
++AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#ifdef HAVE_SYS_SECURITY_H
++#include <sys/security.h>
++#include <prot.h>
++#endif  /* HAVE_SYS_SECURITY_H */
++#if defined(HAVE_RPC_RPC_H)
++#include <rpc/rpc.h>
++#endif],
++[int testvar;],
++samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
++if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
++    AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT,1,[Whether there is a conflicting AUTH_ERROR define in rpc/rpc.h])
++fi
++
++AC_MSG_CHECKING([for test routines])
++AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
++           AC_MSG_RESULT(yes),
++         AC_MSG_ERROR([cant find test code. Aborting config]),
++         AC_MSG_WARN([cannot run when cross-compiling]))
++
++AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
++AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
++           samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
++if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
++    AC_DEFINE(HAVE_FTRUNCATE_EXTEND,1,[Truncate extend])
++fi
++
++AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [
++AC_TRY_RUN([#include "${srcdir-.}/tests/unixsock.c"],
++         samba_cv_HAVE_WORKING_AF_LOCAL=yes,
++         samba_cv_HAVE_WORKING_AF_LOCAL=no,
++         samba_cv_HAVE_WORKING_AF_LOCAL=cross)])
++if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno
++then
++    AC_DEFINE(HAVE_WORKING_AF_LOCAL, 1, [Define if you have working AF_LOCAL sockets])
++fi
++
++AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
++AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
++           samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
++if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
++    AC_DEFINE(HAVE_BROKEN_GETGROUPS,1,[Whether getgroups is broken])
++fi
++
++AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
++SAVE_CPPFLAGS="$CPPFLAGS"
++CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt  -I${srcdir-.}/smbwrapper"
++AC_TRY_COMPILE([
++#define REPLACE_GETPASS 1
++#define NO_PROTO_H 1
++#define NO_CONFIG_H 1
++#define main dont_declare_main
++#include "${srcdir-.}/lib/getsmbpass.c"
++#undef main
++],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
++CPPFLAGS="$SAVE_CPPFLAGS"
++])
++if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
++      AC_DEFINE(REPLACE_GETPASS,1,[Whether getpass should be replaced])
++fi
++
++AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
++AC_TRY_RUN([
++#include <stdio.h>
++#include <sys/types.h>
++#include <netinet/in.h>
++#ifdef HAVE_ARPA_INET_H
++#include <arpa/inet.h>
++#endif
++main() { struct in_addr ip; ip.s_addr = 0x12345678;
++if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
++    strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } 
++exit(1);}],
++           samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
++if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
++    AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced])
++fi
++
++AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
++AC_TRY_RUN([#include <stdlib.h>
++#include <sys/types.h>
++#include <sys/stat.h>
++#include <unistd.h>
++main() { 
++  struct stat st;
++  char tpl[20]="/tmp/test.XXXXXX"; 
++  int fd = mkstemp(tpl); 
++  if (fd == -1) exit(1);
++  unlink(tpl);
++  if (fstat(fd, &st) != 0) exit(1);
++  if ((st.st_mode & 0777) != 0600) exit(1);
++  exit(0);
++}],
++samba_cv_HAVE_SECURE_MKSTEMP=yes,
++samba_cv_HAVE_SECURE_MKSTEMP=no,
++samba_cv_HAVE_SECURE_MKSTEMP=cross)])
++if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
++    AC_DEFINE(HAVE_SECURE_MKSTEMP,1,[Whether mkstemp is secure])
++fi
++
++AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
++AC_TRY_RUN([#include <unistd.h>
++main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
++samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)])
++if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
++    AC_DEFINE(SYSCONF_SC_NGROUPS_MAX,1,[Whether sysconf(_SC_NGROUPS_MAX) is available])
++fi
++
++AC_CACHE_CHECK([for sysconf(_SC_NPROC_ONLN)],samba_cv_SYSCONF_SC_NPROC_ONLN,[
++AC_TRY_RUN([#include <unistd.h>
++main() { exit(sysconf(_SC_NPROC_ONLN) == -1 ? 1 : 0); }],
++samba_cv_SYSCONF_SC_NPROC_ONLN=yes,samba_cv_SYSCONF_SC_NPROC_ONLN=no,samba_cv_SYSCONF_SC_NPROC_ONLN=cross)])
++if test x"$samba_cv_SYSCONF_SC_NPROC_ONLN" = x"yes"; then
++    AC_DEFINE(SYSCONF_SC_NPROC_ONLN,1,[Whether sysconf(_SC_NPROC_ONLN) is available])
++fi
++
++AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
++AC_TRY_RUN([main() { exit(getuid() != 0); }],
++           samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
++if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
++    AC_DEFINE(HAVE_ROOT,1,[Whether current user is root])
++else
++    AC_MSG_WARN(running as non-root will disable some tests)
++fi
++
++##################
++# look for a method of finding the list of network interfaces
++iface=no;
++AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
++AC_TRY_RUN([
++#define HAVE_IFACE_AIX 1
++#define AUTOCONF_TEST 1
++#include "confdefs.h"
++#include "${srcdir-.}/lib/interfaces.c"],
++           samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
++if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
++    iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
++fi
++
++if test $iface = no; then
++AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
++AC_TRY_RUN([
++#define HAVE_IFACE_IFCONF 1
++#define AUTOCONF_TEST 1
++#include "confdefs.h"
++#include "${srcdir-.}/lib/interfaces.c"],
++           samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
++if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
++    iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available])
++fi
++fi
++
++if test $iface = no; then
++AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
++AC_TRY_RUN([
++#define HAVE_IFACE_IFREQ 1
++#define AUTOCONF_TEST 1
++#include "confdefs.h"
++#include "${srcdir-.}/lib/interfaces.c"],
++           samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
++if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
++    iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available])
++fi
++fi
++
++
++################################################
++# look for a method of setting the effective uid
++seteuid=no;
++if test $seteuid = no; then
++AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
++AC_TRY_RUN([
++#define AUTOCONF_TEST 1
++#define USE_SETRESUID 1
++#include "confdefs.h"
++#include "${srcdir-.}/lib/util_sec.c"],
++           samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
++if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
++    seteuid=yes;AC_DEFINE(USE_SETRESUID,1,[Whether setresuid() is available])
++fi
++fi
++
++
++if test $seteuid = no; then
++AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
++AC_TRY_RUN([
++#define AUTOCONF_TEST 1
++#define USE_SETREUID 1
++#include "confdefs.h"
++#include "${srcdir-.}/lib/util_sec.c"],
++           samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
++if test x"$samba_cv_USE_SETREUID" = x"yes"; then
++    seteuid=yes;AC_DEFINE(USE_SETREUID,1,[Whether setreuid() is available])
++fi
++fi
++
++if test $seteuid = no; then
++AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[
++AC_TRY_RUN([
++#define AUTOCONF_TEST 1
++#define USE_SETEUID 1
++#include "confdefs.h"
++#include "${srcdir-.}/lib/util_sec.c"],
++           samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)])
++if test x"$samba_cv_USE_SETEUID" = x"yes"; then
++    seteuid=yes;AC_DEFINE(USE_SETEUID,1,[Whether seteuid() is available])
++fi
++fi
++
++if test $seteuid = no; then
++AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[
++AC_TRY_RUN([
++#define AUTOCONF_TEST 1
++#define USE_SETUIDX 1
++#include "confdefs.h"
++#include "${srcdir-.}/lib/util_sec.c"],
++           samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)])
++if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
++    seteuid=yes;AC_DEFINE(USE_SETUIDX,1,[Whether setuidx() is available])
++fi
++fi
++
++
++AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
++AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
++           samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
++if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
++    AC_DEFINE(HAVE_MMAP,1,[Whether mmap works])
++fi
++
++AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
++AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncroot.c"],
++           samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
++if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
++    AC_DEFINE(FTRUNCATE_NEEDS_ROOT,1,[Whether ftruncate() needs root])
++fi
++
++AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
++AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
++           samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
++if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
++    AC_DEFINE(HAVE_FCNTL_LOCK,1,[Whether fcntl locking is available])
++fi
++
++AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[
++AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"],
++           samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)])
++if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
++    AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS,1,[Whether fcntl64 locks are broken])
++
++else
++
++dnl
++dnl Don't check for 64 bit fcntl locking if we know that the
++dnl glibc2.1 broken check has succeeded.
++dnl 
++
++  AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
++  AC_TRY_RUN([
++#if defined(HAVE_UNISTD_H)
++#include <unistd.h>
++#endif
++#include <stdio.h>
++#include <stdlib.h>
++
++#ifdef HAVE_FCNTL_H
++#include <fcntl.h>
++#endif
++
++#ifdef HAVE_SYS_FCNTL_H
++#include <sys/fcntl.h>
++#endif
++main() { struct flock64 fl64;
++#if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
++exit(0);
++#else
++exit(1);
++#endif
++}],
++       samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
++
++  if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
++      AC_DEFINE(HAVE_STRUCT_FLOCK64,1,[Whether the flock64 struct is available])
++  fi
++fi
++
++AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <sys/stat.h>
++#include <unistd.h>],
++[struct stat st;  st.st_blocks = 0;],
++samba_cv_HAVE_STAT_ST_BLOCKS=yes,samba_cv_HAVE_STAT_ST_BLOCKS=no,samba_cv_HAVE_STAT_ST_BLOCKS=cross)])
++if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then
++    AC_DEFINE(HAVE_STAT_ST_BLOCKS,1,[Whether the stat struct has a st_block property])
++fi 
++
++AC_CACHE_CHECK([for st_blksize in struct stat],samba_cv_HAVE_STAT_ST_BLKSIZE,[
++AC_TRY_COMPILE([#include <sys/types.h>
++#include <sys/stat.h>
++#include <unistd.h>],
++[struct stat st;  st.st_blksize = 0;],
++samba_cv_HAVE_STAT_ST_BLKSIZE=yes,samba_cv_HAVE_STAT_ST_BLKSIZE=no,samba_cv_HAVE_STAT_ST_BLKSIZE=cross)])
++if test x"$samba_cv_HAVE_STAT_ST_BLKSIZE" = x"yes"; then
++    AC_DEFINE(HAVE_STAT_ST_BLKSIZE,1,[Whether the stat struct has a st_blksize property])
++fi
++
++case "$host_os" in
++*linux*)
++AC_CACHE_CHECK([for broken RedHat 7.2 system header files],samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
++AC_TRY_COMPILE([
++#ifdef HAVE_SYS_VFS_H
++#include <sys/vfs.h>
++#endif
++#ifdef HAVE_SYS_CAPABILITY_H
++#include <sys/capability.h>
++#endif
++],[int i;],
++   samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes)])
++if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
++   AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS,1,[Broken RedHat 7.2 system header files])
++fi
++;;
++esac
++
++AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
++AC_TRY_COMPILE([#include <sys/acl.h>
++#if defined(HAVE_RPCSVC_NIS_H)
++#include <rpcsvc/nis.h>
++#endif],
++[int i;],
++samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
++if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
++      AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES,1,[Whether the nisplus include files are broken])
++fi
++
++
++#################################################
++# check for smbwrapper support
++AC_MSG_CHECKING(whether to use smbwrapper)
++AC_ARG_WITH(smbwrapper,
++[  --with-smbwrapper       Include SMB wrapper support (default=no) ],
++[ case "$withval" in
++  yes)
++    AC_MSG_RESULT(yes)
++    AC_DEFINE(WITH_SMBWRAPPER,1,[Whether to include smbwrapper support])
++      WRAPPROG="bin/smbsh\$(EXEEXT)"
++      WRAP="bin/smbwrapper.$SHLIBEXT"
++
++# Conditions under which smbwrapper should not be built.
++
++      if test x$PICFLAGS = x; then
++         echo No support for PIC code - disabling smbwrapper and smbsh
++         WRAPPROG=""
++         WRAP=""
++      elif test x$ac_cv_func_syscall = xno; then
++         AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh])
++         WRAPPROG=""
++         WRAP=""
++      fi
++      EXTRA_ALL_TARGETS="$EXTRA_ALL_TARGETS $WRAPPROG $WRAP"
++      SMBWRAPPER="$WRAPPROG $WRAP"
++    ;;
++  *)
++    AC_MSG_RESULT(no)
++    ;;
++  esac ],
++  AC_MSG_RESULT(no)
++)
++
++#################################################
++# check for AFS clear-text auth support
++AC_MSG_CHECKING(whether to use AFS clear-text auth)
++AC_ARG_WITH(afs,
++[  --with-afs              Include AFS clear-text auth support (default=no) ],
++[ case "$withval" in
++  yes)
++    AC_MSG_RESULT(yes)
++    AC_DEFINE(WITH_AFS,1,[Whether to include AFS clear-text auth support])
++    ;;
++  *)
++    AC_MSG_RESULT(no)
++    ;;
++  esac ],
++  AC_MSG_RESULT(no)
++)
++
++####################################################
++# check for Linux-specific AFS fake-kaserver support
++AC_MSG_CHECKING(whether to use AFS fake-kaserver)
++AC_ARG_WITH(fake-kaserver,
++[  --with-fake-kaserver    Include AFS fake-kaserver support (default=no) ],
++[ case "$withval" in
++  yes)
++    AC_MSG_RESULT(yes)
++    AC_DEFINE(WITH_FAKE_KASERVER,1,[Whether to include AFS fake-kaserver support])
++    ;;
++  *)
++    AC_MSG_RESULT(no)
++    ;;
++  esac ],
++  AC_MSG_RESULT(no)
++)
++
++#################################################
++# check for the DFS clear-text auth system
++AC_MSG_CHECKING(whether to use DFS clear-text auth)
++AC_ARG_WITH(dfs,
++[  --with-dce-dfs          Include DCE/DFS clear-text auth support (default=no)],
++[ case "$withval" in
++  yes)
++    AC_MSG_RESULT(yes)
++    AC_DEFINE(WITH_DFS,1,[Whether to include DFS support])
++    ;;
++  *)
++    AC_MSG_RESULT(no)
++    ;;
++  esac ],
++  AC_MSG_RESULT(no)
++)
++
++########################################################
++# Compile with LDAP support?
++
++with_ldap_support=auto
++AC_MSG_CHECKING([for LDAP support])
++
++AC_ARG_WITH(ldap,
++[  --with-ldap             LDAP support (default yes)],
++[ case "$withval" in
++    yes|no)
++      with_ldap_support=$withval
++      ;;
++  esac ])
++
++AC_MSG_RESULT($with_ldap_support)
++
++SMBLDAP=""
++AC_SUBST(SMBLDAP)
++if test x"$with_ldap_support" != x"no"; then
++
++  ##################################################################
++  # first test for ldap.h and lber.h
++  # (ldap.h is required for this test)
++  AC_CHECK_HEADERS(ldap.h lber.h)
++  
++  if test x"$ac_cv_header_ldap_h" != x"yes"; then
++      if test x"$with_ldap_support" = x"yes"; then
++       AC_MSG_ERROR(ldap.h is needed for LDAP support)
++      else
++       AC_MSG_WARN(ldap.h is needed for LDAP support)
++      fi
++      
++      with_ldap_support=no
++  fi
++fi
++
++if test x"$with_ldap_support" != x"no"; then
++  ac_save_LIBS=$LIBS
++
++  ##################################################################
++  # we might need the lber lib on some systems. To avoid link errors
++  # this test must be before the libldap test
++  AC_CHECK_LIB_EXT(lber, LDAP_LIBS, ber_scanf)
++
++  ########################################################
++  # now see if we can find the ldap libs in standard paths
++  AC_CHECK_LIB_EXT(ldap, LDAP_LIBS, ldap_init)
++
++  AC_CHECK_FUNC_EXT(ldap_domain2hostlist,$LDAP_LIBS)
++  
++  ########################################################
++  # If we have LDAP, does it's rebind procedure take 2 or 3 arguments?
++  # Check found in pam_ldap 145.
++  AC_CHECK_FUNC_EXT(ldap_set_rebind_proc,$LDAP_LIBS)
++
++  LIBS="$LIBS $LDAP_LIBS"
++  AC_CACHE_CHECK(whether ldap_set_rebind_proc takes 3 arguments, smb_ldap_cv_ldap_set_rebind_proc, [
++    AC_TRY_COMPILE([
++      #include <lber.h>
++      #include <ldap.h>], 
++      [ldap_set_rebind_proc(0, 0, 0);], 
++      [smb_ldap_cv_ldap_set_rebind_proc=3], 
++      [smb_ldap_cv_ldap_set_rebind_proc=2]
++    ) 
++  ])
++  
++  AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS, $smb_ldap_cv_ldap_set_rebind_proc, [Number of arguments to ldap_set_rebind_proc])
++
++  AC_CHECK_FUNC_EXT(ldap_initialize,$LDAP_LIBS)       
++  
++  if test x"$ac_cv_lib_ext_ldap_ldap_init" = x"yes" -a x"$ac_cv_func_ext_ldap_domain2hostlist" = x"yes"; then
++    AC_DEFINE(HAVE_LDAP,1,[Whether ldap is available])
++    default_static_modules="$default_static_modules pdb_ldap idmap_ldap";
++    SMBLDAP="lib/smbldap.o"
++    with_ldap_support=yes
++    AC_MSG_CHECKING(whether LDAP support is used)
++    AC_MSG_RESULT(yes)
++  else
++    if test x"$with_ldap_support" = x"yes"; then
++      AC_MSG_ERROR(libldap is needed for LDAP support)
++    else
++      AC_MSG_WARN(libldap is needed for LDAP support)
++    fi
++    
++    LDAP_LIBS=""
++    with_ldap_support=no
++  fi
++  LIBS=$ac_save_LIBS
++fi
++
++
++#################################################
++# active directory support
++
++with_ads_support=auto
++AC_MSG_CHECKING([for Active Directory and krb5 support])
++
++AC_ARG_WITH(ads,
++[  --with-ads              Active Directory support (default auto)],
++[ case "$withval" in
++    yes|no)
++      with_ads_support="$withval"
++      ;;
++  esac ])
++
++AC_MSG_RESULT($with_ads_support)
++
++FOUND_KRB5=no
++KRB5_LIBS=""
++
++if test x"$with_ldap_support" != x"yes"; then
++    if test x"$with_ads_support" = x"yes"; then
++      AC_MSG_ERROR(Active Directory Support requires LDAP support)
++    elif test x"$with_ads_support" != x"no"; then
++      AC_MSG_WARN(Active Directory Support requires LDAP support)
++    fi
++    with_ads_support=no
++fi
++
++if test x"$with_ads_support" != x"no"; then
++
++  # Do no harm to the values of CFLAGS and LIBS while testing for
++  # Kerberos support.
++
++  #################################################
++  # check for krb5-config from recent MIT and Heimdal kerberos 5
++  AC_PATH_PROG(KRB5_CONFIG, krb5-config)
++  AC_MSG_CHECKING(for working krb5-config)
++  if test -x "$KRB5_CONFIG"; then
++    ac_save_CFLAGS=$CFLAGS
++    CFLAGS="";export CFLAGS
++    ac_save_LDFLAGS=$LDFLAGS
++    LDFLAGS="";export LDFLAGS
++    KRB5_LIBS="`$KRB5_CONFIG --libs gssapi`"
++    KRB5_CFLAGS="`$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`" 
++    KRB5_CPPFLAGS="`$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`"
++    CFLAGS=$ac_save_CFLAGS;export CFLAGS
++    LDFLAGS=$ac_save_LDFLAGS;export LDFLAGS
++    FOUND_KRB5=yes
++    AC_MSG_RESULT(yes)
++  else
++    AC_MSG_RESULT(no. Fallback to previous krb5 detection strategy)
++  fi
++  
++  if test x$FOUND_KRB5 = x"no"; then
++    #################################################
++    # check for location of Kerberos 5 install
++    AC_MSG_CHECKING(for kerberos 5 install path)
++    AC_ARG_WITH(krb5,
++    [  --with-krb5=base-dir    Locate Kerberos 5 support (default=/usr)],
++    [ case "$withval" in
++      no)
++        AC_MSG_RESULT(no krb5-path given)
++        ;;
++      yes)
++        AC_MSG_RESULT(/usr)
++        FOUND_KRB5=yes
++        ;;
++      *)
++        AC_MSG_RESULT($withval)
++        KRB5_CFLAGS="-I$withval/include"
++        KRB5_CPPFLAGS="-I$withval/include"
++        KRB5_LDFLAGS="-L$withval/lib"
++        FOUND_KRB5=yes
++        ;;
++      esac ],
++      AC_MSG_RESULT(no krb5-path given)
++    )
++  fi
++
++  if test x$FOUND_KRB5 = x"no"; then
++    #################################################
++    # see if this box has the SuSE location for the heimdal krb implementation
++    AC_MSG_CHECKING(for /usr/include/heimdal)
++    if test -d /usr/include/heimdal; then
++      if test -f /usr/lib/heimdal/lib/libkrb5.a; then
++          KRB5_CFLAGS="-I/usr/include/heimdal"
++          KRB5_CPPFLAGS="-I/usr/include/heimdal"
++          KRB5_LDFLAGS="-L/usr/lib/heimdal/lib"
++          AC_MSG_RESULT(yes)
++      else
++          KRB5_CFLAGS="-I/usr/include/heimdal"
++          KRB5_CPPFLAGS="-I/usr/include/heimdal"
++          AC_MSG_RESULT(yes)
++      fi
++    else
++      AC_MSG_RESULT(no)
++    fi
++  fi
++
++  if test x$FOUND_KRB5 = x"no"; then
++    #################################################
++    # see if this box has the RedHat location for kerberos
++    AC_MSG_CHECKING(for /usr/kerberos)
++    if test -d /usr/kerberos -a -f /usr/kerberos/lib/libkrb5.a; then
++      KRB5_LDFLAGS="-L/usr/kerberos/lib"
++      KRB5_CFLAGS="-I/usr/kerberos/include"
++      KRB5_CPPFLAGS="-I/usr/kerberos/include"
++      AC_MSG_RESULT(yes)
++    else
++      AC_MSG_RESULT(no)
++    fi
++  fi
++
++  ac_save_CFLAGS=$CFLAGS
++  ac_save_CPPFLAGS=$CPPFLAGS
++  ac_save_LDFLAGS=$LDFLAGS
++
++  CFLAGS="$CFLAGS $KRB5_CFLAGS"
++  CPPFLAGS="$CPPFLAGS $KRB5_CPPFLAGS"
++  LDFLAGS="$LDFLAGS $KRB5_LDFLAGS"
++
++  KRB5_LIBS="$KRB5_LDFLAGS $KRB5_LIBS"
++
++  # now check for krb5.h. Some systems have the libraries without the headers!
++  # note that this check is done here to allow for different kerberos
++  # include paths
++  AC_CHECK_HEADERS(krb5.h)
++
++  if test x"$ac_cv_header_krb5_h" = x"no"; then
++
++    # Give a warning if AD support was not explicitly requested,
++    # i.e with_ads_support = auto, otherwise die with an error.
++
++    if test x"$with_ads_support" = x"yes"; then
++      AC_MSG_ERROR([Active Directory cannot be supported without krb5.h])
++    else
++      AC_MSG_WARN([Active Directory cannot be supported without krb5.h])
++    fi
++
++    # Turn off AD support and restore CFLAGS and LIBS variables
++
++    with_ads_support="no"
++    
++    CFLAGS=$ac_save_CFLAGS
++    CPPFLAGS=$ac_save_CPPFLAGS
++    LDFLAGS=$ac_save_LDFLAGS
++  fi
++fi
++
++# Now we have determined whether we really want ADS support
++
++if test x"$with_ads_support" != x"no"; then
++  ac_save_LIBS=$LIBS
++
++  # now check for gssapi headers.  This is also done here to allow for
++  # different kerberos include paths
++  AC_CHECK_HEADERS(gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h com_err.h)
++
++  ##################################################################
++  # we might need the k5crypto and com_err libraries on some systems
++  AC_CHECK_LIB_EXT(com_err, KRB5_LIBS, _et_list)
++  AC_CHECK_LIB_EXT(k5crypto, KRB5_LIBS, krb5_encrypt_data)
++
++  # Heimdal checks.
++  AC_CHECK_LIB_EXT(crypto, KRB5_LIBS, des_set_key)
++  AC_CHECK_LIB_EXT(asn1, KRB5_LIBS, copy_Authenticator)
++  AC_CHECK_LIB_EXT(roken, KRB5_LIBS, roken_getaddrinfo_hostspec)
++
++  # Heimdal checks. On static Heimdal gssapi must be linked before krb5.
++  AC_CHECK_LIB_EXT(gssapi, KRB5_LIBS, gss_display_status,[],[],
++                              AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available]))
++
++  ########################################################
++  # now see if we can find the krb5 libs in standard paths
++  # or as specified above
++  AC_CHECK_LIB_EXT(krb5, KRB5_LIBS, krb5_mk_req_extended)
++
++  ########################################################
++  # now see if we can find the gssapi libs in standard paths
++  AC_CHECK_LIB_EXT(gssapi_krb5, KRB5_LIBS,gss_display_status,[],[],
++          AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available]))
++
++  AC_CHECK_FUNC_EXT(krb5_set_real_time, $KRB5_LIBS)
++  AC_CHECK_FUNC_EXT(krb5_set_default_in_tkt_etypes, $KRB5_LIBS)
++  AC_CHECK_FUNC_EXT(krb5_set_default_tgs_ktypes, $KRB5_LIBS)
++  AC_CHECK_FUNC_EXT(krb5_principal2salt, $KRB5_LIBS)
++  AC_CHECK_FUNC_EXT(krb5_use_enctype, $KRB5_LIBS)
++  AC_CHECK_FUNC_EXT(krb5_string_to_key, $KRB5_LIBS) 
++  AC_CHECK_FUNC_EXT(krb5_get_pw_salt, $KRB5_LIBS)
++  AC_CHECK_FUNC_EXT(krb5_string_to_key_salt, $KRB5_LIBS) 
++  AC_CHECK_FUNC_EXT(krb5_auth_con_setkey, $KRB5_LIBS)
++  AC_CHECK_FUNC_EXT(krb5_auth_con_setuseruserkey, $KRB5_LIBS) 
++  AC_CHECK_FUNC_EXT(krb5_locate_kdc, $KRB5_LIBS)
++  AC_CHECK_FUNC_EXT(krb5_get_permitted_enctypes, $KRB5_LIBS) 
++  AC_CHECK_FUNC_EXT(krb5_get_default_in_tkt_etypes, $KRB5_LIBS) 
++  AC_CHECK_FUNC_EXT(krb5_free_ktypes, $KRB5_LIBS)
++  AC_CHECK_FUNC_EXT(krb5_principal_get_comp_string, $KRB5_LIBS)
++
++  LIBS="$LIBS $KRB5_LIBS"
++  
++  AC_CACHE_CHECK([for addrtype in krb5_address],
++                samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS,[
++    AC_TRY_COMPILE([#include <krb5.h>],
++      [krb5_address kaddr; kaddr.addrtype = ADDRTYPE_INET;],
++      samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS=yes,
++      samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS=no)])
++
++  if test x"$samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS" = x"yes"; then
++    AC_DEFINE(HAVE_ADDRTYPE_IN_KRB5_ADDRESS,1,
++               [Whether the krb5_address struct has a addrtype property])
++  fi
++
++  AC_CACHE_CHECK([for addr_type in krb5_address],
++                 samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS,[
++    AC_TRY_COMPILE([#include <krb5.h>],
++      [krb5_address kaddr; kaddr.addr_type = KRB5_ADDRESS_INET;],
++      samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS=yes,
++      samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS=no)])
++
++  if test x"$samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS" = x"yes"; then
++    AC_DEFINE(HAVE_ADDR_TYPE_IN_KRB5_ADDRESS,1,
++              [Whether the krb5_address struct has a addr_type property])
++  fi
++
++  AC_CACHE_CHECK([for enc_part2 in krb5_ticket], 
++               samba_cv_HAVE_KRB5_TKT_ENC_PART2,
++                 [AC_TRY_COMPILE([#include <krb5.h>],
++    [krb5_ticket tkt; tkt.enc_part2->authorization_data[0]->contents = NULL;],
++    samba_cv_HAVE_KRB5_TKT_ENC_PART2=yes,samba_cv_HAVE_KRB5_TKT_ENC_PART2=no)])
++
++  if test x"$samba_cv_HAVE_KRB5_TKT_ENC_PART2" = x"yes"; then
++    AC_DEFINE(HAVE_KRB5_TKT_ENC_PART2,1,
++              [Whether the krb5_ticket struct has a enc_part2 property])
++  fi
++
++  AC_CACHE_CHECK([for keyvalue in krb5_keyblock],
++                 samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE,[
++    AC_TRY_COMPILE([#include <krb5.h>],
++      [krb5_keyblock key; key.keyvalue.data = NULL;],
++      samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE=yes,
++      samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE=no)])
++
++  if test x"$samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE" = x"yes"; then
++    AC_DEFINE(HAVE_KRB5_KEYBLOCK_KEYVALUE,1,
++              [Whether the krb5_keyblock struct has a keyvalue property])
++  fi
++
++  AC_CACHE_CHECK([for ENCTYPE_ARCFOUR_HMAC_MD5],
++                 samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC_MD5,[
++    AC_TRY_COMPILE([#include <krb5.h>],
++      [krb5_enctype enctype; enctype = ENCTYPE_ARCFOUR_HMAC_MD5;],
++      samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC_MD5=yes,
++      samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC_MD5=no)])
++  AC_CACHE_CHECK([for KEYTYPE_ARCFOUR_56],
++                 samba_cv_HAVE_KEYTYPE_ARCFOUR_56,[
++    AC_TRY_COMPILE([#include <krb5.h>],
++      [krb5_keytype keytype; keytype = KEYTYPE_ARCFOUR_56;],
++      samba_cv_HAVE_KEYTYPE_ARCFOUR_56=yes,
++      samba_cv_HAVE_KEYTYPE_ARCFOUR_56=no)])
++# Heimdals with KEYTYPE_ARCFOUR but not KEYTYPE_ARCFOUR_56 are broken
++# w.r.t. arcfour and windows, so we must not enable it here
++  if test x"$samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC_MD5" = x"yes" -a\
++          x"$samba_cv_HAVE_KEYTYPE_ARCFOUR_56" = x"yes"; then
++    AC_DEFINE(HAVE_ENCTYPE_ARCFOUR_HMAC_MD5,1,
++              [Whether the ENCTYPE_ARCFOUR_HMAC_MD5 key type is available])
++  fi
++
++  AC_CACHE_CHECK([for AP_OPTS_USE_SUBKEY],
++                 samba_cv_HAVE_AP_OPTS_USE_SUBKEY,[
++    AC_TRY_COMPILE([#include <krb5.h>],
++      [krb5_flags ap_options; ap_options = AP_OPTS_USE_SUBKEY;],
++      samba_cv_HAVE_AP_OPTS_USE_SUBKEY=yes,
++      samba_cv_HAVE_AP_OPTS_USE_SUBKEY=no)])
++
++  if test x"$samba_cv_HAVE_AP_OPTS_USE_SUBKEY" = x"yes"; then
++    AC_DEFINE(HAVE_AP_OPTS_USE_SUBKEY,1,
++              [Whether the AP_OPTS_USE_SUBKEY ap option is available])
++  fi
++
++  AC_CACHE_CHECK([for the krb5_princ_component macro],
++                samba_cv_HAVE_KRB5_PRINC_COMPONENT,[
++    AC_TRY_LINK([#include <krb5.h>],
++      [const krb5_data *pkdata; krb5_context context; krb5_principal principal; pkdata = krb5_princ_component(context, principal, 0);],
++      samba_cv_HAVE_KRB5_PRINC_COMPONENT=yes,
++      samba_cv_HAVE_KRB5_PRINC_COMPONENT=no)])
++
++  if test x"$samba_cv_HAVE_KRB5_PRINC_COMPONENT" = x"yes"; then
++    AC_DEFINE(HAVE_KRB5_PRINC_COMPONENT,1,
++               [Whether krb5_princ_component is available])
++  fi
++
++  AC_CACHE_CHECK([for memory keytab support],
++               samba_cv_HAVE_MEMORY_KEYTAB,[
++    AC_TRY_RUN([
++#include<krb5.h>
++  main()
++  {
++    krb5_context context;
++    krb5_keytab keytab;
++    
++    krb5_init_context(&context);
++    if (krb5_kt_resolve(context, "MEMORY:", &keytab))
++      exit(0);
++    exit(1);
++  }], 
++  samba_cv_HAVE_MEMORY_KEYTAB=yes,
++  samba_cv_HAVE_MEMORY_KEYTAB=no)])
++
++  if test x"$samba_cv_HAVE_MEMORY_KEYTAB" = x"yes"; then
++      AC_DEFINE(HAVE_MEMORY_KEYTAB,1,
++               [Whether in-memory keytabs are supported])
++  fi
++
++  AC_CACHE_CHECK([for key in krb5_keytab_entry],
++                 samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEY,[
++    AC_TRY_COMPILE([#include <krb5.h>],
++      [krb5_keytab_entry entry; krb5_keyblock e; entry.key = e;],
++      samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEY=yes,
++      samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEY=no)])
++
++  if test x"$samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEY" = x"yes"; then
++    AC_DEFINE(HAVE_KRB5_KEYTAB_ENTRY_KEY,1,
++              [Whether krb5_keytab_entry has key member])
++  fi
++
++  AC_CACHE_CHECK([for keyblock in krb5_keytab_entry],
++                 samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK,[
++    AC_TRY_COMPILE([#include <krb5.h>],
++      [krb5_keytab_entry entry; entry.keyblock.keytype = 0;],
++      samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK=yes,
++      samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK=no)])
++
++  if test x"$samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK" = x"yes"; then
++    AC_DEFINE(HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK,1,
++              [Whether krb5_keytab_entry has keyblock member])
++  fi
++
++  if test x"$ac_cv_lib_ext_krb5_krb5_mk_req_extended" = x"yes"; then
++    AC_DEFINE(HAVE_KRB5,1,[Whether to have KRB5 support])
++    AC_DEFINE(WITH_ADS,1,[Whether to include Active Directory support])
++    AC_MSG_CHECKING(whether Active Directory and krb5 support is used)
++    AC_MSG_RESULT(yes)
++  else
++    if test x"$with_ads_support" = x"yes"; then
++      AC_MSG_ERROR(libkrb5 is needed for Active Directory support)
++    else
++      AC_MSG_WARN(libkrb5 is needed for Active Directory support)
++    fi
++    KRB5_LIBS=""
++    with_ads_support=no 
++  fi
++  LIBS="$ac_save_LIBS"
++fi
++
++########################################################
++# Compile experimental passdb backends?
++# (pdb_xml, pdb_mysql)
++AC_MSG_CHECKING(whether to build experimental passdb libraries)
++AC_ARG_WITH(expsam,
++[  --with-expsam=<list>    Include experimental passdb libraries (default=no)]
++[                          Valid choices include (comma separated list): ]
++[                              xml & mysql],
++[ expsam_pdb_modules=`echo "$withval" | sed 's/,/ /g'`
++  if test "z$expsam_pdb_modules" = "zyes"; then
++    expsam_pdb_modules="xml mysql"
++  fi
++  AC_MSG_RESULT($expsam_pdb_modules)
++  for i in $expsam_pdb_modules
++  do 
++    case "$i" in
++    xml)
++      ## pdb_xml
++        AM_PATH_XML2([2.0.0],[default_shared_modules="$default_shared_modules pdb_xml"],[AC_MSG_ERROR([Can't find XML libraries while XML support is requested])])
++      CFLAGS="$CFLAGS $XML_CFLAGS"
++      ;;
++    mysql)
++      ## pdb_mysql
++        AM_PATH_MYSQL([default_shared_modules="$default_shared_modules pdb_mysql"],[AC_MSG_ERROR([Can't find MySQL libraries while MySQL support is requested])])
++      CFLAGS="$CFLAGS $MYSQL_CFLAGS"
++      ;;
++    no)
++      ;;
++    *)
++      echo "Unknown module name \"$i\"!  Exiting..."
++      exit 1
++      ;;
++    esac
++  done ],
++  AC_MSG_RESULT(no)
++)
++
++#################################################
++# check for automount support
++AC_MSG_CHECKING(whether to use automount)
++AC_ARG_WITH(automount,
++[  --with-automount        Include automount support (default=no)],
++[ case "$withval" in
++  yes)
++    AC_MSG_RESULT(yes)
++    AC_DEFINE(WITH_AUTOMOUNT,1,[Whether to include automount support])
++    ;;
++  *)
++    AC_MSG_RESULT(no)
++    ;;
++  esac ],
++  AC_MSG_RESULT(no)
++)
++
++#################################################
++# check for smbmount support
++AC_MSG_CHECKING(whether to use smbmount)
++AC_ARG_WITH(smbmount,
++[  --with-smbmount         Include smbmount (Linux only) support (default=no)],
++[ case "$withval" in
++  yes)
++      case "$host_os" in
++      *linux*)
++              AC_MSG_RESULT(yes)
++              AC_DEFINE(WITH_SMBMOUNT,1,[Whether to build smbmount])
++              EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbmount bin/smbmnt bin/smbumount"
++              ;;
++      *)
++              AC_MSG_ERROR(not on a linux system!)
++              ;;
++      esac
++    ;;
++  *)
++    AC_MSG_RESULT(no)
++    ;;
++  esac ],
++  AC_MSG_RESULT(no)
++)
++
++
++#################################################
++# check for a PAM clear-text auth, accounts, password and session support
++with_pam_for_crypt=no
++AC_MSG_CHECKING(whether to use PAM)
++AC_ARG_WITH(pam,
++[  --with-pam              Include PAM support (default=no)],
++[ case "$withval" in
++  yes)
++    AC_MSG_RESULT(yes)
++    if test x"$ac_cv_header_security_pam_appl_h" = x"no"; then
++       if test x"$ac_cv_header_security_pam_modules_h" = x"no"; then
++        if test x"$ac_cv_header_security__pam_macros_h" = x"no"; then
++           AC_MSG_ERROR(--with-pam specified but no PAM headers found)
++        fi
++       fi
++    fi
++    AC_DEFINE(WITH_PAM,1,[Whether to include PAM support])
++    AUTH_LIBS="$AUTH_LIBS -lpam"
++    with_pam_for_crypt=yes
++    ;;
++  *)
++    AC_MSG_RESULT(no)
++    ;;
++  esac ],
++  AC_MSG_RESULT(no)
++)
++
++# we can't build a pam module if we don't have pam.
++AC_CHECK_LIB(pam, pam_get_data, [AC_DEFINE(HAVE_LIBPAM,1,[Whether libpam is available])])
++
++#################################################
++# check for pam_smbpass support
++AC_MSG_CHECKING(whether to use pam_smbpass)
++AC_ARG_WITH(pam_smbpass,
++[  --with-pam_smbpass      Build PAM module for authenticating against passdb backends (default=no)],
++[ case "$withval" in
++  yes)
++    AC_MSG_RESULT(yes)
++
++       # Conditions under which pam_smbpass should not be built.
++
++       if test x$PICFLAGS = x; then
++          AC_MSG_ERROR([No support for PIC code])
++       elif test x"$ac_cv_header_security_pam_appl_h" = x"no"; then
++        AC_MSG_ERROR([No security/pam_appl.h found])
++       elif test x$ac_cv_lib_pam_pam_get_data = xno; then
++          AC_MSG_ERROR([No libpam found])
++       else
++        AUTH_LIBS="$AUTH_LIBS -lpam"
++          SHLIB_PROGS="$SHLIB_PROGS bin/pam_smbpass.$SHLIBEXT"
++       fi
++    ;;
++  *)
++    AC_MSG_RESULT(no)
++    ;;
++  esac ],
++  AC_MSG_RESULT(no)
++)
++
++
++###############################################
++# test for where we get crypt() from
++AC_SEARCH_LIBS(crypt, [crypt],
++  [test "$ac_cv_search_crypt" = "none required" || AUTH_LIBS="-lcrypt $AUTH_LIBS"
++  AC_DEFINE(HAVE_CRYPT,1,[Whether the system has the crypt() function])])
++
++##
++## moved after the check for -lcrypt in order to
++## ensure that the necessary libraries are included
++## check checking for truncated salt.  Wrapped by the
++## $with_pam_for_crypt variable as above   --jerry
++##
++if test $with_pam_for_crypt = no; then
++AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
++crypt_LIBS="$LIBS"
++LIBS="$AUTH_LIBS $LIBS"
++AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
++      samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)
++LIBS="$crypt_LIBS"])
++if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
++      AC_DEFINE(HAVE_TRUNCATED_SALT,1,[Whether crypt needs truncated salt])
++fi
++fi
++
++########################################################################################
++##
++## TESTS FOR SAM BACKENDS.  KEEP THESE GROUPED TOGETHER
++##
++########################################################################################
++
++#################################################
++# check for a LDAP password database configuration backwards compatibility
++AC_MSG_CHECKING(whether to use LDAP SAM 2.2 compatible configuration)
++AC_ARG_WITH(ldapsam,
++[  --with-ldapsam          Include LDAP SAM 2.2 compatible configuration (default=no)],
++[ case "$withval" in
++  yes)
++    AC_MSG_RESULT(yes)
++    AC_DEFINE(WITH_LDAP_SAMCONFIG,1,[Whether to include 2.2 compatible LDAP SAM configuration])
++    ;;
++  *)
++    AC_MSG_RESULT(no)
++    ;;
++  esac ],
++  AC_MSG_RESULT(no)
++)
++
++########################################################################################
++##
++## END OF TESTS FOR SAM BACKENDS.  
++##
++########################################################################################
++
++#################################################
++# check for a NISPLUS_HOME support 
++AC_MSG_CHECKING(whether to use NISPLUS_HOME)
++AC_ARG_WITH(nisplus-home,
++[  --with-nisplus-home     Include NISPLUS_HOME support (default=no)],
++[ case "$withval" in
++  yes)
++    AC_MSG_RESULT(yes)
++    AC_DEFINE(WITH_NISPLUS_HOME,1,[Whether to include nisplus_home support])
++    ;;
++  *)
++    AC_MSG_RESULT(no)
++    ;;
++  esac ],
++  AC_MSG_RESULT(no)
++)
++
++#################################################
++# check for syslog logging
++AC_MSG_CHECKING(whether to use syslog logging)
++AC_ARG_WITH(syslog,
++[  --with-syslog           Include experimental SYSLOG support (default=no)],
++[ case "$withval" in
++  yes)
++    AC_MSG_RESULT(yes)
++    AC_DEFINE(WITH_SYSLOG,1,[Whether to include experimental syslog support])
++    ;;
++  *)
++    AC_MSG_RESULT(no)
++    ;;
++  esac ],
++  AC_MSG_RESULT(no)
++)
++
++#################################################
++# check for a shared memory profiling support
++AC_MSG_CHECKING(whether to use profiling)
++AC_ARG_WITH(profiling-data,
++[  --with-profiling-data   Include gathering source code profile information (default=no)],
++[ case "$withval" in
++  yes)
++    AC_MSG_RESULT(yes)
++    AC_DEFINE(WITH_PROFILE,1,[Whether to use profiling])
++    ;;
++  *)
++    AC_MSG_RESULT(no)
++    ;;
++  esac ],
++  AC_MSG_RESULT(no)
++)
++
++
++#################################################
++# check for experimental disk-quotas support
++
++samba_cv_WITH_QUOTAS=auto
++samba_cv_TRY_QUOTAS=no
++samba_cv_RUN_QUOTA_TESTS=auto
++samba_cv_WITH_SYS_QUOTAS=auto
++samba_cv_TRY_SYS_QUOTAS=no
++
++AC_MSG_CHECKING(whether to try disk-quotas support)
++AC_ARG_WITH(quotas,
++[  --with-quotas           Include disk-quota support (default=no)],
++[ case "$withval" in
++  yes)
++    AC_MSG_RESULT(yes)
++    samba_cv_WITH_QUOTAS=yes
++    samba_cv_TRY_QUOTAS=yes
++    samba_cv_RUN_QUOTA_TESTS=yes
++    #set sys quotas to auto in this case
++    samba_cv_TRY_SYS_QUOTAS=auto
++    ;;
++  auto)
++    AC_MSG_RESULT(auto)
++    samba_cv_WITH_QUOTAS=auto
++    samba_cv_TRY_QUOTAS=auto
++    samba_cv_RUN_QUOTA_TESTS=auto
++    #set sys quotas to auto in this case
++    samba_cv_TRY_SYS_QUOTAS=auto
++    ;;
++  no)
++    AC_MSG_RESULT(no)
++    samba_cv_WITH_QUOTAS=no
++    samba_cv_TRY_QUOTAS=no
++    samba_cv_RUN_QUOTA_TESTS=no
++    ;;
++  *)
++    AC_MSG_RESULT(${samba_cv_TRY_QUOTAS})
++    ;;
++  esac ],
++  AC_MSG_RESULT(${samba_cv_TRY_QUOTAS})
++)
++
++AC_MSG_CHECKING(whether to try the new lib/sysquotas.c interface)
++AC_ARG_WITH(sys-quotas,
++[  --with-sys-quotas       Include lib/sysquotas.c support (default=auto)],
++[ case "$withval" in
++  yes)
++    AC_MSG_RESULT(yes)
++    samba_cv_WITH_SYS_QUOTAS=yes
++    samba_cv_TRY_SYS_QUOTAS=yes
++    samba_cv_RUN_QUOTA_TESTS=yes
++    ;;
++  auto)
++    AC_MSG_RESULT(auto)
++    samba_cv_WITH_SYS_QUOTAS=auto
++    samba_cv_TRY_SYS_QUOTAS=auto
++    samba_cv_RUN_QUOTA_TESTS=auto
++    ;;
++  no)
++    AC_MSG_RESULT(no)
++    samba_cv_WITH_SYS_QUOTAS=no
++    samba_cv_TRY_SYS_QUOTAS=no
++    ;;
++  *)
++    AC_MSG_RESULT(${samba_cv_TRY_SYS_QUOTAS})
++    ;;
++  esac ],
++  AC_MSG_RESULT(${samba_cv_TRY_SYS_QUOTAS})
++)
++
++if test x"$samba_cv_TRY_SYS_QUOTAS" = x"auto"; then
++AC_MSG_CHECKING(whether to try the lib/sysquotas.c interface on ${host_os})
++  case "$host_os" in
++      *linux*)
++          AC_MSG_RESULT(yes)
++            samba_cv_TRY_SYS_QUOTAS=yes
++            samba_cv_RUN_QUOTA_TESTS=yes
++          ;;
++      *)
++          AC_MSG_RESULT(no)
++            samba_cv_TRY_SYS_QUOTAS=no
++          ;;
++  esac
++fi
++
++#############################################
++# only check for quota stuff if --with-quotas
++if test x"$samba_cv_RUN_QUOTA_TESTS" != x"no"; then
++
++# For quotas on Veritas VxFS filesystems
++AC_CHECK_HEADERS(sys/fs/vx_quota.h)
++
++# For sys/quota.h and linux/quota.h
++AC_CHECK_HEADERS(sys/quota.h)
++AC_CHECK_HEADERS(asm/types.h linux/quota.h)
++
++# For quotas on Linux XFS filesystems
++AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
++AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)
++# For linux > 2.5.56 
++AC_CHECK_HEADERS(linux/dqblk_xfs.h)
++
++# if we have struct if_dqblk in <linux/quota.h> we should use it
++AC_CACHE_CHECK([for struct if_dqblk in <linux/quota.h>],samba_cv_HAVE_STRUCT_IF_DQBLK, [
++AC_TRY_COMPILE([
++#include "confdefs.h"
++#ifdef HAVE_SYS_TYPES_H
++#include <sys/types.h>
++#endif
++#ifdef HAVE_ASM_TYPES_H
++#include <asm/types.h>
++#endif
++#include <linux/quota.h>
++],[struct if_dqblk D;],
++samba_cv_HAVE_STRUCT_IF_DQBLK=yes,samba_cv_HAVE_STRUCT_IF_DQBLK=no)])
++if test "$samba_cv_HAVE_STRUCT_IF_DQBLK"x = "yes"x; then
++      AC_DEFINE(HAVE_STRUCT_IF_DQBLK,1,[struct if_dqblk])
++fi
++
++# if we have struct mem_dqblk in <linux/quota.h> we should use it
++AC_CACHE_CHECK([for struct mem_dqblk in <linux/quota.h>],samba_cv_HAVE_STRUCT_MEM_DQBLK, [
++AC_TRY_COMPILE([
++#include "confdefs.h"
++#ifdef HAVE_SYS_TYPES_H
++#include <sys/types.h>
++#endif
++#ifdef HAVE_ASM_TYPES_H
++#include <asm/types.h>
++#endif
++#include <linux/quota.h>
++],[struct mem_dqblk D;],
++samba_cv_HAVE_STRUCT_MEM_DQBLK=yes,samba_cv_HAVE_STRUCT_MEM_DQBLK=no)])
++if test "$samba_cv_HAVE_STRUCT_MEM_DQBLK"x = "yes"x; then
++      AC_DEFINE(HAVE_STRUCT_MEM_DQBLK,1,[struct mem_dqblk])
++fi
++
++# if we have struct dqblk .dqb_fsoftlimit instead of .dqb_isoftlimit on IRIX 
++AC_CACHE_CHECK([if struct dqblk has .dqb_fsoftlimit],samba_cv_HAVE_DQB_FSOFTLIMIT, [
++AC_TRY_COMPILE([
++#include "confdefs.h"
++#ifdef HAVE_SYS_QUOTA_H
++#include <sys/quota.h>
++#endif
++],[
++struct dqblk D;
++D.dqb_fsoftlimit = 0;],
++samba_cv_HAVE_DQB_FSOFTLIMIT=yes,samba_cv_HAVE_DQB_FSOFTLIMIT=no)])
++if test "$samba_cv_HAVE_DQB_FSOFTLIMIT"x = "yes"x; then
++      AC_DEFINE(HAVE_DQB_FSOFTLIMIT,1,[struct dqblk .dqb_fsoftlimit])
++fi
++
++##################
++# look for a working quota system
++samba_cv_SYSQUOTA_FOUND=no;
++
++if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then
++AC_CACHE_CHECK([for long quotactl(int cmd, char *special, qid_t id, caddr_t addr)],samba_cv_HAVE_QUOTACTL_4A,[
++AC_TRY_RUN_STRICT([
++#define HAVE_QUOTACTL_4A 1
++#define AUTOCONF_TEST 1
++#include "confdefs.h"
++#include "${srcdir-.}/tests/sysquotas.c"],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
++           samba_cv_HAVE_QUOTACTL_4A=yes,samba_cv_HAVE_QUOTACTL_4A=no,samba_cv_HAVE_QUOTACTL_4A=cross)])
++if test x"$samba_cv_HAVE_QUOTACTL_4A" = x"yes"; then
++    samba_cv_SYSQUOTA_FOUND=yes;AC_DEFINE(HAVE_QUOTACTL_4A,1,[Whether long quotactl(int cmd, char *special, qid_t id, caddr_t addr) is available])
++fi
++fi
++
++if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then
++AC_CACHE_CHECK([for int quotactl(const char *path, int cmd, int id, char *addr)],samba_cv_HAVE_QUOTACTL_4B,[
++AC_TRY_RUN_STRICT([
++#define HAVE_QUOTACTL_4B 1
++#define AUTOCONF_TEST 1
++#include "confdefs.h"
++#include "${srcdir-.}/tests/sysquotas.c"],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
++           samba_cv_HAVE_QUOTACTL_4B=yes,samba_cv_HAVE_QUOTACTL_4B=no,samba_cv_HAVE_QUOTACTL_4B=cross)])
++if test x"$samba_cv_HAVE_QUOTACTL_4B" = x"yes"; then
++    echo "int quotactl(const char *path, int cmd, int id, char *addr) is not reworked for the new sys_quota api"
++#    samba_cv_SYSQUOTA_FOUND=yes;AC_DEFINE(HAVE_QUOTACTL_4B,1,[Whether int quotactl(const char *path, int cmd, int id, char *addr) is available])
++fi
++fi
++
++if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then
++AC_CACHE_CHECK([for CRAY int quotactl (char *spec, int request, char *arg)],samba_cv_HAVE_QUOTACTL_3,[
++AC_TRY_RUN_STRICT([
++#define HAVE_QUOTACTL_3 1
++#define AUTOCONF_TEST 1
++#include "confdefs.h"
++#include "${srcdir-.}/tests/sysquotas.c"],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
++           samba_cv_HAVE_QUOTACTL_3=yes,samba_cv_HAVE_QUOTACTL_3=no,samba_cv_HAVE_QUOTACTL_3=cross)])
++if test x"$samba_cv_HAVE_QUOTACTL_3" = x"yes"; then
++    echo "CRAY int quotactl (char *spec, int request, char *arg) is NOT reworked for the sys_quota api"
++#    samba_cv_SYSQUOTA_FOUND=yes;AC_DEFINE(HAVE_QUOTACTL_3,1,[Whether CRAY int quotactl (char *spec, int request, char *arg); is available])
++fi
++fi
++
++#################################################
++# check for mntent.h and struct mntent
++AC_CHECK_HEADERS(mntent.h)
++#################################################
++# check for setmntent,getmntent,endmntent
++AC_CHECK_FUNCS(setmntent getmntent endmntent)
++
++#################################################
++# check for devnm.h and struct mntent
++AC_CHECK_HEADERS(devnm.h)
++#################################################
++# check for devnm
++AC_CHECK_FUNCS(devnm)
++
++if test x"$samba_cv_WITH_SYS_QUOTAS" = x"yes"; then
++    if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then
++      # if --with-sys-quotas=yes then build it 
++      # you have can use the get/set quota command smb.conf
++      # options then
++      samba_cv_SYSQUOTA_FOUND=auto
++    fi
++    if test x"$samba_cv_TRY_SYS_QUOTAS" != x"yes"; then
++      # if --with-sys-quotas=yes then build it 
++      # you have can use the get/set quota command smb.conf
++      # options then
++      samba_cv_TRY_SYS_QUOTAS=auto
++    fi
++fi
++
++if test x"$samba_cv_SYSQUOTA_FOUND" != x"no"; then
++AC_CACHE_CHECK([whether the sys_quota interface works],samba_cv_SYSQUOTA_WORKS,[
++SAVE_CPPFLAGS="$CPPFLAGS"
++CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I. -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt  -I${srcdir-.}/smbwrapper -I${srcdir-.}/nsswitch"
++AC_TRY_COMPILE([
++#include "confdefs.h"
++#define NO_PROTO_H 1
++#define NO_CONFIG_H 1
++#define HAVE_SYS_QUOTAS 1
++#include "${srcdir-.}/lib/sysquotas.c"
++],[],samba_cv_SYSQUOTA_WORKS=yes,samba_cv_SYSQUOTA_WORKS=no)
++CPPFLAGS="$SAVE_CPPFLAGS"
++])
++if test x"$samba_cv_SYSQUOTA_WORKS" = x"yes"; then
++AC_MSG_CHECKING(whether to use the new lib/sysquotas.c interface)
++    if test x"$samba_cv_TRY_SYS_QUOTAS" != x"no"; then 
++      AC_DEFINE(WITH_QUOTAS,1,[Whether to use disk quota support])
++      AC_DEFINE(HAVE_SYS_QUOTAS,1,[Whether the new lib/sysquotas.c interface can be used])
++      samba_cv_WE_USE_SYS_QUOTAS=yes
++      AC_MSG_RESULT(yes)
++    else
++        AC_MSG_RESULT(no)
++    fi
++fi
++fi
++
++AC_CACHE_CHECK([whether the old quota support works],samba_cv_QUOTA_WORKS,[
++SAVE_CPPFLAGS="$CPPFLAGS"
++CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I. -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt  -I${srcdir-.}/smbwrapper -I${srcdir-.}/nsswitch"
++AC_TRY_COMPILE([
++#include "confdefs.h"
++#define NO_PROTO_H 1
++#define NO_CONFIG_H 1
++#include "${srcdir-.}/smbd/quotas.c"
++],[],samba_cv_QUOTA_WORKS=yes,samba_cv_QUOTA_WORKS=no)
++CPPFLAGS="$SAVE_CPPFLAGS"
++])
++if test x"$samba_cv_QUOTA_WORKS" = x"yes"; then
++AC_MSG_CHECKING(whether to use the old quota support)
++    if test x"$samba_cv_WE_USE_SYS_QUOTAS" != x"yes"; then
++      if test x"$samba_cv_TRY_QUOTAS" != x"no"; then
++        AC_DEFINE(WITH_QUOTAS,1,[Whether to use disk quota support])
++      AC_MSG_RESULT(yes)
++      else
++      AC_MSG_RESULT(no)
++      fi
++    else
++      AC_MSG_RESULT(no)
++    fi
++fi
++
++####################
++# End of quota check samba_cv_RUN_QUOTA_TESTS
++fi
++
++#################################################
++# check for experimental utmp accounting
++
++AC_MSG_CHECKING(whether to support utmp accounting)
++WITH_UTMP=yes
++AC_ARG_WITH(utmp,
++[  --with-utmp             Include utmp accounting (default, if supported by OS)],
++[ case "$withval" in
++  no)
++              WITH_UTMP=no
++              ;;
++  *)
++              WITH_UTMP=yes
++                ;;
++  esac ],
++)
++
++# utmp requires utmp.h
++# Note similar check earlier, when checking utmp details.
++
++if test x"$WITH_UTMP" = x"yes" -a x"$ac_cv_header_utmp_h" = x"no"; then
++      utmp_no_reason=", no utmp.h on $host_os"
++      WITH_UTMP=no
++fi
++
++# Display test results
++
++if test x"$WITH_UTMP" = x"yes"; then
++        AC_MSG_RESULT(yes)
++      AC_DEFINE(WITH_UTMP,1,[Whether to include experimental utmp accounting])
++else
++        AC_MSG_RESULT(no$utmp_no_reason)
++fi
++
++#################################################
++# choose native language(s) of man pages
++AC_MSG_CHECKING(chosen man pages' language(s))
++AC_ARG_WITH(manpages-langs,
++[  --with-manpages-langs={en,ja,pl}  Choose man pages' language(s). (en)],
++[ case "$withval" in
++  yes|no)
++    AC_MSG_WARN(--with-manpages-langs called without argument - will use default)
++    manlangs="en"
++  ;;
++  *)
++    manlangs="$withval"
++  ;;
++  esac
++
++  AC_MSG_RESULT($manlangs)
++  manlangs=`echo $manlangs | sed "s/,/ /g"`   # replacing commas with spaces to produce a list
++  AC_SUBST(manlangs)],
++
++  [manlangs="en"
++  AC_MSG_RESULT($manlangs)
++  AC_SUBST(manlangs)]
++)
++
++#################################################
++# should we build libsmbclient?
++
++INSTALLCLIENTCMD_SH=:
++INSTALLCLIENTCMD_A=:
++INSTALLCLIENT=
++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 if shared libs supported)],
++[ case "$withval" in
++  no) 
++     AC_MSG_RESULT(no)
++     ;;
++  *)
++     if test $BLDSHARED = true; then
++        INSTALLCLIENTCMD_SH="\$(INSTALLCMD)"
++      ## build the static version of libsmbclient as well
++      INSTALLCLIENTCMD_A="\$(INSTALLCMD)"
++        LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
++        LIBSMBCLIENT=libsmbclient
++        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
++        INSTALLCLIENTCMD_A="\$(INSTALLCMD)"
++        LIBSMBCLIENT=libsmbclient
++     fi
++     INSTALLCLIENT=installclientlib
++     ;;
++  esac ],
++[
++# 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
++     enable_static=yes
++     AC_MSG_RESULT(no shared library support -- will supply static library)
++   fi
++   if test $enable_static = yes; then
++     INSTALLCLIENTCMD_A="\$(INSTALLCMD)"
++     LIBSMBCLIENT=libsmbclient
++  fi]
++  INSTALLCLIENT=installclientlib
++)
++
++
++#################################################
++# these tests are taken from the GNU fileutils package
++AC_CHECKING(how to get filesystem space usage)
++space=no
++
++# Test for statvfs64.
++if test $space = no; then
++  # SVR4
++  AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
++  [AC_TRY_RUN([
++#if defined(HAVE_UNISTD_H)
++#include <unistd.h>
++#endif
++#include <sys/types.h>
++#include <sys/statvfs.h>
++  main ()
++  {
++    struct statvfs64 fsd;
++    exit (statvfs64 (".", &fsd));
++  }],
++  fu_cv_sys_stat_statvfs64=yes,
++  fu_cv_sys_stat_statvfs64=no,
++  fu_cv_sys_stat_statvfs64=cross)])
++  if test $fu_cv_sys_stat_statvfs64 = yes; then
++    space=yes
++    AC_DEFINE(STAT_STATVFS64,1,[Whether statvfs64() is available])
++  fi
++fi
++
++# Perform only the link test since it seems there are no variants of the
++# statvfs function.  This check is more than just AC_CHECK_FUNCS(statvfs)
++# because that got a false positive on SCO OSR5.  Adding the declaration
++# of a `struct statvfs' causes this test to fail (as it should) on such
++# systems.  That system is reported to work fine with STAT_STATFS4 which
++# is what it gets when this test fails.
++if test $space = no; then
++  # SVR4
++  AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
++               [AC_TRY_LINK([#include <sys/types.h>
++#include <sys/statvfs.h>],
++                            [struct statvfs fsd; statvfs (0, &fsd);],
++                            fu_cv_sys_stat_statvfs=yes,
++                            fu_cv_sys_stat_statvfs=no)])
++  if test $fu_cv_sys_stat_statvfs = yes; then
++    space=yes
++    AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available])
++  fi
++fi
++
++if test $space = no; then
++  # DEC Alpha running OSF/1
++  AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
++  AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
++  [AC_TRY_RUN([
++#include <sys/param.h>
++#include <sys/types.h>
++#include <sys/mount.h>
++  main ()
++  {
++    struct statfs fsd;
++    fsd.f_fsize = 0;
++    exit (statfs (".", &fsd, sizeof (struct statfs)));
++  }],
++  fu_cv_sys_stat_statfs3_osf1=yes,
++  fu_cv_sys_stat_statfs3_osf1=no,
++  fu_cv_sys_stat_statfs3_osf1=no)])
++  AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
++  if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
++    space=yes
++    AC_DEFINE(STAT_STATFS3_OSF1,1,[Whether statfs requires 3 arguments])
++  fi
++fi
++
++if test $space = no; then
++# AIX
++  AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
++member (AIX, 4.3BSD)])
++  AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
++  [AC_TRY_RUN([
++#ifdef HAVE_SYS_PARAM_H
++#include <sys/param.h>
++#endif
++#ifdef HAVE_SYS_MOUNT_H
++#include <sys/mount.h>
++#endif
++#ifdef HAVE_SYS_VFS_H
++#include <sys/vfs.h>
++#endif
++  main ()
++  {
++  struct statfs fsd;
++  fsd.f_bsize = 0;
++  exit (statfs (".", &fsd));
++  }],
++  fu_cv_sys_stat_statfs2_bsize=yes,
++  fu_cv_sys_stat_statfs2_bsize=no,
++  fu_cv_sys_stat_statfs2_bsize=no)])
++  AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
++  if test $fu_cv_sys_stat_statfs2_bsize = yes; then
++    space=yes
++    AC_DEFINE(STAT_STATFS2_BSIZE,1,[Whether statfs requires two arguments and struct statfs has bsize property])
++  fi
++fi
++
++if test $space = no; then
++# SVR3
++  AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
++  AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
++  [AC_TRY_RUN([#include <sys/types.h>
++#include <sys/statfs.h>
++  main ()
++  {
++  struct statfs fsd;
++  exit (statfs (".", &fsd, sizeof fsd, 0));
++  }],
++    fu_cv_sys_stat_statfs4=yes,
++    fu_cv_sys_stat_statfs4=no,
++    fu_cv_sys_stat_statfs4=no)])
++  AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
++  if test $fu_cv_sys_stat_statfs4 = yes; then
++    space=yes
++    AC_DEFINE(STAT_STATFS4,1,[Whether statfs requires 4 arguments])
++  fi
++fi
++
++if test $space = no; then
++# 4.4BSD and NetBSD
++  AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
++member (4.4BSD and NetBSD)])
++  AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
++  [AC_TRY_RUN([#include <sys/types.h>
++#ifdef HAVE_SYS_PARAM_H
++#include <sys/param.h>
++#endif
++#ifdef HAVE_SYS_MOUNT_H
++#include <sys/mount.h>
++#endif
++  main ()
++  {
++  struct statfs fsd;
++  fsd.f_fsize = 0;
++  exit (statfs (".", &fsd));
++  }],
++  fu_cv_sys_stat_statfs2_fsize=yes,
++  fu_cv_sys_stat_statfs2_fsize=no,
++  fu_cv_sys_stat_statfs2_fsize=no)])
++  AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
++  if test $fu_cv_sys_stat_statfs2_fsize = yes; then
++    space=yes
++      AC_DEFINE(STAT_STATFS2_FSIZE,1,[Whether statfs requires 2 arguments and struct statfs has fsize])
++  fi
++fi
++
++if test $space = no; then
++  # Ultrix
++  AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
++  AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
++  [AC_TRY_RUN([#include <sys/types.h>
++#ifdef HAVE_SYS_PARAM_H
++#include <sys/param.h>
++#endif
++#ifdef HAVE_SYS_MOUNT_H
++#include <sys/mount.h>
++#endif
++#ifdef HAVE_SYS_FS_TYPES_H
++#include <sys/fs_types.h>
++#endif
++  main ()
++  {
++  struct fs_data fsd;
++  /* Ultrix's statfs returns 1 for success,
++     0 for not mounted, -1 for failure.  */
++  exit (statfs (".", &fsd) != 1);
++  }],
++  fu_cv_sys_stat_fs_data=yes,
++  fu_cv_sys_stat_fs_data=no,
++  fu_cv_sys_stat_fs_data=no)])
++  AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
++  if test $fu_cv_sys_stat_fs_data = yes; then
++    space=yes
++    AC_DEFINE(STAT_STATFS2_FS_DATA,1,[Whether statfs requires 2 arguments and struct fs_data is available])
++  fi
++fi
++
++#
++# As a gating factor for large file support, in order to
++# use <4GB files we must have the following minimal support
++# available.
++# long long, and a 64 bit off_t or off64_t.
++# If we don't have all of these then disable large
++# file support.
++#
++AC_MSG_CHECKING([if large file support can be enabled])
++AC_TRY_COMPILE([
++#if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
++#include <sys/types.h>
++#else
++__COMPILE_ERROR_
++#endif
++],
++[int i],
++samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
++if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
++      AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT,1,[Whether large file support can be enabled])
++fi
++AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT])
++
++AC_ARG_WITH(spinlocks, 
++[  --with-spinlocks        Use spin locks instead of fcntl locks (default=no) ])
++if test "x$with_spinlocks" = "xyes"; then
++    AC_DEFINE(USE_SPINLOCKS,1,[Whether to use spin locks instead of fcntl locks])
++
++    case "$host_cpu" in
++        sparc)
++            AC_DEFINE(SPARC_SPINLOCKS,1,[Whether to use sparc spinlocks])
++            ;;
++
++        i386|i486|i586|i686)
++            AC_DEFINE(INTEL_SPINLOCKS,1,[Whether to use intel spinlocks])
++            ;;
++
++        mips)
++            AC_DEFINE(MIPS_SPINLOCKS,1,[Whether to use mips spinlocks])
++            ;;
++
++        powerpc)
++            AC_DEFINE(POWERPC_SPINLOCKS,1,[Whether to use powerpc spinlocks])
++            ;;
++    esac
++fi
++
++#################################################
++# check for ACL support
++
++AC_MSG_CHECKING(whether to support ACLs)
++AC_ARG_WITH(acl-support,
++[  --with-acl-support      Include ACL support (default=no)],
++[ case "$withval" in
++  yes)
++
++      case "$host_os" in
++      *sysv5*)
++              AC_MSG_RESULT(Using UnixWare ACLs)
++              AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
++              ;;
++      *solaris*)
++              AC_MSG_RESULT(Using solaris ACLs)
++              AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
++              ;;
++      *hpux*)
++              AC_MSG_RESULT(Using HPUX ACLs)
++              AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
++              ;;
++      *irix*)
++              AC_MSG_RESULT(Using IRIX ACLs)
++              AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
++              ;;
++      *aix*)
++              AC_MSG_RESULT(Using AIX ACLs)
++              AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
++              ;;
++      *osf*)
++              AC_MSG_RESULT(Using Tru64 ACLs)
++              AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
++              ACL_LIBS="$ACL_LIBS -lpacl"
++              ;;
++      *freebsd5*)
++              AC_MSG_RESULT(Using FreeBSD posix ACLs)
++              AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether FreeBSD POSIX ACLs are available])
++              AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
++              ;;
++      *linux*)
++              AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
++                      AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
++              AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
++              acl_LIBS=$LIBS
++              LIBS="$LIBS -lacl"
++              AC_TRY_LINK([#include <sys/types.h>
++#include <sys/acl.h>],
++[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
++samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)
++              LIBS=$acl_LIBS])
++                      if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
++                              AC_MSG_RESULT(Using posix ACLs)
++                              AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
++                              AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
++                              acl_LIBS=$LIBS
++                              LIBS="$LIBS -lacl"
++                              AC_TRY_LINK([#include <sys/types.h>
++#include <sys/acl.h>],
++[ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);],
++samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)
++                              LIBS=$acl_LIBS])
++                              if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
++                                      AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
++                              fi
++                      fi
++            ;;
++         *)
++              AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
++              AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
++              acl_LIBS=$LIBS
++              LIBS="$LIBS -lacl"
++              AC_TRY_LINK([#include <sys/types.h>
++#include <sys/acl.h>],
++[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
++samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)
++              LIBS=$acl_LIBS])
++                      if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
++                              AC_MSG_RESULT(Using posix ACLs)
++                              AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
++                              AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
++                              acl_LIBS=$LIBS
++                              LIBS="$LIBS -lacl"
++                              AC_TRY_LINK([#include <sys/types.h>
++#include <sys/acl.h>],
++[ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);],
++samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)
++                              LIBS=$acl_LIBS])
++                              if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
++                                      AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
++                              fi
++                      fi
++            ;;
++        esac
++        ;;
++  *)
++    AC_MSG_RESULT(no)
++    AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
++    ;;
++  esac ],
++  AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
++  AC_MSG_RESULT(no)
++)
++
++#################################################
++# check for sendfile support
++
++with_sendfile_support=yes
++AC_MSG_CHECKING(whether to check to support sendfile)
++AC_ARG_WITH(sendfile-support,
++[  --with-sendfile-support Check for sendfile support (default=yes)],
++[ case "$withval" in
++  yes)
++
++      AC_MSG_RESULT(yes);
++
++      case "$host_os" in
++      *linux*)
++              AC_CACHE_CHECK([for linux sendfile64 support],samba_cv_HAVE_SENDFILE64,[
++              AC_TRY_LINK([#include <sys/sendfile.h>],
++[\
++int tofd, fromfd;
++off64_t offset;
++size_t total;
++ssize_t nwritten = sendfile64(tofd, fromfd, &offset, total);
++],
++samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)])
++
++              AC_CACHE_CHECK([for linux sendfile support],samba_cv_HAVE_SENDFILE,[
++              AC_TRY_LINK([#include <sys/sendfile.h>],
++[\
++int tofd, fromfd;
++off_t offset;
++size_t total;
++ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
++],
++samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
++
++# Try and cope with broken Linux sendfile....
++              AC_CACHE_CHECK([for broken linux sendfile support],samba_cv_HAVE_BROKEN_LINUX_SENDFILE,[
++              AC_TRY_LINK([\
++#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
++#undef _FILE_OFFSET_BITS
++#endif
++#include <sys/sendfile.h>],
++[\
++int tofd, fromfd;
++off_t offset;
++size_t total;
++ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
++],
++samba_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,samba_cv_HAVE_BROKEN_LINUX_SENDFILE=no)])
++
++      if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then
++              AC_DEFINE(HAVE_SENDFILE64,1,[Whether 64-bit sendfile() is available])
++              AC_DEFINE(LINUX_SENDFILE_API,1,[Whether linux sendfile() API is available])
++              AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
++      elif test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
++              AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
++              AC_DEFINE(LINUX_SENDFILE_API,1,[Whether linux sendfile() API is available])
++              AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
++      elif test x"$samba_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then
++              AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken])
++              AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used])
++      else
++              AC_MSG_RESULT(no);
++      fi
++
++      ;;
++      *freebsd*)
++              AC_CACHE_CHECK([for freebsd sendfile support],samba_cv_HAVE_SENDFILE,[
++              AC_TRY_LINK([\
++#include <sys/types.h>
++#include <unistd.h>
++#include <sys/socket.h>
++#include <sys/uio.h>],
++[\
++      int fromfd, tofd, ret, total=0;
++      off_t offset, nwritten;
++      struct sf_hdtr hdr;
++      struct iovec hdtrl;
++      hdr.headers = &hdtrl;
++      hdr.hdr_cnt = 1;
++      hdr.trailers = NULL;
++      hdr.trl_cnt = 0;
++      hdtrl.iov_base = NULL;
++      hdtrl.iov_len = 0;
++      ret = sendfile(fromfd, tofd, offset, total, &hdr, &nwritten, 0);
++],
++samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
++
++      if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
++              AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() support is available])
++              AC_DEFINE(FREEBSD_SENDFILE_API,1,[Whether the FreeBSD sendfile() API is available])
++              AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
++      else
++              AC_MSG_RESULT(no);
++      fi
++      ;;
++
++      *hpux*)
++              AC_CACHE_CHECK([for hpux sendfile64 support],samba_cv_HAVE_SENDFILE64,[
++              AC_TRY_LINK([\
++#include <sys/socket.h>
++#include <sys/uio.h>],
++[\
++      int fromfd, tofd;
++      size_t total=0;
++      struct iovec hdtrl[2];
++      ssize_t nwritten;
++      off64_t offset;
++
++      hdtrl[0].iov_base = 0;
++      hdtrl[0].iov_len = 0;
++
++      nwritten = sendfile64(tofd, fromfd, offset, total, &hdtrl[0], 0);
++],
++samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)])
++      if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then
++              AC_DEFINE(HAVE_SENDFILE64,1,[Whether sendfile64() is available])
++              AC_DEFINE(HPUX_SENDFILE_API,1,[Whether the hpux sendfile() API is available])
++              AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
++      else
++              AC_MSG_RESULT(no);
++      fi
++
++              AC_CACHE_CHECK([for hpux sendfile support],samba_cv_HAVE_SENDFILE,[
++              AC_TRY_LINK([\
++#include <sys/socket.h>
++#include <sys/uio.h>],
++[\
++      int fromfd, tofd;
++      size_t total=0;
++      struct iovec hdtrl[2];
++      ssize_t nwritten;
++      off_t offset;
++
++      hdtrl[0].iov_base = 0;
++      hdtrl[0].iov_len = 0;
++
++      nwritten = sendfile(tofd, fromfd, offset, total, &hdtrl[0], 0);
++],
++samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
++      if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
++              AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
++              AC_DEFINE(HPUX_SENDFILE_API,1,[Whether the hpux sendfile() API is available])
++              AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
++      else
++              AC_MSG_RESULT(no);
++      fi
++      ;;
++
++      *solaris*)
++              AC_CHECK_LIB(sendfile,sendfilev)
++              AC_CACHE_CHECK([for solaris sendfilev64 support],samba_cv_HAVE_SENDFILEV64,[
++              AC_TRY_LINK([\
++#include <sys/sendfile.h>],
++[\
++        int sfvcnt;
++        size_t xferred;
++        struct sendfilevec vec[2];
++      ssize_t nwritten;
++      int tofd;
++
++      sfvcnt = 2;
++
++      vec[0].sfv_fd = SFV_FD_SELF;
++      vec[0].sfv_flag = 0;
++      vec[0].sfv_off = 0;
++      vec[0].sfv_len = 0;
++
++      vec[1].sfv_fd = 0;
++      vec[1].sfv_flag = 0;
++      vec[1].sfv_off = 0;
++      vec[1].sfv_len = 0;
++      nwritten = sendfilev64(tofd, vec, sfvcnt, &xferred);
++],
++samba_cv_HAVE_SENDFILEV64=yes,samba_cv_HAVE_SENDFILEV64=no)])
++
++      if test x"$samba_cv_HAVE_SENDFILEV64" = x"yes"; then
++              AC_DEFINE(HAVE_SENDFILEV64,1,[Whether sendfilev64() is available])
++              AC_DEFINE(SOLARIS_SENDFILE_API,1,[Whether the soloris sendfile() API is available])
++              AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
++      else
++              AC_MSG_RESULT(no);
++      fi
++
++              AC_CACHE_CHECK([for solaris sendfilev support],samba_cv_HAVE_SENDFILEV,[
++              AC_TRY_LINK([\
++#include <sys/sendfile.h>],
++[\
++        int sfvcnt;
++        size_t xferred;
++        struct sendfilevec vec[2];
++      ssize_t nwritten;
++      int tofd;
++
++      sfvcnt = 2;
++
++      vec[0].sfv_fd = SFV_FD_SELF;
++      vec[0].sfv_flag = 0;
++      vec[0].sfv_off = 0;
++      vec[0].sfv_len = 0;
++
++      vec[1].sfv_fd = 0;
++      vec[1].sfv_flag = 0;
++      vec[1].sfv_off = 0;
++      vec[1].sfv_len = 0;
++      nwritten = sendfilev(tofd, vec, sfvcnt, &xferred);
++],
++samba_cv_HAVE_SENDFILEV=yes,samba_cv_HAVE_SENDFILEV=no)])
++
++      if test x"$samba_cv_HAVE_SENDFILEV" = x"yes"; then
++              AC_DEFINE(HAVE_SENDFILEV,1,[Whether sendfilev() is available])
++              AC_DEFINE(SOLARIS_SENDFILE_API,1,[Whether the solaris sendfile() API is available])
++              AC_DEFINE(WITH_SENDFILE,1,[Whether to include sendfile() support])
++      else
++              AC_MSG_RESULT(no);
++      fi
++      ;;
++
++      *)
++      ;;
++        esac
++        ;;
++  *)
++    AC_MSG_RESULT(no)
++    ;;
++  esac ],
++  AC_MSG_RESULT(yes)
++)
++
++
++#################################################
++# Check whether winbind is supported on this platform.  If so we need to
++# build and install client programs, sbin programs and shared libraries
++
++AC_MSG_CHECKING(whether to build winbind)
++
++# Initially, the value of $host_os decides whether winbind is supported
++
++HAVE_WINBIND=yes
++
++# Define the winbind shared library name and any specific linker flags
++# it needs to be built with.
++
++WINBIND_NSS="nsswitch/libnss_winbind.$SHLIBEXT"
++WINBIND_WINS_NSS="nsswitch/libnss_wins.$SHLIBEXT"
++WINBIND_NSS_LDSHFLAGS=$LDSHFLAGS
++
++case "$host_os" in
++      *linux*)
++              WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_linux.o"
++              ;;
++      *freebsd5*)
++              WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_freebsd.o"
++              ;;
++      *irix*)
++              # IRIX has differently named shared libraries
++              WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_irix.o"
++              WINBIND_NSS="nsswitch/libns_winbind.$SHLIBEXT"
++              WINBIND_WINS_NSS="nsswitch/libns_wins.$SHLIBEXT"
++              ;;
++      *solaris*)
++              # Solaris winbind client is implemented as a wrapper around
++              # the Linux version.
++              WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o \
++                  nsswitch/winbind_nss_linux.o"
++              WINBIND_NSS_EXTRA_LIBS="-lsocket"
++              ;;
++      *hpux11*)
++              WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o"
++              ;;
++      *aix*)
++              # AIX has even differently named shared libraries.  No
++              # WINS support has been implemented yet.
++              WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_aix.o"
++              WINBIND_NSS_LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-ewb_aix_init"
++              WINBIND_NSS="nsswitch/WINBIND"
++              WINBIND_WINS_NSS=""
++              ;;
++      *)
++              HAVE_WINBIND=no
++              winbind_no_reason=", unsupported on $host_os"
++              ;;
++esac
++
++AC_SUBST(WINBIND_NSS)
++AC_SUBST(WINBIND_WINS_NSS)
++AC_SUBST(WINBIND_NSS_LDSHFLAGS)
++AC_SUBST(WINBIND_NSS_EXTRA_OBJS)
++AC_SUBST(WINBIND_NSS_EXTRA_LIBS)
++
++# Check the setting of --with-winbindd
++
++AC_ARG_WITH(winbind,
++[  --with-winbind          Build winbind (default, if supported by OS)],
++[ 
++  case "$withval" in
++      yes)
++              HAVE_WINBIND=yes
++              ;;
++        no)
++              HAVE_WINBIND=no
++                winbind_reason=""
++                ;;
++  esac ],
++)
++
++# We need unix domain sockets for winbind
++
++if test x"$HAVE_WINBIND" = x"yes"; then
++      if test x"$samba_cv_unixsocket" = x"no"; then
++              winbind_no_reason=", no unix domain socket support on $host_os"
++              HAVE_WINBIND=no
++      fi
++fi
++
++# Display test results
++
++if test x"$HAVE_WINBIND" = x"yes"; then
++        AC_MSG_RESULT(yes)
++      AC_DEFINE(WITH_WINBIND,1,[Whether to build winbind])
++
++      EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/wbinfo\$(EXEEXT)"
++      EXTRA_SBIN_PROGS="$EXTRA_SBIN_PROGS bin/winbindd\$(EXEEXT)"
++        if test x"$BLDSHARED" = x"true"; then
++              SHLIB_PROGS="$SHLIB_PROGS $WINBIND_NSS $WINBIND_WINS_NSS"
++
++              if test x"$with_pam" = x"yes"; then
++                      SHLIB_PROGS="$SHLIB_PROGS nsswitch/pam_winbind.$SHLIBEXT"
++              fi
++      fi
++else
++        AC_MSG_RESULT(no$winbind_no_reason)
++fi
++
++# Solaris has some extra fields in struct passwd that need to be
++# initialised otherwise nscd crashes.  
++ 
++AC_CHECK_MEMBER(struct passwd.pw_comment,
++              AC_DEFINE(HAVE_PASSWD_PW_COMMENT, 1, [Defined if struct passwd has pw_comment field]),,
++              [#include <pwd.h>])
++
++AC_CHECK_MEMBER(struct passwd.pw_age,
++              AC_DEFINE(HAVE_PASSWD_PW_AGE, 1, [Defined if struct passwd has pw_age field]),,
++              [#include <pwd.h>])
++
++#################################################
++# Check to see if we should use the included popt 
++
++AC_ARG_WITH(included-popt,
++[  --with-included-popt    use bundled popt library, not from system],
++[ 
++  case "$withval" in
++      yes)
++              INCLUDED_POPT=yes
++              ;;
++        no)
++              INCLUDED_POPT=no
++                ;;
++  esac ],
++)
++if test x"$INCLUDED_POPT" != x"yes"; then
++    AC_CHECK_LIB(popt, poptGetContext,
++               INCLUDED_POPT=no, INCLUDED_POPT=yes)
++fi
++
++AC_MSG_CHECKING(whether to use included popt)
++if test x"$INCLUDED_POPT" = x"yes"; then
++    AC_MSG_RESULT(yes)
++    BUILD_POPT='$(POPT_OBJS)'
++      POPTLIBS='$(POPT_OBJS)'
++    FLAGS1="-I$srcdir/popt"
++else
++    AC_MSG_RESULT(no)
++      BUILD_POPT=""
++    POPTLIBS="-lpopt"
++fi
++AC_SUBST(BUILD_POPT)
++AC_SUBST(POPTLIBS)
++AC_SUBST(FLAGS1)
++
++#################################################
++# Check if the user wants Python
++
++# At the moment, you can use this to set which Python binary to link
++# against.  (Libraries built for Python2.2 can't be used by 2.1,
++# though they can coexist in different directories.)  In the future
++# this might make the Python stuff be built by default.
++
++# Defaulting python breaks the clean target if python isn't installed
++
++PYTHON=
++
++AC_ARG_WITH(python,
++[  --with-python=PYTHONNAME  build Python libraries],
++[ case "${withval-python}" in
++  yes)
++      PYTHON=python
++      EXTRA_ALL_TARGETS="$EXTRA_ALL_TARGETS python_ext"
++      ;;
++  no)
++      PYTHON=
++      ;;
++  *)
++      PYTHON=${withval-python}
++      ;;
++  esac ])
++AC_SUBST(PYTHON)
++
++for i in `echo $default_static_modules | sed -e's/,/ /g'`
++do
++      eval MODULE_DEFAULT_$i=STATIC
++done
++
++for i in `echo $default_shared_modules | sed -e's/,/ /g'`
++do
++      dnl Fall back to static if dlopen() is not available
++      eval MODULE_DEFAULT_$i=STATIC
++
++      if test x"$ac_cv_func_dlopen" = xyes; then
++              eval MODULE_DEFAULT_$i=SHARED
++      fi
++done
++
++dnl Always built these modules static
++MODULE_pdb_guest=STATIC
++MODULE_rpc_spoolss=STATIC
++MODULE_rpc_srv=STATIC
++MODULE_idmap_tdb=STATIC
++
++AC_ARG_WITH(static-modules,
++[  --with-static-modules=MODULES  Comma-seperated list of names of modules to statically link in],
++[ if test $withval; then
++      for i in `echo $withval | sed -e's/,/ /g'`
++      do
++              eval MODULE_$i=STATIC
++      done
++fi ])
++
++AC_ARG_WITH(shared-modules,
++[  --with-shared-modules=MODULES  Comma-seperated list of names of modules to build shared],
++[ if test $withval; then
++      for i in `echo $withval | sed -e's/,/ /g'`
++      do
++                      eval MODULE_$i=SHARED
++      done
++fi ])
++
++###########################################################################
++## contributed pdb_modules
++
++SMB_MODULE(pdb_xml, passdb/pdb_xml.o, "bin/xml.$SHLIBEXT", PDB,
++                [ PASSDB_LIBS="$PASSDB_LIBS $XML_LIBS" ] )
++SMB_MODULE(pdb_mysql, passdb/pdb_mysql.o, "bin/mysql.$SHLIBEXT", PDB, 
++                 [ PASSDB_LIBS="$PASSDB_LIBS $MYSQL_LIBS" ]   )
++
++## end of contributed pdb_modules
++###########################################################################
++
++SMB_MODULE(pdb_ldap, passdb/pdb_ldap.o, "bin/ldapsam.$SHLIBEXT", PDB, 
++                 [ PASSDB_LIBS="$PASSDB_LIBS $LDAP_LIBS" ] )
++SMB_MODULE(pdb_smbpasswd, passdb/pdb_smbpasswd.o, "bin/smbpasswd.$SHLIBEXT", PDB)
++SMB_MODULE(pdb_tdbsam, passdb/pdb_tdb.o, "bin/tdbsam.$SHLIBEXT", PDB)
++SMB_MODULE(pdb_guest, passdb/pdb_guest.o, "bin/guest.$SHLIBEXT", PDB)
++SMB_SUBSYSTEM(PDB,passdb/pdb_interface.o)
++
++SMB_MODULE(rpc_lsa, \$(RPC_LSA_OBJ), "bin/librpc_lsarpc.$SHLIBEXT", RPC)
++SMB_MODULE(rpc_reg, \$(RPC_REG_OBJ), "bin/librpc_winreg.$SHLIBEXT", RPC)
++SMB_MODULE(rpc_lsa_ds, \$(RPC_LSA_DS_OBJ), "bin/librpc_lsa_ds.$SHLIBEXT", RPC)
++SMB_MODULE(rpc_wks, \$(RPC_WKS_OBJ), "bin/librpc_wkssvc.$SHLIBEXT", RPC)
++SMB_MODULE(rpc_net, \$(RPC_NETLOG_OBJ), "bin/librpc_NETLOGON.$SHLIBEXT", RPC)
++SMB_MODULE(rpc_dfs, \$(RPC_DFS_OBJ), "bin/librpc_netdfs.$SHLIBEXT", RPC)
++SMB_MODULE(rpc_srv, \$(RPC_SVC_OBJ), "bin/librpc_srvsvc.$SHLIBEXT", RPC)
++SMB_MODULE(rpc_spoolss, \$(RPC_SPOOLSS_OBJ), "bin/librpc_spoolss.$SHLIBEXT", RPC)
++SMB_MODULE(rpc_samr, \$(RPC_SAMR_OBJ), "bin/librpc_samr.$SHLIBEXT", RPC)
++SMB_MODULE(rpc_echo, \$(RPC_ECHO_OBJ), "bin/librpc_echo.$SHLIBEXT", RPC)
++SMB_SUBSYSTEM(RPC,smbd/server.o)
++
++SMB_MODULE(idmap_ldap, sam/idmap_ldap.o, "bin/idmap_ldap.$SHLIBEXT", IDMAP)
++SMB_MODULE(idmap_tdb, sam/idmap_tdb.o, "bin/idmap_tdb.$SHLIBEXT", IDMAP)
++SMB_SUBSYSTEM(IDMAP,sam/idmap.o)
++
++SMB_MODULE(charset_weird, modules/weird.o, "bin/weird.$SHLIBEXT", CHARSET)
++SMB_MODULE(charset_CP850, modules/CP850.o, "bin/CP850.$SHLIBEXT", CHARSET)
++SMB_MODULE(charset_CP437, modules/CP437.o, "bin/CP437.$SHLIBEXT", CHARSET)
++SMB_MODULE(charset_macosxfs, modules/charset_macosxfs.o,"bin/macosxfs.$SHLIBEXT", CHARSET)
++SMB_SUBSYSTEM(CHARSET,lib/iconv.o)
++
++SMB_MODULE(auth_rhosts, \$(AUTH_RHOSTS_OBJ), "bin/rhosts.$SHLIBEXT", AUTH)
++SMB_MODULE(auth_sam, \$(AUTH_SAM_OBJ), "bin/sam.$SHLIBEXT", AUTH)
++SMB_MODULE(auth_unix, \$(AUTH_UNIX_OBJ), "bin/unix.$SHLIBEXT", AUTH)
++SMB_MODULE(auth_winbind, \$(AUTH_WINBIND_OBJ), "bin/winbind.$SHLIBEXT", AUTH)
++SMB_MODULE(auth_server, \$(AUTH_SERVER_OBJ), "bin/smbserver.$SHLIBEXT", AUTH)
++SMB_MODULE(auth_domain, \$(AUTH_DOMAIN_OBJ), "bin/domain.$SHLIBEXT", AUTH)
++SMB_MODULE(auth_builtin, \$(AUTH_BUILTIN_OBJ), "bin/builtin.$SHLIBEXT", AUTH)
++SMB_SUBSYSTEM(AUTH,auth/auth.o)
++
++SMB_MODULE(vfs_recycle, \$(VFS_RECYCLE_OBJ), "bin/recycle.$SHLIBEXT", VFS)
++SMB_MODULE(vfs_audit, \$(VFS_AUDIT_OBJ), "bin/audit.$SHLIBEXT", VFS)
++SMB_MODULE(vfs_extd_audit, \$(VFS_EXTD_AUDIT_OBJ), "bin/extd_audit.$SHLIBEXT", VFS)
++SMB_MODULE(vfs_netatalk, \$(VFS_NETATALK_OBJ), "bin/netatalk.$SHLIBEXT", VFS)
++SMB_MODULE(vfs_fake_perms, \$(VFS_FAKE_PERMS_OBJ), "bin/fake_perms.$SHLIBEXT", VFS)
++SMB_MODULE(vfs_default_quota, \$(VFS_DEFAULT_QUOTA_OBJ), "bin/default_quota.$SHLIBEXT", VFS)
++SMB_MODULE(vfs_readonly, \$(VFS_READONLY_OBJ), "bin/readonly.$SHLIBEXT", VFS)
++SMB_MODULE(vfs_cap, \$(VFS_CAP_OBJ), "bin/cap.$SHLIBEXT", VFS)
++SMB_SUBSYSTEM(VFS,smbd/vfs.o)
++
++AC_DEFINE_UNQUOTED(STRING_STATIC_MODULES, "$string_static_modules", [String list of builtin modules])
++
++#################################################
++# do extra things if we are running insure
++
++if test "${ac_cv_prog_CC}" = "insure"; then
++      CPPFLAGS="$CPPFLAGS -D__INSURE__"
++fi
++
++#################################################
++# Display summary of libraries detected
++
++AC_MSG_RESULT([Using libraries:])
++AC_MSG_RESULT([    LIBS = $LIBS])
++if test x"$with_ads_support" != x"no"; then
++   AC_MSG_RESULT([    KRB5_LIBS = $KRB5_LIBS])
++fi
++if test x"$with_ldap_support" != x"no"; then
++   AC_MSG_RESULT([    LDAP_LIBS = $LDAP_LIBS])
++fi
++AC_MSG_RESULT([    AUTH_LIBS = $AUTH_LIBS])
++
++#################################################
++# final configure stuff
++
++AC_MSG_CHECKING([configure summary])
++AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
++           AC_MSG_RESULT(yes),
++         AC_MSG_ERROR([summary failure. Aborting config]); exit 1;,
++         AC_MSG_WARN([cannot run when cross-compiling]))
++
++builddir=`pwd`
++AC_SUBST(builddir)
++
++dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
++LIB_REMOVE_USR_LIB(LDFLAGS)
++LIB_REMOVE_USR_LIB(LIBS)
++
++dnl Remove -I/usr/include/? from CFLAGS and CPPFLAGS
++CFLAGS_REMOVE_USR_INCLUDE(CFLAGS)
++CFLAGS_REMOVE_USR_INCLUDE(CPPFLAGS)
++
++AC_OUTPUT(include/stamp-h Makefile script/findsmb smbadduser script/gen-8bit-gap.sh)
++
++#################################################
++# Print very concise instructions on building/use
++if test "x$enable_dmalloc" = xyes
++then
++      AC_MSG_RESULT([Note: The dmalloc debug library will be included.  To turn it on use])
++      AC_MSG_RESULT([      \$ eval \`dmalloc samba\`.])
++fi
+diff -durN samba-3.0.1.orig/source/torture/nsstest.c samba-3.0.1/source/torture/nsstest.c
+--- samba-3.0.1.orig/source/torture/nsstest.c  2003-08-15 22:40:00.000000000 +0200
++++ samba-3.0.1/source/torture/nsstest.c       2004-12-30 13:57:10.644768784 +0100
+@@ -21,7 +21,7 @@
+ #include "includes.h"
+-static const char *so_path = "/lib/libnss_winbind.so";
++static const char *so_path = "/lib64/libnss_winbind.so";
+ static const char *nss_name = "winbind";
+ static int nss_errno;
+ static NSS_STATUS last_error;
+diff -durN samba-3.0.1.orig/source/torture/nsstest.c~ samba-3.0.1/source/torture/nsstest.c~
+--- samba-3.0.1.orig/source/torture/nsstest.c~ 1970-01-01 01:00:00.000000000 +0100
++++ samba-3.0.1/source/torture/nsstest.c~      2003-08-15 22:40:00.000000000 +0200
+@@ -0,0 +1,451 @@
++/* 
++   Unix SMB/CIFS implementation.
++   nss tester for winbindd
++   Copyright (C) Andrew Tridgell 2001
++   Copyright (C) Tim Potter 2003
++   
++   This program is free software; you can redistribute it and/or modify
++   it under the terms of the GNU General Public License as published by
++   the Free Software Foundation; either version 2 of the License, or
++   (at your option) any later version.
++   
++   This program is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++   GNU General Public License for more details.
++   
++   You should have received a copy of the GNU General Public License
++   along with this program; if not, write to the Free Software
++   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++*/
++
++#include "includes.h"
++
++static const char *so_path = "/lib/libnss_winbind.so";
++static const char *nss_name = "winbind";
++static int nss_errno;
++static NSS_STATUS last_error;
++static int total_errors;
++
++static void *find_fn(const char *name)
++{
++      pstring s;
++      static void *h;
++      void *res;
++
++      pstr_sprintf(s, "_nss_%s_%s", nss_name, name);
++
++      if (!h) {
++              h = sys_dlopen(so_path, RTLD_LAZY);
++      }
++      if (!h) {
++              printf("Can't open shared library %s\n", so_path);
++              exit(1);
++      }
++      res = sys_dlsym(h, s);
++      if (!res) {
++              printf("Can't find function %s\n", s);
++              total_errors++;
++              return NULL;
++      }
++      return res;
++}
++
++static void report_nss_error(const char *who, NSS_STATUS status)
++{
++      last_error = status;
++      total_errors++;
++      printf("ERROR %s: NSS_STATUS=%d  %d (nss_errno=%d)\n", 
++             who, status, NSS_STATUS_SUCCESS, nss_errno);
++}
++
++static struct passwd *nss_getpwent(void)
++{
++      NSS_STATUS (*_nss_getpwent_r)(struct passwd *, char *, 
++                                    size_t , int *) = find_fn("getpwent_r");
++      static struct passwd pwd;
++      static char buf[1000];
++      NSS_STATUS status;
++
++      if (!_nss_getpwent_r)
++              return NULL;
++
++      status = _nss_getpwent_r(&pwd, buf, sizeof(buf), &nss_errno);
++      if (status == NSS_STATUS_NOTFOUND) {
++              return NULL;
++      }
++      if (status != NSS_STATUS_SUCCESS) {
++              report_nss_error("getpwent", status);
++              return NULL;
++      }
++      return &pwd;
++}
++
++static struct passwd *nss_getpwnam(const char *name)
++{
++      NSS_STATUS (*_nss_getpwnam_r)(const char *, struct passwd *, char *, 
++                                    size_t , int *) = find_fn("getpwnam_r");
++      static struct passwd pwd;
++      static char buf[1000];
++      NSS_STATUS status;
++
++      if (!_nss_getpwnam_r)
++              return NULL;
++      
++      status = _nss_getpwnam_r(name, &pwd, buf, sizeof(buf), &nss_errno);
++      if (status == NSS_STATUS_NOTFOUND) {
++              return NULL;
++      }
++      if (status != NSS_STATUS_SUCCESS) {
++              report_nss_error("getpwnam", status);
++              return NULL;
++      }
++      return &pwd;
++}
++
++static struct passwd *nss_getpwuid(uid_t uid)
++{
++      NSS_STATUS (*_nss_getpwuid_r)(uid_t , struct passwd *, char *, 
++                                    size_t , int *) = find_fn("getpwuid_r");
++      static struct passwd pwd;
++      static char buf[1000];
++      NSS_STATUS status;
++
++      if (!_nss_getpwuid_r)
++              return NULL;
++      
++      status = _nss_getpwuid_r(uid, &pwd, buf, sizeof(buf), &nss_errno);
++      if (status == NSS_STATUS_NOTFOUND) {
++              return NULL;
++      }
++      if (status != NSS_STATUS_SUCCESS) {
++              report_nss_error("getpwuid", status);
++              return NULL;
++      }
++      return &pwd;
++}
++
++static void nss_setpwent(void)
++{
++      NSS_STATUS (*_nss_setpwent)(void) = find_fn("setpwent");
++      NSS_STATUS status;
++      
++      if (!_nss_setpwent)
++              return;
++
++      status = _nss_setpwent();
++      if (status != NSS_STATUS_SUCCESS) {
++              report_nss_error("setpwent", status);
++      }
++}
++
++static void nss_endpwent(void)
++{
++      NSS_STATUS (*_nss_endpwent)(void) = find_fn("endpwent");
++      NSS_STATUS status;
++
++      if (!_nss_endpwent)
++              return;
++
++      status = _nss_endpwent();
++      if (status != NSS_STATUS_SUCCESS) {
++              report_nss_error("endpwent", status);
++      }
++}
++
++
++static struct group *nss_getgrent(void)
++{
++      NSS_STATUS (*_nss_getgrent_r)(struct group *, char *, 
++                                    size_t , int *) = find_fn("getgrent_r");
++      static struct group grp;
++      static char *buf;
++      static int buflen = 1024;
++      NSS_STATUS status;
++
++      if (!_nss_getgrent_r)
++              return NULL;
++
++      if (!buf) 
++              buf = malloc(buflen);
++
++again:        
++      status = _nss_getgrent_r(&grp, buf, buflen, &nss_errno);
++      if (status == NSS_STATUS_TRYAGAIN) {
++              buflen *= 2;
++              buf = realloc(buf, buflen);
++              goto again;
++      }
++      if (status == NSS_STATUS_NOTFOUND) {
++              return NULL;
++      }
++      if (status != NSS_STATUS_SUCCESS) {
++              report_nss_error("getgrent", status);
++              return NULL;
++      }
++      return &grp;
++}
++
++static struct group *nss_getgrnam(const char *name)
++{
++      NSS_STATUS (*_nss_getgrnam_r)(const char *, struct group *, char *, 
++                                    size_t , int *) = find_fn("getgrnam_r");
++      static struct group grp;
++      static char *buf;
++      static int buflen = 1000;
++      NSS_STATUS status;
++
++      if (!_nss_getgrnam_r)
++              return NULL;
++
++      if (!buf) 
++              buf = malloc(buflen);
++again:        
++      status = _nss_getgrnam_r(name, &grp, buf, buflen, &nss_errno);
++      if (status == NSS_STATUS_TRYAGAIN) {
++              buflen *= 2;
++              buf = realloc(buf, buflen);
++              goto again;
++      }
++      if (status == NSS_STATUS_NOTFOUND) {
++              return NULL;
++      }
++      if (status != NSS_STATUS_SUCCESS) {
++              report_nss_error("getgrnam", status);
++              return NULL;
++      }
++      return &grp;
++}
++
++static struct group *nss_getgrgid(gid_t gid)
++{
++      NSS_STATUS (*_nss_getgrgid_r)(gid_t , struct group *, char *, 
++                                    size_t , int *) = find_fn("getgrgid_r");
++      static struct group grp;
++      static char *buf;
++      static int buflen = 1000;
++      NSS_STATUS status;
++      
++      if (!_nss_getgrgid_r)
++              return NULL;
++
++      if (!buf) 
++              buf = malloc(buflen);
++
++again:        
++      status = _nss_getgrgid_r(gid, &grp, buf, buflen, &nss_errno);
++      if (status == NSS_STATUS_TRYAGAIN) {
++              buflen *= 2;
++              buf = realloc(buf, buflen);
++              goto again;
++      }
++      if (status == NSS_STATUS_NOTFOUND) {
++              return NULL;
++      }
++      if (status != NSS_STATUS_SUCCESS) {
++              report_nss_error("getgrgid", status);
++              return NULL;
++      }
++      return &grp;
++}
++
++static void nss_setgrent(void)
++{
++      NSS_STATUS (*_nss_setgrent)(void) = find_fn("setgrent");
++      NSS_STATUS status;
++
++      if (!_nss_setgrent)
++              return;
++
++      status = _nss_setgrent();
++      if (status != NSS_STATUS_SUCCESS) {
++              report_nss_error("setgrent", status);
++      }
++}
++
++static void nss_endgrent(void)
++{
++      NSS_STATUS (*_nss_endgrent)(void) = find_fn("endgrent");
++      NSS_STATUS status;
++
++      if (!_nss_endgrent)
++              return;
++
++      status = _nss_endgrent();
++      if (status != NSS_STATUS_SUCCESS) {
++              report_nss_error("endgrent", status);
++      }
++}
++
++static int nss_initgroups(char *user, gid_t group, gid_t **groups, long int *start, long int *size)
++{
++      NSS_STATUS (*_nss_initgroups)(char *, gid_t , long int *,
++                                    long int *, gid_t **, long int , int *) = 
++              find_fn("initgroups_dyn");
++      NSS_STATUS status;
++
++      if (!_nss_initgroups) 
++              return NSS_STATUS_UNAVAIL;
++
++      status = _nss_initgroups(user, group, start, size, groups, 0, &nss_errno);
++      if (status != NSS_STATUS_SUCCESS) {
++              report_nss_error("initgroups", status);
++      }
++      return status;
++}
++
++static void print_passwd(struct passwd *pwd)
++{
++      printf("%s:%s:%lu:%lu:%s:%s:%s\n", 
++             pwd->pw_name,
++             pwd->pw_passwd,
++             (unsigned long)pwd->pw_uid,
++             (unsigned long)pwd->pw_gid,
++             pwd->pw_gecos,
++             pwd->pw_dir,
++             pwd->pw_shell);
++}
++
++static void print_group(struct group *grp)
++{
++      int i;
++      printf("%s:%s:%lu: ", 
++             grp->gr_name,
++             grp->gr_passwd,
++             (unsigned long)grp->gr_gid);
++      
++      if (!grp->gr_mem[0]) {
++              printf("\n");
++              return;
++      }
++      
++      for (i=0; grp->gr_mem[i+1]; i++) {
++              printf("%s, ", grp->gr_mem[i]);
++      }
++      printf("%s\n", grp->gr_mem[i]);
++}
++
++static void nss_test_initgroups(char *name, gid_t gid)
++{
++      long int size = 16;
++      long int start = 1;
++      gid_t *groups = NULL;
++      int i;
++      NSS_STATUS status;
++
++      groups = (gid_t *)malloc(size * sizeof(gid_t));
++      groups[0] = gid;
++
++      status = nss_initgroups(name, gid, &groups, &start, &size);
++      if (status == NSS_STATUS_UNAVAIL) {
++              printf("No initgroups fn\n");
++              return;
++      }
++
++      for (i=0; i<start-1; i++) {
++              printf("%lu, ", (unsigned long)groups[i]);
++      }
++      printf("%lu\n", (unsigned long)groups[i]);
++}
++
++
++static void nss_test_users(void)
++{
++      struct passwd *pwd;
++
++      nss_setpwent();
++      /* loop over all users */
++      while ((pwd = nss_getpwent())) {
++              printf("Testing user %s\n", pwd->pw_name);
++              printf("getpwent:   "); print_passwd(pwd);
++              pwd = nss_getpwuid(pwd->pw_uid);
++              if (!pwd) {
++                      total_errors++;
++                      printf("ERROR: can't getpwuid\n");
++                      continue;
++              }
++              printf("getpwuid:   "); print_passwd(pwd);
++              pwd = nss_getpwnam(pwd->pw_name);
++              if (!pwd) {
++                      total_errors++;
++                      printf("ERROR: can't getpwnam\n");
++                      continue;
++              }
++              printf("getpwnam:   "); print_passwd(pwd);
++              printf("initgroups: "); nss_test_initgroups(pwd->pw_name, pwd->pw_gid);
++              printf("\n");
++      }
++      nss_endpwent();
++}
++
++static void nss_test_groups(void)
++{
++      struct group *grp;
++
++      nss_setgrent();
++      /* loop over all groups */
++      while ((grp = nss_getgrent())) {
++              printf("Testing group %s\n", grp->gr_name);
++              printf("getgrent: "); print_group(grp);
++              grp = nss_getgrnam(grp->gr_name);
++              if (!grp) {
++                      total_errors++;
++                      printf("ERROR: can't getgrnam\n");
++                      continue;
++              }
++              printf("getgrnam: "); print_group(grp);
++              grp = nss_getgrgid(grp->gr_gid);
++              if (!grp) {
++                      total_errors++;
++                      printf("ERROR: can't getgrgid\n");
++                      continue;
++              }
++              printf("getgrgid: "); print_group(grp);
++              printf("\n");
++      }
++      nss_endgrent();
++}
++
++static void nss_test_errors(void)
++{
++      struct passwd *pwd;
++      struct group *grp;
++
++      pwd = getpwnam("nosuchname");
++      if (pwd || last_error != NSS_STATUS_NOTFOUND) {
++              total_errors++;
++              printf("ERROR Non existant user gave error %d\n", last_error);
++      }
++
++      pwd = getpwuid(0xFFF0);
++      if (pwd || last_error != NSS_STATUS_NOTFOUND) {
++              total_errors++;
++              printf("ERROR Non existant uid gave error %d\n", last_error);
++      }
++
++      grp = getgrnam("nosuchgroup");
++      if (grp || last_error != NSS_STATUS_NOTFOUND) {
++              total_errors++;
++              printf("ERROR Non existant group gave error %d\n", last_error);
++      }
++
++      grp = getgrgid(0xFFF0);
++      if (grp || last_error != NSS_STATUS_NOTFOUND) {
++              total_errors++;
++              printf("ERROR Non existant gid gave error %d\n", last_error);
++      }
++}
++
++ int main(int argc, char *argv[])
++{     
++      if (argc > 1) so_path = argv[1];
++      if (argc > 2) nss_name = argv[2];
++
++      nss_test_users();
++      nss_test_groups();
++      nss_test_errors();
++
++      printf("total_errors=%d\n", total_errors);
++
++      return total_errors;
++}
This page took 0.36378 seconds and 4 git commands to generate.