]> git.pld-linux.org Git - packages/samba.git/blob - samba-lib64.patch
- lib64 (AMD64) patch for samba
[packages/samba.git] / samba-lib64.patch
1 diff -durN samba-3.0.1.orig/source/Makefile.in samba-3.0.1/source/Makefile.in
2 --- samba-3.0.1.orig/source/Makefile.in 2003-12-10 22:59:18.000000000 +0100
3 +++ samba-3.0.1/source/Makefile.in      2004-12-30 13:53:05.263072472 +0100
4 @@ -1243,9 +1243,9 @@
5         @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
6  
7  installclientlib: installdirs libsmbclient
8 -       @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)${prefix}/lib
9 -       -$(INSTALLCLIENTCMD_SH) bin/libsmbclient.@SHLIBEXT@ $(DESTDIR)${prefix}/lib
10 -       -$(INSTALLCLIENTCMD_A) bin/libsmbclient.a $(DESTDIR)${prefix}/lib
11 +       @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)${prefix}/lib64
12 +       -$(INSTALLCLIENTCMD_SH) bin/libsmbclient.@SHLIBEXT@ $(DESTDIR)${prefix}/lib64
13 +       -$(INSTALLCLIENTCMD_A) bin/libsmbclient.a $(DESTDIR)${prefix}/lib64
14         @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)${prefix}/include
15         -$(INSTALLCMD) $(srcdir)/include/libsmbclient.h $(DESTDIR)${prefix}/include
16  
17 diff -durN samba-3.0.1.orig/source/Makefile.in~ samba-3.0.1/source/Makefile.in~
18 --- samba-3.0.1.orig/source/Makefile.in~        1970-01-01 01:00:00.000000000 +0100
19 +++ samba-3.0.1/source/Makefile.in~     2003-12-10 22:59:18.000000000 +0100
20 @@ -0,0 +1,1463 @@
21 +#########################################################################
22 +# Makefile.in for Samba - rewritten for autoconf support
23 +# Copyright Andrew Tridgell 1992-1998
24 +# Copyright (C) 2001 by Martin Pool <mbp@samba.org>
25 +# Copyright Andrew Bartlett 2002
26 +# Copyright (C) 2003 Jim McDonough <jmcd@us.ibm.com>
27 +# Copyright (C) 2002-2003 Jelmer Vernooij <jelmer@samba.org>
28 +###########################################################################
29 +
30 +prefix=@prefix@
31 +exec_prefix=@exec_prefix@
32 +
33 +LIBS=@LIBS@
34 +CC=@CC@
35 +SHLD=@SHLD@
36 +CFLAGS=@CFLAGS@
37 +CPPFLAGS=@CPPFLAGS@
38 +EXEEXT=@EXEEXT@
39 +LDFLAGS=@LDFLAGS@
40 +AR=@AR@
41 +LDSHFLAGS=@LDSHFLAGS@ @LDFLAGS@
42 +WINBIND_NSS_LDSHFLAGS=@WINBIND_NSS_LDSHFLAGS@ @LDFLAGS@
43 +AWK=@AWK@
44 +DYNEXP=@DYNEXP@
45 +PYTHON=@PYTHON@
46 +PERL=@PERL@
47 +
48 +TERMLDFLAGS=@TERMLDFLAGS@
49 +TERMLIBS=@TERMLIBS@
50 +PRINT_LIBS=@PRINT_LIBS@
51 +AUTH_LIBS=@AUTH_LIBS@
52 +ACL_LIBS=@ACL_LIBS@
53 +PASSDB_LIBS=@PASSDB_LIBS@
54 +IDMAP_LIBS=@IDMAP_LIBS@
55 +KRB5LIBS=@KRB5_LIBS@
56 +LDAP_LIBS=@LDAP_LIBS@
57 +
58 +LINK=$(CC) $(FLAGS) $(LDFLAGS)
59 +
60 +INSTALLCMD=@INSTALL@
61 +INSTALLCLIENTCMD_SH=@INSTALLCLIENTCMD_SH@
62 +INSTALLCLIENTCMD_A=@INSTALLCLIENTCMD_A@
63 +
64 +VPATH=@srcdir@
65 +srcdir=@abs_srcdir@
66 +builddir=@abs_builddir@
67 +SHELL=/bin/sh
68 +DESTDIR=/
69 +
70 +# XXX: Perhaps this should be @SHELL@ instead -- apparently autoconf
71 +# will search for a POSIX-compliant shell, and that might not be
72 +# /bin/sh on some platforms.  I guess it's not a big problem -- mbp
73 +
74 +# See the autoconf manual "Installation Directory Variables" for a
75 +# discussion of the subtle use of these variables.
76 +
77 +BASEDIR= @prefix@
78 +BINDIR = @bindir@
79 +# sbindir is mapped to bindir when compiling SAMBA in 2.0.x compatibility mode.
80 +SBINDIR = @sbindir@
81 +LIBDIR = @libdir@
82 +VFSLIBDIR = $(LIBDIR)/vfs
83 +PDBLIBDIR = $(LIBDIR)/pdb
84 +RPCLIBDIR = $(LIBDIR)/rpc
85 +IDMAPLIBDIR = $(LIBDIR)/idmap
86 +CHARSETLIBDIR = $(LIBDIR)/charset
87 +AUTHLIBDIR = $(LIBDIR)/auth
88 +CONFIGDIR = @configdir@
89 +VARDIR = @localstatedir@
90 +MANDIR = @mandir@
91 +
92 +# The permissions to give the executables
93 +INSTALLPERMS = 0755
94 +
95 +# set these to where to find various files
96 +# These can be overridden by command line switches (see smbd(8))
97 +# or in smb.conf (see smb.conf(5))
98 +LOGFILEBASE = @logfilebase@
99 +CONFIGFILE = $(CONFIGDIR)/smb.conf
100 +LMHOSTSFILE = $(CONFIGDIR)/lmhosts
101 +
102 +# This is where smbpasswd et al go
103 +PRIVATEDIR = @privatedir@
104 +
105 +SMB_PASSWD_FILE = $(PRIVATEDIR)/smbpasswd
106 +PRIVATE_DIR = $(PRIVATEDIR)
107 +
108 +# This is where SWAT images and help files go
109 +SWATDIR = @swatdir@
110 +
111 +# the directory where lock files go
112 +LOCKDIR = @lockdir@
113 +
114 +# the directory where pid files go
115 +PIDDIR = @piddir@
116 +# man pages language(s)
117 +man_langs = "@manlangs@"
118 +
119 +LIBSMBCLIENT=bin/libsmbclient.a @LIBSMBCLIENT_SHARED@
120 +LIBSMBCLIENT_MAJOR=0
121 +LIBSMBCLIENT_MINOR=1
122 +
123 +
124 +FLAGS1 = $(CFLAGS) @FLAGS1@ -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper  -I. $(CPPFLAGS) -I$(srcdir)
125 +FLAGS2 = 
126 +FLAGS3 = 
127 +FLAGS4 = 
128 +FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4)
129 +FLAGS  = $(ISA) $(FLAGS5) 
130 +
131 +PASSWD_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" -DPRIVATE_DIR=\"$(PRIVATE_DIR)\"
132 +PATH_FLAGS1 = -DCONFIGFILE=\"$(CONFIGFILE)\"  -DSBINDIR=\"$(SBINDIR)\"
133 +PATH_FLAGS2 = $(PATH_FLAGS1) -DBINDIR=\"$(BINDIR)\" -DDRIVERFILE=\"$(DRIVERFILE)\" 
134 +PATH_FLAGS3 = $(PATH_FLAGS2) -DLMHOSTSFILE=\"$(LMHOSTSFILE)\" 
135 +PATH_FLAGS4 = $(PATH_FLAGS3) -DSWATDIR=\"$(SWATDIR)\"  -DLOCKDIR=\"$(LOCKDIR)\" -DPIDDIR=\"$(PIDDIR)\"
136 +PATH_FLAGS5 = $(PATH_FLAGS4) -DLIBDIR=\"$(LIBDIR)\" \
137 +             -DLOGFILEBASE=\"$(LOGFILEBASE)\" -DSHLIBEXT=\"@SHLIBEXT@\"
138 +PATH_FLAGS6 = $(PATH_FLAGS5) -DCONFIGDIR=\"$(CONFIGDIR)\"
139 +PATH_FLAGS = $(PATH_FLAGS6) $(PASSWD_FLAGS)
140 +
141 +# Note that all executable programs now provide for an optional executable suffix.
142 +
143 +SBIN_PROGS = bin/smbd@EXEEXT@ bin/nmbd@EXEEXT@ bin/swat@EXEEXT@ @EXTRA_SBIN_PROGS@
144 +
145 +BIN_PROGS1 = bin/smbclient@EXEEXT@ bin/net@EXEEXT@ bin/smbspool@EXEEXT@ \
146 +       bin/testparm@EXEEXT@ bin/testprns@EXEEXT@ bin/smbstatus@EXEEXT@ 
147 +BIN_PROGS2 = bin/smbcontrol@EXEEXT@ bin/smbtree@EXEEXT@ bin/tdbbackup@EXEEXT@ \
148 +       bin/nmblookup@EXEEXT@ bin/pdbedit@EXEEXT@ bin/tdbdump@EXEEXT@
149 +BIN_PROGS3 = bin/smbpasswd@EXEEXT@ bin/rpcclient@EXEEXT@ bin/smbcacls@EXEEXT@ \
150 +       bin/profiles@EXEEXT@ bin/ntlm_auth@EXEEXT@ \
151 +       bin/smbcquotas@EXEEXT@
152 +
153 +# editreg removed from standard build until it is portable. It needs a major rewrite to 
154 +# achieve this (tridge)
155 +# bin/editreg@EXEEXT@
156 +
157 +TORTURE_PROGS = bin/smbtorture@EXEEXT@ bin/msgtest@EXEEXT@ \
158 +       bin/masktest@EXEEXT@ bin/locktest@EXEEXT@ \
159 +       bin/locktest2@EXEEXT@ bin/nsstest@EXEEXT@ bin/vfstest@EXEEXT@
160 +
161 +BIN_PROGS = $(BIN_PROGS1) $(BIN_PROGS2) $(BIN_PROGS3) @EXTRA_BIN_PROGS@
162 +
163 +EVERYTHING_PROGS = bin/debug2html@EXEEXT@ bin/smbfilter@EXEEXT@ bin/talloctort@EXEEXT@ \
164 +       bin/log2pcap@EXEEXT@
165 +
166 +SHLIBS = @SHLIB_PROGS@ @LIBSMBCLIENT@
167 +
168 +SCRIPTS = $(srcdir)/script/smbtar $(builddir)/script/findsmb
169 +
170 +VFS_MODULES = @VFS_MODULES@
171 +PDB_MODULES = @PDB_MODULES@
172 +RPC_MODULES = @RPC_MODULES@
173 +IDMAP_MODULES = @IDMAP_MODULES@
174 +CHARSET_MODULES = @CHARSET_MODULES@
175 +AUTH_MODULES = @AUTH_MODULES@
176 +MODULES = $(VFS_MODULES) $(PDB_MODULES) $(RPC_MODULES) $(IDMAP_MODULES) $(CHARSET_MODULES) $(AUTH_MODULES)
177 +
178 +######################################################################
179 +# object file lists
180 +######################################################################
181 +
182 +TDBBASE_OBJ = tdb/tdb.o tdb/spinlock.o
183 +TDB_OBJ = $(TDBBASE_OBJ) tdb/tdbutil.o tdb/tdbback.o
184 +
185 +SMBLDAP_OBJ = @SMBLDAP@
186 +
187 +LIB_OBJ = lib/version.o lib/charcnv.o lib/debug.o lib/fault.o \
188 +          lib/getsmbpass.o lib/interface.o lib/md4.o \
189 +          lib/interfaces.o lib/pidfile.o lib/replace.o lib/replace1.o \
190 +          lib/signal.o lib/system.o lib/sendfile.o lib/time.o \
191 +         lib/ufc.o lib/genrand.o lib/username.o \
192 +         lib/util_getent.o lib/util_pw.o lib/access.o lib/smbrun.o \
193 +         lib/bitmap.o lib/crc32.o lib/snprintf.o lib/dprintf.o \
194 +         lib/xfile.o lib/wins_srv.o \
195 +         lib/util_str.o lib/clobber.o lib/util_sid.o lib/util_uuid.o \
196 +         lib/util_unistr.o lib/util_file.o lib/data_blob.o \
197 +         lib/util.o lib/util_sock.o lib/sock_exec.o lib/util_sec.o \
198 +         lib/talloc.o lib/hash.o lib/substitute.o lib/fsusage.o \
199 +         lib/ms_fnmatch.o lib/select.o lib/messages.o \
200 +         lib/tallocmsg.o lib/dmallocmsg.o libsmb/smb_signing.o \
201 +         lib/md5.o lib/hmacmd5.o lib/iconv.o lib/smbpasswd.o \
202 +         nsswitch/wb_client.o nsswitch/wb_common.o \
203 +         lib/pam_errors.o intl/lang_tdb.o lib/account_pol.o \
204 +         lib/adt_tree.o lib/gencache.o $(TDB_OBJ) \
205 +         lib/module.o lib/ldap_escape.o @CHARSET_STATIC@ \
206 +         lib/privileges.o lib/secdesc.o lib/secace.o lib/secacl.o
207 +
208 +LIB_SMBD_OBJ = lib/system_smbd.o lib/util_smbd.o 
209 +
210 +READLINE_OBJ = lib/readline.o
211 +
212 +# Also depends on  $(SECRETS_OBJ) $(LIBSAMBA_OBJ)
213 +# Be sure to include them into your application
214 +POPT_LIB_OBJ = lib/popt_common.o 
215 +
216 +UBIQX_OBJ = ubiqx/ubi_BinTree.o ubiqx/ubi_Cache.o ubiqx/ubi_SplayTree.o \
217 +            ubiqx/ubi_dLinkList.o ubiqx/ubi_sLinkList.o 
218 +
219 +PARAM_OBJ = dynconfig.o param/loadparm.o param/params.o
220 +
221 +KRBCLIENT_OBJ = libads/kerberos.o
222 +
223 +LIBADS_OBJ = libads/ldap.o libads/ldap_printer.o libads/sasl.o \
224 +            libads/krb5_setpw.o libads/ldap_user.o \
225 +            libads/ads_struct.o libads/ads_status.o \
226 +             libads/disp_sec.o libads/ads_utils.o libads/ldap_utils.o \
227 +            libads/ads_ldap.o libads/authdata.o
228 +
229 +LIBADS_SERVER_OBJ = libads/util.o libads/kerberos_verify.o
230 +
231 +SECRETS_OBJ = passdb/secrets.o
232 +
233 +LIBNMB_OBJ = libsmb/unexpected.o libsmb/namecache.o libsmb/nmblib.o \
234 +            libsmb/namequery.o libsmb/conncache.o 
235 +
236 +LIBSAMBA_OBJ = libsmb/nterr.o libsmb/smbdes.o libsmb/smbencrypt.o libsmb/ntlmssp.o libsmb/ntlmssp_parse.o libsmb/ntlmssp_sign.o
237 +
238 +LIBSMB_OBJ = libsmb/clientgen.o libsmb/cliconnect.o libsmb/clifile.o \
239 +            libsmb/clikrb5.o libsmb/clispnego.o libsmb/asn1.o \
240 +            libsmb/clirap.o libsmb/clierror.o libsmb/climessage.o \
241 +            libsmb/clireadwrite.o libsmb/clilist.o libsmb/cliprint.o \
242 +            libsmb/clitrans.o libsmb/clisecdesc.o libsmb/clidgram.o \
243 +            libsmb/clistr.o lib/util_seaccess.o \
244 +            libsmb/cliquota.o libsmb/clifsinfo.o \
245 +             libsmb/smberr.o libsmb/credentials.o libsmb/pwd_cache.o \
246 +            libsmb/clioplock.o libsmb/errormap.o libsmb/clirap2.o \
247 +            libsmb/passchange.o libsmb/doserr.o \
248 +            $(RPC_PARSE_OBJ1) $(LIBSAMBA_OBJ) $(LIBNMB_OBJ) 
249 +
250 +LIBMSRPC_OBJ = rpc_client/cli_lsarpc.o rpc_client/cli_samr.o \
251 +              rpc_client/cli_netlogon.o rpc_client/cli_srvsvc.o \
252 +              rpc_client/cli_wkssvc.o rpc_client/cli_dfs.o \
253 +              rpc_client/cli_reg.o rpc_client/cli_pipe.o \
254 +              rpc_client/cli_spoolss.o rpc_client/cli_spoolss_notify.o  \
255 +              rpc_client/cli_ds.o rpc_client/cli_echo.o \
256 +              rpc_client/cli_shutdown.o
257 +
258 +REGOBJS_OBJ = registry/reg_objects.o
259 +REGISTRY_OBJ = registry/reg_frontend.o registry/reg_cachehook.o registry/reg_printing.o \
260 +               registry/reg_db.o 
261 +
262 +RPC_LSA_OBJ = rpc_server/srv_lsa.o rpc_server/srv_lsa_nt.o
263 +
264 +RPC_NETLOG_OBJ = rpc_server/srv_netlog.o rpc_server/srv_netlog_nt.o
265 +
266 +RPC_SAMR_OBJ = rpc_server/srv_samr.o rpc_server/srv_samr_nt.o \
267 +               rpc_server/srv_samr_util.o
268 +
269 +RPC_REG_OBJ =  rpc_server/srv_reg.o rpc_server/srv_reg_nt.o
270 +
271 +RPC_LSA_DS_OBJ =  rpc_server/srv_lsa_ds.o rpc_server/srv_lsa_ds_nt.o
272 +
273 +RPC_SVC_OBJ = rpc_server/srv_srvsvc.o rpc_server/srv_srvsvc_nt.o
274 +
275 +RPC_WKS_OBJ =  rpc_server/srv_wkssvc.o rpc_server/srv_wkssvc_nt.o
276 +
277 +RPC_DFS_OBJ =  rpc_server/srv_dfs.o rpc_server/srv_dfs_nt.o
278 +RPC_SPOOLSS_OBJ = rpc_server/srv_spoolss.o rpc_server/srv_spoolss_nt.o 
279 +
280 +RPC_PIPE_OBJ = rpc_server/srv_pipe_hnd.o rpc_server/srv_util.o \
281 +               rpc_server/srv_pipe.o rpc_server/srv_lsa_hnd.o
282 +
283 +RPC_ECHO_OBJ = rpc_server/srv_echo.o rpc_server/srv_echo_nt.o
284 +
285 +RPC_SERVER_OBJ = @RPC_STATIC@ $(RPC_PIPE_OBJ)
286 +
287 +# this includes only the low level parse code, not stuff
288 +# that requires knowledge of security contexts
289 +RPC_PARSE_OBJ1 = rpc_parse/parse_prs.o rpc_parse/parse_sec.o \
290 +                rpc_parse/parse_misc.o
291 +
292 +RPC_PARSE_OBJ = rpc_parse/parse_lsa.o rpc_parse/parse_net.o \
293 +                rpc_parse/parse_reg.o rpc_parse/parse_rpc.o \
294 +                rpc_parse/parse_samr.o rpc_parse/parse_srv.o \
295 +                rpc_parse/parse_wks.o rpc_parse/parse_ds.o \
296 +               rpc_parse/parse_spoolss.o rpc_parse/parse_dfs.o \
297 +               rpc_parse/parse_echo.o rpc_parse/parse_shutdown.o \
298 +               $(REGOBJS_OBJ)
299 +
300 +
301 +RPC_CLIENT_OBJ = rpc_client/cli_pipe.o 
302 +
303 +LOCKING_OBJ = locking/locking.o locking/brlock.o locking/posix.o
304 +
305 +PASSDB_GET_SET_OBJ = passdb/pdb_get_set.o
306 +
307 +PASSDB_OBJ = $(PASSDB_GET_SET_OBJ) passdb/passdb.o passdb/pdb_interface.o \
308 +               passdb/machine_sid.o passdb/util_sam_sid.o passdb/pdb_compat.o \
309 +               passdb/privileges.o passdb/lookup_sid.o @PDB_STATIC@ 
310 +
311 +XML_OBJ = passdb/pdb_xml.o
312 +MYSQL_OBJ = passdb/pdb_mysql.o
313 +DEVEL_HELP_WEIRD_OBJ = modules/weird.o
314 +CP850_OBJ = modules/CP850.o
315 +CP437_OBJ = modules/CP437.o
316 +CHARSET_MACOSXFS_OBJ = modules/charset_macosxfs.o
317 +
318 +GROUPDB_OBJ = groupdb/mapping.o
319 +
320 +PROFILE_OBJ = profile/profile.o
321 +PROFILES_OBJ = utils/profiles.o
322 +EDITREG_OBJ = utils/editreg.o
323 +
324 +OPLOCK_OBJ = smbd/oplock.o smbd/oplock_irix.o smbd/oplock_linux.o
325 +
326 +NOTIFY_OBJ = smbd/notify.o smbd/notify_hash.o smbd/notify_kernel.o
327 +
328 +VFS_AUDIT_OBJ = modules/vfs_audit.o
329 +VFS_EXTD_AUDIT_OBJ = modules/vfs_extd_audit.o
330 +VFS_FAKE_PERMS_OBJ = modules/vfs_fake_perms.o
331 +VFS_RECYCLE_OBJ = modules/vfs_recycle.o
332 +VFS_NETATALK_OBJ = modules/vfs_netatalk.o
333 +VFS_DEFAULT_QUOTA_OBJ = modules/vfs_default_quota.o
334 +VFS_READONLY_OBJ = modules/vfs_readonly.o modules/getdate.o
335 +VFS_CAP_OBJ = modules/vfs_cap.o
336 +
337 +PLAINTEXT_AUTH_OBJ = auth/pampass.o auth/pass_check.o
338 +
339 +SLCACHE_OBJ = libsmb/samlogon_cache.o
340 +
341 +DCUTIL_OBJ  = libsmb/namequery_dc.o libsmb/trustdom_cache.o libsmb/trusts_util.o
342 +
343 +AUTH_BUILTIN_OBJ = auth/auth_builtin.o
344 +AUTH_DOMAIN_OBJ = auth/auth_domain.o
345 +AUTH_SAM_OBJ = auth/auth_sam.o
346 +AUTH_RHOSTS_OBJ = auth/auth_rhosts.o
347 +AUTH_SERVER_OBJ = auth/auth_server.o
348 +AUTH_UNIX_OBJ = auth/auth_unix.o
349 +AUTH_WINBIND_OBJ = auth/auth_winbind.o
350 +
351 +AUTH_OBJ = auth/auth.o @AUTH_STATIC@ auth/auth_util.o auth/auth_compat.o \
352 +          auth/auth_ntlmssp.o \
353 +          $(PLAINTEXT_AUTH_OBJ) $(SLCACHE_OBJ) $(DCUTIL_OBJ)
354 +
355 +MANGLE_OBJ = smbd/mangle.o smbd/mangle_hash.o smbd/mangle_map.o smbd/mangle_hash2.o
356 +
357 +SMBD_OBJ_MAIN = smbd/server.o
358 +
359 +BUILDOPT_OBJ = smbd/build_options.o
360 +
361 +SMBD_OBJ_SRV = smbd/files.o smbd/chgpasswd.o smbd/connection.o \
362 +              smbd/utmp.o smbd/session.o \
363 +               smbd/dfree.o smbd/dir.o smbd/password.o smbd/conn.o smbd/fileio.o \
364 +               smbd/ipc.o smbd/lanman.o smbd/negprot.o \
365 +               smbd/message.o smbd/nttrans.o smbd/pipes.o \
366 +               smbd/reply.o smbd/sesssetup.o smbd/trans2.o smbd/uid.o \
367 +              smbd/dosmode.o smbd/filename.o smbd/open.o smbd/close.o \
368 +              smbd/blocking.o smbd/sec_ctx.o smbd/srvstr.o \
369 +              smbd/vfs.o smbd/vfs-wrap.o smbd/statcache.o \
370 +               smbd/posix_acls.o lib/sysacls.o lib/server_mutex.o \
371 +              smbd/process.o smbd/service.o smbd/error.o \
372 +              printing/printfsp.o \
373 +               lib/sysquotas.o smbd/change_trust_pw.o smbd/fake_file.o \
374 +              smbd/quotas.o smbd/ntquotas.o lib/afs.o \
375 +              $(MANGLE_OBJ) @VFS_STATIC@
376 +
377 +SMBD_OBJ_BASE = $(PARAM_OBJ) $(SMBD_OBJ_SRV) $(MSDFS_OBJ) $(LIBSMB_OBJ) \
378 +               $(RPC_SERVER_OBJ) $(RPC_PARSE_OBJ) $(SECRETS_OBJ) \
379 +               $(LOCKING_OBJ) $(PASSDB_OBJ) $(PRINTING_OBJ) $(PROFILE_OBJ) \
380 +               $(LIB_OBJ) $(PRINTBACKEND_OBJ) $(OPLOCK_OBJ) \
381 +               $(NOTIFY_OBJ) $(GROUPDB_OBJ) $(AUTH_OBJ) \
382 +               $(LIBMSRPC_OBJ) \
383 +               $(LIBADS_OBJ) $(KRBCLIENT_OBJ) $(LIBADS_SERVER_OBJ) \
384 +               $(LIB_SMBD_OBJ) $(REGISTRY_OBJ) $(POPT_LIB_OBJ) \
385 +               $(UBIQX_OBJ) $(BUILDOPT_OBJ) $(SMBLDAP_OBJ)
386 +
387 +PRINTING_OBJ = printing/pcap.o printing/print_svid.o \
388 +                               printing/print_cups.o printing/print_generic.o \
389 +                               printing/lpq_parse.o printing/load.o
390 +
391 +PRINTBACKEND_OBJ = printing/printing.o printing/nt_printing.o printing/notify.o \
392 +               printing/printing_db.o
393 +
394 +MSDFS_OBJ = msdfs/msdfs.o 
395 +
396 +SMBD_OBJ = $(SMBD_OBJ_BASE) $(SMBD_OBJ_MAIN)
397 +NMBD_OBJ1 = nmbd/asyncdns.o nmbd/nmbd.o nmbd/nmbd_become_dmb.o \
398 +            nmbd/nmbd_become_lmb.o nmbd/nmbd_browserdb.o \
399 +            nmbd/nmbd_browsesync.o nmbd/nmbd_elections.o \
400 +            nmbd/nmbd_incomingdgrams.o nmbd/nmbd_incomingrequests.o \
401 +            nmbd/nmbd_lmhosts.o nmbd/nmbd_logonnames.o nmbd/nmbd_mynames.o \
402 +            nmbd/nmbd_namelistdb.o nmbd/nmbd_namequery.o \
403 +            nmbd/nmbd_nameregister.o nmbd/nmbd_namerelease.o \
404 +            nmbd/nmbd_nodestatus.o nmbd/nmbd_packets.o \
405 +            nmbd/nmbd_processlogon.o nmbd/nmbd_responserecordsdb.o \
406 +            nmbd/nmbd_sendannounce.o nmbd/nmbd_serverlistdb.o \
407 +            nmbd/nmbd_subnetdb.o nmbd/nmbd_winsproxy.o nmbd/nmbd_winsserver.o \
408 +            nmbd/nmbd_workgroupdb.o nmbd/nmbd_synclists.o
409 +
410 +NMBD_OBJ = $(NMBD_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(UBIQX_OBJ) \
411 +           $(PROFILE_OBJ) $(LIB_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ)
412 +
413 +WREPL_OBJ1 = wrepld/server.o wrepld/process.o wrepld/parser.o wrepld/socket.o \
414 +             wrepld/partners.o
415 +
416 +WREPL_OBJ = $(WREPL_OBJ1)  $(PARAM_OBJ) $(UBIQX_OBJ) \
417 +           $(PROFILE_OBJ) $(LIB_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) \
418 +           $(LIBSAMBA_OBJ)
419 +
420 +SWAT_OBJ1 = web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o \
421 +           web/swat.o web/neg_lang.o 
422 +
423 +SWAT_OBJ = $(SWAT_OBJ1) $(PARAM_OBJ) $(PRINTING_OBJ) $(LIBSMB_OBJ) \
424 +          $(LOCKING_OBJ) $(PASSDB_OBJ) $(SECRETS_OBJ) $(KRBCLIENT_OBJ) \
425 +          $(UBIQX_OBJ) $(LIB_OBJ) $(GROUPDB_OBJ) $(PLAINTEXT_AUTH_OBJ) \
426 +          $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) lib/dummyroot.o
427 +
428 +SMBSH_OBJ = smbwrapper/smbsh.o smbwrapper/shared.o \
429 +            $(PARAM_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
430 +
431 +STATUS_OBJ = utils/status.o $(LOCKING_OBJ) $(PARAM_OBJ) \
432 +             $(UBIQX_OBJ) $(PROFILE_OBJ) $(LIB_OBJ) $(POPT_LIB_OBJ) \
433 +            $(SECRETS_OBJ) $(LIBSAMBA_OBJ) lib/dummyroot.o libsmb/errormap.o 
434 +
435 +SMBCONTROL_OBJ = utils/smbcontrol.o $(LOCKING_OBJ) $(PARAM_OBJ) \
436 +       $(UBIQX_OBJ) $(PROFILE_OBJ) $(LIB_OBJ) $(POPT_LIB_OBJ) \
437 +       $(SECRETS_OBJ) $(LIBSAMBA_OBJ) \
438 +       printing/notify.o printing/printing_db.o lib/dummyroot.o libsmb/errormap.o
439 +
440 +SMBTREE_OBJ = utils/smbtree.o $(LOCKING_OBJ) $(PARAM_OBJ) \
441 +             $(UBIQX_OBJ) $(PROFILE_OBJ) $(LIB_OBJ) $(LIBSMB_OBJ) \
442 +            $(KRBCLIENT_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) 
443 +
444 +TESTPARM_OBJ = utils/testparm.o \
445 +               $(PARAM_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) $(POPT_LIB_OBJ) \
446 +              $(SECRETS_OBJ) $(LIBSAMBA_OBJ)
447 +
448 +TESTPRNS_OBJ = utils/testprns.o $(PARAM_OBJ) $(PRINTING_OBJ) $(UBIQX_OBJ) \
449 +               $(LIB_OBJ)
450 +
451 +SMBPASSWD_OBJ = utils/smbpasswd.o $(PARAM_OBJ) $(SECRETS_OBJ) \
452 +               $(LIBSMB_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ)\
453 +                $(UBIQX_OBJ) $(LIB_OBJ) $(KRBCLIENT_OBJ) \
454 +               $(SMBLDAP_OBJ) lib/dummyroot.o
455 +
456 +PDBEDIT_OBJ = utils/pdbedit.o $(PARAM_OBJ) $(PASSDB_OBJ) $(LIBSAMBA_OBJ) \
457 +               $(UBIQX_OBJ) $(LIB_OBJ) $(GROUPDB_OBJ) $(SECRETS_OBJ) \
458 +               $(POPT_LIB_OBJ) $(SMBLDAP_OBJ) lib/dummyroot.o
459 +
460 +RPCCLIENT_OBJ1 = rpcclient/rpcclient.o rpcclient/cmd_lsarpc.o \
461 +                rpcclient/cmd_samr.o rpcclient/cmd_spoolss.o \
462 +                rpcclient/cmd_netlogon.o rpcclient/cmd_srvsvc.o \
463 +                rpcclient/cmd_dfs.o rpcclient/cmd_reg.o \
464 +                rpcclient/display_sec.o rpcclient/cmd_ds.o \
465 +                rpcclient/cmd_echo.o rpcclient/cmd_shutdown.o
466 +
467 +RPCCLIENT_OBJ = $(RPCCLIENT_OBJ1) \
468 +             $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) \
469 +             $(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(LIBMSRPC_OBJ) \
470 +             $(READLINE_OBJ) $(GROUPDB_OBJ) $(KRBCLIENT_OBJ) \
471 +            $(LIBADS_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ) \
472 +            $(SMBLDAP_OBJ) $(DCUTIL_OBJ) lib/dummyroot.o
473 +
474 +PAM_WINBIND_PICOBJ = nsswitch/pam_winbind.@PICSUFFIX@ \
475 +       nsswitch/wb_common.@PICSUFFIX@ lib/replace1.@PICSUFFIX@ \
476 +       lib/snprintf.@PICSUFFIX@
477 +
478 +SMBW_OBJ1 = smbwrapper/smbw.o \
479 +               smbwrapper/smbw_dir.o smbwrapper/smbw_stat.o \
480 +               smbwrapper/realcalls.o smbwrapper/shared.o \
481 +               smbwrapper/smbw_cache.o
482 +
483 +SMBW_OBJ = $(SMBW_OBJ1) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(PARAM_OBJ) \
484 +                $(UBIQX_OBJ) $(LIB_OBJ)
485 +
486 +SMBWRAPPER_OBJ1 = smbwrapper/wrapped.o
487 +
488 +SMBWRAPPER_OBJ = $(SMBW_OBJ) $(SMBWRAPPER_OBJ1)
489 +
490 +LIBSMBCLIENT_OBJ = libsmb/libsmbclient.o libsmb/libsmb_compat.o \
491 +                  libsmb/libsmb_cache.o \
492 +                  $(PARAM_OBJ) $(LIB_OBJ) \
493 +                  $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(UBIQX_OBJ) \
494 +                  $(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_GET_SET_OBJ)
495 +
496 +# This shared library is intended for linking with unit test programs
497 +# to test Samba internals.  It's called libbigballofmud.so to
498 +# discourage casual usage.
499 +
500 +LIBBIGBALLOFMUD_MAJOR = 0
501 +
502 +LIBBIGBALLOFMUD_OBJ = $(PARAM_OBJ) $(LIB_OBJ) $(UBIQX_OBJ) $(SECRETS_OBJ) \
503 +       $(LIBSMB_OBJ) $(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_OBJ) \
504 +       $(GROUPDB_OBJ) $(KRBCLIENT_OBJ) $(SMBLDAP_OBJ) lib/dummyroot.o
505 +
506 +LIBBIGBALLOFMUD_PICOBJS = $(LIBBIGBALLOFMUD_OBJ:.o=.@PICSUFFIX@)
507 +
508 +CLIENT_OBJ1 = client/client.o client/clitar.o 
509 +
510 +CLIENT_OBJ = $(CLIENT_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) \
511 +            $(LIB_OBJ) $(KRBCLIENT_OBJ) \
512 +             $(READLINE_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ)
513 +
514 +NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_ads_cldap.o utils/net_help.o \
515 +          utils/net_rap.o utils/net_rpc.o utils/net_rpc_samsync.o \
516 +          utils/net_rpc_join.o utils/net_time.o utils/net_lookup.o \
517 +          utils/net_cache.o utils/net_groupmap.o utils/net_idmap.o \
518 +          utils/net_status.o
519 +
520 +NET_OBJ = $(NET_OBJ1) $(PARAM_OBJ) $(SECRETS_OBJ) $(LIBSMB_OBJ) \
521 +         $(RPC_PARSE_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
522 +         $(KRBCLIENT_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) \
523 +         $(LIBMSRPC_OBJ) $(IDMAP_OBJ) \
524 +         $(LIBADS_OBJ) $(LIBADS_SERVER_OBJ) $(POPT_LIB_OBJ) \
525 +         $(SMBLDAP_OBJ) $(DCUTIL_OBJ) lib/dummyroot.o lib/server_mutex.o lib/afs.o
526 +
527 +CUPS_OBJ = client/smbspool.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) \
528 +         $(LIB_OBJ) $(KRBCLIENT_OBJ) $(SECRETS_OBJ)
529 +
530 +MOUNT_OBJ = client/smbmount.o \
531 +             $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) 
532 +
533 +MNT_OBJ = client/smbmnt.o lib/version.o lib/snprintf.o
534 +
535 +UMOUNT_OBJ = client/smbumount.o
536 +
537 +NMBLOOKUP_OBJ = utils/nmblookup.o $(PARAM_OBJ) $(UBIQX_OBJ) $(LIBNMB_OBJ) \
538 +               $(LIB_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) $(LIBSAMBA_OBJ)
539 +
540 +SMBTORTURE_OBJ1 = torture/torture.o torture/nbio.o torture/scanner.o torture/utable.o \
541 +               torture/denytest.o torture/mangle_test.o 
542 +
543 +SMBTORTURE_OBJ = $(SMBTORTURE_OBJ1) $(PARAM_OBJ) \
544 +       $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
545 +
546 +MASKTEST_OBJ = torture/masktest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
547 +                 $(UBIQX_OBJ) $(LIB_OBJ)
548 +
549 +MSGTEST_OBJ = torture/msgtest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
550 +                 $(UBIQX_OBJ) $(LIB_OBJ)
551 +
552 +LOCKTEST_OBJ = torture/locktest.o $(PARAM_OBJ) $(LOCKING_OBJ) $(KRBCLIENT_OBJ) \
553 +                          $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
554 +
555 +NSSTEST_OBJ = torture/nsstest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
556 +                 $(UBIQX_OBJ) $(LIB_OBJ)
557 +
558 +VFSTEST_OBJ = torture/cmd_vfs.o torture/vfstest.o $(SMBD_OBJ_BASE) $(READLINE_OBJ)
559 +
560 +SMBICONV_OBJ = $(PARAM_OBJ) torture/smbiconv.o $(LIB_OBJ) $(UBIQX_OBJ) $(POPT_LIB_OBJ) $(SECRETS_OBJ) $(LIBSAMBA_OBJ)
561 +
562 +LOG2PCAP_OBJ = utils/log2pcaphex.o
563 +
564 +LOCKTEST2_OBJ = torture/locktest2.o $(PARAM_OBJ) $(LOCKING_OBJ) $(LIBSMB_OBJ) \
565 +               $(KRBCLIENT_OBJ) $(UBIQX_OBJ) $(LIB_OBJ)
566 +
567 +SMBCACLS_OBJ = utils/smbcacls.o $(PARAM_OBJ) $(LOCKING_OBJ) $(LIBSMB_OBJ) \
568 +                          $(KRBCLIENT_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) $(RPC_PARSE_OBJ) \
569 +                          $(PASSDB_GET_SET_OBJ) $(LIBMSRPC_OBJ) $(SECRETS_OBJ) \
570 +                          $(POPT_LIB_OBJ) $(DCUTIL_OBJ) $(LIBADS_OBJ)
571 +
572 +SMBCQUOTAS_OBJ = utils/smbcquotas.o $(LOCKING_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
573 +               $(PARAM_OBJ) \
574 +               $(UBIQX_OBJ) $(LIB_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_GET_SET_OBJ) \
575 +               $(LIBMSRPC_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ)
576 +
577 +TALLOCTORT_OBJ = lib/talloctort.o $(PARAM_OBJ) $(LIB_OBJ) $(UBIQX_OBJ)
578 +
579 +RPCTORTURE_OBJ = torture/rpctorture.o \
580 +             rpcclient/display.o \
581 +             rpcclient/cmd_lsarpc.o \
582 +             rpcclient/cmd_wkssvc.o \
583 +             rpcclient/cmd_samr.o \
584 +             rpcclient/cmd_srvsvc.o \
585 +             rpcclient/cmd_netlogon.o \
586 +             $(PARAM_OBJ) $(LIBSMB_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) $(KRBCLIENT_OBJ) \
587 +             $(RPC_CLIENT_OBJ) $(RPC_PARSE_OBJ) $(PASSDB_GET_SET_OBJ)
588 +
589 +DEBUG2HTML_OBJ = utils/debug2html.o ubiqx/debugparse.o
590 +
591 +SMBFILTER_OBJ = utils/smbfilter.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
592 +                 $(UBIQX_OBJ) $(LIB_OBJ) $(KRBCLIENT_OBJ) 
593 +
594 +PROTO_OBJ = $(SMBD_OBJ_MAIN) \
595 +           $(SMBD_OBJ_SRV) $(NMBD_OBJ1) $(SWAT_OBJ1) $(LIB_OBJ) $(LIBSMB_OBJ) \
596 +           $(SMBW_OBJ1) $(SMBWRAPPER_OBJ1) $(SMBTORTURE_OBJ1) $(RPCCLIENT_OBJ1) \
597 +           $(LIBMSRPC_OBJ) $(RPC_CLIENT_OBJ) \
598 +           $(RPC_PIPE_OBJ) $(RPC_PARSE_OBJ) $(KRBCLIENT_OBJ) \
599 +           $(AUTH_OBJ) $(PARAM_OBJ) $(LOCKING_OBJ) $(SECRETS_OBJ) \
600 +           $(PRINTING_OBJ) $(PRINTBACKEND_OBJ) $(OPLOCK_OBJ) $(NOTIFY_OBJ) \
601 +           $(PASSDB_OBJ) $(GROUPDB_OBJ) $(MSDFS_OBJ) \
602 +           $(READLINE_OBJ) $(PROFILE_OBJ) $(LIBADS_OBJ) $(LIBADS_SERVER_OBJ) \
603 +           $(LIB_SMBD_OBJ) $(SAM_OBJ) $(REGISTRY_OBJ) $(POPT_LIB_OBJ) \
604 +           $(RPC_LSA_OBJ) $(RPC_NETLOG_OBJ) $(RPC_SAMR_OBJ) $(RPC_REG_OBJ) $(RPC_LSA_DS_OBJ) \
605 +           $(RPC_SVC_OBJ) $(RPC_WKS_OBJ) $(RPC_DFS_OBJ) $(RPC_SPOOLSS_OBJ) \
606 +           $(RPC_ECHO_OBJ) $(SMBLDAP_OBJ) $(IDMAP_OBJ) libsmb/spnego.o
607 +
608 +WINBIND_WINS_NSS_OBJ = nsswitch/wins.o $(PARAM_OBJ) $(UBIQX_OBJ) \
609 +       $(LIBSMB_OBJ) $(LIB_OBJ) $(NSSWINS_OBJ) $(KRBCLIENT_OBJ)
610 +
611 +WINBIND_WINS_NSS_PICOBJS = $(WINBIND_WINS_NSS_OBJ:.o=.@PICSUFFIX@)
612 +
613 +PICOBJS = $(SMBWRAPPER_OBJ:.o=.@PICSUFFIX@)
614 +LIBSMBCLIENT_PICOBJS = $(LIBSMBCLIENT_OBJ:.o=.@PICSUFFIX@)
615 +
616 +PAM_SMBPASS_OBJ_0 = pam_smbpass/pam_smb_auth.o pam_smbpass/pam_smb_passwd.o \
617 +               pam_smbpass/pam_smb_acct.o pam_smbpass/support.o \
618 +               lib/dummyroot.o $(PARAM_OBJ) $(LIB_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
619 +               $(SECRETS_OBJ) $(UBIQX_OBJ) $(SMBLDAP_OBJ) $(LIBSAMBA_OBJ)
620 +
621 +PAM_SMBPASS_PICOOBJ = $(PAM_SMBPASS_OBJ_0:.o=.@PICSUFFIX@)
622 +
623 +IDMAP_OBJ     = sam/idmap.o sam/idmap_util.o @IDMAP_STATIC@
624 +
625 +WINBINDD_OBJ1 = \
626 +               nsswitch/winbindd.o       \
627 +               nsswitch/winbindd_user.o  \
628 +               nsswitch/winbindd_group.o \
629 +               nsswitch/winbindd_util.o  \
630 +               nsswitch/winbindd_cache.o \
631 +               nsswitch/winbindd_pam.o   \
632 +               nsswitch/winbindd_sid.o   \
633 +               nsswitch/winbindd_misc.o  \
634 +               nsswitch/winbindd_cm.o \
635 +               nsswitch/winbindd_wins.o \
636 +               nsswitch/winbindd_rpc.o \
637 +               nsswitch/winbindd_ads.o \
638 +               nsswitch/winbindd_dual.o \
639 +               nsswitch/winbindd_acct.o
640 +
641 +WINBINDD_OBJ = \
642 +               $(WINBINDD_OBJ1) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
643 +               $(PARAM_OBJ) $(UBIQX_OBJ) $(LIB_OBJ) \
644 +               $(LIBSMB_OBJ) $(LIBMSRPC_OBJ) $(RPC_PARSE_OBJ) \
645 +               $(PROFILE_OBJ) $(SLCACHE_OBJ) $(SMBLDAP_OBJ) \
646 +               $(SECRETS_OBJ) $(LIBADS_OBJ) $(KRBCLIENT_OBJ) $(POPT_LIB_OBJ) \
647 +               $(DCUTIL_OBJ) $(IDMAP_OBJ) lib/dummyroot.o
648 +
649 +WBINFO_OBJ = nsswitch/wbinfo.o $(LIBSAMBA_OBJ) $(PARAM_OBJ) $(LIB_OBJ) \
650 +               $(UBIQX_OBJ) $(SECRETS_OBJ) $(POPT_LIB_OBJ)
651 +
652 +WINBIND_NSS_OBJ = nsswitch/wb_common.o lib/replace1.o @WINBIND_NSS_EXTRA_OBJS@
653 +
654 +WINBIND_NSS_PICOBJS = $(WINBIND_NSS_OBJ:.o=.@PICSUFFIX@) lib/snprintf.@PICSUFFIX@
655 +
656 +POPT_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \
657 +          popt/popthelp.o popt/poptparse.o
658 +
659 +TDBBACKUP_OBJ = tdb/tdbbackup.o tdb/tdbback.o lib/snprintf.o $(TDBBASE_OBJ)
660 +
661 +TDBDUMP_OBJ = tdb/tdbdump.o $(TDBBASE_OBJ)
662 +
663 +NTLM_AUTH_OBJ = utils/ntlm_auth.o $(LIBSAMBA_OBJ) $(POPT_LIB_OBJ) \
664 +               libsmb/asn1.o libsmb/spnego.o libsmb/clikrb5.o libads/kerberos.o \
665 +               libads/kerberos_verify.o $(SECRETS_OBJ) lib/server_mutex.o \
666 +               libads/authdata.o rpc_parse/parse_prs.o rpc_parse/parse_misc.o \
667 +               libsmb/doserr.o
668 +
669 +######################################################################
670 +# now the rules...
671 +######################################################################
672 +all : SHOWFLAGS proto_exists $(SBIN_PROGS) $(BIN_PROGS) $(SHLIBS) \
673 +       $(MODULES) @EXTRA_ALL_TARGETS@
674 +
675 +pam_smbpass : SHOWFLAGS bin/pam_smbpass.@SHLIBEXT@
676 +
677 +smbwrapper : SHOWFLAGS @SMBWRAPPER@
678 +
679 +torture : SHOWFLAGS $(TORTURE_PROGS)
680 +
681 +smbtorture : SHOWFLAGS bin/smbtorture@EXEEXT@
682 +
683 +masktest : SHOWFLAGS bin/masktest@EXEEXT@
684 +
685 +msgtest : SHOWFLAGS bin/msgtest@EXEEXT@
686 +
687 +locktest : SHOWFLAGS bin/locktest@EXEEXT@
688 +
689 +smbcacls : SHOWFLAGS bin/smbcacls@EXEEXT@
690 +
691 +smbcquotas : SHOWFLAGS bin/smbcquotas@EXEEXT@
692 +
693 +locktest2 : SHOWFLAGS bin/locktest2@EXEEXT@
694 +
695 +rpctorture : SHOWFLAGS bin/rpctorture@EXEEXT@
696 +
697 +debug2html : SHOWFLAGS bin/debug2html@EXEEXT@
698 +
699 +smbfilter : SHOWFLAGS bin/smbfilter@EXEEXT@
700 +
701 +talloctort : SHOWFLAGS bin/talloctort@EXEEXT@
702 +
703 +nsswitch : SHOWFLAGS bin/winbindd@EXEEXT@ bin/wbinfo@EXEEXT@ @WINBIND_NSS@ \
704 +       @WINBIND_WINS_NSS@ nsswitch/pam_winbind.@SHLIBEXT@
705 +
706 +wins : SHOWFLAGS @WINBIND_WINS_NSS@
707 +
708 +modules: SHOWFLAGS proto_exists $(MODULES)
709 +
710 +everything: all libsmbclient debug2html smbfilter talloctort modules torture \
711 +       $(EVERYTHING_PROGS)
712 +
713 +.SUFFIXES:
714 +.SUFFIXES: .c .o .@PICSUFFIX@ .lo
715 +
716 +SHOWFLAGS:
717 +       @echo "Using FLAGS = $(FLAGS)"
718 +       @echo "      LIBS = $(LIBS)"
719 +       @echo "      LDSHFLAGS = $(LDSHFLAGS)"
720 +       @echo "      LDFLAGS = $(LDFLAGS)"
721 +
722 +MAKEDIR = || exec false; \
723 +         if test -d "$$dir"; then :; else \
724 +         echo mkdir "$$dir"; \
725 +         mkdir -p "$$dir" >/dev/null 2>&1 || \
726 +         test -d "$$dir" || \
727 +         mkdir "$$dir" || \
728 +         exec false; fi || exec false
729 +
730 +.c.o:
731 +       @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
732 +        dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
733 +       @echo Compiling $*.c
734 +       @$(CC) -I. -I$(srcdir) $(FLAGS) -c $< \
735 +         -o $@ 
736 +@BROKEN_CC@    -mv `echo $@ | sed 's%^.*/%%g'` $@
737 +
738 +# this adds support for precompiled headers. To use it, install a snapshot
739 +# of gcc-3.4 and run 'make pch' before you do the main build. 
740 +pch:
741 +       rm -f $(srcdir)/include/includes.h.gch
742 +       $(CC) -I. -I$(srcdir) $(FLAGS) -c $(srcdir)/include/includes.h -o $(srcdir)/include/includes.h.gch
743 +
744 +# These dependencies are only approximately correct: we want to make
745 +# sure Samba's paths are updated if ./configure is re-run.  Really it
746 +# would be nice if "make prefix=/opt/samba all" also rebuilt things,
747 +# but since we also require "make install prefix=/opt/samba" *not* to
748 +# rebuild it's a bit hard.
749 +
750 +dynconfig.o: dynconfig.c Makefile
751 +       @echo Compiling $*.c
752 +       @$(CC) $(FLAGS) $(PATH_FLAGS) -c $< -o $@ 
753 +
754 +dynconfig.@PICSUFFIX@: dynconfig.c Makefile
755 +       @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
756 +         dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
757 +       @echo Compiling $*.c with @PICFLAGS@
758 +       @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PICFLAGS@ -c $< -o $*.@PICSUFFIX@
759 +@BROKEN_CC@    -mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.@PICSUFFIX@$$%.o%'` $@
760 +@POBAD_CC@     @mv $*.@PICSUFFIX@.o $@
761 +
762 +lib/version.o: lib/version.c include/version.h
763 +       @echo Compiling $*.c
764 +       @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) -c $< -o $@ 
765 +
766 +lib/version.@PICSUFFIX@: lib/version.c include/version.h
767 +       @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
768 +         dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
769 +       @echo Compiling $*.c with @PICFLAGS@
770 +       @$(CC) -I. -I$(srcdir) $(FLAGS) $(PATH_FLAGS) @PICFLAGS@ -c $< -o $*.@PICSUFFIX@
771 +@BROKEN_CC@    -mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.@PICSUFFIX@$$%.o%'` $@
772 +@POBAD_CC@     @mv $*.@PICSUFFIX@.o $@
773 +
774 +smbd/build_options.o: smbd/build_options.c Makefile include/config.h include/build_env.h include/proto.h
775 +       @echo Compiling $*.c
776 +       @$(CC) $(FLAGS) $(PATH_FLAGS) -c $< -o $@
777 +
778 +smbd/build_options.c: include/config.h.in script/mkbuildoptions.awk
779 +       @echo Generating $@
780 +       @dir=smbd $(MAKEDIR) && $(AWK) -f $(srcdir)/script/mkbuildoptions.awk > $(builddir)/smbd/build_options.c < $(srcdir)/include/config.h.in
781 +
782 +.c.@PICSUFFIX@: 
783 +       @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \
784 +         dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi
785 +       @echo Compiling $*.c with @PICFLAGS@
786 +       @$(CC) -I. -I$(srcdir) $(FLAGS) @PICFLAGS@ -c $< -o $*.@PICSUFFIX@
787 +@BROKEN_CC@    -mv `echo $@ | sed -e 's%^.*/%%g' -e 's%\.@PICSUFFIX@$$%.o%'` $@
788 +@POBAD_CC@     @mv $*.@PICSUFFIX@.o $@
789 +
790 +bin/.dummy:
791 +       @if (: >> $@ || : > $@) >/dev/null 2>&1; then :; else \
792 +         dir=bin $(MAKEDIR); fi
793 +       @: >> $@ || : > $@ # what a fancy emoticon!
794 +
795 +bin/smbd@EXEEXT@: $(SMBD_OBJ) @BUILD_POPT@ bin/.dummy
796 +       @echo Linking $@
797 +       @$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(LDFLAGS) $(LDAP_LIBS) \
798 +               $(KRB5LIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) \
799 +               $(ACL_LIBS) $(PASSDB_LIBS) $(LIBS) @POPTLIBS@
800 +
801 +bin/nmbd@EXEEXT@: $(NMBD_OBJ) @BUILD_POPT@ bin/.dummy
802 +       @echo Linking $@
803 +       @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
804 +
805 +bin/wrepld@EXEEXT@: $(WREPL_OBJ) @BUILD_POPT@ bin/.dummy
806 +       @echo Linking $@
807 +       @$(CC) $(FLAGS) -o $@ $(WREPL_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@
808 +
809 +bin/swat@EXEEXT@: $(SWAT_OBJ) @BUILD_POPT@ bin/.dummy
810 +       @echo Linking $@
811 +       @$(CC) $(FLAGS) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINT_LIBS) \
812 +         $(AUTH_LIBS) $(LIBS) $(PASSDB_LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
813 +
814 +bin/rpcclient@EXEEXT@: $(RPCCLIENT_OBJ) @BUILD_POPT@ bin/.dummy
815 +       @echo Linking $@
816 +       @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(PASSDB_LIBS) $(RPCCLIENT_OBJ) \
817 +               $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ \
818 +               $(KRB5LIBS) $(LDAP_LIBS)
819 +
820 +bin/smbclient@EXEEXT@: $(CLIENT_OBJ) @BUILD_POPT@ bin/.dummy
821 +       @echo Linking $@
822 +       @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
823 +
824 +bin/net@EXEEXT@: $(NET_OBJ) @BUILD_POPT@ bin/.dummy
825 +       @echo Linking $@
826 +       @$(CC) $(FLAGS) -o $@ $(NET_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS)
827 +
828 +bin/profiles@EXEEXT@: $(PROFILES_OBJ) @BUILD_POPT@ bin/.dummy
829 +       @echo Linking $@
830 +       @$(CC) $(FLAGS) -o $@ $(PROFILES_OBJ) $(LDFLAGS) $(LIBS) @POPTLIBS@
831 +
832 +bin/editreg@EXEEXT@: $(EDITREG_OBJ) @BUILD_POPT@ bin/.dummy
833 +       @echo Linking $@
834 +       @$(CC) $(FLAGS) -o $@ $(EDITREG_OBJ) $(LDFLAGS) $(LIBS) @POPTLIBS@
835 +
836 +bin/smbspool@EXEEXT@: $(CUPS_OBJ) bin/.dummy
837 +       @echo Linking $@
838 +       @$(CC) $(FLAGS) -o $@ $(CUPS_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
839 +
840 +bin/smbmount@EXEEXT@: $(MOUNT_OBJ) bin/.dummy
841 +       @echo Linking $@
842 +       @$(CC) $(FLAGS) -o $@ $(MOUNT_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
843 +
844 +bin/smbmnt@EXEEXT@: $(MNT_OBJ) bin/.dummy
845 +       @echo Linking $@
846 +       @$(CC) $(FLAGS) -o $@ $(MNT_OBJ) $(LDFLAGS) 
847 +
848 +bin/smbumount@EXEEXT@: $(UMOUNT_OBJ) bin/.dummy
849 +       @echo Linking $@
850 +       @$(CC) $(FLAGS) -o $@ $(UMOUNT_OBJ) $(LDFLAGS)
851 +
852 +bin/testparm@EXEEXT@: $(TESTPARM_OBJ) @BUILD_POPT@ bin/.dummy
853 +       @echo Linking $@
854 +       @$(CC) $(FLAGS) -o $@ $(TESTPARM_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@
855 +
856 +bin/testprns@EXEEXT@: $(TESTPRNS_OBJ) bin/.dummy
857 +       @echo Linking $@
858 +       @$(CC) $(FLAGS) -o $@ $(TESTPRNS_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINT_LIBS) $(LIBS)
859 +
860 +bin/smbstatus@EXEEXT@: $(STATUS_OBJ) @BUILD_POPT@ bin/.dummy
861 +       @echo Linking $@
862 +       @$(CC) $(FLAGS) -o $@ $(STATUS_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
863 +       @POPTLIBS@
864 +
865 +bin/smbcontrol@EXEEXT@: $(SMBCONTROL_OBJ) @BUILD_POPT@ bin/.dummy
866 +       @echo Linking $@
867 +       @$(CC) -DUSING_SMBCONTROL $(FLAGS) -o $@ $(SMBCONTROL_OBJ) $(DYNEXP) \
868 +       $(LDFLAGS) $(LIBS) \
869 +       @POPTLIBS@
870 +
871 +bin/smbtree@EXEEXT@: $(SMBTREE_OBJ) @BUILD_POPT@ bin/.dummy
872 +       @echo Linking $@
873 +       @$(CC) $(FLAGS) -o $@ $(SMBTREE_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) 
874 +
875 +bin/smbpasswd@EXEEXT@: $(SMBPASSWD_OBJ) bin/.dummy
876 +       @echo Linking $@
877 +       @$(CC) $(FLAGS) -o $@ $(SMBPASSWD_OBJ) $(LDFLAGS) $(PASSDB_LIBS) \
878 +               $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) 
879 +
880 +bin/pdbedit@EXEEXT@: $(PDBEDIT_OBJ) @BUILD_POPT@ bin/.dummy
881 +       @echo Linking $@
882 +       @$(CC) $(FLAGS) -o $@ $(PDBEDIT_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(PASSDB_LIBS) $(LDAP_LIBS)
883 +
884 +bin/samtest@EXEEXT@: $(SAMTEST_OBJ) @BUILD_POPT@ bin/.dummy
885 +       @echo Linking $@
886 +       @$(CC) $(FLAGS) -o $@ $(SAMTEST_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(PASSDB_LIBS) $(KRB5LIBS) $(LDAP_LIBS)
887 +
888 +bin/nmblookup@EXEEXT@: $(NMBLOOKUP_OBJ) @BUILD_POPT@ bin/.dummy
889 +       @echo Linking $@
890 +       @$(CC) $(FLAGS) -o $@ $(NMBLOOKUP_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) @POPTLIBS@ $(LDAP_LIBS)
891 +
892 +bin/smbtorture@EXEEXT@: $(SMBTORTURE_OBJ) bin/.dummy
893 +       @echo Linking $@
894 +       @$(CC) $(FLAGS) -o $@ $(SMBTORTURE_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(SECRETS_OBJ)
895 +
896 +bin/talloctort@EXEEXT@: $(TALLOCTORT_OBJ) bin/.dummy
897 +       @echo Linking $@
898 +       @$(CC) $(FLAGS) -o $@ $(TALLOCTORT_OBJ) $(LDFLAGS) $(LIBS)
899 +
900 +bin/masktest@EXEEXT@: $(MASKTEST_OBJ) bin/.dummy
901 +       @echo Linking $@
902 +       @$(CC) $(FLAGS) -o $@ $(MASKTEST_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(SECRETS_OBJ)
903 +
904 +bin/msgtest@EXEEXT@: $(MSGTEST_OBJ) bin/.dummy
905 +       @echo Linking $@
906 +       @$(CC) $(FLAGS) -o $@ $(MSGTEST_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) 
907 +
908 +bin/smbcacls@EXEEXT@: $(SMBCACLS_OBJ) @BUILD_POPT@ bin/.dummy
909 +       @echo Linking $@
910 +       @$(CC) $(FLAGS) -o $@ $(SMBCACLS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
911 +
912 +bin/smbcquotas@EXEEXT@: $(SMBCQUOTAS_OBJ) @BUILD_POPT@ bin/.dummy
913 +       @echo Linking $@
914 +       @$(CC) $(FLAGS) -o $@ $(SMBCQUOTAS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
915 +
916 +bin/locktest@EXEEXT@: $(LOCKTEST_OBJ) bin/.dummy
917 +       @echo Linking $@
918 +       @$(CC) $(FLAGS) -o $@ $(LOCKTEST_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
919 +
920 +bin/nsstest@EXEEXT@: $(NSSTEST_OBJ) bin/.dummy
921 +       @echo Linking $@
922 +       @$(CC) $(FLAGS) -o $@ $(NSSTEST_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS)  $(LDAP_LIBS)
923 +
924 +bin/vfstest@EXEEXT@: $(VFSTEST_OBJ) @BUILD_POPT@ bin/.dummy
925 +       @echo Linking $@
926 +       @$(CC) $(FLAGS) -o $@ $(VFSTEST_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) $(ACL_LIBS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
927 +
928 +bin/smbiconv@EXEEXT@: $(SMBICONV_OBJ) @BUILD_POPT@ bin/.dummy
929 +       @echo Linking $@
930 +       @$(CC) $(FLAGS) -o $@ $(SMBICONV_OBJ) $(LDFLAGS) $(TERMLDFLAGS) $(TERMLIBS) $(DYNEXP) $(LIBS) @POPTLIBS@
931 +
932 +bin/log2pcap@EXEEXT@: $(LOG2PCAP_OBJ) @BUILD_POPT@ bin/.dummy
933 +       @echo Linking $@
934 +       @$(CC) $(FLAGS) -o $@ $(LOG2PCAP_OBJ) $(LDFLAGS) @POPTLIBS@ $(LIBS)
935 +
936 +bin/locktest2@EXEEXT@: $(LOCKTEST2_OBJ) bin/.dummy
937 +       @echo Linking $@
938 +       @$(CC) $(FLAGS) -o $@ $(LOCKTEST2_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
939 +
940 +bin/rpctorture@EXEEXT@: $(RPCTORTURE_OBJ) bin/.dummy
941 +       @echo Linking $@
942 +       @$(CC) $(FLAGS) -o $@ $(RPCTORTURE_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
943 +
944 +bin/debug2html@EXEEXT@: $(DEBUG2HTML_OBJ) bin/.dummy
945 +       @echo Linking $@
946 +       @$(CC) $(FLAGS) -o $@ $(DEBUG2HTML_OBJ) $(LDFLAGS) $(LIBS)
947 +
948 +bin/smbfilter@EXEEXT@: $(SMBFILTER_OBJ) bin/.dummy
949 +       @echo Linking $@
950 +       @$(CC) $(FLAGS) -o $@ $(SMBFILTER_OBJ) $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
951 +
952 +bin/smbw_sample@EXEEXT@: $(SMBW_OBJ) utils/smbw_sample.o bin/.dummy
953 +       @echo Linking $@
954 +       @$(CC) $(FLAGS) -o $@ $(SMBW_OBJ) utils/smbw_sample.o $(LDFLAGS) $(LIBS) $(KRB5LIBS) $(LDAP_LIBS)
955 +
956 +bin/smbsh@EXEEXT@: $(SMBSH_OBJ) bin/.dummy
957 +       @echo Linking $@
958 +       @$(CC) $(FLAGS) -o $@ $(SMBSH_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS)
959 +
960 +bin/smbwrapper.@SHLIBEXT@: $(PICOBJS) bin/.dummy
961 +       @echo Linking shared library $@
962 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(PICOBJS) $(LIBS) \
963 +               $(KRB5LIBS) $(LDAP_LIBS) \
964 +               @SONAMEFLAG@`basename $@`
965 +
966 +bin/libsmbclient.@SHLIBEXT@: $(LIBSMBCLIENT_PICOBJS)
967 +       @echo Linking libsmbclient shared library $@
968 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(LIBSMBCLIENT_PICOBJS) $(LDFLAGS) $(DYNEXP) $(LIBS) \
969 +               $(KRB5LIBS) $(LDAP_LIBS) \
970 +               @SONAMEFLAG@`basename $@`.$(LIBSMBCLIENT_MAJOR)
971 +
972 +bin/libsmbclient.a: $(LIBSMBCLIENT_PICOBJS)
973 +       @echo Linking libsmbclient non-shared library $@
974 +       @-$(AR) -rc $@ $(LIBSMBCLIENT_PICOBJS)
975 +
976 +# This is probably wrong for anything other than the GNU linker. 
977 +bin/libbigballofmud.@SHLIBEXT@: $(LIBBIGBALLOFMUD_PICOBJS)
978 +       @echo Linking bigballofmud shared library $@
979 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(LIBBIGBALLOFMUD_PICOBJS) $(LIBS) \
980 +               $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS) \
981 +               @SONAMEFLAG@`basename $@`.$(LIBBIGBALLOFMUD_MAJOR)
982 +       ln -snf libbigballofmud.so bin/libbigballofmud.so.0
983 +
984 +# It would be nice to build a static bigballofmud too, but when I try
985 +# I get linker errors about dl_open and similar things.  I'm not sure if
986 +# it can be fixed or if they just can't be called from a static
987 +# library.
988 +
989 +libsmbclient: $(LIBSMBCLIENT)
990 +
991 +bin/librpc_lsarpc.@SHLIBEXT@: $(RPC_LSA_OBJ)
992 +       @echo "Linking $@"
993 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_LSA_OBJ) -lc \
994 +               @SONAMEFLAG@`basename $@`
995 +
996 +bin/librpc_samr.@SHLIBEXT@: $(RPC_SAMR_OBJ)
997 +       @echo "Linking $@"
998 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SAMR_OBJ) -lc \
999 +               @SONAMEFLAG@`basename $@`
1000 +
1001 +bin/librpc_srvsvc.@SHLIBEXT@: $(RPC_SVC_OBJ)
1002 +       @echo "Linking $@"
1003 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SVC_OBJ) -lc \
1004 +               @SONAMEFLAG@`basename $@`
1005 +
1006 +bin/librpc_wkssvc.@SHLIBEXT@: $(RPC_WKS_OBJ)
1007 +       @echo "Linking $@"
1008 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_WKS_OBJ) -lc \
1009 +               @SONAMEFLAG@`basename $@`
1010 +
1011 +bin/librpc_NETLOGON.@SHLIBEXT@: $(RPC_NETLOG_OBJ)
1012 +       @echo "Linking $@"
1013 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_NETLOG_OBJ) -lc \
1014 +               @SONAMEFLAG@`basename $@`
1015 +
1016 +bin/librpc_winreg.@SHLIBEXT@: $(RPC_REG_OBJ)
1017 +       @echo "Linking $@"
1018 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_REG_OBJ) -lc \
1019 +               @SONAMEFLAG@`basename $@`
1020 +
1021 +bin/librpc_lsa_ds.@SHLIBEXT@: $(RPC_LSA_DS_OBJ)
1022 +       @echo "Linking $@"
1023 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_LSA_DS_OBJ) -lc \
1024 +               @SONAMEFLAG@`basename $@`
1025 +
1026 +bin/librpc_spoolss.@SHLIBEXT@: $(RPC_SPOOLSS_OBJ)
1027 +       @echo "Linking $@"
1028 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_SPOOLSS_OBJ) -lc \
1029 +               @SONAMEFLAG@`basename $@`
1030 +
1031 +bin/librpc_netdfs.@SHLIBEXT@: $(RPC_DFS_OBJ)
1032 +       @echo "Linking $@"
1033 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_DFS_OBJ) -lc \
1034 +               @SONAMEFLAG@`basename $@`
1035 +
1036 +bin/librpc_echo.@SHLIBEXT@: $(RPC_ECHO_OBJ)
1037 +       @echo "Linking $@"
1038 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(RPC_ECHO_OBJ) -lc \
1039 +               @SONAMEFLAG@`basename $@`
1040 +
1041 +bin/winbindd@EXEEXT@: $(WINBINDD_OBJ) @BUILD_POPT@ bin/.dummy
1042 +       @echo "Linking $@"
1043 +       @$(LINK) -o $@ $(WINBINDD_OBJ) $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS)
1044 +
1045 +# Please don't add .o files to libnss_winbind, libnss_wins, or the pam_winbind
1046 +# libraries.  Add to the appropriate PICOBJ variable instead.
1047 +
1048 +@WINBIND_NSS@: $(WINBIND_NSS_PICOBJS)
1049 +       @echo "Linking $@"
1050 +       @$(SHLD) $(WINBIND_NSS_LDSHFLAGS) -o $@ $(WINBIND_NSS_PICOBJS) \
1051 +               @WINBIND_NSS_EXTRA_LIBS@ @SONAMEFLAG@`basename $@`
1052 +
1053 +@WINBIND_WINS_NSS@: $(WINBIND_WINS_NSS_PICOBJS)
1054 +       @echo "Linking $@"
1055 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(WINBIND_WINS_NSS_PICOBJS) \
1056 +               $(LDAP_LIBS) $(KRB5LIBS) -lc \
1057 +               @SONAMEFLAG@`basename $@`
1058 +
1059 +nsswitch/pam_winbind.@SHLIBEXT@: $(PAM_WINBIND_PICOBJ) bin/.dummy
1060 +       @echo "Linking $@"
1061 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_WINBIND_PICOBJ) \
1062 +               @SONAMEFLAG@`basename $@` -lpam
1063 +
1064 +bin/rhosts.@SHLIBEXT@: $(AUTH_RHOSTS_OBJ:.o=.@PICSUFFIX@)
1065 +       @echo "Building plugin $@"
1066 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_RHOSTS_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@`
1067 +
1068 +bin/builtin.@SHLIBEXT@: $(AUTH_BUILTIN_OBJ:.o=.@PICSUFFIX@)
1069 +       @echo "Building plugin $@"
1070 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_BUILTIN_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@`
1071 +
1072 +bin/domain.@SHLIBEXT@: $(AUTH_DOMAIN_OBJ:.o=.@PICSUFFIX@)
1073 +       @echo "Building plugin $@"
1074 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_DOMAIN_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@`
1075 +
1076 +bin/smbserver.@SHLIBEXT@: $(AUTH_SERVER_OBJ:.o=.@PICSUFFIX@)
1077 +       @echo "Building plugin $@"
1078 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_SERVER_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@`
1079 +
1080 +bin/winbind.@SHLIBEXT@: $(AUTH_WINBIND_OBJ:.o=.@PICSUFFIX@)
1081 +       @echo "Building plugin $@"
1082 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_WINBIND_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@`
1083 +
1084 +bin/unix.@SHLIBEXT@: $(AUTH_UNIX_OBJ:.o=.@PICSUFFIX@)
1085 +       @echo "Building plugin $@"
1086 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_UNIX_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@`
1087 +
1088 +bin/sam.@SHLIBEXT@: $(AUTH_SAM_OBJ:.o=.@PICSUFFIX@)
1089 +       @echo "Building plugin $@"
1090 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(AUTH_SAM_OBJ:.o=.@PICSUFFIX@) @SONAMEFLAG@`basename $@`
1091 +
1092 +bin/mysql.@SHLIBEXT@: $(MYSQL_OBJ:.o=.@PICSUFFIX@)
1093 +       @echo "Building plugin $@"
1094 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(MYSQL_OBJ:.o=.@PICSUFFIX@) @MYSQL_LIBS@ \
1095 +               @SONAMEFLAG@`basename $@`
1096 +
1097 +bin/ldapsam.@SHLIBEXT@: passdb/pdb_ldap.@PICSUFFIX@
1098 +       @echo "Building plugin $@"
1099 +       @$(SHLD) $(LDSHFLAGS) $(LDAP_LIBS) -o $@ passdb/pdb_ldap.@PICSUFFIX@ \
1100 +               @SONAMEFLAG@`basename $@`
1101 +
1102 +bin/tdbsam.@SHLIBEXT@: passdb/pdb_tdb.@PICSUFFIX@
1103 +       @echo "Building plugin $@"
1104 +       @$(SHLD) $(LDSHFLAGS) -o $@ passdb/pdb_tdb.@PICSUFFIX@ \
1105 +               @SONAMEFLAG@`basename $@`
1106 +
1107 +bin/smbpasswd.@SHLIBEXT@: passdb/pdb_smbpasswd.@PICSUFFIX@
1108 +       @echo "Building plugin $@"
1109 +       @$(SHLD) $(LDSHFLAGS) -o $@ passdb/pdb_smbpasswd.@PICSUFFIX@ \
1110 +               @SONAMEFLAG@`basename $@`
1111 +
1112 +bin/weird.@SHLIBEXT@: $(DEVEL_HELP_WEIRD_OBJ:.o=.@PICSUFFIX@)
1113 +       @echo "Building plugin $@"
1114 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(DEVEL_HELP_WEIRD_OBJ:.o=.@PICSUFFIX@) \
1115 +               @SONAMEFLAG@`basename $@`
1116 +
1117 +bin/CP850.@SHLIBEXT@: $(CP850_OBJ:.o=.@PICSUFFIX@)
1118 +       @echo "Building plugin $@"
1119 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(CP850_OBJ:.o=.@PICSUFFIX@) \
1120 +               @SONAMEFLAG@`basename $@`
1121 +
1122 +bin/CP437.@SHLIBEXT@: $(CP437_OBJ:.o=.@PICSUFFIX@)
1123 +       @echo "Building plugin $@"
1124 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(CP437_OBJ:.o=.@PICSUFFIX@) \
1125 +               @SONAMEFLAG@`basename $@`
1126 +
1127 +bin/macosxfs.@SHLIBEXT@: $(CHARSET_MACOSXFS_OBJ:.o=.po)
1128 +       @echo "Building plugin $@"
1129 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(CHARSET_MACOSXFS_OBJ:.o=.po) \
1130 +               -framework CoreFoundation @SONAMEFLAG@`basename $@`
1131 +
1132 +bin/xml.@SHLIBEXT@: $(XML_OBJ:.o=.@PICSUFFIX@)
1133 +       @echo "Building plugin $@"
1134 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(XML_OBJ:.o=.@PICSUFFIX@) @XML_LIBS@ \
1135 +               @SONAMEFLAG@`basename $@`
1136 +
1137 +bin/audit.@SHLIBEXT@: $(VFS_AUDIT_OBJ:.o=.@PICSUFFIX@)
1138 +       @echo "Building plugin $@"
1139 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_AUDIT_OBJ:.o=.@PICSUFFIX@) \
1140 +               @SONAMEFLAG@`basename $@`
1141 +
1142 +bin/extd_audit.@SHLIBEXT@: $(VFS_EXTD_AUDIT_OBJ:.o=.@PICSUFFIX@)
1143 +       @echo "Building plugin $@"
1144 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_EXTD_AUDIT_OBJ:.o=.@PICSUFFIX@) \
1145 +               @SONAMEFLAG@`basename $@`
1146 +
1147 +bin/recycle.@SHLIBEXT@: $(VFS_RECYCLE_OBJ:.o=.@PICSUFFIX@)
1148 +       @echo "Building plugin $@"
1149 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_RECYCLE_OBJ:.o=.@PICSUFFIX@) \
1150 +               @SONAMEFLAG@`basename $@`
1151 +
1152 +bin/netatalk.@SHLIBEXT@: $(VFS_NETATALK_OBJ:.o=.@PICSUFFIX@)
1153 +       @echo "Building plugin $@"
1154 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_NETATALK_OBJ:.o=.@PICSUFFIX@) \
1155 +               @SONAMEFLAG@`basename $@`
1156 +
1157 +bin/fake_perms.@SHLIBEXT@: $(VFS_FAKE_PERMS_OBJ:.o=.@PICSUFFIX@)
1158 +       @echo "Building plugin $@"
1159 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_FAKE_PERMS_OBJ:.o=.@PICSUFFIX@) \
1160 +               @SONAMEFLAG@`basename $@`
1161 +
1162 +bin/default_quota.@SHLIBEXT@: $(VFS_DEFAULT_QUOTA_OBJ:.o=.@PICSUFFIX@)
1163 +       @echo "Building plugin $@"
1164 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_DEFAULT_QUOTA_OBJ:.o=.@PICSUFFIX@) \
1165 +               @SONAMEFLAG@`basename $@`
1166 +
1167 +bin/readonly.@SHLIBEXT@: $(VFS_READONLY_OBJ:.o=.@PICSUFFIX@)
1168 +       @echo "Building plugin $@"
1169 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_READONLY_OBJ:.o=.@PICSUFFIX@) \
1170 +               @SONAMEFLAG@`basename $@`
1171 +
1172 +bin/cap.@SHLIBEXT@: $(VFS_CAP_OBJ:.o=.@PICSUFFIX@)
1173 +       @echo "Building plugin $@"
1174 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(VFS_CAP_OBJ:.o=.@PICSUFFIX@) \
1175 +               @SONAMEFLAG@`basename $@`
1176 +
1177 +bin/wbinfo@EXEEXT@: $(WBINFO_OBJ) @BUILD_POPT@ bin/.dummy
1178 +       @echo Linking $@
1179 +       @$(LINK) -o $@ $(WBINFO_OBJ) $(LIBS) @POPTLIBS@
1180 +
1181 +bin/ntlm_auth@EXEEXT@: $(NTLM_AUTH_OBJ) $(PARAM_OBJ) $(LIB_OBJ) \
1182 +               $(UBIQX_OBJ) @BUILD_POPT@ bin/.dummy
1183 +       @echo Linking $@
1184 +       @$(LINK) -o $@ $(NTLM_AUTH_OBJ) $(PARAM_OBJ) $(LIB_OBJ) \
1185 +               $(UBIQX_OBJ) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
1186 +
1187 +bin/pam_smbpass.@SHLIBEXT@: $(PAM_SMBPASS_PICOOBJ)
1188 +       @echo "Linking shared library $@"
1189 +       @$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_PICOOBJ) -lpam $(DYNEXP) $(LIBS) -lc $(LDAP_LIBS) $(KRB5LIBS)
1190 +
1191 +bin/libmsrpc.a: $(LIBMSRPC_PICOBJ)
1192 +       @-$(AR) -rc $@ $(LIBMSRPC_PICOBJ) 
1193 +
1194 +bin/tdbbackup@EXEEXT@: $(TDBBACKUP_OBJ) bin/.dummy
1195 +       @echo Linking $@
1196 +       @$(CC) $(FLAGS) -o $@ $(TDBBACKUP_OBJ)
1197 +
1198 +bin/tdbdump@EXEEXT@: $(TDBDUMP_OBJ) bin/.dummy
1199 +       @echo Linking $@
1200 +       @$(CC) $(FLAGS) -o $@ $(TDBDUMP_OBJ)
1201 +
1202 +bin/t_strcmp@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_strcmp.o
1203 +       $(CC) $(FLAGS) -o $@ $(LIBS) torture/t_strcmp.o -L ./bin -lbigballofmud
1204 +
1205 +bin/t_stringoverflow@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_stringoverflow.o
1206 +       $(CC) $(FLAGS) -o $@ torture/t_stringoverflow.o -L./bin -lbigballofmud
1207 +
1208 +bin/t_doschar@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_doschar.o
1209 +       $(CC) $(FLAGS) -o $@ $(LIBS) torture/t_doschar.o -L ./bin -lbigballofmud
1210 +bin/t_push_ucs2@EXEEXT@: bin/libbigballofmud.@SHLIBEXT@ torture/t_push_ucs2.o
1211 +       $(CC) $(FLAGS) -o $@ $(LIBS) torture/t_push_ucs2.o -L ./bin -lbigballofmud
1212 +
1213 +bin/t_snprintf@EXEEXT@: lib/snprintf.c
1214 +       $(CC) $(FLAGS) -o $@ -DTEST_SNPRINTF lib/snprintf.c -lm
1215 +install: installbin installman installscripts installdat installswat installmodules @INSTALLCLIENT@
1216 +
1217 +install-everything: install installmodules
1218 +
1219 +# DESTDIR is used here to prevent packagers wasting their time
1220 +# duplicating the Makefile. Remove it and you will have the privelege
1221 +# of package each samba release for muliple versions of multiple
1222 +# distributions and operating systems, or at least supplying patches
1223 +# to all the packaging files required for this, prior to committing
1224 +# the removal of DESTDIR. Do not remove it even though you think it
1225 +# is not used
1226 +
1227 +installdirs:
1228 +       @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(PRIVATEDIR) $(DESTDIR)$(PIDDIR) $(DESTDIR)$(LOCKDIR) $(DESTDIR)$(MANDIR)
1229 +
1230 +installservers: all installdirs
1231 +       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(SBIN_PROGS)
1232 +
1233 +installbin: all installdirs
1234 +       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(SBIN_PROGS)
1235 +       @$(SHELL) $(srcdir)/script/installbin.sh $(INSTALLPERMS) $(DESTDIR) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(BIN_PROGS)
1236 +
1237 +
1238 +installmodules: modules installdirs
1239 +       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(VFSLIBDIR) $(VFS_MODULES)
1240 +       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(PDBLIBDIR) $(PDB_MODULES)
1241 +       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(RPCLIBDIR) $(RPC_MODULES)
1242 +       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(IDMAPLIBDIR) $(IDMAP_MODULES)
1243 +       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(CHARSETLIBDIR) $(CHARSET_MODULES)
1244 +       @$(SHELL) $(srcdir)/script/installmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(AUTHLIBDIR) $(AUTH_MODULES)
1245 +       @# These symlinks are required for the 'probing' of modules. 
1246 +       @# This mechanism should go at some point..
1247 +       @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(PDBLIBDIR) ldapsam.@SHLIBEXT@ ldapsam_compat.@SHLIBEXT@
1248 +       @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) rhosts.@SHLIBEXT@ hostsequiv.@SHLIBEXT@
1249 +       @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) sam.@SHLIBEXT@ sam_ignoredomain.@SHLIBEXT@
1250 +       @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) domain.@SHLIBEXT@ trustdomain.@SHLIBEXT@ ntdomain.@SHLIBEXT@
1251 +       @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) builtin.@SHLIBEXT@ guest.@SHLIBEXT@ fixed_challenge.@SHLIBEXT@ name_to_ntstatus.@SHLIBEXT@
1252 +
1253 +installscripts: installdirs
1254 +       @$(SHELL) $(srcdir)/script/installscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS)
1255 +
1256 +installdat: installdirs
1257 +       @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(LIBDIR) $(srcdir)
1258 +
1259 +installmsg: installdirs
1260 +       @$(SHELL) $(srcdir)/script/installmsg.sh $(DESTDIR)$(LIBDIR) $(srcdir)
1261 +
1262 +installswat: installdirs installmsg
1263 +       @$(SHELL) $(srcdir)/script/installswat.sh $(DESTDIR)$(SWATDIR) $(srcdir)
1264 +
1265 +installclientlib: installdirs libsmbclient
1266 +       @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)${prefix}/lib
1267 +       -$(INSTALLCLIENTCMD_SH) bin/libsmbclient.@SHLIBEXT@ $(DESTDIR)${prefix}/lib
1268 +       -$(INSTALLCLIENTCMD_A) bin/libsmbclient.a $(DESTDIR)${prefix}/lib
1269 +       @$(SHELL) $(srcdir)/script/installdirs.sh $(DESTDIR)${prefix}/include
1270 +       -$(INSTALLCMD) $(srcdir)/include/libsmbclient.h $(DESTDIR)${prefix}/include
1271 +
1272 +# Python extensions
1273 +
1274 +PYTHON_OBJS = $(PARAM_OBJ) $(LIB_OBJ) $(LIBSMB_OBJ) $(RPC_PARSE_OBJ) \
1275 +       $(UBIQX_OBJ) $(LIBMSRPC_OBJ) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
1276 +       $(SECRETS_OBJ) $(KRBCLIENT_OBJ) $(SMBLDAP_OBJ) lib/dummyroot.o
1277 +
1278 +PYTHON_PICOBJS = $(PYTHON_OBJS:.o=.@PICSUFFIX@)
1279 +
1280 +python_ext: $(PYTHON_PICOBJS)
1281 +       @if test -z "$(PYTHON)"; then \
1282 +               echo Use the option --with-python to configure python; \
1283 +               exit 1; \
1284 +       fi
1285 +       PYTHON_OBJS="$(PYTHON_PICOBJS)" \
1286 +       PYTHON_CFLAGS="$(CFLAGS) $(CPPFLAGS) $(FLAGS)" \
1287 +       LIBS="$(LIBS) $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS)" \
1288 +               $(PYTHON) python/setup.py build
1289 +
1290 +python_install: $(PYTHON_PICOBJS)
1291 +       @if test -z "$(PYTHON)"; then \
1292 +               echo Use the option --with-python to configure python; \
1293 +               exit 1; \
1294 +       fi
1295 +       PYTHON_OBJS="$(PYTHON_PICOBJS)" \
1296 +       PYTHON_CFLAGS="$(CFLAGS) $(CPPFLAGS)" \
1297 +       LIBS="$(LIBS)" \
1298 +               $(PYTHON) python/setup.py install
1299 +
1300 +python_clean:
1301 +       @-if test -n "$(PYTHON)"; then $(PYTHON) python/setup.py clean; fi
1302 +
1303 +# revert to the previously installed version
1304 +revert:
1305 +       @$(SHELL) $(srcdir)/script/revert.sh $(SBINDIR) $(SBIN_PROGS) 
1306 +       @$(SHELL) $(srcdir)/script/revert.sh $(BINDIR) $(BIN_PROGS) $(SCRIPTS)
1307 +
1308 +installman: installdirs
1309 +       @$(SHELL) $(srcdir)/script/installman.sh $(DESTDIR)$(MANDIR) $(srcdir) $(man_langs) "@ROFF@"
1310 +
1311 +.PHONY: showlayout
1312 +
1313 +showlayout: 
1314 +       @echo "Samba will be installed into:"
1315 +       @echo "  basedir:     $(BASEDIR)"
1316 +       @echo "  bindir:      $(BINDIR)"
1317 +       @echo "  sbindir:     $(SBINDIR)"
1318 +       @echo "  libdir:      $(LIBDIR)"
1319 +       @echo "  vardir:      $(VARDIR)"
1320 +       @echo "  mandir:      $(MANDIR)"
1321 +       @echo "  privatedir:  $(PRIVATE_DIR)"
1322 +       @echo "  configdir:   $(CONFIGDIR)"
1323 +       @echo "  lockdir:     $(LOCKDIR)"
1324 +       @echo "  piddir:      $(PIDDIR)"
1325 +
1326 +
1327 +uninstall: uninstallman uninstallbin uninstallscripts uninstallmodules
1328 +
1329 +uninstallman:
1330 +       @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(srcdir) $(man_langs)
1331 +
1332 +uninstallbin:
1333 +       @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(SBINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(SBIN_PROGS)
1334 +       @$(SHELL) $(srcdir)/script/uninstallbin.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(VARDIR) $(DESTDIR)$(BIN_PROGS)
1335 +
1336 +uninstallmodules:
1337 +       @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(VFSLIBDIR) $(DESTDIR)$(VFS_MODULES)
1338 +       @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(PDBLIBDIR) $(DESTDIR)$(PDB_MODULES)
1339 +       @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(RPCLIBDIR) $(DESTDIR)$(RPC_MODULES)
1340 +       @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(CHARSETLIBDIR) $(DESTDIR)$(CHARSET_MODULES)
1341 +       @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS) $(DESTDIR)$(BASEDIR) $(DESTDIR)$(AUTHLIBDIR) $(DESTDIR)$(AUTH_MODULES)
1342 +
1343 +uninstallscripts:
1344 +       @$(SHELL) $(srcdir)/script/uninstallscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS)
1345 +
1346 +# Toplevel clean files
1347 +TOPFILES=dynconfig.o dynconfig.@PICSUFFIX@
1348 +
1349 +clean: delheaders python_clean
1350 +       -rm -f core */*~ *~ */*.o */*.@PICSUFFIX@ */*.@SHLIBEXT@ \
1351 +               $(TOPFILES) $(BIN_PROGS) $(SBIN_PROGS) $(MODULES) $(TORTURE_PROGS) \
1352 +               $(LIBSMBCLIENT) $(EVERYTHING_PROGS) .headers.stamp
1353 +
1354 +# Making this target will just make sure that the prototype files
1355 +# exist, not necessarily that they are up to date.  Since they're
1356 +# removed by "make clean" this will always be run when you do anything
1357 +# afterwards.
1358 +proto_exists: include/proto.h include/wrepld_proto.h include/build_env.h \
1359 +       nsswitch/winbindd_proto.h web/swat_proto.h \
1360 +       client/client_proto.h utils/net_proto.h smbd/build_options.c
1361 +
1362 +delheaders:
1363 +       @echo Removing prototype headers
1364 +       @rm -f include/proto.h include/build_env.h  include/wrepld_proto.h \
1365 +               nsswitch/winbindd_proto.h web/swat_proto.h \
1366 +               client/client_proto.h utils/net_proto.h \
1367 +               smbd/build_options.c
1368 +
1369 +MKPROTO_SH = $(srcdir)/script/mkproto.sh
1370 +
1371 +include/proto.h: smbd/build_options.c
1372 +       @echo Building include/proto.h
1373 +       @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
1374 +         -h _PROTO_H_ $(builddir)/include/proto.h \
1375 +         $(PROTO_OBJ)
1376 +
1377 +include/build_env.h: script/build_env.sh
1378 +       @echo Building include/build_env.h
1379 +       @$(SHELL) $(srcdir)/script/build_env.sh $(srcdir) $(builddir) $(CC) \
1380 +         > $(builddir)/include/build_env.h
1381 +
1382 +include/wrepld_proto.h:
1383 +       @echo Building include/wrepld_proto.h
1384 +       @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
1385 +         -h _WREPLD_PROTO_H_ $(builddir)/include/wrepld_proto.h \
1386 +         $(WREPL_OBJ1)
1387 +
1388 +nsswitch/winbindd_proto.h: 
1389 +       @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
1390 +         -h _WINBINDD_PROTO_H_ $(builddir)/nsswitch/winbindd_proto.h \
1391 +         $(WINBINDD_OBJ1)
1392 +
1393 +web/swat_proto.h: 
1394 +       @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
1395 +         -h _SWAT_PROTO_H_ $(builddir)/web/swat_proto.h \
1396 +         $(SWAT_OBJ1)
1397 +
1398 +client/client_proto.h: 
1399 +       @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
1400 +         -h _CLIENT_PROTO_H_ $(builddir)/client/client_proto.h \
1401 +         $(CLIENT_OBJ1)
1402 +
1403 +utils/net_proto.h: 
1404 +       @cd $(srcdir) && $(SHELL) $(MKPROTO_SH) $(AWK) \
1405 +         -h _CLIENT_PROTO_H_ $(builddir)/utils/net_proto.h \
1406 +         $(NET_OBJ1)
1407 +
1408 +# "make headers" or "make proto" calls a subshell because we need to
1409 +# make sure these commands are executed in sequence even for a
1410 +# parallel make.
1411 +headers: 
1412 +       $(MAKE) delheaders; \
1413 +       $(MAKE) smbd/build_options.c; \
1414 +       $(MAKE) include/proto.h; \
1415 +       $(MAKE) include/build_env.h; \
1416 +       $(MAKE) include/wrepld_proto.h; \
1417 +       $(MAKE) nsswitch/winbindd_proto.h; \
1418 +       $(MAKE) web/swat_proto.h; \
1419 +       $(MAKE) client/client_proto.h; \
1420 +       $(MAKE) utils/net_proto.h
1421 +
1422 +proto: headers 
1423 +
1424 +.PHONY: headers proto
1425 +
1426 +etags:
1427 +       etags `find $(srcdir) -name "*.[ch]" | grep -v /CVS/`
1428 +
1429 +ctags:
1430 +       ctags `find $(srcdir) -name "*.[ch]" | grep -v /CVS/`
1431 +
1432 +realclean: clean delheaders
1433 +       -rm -f config.log bin/.dummy script/findsmb
1434 +
1435 +distclean: realclean
1436 +       -rm -f include/stamp-h
1437 +       -rm -f include/config.h Makefile
1438 +       -rm -f config.status config.cache so_locations
1439 +       -rm -rf .deps TAGS
1440 +
1441 +realdistclean: distclean
1442 +       -rm -f include/config.h.in
1443 +       -rm -f include/version.h
1444 +       -rm -f configure
1445 +
1446 +# this target is really just for my use. It only works on a limited
1447 +# range of machines and is used to produce a list of potentially
1448 +# dead (ie. unused) functions in the code. (tridge)
1449 +finddead:
1450 +       nm */*.o |grep 'U ' | awk '{print $$2}' | sort -u > nmused.txt
1451 +       nm */*.o |grep 'T ' | awk '{print $$3}' | sort -u > nmfns.txt
1452 +       comm -13 nmused.txt nmfns.txt 
1453 +
1454 +
1455 +# when configure.in is updated, reconfigure
1456 +$(srcdir)/configure: $(srcdir)/configure.in
1457 +       @echo "WARNING: you need to rerun ./autogen.sh"
1458 +
1459 +config.status: $(srcdir)/configure
1460 +       @echo "WARNING: you need to run ./configure"
1461 +
1462 +Makefile: $(srcdir)/Makefile.in config.status
1463 +       @echo "WARNING: you need to run ./config.status"
1464 +
1465 +######################################################################
1466 +# Samba Testing Framework
1467 +
1468 +# FIXME: LD_LIBRARY_PATH is not portable, but in the absence of
1469 +# libtool I don't know a better way to do it.  Perhaps we should fix
1470 +# libbigballofmud to link statically?
1471 +
1472 +check: check-programs
1473 +       LD_LIBRARY_PATH="`pwd`/bin:$$LD_LIBRARY_PATH" \
1474 +       PATH="`pwd`/bin:$$PATH" \
1475 +       python stf/standardcheck.py; \
1476 +       if test -n "$(PYTHON)"; then \
1477 +               python stf/pythoncheck.py; \
1478 +       fi
1479 +
1480 +# These are called by the test suite and need to be built before
1481 +# running it.  For the time being we don't build all of BIN_PROGS,
1482 +# because they're not all needed.
1483 +check-programs: bin/t_strcmp bin/t_push_ucs2 bin/smbcontrol bin/t_snprintf
1484 diff -durN samba-3.0.1.orig/source/aclocal.m4 samba-3.0.1/source/aclocal.m4
1485 --- samba-3.0.1.orig/source/aclocal.m4  2003-11-07 18:37:32.000000000 +0100
1486 +++ samba-3.0.1/source/aclocal.m4       2004-12-30 13:54:05.767874344 +0100
1487 @@ -496,12 +496,12 @@
1488    $1=[$]ac_new_flags
1489  ])
1490      
1491 -dnl Removes -L/usr/lib/? from given variable
1492 +dnl Removes -L/usr/lib64/? from given variable
1493  AC_DEFUN(LIB_REMOVE_USR_LIB,[
1494    ac_new_flags=""
1495    for i in [$]$1; do
1496      case [$]i in
1497 -    -L/usr/lib|-L/usr/lib/) ;;
1498 +    -L/usr/lib64|-L/usr/lib64/) ;;
1499      *) ac_new_flags="[$]ac_new_flags [$]i" ;;
1500      esac
1501    done
1502 @@ -632,9 +632,9 @@
1503  ])
1504  
1505  dnl LIB_ADD_DIR(LDFLAGS, $LIBDIR)
1506 -dnl This function doesn't add -L/usr/lib into LDFLAGS
1507 +dnl This function doesn't add -L/usr/lib64 into LDFLAGS
1508  AC_DEFUN(LIB_ADD_DIR,[
1509 -if test "$2" != "/usr/lib" ; then
1510 +if test "$2" != "/usr/lib64" ; then
1511      $1="$$1 -L$2"
1512  fi
1513  ])
1514 diff -durN samba-3.0.1.orig/source/aclocal.m4~ samba-3.0.1/source/aclocal.m4~
1515 --- samba-3.0.1.orig/source/aclocal.m4~ 1970-01-01 01:00:00.000000000 +0100
1516 +++ samba-3.0.1/source/aclocal.m4~      2003-11-07 18:37:32.000000000 +0100
1517 @@ -0,0 +1,730 @@
1518 +dnl AC_VALIDATE_CACHE_SYSTEM_TYPE[(cmd)]
1519 +dnl if the cache file is inconsistent with the current host,
1520 +dnl target and build system types, execute CMD or print a default
1521 +dnl error message.
1522 +AC_DEFUN(AC_VALIDATE_CACHE_SYSTEM_TYPE, [
1523 +    AC_REQUIRE([AC_CANONICAL_SYSTEM])
1524 +    AC_MSG_CHECKING([config.cache system type])
1525 +    if { test x"${ac_cv_host_system_type+set}" = x"set" &&
1526 +         test x"$ac_cv_host_system_type" != x"$host"; } ||
1527 +       { test x"${ac_cv_build_system_type+set}" = x"set" &&
1528 +         test x"$ac_cv_build_system_type" != x"$build"; } ||
1529 +       { test x"${ac_cv_target_system_type+set}" = x"set" &&
1530 +         test x"$ac_cv_target_system_type" != x"$target"; }; then
1531 +       AC_MSG_RESULT([different])
1532 +       ifelse($#, 1, [$1],
1533 +               [AC_MSG_ERROR(["you must remove config.cache and restart configure"])])
1534 +    else
1535 +       AC_MSG_RESULT([same])
1536 +    fi
1537 +    ac_cv_host_system_type="$host"
1538 +    ac_cv_build_system_type="$build"
1539 +    ac_cv_target_system_type="$target"
1540 +])
1541 +
1542 +
1543 +dnl test whether dirent has a d_off member
1544 +AC_DEFUN(AC_DIRENT_D_OFF,
1545 +[AC_CACHE_CHECK([for d_off in dirent], ac_cv_dirent_d_off,
1546 +[AC_TRY_COMPILE([
1547 +#include <unistd.h>
1548 +#include <sys/types.h>
1549 +#include <dirent.h>], [struct dirent d; d.d_off;],
1550 +ac_cv_dirent_d_off=yes, ac_cv_dirent_d_off=no)])
1551 +if test $ac_cv_dirent_d_off = yes; then
1552 +  AC_DEFINE(HAVE_DIRENT_D_OFF,1,[Whether dirent has a d_off member])
1553 +fi
1554 +])
1555 +
1556 +dnl Mark specified module as shared
1557 +dnl SMB_MODULE(name,static_files,shared_files,subsystem,whatif-static,whatif-shared)
1558 +AC_DEFUN(SMB_MODULE,
1559 +[
1560 +       AC_MSG_CHECKING([how to build $1])
1561 +       if test "$[MODULE_][$1]"; then
1562 +               DEST=$[MODULE_][$1]
1563 +       elif test "$[MODULE_]translit([$4], [A-Z], [a-z])" -a "$[MODULE_DEFAULT_][$1]"; then
1564 +               DEST=$[MODULE_]translit([$4], [A-Z], [a-z])
1565 +       else
1566 +               DEST=$[MODULE_DEFAULT_][$1]
1567 +       fi
1568 +       
1569 +       if test x"$DEST" = xSHARED; then
1570 +               AC_DEFINE([$1][_init], [init_module], [Whether to build $1 as shared module])
1571 +               $4_MODULES="$$4_MODULES $3"
1572 +               AC_MSG_RESULT([shared])
1573 +               [$6]
1574 +               string_shared_modules="$string_shared_modules $1"
1575 +       elif test x"$DEST" = xSTATIC; then
1576 +               [init_static_modules_]translit([$4], [A-Z], [a-z])="$[init_static_modules_]translit([$4], [A-Z], [a-z]) $1_init();"
1577 +               string_static_modules="$string_static_modules $1"
1578 +               $4_STATIC="$$4_STATIC $2"
1579 +               AC_SUBST($4_STATIC)
1580 +               [$5]
1581 +               AC_MSG_RESULT([static])
1582 +       else
1583 +           string_ignored_modules="$string_ignored_modules $1"
1584 +               AC_MSG_RESULT([not])
1585 +       fi
1586 +])
1587 +
1588 +AC_DEFUN(SMB_SUBSYSTEM,
1589 +[
1590 +       AC_SUBST($1_STATIC)
1591 +       AC_SUBST($1_MODULES)
1592 +       AC_DEFINE_UNQUOTED([static_init_]translit([$1], [A-Z], [a-z]), [{$init_static_modules_]translit([$1], [A-Z], [a-z])[}], [Static init functions])
1593 +       ifelse([$2], , :, [rm -f $2])
1594 +])
1595 +
1596 +dnl AC_PROG_CC_FLAG(flag)
1597 +AC_DEFUN(AC_PROG_CC_FLAG,
1598 +[AC_CACHE_CHECK(whether ${CC-cc} accepts -$1, ac_cv_prog_cc_$1,
1599 +[echo 'void f(){}' > conftest.c
1600 +if test -z "`${CC-cc} -$1 -c conftest.c 2>&1`"; then
1601 +  ac_cv_prog_cc_$1=yes
1602 +else
1603 +  ac_cv_prog_cc_$1=no
1604 +fi
1605 +rm -f conftest*
1606 +])])
1607 +
1608 +dnl see if a declaration exists for a function or variable
1609 +dnl defines HAVE_function_DECL if it exists
1610 +dnl AC_HAVE_DECL(var, includes)
1611 +AC_DEFUN(AC_HAVE_DECL,
1612 +[
1613 + AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[
1614 +    AC_TRY_COMPILE([$2],[int i = (int)$1],
1615 +        ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)])
1616 + if test x"$ac_cv_have_$1_decl" = x"yes"; then
1617 +    AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL],1,[Whether $1() is available])
1618 + fi
1619 +])
1620 +
1621 +
1622 +dnl check for a function in a library, but don't
1623 +dnl keep adding the same library to the LIBS variable.
1624 +dnl AC_LIBTESTFUNC(lib,func)
1625 +AC_DEFUN(AC_LIBTESTFUNC,
1626 +[case "$LIBS" in
1627 +  *-l$1*) AC_CHECK_FUNCS($2) ;;
1628 +  *) AC_CHECK_LIB($1, $2) 
1629 +     AC_CHECK_FUNCS($2)
1630 +  ;;
1631 +  esac
1632 +])
1633 +
1634 +# AC_CHECK_LIB_EXT(LIBRARY, [EXT_LIBS], [FUNCTION],
1635 +#              [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
1636 +#              [ADD-ACTION-IF-FOUND],[OTHER-LIBRARIES])
1637 +# ------------------------------------------------------
1638 +#
1639 +# Use a cache variable name containing both the library and function name,
1640 +# because the test really is for library $1 defining function $3, not
1641 +# just for library $1.  Separate tests with the same $1 and different $3s
1642 +# may have different results.
1643 +#
1644 +# Note that using directly AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$3])
1645 +# is asking for trouble, since AC_CHECK_LIB($lib, fun) would give
1646 +# ac_cv_lib_$lib_fun, which is definitely not what was meant.  Hence
1647 +# the AS_LITERAL_IF indirection.
1648 +#
1649 +# FIXME: This macro is extremely suspicious.  It DEFINEs unconditionally,
1650 +# whatever the FUNCTION, in addition to not being a *S macro.  Note
1651 +# that the cache does depend upon the function we are looking for.
1652 +#
1653 +# It is on purpose we used `ac_check_lib_ext_save_LIBS' and not just
1654 +# `ac_save_LIBS': there are many macros which don't want to see `LIBS'
1655 +# changed but still want to use AC_CHECK_LIB_EXT, so they save `LIBS'.
1656 +# And ``ac_save_LIBS' is too tempting a name, so let's leave them some
1657 +# freedom.
1658 +AC_DEFUN([AC_CHECK_LIB_EXT],
1659 +[
1660 +AH_CHECK_LIB_EXT([$1])
1661 +ac_check_lib_ext_save_LIBS=$LIBS
1662 +LIBS="-l$1 $$2 $7 $LIBS"
1663 +AS_LITERAL_IF([$1],
1664 +      [AS_VAR_PUSHDEF([ac_Lib_ext], [ac_cv_lib_ext_$1])],
1665 +      [AS_VAR_PUSHDEF([ac_Lib_ext], [ac_cv_lib_ext_$1''])])dnl
1666 +
1667 +m4_ifval([$3],
1668 + [
1669 +    AH_CHECK_FUNC_EXT([$3])
1670 +    AS_LITERAL_IF([$1],
1671 +              [AS_VAR_PUSHDEF([ac_Lib_func], [ac_cv_lib_ext_$1_$3])],
1672 +              [AS_VAR_PUSHDEF([ac_Lib_func], [ac_cv_lib_ext_$1''_$3])])dnl
1673 +    AC_CACHE_CHECK([for $3 in -l$1], ac_Lib_func,
1674 +       [AC_TRY_LINK_FUNC($3,
1675 +                 [AS_VAR_SET(ac_Lib_func, yes);
1676 +                 AS_VAR_SET(ac_Lib_ext, yes)],
1677 +                 [AS_VAR_SET(ac_Lib_func, no);
1678 +                 AS_VAR_SET(ac_Lib_ext, no)])
1679 +       ])
1680 +    AS_IF([test AS_VAR_GET(ac_Lib_func) = yes],
1681 +        [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_$3))])dnl
1682 +    AS_VAR_POPDEF([ac_Lib_func])dnl
1683 + ],[
1684 +    AC_CACHE_CHECK([for -l$1], ac_Lib_ext,
1685 +       [AC_TRY_LINK_FUNC([main],
1686 +                 [AS_VAR_SET(ac_Lib_ext, yes)],
1687 +                 [AS_VAR_SET(ac_Lib_ext, no)])
1688 +       ])
1689 + ])
1690 +LIBS=$ac_check_lib_ext_save_LIBS
1691 +
1692 +AS_IF([test AS_VAR_GET(ac_Lib_ext) = yes],
1693 +    [m4_default([$4], 
1694 +        [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
1695 +               case "$$2" in
1696 +                   *-l$1*)
1697 +                       ;;
1698 +                   *)
1699 +                       $2="-l$1 $$2"
1700 +                       ;;
1701 +               esac])
1702 +               [$6]
1703 +           ],
1704 +           [$5])dnl
1705 +AS_VAR_POPDEF([ac_Lib_ext])dnl
1706 +])# AC_CHECK_LIB_EXT
1707 +
1708 +# AH_CHECK_LIB_EXT(LIBNAME)
1709 +# ---------------------
1710 +m4_define([AH_CHECK_LIB_EXT],
1711 +[AH_TEMPLATE(AS_TR_CPP(HAVE_LIB$1),
1712 +             [Define to 1 if you have the `]$1[' library (-l]$1[).])])
1713 +
1714 +# AC_CHECK_FUNCS_EXT(FUNCTION, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1715 +# -----------------------------------------------------------------
1716 +dnl check for a function in a $LIBS and $OTHER_LIBS libraries variable.
1717 +dnl AC_CHECK_FUNC_EXT(func,OTHER_LIBS,IF-TRUE,IF-FALSE)
1718 +AC_DEFUN([AC_CHECK_FUNC_EXT],
1719 +[
1720 +    AH_CHECK_FUNC_EXT($1)      
1721 +    ac_check_func_ext_save_LIBS=$LIBS
1722 +    LIBS="$2 $LIBS"
1723 +    AS_VAR_PUSHDEF([ac_var], [ac_cv_func_ext_$1])dnl
1724 +    AC_CACHE_CHECK([for $1], ac_var,
1725 +       [AC_LINK_IFELSE([AC_LANG_FUNC_LINK_TRY([$1])],
1726 +                [AS_VAR_SET(ac_var, yes)],
1727 +                [AS_VAR_SET(ac_var, no)])])
1728 +    LIBS=$ac_check_func_ext_save_LIBS
1729 +    AS_IF([test AS_VAR_GET(ac_var) = yes], 
1730 +           [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1])) $3], 
1731 +           [$4])dnl
1732 +AS_VAR_POPDEF([ac_var])dnl
1733 +])# AC_CHECK_FUNC
1734 +
1735 +# AH_CHECK_FUNC_EXT(FUNCNAME)
1736 +# ---------------------
1737 +m4_define([AH_CHECK_FUNC_EXT],
1738 +[AH_TEMPLATE(AS_TR_CPP(HAVE_$1),
1739 +             [Define to 1 if you have the `]$1[' function.])])
1740 +
1741 +dnl Define an AC_DEFINE with ifndef guard.
1742 +dnl AC_N_DEFINE(VARIABLE [, VALUE])
1743 +define(AC_N_DEFINE,
1744 +[cat >> confdefs.h <<\EOF
1745 +[#ifndef] $1
1746 +[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1)
1747 +[#endif]
1748 +EOF
1749 +])
1750 +
1751 +dnl Add an #include
1752 +dnl AC_ADD_INCLUDE(VARIABLE)
1753 +define(AC_ADD_INCLUDE,
1754 +[cat >> confdefs.h <<\EOF
1755 +[#include] $1
1756 +EOF
1757 +])
1758 +
1759 +dnl Copied from libtool.m4
1760 +AC_DEFUN(AC_PROG_LD_GNU,
1761 +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
1762 +[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
1763 +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
1764 +  ac_cv_prog_gnu_ld=yes
1765 +else
1766 +  ac_cv_prog_gnu_ld=no
1767 +fi])
1768 +])
1769 +
1770 +# Configure paths for LIBXML2
1771 +# Toshio Kuratomi 2001-04-21
1772 +# Adapted from:
1773 +# Configure paths for GLIB
1774 +# Owen Taylor     97-11-3
1775 +
1776 +dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1777 +dnl Test for XML, and define XML_CFLAGS and XML_LIBS
1778 +dnl
1779 +AC_DEFUN(AM_PATH_XML2,[ 
1780 +AC_ARG_WITH(xml-prefix,
1781 +            [  --with-xml-prefix=PFX   Prefix where libxml is installed (optional)],
1782 +            xml_config_prefix="$withval", xml_config_prefix="")
1783 +AC_ARG_WITH(xml-exec-prefix,
1784 +            [  --with-xml-exec-prefix=PFX Exec prefix where libxml is installed (optional)],
1785 +            xml_config_exec_prefix="$withval", xml_config_exec_prefix="")
1786 +AC_ARG_ENABLE(xmltest,
1787 +              [  --disable-xmltest       Do not try to compile and run a test LIBXML program],,
1788 +              enable_xmltest=yes)
1789 +
1790 +  if test x$xml_config_exec_prefix != x ; then
1791 +     xml_config_args="$xml_config_args --exec-prefix=$xml_config_exec_prefix"
1792 +     if test x${XML2_CONFIG+set} != xset ; then
1793 +        XML2_CONFIG=$xml_config_exec_prefix/bin/xml2-config
1794 +     fi
1795 +  fi
1796 +  if test x$xml_config_prefix != x ; then
1797 +     xml_config_args="$xml_config_args --prefix=$xml_config_prefix"
1798 +     if test x${XML2_CONFIG+set} != xset ; then
1799 +        XML2_CONFIG=$xml_config_prefix/bin/xml2-config
1800 +     fi
1801 +  fi
1802 +
1803 +  AC_PATH_PROG(XML2_CONFIG, xml2-config, no)
1804 +  min_xml_version=ifelse([$1], ,2.0.0,[$1])
1805 +  AC_MSG_CHECKING(for libxml - version >= $min_xml_version)
1806 +  no_xml=""
1807 +  if test "$XML2_CONFIG" = "no" ; then
1808 +    no_xml=yes
1809 +  else
1810 +    XML_CFLAGS=`$XML2_CONFIG $xml_config_args --cflags`
1811 +    XML_LIBS=`$XML2_CONFIG $xml_config_args --libs`
1812 +    xml_config_major_version=`$XML2_CONFIG $xml_config_args --version | \
1813 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1814 +    xml_config_minor_version=`$XML2_CONFIG $xml_config_args --version | \
1815 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1816 +    xml_config_micro_version=`$XML2_CONFIG $xml_config_args --version | \
1817 +           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1818 +    if test "x$enable_xmltest" = "xyes" ; then
1819 +      ac_save_CFLAGS="$CFLAGS"
1820 +      ac_save_LIBS="$LIBS"
1821 +      CFLAGS="$CFLAGS $XML_CFLAGS"
1822 +      LIBS="$XML_LIBS $LIBS"
1823 +dnl
1824 +dnl Now check if the installed libxml is sufficiently new.
1825 +dnl (Also sanity checks the results of xml2-config to some extent)
1826 +dnl
1827 +      rm -f conf.xmltest
1828 +      AC_TRY_RUN([
1829 +#include <stdlib.h>
1830 +#include <stdio.h>
1831 +#include <string.h>
1832 +#include <libxml/xmlversion.h>
1833 +
1834 +int 
1835 +main()
1836 +{
1837 +  int xml_major_version, xml_minor_version, xml_micro_version;
1838 +  int major, minor, micro;
1839 +  char *tmp_version;
1840 +
1841 +  system("touch conf.xmltest");
1842 +
1843 +  /* Capture xml2-config output via autoconf/configure variables */
1844 +  /* HP/UX 9 (%@#!) writes to sscanf strings */
1845 +  tmp_version = (char *)strdup("$min_xml_version");
1846 +  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
1847 +     printf("%s, bad version string from xml2-config\n", "$min_xml_version");
1848 +     exit(1);
1849 +   }
1850 +   free(tmp_version);
1851 +
1852 +   /* Capture the version information from the header files */
1853 +   tmp_version = (char *)strdup(LIBXML_DOTTED_VERSION);
1854 +   if (sscanf(tmp_version, "%d.%d.%d", &xml_major_version, &xml_minor_version, &xml_micro_version) != 3) {
1855 +     printf("%s, bad version string from libxml includes\n", "LIBXML_DOTTED_VERSION");
1856 +     exit(1);
1857 +   }
1858 +   free(tmp_version);
1859 +
1860 + /* Compare xml2-config output to the libxml headers */
1861 +  if ((xml_major_version != $xml_config_major_version) ||
1862 +      (xml_minor_version != $xml_config_minor_version) ||
1863 +      (xml_micro_version != $xml_config_micro_version))
1864 +    {
1865 +      printf("*** libxml header files (version %d.%d.%d) do not match\n",
1866 +         xml_major_version, xml_minor_version, xml_micro_version);
1867 +      printf("*** xml2-config (version %d.%d.%d)\n",
1868 +         $xml_config_major_version, $xml_config_minor_version, $xml_config_micro_version);
1869 +      return 1;
1870 +    } 
1871 +/* Compare the headers to the library to make sure we match */
1872 +  /* Less than ideal -- doesn't provide us with return value feedback, 
1873 +   * only exits if there's a serious mismatch between header and library.
1874 +   */
1875 +    LIBXML_TEST_VERSION;
1876 +
1877 +    /* Test that the library is greater than our minimum version */
1878 +    if ((xml_major_version > major) ||
1879 +        ((xml_major_version == major) && (xml_minor_version > minor)) ||
1880 +        ((xml_major_version == major) && (xml_minor_version == minor) &&
1881 +        (xml_micro_version >= micro)))
1882 +      {
1883 +        return 0;
1884 +       }
1885 +     else
1886 +      {
1887 +        printf("\n*** An old version of libxml (%d.%d.%d) was found.\n",
1888 +               xml_major_version, xml_minor_version, xml_micro_version);
1889 +        printf("*** You need a version of libxml newer than %d.%d.%d. The latest version of\n",
1890 +           major, minor, micro);
1891 +        printf("*** libxml is always available from ftp://ftp.xmlsoft.org.\n");
1892 +        printf("***\n");
1893 +        printf("*** If you have already installed a sufficiently new version, this error\n");
1894 +        printf("*** probably means that the wrong copy of the xml2-config shell script is\n");
1895 +        printf("*** being found. The easiest way to fix this is to remove the old version\n");
1896 +        printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
1897 +        printf("*** correct copy of xml2-config. (In this case, you will have to\n");
1898 +        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1899 +        printf("*** so that the correct libraries are found at run-time))\n");
1900 +    }
1901 +  return 1;
1902 +}
1903 +],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1904 +       CFLAGS="$ac_save_CFLAGS"
1905 +       LIBS="$ac_save_LIBS"
1906 +     fi
1907 +  fi
1908 +
1909 +  if test "x$no_xml" = x ; then
1910 +     AC_MSG_RESULT(yes (version $xml_config_major_version.$xml_config_minor_version.$xml_config_micro_version))
1911 +     ifelse([$2], , :, [$2])     
1912 +  else
1913 +     AC_MSG_RESULT(no)
1914 +     if test "$XML2_CONFIG" = "no" ; then
1915 +       echo "*** The xml2-config script installed by LIBXML could not be found"
1916 +       echo "*** If libxml was installed in PREFIX, make sure PREFIX/bin is in"
1917 +       echo "*** your path, or set the XML2_CONFIG environment variable to the"
1918 +       echo "*** full path to xml2-config."
1919 +     else
1920 +       if test -f conf.xmltest ; then
1921 +        :
1922 +       else
1923 +          echo "*** Could not run libxml test program, checking why..."
1924 +          CFLAGS="$CFLAGS $XML_CFLAGS"
1925 +          LIBS="$LIBS $XML_LIBS"
1926 +          AC_TRY_LINK([
1927 +#include <libxml/xmlversion.h>
1928 +#include <stdio.h>
1929 +],      [ LIBXML_TEST_VERSION; return 0;],
1930 +        [ echo "*** The test program compiled, but did not run. This usually means"
1931 +          echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
1932 +          echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
1933 +          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1934 +          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
1935 +          echo "*** is required on your system"
1936 +          echo "***"
1937 +          echo "*** If you have an old version installed, it is best to remove it, although"
1938 +          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1939 +        [ echo "*** The test program failed to compile or link. See the file config.log for the"
1940 +          echo "*** exact error that occured. This usually means LIBXML was incorrectly installed"
1941 +          echo "*** or that you have moved LIBXML since it was installed. In the latter case, you"
1942 +          echo "*** may want to edit the xml2-config script: $XML2_CONFIG" ])
1943 +          CFLAGS="$ac_save_CFLAGS"
1944 +          LIBS="$ac_save_LIBS"
1945 +       fi
1946 +     fi
1947 +
1948 +     XML_CFLAGS=""
1949 +     XML_LIBS=""
1950 +     ifelse([$3], , :, [$3])
1951 +  fi
1952 +  AC_SUBST(XML_CFLAGS)
1953 +  AC_SUBST(XML_LIBS)
1954 +  rm -f conf.xmltest
1955 +])
1956 +
1957 +# =========================================================================
1958 +# AM_PATH_MYSQL : MySQL library
1959 +
1960 +dnl AM_PATH_MYSQL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
1961 +dnl Test for MYSQL, and define MYSQL_CFLAGS and MYSQL_LIBS
1962 +dnl
1963 +AC_DEFUN(AM_PATH_MYSQL,
1964 +[dnl
1965 +dnl Get the cflags and libraries from the mysql_config script
1966 +dnl
1967 +AC_ARG_WITH(mysql-prefix,[  --with-mysql-prefix=PFX   Prefix where MYSQL is installed (optional)],
1968 +            mysql_prefix="$withval", mysql_prefix="")
1969 +AC_ARG_WITH(mysql-exec-prefix,[  --with-mysql-exec-prefix=PFX Exec prefix where MYSQL is installed (optional)],
1970 +            mysql_exec_prefix="$withval", mysql_exec_prefix="")
1971 +
1972 +  if test x$mysql_exec_prefix != x ; then
1973 +     mysql_args="$mysql_args --exec-prefix=$mysql_exec_prefix"
1974 +     if test x${MYSQL_CONFIG+set} != xset ; then
1975 +        MYSQL_CONFIG=$mysql_exec_prefix/bin/mysql_config
1976 +     fi
1977 +  fi
1978 +  if test x$mysql_prefix != x ; then
1979 +     mysql_args="$mysql_args --prefix=$mysql_prefix"
1980 +     if test x${MYSQL_CONFIG+set} != xset ; then
1981 +        MYSQL_CONFIG=$mysql_prefix/bin/mysql_config
1982 +     fi
1983 +  fi
1984 +
1985 +  AC_REQUIRE([AC_CANONICAL_TARGET])
1986 +  AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no)
1987 +  AC_MSG_CHECKING(for MYSQL)
1988 +  no_mysql=""
1989 +  if test "$MYSQL_CONFIG" = "no" ; then
1990 +    MYSQL_CFLAGS=""
1991 +    MYSQL_LIBS=""
1992 +    AC_MSG_RESULT(no)
1993 +     ifelse([$2], , :, [$2])
1994 +  else
1995 +    MYSQL_CFLAGS=`$MYSQL_CONFIG $mysqlconf_args --cflags | sed -e "s/'//g"`
1996 +    MYSQL_LIBS=`$MYSQL_CONFIG $mysqlconf_args --libs | sed -e "s/'//g"`
1997 +    AC_MSG_RESULT(yes)
1998 +    ifelse([$1], , :, [$1])
1999 +  fi
2000 +  AC_SUBST(MYSQL_CFLAGS)
2001 +  AC_SUBST(MYSQL_LIBS)
2002 +])
2003 +
2004 +dnl Removes -I/usr/include/? from given variable
2005 +AC_DEFUN(CFLAGS_REMOVE_USR_INCLUDE,[
2006 +  ac_new_flags=""
2007 +  for i in [$]$1; do
2008 +    case [$]i in
2009 +    -I/usr/include|-I/usr/include/) ;;
2010 +    *) ac_new_flags="[$]ac_new_flags [$]i" ;;
2011 +    esac
2012 +  done
2013 +  $1=[$]ac_new_flags
2014 +])
2015 +    
2016 +dnl Removes -L/usr/lib/? from given variable
2017 +AC_DEFUN(LIB_REMOVE_USR_LIB,[
2018 +  ac_new_flags=""
2019 +  for i in [$]$1; do
2020 +    case [$]i in
2021 +    -L/usr/lib|-L/usr/lib/) ;;
2022 +    *) ac_new_flags="[$]ac_new_flags [$]i" ;;
2023 +    esac
2024 +  done
2025 +  $1=[$]ac_new_flags
2026 +])
2027 +
2028 +dnl From Bruno Haible.
2029 +
2030 +AC_DEFUN(jm_ICONV,
2031 +[
2032 +  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2033 +  dnl those with the standalone portable libiconv installed).
2034 +  AC_MSG_CHECKING(for iconv in $1)
2035 +    jm_cv_func_iconv="no"
2036 +    jm_cv_lib_iconv=""
2037 +    jm_cv_giconv=no
2038 +    jm_save_LIBS="$LIBS"
2039 +    LIBS="$LIBS -lbiconv"
2040 +    AC_TRY_LINK([#include <stdlib.h>
2041 +#include <biconv.h>],
2042 +        [iconv_t cd = iconv_open("","");
2043 +         iconv(cd,NULL,NULL,NULL,NULL);
2044 +         iconv_close(cd);],
2045 +      jm_cv_func_iconv=yes
2046 +      jm_cv_biconv=yes
2047 +      jm_cv_include="biconv.h"
2048 +      jm_cv_lib_iconv="biconv")
2049 +      LIBS="$jm_save_LIBS"
2050 +
2051 +    dnl Check for include in funny place but no lib needed
2052 +    if test "$jm_cv_func_iconv" != yes; then 
2053 +      AC_TRY_LINK([#include <stdlib.h>
2054 +#include <giconv.h>],
2055 +        [iconv_t cd = iconv_open("","");
2056 +         iconv(cd,NULL,NULL,NULL,NULL);
2057 +         iconv_close(cd);],
2058 +         jm_cv_func_iconv=yes
2059 +         jm_cv_include="giconv.h"
2060 +         jm_cv_giconv="yes"
2061 +         jm_cv_lib_iconv="")
2062 +
2063 +      dnl Standard iconv.h include, lib in glibc or libc ...
2064 +      if test "$jm_cv_func_iconv" != yes; then
2065 +        AC_TRY_LINK([#include <stdlib.h>
2066 +#include <iconv.h>],
2067 +          [iconv_t cd = iconv_open("","");
2068 +           iconv(cd,NULL,NULL,NULL,NULL);
2069 +           iconv_close(cd);],
2070 +           jm_cv_include="iconv.h"
2071 +           jm_cv_func_iconv=yes
2072 +           jm_cv_lib_iconv="")
2073 +
2074 +          if test "$jm_cv_lib_iconv" != yes; then
2075 +            jm_save_LIBS="$LIBS"
2076 +            LIBS="$LIBS -lgiconv"
2077 +            AC_TRY_LINK([#include <stdlib.h>
2078 +#include <giconv.h>],
2079 +              [iconv_t cd = iconv_open("","");
2080 +               iconv(cd,NULL,NULL,NULL,NULL);
2081 +               iconv_close(cd);],
2082 +              jm_cv_lib_iconv=yes
2083 +              jm_cv_func_iconv=yes
2084 +              jm_cv_include="giconv.h"
2085 +              jm_cv_giconv=yes
2086 +              jm_cv_lib_iconv="giconv")
2087 +
2088 +           LIBS="$jm_save_LIBS"
2089 +
2090 +        if test "$jm_cv_func_iconv" != yes; then
2091 +          jm_save_LIBS="$LIBS"
2092 +          LIBS="$LIBS -liconv"
2093 +          AC_TRY_LINK([#include <stdlib.h>
2094 +#include <iconv.h>],
2095 +            [iconv_t cd = iconv_open("","");
2096 +             iconv(cd,NULL,NULL,NULL,NULL);
2097 +             iconv_close(cd);],
2098 +            jm_cv_include="iconv.h"
2099 +            jm_cv_func_iconv=yes
2100 +            jm_cv_lib_iconv="iconv")
2101 +          LIBS="$jm_save_LIBS"
2102 +        fi
2103 +      fi
2104 +    fi
2105 +  fi
2106 +  if test "$jm_cv_func_iconv" = yes; then
2107 +    if test "$jm_cv_giconv" = yes; then
2108 +      AC_DEFINE(HAVE_GICONV, 1, [What header to include for iconv() function: giconv.h])
2109 +      AC_MSG_RESULT(yes)
2110 +      ICONV_FOUND=yes
2111 +    else
2112 +      if test "$jm_cv_biconv" = yes; then
2113 +        AC_DEFINE(HAVE_BICONV, 1, [What header to include for iconv() function: biconv.h])
2114 +        AC_MSG_RESULT(yes)
2115 +        ICONV_FOUND=yes
2116 +      else 
2117 +        AC_DEFINE(HAVE_ICONV, 1, [What header to include for iconv() function: iconv.h])
2118 +        AC_MSG_RESULT(yes)
2119 +        ICONV_FOUND=yes
2120 +      fi
2121 +    fi
2122 +  else
2123 +    AC_MSG_RESULT(no)
2124 +  fi
2125 +])
2126 +
2127 +AC_DEFUN(rjs_CHARSET,[
2128 +  dnl Find out if we can convert from $1 to UCS2-LE
2129 +  AC_MSG_CHECKING([can we convert from $1 to UCS2-LE?])
2130 +  AC_TRY_RUN([
2131 +#include <$jm_cv_include>
2132 +main(){
2133 +    iconv_t cd = iconv_open("$1", "UCS-2LE");
2134 +    if (cd == 0 || cd == (iconv_t)-1) {
2135 +       return -1;
2136 +    }
2137 +    return 0;
2138 +}
2139 +  ],ICONV_CHARSET=$1,ICONV_CHARSET=no,ICONV_CHARSET=cross)
2140 +  AC_MSG_RESULT($ICONV_CHARSET)
2141 +])
2142 +
2143 +dnl CFLAGS_ADD_DIR(CFLAGS, $INCDIR)
2144 +dnl This function doesn't add -I/usr/include into CFLAGS
2145 +AC_DEFUN(CFLAGS_ADD_DIR,[
2146 +if test "$2" != "/usr/include" ; then
2147 +    $1="$$1 -I$2"
2148 +fi
2149 +])
2150 +
2151 +dnl LIB_ADD_DIR(LDFLAGS, $LIBDIR)
2152 +dnl This function doesn't add -L/usr/lib into LDFLAGS
2153 +AC_DEFUN(LIB_ADD_DIR,[
2154 +if test "$2" != "/usr/lib" ; then
2155 +    $1="$$1 -L$2"
2156 +fi
2157 +])
2158 +
2159 +dnl AC_ENABLE_SHARED - implement the --enable-shared flag
2160 +dnl Usage: AC_ENABLE_SHARED[(DEFAULT)]
2161 +dnl   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
2162 +dnl   `yes'.
2163 +AC_DEFUN([AC_ENABLE_SHARED],
2164 +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
2165 +AC_ARG_ENABLE(shared,
2166 +changequote(<<, >>)dnl
2167 +<<  --enable-shared[=PKGS]    build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
2168 +changequote([, ])dnl
2169 +[p=${PACKAGE-default}
2170 +case $enableval in
2171 +yes) enable_shared=yes ;;
2172 +no) enable_shared=no ;;
2173 +*)
2174 +  enable_shared=no
2175 +  # Look at the argument we got.  We use all the common list separators.
2176 +  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2177 +  for pkg in $enableval; do
2178 +    if test "X$pkg" = "X$p"; then
2179 +      enable_shared=yes
2180 +    fi
2181 +
2182 +  done
2183 +  IFS="$ac_save_ifs"
2184 +  ;;
2185 +esac],
2186 +enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
2187 +])
2188 +
2189 +dnl AC_ENABLE_STATIC - implement the --enable-static flag
2190 +dnl Usage: AC_ENABLE_STATIC[(DEFAULT)]
2191 +dnl   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
2192 +dnl   `yes'.
2193 +AC_DEFUN([AC_ENABLE_STATIC],
2194 +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
2195 +AC_ARG_ENABLE(static,
2196 +changequote(<<, >>)dnl
2197 +<<  --enable-static[=PKGS]    build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
2198 +changequote([, ])dnl
2199 +[p=${PACKAGE-default}
2200 +case $enableval in
2201 +yes) enable_static=yes ;;
2202 +no) enable_static=no ;;
2203 +*)
2204 +  enable_static=no
2205 +  # Look at the argument we got.  We use all the common list separators.
2206 +  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2207 +  for pkg in $enableval; do
2208 +    if test "X$pkg" = "X$p"; then
2209 +      enable_static=yes
2210 +    fi
2211 +  done
2212 +  IFS="$ac_save_ifs"
2213 +  ;;
2214 +esac],
2215 +enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
2216 +])
2217 +
2218 +dnl AC_DISABLE_STATIC - set the default static flag to --disable-static
2219 +AC_DEFUN([AC_DISABLE_STATIC],
2220 +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
2221 +AC_ENABLE_STATIC(no)])
2222 +
2223 +dnl AC_TRY_RUN_STRICT(PROGRAM,CFLAGS,CPPFLAGS,LDFLAGS,
2224 +dnl            [ACTION-IF-TRUE],[ACTION-IF-FALSE],
2225 +dnl            [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
2226 +AC_DEFUN( [AC_TRY_RUN_STRICT],
2227 +[
2228 +       old_CFLAGS="$CFLAGS";
2229 +       CFLAGS="$2";
2230 +       export CFLAGS;
2231 +       old_CPPFLAGS="$CPPFLAGS";
2232 +       CPPFLAGS="$3";
2233 +       export CPPFLAGS;
2234 +       old_LDFLAGS="$LDFLAGS";
2235 +       LDFLAGS="$4";
2236 +       export LDFLAGS;
2237 +       AC_TRY_RUN([$1],[$5],[$6],[$7]);
2238 +       CFLAGS="$old_CFLAGS";
2239 +       old_CFLAGS="";
2240 +       export CFLAGS;
2241 +       CPPFLAGS="$old_CPPFLAGS";
2242 +       old_CPPFLAGS="";
2243 +       export CPPFLAGS;
2244 +       LDFLAGS="$old_LDFLAGS";
2245 +       old_LDFLAGS="";
2246 +       export LDFLAGS;
2247 +])
2248 diff -durN samba-3.0.1.orig/source/configure.in samba-3.0.1/source/configure.in
2249 --- samba-3.0.1.orig/source/configure.in        2003-12-15 04:36:25.000000000 +0100
2250 +++ samba-3.0.1/source/configure.in     2004-12-30 13:56:21.871183496 +0100
2251 @@ -22,7 +22,7 @@
2252      mandir="\${prefix}/share/man"
2253      logfilebase="\${VARDIR}/log/samba"
2254      privatedir="\${CONFIGDIR}/private"
2255 -    libdir="\${prefix}/lib/samba"
2256 +    libdir="\${prefix}/lib64/samba"
2257      swatdir="\${DATADIR}/samba/swat",
2258      configdir="\${LIBDIR}"
2259      logfilebase="\${VARDIR}"
2260 @@ -825,7 +825,7 @@
2261      _cppflags=${CPPFLAGS}
2262  
2263      # Add additional search path
2264 -    LDFLAGS="-L$with_readline/lib $LDFLAGS"
2265 +    LDFLAGS="-L$with_readline/lib64 $LDFLAGS"
2266      CPPFLAGS="-I$with_readline/include $CPPFLAGS"
2267  
2268      AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
2269 @@ -836,7 +836,7 @@
2270         AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
2271        done
2272        AC_CHECK_LIB(readline, rl_callback_handler_install,
2273 -       [TERMLDFLAGS="-L$with_readline/lib"
2274 +       [TERMLDFLAGS="-L$with_readline/lib64"
2275         TERMCPPFLAGS="-I$with_readline/include"
2276         CPPFLAGS="-I$with_readline/include $CPPFLAGS"
2277         TERMLIBS="-lreadline $TERMLIBS"
2278 @@ -1615,7 +1615,7 @@
2279  ICONV_LOCATION=standard
2280  LOOK_DIRS="/usr /usr/local /sw"
2281  AC_ARG_WITH(libiconv,
2282 -[  --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include (default=auto) ],
2283 +[  --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib64 and BASEDIR/include (default=auto) ],
2284  [
2285    if test "$withval" = "no" ; then
2286      AC_MSG_ERROR([argument to --with-libiconv must be a directory])
2287 @@ -1635,7 +1635,7 @@
2288      CPPFLAGS="$CPPFLAGS -I$i/include"
2289  dnl This is here to handle -withval stuff for --with-libiconv
2290  dnl Perhaps we should always add a -L
2291 -    LDFLAGS="$LDFLAGS -L$i/lib"
2292 +    LDFLAGS="$LDFLAGS -L$i/lib64"
2293      LIBS=
2294      export LDFLAGS LIBS CPPFLAGS
2295  dnl Try to find iconv(3)
2296 @@ -1643,7 +1643,7 @@
2297  
2298      if test "$ICONV_FOUND" = yes; then
2299         LDFLAGS=$save_LDFLAG
2300 -        LIB_ADD_DIR(LDFLAGS, "$i/lib")
2301 +        LIB_ADD_DIR(LDFLAGS, "$i/lib64")
2302          CFLAGS_ADD_DIR(CPPFLAGS, "$i/include")
2303          LIBS="$save_LIBS"
2304          ICONV_LOCATION=$i
2305 @@ -1655,7 +1655,7 @@
2306          # check for iconv in libc
2307          ic_save_LIBS="$LIBS"
2308          if test x"$ICONV_PATH_SPEC" = "xyes" ; then
2309 -           LIBS="$LIBS -L$ICONV_LOCATION/lib"
2310 +           LIBS="$LIBS -L$ICONV_LOCATION/lib64"
2311          fi
2312          if test x"$jm_cv_lib_iconv" != x; then
2313             LIBS="$LIBS -l$jm_cv_lib_iconv"
2314 @@ -1719,7 +1719,7 @@
2315             fi
2316            dnl Add the flags we need to CPPFLAGS and LDFLAGS
2317            CFLAGS_ADD_DIR(CPPFLAGS, "$i/include")
2318 -          LIB_ADD_DIR(LDFLAGS, "$i/lib")
2319 +          LIB_ADD_DIR(LDFLAGS, "$i/lib64")
2320            export CPPFLAGS
2321             AC_DEFINE(HAVE_NATIVE_ICONV,1,[Whether to use native iconv])
2322            AC_DEFINE_UNQUOTED(DEFAULT_DOS_CHARSET,$default_dos_charset,[Default dos charset name])
2323 @@ -2468,7 +2468,7 @@
2324          AC_MSG_RESULT($withval)
2325          KRB5_CFLAGS="-I$withval/include"
2326          KRB5_CPPFLAGS="-I$withval/include"
2327 -        KRB5_LDFLAGS="-L$withval/lib"
2328 +        KRB5_LDFLAGS="-L$withval/lib64"
2329          FOUND_KRB5=yes
2330          ;;
2331        esac ],
2332 @@ -2481,10 +2481,10 @@
2333      # see if this box has the SuSE location for the heimdal krb implementation
2334      AC_MSG_CHECKING(for /usr/include/heimdal)
2335      if test -d /usr/include/heimdal; then
2336 -      if test -f /usr/lib/heimdal/lib/libkrb5.a; then
2337 +      if test -f /usr/lib64/heimdal/lib/libkrb5.a; then
2338            KRB5_CFLAGS="-I/usr/include/heimdal"
2339            KRB5_CPPFLAGS="-I/usr/include/heimdal"
2340 -          KRB5_LDFLAGS="-L/usr/lib/heimdal/lib"
2341 +          KRB5_LDFLAGS="-L/usr/lib64/heimdal/lib"
2342            AC_MSG_RESULT(yes)
2343        else
2344            KRB5_CFLAGS="-I/usr/include/heimdal"
2345 @@ -4261,7 +4261,7 @@
2346  builddir=`pwd`
2347  AC_SUBST(builddir)
2348  
2349 -dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
2350 +dnl Remove -L/usr/lib64/? from LDFLAGS and LIBS
2351  LIB_REMOVE_USR_LIB(LDFLAGS)
2352  LIB_REMOVE_USR_LIB(LIBS)
2353  
2354 diff -durN samba-3.0.1.orig/source/configure.in~ samba-3.0.1/source/configure.in~
2355 --- samba-3.0.1.orig/source/configure.in~       1970-01-01 01:00:00.000000000 +0100
2356 +++ samba-3.0.1/source/configure.in~    2003-12-15 04:36:25.000000000 +0100
2357 @@ -0,0 +1,4280 @@
2358 +dnl Process this file with autoconf to produce a configure script.
2359 +
2360 +dnl We must use autotools 2.53 or above
2361 +AC_PREREQ(2.53)
2362 +AC_INIT(include/includes.h)
2363 +AC_CONFIG_HEADER(include/config.h)
2364 +
2365 +AC_DISABLE_STATIC
2366 +AC_ENABLE_SHARED
2367 +
2368 +#################################################
2369 +# Directory handling stuff to support both the
2370 +# legacy SAMBA directories and FHS compliant
2371 +# ones...
2372 +AC_PREFIX_DEFAULT(/usr/local/samba)
2373 +
2374 +AC_ARG_WITH(fhs, 
2375 +[  --with-fhs              Use FHS-compliant paths (default=no)],
2376 +    configdir="${sysconfdir}/samba"
2377 +    lockdir="\${VARDIR}/lib/samba"
2378 +    piddir="\${VARDIR}/run"
2379 +    mandir="\${prefix}/share/man"
2380 +    logfilebase="\${VARDIR}/log/samba"
2381 +    privatedir="\${CONFIGDIR}/private"
2382 +    libdir="\${prefix}/lib/samba"
2383 +    swatdir="\${DATADIR}/samba/swat",
2384 +    configdir="\${LIBDIR}"
2385 +    logfilebase="\${VARDIR}"
2386 +    lockdir="\${VARDIR}/locks"
2387 +    piddir="\${VARDIR}/locks"
2388 +    privatedir="\${prefix}/private"
2389 +    swatdir="\${prefix}/swat")
2390 +
2391 +#################################################
2392 +# set private directory location
2393 +AC_ARG_WITH(privatedir,
2394 +[  --with-privatedir=DIR   Where to put smbpasswd ($ac_default_prefix/private)],
2395 +[ case "$withval" in
2396 +  yes|no)
2397 +  #
2398 +  # Just in case anybody calls it without argument
2399 +  #
2400 +    AC_MSG_WARN([--with-privatedir called without argument - will use default])
2401 +  ;;
2402 +  * )
2403 +    privatedir="$withval"
2404 +    ;;
2405 +  esac])
2406 +
2407 +#################################################
2408 +# set lock directory location
2409 +AC_ARG_WITH(lockdir,
2410 +[  --with-lockdir=DIR      Where to put lock files ($ac_default_prefix/var/locks)],
2411 +[ case "$withval" in
2412 +  yes|no)
2413 +  #
2414 +  # Just in case anybody calls it without argument
2415 +  #
2416 +    AC_MSG_WARN([--with-lockdir called without argument - will use default])
2417 +  ;;
2418 +  * )
2419 +    lockdir="$withval"
2420 +    ;;
2421 +  esac])
2422 +
2423 +#################################################
2424 +# set pid directory location
2425 +AC_ARG_WITH(piddir,
2426 +[  --with-piddir=DIR       Where to put pid files ($ac_default_prefix/var/locks)],
2427 +[ case "$withval" in
2428 +  yes|no)
2429 +  #
2430 +  # Just in case anybody calls it without argument
2431 +  #
2432 +    AC_MSG_WARN([--with-piddir called without argument - will use default])
2433 +  ;;
2434 +  * )
2435 +    piddir="$withval"
2436 +    ;;
2437 +  esac])
2438 +
2439 +#################################################
2440 +# set SWAT directory location
2441 +AC_ARG_WITH(swatdir,
2442 +[  --with-swatdir=DIR      Where to put SWAT files ($ac_default_prefix/swat)],
2443 +[ case "$withval" in
2444 +  yes|no)
2445 +  #
2446 +  # Just in case anybody does it
2447 +  #
2448 +    AC_MSG_WARN([--with-swatdir called without argument - will use default])
2449 +  ;;
2450 +  * )
2451 +    swatdir="$withval"
2452 +    ;;
2453 +  esac])
2454 +
2455 +#################################################
2456 +# set configuration directory location
2457 +AC_ARG_WITH(configdir,
2458 +[  --with-configdir=DIR    Where to put configuration files (\$libdir)],
2459 +[ case "$withval" in
2460 +  yes|no)
2461 +  #
2462 +  # Just in case anybody does it
2463 +  #
2464 +    AC_MSG_WARN([--with-configdir called without argument - will use default])
2465 +  ;;
2466 +  * )
2467 +    configdir="$withval"
2468 +    ;;
2469 +  esac])
2470 +
2471 +#################################################
2472 +# set log directory location
2473 +AC_ARG_WITH(logfilebase,
2474 +[  --with-logfilebase=DIR  Where to put log files (\$(VARDIR))],
2475 +[ case "$withval" in
2476 +  yes|no)
2477 +  #
2478 +  # Just in case anybody does it
2479 +  #
2480 +    AC_MSG_WARN([--with-logfilebase called without argument - will use default])
2481 +  ;;
2482 +  * )
2483 +    logfilebase="$withval"
2484 +    ;;
2485 +  esac])
2486 +
2487 +AC_ARG_WITH(cfenc,
2488 +[  --with-cfenc=HEADERDIR  Use internal CoreFoundation encoding API
2489 +                         for optimization (Mac OS X/Darwin only)],
2490 +[
2491 +# May be in source $withval/CoreFoundation/StringEncodings.subproj.
2492 +# Should have been in framework $withval/CoreFoundation.framework/Headers.
2493 +for d in \
2494 +    $withval/CoreFoundation/StringEncodings.subproj \
2495 +    $withval/StringEncodings.subproj \
2496 +    $withval/CoreFoundation.framework/Headers \
2497 +    $withval/Headers \
2498 +    $withval
2499 +do
2500 +    if test -r $d/CFStringEncodingConverter.h; then
2501 +        ln -sfh $d include/CoreFoundation
2502 +    fi
2503 +done
2504 +])
2505 +
2506 +AC_SUBST(configdir)
2507 +AC_SUBST(lockdir)
2508 +AC_SUBST(piddir)
2509 +AC_SUBST(logfilebase)
2510 +AC_SUBST(privatedir)
2511 +AC_SUBST(swatdir)
2512 +AC_SUBST(bindir)
2513 +AC_SUBST(sbindir)
2514 +
2515 +dnl Unique-to-Samba variables we'll be playing with.
2516 +AC_SUBST(SHELL)
2517 +AC_SUBST(LDSHFLAGS)
2518 +AC_SUBST(SONAMEFLAG)
2519 +AC_SUBST(SHLD)
2520 +AC_SUBST(HOST_OS)
2521 +AC_SUBST(PICFLAGS)
2522 +AC_SUBST(PICSUFFIX)
2523 +AC_SUBST(POBAD_CC)
2524 +AC_SUBST(SHLIBEXT)
2525 +AC_SUBST(INSTALLCLIENT)
2526 +AC_SUBST(INSTALLCLIENTCMD_SH)
2527 +AC_SUBST(INSTALLCLIENTCMD_A)
2528 +AC_SUBST(LIBSMBCLIENT_SHARED)
2529 +AC_SUBST(LIBSMBCLIENT)
2530 +AC_SUBST(PRINT_LIBS)
2531 +AC_SUBST(AUTH_LIBS)
2532 +AC_SUBST(ACL_LIBS)
2533 +AC_SUBST(PASSDB_LIBS)
2534 +AC_SUBST(IDMAP_LIBS)
2535 +AC_SUBST(KRB5_LIBS)
2536 +AC_SUBST(LDAP_LIBS)
2537 +AC_SUBST(SHLIB_PROGS)
2538 +AC_SUBST(SMBWRAPPER)
2539 +AC_SUBST(EXTRA_BIN_PROGS)
2540 +AC_SUBST(EXTRA_SBIN_PROGS)
2541 +AC_SUBST(EXTRA_ALL_TARGETS)
2542 +
2543 +AC_ARG_ENABLE(debug, 
2544 +[  --enable-debug          Turn on compiler debugging information (default=no)],
2545 +    [if eval "test x$enable_debug = xyes"; then
2546 +       CFLAGS="${CFLAGS} -g"
2547 +    fi])
2548 +
2549 +AC_ARG_ENABLE(developer, [  --enable-developer      Turn on developer warnings and debugging (default=no)],
2550 +    [if eval "test x$enable_developer = xyes"; then
2551 +        developer=yes
2552 +       CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
2553 +    fi])
2554 +
2555 +AC_ARG_ENABLE(krb5developer, [  --enable-krb5developer  Turn on developer warnings and debugging, except -Wstrict-prototypes (default=no)],
2556 +    [if eval "test x$enable_krb5developer = xyes"; then
2557 +        developer=yes
2558 +       CFLAGS="${CFLAGS} -gstabs -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -DDEBUG_PASSWORD -DDEVELOPER"
2559 +    fi])
2560 +
2561 +AC_ARG_ENABLE(dmalloc, [  --enable-dmalloc        Enable heap debugging [default=no]])
2562 +
2563 +if test "x$enable_dmalloc" = xyes
2564 +then
2565 +       AC_DEFINE(ENABLE_DMALLOC, 1, [Define to turn on dmalloc debugging])
2566 +       AC_DEFINE(DMALLOC_FUNC_CHECK, 1, 
2567 +                  [Define to check invariants around some common functions])
2568 +       LIBS="$LIBS -ldmalloc"  
2569 +fi
2570 +
2571 +dnl Checks for programs.
2572 +
2573 +##
2574 +## for some reason this macro resets the CFLAGS
2575 +## so save and restore
2576 +##
2577 +OLD_CFLAGS=${CFLAGS}
2578 +AC_PROG_CC
2579 +CFLAGS=${OLD_CFLAGS}
2580 +
2581 +OLD_CFLAGS=${CFLAGS}
2582 +AC_PROG_CPP
2583 +CFLAGS=${OLD_CFLAGS}
2584 +
2585 +AC_PROG_INSTALL
2586 +AC_PROG_AWK
2587 +AC_PATH_PROG(PERL, perl)
2588 +
2589 +AC_CHECK_TOOL(AR, ar)
2590 +
2591 +# compile with optimization and without debugging by default, but
2592 +# allow people to set their own preference.
2593 +if test "x$CFLAGS" = x
2594 +then
2595 +  CFLAGS="-O ${CFLAGS}"
2596 +fi
2597 +
2598 +dnl Check if we use GNU ld
2599 +LD=ld
2600 +AC_PROG_LD_GNU
2601 +
2602 +dnl needed before AC_TRY_COMPILE
2603 +AC_ISC_POSIX
2604 +
2605 +dnl look for executable suffix
2606 +AC_EXEEXT
2607 +
2608 +dnl Check if C compiler understands -c and -o at the same time
2609 +AC_PROG_CC_C_O
2610 +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = no"; then
2611 +      BROKEN_CC=
2612 +else
2613 +      BROKEN_CC=#
2614 +fi
2615 +AC_SUBST(BROKEN_CC)
2616 +
2617 +dnl Check if the C compiler understands -Werror
2618 +AC_CACHE_CHECK([that the C compiler understands -Werror],samba_cv_HAVE_Werror, [
2619 + AC_TRY_RUN_STRICT([
2620 +  int main(void)
2621 +  {
2622 +       return 0;
2623 +  }],[-Werror],[$CPPFLAGS],[$LDFLAGS],
2624 +  samba_cv_HAVE_Werror=yes,samba_cv_HAVE_Werror=no,samba_cv_HAVE_Werror=cross)])
2625 +if test x"$samba_cv_HAVE_Werror" = x"yes"; then
2626 +   Werror_FLAGS="-Werror"
2627 +else 
2628 +dnl Check if the C compiler understands -w2
2629 +AC_CACHE_CHECK([that the C compiler understands -w2],samba_cv_HAVE_w2, [
2630 + AC_TRY_RUN_STRICT([
2631 +  int main(void)
2632 +  {
2633 +       return 0;
2634 +  }],[-w2],[$CPPFLAGS],[$LDFLAGS],
2635 +  samba_cv_HAVE_w2=yes,samba_cv_HAVE_w2=no,samba_cv_HAVE_w2=cross)])
2636 +if test x"$samba_cv_HAVE_w2" = x"yes"; then
2637 +   Werror_FLAGS="-w2"
2638 +fi
2639 +fi
2640 +
2641 +dnl Check if the C compiler understands volatile (it should, being ANSI).
2642 +AC_CACHE_CHECK([that the C compiler understands volatile],samba_cv_volatile, [
2643 +    AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0],
2644 +       samba_cv_volatile=yes,samba_cv_volatile=no)])
2645 +if test x"$samba_cv_volatile" = x"yes"; then
2646 +   AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile])
2647 +fi
2648 +
2649 +UNAME_S=`(uname -s) 2>/dev/null` || UNAME_S="unknown"
2650 +AC_MSG_CHECKING(uname -s)
2651 +AC_MSG_RESULT(${UNAME_S})
2652 +
2653 +UNAME_R=`(uname -r) 2>/dev/null` || UNAME_R="unknown"
2654 +AC_MSG_CHECKING(uname -r)
2655 +AC_MSG_RESULT(${UNAME_R})
2656 +
2657 +UNAME_M=`(uname -m) 2>/dev/null` || UNAME_M="unknown"
2658 +AC_MSG_CHECKING(uname -m)
2659 +AC_MSG_RESULT(${UNAME_M})
2660 +
2661 +UNAME_P=`(uname -p) 2>/dev/null` || UNAME_P="unknown"
2662 +AC_MSG_CHECKING(uname -p)
2663 +AC_MSG_RESULT(${UNAME_P})
2664 +
2665 +AC_CANONICAL_SYSTEM
2666 +
2667 +dnl Add #include for broken IRIX header files
2668 +  case "$host_os" in
2669 +       *irix6*) AC_ADD_INCLUDE(<standards.h>)
2670 +       ;;
2671 +esac
2672 +
2673 +AC_VALIDATE_CACHE_SYSTEM_TYPE
2674 +
2675 +DYNEXP=
2676 +
2677 +dnl Add modules that have to be built by default here
2678 +dnl These have to be built static:
2679 +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"
2680 +
2681 +dnl These are preferably build shared, and static if dlopen() is not available
2682 +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"
2683 +
2684 +if test "x$developer" = xyes; then
2685 +   default_static_modules="$default_static_modules rpc_echo"
2686 +   default_shared_modules="$default_shared_modules charset_weird"
2687 +fi
2688 +
2689 +#
2690 +# Config CPPFLAG settings for strange OS's that must be set
2691 +# before other tests.
2692 +#
2693 +case "$host_os" in
2694 +# Try to work out if this is the native HPUX compiler that uses the -Ae flag.
2695 +    *hpux*)
2696 +    
2697 +      AC_PROG_CC_FLAG(Ae)
2698 +      # mmap on HPUX is completely broken...
2699 +      AC_DEFINE(MMAP_BLACKLIST, 1, [Whether MMAP is broken])
2700 +      if test $ac_cv_prog_cc_Ae = yes; then
2701 +        CPPFLAGS="$CPPFLAGS -Ae"
2702 +      fi
2703 +#
2704 +# Defines needed for HPUX support.
2705 +# HPUX has bigcrypt but (sometimes?) doesn't use it for
2706 +# password hashing - hence the USE_BOTH_CRYPT_CALLS define.
2707 +#
2708 +      case `uname -r` in
2709 +                       *9*|*10*)
2710 +                               CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4 -DMAX_POSITIVE_LOCK_OFFSET=0x1ffffffffffLL"
2711 +                               AC_DEFINE(USE_BOTH_CRYPT_CALLS, 1, [Whether to use both of HPUX' crypt calls])
2712 +                               AC_DEFINE(_HPUX_SOURCE, 1, [Whether to use HPUX extensions])
2713 +                               AC_DEFINE(_POSIX_SOURCE, 1, [Whether to use POSIX compatible functions])
2714 +                               AC_DEFINE(_ALIGNMENT_REQUIRED,1,[Required alignment])
2715 +                               AC_DEFINE(_MAX_ALIGNMENT,4,[Maximum alignment])
2716 +                               ;;
2717 +                       *11*)
2718 +                               CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_POSIX_SOURCE -D_LARGEFILE64_SOURCE -D_ALIGNMENT_REQUIRED=1 -D_MAX_ALIGNMENT=4 -DMAX_POSITIVE_LOCK_OFFSET=0x1ffffffffffLL"
2719 +                               AC_DEFINE(USE_BOTH_CRYPT_CALLS, 1, [Whether to use both of HPUX' crypt calls])
2720 +                               AC_DEFINE(_HPUX_SOURCE, 1, [Whether to use HPUX extensions])
2721 +                               AC_DEFINE(_POSIX_SOURCE, 1, [Whether to use POSIX compatible functions])
2722 +                               AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to use large file support])
2723 +                               AC_DEFINE(_ALIGNMENT_REQUIRED, 1, [Required alignment])
2724 +                               AC_DEFINE(_MAX_ALIGNMENT, 4, [Maximum alignment])
2725 +                               ;;
2726 +      esac
2727 +      DYNEXP="-Wl,-E"
2728 +      ;;
2729 +
2730 +#
2731 +# CRAY Unicos has broken const handling
2732 +       *unicos*)
2733 +         AC_MSG_RESULT([disabling const])
2734 +         CPPFLAGS="$CPPFLAGS -Dconst="
2735 +         ;;
2736 +       
2737 +#
2738 +# AIX4.x doesn't even admit to having large
2739 +# files *at all* unless the -D_LARGE_FILE or -D_LARGE_FILE_API flags are set.
2740 +#
2741 +    *aix4*)
2742 +         AC_MSG_RESULT([enabling large file support])
2743 +      CPPFLAGS="$CPPFLAGS -D_LARGE_FILES"
2744 +         AC_DEFINE(_LARGE_FILES, 1, [Whether to enable large file support])
2745 +      ;;    
2746 +#
2747 +# Defines needed for Solaris 2.6/2.7 aka 7.0 to make it admit
2748 +# to the existance of large files..
2749 +# Note that -D_LARGEFILE64_SOURCE is different from the Sun
2750 +# recommendations on large file support, however it makes the
2751 +# compile work using gcc 2.7 and 2.8, whereas using the Sun
2752 +# recommendation makes the compile fail on gcc2.7. JRA.
2753 +#
2754 +# Solaris uses SYSV printing.  Make sure to set that here.  --jerry
2755 +#
2756 +       *solaris*)
2757 +               AC_DEFINE(SYSV, 1, [Whether to enable System V compatibility])
2758 +               case `uname -r` in
2759 +                       5.0*|5.1*|5.2*|5.3*|5.5*)
2760 +                               AC_MSG_RESULT([no large file support])
2761 +                               ;;
2762 +                       5.*)
2763 +                       AC_MSG_RESULT([enabling large file support])
2764 +                       if test "$ac_cv_prog_gcc" = yes; then
2765 +                               ${CC-cc} -v >conftest.c 2>&1
2766 +                               ac_cv_gcc_compiler_version_number=`grep 'gcc version' conftest.c`
2767 +                               rm -fr conftest.c
2768 +                               case "$ac_cv_gcc_compiler_version_number" in
2769 +                                       *"gcc version 2.6"*|*"gcc version 2.7"*)
2770 +                                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
2771 +                                               AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
2772 +                                               ;;
2773 +                                       *)
2774 +                                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
2775 +                                               AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
2776 +                                               AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
2777 +                                               ;;
2778 +                               esac
2779 +                       else
2780 +                               CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
2781 +                               AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
2782 +                               AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
2783 +                       fi
2784 +                       ;;
2785 +               esac
2786 +               ;;
2787 +#
2788 +# IRIX uses SYSV printing.  Make sure to set that here
2789 +#
2790 +       *irix*)
2791 +               AC_DEFINE(SYSV, 1, [Whether to enable System V compatibility])
2792 +               ;;
2793 +       *freebsd*)
2794 +               AC_DEFINE(FREEBSD, 1, [Whether the host os is FreeBSD])
2795 +               ;;
2796 +#
2797 +# VOS may need to have POSIX support and System V compatibility enabled.
2798 +#
2799 +    *vos*)
2800 +    case "$CPPFLAGS" in
2801 +         *-D_POSIX_C_SOURCE*)
2802 +               ;;
2803 +         *)
2804 +               CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=199506L"
2805 +               AC_DEFINE(_POSIX_C_SOURCE, 199506L, [Whether to enable POSIX support])
2806 +               ;;
2807 +    esac
2808 +    case "$CPPFLAGS" in
2809 +         *-D_SYSV*|*-D_SVID_SOURCE*)
2810 +               ;;
2811 +         *)
2812 +               CPPFLAGS="$CPPFLAGS -D_SYSV"
2813 +               AC_DEFINE(_SYSV, 1, [Whether to enable System V compatibility])
2814 +    esac
2815 +    ;;
2816 +#
2817 +# Tests needed for SINIX large file support.
2818 +#
2819 +    *sysv4*)
2820 +      if test $host = mips-sni-sysv4 ; then
2821 +        AC_MSG_CHECKING([for LFS support])
2822 +        old_CPPFLAGS="$CPPFLAGS"
2823 +        CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
2824 +        AC_TRY_RUN([
2825 +#include <unistd.h>
2826 +main () {
2827 +#if _LFS64_LARGEFILE == 1
2828 +exit(0);
2829 +#else
2830 +exit(1);
2831 +#endif
2832 +}], [SINIX_LFS_SUPPORT=yes], [SINIX_LFS_SUPPORT=no], [SINIX_LFS_SUPPORT=cross])
2833 +        CPPFLAGS="$old_CPPFLAGS"
2834 +        if test x$SINIX_LFS_SUPPORT = xyes ; then
2835 +          CPPFLAGS="-D_LARGEFILE64_SOURCE $CPPFLAGS"
2836 +                 AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
2837 +          CFLAGS="`getconf LFS64_CFLAGS` $CFLAGS"
2838 +          LDFLAGS="`getconf LFS64_LDFLAGS` $LDFLAGS"
2839 +          LIBS="`getconf LFS64_LIBS` $LIBS"
2840 +        fi
2841 +      AC_MSG_RESULT([$SINIX_LFS_SUPPORT])
2842 +      fi
2843 +    ;;
2844 +
2845 +# Tests for linux LFS support. Need kernel 2.4 and glibc2.2 or greater support.
2846 +#
2847 +    *linux*)
2848 +        AC_MSG_CHECKING([for LFS support])
2849 +        old_CPPFLAGS="$CPPFLAGS"
2850 +        CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
2851 +       AC_TRY_RUN([
2852 +#include <unistd.h>
2853 +#include <sys/utsname.h>
2854 +main() {
2855 +#if _LFS64_LARGEFILE == 1
2856 +       struct utsname uts;
2857 +       char *release;
2858 +       int major, minor;
2859 +
2860 +       /* Ensure this is glibc 2.2 or higher */
2861 +#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
2862 +       int libc_major = __GLIBC__;
2863 +       int libc_minor = __GLIBC_MINOR__;
2864 +
2865 +       if (libc_major < 2)
2866 +              exit(1);
2867 +       if (libc_minor < 2)
2868 +              exit(1);
2869 +#endif
2870 +
2871 +       /* Ensure this is kernel 2.4 or higher */
2872 +
2873 +       uname(&uts);
2874 +       release = strdup(uts.release);
2875 +       major = atoi(strsep(&release, "."));
2876 +       minor = atoi(strsep(&release, "."));
2877 +
2878 +       if (major > 2 || (major == 2 && minor > 3))
2879 +               exit(0);
2880 +       exit(1);
2881 +#else
2882 +       exit(1);
2883 +#endif
2884 +}
2885 +], [LINUX_LFS_SUPPORT=yes], [LINUX_LFS_SUPPORT=no], [LINUX_LFS_SUPPORT=cross])
2886 +       CPPFLAGS="$old_CPPFLAGS"
2887 +       if test x$LINUX_LFS_SUPPORT = xyes ; then
2888 +               CPPFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $CPPFLAGS"
2889 +               AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
2890 +               AC_DEFINE(_FILE_OFFSET_BITS, 64, [File offset bits])
2891 +               AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
2892 +       fi
2893 +       AC_MSG_RESULT([$LINUX_LFS_SUPPORT])
2894 +       ;;
2895 +
2896 +#
2897 +# MacOS X is the *only* system that uses compose character in utf8. This
2898 +# is so horribly broken....
2899 +#
2900 +    *darwin*)
2901 +               AC_DEFINE(BROKEN_UNICODE_COMPOSE_CHARACTERS, 1, [Does this system use unicode compose characters])
2902 +# Add Fink directories for various packages, like dlcompat.
2903 +# Note: iconv does that explicitly below, but other packages
2904 +# don't.
2905 +               CPPFLAGS="$CPPFLAGS -I/sw/include"
2906 +               LDFLAGS="$LDFLAGS -L/sw/lib"
2907 +
2908 +# If we have dlsym_prepend_underscore (from Fink's dlcompat),
2909 +# use that instead of plain dlsym.
2910 +
2911 +               AC_CHECK_LIB(dl,dlopen)
2912 +               AC_CHECK_FUNCS(dlsym_prepend_underscore,[CPPFLAGS="$CPPFLAGS -Ddlsym=dlsym_prepend_underscore"])
2913 +
2914 +#Add a system specific charset module.
2915 +
2916 +               default_shared_modules="$default_shared_modules charset_macosxfs"
2917 +               old_CPPFLAGS="$CPPFLAGS"
2918 +               CPPFLAGS="-Iinclude $CPPFLAGS" 
2919 +               AC_CHECK_HEADERS([CoreFoundation/CFStringEncodingConverter.h], [], [AC_CHECK_HEADERS([CFStringEncodingConverter.h])])
2920 +               CPPFLAGS="$old_CPPFLAGS"
2921 +               ;;
2922 +    *hurd*)
2923 +        AC_MSG_CHECKING([for LFS support])
2924 +        old_CPPFLAGS="$CPPFLAGS"
2925 +        CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
2926 +        AC_TRY_RUN([
2927 +#include <unistd.h>
2928 +main () {
2929 +#if _LFS64_LARGEFILE == 1
2930 +exit(0);
2931 +#else
2932 +exit(1);
2933 +#endif
2934 +}], [GLIBC_LFS_SUPPORT=yes], [GLIBC_LFS_SUPPORT=no], [GLIBC_LFS_SUPPORT=cross])
2935 +        CPPFLAGS="$old_CPPFLAGS"
2936 +        if test x$GLIBC_LFS_SUPPORT = xyes ; then
2937 +          CPPFLAGS="-D_LARGEFILE64_SOURCE -D_GNU_SOURCE $CPPFLAGS"
2938 +                 AC_DEFINE(_LARGEFILE64_SOURCE, 1, [Whether to enable large file support])
2939 +          AC_DEFINE(_GNU_SOURCE, 1, [Whether to use GNU libc extensions])
2940 +        fi
2941 +      AC_MSG_RESULT([$GLIBC_LFS_SUPPORT])
2942 +    ;;
2943 +
2944 +esac
2945 +
2946 +AC_INLINE
2947 +AC_HEADER_STDC
2948 +AC_HEADER_DIRENT
2949 +AC_HEADER_TIME
2950 +AC_HEADER_SYS_WAIT
2951 +AC_CHECK_HEADERS(arpa/inet.h sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h)
2952 +AC_CHECK_HEADERS(unistd.h utime.h grp.h sys/id.h limits.h memory.h net/if.h)
2953 +AC_CHECK_HEADERS(rpc/rpc.h rpcsvc/nis.h rpcsvc/yp_prot.h rpcsvc/ypclnt.h)
2954 +AC_CHECK_HEADERS(sys/param.h ctype.h sys/wait.h sys/resource.h sys/ioctl.h sys/ipc.h sys/mode.h)
2955 +AC_CHECK_HEADERS(sys/mman.h sys/filio.h sys/priv.h sys/shm.h string.h strings.h stdlib.h sys/socket.h)
2956 +AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs/s5param.h sys/filsys.h termios.h termio.h)
2957 +AC_CHECK_HEADERS(sys/termio.h sys/statfs.h sys/dustat.h sys/statvfs.h stdarg.h sys/sockio.h)
2958 +AC_CHECK_HEADERS(security/pam_modules.h security/_pam_macros.h dlfcn.h)
2959 +AC_CHECK_HEADERS(sys/syslog.h syslog.h execinfo.h)
2960 +AC_CHECK_HEADERS(langinfo.h locale.h)
2961 +
2962 +# In valgrind 1.0.x, it's just valgrind.h.  In 1.9.x+ there's a
2963 +# subdirectory of headers.
2964 +AC_CHECK_HEADERS(valgrind.h valgrind/valgrind.h valgrind/memcheck.h)
2965 +
2966 +#
2967 +# HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
2968 +# This causes configure to fail to detect it. Check for shadow separately on HPUX.
2969 +#
2970 +case "$host_os" in
2971 +    *hpux*)
2972 +               AC_TRY_COMPILE([#include <shadow.h>],[struct spwd testme],
2973 +                       ac_cv_header_shadow_h=yes,ac_cv_header_shadow_h=no)
2974 +               if test x"$ac_cv_header_shadow_h" = x"yes"; then
2975 +                  AC_DEFINE(HAVE_SHADOW_H,1,[Whether we have shadow.h])
2976 +               fi
2977 +       ;;
2978 +esac
2979 +AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
2980 +AC_CHECK_HEADERS(nss.h nss_common.h nsswitch.h ns_api.h sys/security.h security/pam_appl.h security/pam_modules.h)
2981 +AC_CHECK_HEADERS(stropts.h poll.h)
2982 +AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
2983 +AC_CHECK_HEADERS(sys/acl.h sys/attributes.h attr/xattr.h sys/cdefs.h glob.h)
2984 +
2985 +# For experimental utmp support (lastlog on some BSD-like systems)
2986 +AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h)
2987
2988 +AC_CHECK_SIZEOF(int,cross)
2989 +AC_CHECK_SIZEOF(long,cross)
2990 +AC_CHECK_SIZEOF(short,cross)
2991 +
2992 +AC_C_CONST
2993 +AC_C_INLINE
2994 +AC_C_BIGENDIAN
2995 +AC_C_CHAR_UNSIGNED
2996 +
2997 +AC_TYPE_SIGNAL
2998 +AC_TYPE_UID_T
2999 +AC_TYPE_MODE_T
3000 +AC_TYPE_OFF_T
3001 +AC_TYPE_SIZE_T
3002 +AC_TYPE_PID_T
3003 +AC_STRUCT_ST_RDEV
3004 +AC_DIRENT_D_OFF
3005 +AC_CHECK_TYPE(ino_t,unsigned)
3006 +AC_CHECK_TYPE(loff_t,off_t)
3007 +AC_CHECK_TYPE(offset_t,loff_t)
3008 +AC_CHECK_TYPE(ssize_t, int)
3009 +AC_CHECK_TYPE(wchar_t, unsigned short)
3010 +
3011 +############################################
3012 +# for cups support we need libcups, and a handful of header files
3013 +
3014 +AC_ARG_ENABLE(cups,
3015 +[  --enable-cups           Turn on CUPS support (default=auto)])
3016 +
3017 +if test x$enable_cups != xno; then
3018 +       AC_PATH_PROG(CUPS_CONFIG, cups-config)
3019 +
3020 +        if test "x$CUPS_CONFIG" != x; then
3021 +                        AC_DEFINE(HAVE_CUPS,1,[Whether we have CUPS])
3022 +               CFLAGS="$CFLAGS `$CUPS_CONFIG --cflags`"
3023 +               LDFLAGS="$LDFLAGS `$CUPS_CONFIG --ldflags`"
3024 +               PRINT_LIBS="$PRINT_LIBS `$CUPS_CONFIG --libs`"
3025 +        fi
3026 +fi
3027 +
3028 +############################################
3029 +# we need dlopen/dlclose/dlsym/dlerror for PAM, the password database plugins and the plugin loading code
3030 +AC_SEARCH_LIBS(dlopen, [dl])
3031 +# dlopen/dlclose/dlsym/dlerror will be checked again later and defines will be set then
3032 +
3033 +############################################
3034 +# check if the compiler can do immediate structures
3035 +AC_CACHE_CHECK([for immediate structures],samba_cv_immediate_structures, [
3036 +    AC_TRY_COMPILE([
3037 +#include <stdio.h>],
3038 +[
3039 +   typedef struct {unsigned x;} FOOBAR;
3040 +   #define X_FOOBAR(x) ((FOOBAR) { x })
3041 +   #define FOO_ONE X_FOOBAR(1)
3042 +   FOOBAR f = FOO_ONE;   
3043 +   static struct {
3044 +       FOOBAR y; 
3045 +       } f2[] = {
3046 +               {FOO_ONE}
3047 +       };   
3048 +],
3049 +       samba_cv_immediate_structures=yes,samba_cv_immediate_structures=no)])
3050 +if test x"$samba_cv_immediate_structures" = x"yes"; then
3051 +   AC_DEFINE(HAVE_IMMEDIATE_STRUCTURES,1,[Whether the compiler supports immediate structures])
3052 +fi
3053 +
3054 +############################################
3055 +# check if the compiler can do immediate structures
3056 +AC_CACHE_CHECK([if the compiler will optimize out function calls],samba_cv_optimize_out_funcation_calls, [
3057 +    AC_TRY_LINK([
3058 +#include <stdio.h>],
3059 +[
3060 +               if (0) {
3061 +                  this_function_does_not_exist();
3062 +               } else {
3063 +                 return 1;
3064 +               }
3065 +
3066 +],
3067 +       samba_cv_optimize_out_funcation_calls=yes,samba_cv_optimize_out_funcation_calls=no)])
3068 +if test x"$samba_cv_optimize_out_funcation_calls" = x"yes"; then
3069 +   AC_DEFINE(HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS,1,[Whether the compiler will optimize out function calls])
3070 +fi
3071 +
3072 +############################################
3073 +# check for unix domain sockets
3074 +AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [
3075 +    AC_TRY_COMPILE([
3076 +#include <sys/types.h>
3077 +#include <stdlib.h>
3078 +#include <stddef.h>
3079 +#include <sys/socket.h>
3080 +#include <sys/un.h>],
3081 +[
3082 +  struct sockaddr_un sunaddr; 
3083 +  sunaddr.sun_family = AF_UNIX;
3084 +],
3085 +       samba_cv_unixsocket=yes,samba_cv_unixsocket=no)])
3086 +if test x"$samba_cv_unixsocket" = x"yes"; then
3087 +   AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixscoket support])
3088 +fi
3089 +
3090 +
3091 +AC_CACHE_CHECK([for socklen_t type],samba_cv_socklen_t, [
3092 +    AC_TRY_COMPILE([
3093 +#include <sys/types.h>
3094 +#if STDC_HEADERS
3095 +#include <stdlib.h>
3096 +#include <stddef.h>
3097 +#endif
3098 +#include <sys/socket.h>],[socklen_t i = 0],
3099 +       samba_cv_socklen_t=yes,samba_cv_socklen_t=no)])
3100 +if test x"$samba_cv_socklen_t" = x"yes"; then
3101 +   AC_DEFINE(HAVE_SOCKLEN_T_TYPE,1,[Whether we have the variable type socklen_t])
3102 +fi
3103 +
3104 +AC_CACHE_CHECK([for sig_atomic_t type],samba_cv_sig_atomic_t, [
3105 +    AC_TRY_COMPILE([
3106 +#include <sys/types.h>
3107 +#if STDC_HEADERS
3108 +#include <stdlib.h>
3109 +#include <stddef.h>
3110 +#endif
3111 +#include <signal.h>],[sig_atomic_t i = 0],
3112 +       samba_cv_sig_atomic_t=yes,samba_cv_sig_atomic_t=no)])
3113 +if test x"$samba_cv_sig_atomic_t" = x"yes"; then
3114 +   AC_DEFINE(HAVE_SIG_ATOMIC_T_TYPE,1,[Whether we have the atomic_t variable type])
3115 +fi
3116 +
3117 +# stupid headers have the functions but no declaration. grrrr.
3118 +AC_HAVE_DECL(errno, [#include <errno.h>])
3119 +AC_HAVE_DECL(setresuid, [#include <unistd.h>])
3120 +AC_HAVE_DECL(setresgid, [#include <unistd.h>])
3121 +AC_HAVE_DECL(asprintf, [#include <stdio.h>])
3122 +AC_HAVE_DECL(vasprintf, [#include <stdio.h>])
3123 +AC_HAVE_DECL(vsnprintf, [#include <stdio.h>])
3124 +AC_HAVE_DECL(snprintf, [#include <stdio.h>])
3125 +
3126 +# and glibc has setresuid under linux but the function does
3127 +# nothing until kernel 2.1.44! very dumb.
3128 +AC_CACHE_CHECK([for real setresuid],samba_cv_have_setresuid,[
3129 +    AC_TRY_RUN([#include <errno.h>
3130 +main() { setresuid(1,1,1); setresuid(2,2,2); exit(errno==EPERM?0:1);}],
3131 +       samba_cv_have_setresuid=yes,samba_cv_have_setresuid=no,samba_cv_have_setresuid=cross)])
3132 +if test x"$samba_cv_have_setresuid" = x"yes"; then
3133 +    AC_DEFINE(HAVE_SETRESUID,1,[Whether the system has setresuid])
3134 +fi
3135 +
3136 +# Do the same check for setresguid...
3137 +#
3138 +AC_CACHE_CHECK([for real setresgid],samba_cv_have_setresgid,[
3139 +    AC_TRY_RUN([#include <unistd.h>
3140 +#include <errno.h>
3141 +main() { errno = 0; setresgid(1,1,1); exit(errno != 0 ? (errno==EPERM ? 0 : 1) : 0);}],
3142 +       samba_cv_have_setresgid=yes,samba_cv_have_setresgid=no,samba_cv_have_setresgid=cross)])
3143 +if test x"$samba_cv_have_setresgid" = x"yes"; then
3144 +    AC_DEFINE(HAVE_SETRESGID,1,[Whether the system has setresgid])
3145 +fi
3146 +
3147 +AC_FUNC_MEMCMP
3148 +
3149 +###############################################
3150 +# Readline included by default unless explicitly asked not to
3151 +test "${with_readline+set}" != "set" && with_readline=yes
3152 +
3153 +# test for where we get readline() from
3154 +AC_MSG_CHECKING(whether to use readline)
3155 +AC_ARG_WITH(readline,
3156 +[  --with-readline[=DIR]     Look for readline include/libs in DIR (default=auto) ],
3157 +[  case "$with_readline" in
3158 +  yes)
3159 +    AC_MSG_RESULT(yes)
3160 +
3161 +    AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
3162 +    AC_CHECK_HEADERS(readline/history.h)
3163 +
3164 +    AC_CHECK_HEADERS(readline.h readline/readline.h,[
3165 +      for termlib in ncurses curses termcap terminfo termlib tinfo; do
3166 +       AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
3167 +      done
3168 +      AC_CHECK_LIB(readline, rl_callback_handler_install,
3169 +       [TERMLIBS="-lreadline $TERMLIBS"
3170 +       AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline])
3171 +       break], [TERMLIBS=], $TERMLIBS)])
3172 +    ;;
3173 +  no)
3174 +    AC_MSG_RESULT(no)
3175 +    ;;
3176 +  *)
3177 +    AC_MSG_RESULT(yes)
3178 +
3179 +    # Needed for AC_CHECK_HEADERS and AC_CHECK_LIB to look at
3180 +    # alternate readline path
3181 +    _ldflags=${LDFLAGS}
3182 +    _cppflags=${CPPFLAGS}
3183 +
3184 +    # Add additional search path
3185 +    LDFLAGS="-L$with_readline/lib $LDFLAGS"
3186 +    CPPFLAGS="-I$with_readline/include $CPPFLAGS"
3187 +
3188 +    AC_CHECK_HEADERS(readline.h history.h readline/readline.h)
3189 +    AC_CHECK_HEADERS(readline/history.h)
3190 +
3191 +    AC_CHECK_HEADERS(readline.h readline/readline.h,[
3192 +      for termlib in ncurses curses termcap terminfo termlib; do
3193 +       AC_CHECK_LIB(${termlib}, tgetent, [TERMLIBS="-l${termlib}"; break])
3194 +      done
3195 +      AC_CHECK_LIB(readline, rl_callback_handler_install,
3196 +       [TERMLDFLAGS="-L$with_readline/lib"
3197 +       TERMCPPFLAGS="-I$with_readline/include"
3198 +       CPPFLAGS="-I$with_readline/include $CPPFLAGS"
3199 +       TERMLIBS="-lreadline $TERMLIBS"
3200 +       AC_DEFINE(HAVE_LIBREADLINE,1,[Whether the system has readline])
3201 +       break], [TERMLIBS= CPPFLAGS=$_cppflags], $TERMLIBS)])
3202 +
3203 +    LDFLAGS=$_ldflags
3204 +    ;;
3205 +  esac],
3206 +  AC_MSG_RESULT(no)
3207 +)
3208 +AC_SUBST(TERMLIBS)
3209 +AC_SUBST(TERMLDFLAGS)
3210 +
3211 +# The readline API changed slightly from readline3 to readline4, so
3212 +# code will generate warnings on one of them unless we have a few
3213 +# special cases.
3214 +AC_CHECK_LIB(readline, rl_completion_matches,
3215 +            [AC_DEFINE(HAVE_NEW_LIBREADLINE, 1, 
3216 +                       [Do we have rl_completion_matches?])],
3217 +            [],
3218 +            [$TERMLIBS])
3219 +
3220 +# The following test taken from the cvs sources
3221 +# If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
3222 +# The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has
3223 +# libsocket.so which has a bad implementation of gethostbyname (it
3224 +# only looks in /etc/hosts), so we only look for -lsocket if we need
3225 +# it.
3226 +AC_CHECK_FUNCS(connect)
3227 +if test x"$ac_cv_func_connect" = x"no"; then
3228 +    case "$LIBS" in
3229 +    *-lnsl*) ;;
3230 +    *) AC_CHECK_LIB(nsl_s, printf) ;;
3231 +    esac
3232 +    case "$LIBS" in
3233 +    *-lnsl*) ;;
3234 +    *) AC_CHECK_LIB(nsl, printf) ;;
3235 +    esac
3236 +    case "$LIBS" in
3237 +    *-lsocket*) ;;
3238 +    *) AC_CHECK_LIB(socket, connect) ;;
3239 +    esac
3240 +    case "$LIBS" in
3241 +    *-linet*) ;;
3242 +    *) AC_CHECK_LIB(inet, connect) ;;
3243 +    esac
3244 +    dnl We can't just call AC_CHECK_FUNCS(connect) here, because the value
3245 +    dnl has been cached.
3246 +    if test x"$ac_cv_lib_socket_connect" = x"yes" || 
3247 +       test x"$ac_cv_lib_inet_connect" = x"yes"; then
3248 +        # ac_cv_func_connect=yes
3249 +        # don't!  it would cause AC_CHECK_FUNC to succeed next time configure is run
3250 +        AC_DEFINE(HAVE_CONNECT,1,[Whether the system has connect()])
3251 +    fi
3252 +fi
3253 +
3254 +###############################################
3255 +# test for where we get yp_get_default_domain() from
3256 +AC_SEARCH_LIBS(yp_get_default_domain, [nsl])
3257 +AC_CHECK_FUNCS(yp_get_default_domain)
3258 +
3259 +# Check if we have execl, if not we need to compile smbrun.
3260 +AC_CHECK_FUNCS(execl)
3261 +if test x"$ac_cv_func_execl" = x"no"; then
3262 +    EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbrun\$(EXEEXT)"
3263 +fi
3264 +
3265 +AC_CHECK_FUNCS(dlopen dlclose dlsym dlerror waitpid getcwd strdup strndup strnlen strtoul strerror chown fchown chmod fchmod chroot link mknod mknod64)
3266 +AC_CHECK_FUNCS(fstat strchr utime utimes getrlimit fsync bzero memset strlcpy strlcat setpgid)
3267 +AC_CHECK_FUNCS(memmove vsnprintf snprintf asprintf vasprintf setsid glob strpbrk pipe crypt16 getauthuid)
3268 +AC_CHECK_FUNCS(strftime sigprocmask sigblock sigaction sigset innetgr setnetgrent getnetgrent endnetgrent)
3269 +AC_CHECK_FUNCS(initgroups select poll rdchk getgrnam getgrent pathconf realpath)
3270 +AC_CHECK_FUNCS(setpriv setgidx setuidx setgroups sysconf mktime rename ftruncate stat64 fstat64)
3271 +AC_CHECK_FUNCS(lstat64 fopen64 atexit grantpt dup2 lseek64 ftruncate64 readdir64)
3272 +AC_CHECK_FUNCS(fseek64 fseeko64 ftell64 ftello64 setluid getpwanam setlinebuf)
3273 +AC_CHECK_FUNCS(srandom random srand rand setenv usleep strcasecmp fcvt fcvtl symlink readlink)
3274 +AC_CHECK_FUNCS(syslog vsyslog timegm)
3275 +AC_CHECK_FUNCS(setlocale nl_langinfo)
3276 +# setbuffer, shmget, shm_open are needed for smbtorture
3277 +AC_CHECK_FUNCS(setbuffer shmget shm_open backtrace_symbols)
3278 +
3279 +# syscall() is needed for smbwrapper.
3280 +AC_CHECK_FUNCS(syscall)
3281 +
3282 +AC_CHECK_FUNCS(_dup _dup2 _opendir _readdir _seekdir _telldir _closedir)
3283 +AC_CHECK_FUNCS(__dup __dup2 __opendir __readdir __seekdir __telldir __closedir)
3284 +AC_CHECK_FUNCS(__getcwd _getcwd)
3285 +AC_CHECK_FUNCS(__xstat __fxstat __lxstat)
3286 +AC_CHECK_FUNCS(_stat _lstat _fstat __stat __lstat __fstat)
3287 +AC_CHECK_FUNCS(_acl __acl _facl __facl _open __open _chdir __chdir)
3288 +AC_CHECK_FUNCS(_close __close _fchdir __fchdir _fcntl __fcntl)
3289 +AC_CHECK_FUNCS(getdents _getdents __getdents _lseek __lseek _read __read)
3290 +AC_CHECK_FUNCS(getdirentries _write __write _fork __fork)
3291 +AC_CHECK_FUNCS(_stat64 __stat64 _fstat64 __fstat64 _lstat64 __lstat64)
3292 +AC_CHECK_FUNCS(__sys_llseek llseek _llseek __llseek readdir64 _readdir64 __readdir64)
3293 +AC_CHECK_FUNCS(pread _pread __pread pread64 _pread64 __pread64)
3294 +AC_CHECK_FUNCS(pwrite _pwrite __pwrite pwrite64 _pwrite64 __pwrite64)
3295 +AC_CHECK_FUNCS(open64 _open64 __open64 creat64)
3296 +
3297 +#
3298 +# 
3299 +#
3300 +case "$host_os" in
3301 +    *linux*)
3302 +       # glibc <= 2.3.2 has a broken getgrouplist
3303 +       AC_TRY_RUN([
3304 +#include <unistd.h>
3305 +#include <sys/utsname.h>
3306 +main() {
3307 +       /* glibc up to 2.3 has a broken getgrouplist */
3308 +#if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
3309 +       int libc_major = __GLIBC__;
3310 +       int libc_minor = __GLIBC_MINOR__;
3311 +
3312 +       if (libc_major < 2)
3313 +              exit(1);
3314 +       if ((libc_major == 2) && (libc_minor <= 3))
3315 +              exit(1);
3316 +#endif
3317 +       exit(0);
3318 +}
3319 +], [linux_getgrouplist_ok=yes], [linux_getgrouplist_ok=no])
3320 +       if test x"$linux_getgrouplist_ok" = x"yes"; then
3321 +          AC_DEFINE(HAVE_GETGROUPLIST, 1, [Have good getgrouplist])
3322 +       fi
3323 +       ;;
3324 +    *)
3325 +       AC_CHECK_FUNCS(getgrouplist)
3326 +       ;;
3327 +esac
3328 +
3329 +#
3330 +# stat64 family may need <sys/stat.h> on some systems, notably ReliantUNIX
3331 +#
3332 +
3333 +if test x$ac_cv_func_stat64 = xno ; then
3334 +  AC_MSG_CHECKING([for stat64 in <sys/stat.h>])
3335 +  AC_TRY_LINK([
3336 +#if defined(HAVE_UNISTD_H)
3337 +#include <unistd.h>
3338 +#endif
3339 +#include <sys/stat.h>
3340 +], [struct stat64 st64; exit(stat64(".",&st64));], [ac_cv_func_stat64=yes])
3341 +  AC_MSG_RESULT([$ac_cv_func_stat64])
3342 +  if test x$ac_cv_func_stat64 = xyes ; then
3343 +    AC_DEFINE(HAVE_STAT64,1,[Whether stat64() is available])
3344 +  fi
3345 +fi
3346 +
3347 +if test x$ac_cv_func_lstat64 = xno ; then
3348 +  AC_MSG_CHECKING([for lstat64 in <sys/stat.h>])
3349 +  AC_TRY_LINK([
3350 +#if defined(HAVE_UNISTD_H)
3351 +#include <unistd.h>
3352 +#endif
3353 +#include <sys/stat.h>
3354 +], [struct stat64 st64; exit(lstat64(".",&st64));], [ac_cv_func_lstat64=yes])
3355 +  AC_MSG_RESULT([$ac_cv_func_lstat64])
3356 +  if test x$ac_cv_func_lstat64 = xyes ; then
3357 +    AC_DEFINE(HAVE_LSTAT64,[Whether lstat64() is available])
3358 +  fi
3359 +fi
3360 +
3361 +if test x$ac_cv_func_fstat64 = xno ; then
3362 +  AC_MSG_CHECKING([for fstat64 in <sys/stat.h>])
3363 +  AC_TRY_LINK([
3364 +#if defined(HAVE_UNISTD_H)
3365 +#include <unistd.h>
3366 +#endif
3367 +#include <sys/stat.h>
3368 +], [struct stat64 st64; exit(fstat64(0,&st64));], [ac_cv_func_fstat64=yes])
3369 +  AC_MSG_RESULT([$ac_cv_func_fstat64])
3370 +  if test x$ac_cv_func_fstat64 = xyes ; then
3371 +    AC_DEFINE(HAVE_FSTAT64,1,[Whether fstat64() is available])
3372 +  fi
3373 +fi
3374 +
3375 +#####################################
3376 +# we might need the resolv library on some systems
3377 +AC_CHECK_LIB(resolv, dn_expand)
3378 +
3379 +#
3380 +# Check for the functions putprpwnam, set_auth_parameters,
3381 +# getspnam, bigcrypt and getprpwnam in -lsec and -lsecurity
3382 +# Needed for OSF1 and HPUX.
3383 +#
3384 +
3385 +AC_LIBTESTFUNC(security, putprpwnam)
3386 +AC_LIBTESTFUNC(sec, putprpwnam)
3387 +
3388 +AC_LIBTESTFUNC(security, set_auth_parameters)
3389 +AC_LIBTESTFUNC(sec, set_auth_parameters)
3390 +
3391 +# UnixWare 7.x has its getspnam in -lgen
3392 +AC_LIBTESTFUNC(gen, getspnam)
3393 +
3394 +AC_LIBTESTFUNC(security, getspnam)
3395 +AC_LIBTESTFUNC(sec, getspnam)
3396 +
3397 +AC_LIBTESTFUNC(security, bigcrypt)
3398 +AC_LIBTESTFUNC(sec, bigcrypt)
3399 +
3400 +AC_LIBTESTFUNC(security, getprpwnam)
3401 +AC_LIBTESTFUNC(sec, getprpwnam)
3402 +
3403 +############################################
3404 +# Check if we have libattr
3405 +AC_SEARCH_LIBS(getxattr, [attr])
3406 +AC_CHECK_FUNCS(getxattr lgetxattr fgetxattr listxattr llistxattr)
3407 +AC_CHECK_FUNCS(flistxattr removexattr lremovexattr fremovexattr)
3408 +AC_CHECK_FUNCS(setxattr lsetxattr fsetxattr)
3409 +AC_CHECK_FUNCS(attr_get attr_list attr_set attr_remove)
3410 +AC_CHECK_FUNCS(attr_getf attr_listf attr_setf attr_removef)
3411 +
3412 +# Assume non-shared by default and override below
3413 +BLDSHARED="false"
3414 +
3415 +# these are the defaults, good for lots of systems
3416 +HOST_OS="$host_os"
3417 +LDSHFLAGS="-shared"
3418 +SONAMEFLAG="#"
3419 +SHLD="\${CC} \${CFLAGS}"
3420 +PICFLAGS=""
3421 +PICSUFFIX="po"
3422 +POBAD_CC="#"
3423 +SHLIBEXT="so"
3424 +
3425 +if test "$enable_shared" = "yes"; then
3426 +  # this bit needs to be modified for each OS that is suported by
3427 +  # smbwrapper. You need to specify how to created a shared library and
3428 +  # how to compile C code to produce PIC object files
3429 +
3430 +  AC_MSG_CHECKING([ability to build shared libraries])
3431 +
3432 +  # and these are for particular systems
3433 +  case "$host_os" in
3434 +               *linux*)   AC_DEFINE(LINUX,1,[Whether the host os is linux])
3435 +                       BLDSHARED="true"
3436 +                       LDSHFLAGS="-shared" 
3437 +                       DYNEXP="-Wl,--export-dynamic"
3438 +                       PICFLAGS="-fPIC"
3439 +                       SONAMEFLAG="-Wl,-soname="
3440 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
3441 +                       ;;
3442 +               *solaris*) AC_DEFINE(SUNOS5,1,[Whether the host os is solaris])
3443 +                       BLDSHARED="true"
3444 +                       LDSHFLAGS="-G"
3445 +                       SONAMEFLAG="-h "
3446 +                       if test "${GCC}" = "yes"; then
3447 +                               PICFLAGS="-fPIC"
3448 +                               if test "${ac_cv_prog_gnu_ld}" = "yes"; then
3449 +                                       DYNEXP="-Wl,-E"
3450 +                               fi
3451 +                       else
3452 +                               PICFLAGS="-KPIC"
3453 +                               ## ${CFLAGS} added for building 64-bit shared 
3454 +                               ## libs using Sun's Compiler
3455 +                               LDSHFLAGS="-G \${CFLAGS}"
3456 +                               POBAD_CC=""
3457 +                               PICSUFFIX="po.o"
3458 +                       fi
3459 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
3460 +                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
3461 +                       ;;
3462 +               *sunos*) AC_DEFINE(SUNOS4,1,[Whether the host os is sunos4])
3463 +                       BLDSHARED="true"
3464 +                       LDSHFLAGS="-G"
3465 +                       SONAMEFLAG="-Wl,-h,"
3466 +                       PICFLAGS="-KPIC"   # Is this correct for SunOS
3467 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
3468 +                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
3469 +                       ;;
3470 +               *netbsd* | *freebsd*)  BLDSHARED="true"
3471 +                       LDSHFLAGS="-shared"
3472 +                       DYNEXP="-Wl,--export-dynamic"
3473 +                       SONAMEFLAG="-Wl,-soname,"
3474 +                       PICFLAGS="-fPIC -DPIC"
3475 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
3476 +                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
3477 +                       ;;
3478 +               *openbsd*)  BLDSHARED="true"
3479 +                       LDSHFLAGS="-shared"
3480 +                       DYNEXP="-Wl,-Bdynamic"
3481 +                       SONAMEFLAG="-Wl,-soname,"
3482 +                       PICFLAGS="-fPIC"
3483 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
3484 +                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
3485 +                       ;;
3486 +               *irix*) AC_DEFINE(IRIX,1,[Whether the host os is irix])
3487 +                       case "$host_os" in
3488 +                       *irix6*) AC_DEFINE(IRIX6,1,[Whether the host os is irix6])
3489 +                       ;;
3490 +                       esac
3491 +                       BLDSHARED="true"
3492 +                       LDSHFLAGS="-set_version sgi1.0 -shared"
3493 +                       SONAMEFLAG="-soname "
3494 +                       SHLD="\${LD}"
3495 +                       if test "${GCC}" = "yes"; then
3496 +                               PICFLAGS="-fPIC"
3497 +                       else 
3498 +                               PICFLAGS="-KPIC"
3499 +                       fi
3500 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512,[The size of a block])
3501 +                       ;;
3502 +               *aix*) AC_DEFINE(AIX,1,[Whether the host os is aix])
3503 +                       BLDSHARED="true"
3504 +                       LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-bnoentry,-berok"
3505 +                       DYNEXP="-Wl,-brtl,-bexpall"
3506 +                       PICFLAGS="-O2"
3507 +                       if test "${GCC}" != "yes"; then
3508 +                               ## for funky AIX compiler using strncpy()
3509 +                               CFLAGS="$CFLAGS -D_LINUX_SOURCE_COMPAT -qmaxmem=32000"
3510 +                       fi
3511 +
3512 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,DEV_BSIZE,[The size of a block])
3513 +                       ;;
3514 +               *hpux*) AC_DEFINE(HPUX,1,[Whether the host os is HPUX])
3515 +                       SHLIBEXT="sl"
3516 +                       # Use special PIC flags for the native HP-UX compiler.
3517 +                       if test $ac_cv_prog_cc_Ae = yes; then
3518 +                               BLDSHARED="true"
3519 +                               SHLD="/usr/bin/ld"
3520 +                               LDSHFLAGS="-B symbolic -b -z"
3521 +                               SONAMEFLAG="+h "
3522 +                               PICFLAGS="+z"
3523 +                       elif test "${GCC}" = "yes"; then
3524 +                               PICFLAGS="-fPIC"
3525 +                       fi
3526 +                       DYNEXP="-Wl,-E"
3527 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,8192,[The size of a block])
3528 +                       AC_DEFINE(POSIX_ACL_NEEDS_MASK,1,[Does a POSIX ACL need a mask element])
3529 +                       ;;
3530 +               *qnx*) AC_DEFINE(QNX,1,[Whether the host os is qnx])
3531 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
3532 +                       ;;
3533 +               *osf*) AC_DEFINE(OSF1,1,[Whether the host os is osf1])
3534 +                       BLDSHARED="true"
3535 +                       LDSHFLAGS="-shared"
3536 +                       SONAMEFLAG="-Wl,-soname,"
3537 +                       PICFLAGS="-fPIC"
3538 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
3539 +                       AC_DEFINE(BROKEN_GETGRNAM,1,[Does getgrnam work correctly])
3540 +                       ;;
3541 +               *sco*) AC_DEFINE(SCO,1,[Whether the host os is sco unix])
3542 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
3543 +                       ;;
3544 +               *unixware*) AC_DEFINE(UNIXWARE,1,[Whether the host os is unixware])
3545 +                       BLDSHARED="true"
3546 +                       LDSHFLAGS="-shared"
3547 +                       SONAMEFLAG="-Wl,-soname,"
3548 +                       PICFLAGS="-KPIC"
3549 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
3550 +                       ;;
3551 +               *next2*) AC_DEFINE(NEXT2,1,[Whether the host os is NeXT v2])
3552 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
3553 +                       ;;
3554 +               *dgux*) AC_CHECK_PROG( ROFF, groff, [groff -etpsR -Tascii -man])
3555 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
3556 +                       ;;
3557 +               *sysv4*) AC_DEFINE(SYSV,1,[Whether this is a system V system])
3558 +                       case "$host" in
3559 +                               *-univel-*)     if [ test "$GCC" != yes ]; then
3560 +                                               AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available])
3561 +                                       fi
3562 +                                       LDSHFLAGS="-G"
3563 +                                       DYNEXP="-Bexport"
3564 +                               ;;
3565 +                               *mips-sni-sysv4*) AC_DEFINE(RELIANTUNIX,1,[Whether the host os is reliantunix]);;
3566 +                       esac
3567 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
3568 +                       ;;
3569 +
3570 +               *sysv5*) AC_DEFINE(SYSV,1,[Whether this is a system V system])
3571 +                       if [ test "$GCC" != yes ]; then
3572 +                               AC_DEFINE(HAVE_MEMSET,1,[Whether memset() is available])
3573 +                       fi
3574 +                       LDSHFLAGS="-G"
3575 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
3576 +                       ;;
3577 +               *vos*) AC_DEFINE(STAT_ST_BLOCKSIZE,4096)
3578 +                       BLDSHARED="false"
3579 +                       LDSHFLAGS=""
3580 +                       ;;
3581 +
3582 +               *darwin*)   AC_DEFINE(DARWINOS,1,[Whether the host os is Darwin/MacOSX])
3583 +                       BLDSHARED="true"
3584 +                       LDSHFLAGS="-bundle -flat_namespace -undefined suppress"
3585 +                       SHLIBEXT="dylib"
3586 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
3587 +                       ;;
3588 +
3589 +               *)
3590 +                       AC_DEFINE(STAT_ST_BLOCKSIZE,512)
3591 +                       ;;
3592 +  esac
3593 +  AC_SUBST(DYNEXP)
3594 +  AC_MSG_RESULT($BLDSHARED)
3595 +  AC_MSG_CHECKING([linker flags for shared libraries])
3596 +  AC_MSG_RESULT([$LDSHFLAGS])
3597 +  AC_MSG_CHECKING([compiler flags for position-independent code])
3598 +  AC_MSG_RESULT([$PICFLAGS])
3599 +fi
3600 +
3601 +#######################################################
3602 +# test whether building a shared library actually works
3603 +if test $BLDSHARED = true; then
3604 +AC_CACHE_CHECK([whether building shared libraries actually works], 
3605 +               [ac_cv_shlib_works],[
3606 +   ac_cv_shlib_works=no
3607 +   # try building a trivial shared library
3608 +   $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o \
3609 +       shlib.$PICSUFFIX ${srcdir-.}/tests/shlib.c && \
3610 +       $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" \
3611 +       shlib.$PICSUFFIX && \
3612 +       ac_cv_shlib_works=yes
3613 +   rm -f "shlib.$SHLIBEXT" shlib.$PICSUFFIX
3614 +])
3615 +if test $ac_cv_shlib_works = no; then
3616 +   BLDSHARED=false
3617 +fi
3618 +fi
3619 +
3620 +################
3621 +
3622 +AC_CACHE_CHECK([for long long],samba_cv_have_longlong,[
3623 +AC_TRY_RUN([#include <stdio.h>
3624 +main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 1); }],
3625 +samba_cv_have_longlong=yes,samba_cv_have_longlong=no,samba_cv_have_longlong=cross)])
3626 +if test x"$samba_cv_have_longlong" = x"yes"; then
3627 +    AC_DEFINE(HAVE_LONGLONG,1,[Whether the host supports long long's])
3628 +fi
3629 +
3630 +#
3631 +# Check if the compiler supports the LL prefix on long long integers.
3632 +# AIX needs this.
3633 +
3634 +AC_CACHE_CHECK([for LL suffix on long long integers],samba_cv_compiler_supports_ll, [
3635 +    AC_TRY_COMPILE([#include <stdio.h>],[long long i = 0x8000000000LL],
3636 +       samba_cv_compiler_supports_ll=yes,samba_cv_compiler_supports_ll=no)])
3637 +if test x"$samba_cv_compiler_supports_ll" = x"yes"; then
3638 +   AC_DEFINE(COMPILER_SUPPORTS_LL,1,[Whether the compiler supports the LL prefix on long long integers])
3639 +fi
3640 +
3641 +  
3642 +AC_CACHE_CHECK([for 64 bit off_t],samba_cv_SIZEOF_OFF_T,[
3643 +AC_TRY_RUN([#include <stdio.h>
3644 +#include <sys/stat.h>
3645 +main() { exit((sizeof(off_t) == 8) ? 0 : 1); }],
3646 +samba_cv_SIZEOF_OFF_T=yes,samba_cv_SIZEOF_OFF_T=no,samba_cv_SIZEOF_OFF_T=cross)])
3647 +if test x"$samba_cv_SIZEOF_OFF_T" = x"yes"; then
3648 +    AC_DEFINE(SIZEOF_OFF_T,8,[The size of the 'off_t' type])
3649 +fi
3650 +
3651 +AC_CACHE_CHECK([for off64_t],samba_cv_HAVE_OFF64_T,[
3652 +AC_TRY_RUN([
3653 +#if defined(HAVE_UNISTD_H)
3654 +#include <unistd.h>
3655 +#endif
3656 +#include <stdio.h>
3657 +#include <sys/stat.h>
3658 +main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
3659 +samba_cv_HAVE_OFF64_T=yes,samba_cv_HAVE_OFF64_T=no,samba_cv_HAVE_OFF64_T=cross)])
3660 +if test x"$samba_cv_HAVE_OFF64_T" = x"yes"; then
3661 +    AC_DEFINE(HAVE_OFF64_T,1,[Whether off64_t is available])
3662 +fi
3663 +
3664 +AC_CACHE_CHECK([for 64 bit ino_t],samba_cv_SIZEOF_INO_T,[
3665 +AC_TRY_RUN([#include <stdio.h>
3666 +#include <sys/stat.h>
3667 +main() { exit((sizeof(ino_t) == 8) ? 0 : 1); }],
3668 +samba_cv_SIZEOF_INO_T=yes,samba_cv_SIZEOF_INO_T=no,samba_cv_SIZEOF_INO_T=cross)])
3669 +if test x"$samba_cv_SIZEOF_INO_T" = x"yes"; then
3670 +    AC_DEFINE(SIZEOF_INO_T,8,[The size of the 'ino_t' type])
3671 +fi
3672 +
3673 +AC_CACHE_CHECK([for ino64_t],samba_cv_HAVE_INO64_T,[
3674 +AC_TRY_RUN([
3675 +#if defined(HAVE_UNISTD_H)
3676 +#include <unistd.h>
3677 +#endif
3678 +#include <stdio.h>
3679 +#include <sys/stat.h>
3680 +main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
3681 +samba_cv_HAVE_INO64_T=yes,samba_cv_HAVE_INO64_T=no,samba_cv_HAVE_INO64_T=cross)])
3682 +if test x"$samba_cv_HAVE_INO64_T" = x"yes"; then
3683 +    AC_DEFINE(HAVE_INO64_T,1,[Whether the 'ino64_t' type is available])
3684 +fi
3685 +
3686 +AC_CACHE_CHECK([for dev64_t],samba_cv_HAVE_DEV64_T,[
3687 +AC_TRY_RUN([
3688 +#if defined(HAVE_UNISTD_H)
3689 +#include <unistd.h>
3690 +#endif
3691 +#include <stdio.h>
3692 +#include <sys/stat.h>
3693 +main() { struct stat64 st; dev64_t s; if (sizeof(dev_t) == sizeof(dev64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
3694 +samba_cv_HAVE_DEV64_T=yes,samba_cv_HAVE_DEV64_T=no,samba_cv_HAVE_DEV64_T=cross)])
3695 +if test x"$samba_cv_HAVE_DEV64_T" = x"yes"; then
3696 +    AC_DEFINE(HAVE_DEV64_T,1,[Whether the 'dev64_t' type is available])
3697 +fi
3698 +
3699 +AC_CACHE_CHECK([for struct dirent64],samba_cv_HAVE_STRUCT_DIRENT64,[
3700 +AC_TRY_COMPILE([
3701 +#if defined(HAVE_UNISTD_H)
3702 +#include <unistd.h>
3703 +#endif
3704 +#include <sys/types.h>
3705 +#include <dirent.h>],
3706 +[struct dirent64 de;],
3707 +samba_cv_HAVE_STRUCT_DIRENT64=yes,samba_cv_HAVE_STRUCT_DIRENT64=no)])
3708 +if test x"$samba_cv_HAVE_STRUCT_DIRENT64" = x"yes" && test x"$ac_cv_func_readdir64" = x"yes"; then
3709 +    AC_DEFINE(HAVE_STRUCT_DIRENT64,1,[Whether the 'dirent64' struct is available])
3710 +fi
3711 +
3712 +AC_CACHE_CHECK([for major macro],samba_cv_HAVE_DEVICE_MAJOR_FN,[
3713 +AC_TRY_RUN([
3714 +#if defined(HAVE_UNISTD_H)
3715 +#include <unistd.h>
3716 +#endif
3717 +#include <sys/types.h>
3718 +main() { dev_t dev; int i = major(dev); return 0; }],
3719 +samba_cv_HAVE_DEVICE_MAJOR_FN=yes,samba_cv_HAVE_DEVICE_MAJOR_FN=no,samba_cv_HAVE_DEVICE_MAJOR_FN=cross)])
3720 +if test x"$samba_cv_HAVE_DEVICE_MAJOR_FN" = x"yes"; then
3721 +    AC_DEFINE(HAVE_DEVICE_MAJOR_FN,1,[Whether the major macro for dev_t is available])
3722 +fi
3723 +
3724 +AC_CACHE_CHECK([for minor macro],samba_cv_HAVE_DEVICE_MINOR_FN,[
3725 +AC_TRY_RUN([
3726 +#if defined(HAVE_UNISTD_H)
3727 +#include <unistd.h>
3728 +#endif
3729 +#include <sys/types.h>
3730 +main() { dev_t dev; int i = minor(dev); return 0; }],
3731 +samba_cv_HAVE_DEVICE_MINOR_FN=yes,samba_cv_HAVE_DEVICE_MINOR_FN=no,samba_cv_HAVE_DEVICE_MINOR_FN=cross)])
3732 +if test x"$samba_cv_HAVE_DEVICE_MINOR_FN" = x"yes"; then
3733 +    AC_DEFINE(HAVE_DEVICE_MINOR_FN,1,[Whether the minor macro for dev_t is available])
3734 +fi
3735 +
3736 +AC_CACHE_CHECK([for unsigned char],samba_cv_HAVE_UNSIGNED_CHAR,[
3737 +AC_TRY_RUN([#include <stdio.h>
3738 +main() { char c; c=250; exit((c > 0)?0:1); }],
3739 +samba_cv_HAVE_UNSIGNED_CHAR=yes,samba_cv_HAVE_UNSIGNED_CHAR=no,samba_cv_HAVE_UNSIGNED_CHAR=cross)])
3740 +if test x"$samba_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then
3741 +    AC_DEFINE(HAVE_UNSIGNED_CHAR,1,[Whether the 'unsigned char' type is available])
3742 +fi
3743 +
3744 +AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
3745 +AC_TRY_COMPILE([#include <sys/types.h>
3746 +#include <sys/socket.h>
3747 +#include <netinet/in.h>],
3748 +[struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
3749 +samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
3750 +if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
3751 +    AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
3752 +fi
3753 +
3754 +AC_CACHE_CHECK([whether seekdir returns void],samba_cv_SEEKDIR_RETURNS_VOID,[
3755 +AC_TRY_COMPILE([#include <sys/types.h>
3756 +#include <dirent.h>
3757 +void seekdir(DIR *d, long loc) { return; }],[return 0;],
3758 +samba_cv_SEEKDIR_RETURNS_VOID=yes,samba_cv_SEEKDIR_RETURNS_VOID=no)])
3759 +if test x"$samba_cv_SEEKDIR_RETURNS_VOID" = x"yes"; then
3760 +    AC_DEFINE(SEEKDIR_RETURNS_VOID,1,[Whether seekdir returns void])
3761 +fi
3762 +
3763 +AC_CACHE_CHECK([for __FUNCTION__ macro],samba_cv_HAVE_FUNCTION_MACRO,[
3764 +AC_TRY_COMPILE([#include <stdio.h>], [printf("%s\n", __FUNCTION__);],
3765 +samba_cv_HAVE_FUNCTION_MACRO=yes,samba_cv_HAVE_FUNCTION_MACRO=no)])
3766 +if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
3767 +    AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro])
3768 +fi
3769 +
3770 +AC_CACHE_CHECK([if gettimeofday takes tz argument],samba_cv_HAVE_GETTIMEOFDAY_TZ,[
3771 +AC_TRY_RUN([
3772 +#include <sys/time.h>
3773 +#include <unistd.h>
3774 +main() { struct timeval tv; exit(gettimeofday(&tv, NULL));}],
3775 +           samba_cv_HAVE_GETTIMEOFDAY_TZ=yes,samba_cv_HAVE_GETTIMEOFDAY_TZ=no,samba_cv_HAVE_GETTIMEOFDAY_TZ=cross)])
3776 +if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then
3777 +    AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available])
3778 +fi
3779 +
3780 +AC_CACHE_CHECK([for va_copy],samba_cv_HAVE_VA_COPY,[
3781 +AC_TRY_LINK([#include <stdarg.h>
3782 +va_list ap1,ap2;], [va_copy(ap1,ap2);],
3783 +samba_cv_HAVE_VA_COPY=yes,
3784 +samba_cv_HAVE_VA_COPY=no)])
3785 +if test x"$samba_cv_HAVE_VA_COPY" = x"yes"; then
3786 +    AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
3787 +else
3788 +    AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE___VA_COPY,[
3789 +    AC_TRY_LINK([#include <stdarg.h>
3790 +    va_list ap1,ap2;], [__va_copy(ap1,ap2);],
3791 +    samba_cv_HAVE___VA_COPY=yes,
3792 +    samba_cv_HAVE___VA_COPY=no)])
3793 +    if test x"$samba_cv_HAVE___VA_COPY" = x"yes"; then
3794 +        AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
3795 +    fi
3796 +fi
3797 +
3798 +AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[
3799 +AC_TRY_RUN([
3800 +#include <sys/types.h>
3801 +#include <stdarg.h>
3802 +void foo(const char *format, ...) { 
3803 +       va_list ap;
3804 +       int len;
3805 +       char buf[5];
3806 +
3807 +       va_start(ap, format);
3808 +       len = vsnprintf(buf, 0, format, ap);
3809 +       va_end(ap);
3810 +       if (len != 5) exit(1);
3811 +
3812 +       va_start(ap, format);
3813 +       len = vsnprintf(0, 0, format, ap);
3814 +       va_end(ap);
3815 +       if (len != 5) exit(1);
3816 +
3817 +       if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1);
3818 +
3819 +       exit(0);
3820 +}
3821 +main() { foo("hello"); }
3822 +],
3823 +samba_cv_HAVE_C99_VSNPRINTF=yes,samba_cv_HAVE_C99_VSNPRINTF=no,samba_cv_HAVE_C99_VSNPRINTF=cross)])
3824 +if test x"$samba_cv_HAVE_C99_VSNPRINTF" = x"yes"; then
3825 +    AC_DEFINE(HAVE_C99_VSNPRINTF,1,[Whether there is a C99 compliant vsnprintf])
3826 +fi
3827 +
3828 +AC_CACHE_CHECK([for broken readdir],samba_cv_HAVE_BROKEN_READDIR,[
3829 +AC_TRY_RUN([#include <sys/types.h>
3830 +#include <dirent.h>
3831 +main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d);
3832 +if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 &&
3833 +di->d_name[0] == 0) exit(0); exit(1);} ],
3834 +samba_cv_HAVE_BROKEN_READDIR=yes,samba_cv_HAVE_BROKEN_READDIR=no,samba_cv_HAVE_BROKEN_READDIR=cross)])
3835 +if test x"$samba_cv_HAVE_BROKEN_READDIR" = x"yes"; then
3836 +    AC_DEFINE(HAVE_BROKEN_READDIR,1,[Whether readdir() is broken])
3837 +fi
3838 +
3839 +AC_CACHE_CHECK([for utimbuf],samba_cv_HAVE_UTIMBUF,[
3840 +AC_TRY_COMPILE([#include <sys/types.h>
3841 +#include <utime.h>],
3842 +[struct utimbuf tbuf;  tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf));],
3843 +samba_cv_HAVE_UTIMBUF=yes,samba_cv_HAVE_UTIMBUF=no,samba_cv_HAVE_UTIMBUF=cross)])
3844 +if test x"$samba_cv_HAVE_UTIMBUF" = x"yes"; then
3845 +    AC_DEFINE(HAVE_UTIMBUF,1,[Whether struct utimbuf is available])
3846 +fi
3847 +
3848 +##############
3849 +# Check utmp details, but only if our OS offers utmp.h
3850 +if test x"$ac_cv_header_utmp_h" = x"yes"; then
3851 +dnl  utmp and utmpx come in many flavours
3852 +dnl  We need to check for many of them
3853 +dnl  But we don't need to do each and every one, because our code uses
3854 +dnl  mostly just the utmp (not utmpx) fields.
3855 +
3856 +AC_CHECK_FUNCS(pututline pututxline updwtmp updwtmpx getutmpx)
3857 +
3858 +AC_CACHE_CHECK([for ut_name in utmp],samba_cv_HAVE_UT_UT_NAME,[
3859 +AC_TRY_COMPILE([#include <sys/types.h>
3860 +#include <utmp.h>],
3861 +[struct utmp ut;  ut.ut_name[0] = 'a';],
3862 +samba_cv_HAVE_UT_UT_NAME=yes,samba_cv_HAVE_UT_UT_NAME=no,samba_cv_HAVE_UT_UT_NAME=cross)])
3863 +if test x"$samba_cv_HAVE_UT_UT_NAME" = x"yes"; then
3864 +    AC_DEFINE(HAVE_UT_UT_NAME,1,[Whether the utmp struct has a property ut_name])
3865 +fi 
3866 +
3867 +AC_CACHE_CHECK([for ut_user in utmp],samba_cv_HAVE_UT_UT_USER,[
3868 +AC_TRY_COMPILE([#include <sys/types.h>
3869 +#include <utmp.h>],
3870 +[struct utmp ut;  ut.ut_user[0] = 'a';],
3871 +samba_cv_HAVE_UT_UT_USER=yes,samba_cv_HAVE_UT_UT_USER=no,samba_cv_HAVE_UT_UT_USER=cross)])
3872 +if test x"$samba_cv_HAVE_UT_UT_USER" = x"yes"; then
3873 +    AC_DEFINE(HAVE_UT_UT_USER,1,[Whether the utmp struct has a property ut_user])
3874 +fi 
3875 +
3876 +AC_CACHE_CHECK([for ut_id in utmp],samba_cv_HAVE_UT_UT_ID,[
3877 +AC_TRY_COMPILE([#include <sys/types.h>
3878 +#include <utmp.h>],
3879 +[struct utmp ut;  ut.ut_id[0] = 'a';],
3880 +samba_cv_HAVE_UT_UT_ID=yes,samba_cv_HAVE_UT_UT_ID=no,samba_cv_HAVE_UT_UT_ID=cross)])
3881 +if test x"$samba_cv_HAVE_UT_UT_ID" = x"yes"; then
3882 +    AC_DEFINE(HAVE_UT_UT_ID,1,[Whether the utmp struct has a property ut_id])
3883 +fi 
3884 +
3885 +AC_CACHE_CHECK([for ut_host in utmp],samba_cv_HAVE_UT_UT_HOST,[
3886 +AC_TRY_COMPILE([#include <sys/types.h>
3887 +#include <utmp.h>],
3888 +[struct utmp ut;  ut.ut_host[0] = 'a';],
3889 +samba_cv_HAVE_UT_UT_HOST=yes,samba_cv_HAVE_UT_UT_HOST=no,samba_cv_HAVE_UT_UT_HOST=cross)])
3890 +if test x"$samba_cv_HAVE_UT_UT_HOST" = x"yes"; then
3891 +    AC_DEFINE(HAVE_UT_UT_HOST,1,[Whether the utmp struct has a property ut_host])
3892 +fi 
3893 +
3894 +AC_CACHE_CHECK([for ut_time in utmp],samba_cv_HAVE_UT_UT_TIME,[
3895 +AC_TRY_COMPILE([#include <sys/types.h>
3896 +#include <utmp.h>],
3897 +[struct utmp ut;  time_t t; ut.ut_time = t;],
3898 +samba_cv_HAVE_UT_UT_TIME=yes,samba_cv_HAVE_UT_UT_TIME=no,samba_cv_HAVE_UT_UT_TIME=cross)])
3899 +if test x"$samba_cv_HAVE_UT_UT_TIME" = x"yes"; then
3900 +    AC_DEFINE(HAVE_UT_UT_TIME,1,[Whether the utmp struct has a property ut_time])
3901 +fi 
3902 +
3903 +AC_CACHE_CHECK([for ut_tv in utmp],samba_cv_HAVE_UT_UT_TV,[
3904 +AC_TRY_COMPILE([#include <sys/types.h>
3905 +#include <utmp.h>],
3906 +[struct utmp ut;  struct timeval tv; ut.ut_tv = tv;],
3907 +samba_cv_HAVE_UT_UT_TV=yes,samba_cv_HAVE_UT_UT_TV=no,samba_cv_HAVE_UT_UT_TV=cross)])
3908 +if test x"$samba_cv_HAVE_UT_UT_TV" = x"yes"; then
3909 +    AC_DEFINE(HAVE_UT_UT_TV,1,[Whether the utmp struct has a property ut_tv])
3910 +fi 
3911 +
3912 +AC_CACHE_CHECK([for ut_type in utmp],samba_cv_HAVE_UT_UT_TYPE,[
3913 +AC_TRY_COMPILE([#include <sys/types.h>
3914 +#include <utmp.h>],
3915 +[struct utmp ut;  ut.ut_type = 0;],
3916 +samba_cv_HAVE_UT_UT_TYPE=yes,samba_cv_HAVE_UT_UT_TYPE=no,samba_cv_HAVE_UT_UT_TYPE=cross)])
3917 +if test x"$samba_cv_HAVE_UT_UT_TYPE" = x"yes"; then
3918 +    AC_DEFINE(HAVE_UT_UT_TYPE,1,[Whether the utmp struct has a property ut_type])
3919 +fi 
3920 +
3921 +AC_CACHE_CHECK([for ut_pid in utmp],samba_cv_HAVE_UT_UT_PID,[
3922 +AC_TRY_COMPILE([#include <sys/types.h>
3923 +#include <utmp.h>],
3924 +[struct utmp ut;  ut.ut_pid = 0;],
3925 +samba_cv_HAVE_UT_UT_PID=yes,samba_cv_HAVE_UT_UT_PID=no,samba_cv_HAVE_UT_UT_PID=cross)])
3926 +if test x"$samba_cv_HAVE_UT_UT_PID" = x"yes"; then
3927 +    AC_DEFINE(HAVE_UT_UT_PID,1,[Whether the utmp struct has a property ut_pid])
3928 +fi 
3929 +
3930 +AC_CACHE_CHECK([for ut_exit in utmp],samba_cv_HAVE_UT_UT_EXIT,[
3931 +AC_TRY_COMPILE([#include <sys/types.h>
3932 +#include <utmp.h>],
3933 +[struct utmp ut;  ut.ut_exit.e_exit = 0;],
3934 +samba_cv_HAVE_UT_UT_EXIT=yes,samba_cv_HAVE_UT_UT_EXIT=no,samba_cv_HAVE_UT_UT_EXIT=cross)])
3935 +if test x"$samba_cv_HAVE_UT_UT_EXIT" = x"yes"; then
3936 +    AC_DEFINE(HAVE_UT_UT_EXIT,1,[Whether the utmp struct has a property ut_exit])
3937 +fi 
3938 +
3939 +AC_CACHE_CHECK([for ut_addr in utmp],samba_cv_HAVE_UT_UT_ADDR,[
3940 +AC_TRY_COMPILE([#include <sys/types.h>
3941 +#include <utmp.h>],
3942 +[struct utmp ut;  ut.ut_addr = 0;],
3943 +samba_cv_HAVE_UT_UT_ADDR=yes,samba_cv_HAVE_UT_UT_ADDR=no,samba_cv_HAVE_UT_UT_ADDR=cross)])
3944 +if test x"$samba_cv_HAVE_UT_UT_ADDR" = x"yes"; then
3945 +    AC_DEFINE(HAVE_UT_UT_ADDR,1,[Whether the utmp struct has a property ut_addr])
3946 +fi 
3947 +
3948 +if test x$ac_cv_func_pututline = xyes ; then
3949 +  AC_CACHE_CHECK([whether pututline returns pointer],samba_cv_PUTUTLINE_RETURNS_UTMP,[
3950 +  AC_TRY_COMPILE([#include <sys/types.h>
3951 +#include <utmp.h>],
3952 +  [struct utmp utarg; struct utmp *utreturn; utreturn = pututline(&utarg);],
3953 +  samba_cv_PUTUTLINE_RETURNS_UTMP=yes,samba_cv_PUTUTLINE_RETURNS_UTMP=no)])
3954 +  if test x"$samba_cv_PUTUTLINE_RETURNS_UTMP" = x"yes"; then
3955 +      AC_DEFINE(PUTUTLINE_RETURNS_UTMP,1,[Whether pututline returns pointer])
3956 +  fi
3957 +fi
3958 +
3959 +AC_CACHE_CHECK([for ut_syslen in utmpx],samba_cv_HAVE_UX_UT_SYSLEN,[
3960 +AC_TRY_COMPILE([#include <sys/types.h>
3961 +#include <utmpx.h>],
3962 +[struct utmpx ux;  ux.ut_syslen = 0;],
3963 +samba_cv_HAVE_UX_UT_SYSLEN=yes,samba_cv_HAVE_UX_UT_SYSLEN=no,samba_cv_HAVE_UX_UT_SYSLEN=cross)])
3964 +if test x"$samba_cv_HAVE_UX_UT_SYSLEN" = x"yes"; then
3965 +    AC_DEFINE(HAVE_UX_UT_SYSLEN,1,[Whether the utmpx struct has a property ut_syslen])
3966 +fi 
3967 +
3968 +fi
3969 +# end utmp details
3970 +
3971 +
3972 +ICONV_LOCATION=standard
3973 +LOOK_DIRS="/usr /usr/local /sw"
3974 +AC_ARG_WITH(libiconv,
3975 +[  --with-libiconv=BASEDIR Use libiconv in BASEDIR/lib and BASEDIR/include (default=auto) ],
3976 +[
3977 +  if test "$withval" = "no" ; then
3978 +    AC_MSG_ERROR([argument to --with-libiconv must be a directory])
3979 +  else
3980 +     if test "$withval" != "yes" ; then
3981 +       ICONV_PATH_SPEC=yes
3982 +        LOOK_DIRS="$withval"
3983 +     fi
3984 +  fi
3985 +])
3986 +
3987 +ICONV_FOUND="no"
3988 +for i in $LOOK_DIRS ; do
3989 +    save_LIBS=$LIBS
3990 +    save_LDFLAGS=$LDFLAGS
3991 +    save_CPPFLAGS=$CPPFLAGS
3992 +    CPPFLAGS="$CPPFLAGS -I$i/include"
3993 +dnl This is here to handle -withval stuff for --with-libiconv
3994 +dnl Perhaps we should always add a -L
3995 +    LDFLAGS="$LDFLAGS -L$i/lib"
3996 +    LIBS=
3997 +    export LDFLAGS LIBS CPPFLAGS
3998 +dnl Try to find iconv(3)
3999 +    jm_ICONV($i)
4000 +
4001 +    if test "$ICONV_FOUND" = yes; then
4002 +       LDFLAGS=$save_LDFLAG
4003 +        LIB_ADD_DIR(LDFLAGS, "$i/lib")
4004 +        CFLAGS_ADD_DIR(CPPFLAGS, "$i/include")
4005 +        LIBS="$save_LIBS"
4006 +        ICONV_LOCATION=$i
4007 +        export LDFLAGS LIBS CPPFLAGS
4008 +dnl Now, check for a working iconv ... we want to do it here because
4009 +dnl there might be a working iconv further down the list of LOOK_DIRS
4010 +
4011 +        ############
4012 +        # check for iconv in libc
4013 +        ic_save_LIBS="$LIBS"
4014 +        if test x"$ICONV_PATH_SPEC" = "xyes" ; then
4015 +           LIBS="$LIBS -L$ICONV_LOCATION/lib"
4016 +        fi
4017 +        if test x"$jm_cv_lib_iconv" != x; then
4018 +           LIBS="$LIBS -l$jm_cv_lib_iconv"
4019 +        fi
4020 +dnl        AC_CACHE_CHECK([for working iconv],samba_cv_HAVE_NATIVE_ICONV,[
4021 +       default_dos_charset=no
4022 +       default_display_charset=no
4023 +       default_unix_charset=no
4024 +
4025 +       # check for default dos charset name
4026 +       for j in CP850 IBM850 ; do
4027 +           rjs_CHARSET($j)
4028 +           if test x"$ICONV_CHARSET" = x"$j"; then
4029 +               default_dos_charset="\"$j\""
4030 +               break
4031 +           fi
4032 +       done
4033 +       # check for default display charset name
4034 +       for j in ASCII 646 ; do
4035 +           rjs_CHARSET($j)
4036 +           if test x"$ICONV_CHARSET" = x"$j"; then
4037 +               default_display_charset="\"$j\""
4038 +               break
4039 +           fi
4040 +       done
4041 +       # check for default unix charset name
4042 +       for j in UTF-8 UTF8 ; do
4043 +           rjs_CHARSET($j)
4044 +           if test x"$ICONV_CHARSET" = x"$j"; then
4045 +               default_unix_charset="\"$j\""
4046 +               break
4047 +           fi
4048 +       done
4049 +       
4050 +       if test "$default_dos_charset" != "no" -a \
4051 +               "$default_dos_charset" != "cross" -a \
4052 +               "$default_display_charset" != "no" -a \ 
4053 +               "$default_display_charset" != "cross" -a \
4054 +               "$default_unix_charset" != "no" -a \
4055 +               "$default_unix_charset" != "cross"
4056 +       then
4057 +               samba_cv_HAVE_NATIVE_ICONV=yes
4058 +       else if test "$default_dos_charset" = "cross" -o \
4059 +                    "$default_display_charset" = "cross" -o \
4060 +                    "$default_unix_charset" = "cross"
4061 +       then
4062 +               samba_cv_HAVE_NATIVE_ICONV=cross
4063 +       else
4064 +               samba_cv_HAVE_NATIVE_ICONV=no
4065 +       fi
4066 +       fi
4067 +dnl ])
4068 +
4069 +        LIBS="$ic_save_LIBS"
4070 +        if test x"$samba_cv_HAVE_NATIVE_ICONV" = x"yes"; then
4071 +          CPPFLAGS=$save_CPPFLAGS
4072 +          LDFLAGS=$save_LDFLAGS
4073 +          LIBS=$save_LIBS
4074 +           if test x"$jm_cv_lib_iconv" != x; then
4075 +              LIBS="$LIBS -l$jm_cv_lib_iconv"
4076 +           fi
4077 +          dnl Add the flags we need to CPPFLAGS and LDFLAGS
4078 +          CFLAGS_ADD_DIR(CPPFLAGS, "$i/include")
4079 +          LIB_ADD_DIR(LDFLAGS, "$i/lib")
4080 +          export CPPFLAGS
4081 +           AC_DEFINE(HAVE_NATIVE_ICONV,1,[Whether to use native iconv])
4082 +          AC_DEFINE_UNQUOTED(DEFAULT_DOS_CHARSET,$default_dos_charset,[Default dos charset name])
4083 +          AC_DEFINE_UNQUOTED(DEFAULT_DISPLAY_CHARSET,$default_display_charset,[Default display charset name])
4084 +          AC_DEFINE_UNQUOTED(DEFAULT_UNIX_CHARSET,$default_unix_charset,[Default unix charset name])
4085 +           break
4086 +        fi
4087 +dnl We didn't find a working iconv, so keep going
4088 +    fi
4089 +dnl We only need to clean these up here for the next pass through the loop
4090 +    CPPFLAGS=$save_CPPFLAGS
4091 +    LDFLAGS=$save_LDFLAGS
4092 +    LIBS=$save_LIBS
4093 +    export LDFLAGS LIBS CPPFLAGS
4094 +done
4095 +
4096 +
4097 +if test x"$ICONV_FOUND" = x"no" -o x"$samba_cv_HAVE_NATIVE_ICONV" != x"yes" ; then
4098 +    AC_MSG_WARN([Sufficient support for iconv function was not found. 
4099 +    Install libiconv from http://freshmeat.net/projects/libiconv/ for better charset compatibility!])
4100 +   AC_DEFINE_UNQUOTED(DEFAULT_DOS_CHARSET,"ASCII",[Default dos charset name])
4101 +   AC_DEFINE_UNQUOTED(DEFAULT_DISPLAY_CHARSET,"ASCII",[Default display charset name])
4102 +   AC_DEFINE_UNQUOTED(DEFAULT_UNIX_CHARSET,"UTF8",[Default unix charset name])
4103 +fi
4104 +
4105 +
4106 +AC_CACHE_CHECK([for Linux kernel oplocks],samba_cv_HAVE_KERNEL_OPLOCKS_LINUX,[
4107 +AC_TRY_RUN([
4108 +#include <sys/types.h>
4109 +#include <fcntl.h>
4110 +#ifndef F_GETLEASE
4111 +#define F_GETLEASE     1025
4112 +#endif
4113 +main() {
4114 +       int fd = open("/dev/null", O_RDONLY);
4115 +       return fcntl(fd, F_GETLEASE, 0) == -1;
4116 +}
4117 +],
4118 +samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=no,samba_cv_HAVE_KERNEL_OPLOCKS_LINUX=cross)])
4119 +if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_LINUX" = x"yes"; then
4120 +    AC_DEFINE(HAVE_KERNEL_OPLOCKS_LINUX,1,[Whether to use linux kernel oplocks])
4121 +fi
4122 +
4123 +AC_CACHE_CHECK([for kernel change notify support],samba_cv_HAVE_KERNEL_CHANGE_NOTIFY,[
4124 +AC_TRY_RUN([
4125 +#include <sys/types.h>
4126 +#include <fcntl.h>
4127 +#include <signal.h>
4128 +#ifndef F_NOTIFY
4129 +#define F_NOTIFY 1026
4130 +#endif
4131 +main() {
4132 +               exit(fcntl(open("/tmp", O_RDONLY), F_NOTIFY, 0) == -1 ?  1 : 0);
4133 +}
4134 +],
4135 +samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=yes,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=no,samba_cv_HAVE_KERNEL_CHANGE_NOTIFY=cross)])
4136 +if test x"$samba_cv_HAVE_KERNEL_CHANGE_NOTIFY" = x"yes"; then
4137 +    AC_DEFINE(HAVE_KERNEL_CHANGE_NOTIFY,1,[Whether kernel notifies changes])
4138 +fi
4139 +
4140 +AC_CACHE_CHECK([for kernel share modes],samba_cv_HAVE_KERNEL_SHARE_MODES,[
4141 +AC_TRY_RUN([
4142 +#include <sys/types.h>
4143 +#include <fcntl.h>
4144 +#include <signal.h>
4145 +#include <sys/file.h>
4146 +#ifndef LOCK_MAND
4147 +#define LOCK_MAND      32
4148 +#define LOCK_READ      64
4149 +#endif
4150 +main() {
4151 +               exit(flock(open("/dev/null", O_RDWR), LOCK_MAND|LOCK_READ) != 0);
4152 +}
4153 +],
4154 +samba_cv_HAVE_KERNEL_SHARE_MODES=yes,samba_cv_HAVE_KERNEL_SHARE_MODES=no,samba_cv_HAVE_KERNEL_SHARE_MODES=cross)])
4155 +if test x"$samba_cv_HAVE_KERNEL_SHARE_MODES" = x"yes"; then
4156 +    AC_DEFINE(HAVE_KERNEL_SHARE_MODES,1,[Whether the kernel supports share modes])
4157 +fi
4158 +
4159 +
4160 +
4161 +
4162 +AC_CACHE_CHECK([for IRIX kernel oplock type definitions],samba_cv_HAVE_KERNEL_OPLOCKS_IRIX,[
4163 +AC_TRY_COMPILE([#include <sys/types.h>
4164 +#include <fcntl.h>],
4165 +[oplock_stat_t t; t.os_state = OP_REVOKE; t.os_dev = 1; t.os_ino = 1;],
4166 +samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=yes,samba_cv_HAVE_KERNEL_OPLOCKS_IRIX=no)])
4167 +if test x"$samba_cv_HAVE_KERNEL_OPLOCKS_IRIX" = x"yes"; then
4168 +    AC_DEFINE(HAVE_KERNEL_OPLOCKS_IRIX,1,[Whether IRIX kernel oplock type definitions are available])
4169 +fi
4170 +
4171 +AC_CACHE_CHECK([for irix specific capabilities],samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES,[
4172 +AC_TRY_RUN([#include <sys/types.h>
4173 +#include <sys/capability.h>
4174 +main() {
4175 + cap_t cap;
4176 + if ((cap = cap_get_proc()) == NULL)
4177 +   exit(1);
4178 + cap->cap_effective |= CAP_NETWORK_MGT;
4179 + cap->cap_inheritable |= CAP_NETWORK_MGT;
4180 + cap_set_proc(cap);
4181 + exit(0);
4182 +}
4183 +],
4184 +samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=yes,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=no,samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES=cross)])
4185 +if test x"$samba_cv_HAVE_IRIX_SPECIFIC_CAPABILITIES" = x"yes"; then
4186 +    AC_DEFINE(HAVE_IRIX_SPECIFIC_CAPABILITIES,1,[Whether IRIX specific capabilities are available])
4187 +fi
4188 +
4189 +#
4190 +# Check for int16, uint16, int32 and uint32 in rpc/types.h included from rpc/rpc.h
4191 +# This is *really* broken but some systems (DEC OSF1) do this.... JRA.
4192 +#
4193 +
4194 +AC_CACHE_CHECK([for int16 typedef included by rpc/rpc.h],samba_cv_HAVE_INT16_FROM_RPC_RPC_H,[
4195 +AC_TRY_COMPILE([#include <sys/types.h>
4196 +#if defined(HAVE_RPC_RPC_H)
4197 +#include <rpc/rpc.h>
4198 +#endif],
4199 +[int16 testvar;],
4200 +samba_cv_HAVE_INT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT16_FROM_RPC_RPC_H=no)])
4201 +if test x"$samba_cv_HAVE_INT16_FROM_RPC_RPC_H" = x"yes"; then
4202 +    AC_DEFINE(HAVE_INT16_FROM_RPC_RPC_H,1,[Whether int16 typedef is included by rpc/rpc.h])
4203 +fi
4204 +
4205 +AC_CACHE_CHECK([for uint16 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT16_FROM_RPC_RPC_H,[
4206 +AC_TRY_COMPILE([#include <sys/types.h>
4207 +#if defined(HAVE_RPC_RPC_H)
4208 +#include <rpc/rpc.h>
4209 +#endif],
4210 +[uint16 testvar;],
4211 +samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT16_FROM_RPC_RPC_H=no)])
4212 +if test x"$samba_cv_HAVE_UINT16_FROM_RPC_RPC_H" = x"yes"; then
4213 +    AC_DEFINE(HAVE_UINT16_FROM_RPC_RPC_H,1,[Whether uint16 typedef is included by rpc/rpc.h])
4214 +fi
4215 +
4216 +AC_CACHE_CHECK([for int32 typedef included by rpc/rpc.h],samba_cv_HAVE_INT32_FROM_RPC_RPC_H,[
4217 +AC_TRY_COMPILE([#include <sys/types.h>
4218 +#if defined(HAVE_RPC_RPC_H)
4219 +#include <rpc/rpc.h>
4220 +#endif],
4221 +[int32 testvar;],
4222 +samba_cv_HAVE_INT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_INT32_FROM_RPC_RPC_H=no)])
4223 +if test x"$samba_cv_HAVE_INT32_FROM_RPC_RPC_H" = x"yes"; then
4224 +    AC_DEFINE(HAVE_INT32_FROM_RPC_RPC_H,1,[Whether int32 typedef is included by rpc/rpc.h])
4225 +fi
4226 +
4227 +AC_CACHE_CHECK([for uint32 typedef included by rpc/rpc.h],samba_cv_HAVE_UINT32_FROM_RPC_RPC_H,[
4228 +AC_TRY_COMPILE([#include <sys/types.h>
4229 +#if defined(HAVE_RPC_RPC_H)
4230 +#include <rpc/rpc.h>
4231 +#endif],
4232 +[uint32 testvar;],
4233 +samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=yes,samba_cv_HAVE_UINT32_FROM_RPC_RPC_H=no)])
4234 +if test x"$samba_cv_HAVE_UINT32_FROM_RPC_RPC_H" = x"yes"; then
4235 +    AC_DEFINE(HAVE_UINT32_FROM_RPC_RPC_H,1,[Whether uint32 typedef is included by rpc/rpc.h])
4236 +fi
4237 +
4238 +dnl
4239 +dnl Some systems (SCO) have a problem including
4240 +dnl <prot.h> and <rpc/rpc.h> due to AUTH_ERROR being defined
4241 +dnl as a #define in <prot.h> and as part of an enum
4242 +dnl in <rpc/rpc.h>.
4243 +dnl
4244 +
4245 +AC_CACHE_CHECK([for conflicting AUTH_ERROR define in rpc/rpc.h],samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT,[
4246 +AC_TRY_COMPILE([#include <sys/types.h>
4247 +#ifdef HAVE_SYS_SECURITY_H
4248 +#include <sys/security.h>
4249 +#include <prot.h>
4250 +#endif  /* HAVE_SYS_SECURITY_H */
4251 +#if defined(HAVE_RPC_RPC_H)
4252 +#include <rpc/rpc.h>
4253 +#endif],
4254 +[int testvar;],
4255 +samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=no,samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT=yes)])
4256 +if test x"$samba_cv_HAVE_RPC_AUTH_ERROR_CONFLICT" = x"yes"; then
4257 +    AC_DEFINE(HAVE_RPC_AUTH_ERROR_CONFLICT,1,[Whether there is a conflicting AUTH_ERROR define in rpc/rpc.h])
4258 +fi
4259 +
4260 +AC_MSG_CHECKING([for test routines])
4261 +AC_TRY_RUN([#include "${srcdir-.}/tests/trivial.c"],
4262 +           AC_MSG_RESULT(yes),
4263 +          AC_MSG_ERROR([cant find test code. Aborting config]),
4264 +          AC_MSG_WARN([cannot run when cross-compiling]))
4265 +
4266 +AC_CACHE_CHECK([for ftruncate extend],samba_cv_HAVE_FTRUNCATE_EXTEND,[
4267 +AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncate.c"],
4268 +           samba_cv_HAVE_FTRUNCATE_EXTEND=yes,samba_cv_HAVE_FTRUNCATE_EXTEND=no,samba_cv_HAVE_FTRUNCATE_EXTEND=cross)])
4269 +if test x"$samba_cv_HAVE_FTRUNCATE_EXTEND" = x"yes"; then
4270 +    AC_DEFINE(HAVE_FTRUNCATE_EXTEND,1,[Truncate extend])
4271 +fi
4272 +
4273 +AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [
4274 +AC_TRY_RUN([#include "${srcdir-.}/tests/unixsock.c"],
4275 +          samba_cv_HAVE_WORKING_AF_LOCAL=yes,
4276 +          samba_cv_HAVE_WORKING_AF_LOCAL=no,
4277 +          samba_cv_HAVE_WORKING_AF_LOCAL=cross)])
4278 +if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno
4279 +then
4280 +    AC_DEFINE(HAVE_WORKING_AF_LOCAL, 1, [Define if you have working AF_LOCAL sockets])
4281 +fi
4282 +
4283 +AC_CACHE_CHECK([for broken getgroups],samba_cv_HAVE_BROKEN_GETGROUPS,[
4284 +AC_TRY_RUN([#include "${srcdir-.}/tests/getgroups.c"],
4285 +           samba_cv_HAVE_BROKEN_GETGROUPS=yes,samba_cv_HAVE_BROKEN_GETGROUPS=no,samba_cv_HAVE_BROKEN_GETGROUPS=cross)])
4286 +if test x"$samba_cv_HAVE_BROKEN_GETGROUPS" = x"yes"; then
4287 +    AC_DEFINE(HAVE_BROKEN_GETGROUPS,1,[Whether getgroups is broken])
4288 +fi
4289 +
4290 +AC_CACHE_CHECK([whether getpass should be replaced],samba_cv_REPLACE_GETPASS,[
4291 +SAVE_CPPFLAGS="$CPPFLAGS"
4292 +CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt  -I${srcdir-.}/smbwrapper"
4293 +AC_TRY_COMPILE([
4294 +#define REPLACE_GETPASS 1
4295 +#define NO_PROTO_H 1
4296 +#define NO_CONFIG_H 1
4297 +#define main dont_declare_main
4298 +#include "${srcdir-.}/lib/getsmbpass.c"
4299 +#undef main
4300 +],[],samba_cv_REPLACE_GETPASS=yes,samba_cv_REPLACE_GETPASS=no)
4301 +CPPFLAGS="$SAVE_CPPFLAGS"
4302 +])
4303 +if test x"$samba_cv_REPLACE_GETPASS" = x"yes"; then
4304 +       AC_DEFINE(REPLACE_GETPASS,1,[Whether getpass should be replaced])
4305 +fi
4306 +
4307 +AC_CACHE_CHECK([for broken inet_ntoa],samba_cv_REPLACE_INET_NTOA,[
4308 +AC_TRY_RUN([
4309 +#include <stdio.h>
4310 +#include <sys/types.h>
4311 +#include <netinet/in.h>
4312 +#ifdef HAVE_ARPA_INET_H
4313 +#include <arpa/inet.h>
4314 +#endif
4315 +main() { struct in_addr ip; ip.s_addr = 0x12345678;
4316 +if (strcmp(inet_ntoa(ip),"18.52.86.120") &&
4317 +    strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(0); } 
4318 +exit(1);}],
4319 +           samba_cv_REPLACE_INET_NTOA=yes,samba_cv_REPLACE_INET_NTOA=no,samba_cv_REPLACE_INET_NTOA=cross)])
4320 +if test x"$samba_cv_REPLACE_INET_NTOA" = x"yes"; then
4321 +    AC_DEFINE(REPLACE_INET_NTOA,1,[Whether inet_ntoa should be replaced])
4322 +fi
4323 +
4324 +AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
4325 +AC_TRY_RUN([#include <stdlib.h>
4326 +#include <sys/types.h>
4327 +#include <sys/stat.h>
4328 +#include <unistd.h>
4329 +main() { 
4330 +  struct stat st;
4331 +  char tpl[20]="/tmp/test.XXXXXX"; 
4332 +  int fd = mkstemp(tpl); 
4333 +  if (fd == -1) exit(1);
4334 +  unlink(tpl);
4335 +  if (fstat(fd, &st) != 0) exit(1);
4336 +  if ((st.st_mode & 0777) != 0600) exit(1);
4337 +  exit(0);
4338 +}],
4339 +samba_cv_HAVE_SECURE_MKSTEMP=yes,
4340 +samba_cv_HAVE_SECURE_MKSTEMP=no,
4341 +samba_cv_HAVE_SECURE_MKSTEMP=cross)])
4342 +if test x"$samba_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then
4343 +    AC_DEFINE(HAVE_SECURE_MKSTEMP,1,[Whether mkstemp is secure])
4344 +fi
4345 +
4346 +AC_CACHE_CHECK([for sysconf(_SC_NGROUPS_MAX)],samba_cv_SYSCONF_SC_NGROUPS_MAX,[
4347 +AC_TRY_RUN([#include <unistd.h>
4348 +main() { exit(sysconf(_SC_NGROUPS_MAX) == -1 ? 1 : 0); }],
4349 +samba_cv_SYSCONF_SC_NGROUPS_MAX=yes,samba_cv_SYSCONF_SC_NGROUPS_MAX=no,samba_cv_SYSCONF_SC_NGROUPS_MAX=cross)])
4350 +if test x"$samba_cv_SYSCONF_SC_NGROUPS_MAX" = x"yes"; then
4351 +    AC_DEFINE(SYSCONF_SC_NGROUPS_MAX,1,[Whether sysconf(_SC_NGROUPS_MAX) is available])
4352 +fi
4353 +
4354 +AC_CACHE_CHECK([for sysconf(_SC_NPROC_ONLN)],samba_cv_SYSCONF_SC_NPROC_ONLN,[
4355 +AC_TRY_RUN([#include <unistd.h>
4356 +main() { exit(sysconf(_SC_NPROC_ONLN) == -1 ? 1 : 0); }],
4357 +samba_cv_SYSCONF_SC_NPROC_ONLN=yes,samba_cv_SYSCONF_SC_NPROC_ONLN=no,samba_cv_SYSCONF_SC_NPROC_ONLN=cross)])
4358 +if test x"$samba_cv_SYSCONF_SC_NPROC_ONLN" = x"yes"; then
4359 +    AC_DEFINE(SYSCONF_SC_NPROC_ONLN,1,[Whether sysconf(_SC_NPROC_ONLN) is available])
4360 +fi
4361 +
4362 +AC_CACHE_CHECK([for root],samba_cv_HAVE_ROOT,[
4363 +AC_TRY_RUN([main() { exit(getuid() != 0); }],
4364 +           samba_cv_HAVE_ROOT=yes,samba_cv_HAVE_ROOT=no,samba_cv_HAVE_ROOT=cross)])
4365 +if test x"$samba_cv_HAVE_ROOT" = x"yes"; then
4366 +    AC_DEFINE(HAVE_ROOT,1,[Whether current user is root])
4367 +else
4368 +    AC_MSG_WARN(running as non-root will disable some tests)
4369 +fi
4370 +
4371 +##################
4372 +# look for a method of finding the list of network interfaces
4373 +iface=no;
4374 +AC_CACHE_CHECK([for iface AIX],samba_cv_HAVE_IFACE_AIX,[
4375 +AC_TRY_RUN([
4376 +#define HAVE_IFACE_AIX 1
4377 +#define AUTOCONF_TEST 1
4378 +#include "confdefs.h"
4379 +#include "${srcdir-.}/lib/interfaces.c"],
4380 +           samba_cv_HAVE_IFACE_AIX=yes,samba_cv_HAVE_IFACE_AIX=no,samba_cv_HAVE_IFACE_AIX=cross)])
4381 +if test x"$samba_cv_HAVE_IFACE_AIX" = x"yes"; then
4382 +    iface=yes;AC_DEFINE(HAVE_IFACE_AIX,1,[Whether iface AIX is available])
4383 +fi
4384 +
4385 +if test $iface = no; then
4386 +AC_CACHE_CHECK([for iface ifconf],samba_cv_HAVE_IFACE_IFCONF,[
4387 +AC_TRY_RUN([
4388 +#define HAVE_IFACE_IFCONF 1
4389 +#define AUTOCONF_TEST 1
4390 +#include "confdefs.h"
4391 +#include "${srcdir-.}/lib/interfaces.c"],
4392 +           samba_cv_HAVE_IFACE_IFCONF=yes,samba_cv_HAVE_IFACE_IFCONF=no,samba_cv_HAVE_IFACE_IFCONF=cross)])
4393 +if test x"$samba_cv_HAVE_IFACE_IFCONF" = x"yes"; then
4394 +    iface=yes;AC_DEFINE(HAVE_IFACE_IFCONF,1,[Whether iface ifconf is available])
4395 +fi
4396 +fi
4397 +
4398 +if test $iface = no; then
4399 +AC_CACHE_CHECK([for iface ifreq],samba_cv_HAVE_IFACE_IFREQ,[
4400 +AC_TRY_RUN([
4401 +#define HAVE_IFACE_IFREQ 1
4402 +#define AUTOCONF_TEST 1
4403 +#include "confdefs.h"
4404 +#include "${srcdir-.}/lib/interfaces.c"],
4405 +           samba_cv_HAVE_IFACE_IFREQ=yes,samba_cv_HAVE_IFACE_IFREQ=no,samba_cv_HAVE_IFACE_IFREQ=cross)])
4406 +if test x"$samba_cv_HAVE_IFACE_IFREQ" = x"yes"; then
4407 +    iface=yes;AC_DEFINE(HAVE_IFACE_IFREQ,1,[Whether iface ifreq is available])
4408 +fi
4409 +fi
4410 +
4411 +
4412 +################################################
4413 +# look for a method of setting the effective uid
4414 +seteuid=no;
4415 +if test $seteuid = no; then
4416 +AC_CACHE_CHECK([for setresuid],samba_cv_USE_SETRESUID,[
4417 +AC_TRY_RUN([
4418 +#define AUTOCONF_TEST 1
4419 +#define USE_SETRESUID 1
4420 +#include "confdefs.h"
4421 +#include "${srcdir-.}/lib/util_sec.c"],
4422 +           samba_cv_USE_SETRESUID=yes,samba_cv_USE_SETRESUID=no,samba_cv_USE_SETRESUID=cross)])
4423 +if test x"$samba_cv_USE_SETRESUID" = x"yes"; then
4424 +    seteuid=yes;AC_DEFINE(USE_SETRESUID,1,[Whether setresuid() is available])
4425 +fi
4426 +fi
4427 +
4428 +
4429 +if test $seteuid = no; then
4430 +AC_CACHE_CHECK([for setreuid],samba_cv_USE_SETREUID,[
4431 +AC_TRY_RUN([
4432 +#define AUTOCONF_TEST 1
4433 +#define USE_SETREUID 1
4434 +#include "confdefs.h"
4435 +#include "${srcdir-.}/lib/util_sec.c"],
4436 +           samba_cv_USE_SETREUID=yes,samba_cv_USE_SETREUID=no,samba_cv_USE_SETREUID=cross)])
4437 +if test x"$samba_cv_USE_SETREUID" = x"yes"; then
4438 +    seteuid=yes;AC_DEFINE(USE_SETREUID,1,[Whether setreuid() is available])
4439 +fi
4440 +fi
4441 +
4442 +if test $seteuid = no; then
4443 +AC_CACHE_CHECK([for seteuid],samba_cv_USE_SETEUID,[
4444 +AC_TRY_RUN([
4445 +#define AUTOCONF_TEST 1
4446 +#define USE_SETEUID 1
4447 +#include "confdefs.h"
4448 +#include "${srcdir-.}/lib/util_sec.c"],
4449 +           samba_cv_USE_SETEUID=yes,samba_cv_USE_SETEUID=no,samba_cv_USE_SETEUID=cross)])
4450 +if test x"$samba_cv_USE_SETEUID" = x"yes"; then
4451 +    seteuid=yes;AC_DEFINE(USE_SETEUID,1,[Whether seteuid() is available])
4452 +fi
4453 +fi
4454 +
4455 +if test $seteuid = no; then
4456 +AC_CACHE_CHECK([for setuidx],samba_cv_USE_SETUIDX,[
4457 +AC_TRY_RUN([
4458 +#define AUTOCONF_TEST 1
4459 +#define USE_SETUIDX 1
4460 +#include "confdefs.h"
4461 +#include "${srcdir-.}/lib/util_sec.c"],
4462 +           samba_cv_USE_SETUIDX=yes,samba_cv_USE_SETUIDX=no,samba_cv_USE_SETUIDX=cross)])
4463 +if test x"$samba_cv_USE_SETUIDX" = x"yes"; then
4464 +    seteuid=yes;AC_DEFINE(USE_SETUIDX,1,[Whether setuidx() is available])
4465 +fi
4466 +fi
4467 +
4468 +
4469 +AC_CACHE_CHECK([for working mmap],samba_cv_HAVE_MMAP,[
4470 +AC_TRY_RUN([#include "${srcdir-.}/tests/shared_mmap.c"],
4471 +           samba_cv_HAVE_MMAP=yes,samba_cv_HAVE_MMAP=no,samba_cv_HAVE_MMAP=cross)])
4472 +if test x"$samba_cv_HAVE_MMAP" = x"yes"; then
4473 +    AC_DEFINE(HAVE_MMAP,1,[Whether mmap works])
4474 +fi
4475 +
4476 +AC_CACHE_CHECK([for ftruncate needs root],samba_cv_FTRUNCATE_NEEDS_ROOT,[
4477 +AC_TRY_RUN([#include "${srcdir-.}/tests/ftruncroot.c"],
4478 +           samba_cv_FTRUNCATE_NEEDS_ROOT=yes,samba_cv_FTRUNCATE_NEEDS_ROOT=no,samba_cv_FTRUNCATE_NEEDS_ROOT=cross)])
4479 +if test x"$samba_cv_FTRUNCATE_NEEDS_ROOT" = x"yes"; then
4480 +    AC_DEFINE(FTRUNCATE_NEEDS_ROOT,1,[Whether ftruncate() needs root])
4481 +fi
4482 +
4483 +AC_CACHE_CHECK([for fcntl locking],samba_cv_HAVE_FCNTL_LOCK,[
4484 +AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock.c"],
4485 +           samba_cv_HAVE_FCNTL_LOCK=yes,samba_cv_HAVE_FCNTL_LOCK=no,samba_cv_HAVE_FCNTL_LOCK=cross)])
4486 +if test x"$samba_cv_HAVE_FCNTL_LOCK" = x"yes"; then
4487 +    AC_DEFINE(HAVE_FCNTL_LOCK,1,[Whether fcntl locking is available])
4488 +fi
4489 +
4490 +AC_CACHE_CHECK([for broken (glibc2.1/x86) 64 bit fcntl locking],samba_cv_HAVE_BROKEN_FCNTL64_LOCKS,[
4491 +AC_TRY_RUN([#include "${srcdir-.}/tests/fcntl_lock64.c"],
4492 +           samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=yes,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=no,samba_cv_HAVE_BROKEN_FCNTL64_LOCKS=cross)])
4493 +if test x"$samba_cv_HAVE_BROKEN_FCNTL64_LOCKS" = x"yes"; then
4494 +    AC_DEFINE(HAVE_BROKEN_FCNTL64_LOCKS,1,[Whether fcntl64 locks are broken])
4495 +
4496 +else
4497 +
4498 +dnl
4499 +dnl Don't check for 64 bit fcntl locking if we know that the
4500 +dnl glibc2.1 broken check has succeeded.
4501 +dnl 
4502 +
4503 +  AC_CACHE_CHECK([for 64 bit fcntl locking],samba_cv_HAVE_STRUCT_FLOCK64,[
4504 +  AC_TRY_RUN([
4505 +#if defined(HAVE_UNISTD_H)
4506 +#include <unistd.h>
4507 +#endif
4508 +#include <stdio.h>
4509 +#include <stdlib.h>
4510 +
4511 +#ifdef HAVE_FCNTL_H
4512 +#include <fcntl.h>
4513 +#endif
4514 +
4515 +#ifdef HAVE_SYS_FCNTL_H
4516 +#include <sys/fcntl.h>
4517 +#endif
4518 +main() { struct flock64 fl64;
4519 +#if defined(F_SETLKW64) && defined(F_SETLK64) && defined(F_GETLK64)
4520 +exit(0);
4521 +#else
4522 +exit(1);
4523 +#endif
4524 +}],
4525 +       samba_cv_HAVE_STRUCT_FLOCK64=yes,samba_cv_HAVE_STRUCT_FLOCK64=no,samba_cv_HAVE_STRUCT_FLOCK64=cross)])
4526 +
4527 +  if test x"$samba_cv_HAVE_STRUCT_FLOCK64" = x"yes"; then
4528 +      AC_DEFINE(HAVE_STRUCT_FLOCK64,1,[Whether the flock64 struct is available])
4529 +  fi
4530 +fi
4531 +
4532 +AC_CACHE_CHECK([for st_blocks in struct stat],samba_cv_HAVE_STAT_ST_BLOCKS,[
4533 +AC_TRY_COMPILE([#include <sys/types.h>
4534 +#include <sys/stat.h>
4535 +#include <unistd.h>],
4536 +[struct stat st;  st.st_blocks = 0;],
4537 +samba_cv_HAVE_STAT_ST_BLOCKS=yes,samba_cv_HAVE_STAT_ST_BLOCKS=no,samba_cv_HAVE_STAT_ST_BLOCKS=cross)])
4538 +if test x"$samba_cv_HAVE_STAT_ST_BLOCKS" = x"yes"; then
4539 +    AC_DEFINE(HAVE_STAT_ST_BLOCKS,1,[Whether the stat struct has a st_block property])
4540 +fi 
4541 +
4542 +AC_CACHE_CHECK([for st_blksize in struct stat],samba_cv_HAVE_STAT_ST_BLKSIZE,[
4543 +AC_TRY_COMPILE([#include <sys/types.h>
4544 +#include <sys/stat.h>
4545 +#include <unistd.h>],
4546 +[struct stat st;  st.st_blksize = 0;],
4547 +samba_cv_HAVE_STAT_ST_BLKSIZE=yes,samba_cv_HAVE_STAT_ST_BLKSIZE=no,samba_cv_HAVE_STAT_ST_BLKSIZE=cross)])
4548 +if test x"$samba_cv_HAVE_STAT_ST_BLKSIZE" = x"yes"; then
4549 +    AC_DEFINE(HAVE_STAT_ST_BLKSIZE,1,[Whether the stat struct has a st_blksize property])
4550 +fi
4551 +
4552 +case "$host_os" in
4553 +*linux*)
4554 +AC_CACHE_CHECK([for broken RedHat 7.2 system header files],samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS,[
4555 +AC_TRY_COMPILE([
4556 +#ifdef HAVE_SYS_VFS_H
4557 +#include <sys/vfs.h>
4558 +#endif
4559 +#ifdef HAVE_SYS_CAPABILITY_H
4560 +#include <sys/capability.h>
4561 +#endif
4562 +],[int i;],
4563 +   samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=no,samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS=yes)])
4564 +if test x"$samba_cv_BROKEN_REDHAT_7_SYSTEM_HEADERS" = x"yes"; then
4565 +   AC_DEFINE(BROKEN_REDHAT_7_SYSTEM_HEADERS,1,[Broken RedHat 7.2 system header files])
4566 +fi
4567 +;;
4568 +esac
4569 +
4570 +AC_CACHE_CHECK([for broken nisplus include files],samba_cv_BROKEN_NISPLUS_INCLUDE_FILES,[
4571 +AC_TRY_COMPILE([#include <sys/acl.h>
4572 +#if defined(HAVE_RPCSVC_NIS_H)
4573 +#include <rpcsvc/nis.h>
4574 +#endif],
4575 +[int i;],
4576 +samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=no,samba_cv_BROKEN_NISPLUS_INCLUDE_FILES=yes)])
4577 +if test x"$samba_cv_BROKEN_NISPLUS_INCLUDE_FILES" = x"yes"; then
4578 +       AC_DEFINE(BROKEN_NISPLUS_INCLUDE_FILES,1,[Whether the nisplus include files are broken])
4579 +fi
4580 +
4581 +
4582 +#################################################
4583 +# check for smbwrapper support
4584 +AC_MSG_CHECKING(whether to use smbwrapper)
4585 +AC_ARG_WITH(smbwrapper,
4586 +[  --with-smbwrapper       Include SMB wrapper support (default=no) ],
4587 +[ case "$withval" in
4588 +  yes)
4589 +    AC_MSG_RESULT(yes)
4590 +    AC_DEFINE(WITH_SMBWRAPPER,1,[Whether to include smbwrapper support])
4591 +       WRAPPROG="bin/smbsh\$(EXEEXT)"
4592 +       WRAP="bin/smbwrapper.$SHLIBEXT"
4593 +
4594 +# Conditions under which smbwrapper should not be built.
4595 +
4596 +       if test x$PICFLAGS = x; then
4597 +          echo No support for PIC code - disabling smbwrapper and smbsh
4598 +          WRAPPROG=""
4599 +          WRAP=""
4600 +       elif test x$ac_cv_func_syscall = xno; then
4601 +          AC_MSG_RESULT([No syscall() -- disabling smbwrapper and smbsh])
4602 +          WRAPPROG=""
4603 +          WRAP=""
4604 +       fi
4605 +       EXTRA_ALL_TARGETS="$EXTRA_ALL_TARGETS $WRAPPROG $WRAP"
4606 +       SMBWRAPPER="$WRAPPROG $WRAP"
4607 +    ;;
4608 +  *)
4609 +    AC_MSG_RESULT(no)
4610 +    ;;
4611 +  esac ],
4612 +  AC_MSG_RESULT(no)
4613 +)
4614 +
4615 +#################################################
4616 +# check for AFS clear-text auth support
4617 +AC_MSG_CHECKING(whether to use AFS clear-text auth)
4618 +AC_ARG_WITH(afs,
4619 +[  --with-afs              Include AFS clear-text auth support (default=no) ],
4620 +[ case "$withval" in
4621 +  yes)
4622 +    AC_MSG_RESULT(yes)
4623 +    AC_DEFINE(WITH_AFS,1,[Whether to include AFS clear-text auth support])
4624 +    ;;
4625 +  *)
4626 +    AC_MSG_RESULT(no)
4627 +    ;;
4628 +  esac ],
4629 +  AC_MSG_RESULT(no)
4630 +)
4631 +
4632 +####################################################
4633 +# check for Linux-specific AFS fake-kaserver support
4634 +AC_MSG_CHECKING(whether to use AFS fake-kaserver)
4635 +AC_ARG_WITH(fake-kaserver,
4636 +[  --with-fake-kaserver    Include AFS fake-kaserver support (default=no) ],
4637 +[ case "$withval" in
4638 +  yes)
4639 +    AC_MSG_RESULT(yes)
4640 +    AC_DEFINE(WITH_FAKE_KASERVER,1,[Whether to include AFS fake-kaserver support])
4641 +    ;;
4642 +  *)
4643 +    AC_MSG_RESULT(no)
4644 +    ;;
4645 +  esac ],
4646 +  AC_MSG_RESULT(no)
4647 +)
4648 +
4649 +#################################################
4650 +# check for the DFS clear-text auth system
4651 +AC_MSG_CHECKING(whether to use DFS clear-text auth)
4652 +AC_ARG_WITH(dfs,
4653 +[  --with-dce-dfs          Include DCE/DFS clear-text auth support (default=no)],
4654 +[ case "$withval" in
4655 +  yes)
4656 +    AC_MSG_RESULT(yes)
4657 +    AC_DEFINE(WITH_DFS,1,[Whether to include DFS support])
4658 +    ;;
4659 +  *)
4660 +    AC_MSG_RESULT(no)
4661 +    ;;
4662 +  esac ],
4663 +  AC_MSG_RESULT(no)
4664 +)
4665 +
4666 +########################################################
4667 +# Compile with LDAP support?
4668 +
4669 +with_ldap_support=auto
4670 +AC_MSG_CHECKING([for LDAP support])
4671 +
4672 +AC_ARG_WITH(ldap,
4673 +[  --with-ldap             LDAP support (default yes)],
4674 +[ case "$withval" in
4675 +    yes|no)
4676 +       with_ldap_support=$withval
4677 +       ;;
4678 +  esac ])
4679 +
4680 +AC_MSG_RESULT($with_ldap_support)
4681 +
4682 +SMBLDAP=""
4683 +AC_SUBST(SMBLDAP)
4684 +if test x"$with_ldap_support" != x"no"; then
4685 +
4686 +  ##################################################################
4687 +  # first test for ldap.h and lber.h
4688 +  # (ldap.h is required for this test)
4689 +  AC_CHECK_HEADERS(ldap.h lber.h)
4690 +  
4691 +  if test x"$ac_cv_header_ldap_h" != x"yes"; then
4692 +       if test x"$with_ldap_support" = x"yes"; then
4693 +        AC_MSG_ERROR(ldap.h is needed for LDAP support)
4694 +       else
4695 +        AC_MSG_WARN(ldap.h is needed for LDAP support)
4696 +       fi
4697 +       
4698 +       with_ldap_support=no
4699 +  fi
4700 +fi
4701 +
4702 +if test x"$with_ldap_support" != x"no"; then
4703 +  ac_save_LIBS=$LIBS
4704 +
4705 +  ##################################################################
4706 +  # we might need the lber lib on some systems. To avoid link errors
4707 +  # this test must be before the libldap test
4708 +  AC_CHECK_LIB_EXT(lber, LDAP_LIBS, ber_scanf)
4709 +
4710 +  ########################################################
4711 +  # now see if we can find the ldap libs in standard paths
4712 +  AC_CHECK_LIB_EXT(ldap, LDAP_LIBS, ldap_init)
4713 +
4714 +  AC_CHECK_FUNC_EXT(ldap_domain2hostlist,$LDAP_LIBS)
4715 +  
4716 +  ########################################################
4717 +  # If we have LDAP, does it's rebind procedure take 2 or 3 arguments?
4718 +  # Check found in pam_ldap 145.
4719 +  AC_CHECK_FUNC_EXT(ldap_set_rebind_proc,$LDAP_LIBS)
4720 +
4721 +  LIBS="$LIBS $LDAP_LIBS"
4722 +  AC_CACHE_CHECK(whether ldap_set_rebind_proc takes 3 arguments, smb_ldap_cv_ldap_set_rebind_proc, [
4723 +    AC_TRY_COMPILE([
4724 +       #include <lber.h>
4725 +       #include <ldap.h>], 
4726 +       [ldap_set_rebind_proc(0, 0, 0);], 
4727 +       [smb_ldap_cv_ldap_set_rebind_proc=3], 
4728 +       [smb_ldap_cv_ldap_set_rebind_proc=2]
4729 +    ) 
4730 +  ])
4731 +  
4732 +  AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS, $smb_ldap_cv_ldap_set_rebind_proc, [Number of arguments to ldap_set_rebind_proc])
4733 +
4734 +  AC_CHECK_FUNC_EXT(ldap_initialize,$LDAP_LIBS)        
4735 +  
4736 +  if test x"$ac_cv_lib_ext_ldap_ldap_init" = x"yes" -a x"$ac_cv_func_ext_ldap_domain2hostlist" = x"yes"; then
4737 +    AC_DEFINE(HAVE_LDAP,1,[Whether ldap is available])
4738 +    default_static_modules="$default_static_modules pdb_ldap idmap_ldap";
4739 +    SMBLDAP="lib/smbldap.o"
4740 +    with_ldap_support=yes
4741 +    AC_MSG_CHECKING(whether LDAP support is used)
4742 +    AC_MSG_RESULT(yes)
4743 +  else
4744 +    if test x"$with_ldap_support" = x"yes"; then
4745 +       AC_MSG_ERROR(libldap is needed for LDAP support)
4746 +    else
4747 +       AC_MSG_WARN(libldap is needed for LDAP support)
4748 +    fi
4749 +    
4750 +    LDAP_LIBS=""
4751 +    with_ldap_support=no
4752 +  fi
4753 +  LIBS=$ac_save_LIBS
4754 +fi
4755 +
4756 +
4757 +#################################################
4758 +# active directory support
4759 +
4760 +with_ads_support=auto
4761 +AC_MSG_CHECKING([for Active Directory and krb5 support])
4762 +
4763 +AC_ARG_WITH(ads,
4764 +[  --with-ads              Active Directory support (default auto)],
4765 +[ case "$withval" in
4766 +    yes|no)
4767 +       with_ads_support="$withval"
4768 +       ;;
4769 +  esac ])
4770 +
4771 +AC_MSG_RESULT($with_ads_support)
4772 +
4773 +FOUND_KRB5=no
4774 +KRB5_LIBS=""
4775 +
4776 +if test x"$with_ldap_support" != x"yes"; then
4777 +    if test x"$with_ads_support" = x"yes"; then
4778 +       AC_MSG_ERROR(Active Directory Support requires LDAP support)
4779 +    elif test x"$with_ads_support" != x"no"; then
4780 +       AC_MSG_WARN(Active Directory Support requires LDAP support)
4781 +    fi
4782 +    with_ads_support=no
4783 +fi
4784 +
4785 +if test x"$with_ads_support" != x"no"; then
4786 +
4787 +  # Do no harm to the values of CFLAGS and LIBS while testing for
4788 +  # Kerberos support.
4789 +
4790 +  #################################################
4791 +  # check for krb5-config from recent MIT and Heimdal kerberos 5
4792 +  AC_PATH_PROG(KRB5_CONFIG, krb5-config)
4793 +  AC_MSG_CHECKING(for working krb5-config)
4794 +  if test -x "$KRB5_CONFIG"; then
4795 +    ac_save_CFLAGS=$CFLAGS
4796 +    CFLAGS="";export CFLAGS
4797 +    ac_save_LDFLAGS=$LDFLAGS
4798 +    LDFLAGS="";export LDFLAGS
4799 +    KRB5_LIBS="`$KRB5_CONFIG --libs gssapi`"
4800 +    KRB5_CFLAGS="`$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`" 
4801 +    KRB5_CPPFLAGS="`$KRB5_CONFIG --cflags | sed s/@INCLUDE_des@//`"
4802 +    CFLAGS=$ac_save_CFLAGS;export CFLAGS
4803 +    LDFLAGS=$ac_save_LDFLAGS;export LDFLAGS
4804 +    FOUND_KRB5=yes
4805 +    AC_MSG_RESULT(yes)
4806 +  else
4807 +    AC_MSG_RESULT(no. Fallback to previous krb5 detection strategy)
4808 +  fi
4809 +  
4810 +  if test x$FOUND_KRB5 = x"no"; then
4811 +    #################################################
4812 +    # check for location of Kerberos 5 install
4813 +    AC_MSG_CHECKING(for kerberos 5 install path)
4814 +    AC_ARG_WITH(krb5,
4815 +    [  --with-krb5=base-dir    Locate Kerberos 5 support (default=/usr)],
4816 +    [ case "$withval" in
4817 +      no)
4818 +        AC_MSG_RESULT(no krb5-path given)
4819 +        ;;
4820 +      yes)
4821 +        AC_MSG_RESULT(/usr)
4822 +        FOUND_KRB5=yes
4823 +        ;;
4824 +      *)
4825 +        AC_MSG_RESULT($withval)
4826 +        KRB5_CFLAGS="-I$withval/include"
4827 +        KRB5_CPPFLAGS="-I$withval/include"
4828 +        KRB5_LDFLAGS="-L$withval/lib"
4829 +        FOUND_KRB5=yes
4830 +        ;;
4831 +      esac ],
4832 +      AC_MSG_RESULT(no krb5-path given)
4833 +    )
4834 +  fi
4835 +
4836 +  if test x$FOUND_KRB5 = x"no"; then
4837 +    #################################################
4838 +    # see if this box has the SuSE location for the heimdal krb implementation
4839 +    AC_MSG_CHECKING(for /usr/include/heimdal)
4840 +    if test -d /usr/include/heimdal; then
4841 +      if test -f /usr/lib/heimdal/lib/libkrb5.a; then
4842 +          KRB5_CFLAGS="-I/usr/include/heimdal"
4843 +          KRB5_CPPFLAGS="-I/usr/include/heimdal"
4844 +          KRB5_LDFLAGS="-L/usr/lib/heimdal/lib"
4845 +          AC_MSG_RESULT(yes)
4846 +      else
4847 +          KRB5_CFLAGS="-I/usr/include/heimdal"
4848 +          KRB5_CPPFLAGS="-I/usr/include/heimdal"
4849 +          AC_MSG_RESULT(yes)
4850 +      fi
4851 +    else
4852 +      AC_MSG_RESULT(no)
4853 +    fi
4854 +  fi
4855 +
4856 +  if test x$FOUND_KRB5 = x"no"; then
4857 +    #################################################
4858 +    # see if this box has the RedHat location for kerberos
4859 +    AC_MSG_CHECKING(for /usr/kerberos)
4860 +    if test -d /usr/kerberos -a -f /usr/kerberos/lib/libkrb5.a; then
4861 +      KRB5_LDFLAGS="-L/usr/kerberos/lib"
4862 +      KRB5_CFLAGS="-I/usr/kerberos/include"
4863 +      KRB5_CPPFLAGS="-I/usr/kerberos/include"
4864 +      AC_MSG_RESULT(yes)
4865 +    else
4866 +      AC_MSG_RESULT(no)
4867 +    fi
4868 +  fi
4869 +
4870 +  ac_save_CFLAGS=$CFLAGS
4871 +  ac_save_CPPFLAGS=$CPPFLAGS
4872 +  ac_save_LDFLAGS=$LDFLAGS
4873 +
4874 +  CFLAGS="$CFLAGS $KRB5_CFLAGS"
4875 +  CPPFLAGS="$CPPFLAGS $KRB5_CPPFLAGS"
4876 +  LDFLAGS="$LDFLAGS $KRB5_LDFLAGS"
4877 +
4878 +  KRB5_LIBS="$KRB5_LDFLAGS $KRB5_LIBS"
4879 +
4880 +  # now check for krb5.h. Some systems have the libraries without the headers!
4881 +  # note that this check is done here to allow for different kerberos
4882 +  # include paths
4883 +  AC_CHECK_HEADERS(krb5.h)
4884 +
4885 +  if test x"$ac_cv_header_krb5_h" = x"no"; then
4886 +
4887 +    # Give a warning if AD support was not explicitly requested,
4888 +    # i.e with_ads_support = auto, otherwise die with an error.
4889 +
4890 +    if test x"$with_ads_support" = x"yes"; then
4891 +      AC_MSG_ERROR([Active Directory cannot be supported without krb5.h])
4892 +    else
4893 +      AC_MSG_WARN([Active Directory cannot be supported without krb5.h])
4894 +    fi
4895 +
4896 +    # Turn off AD support and restore CFLAGS and LIBS variables
4897 +
4898 +    with_ads_support="no"
4899 +    
4900 +    CFLAGS=$ac_save_CFLAGS
4901 +    CPPFLAGS=$ac_save_CPPFLAGS
4902 +    LDFLAGS=$ac_save_LDFLAGS
4903 +  fi
4904 +fi
4905 +
4906 +# Now we have determined whether we really want ADS support
4907 +
4908 +if test x"$with_ads_support" != x"no"; then
4909 +  ac_save_LIBS=$LIBS
4910 +
4911 +  # now check for gssapi headers.  This is also done here to allow for
4912 +  # different kerberos include paths
4913 +  AC_CHECK_HEADERS(gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h com_err.h)
4914 +
4915 +  ##################################################################
4916 +  # we might need the k5crypto and com_err libraries on some systems
4917 +  AC_CHECK_LIB_EXT(com_err, KRB5_LIBS, _et_list)
4918 +  AC_CHECK_LIB_EXT(k5crypto, KRB5_LIBS, krb5_encrypt_data)
4919 +
4920 +  # Heimdal checks.
4921 +  AC_CHECK_LIB_EXT(crypto, KRB5_LIBS, des_set_key)
4922 +  AC_CHECK_LIB_EXT(asn1, KRB5_LIBS, copy_Authenticator)
4923 +  AC_CHECK_LIB_EXT(roken, KRB5_LIBS, roken_getaddrinfo_hostspec)
4924 +
4925 +  # Heimdal checks. On static Heimdal gssapi must be linked before krb5.
4926 +  AC_CHECK_LIB_EXT(gssapi, KRB5_LIBS, gss_display_status,[],[],
4927 +                               AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available]))
4928 +
4929 +  ########################################################
4930 +  # now see if we can find the krb5 libs in standard paths
4931 +  # or as specified above
4932 +  AC_CHECK_LIB_EXT(krb5, KRB5_LIBS, krb5_mk_req_extended)
4933 +
4934 +  ########################################################
4935 +  # now see if we can find the gssapi libs in standard paths
4936 +  AC_CHECK_LIB_EXT(gssapi_krb5, KRB5_LIBS,gss_display_status,[],[],
4937 +           AC_DEFINE(HAVE_GSSAPI,1,[Whether GSSAPI is available]))
4938 +
4939 +  AC_CHECK_FUNC_EXT(krb5_set_real_time, $KRB5_LIBS)
4940 +  AC_CHECK_FUNC_EXT(krb5_set_default_in_tkt_etypes, $KRB5_LIBS)
4941 +  AC_CHECK_FUNC_EXT(krb5_set_default_tgs_ktypes, $KRB5_LIBS)
4942 +  AC_CHECK_FUNC_EXT(krb5_principal2salt, $KRB5_LIBS)
4943 +  AC_CHECK_FUNC_EXT(krb5_use_enctype, $KRB5_LIBS)
4944 +  AC_CHECK_FUNC_EXT(krb5_string_to_key, $KRB5_LIBS) 
4945 +  AC_CHECK_FUNC_EXT(krb5_get_pw_salt, $KRB5_LIBS)
4946 +  AC_CHECK_FUNC_EXT(krb5_string_to_key_salt, $KRB5_LIBS) 
4947 +  AC_CHECK_FUNC_EXT(krb5_auth_con_setkey, $KRB5_LIBS)
4948 +  AC_CHECK_FUNC_EXT(krb5_auth_con_setuseruserkey, $KRB5_LIBS) 
4949 +  AC_CHECK_FUNC_EXT(krb5_locate_kdc, $KRB5_LIBS)
4950 +  AC_CHECK_FUNC_EXT(krb5_get_permitted_enctypes, $KRB5_LIBS) 
4951 +  AC_CHECK_FUNC_EXT(krb5_get_default_in_tkt_etypes, $KRB5_LIBS) 
4952 +  AC_CHECK_FUNC_EXT(krb5_free_ktypes, $KRB5_LIBS)
4953 +  AC_CHECK_FUNC_EXT(krb5_principal_get_comp_string, $KRB5_LIBS)
4954 +
4955 +  LIBS="$LIBS $KRB5_LIBS"
4956 +  
4957 +  AC_CACHE_CHECK([for addrtype in krb5_address],
4958 +                samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS,[
4959 +    AC_TRY_COMPILE([#include <krb5.h>],
4960 +      [krb5_address kaddr; kaddr.addrtype = ADDRTYPE_INET;],
4961 +      samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS=yes,
4962 +      samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS=no)])
4963 +
4964 +  if test x"$samba_cv_HAVE_ADDRTYPE_IN_KRB5_ADDRESS" = x"yes"; then
4965 +    AC_DEFINE(HAVE_ADDRTYPE_IN_KRB5_ADDRESS,1,
4966 +               [Whether the krb5_address struct has a addrtype property])
4967 +  fi
4968 +
4969 +  AC_CACHE_CHECK([for addr_type in krb5_address],
4970 +                 samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS,[
4971 +    AC_TRY_COMPILE([#include <krb5.h>],
4972 +      [krb5_address kaddr; kaddr.addr_type = KRB5_ADDRESS_INET;],
4973 +      samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS=yes,
4974 +      samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS=no)])
4975 +
4976 +  if test x"$samba_cv_HAVE_ADDR_TYPE_IN_KRB5_ADDRESS" = x"yes"; then
4977 +    AC_DEFINE(HAVE_ADDR_TYPE_IN_KRB5_ADDRESS,1,
4978 +              [Whether the krb5_address struct has a addr_type property])
4979 +  fi
4980 +
4981 +  AC_CACHE_CHECK([for enc_part2 in krb5_ticket], 
4982 +                samba_cv_HAVE_KRB5_TKT_ENC_PART2,
4983 +                 [AC_TRY_COMPILE([#include <krb5.h>],
4984 +    [krb5_ticket tkt; tkt.enc_part2->authorization_data[0]->contents = NULL;],
4985 +    samba_cv_HAVE_KRB5_TKT_ENC_PART2=yes,samba_cv_HAVE_KRB5_TKT_ENC_PART2=no)])
4986 +
4987 +  if test x"$samba_cv_HAVE_KRB5_TKT_ENC_PART2" = x"yes"; then
4988 +    AC_DEFINE(HAVE_KRB5_TKT_ENC_PART2,1,
4989 +              [Whether the krb5_ticket struct has a enc_part2 property])
4990 +  fi
4991 +
4992 +  AC_CACHE_CHECK([for keyvalue in krb5_keyblock],
4993 +                 samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE,[
4994 +    AC_TRY_COMPILE([#include <krb5.h>],
4995 +      [krb5_keyblock key; key.keyvalue.data = NULL;],
4996 +      samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE=yes,
4997 +      samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE=no)])
4998 +
4999 +  if test x"$samba_cv_HAVE_KRB5_KEYBLOCK_KEYVALUE" = x"yes"; then
5000 +    AC_DEFINE(HAVE_KRB5_KEYBLOCK_KEYVALUE,1,
5001 +              [Whether the krb5_keyblock struct has a keyvalue property])
5002 +  fi
5003 +
5004 +  AC_CACHE_CHECK([for ENCTYPE_ARCFOUR_HMAC_MD5],
5005 +                 samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC_MD5,[
5006 +    AC_TRY_COMPILE([#include <krb5.h>],
5007 +      [krb5_enctype enctype; enctype = ENCTYPE_ARCFOUR_HMAC_MD5;],
5008 +      samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC_MD5=yes,
5009 +      samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC_MD5=no)])
5010 +  AC_CACHE_CHECK([for KEYTYPE_ARCFOUR_56],
5011 +                 samba_cv_HAVE_KEYTYPE_ARCFOUR_56,[
5012 +    AC_TRY_COMPILE([#include <krb5.h>],
5013 +      [krb5_keytype keytype; keytype = KEYTYPE_ARCFOUR_56;],
5014 +      samba_cv_HAVE_KEYTYPE_ARCFOUR_56=yes,
5015 +      samba_cv_HAVE_KEYTYPE_ARCFOUR_56=no)])
5016 +# Heimdals with KEYTYPE_ARCFOUR but not KEYTYPE_ARCFOUR_56 are broken
5017 +# w.r.t. arcfour and windows, so we must not enable it here
5018 +  if test x"$samba_cv_HAVE_ENCTYPE_ARCFOUR_HMAC_MD5" = x"yes" -a\
5019 +          x"$samba_cv_HAVE_KEYTYPE_ARCFOUR_56" = x"yes"; then
5020 +    AC_DEFINE(HAVE_ENCTYPE_ARCFOUR_HMAC_MD5,1,
5021 +              [Whether the ENCTYPE_ARCFOUR_HMAC_MD5 key type is available])
5022 +  fi
5023 +
5024 +  AC_CACHE_CHECK([for AP_OPTS_USE_SUBKEY],
5025 +                 samba_cv_HAVE_AP_OPTS_USE_SUBKEY,[
5026 +    AC_TRY_COMPILE([#include <krb5.h>],
5027 +      [krb5_flags ap_options; ap_options = AP_OPTS_USE_SUBKEY;],
5028 +      samba_cv_HAVE_AP_OPTS_USE_SUBKEY=yes,
5029 +      samba_cv_HAVE_AP_OPTS_USE_SUBKEY=no)])
5030 +
5031 +  if test x"$samba_cv_HAVE_AP_OPTS_USE_SUBKEY" = x"yes"; then
5032 +    AC_DEFINE(HAVE_AP_OPTS_USE_SUBKEY,1,
5033 +              [Whether the AP_OPTS_USE_SUBKEY ap option is available])
5034 +  fi
5035 +
5036 +  AC_CACHE_CHECK([for the krb5_princ_component macro],
5037 +                samba_cv_HAVE_KRB5_PRINC_COMPONENT,[
5038 +    AC_TRY_LINK([#include <krb5.h>],
5039 +      [const krb5_data *pkdata; krb5_context context; krb5_principal principal; pkdata = krb5_princ_component(context, principal, 0);],
5040 +      samba_cv_HAVE_KRB5_PRINC_COMPONENT=yes,
5041 +      samba_cv_HAVE_KRB5_PRINC_COMPONENT=no)])
5042 +
5043 +  if test x"$samba_cv_HAVE_KRB5_PRINC_COMPONENT" = x"yes"; then
5044 +    AC_DEFINE(HAVE_KRB5_PRINC_COMPONENT,1,
5045 +               [Whether krb5_princ_component is available])
5046 +  fi
5047 +
5048 +  AC_CACHE_CHECK([for memory keytab support],
5049 +                samba_cv_HAVE_MEMORY_KEYTAB,[
5050 +    AC_TRY_RUN([
5051 +#include<krb5.h>
5052 +  main()
5053 +  {
5054 +    krb5_context context;
5055 +    krb5_keytab keytab;
5056 +    
5057 +    krb5_init_context(&context);
5058 +    if (krb5_kt_resolve(context, "MEMORY:", &keytab))
5059 +      exit(0);
5060 +    exit(1);
5061 +  }], 
5062 +  samba_cv_HAVE_MEMORY_KEYTAB=yes,
5063 +  samba_cv_HAVE_MEMORY_KEYTAB=no)])
5064 +
5065 +  if test x"$samba_cv_HAVE_MEMORY_KEYTAB" = x"yes"; then
5066 +      AC_DEFINE(HAVE_MEMORY_KEYTAB,1,
5067 +               [Whether in-memory keytabs are supported])
5068 +  fi
5069 +
5070 +  AC_CACHE_CHECK([for key in krb5_keytab_entry],
5071 +                 samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEY,[
5072 +    AC_TRY_COMPILE([#include <krb5.h>],
5073 +      [krb5_keytab_entry entry; krb5_keyblock e; entry.key = e;],
5074 +      samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEY=yes,
5075 +      samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEY=no)])
5076 +
5077 +  if test x"$samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEY" = x"yes"; then
5078 +    AC_DEFINE(HAVE_KRB5_KEYTAB_ENTRY_KEY,1,
5079 +              [Whether krb5_keytab_entry has key member])
5080 +  fi
5081 +
5082 +  AC_CACHE_CHECK([for keyblock in krb5_keytab_entry],
5083 +                 samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK,[
5084 +    AC_TRY_COMPILE([#include <krb5.h>],
5085 +      [krb5_keytab_entry entry; entry.keyblock.keytype = 0;],
5086 +      samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK=yes,
5087 +      samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK=no)])
5088 +
5089 +  if test x"$samba_cv_HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK" = x"yes"; then
5090 +    AC_DEFINE(HAVE_KRB5_KEYTAB_ENTRY_KEYBLOCK,1,
5091 +              [Whether krb5_keytab_entry has keyblock member])
5092 +  fi
5093 +
5094 +  if test x"$ac_cv_lib_ext_krb5_krb5_mk_req_extended" = x"yes"; then
5095 +    AC_DEFINE(HAVE_KRB5,1,[Whether to have KRB5 support])
5096 +    AC_DEFINE(WITH_ADS,1,[Whether to include Active Directory support])
5097 +    AC_MSG_CHECKING(whether Active Directory and krb5 support is used)
5098 +    AC_MSG_RESULT(yes)
5099 +  else
5100 +    if test x"$with_ads_support" = x"yes"; then
5101 +       AC_MSG_ERROR(libkrb5 is needed for Active Directory support)
5102 +    else
5103 +       AC_MSG_WARN(libkrb5 is needed for Active Directory support)
5104 +    fi
5105 +    KRB5_LIBS=""
5106 +    with_ads_support=no 
5107 +  fi
5108 +  LIBS="$ac_save_LIBS"
5109 +fi
5110 +
5111 +########################################################
5112 +# Compile experimental passdb backends?
5113 +# (pdb_xml, pdb_mysql)
5114 +AC_MSG_CHECKING(whether to build experimental passdb libraries)
5115 +AC_ARG_WITH(expsam,
5116 +[  --with-expsam=<list>    Include experimental passdb libraries (default=no)]
5117 +[                          Valid choices include (comma separated list): ]
5118 +[                              xml & mysql],
5119 +[ expsam_pdb_modules=`echo "$withval" | sed 's/,/ /g'`
5120 +  if test "z$expsam_pdb_modules" = "zyes"; then
5121 +    expsam_pdb_modules="xml mysql"
5122 +  fi
5123 +  AC_MSG_RESULT($expsam_pdb_modules)
5124 +  for i in $expsam_pdb_modules
5125 +  do 
5126 +    case "$i" in
5127 +    xml)
5128 +      ## pdb_xml
5129 +         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])])
5130 +      CFLAGS="$CFLAGS $XML_CFLAGS"
5131 +      ;;
5132 +    mysql)
5133 +      ## pdb_mysql
5134 +         AM_PATH_MYSQL([default_shared_modules="$default_shared_modules pdb_mysql"],[AC_MSG_ERROR([Can't find MySQL libraries while MySQL support is requested])])
5135 +      CFLAGS="$CFLAGS $MYSQL_CFLAGS"
5136 +      ;;
5137 +    no)
5138 +      ;;
5139 +    *)
5140 +      echo "Unknown module name \"$i\"!  Exiting..."
5141 +      exit 1
5142 +      ;;
5143 +    esac
5144 +  done ],
5145 +  AC_MSG_RESULT(no)
5146 +)
5147 +
5148 +#################################################
5149 +# check for automount support
5150 +AC_MSG_CHECKING(whether to use automount)
5151 +AC_ARG_WITH(automount,
5152 +[  --with-automount        Include automount support (default=no)],
5153 +[ case "$withval" in
5154 +  yes)
5155 +    AC_MSG_RESULT(yes)
5156 +    AC_DEFINE(WITH_AUTOMOUNT,1,[Whether to include automount support])
5157 +    ;;
5158 +  *)
5159 +    AC_MSG_RESULT(no)
5160 +    ;;
5161 +  esac ],
5162 +  AC_MSG_RESULT(no)
5163 +)
5164 +
5165 +#################################################
5166 +# check for smbmount support
5167 +AC_MSG_CHECKING(whether to use smbmount)
5168 +AC_ARG_WITH(smbmount,
5169 +[  --with-smbmount         Include smbmount (Linux only) support (default=no)],
5170 +[ case "$withval" in
5171 +  yes)
5172 +       case "$host_os" in
5173 +       *linux*)
5174 +               AC_MSG_RESULT(yes)
5175 +               AC_DEFINE(WITH_SMBMOUNT,1,[Whether to build smbmount])
5176 +               EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/smbmount bin/smbmnt bin/smbumount"
5177 +               ;;
5178 +       *)
5179 +               AC_MSG_ERROR(not on a linux system!)
5180 +               ;;
5181 +       esac
5182 +    ;;
5183 +  *)
5184 +    AC_MSG_RESULT(no)
5185 +    ;;
5186 +  esac ],
5187 +  AC_MSG_RESULT(no)
5188 +)
5189 +
5190 +
5191 +#################################################
5192 +# check for a PAM clear-text auth, accounts, password and session support
5193 +with_pam_for_crypt=no
5194 +AC_MSG_CHECKING(whether to use PAM)
5195 +AC_ARG_WITH(pam,
5196 +[  --with-pam              Include PAM support (default=no)],
5197 +[ case "$withval" in
5198 +  yes)
5199 +    AC_MSG_RESULT(yes)
5200 +    if test x"$ac_cv_header_security_pam_appl_h" = x"no"; then
5201 +       if test x"$ac_cv_header_security_pam_modules_h" = x"no"; then
5202 +         if test x"$ac_cv_header_security__pam_macros_h" = x"no"; then
5203 +            AC_MSG_ERROR(--with-pam specified but no PAM headers found)
5204 +         fi
5205 +       fi
5206 +    fi
5207 +    AC_DEFINE(WITH_PAM,1,[Whether to include PAM support])
5208 +    AUTH_LIBS="$AUTH_LIBS -lpam"
5209 +    with_pam_for_crypt=yes
5210 +    ;;
5211 +  *)
5212 +    AC_MSG_RESULT(no)
5213 +    ;;
5214 +  esac ],
5215 +  AC_MSG_RESULT(no)
5216 +)
5217 +
5218 +# we can't build a pam module if we don't have pam.
5219 +AC_CHECK_LIB(pam, pam_get_data, [AC_DEFINE(HAVE_LIBPAM,1,[Whether libpam is available])])
5220 +
5221 +#################################################
5222 +# check for pam_smbpass support
5223 +AC_MSG_CHECKING(whether to use pam_smbpass)
5224 +AC_ARG_WITH(pam_smbpass,
5225 +[  --with-pam_smbpass      Build PAM module for authenticating against passdb backends (default=no)],
5226 +[ case "$withval" in
5227 +  yes)
5228 +    AC_MSG_RESULT(yes)
5229 +
5230 +       # Conditions under which pam_smbpass should not be built.
5231 +
5232 +       if test x$PICFLAGS = x; then
5233 +          AC_MSG_ERROR([No support for PIC code])
5234 +       elif test x"$ac_cv_header_security_pam_appl_h" = x"no"; then
5235 +         AC_MSG_ERROR([No security/pam_appl.h found])
5236 +       elif test x$ac_cv_lib_pam_pam_get_data = xno; then
5237 +          AC_MSG_ERROR([No libpam found])
5238 +       else
5239 +         AUTH_LIBS="$AUTH_LIBS -lpam"
5240 +          SHLIB_PROGS="$SHLIB_PROGS bin/pam_smbpass.$SHLIBEXT"
5241 +       fi
5242 +    ;;
5243 +  *)
5244 +    AC_MSG_RESULT(no)
5245 +    ;;
5246 +  esac ],
5247 +  AC_MSG_RESULT(no)
5248 +)
5249 +
5250 +
5251 +###############################################
5252 +# test for where we get crypt() from
5253 +AC_SEARCH_LIBS(crypt, [crypt],
5254 +  [test "$ac_cv_search_crypt" = "none required" || AUTH_LIBS="-lcrypt $AUTH_LIBS"
5255 +  AC_DEFINE(HAVE_CRYPT,1,[Whether the system has the crypt() function])])
5256 +
5257 +##
5258 +## moved after the check for -lcrypt in order to
5259 +## ensure that the necessary libraries are included
5260 +## check checking for truncated salt.  Wrapped by the
5261 +## $with_pam_for_crypt variable as above   --jerry
5262 +##
5263 +if test $with_pam_for_crypt = no; then
5264 +AC_CACHE_CHECK([for a crypt that needs truncated salt],samba_cv_HAVE_TRUNCATED_SALT,[
5265 +crypt_LIBS="$LIBS"
5266 +LIBS="$AUTH_LIBS $LIBS"
5267 +AC_TRY_RUN([#include "${srcdir-.}/tests/crypttest.c"],
5268 +       samba_cv_HAVE_TRUNCATED_SALT=no,samba_cv_HAVE_TRUNCATED_SALT=yes,samba_cv_HAVE_TRUNCATED_SALT=cross)
5269 +LIBS="$crypt_LIBS"])
5270 +if test x"$samba_cv_HAVE_TRUNCATED_SALT" = x"yes"; then
5271 +       AC_DEFINE(HAVE_TRUNCATED_SALT,1,[Whether crypt needs truncated salt])
5272 +fi
5273 +fi
5274 +
5275 +########################################################################################
5276 +##
5277 +## TESTS FOR SAM BACKENDS.  KEEP THESE GROUPED TOGETHER
5278 +##
5279 +########################################################################################
5280 +
5281 +#################################################
5282 +# check for a LDAP password database configuration backwards compatibility
5283 +AC_MSG_CHECKING(whether to use LDAP SAM 2.2 compatible configuration)
5284 +AC_ARG_WITH(ldapsam,
5285 +[  --with-ldapsam          Include LDAP SAM 2.2 compatible configuration (default=no)],
5286 +[ case "$withval" in
5287 +  yes)
5288 +    AC_MSG_RESULT(yes)
5289 +    AC_DEFINE(WITH_LDAP_SAMCONFIG,1,[Whether to include 2.2 compatible LDAP SAM configuration])
5290 +    ;;
5291 +  *)
5292 +    AC_MSG_RESULT(no)
5293 +    ;;
5294 +  esac ],
5295 +  AC_MSG_RESULT(no)
5296 +)
5297 +
5298 +########################################################################################
5299 +##
5300 +## END OF TESTS FOR SAM BACKENDS.  
5301 +##
5302 +########################################################################################
5303 +
5304 +#################################################
5305 +# check for a NISPLUS_HOME support 
5306 +AC_MSG_CHECKING(whether to use NISPLUS_HOME)
5307 +AC_ARG_WITH(nisplus-home,
5308 +[  --with-nisplus-home     Include NISPLUS_HOME support (default=no)],
5309 +[ case "$withval" in
5310 +  yes)
5311 +    AC_MSG_RESULT(yes)
5312 +    AC_DEFINE(WITH_NISPLUS_HOME,1,[Whether to include nisplus_home support])
5313 +    ;;
5314 +  *)
5315 +    AC_MSG_RESULT(no)
5316 +    ;;
5317 +  esac ],
5318 +  AC_MSG_RESULT(no)
5319 +)
5320 +
5321 +#################################################
5322 +# check for syslog logging
5323 +AC_MSG_CHECKING(whether to use syslog logging)
5324 +AC_ARG_WITH(syslog,
5325 +[  --with-syslog           Include experimental SYSLOG support (default=no)],
5326 +[ case "$withval" in
5327 +  yes)
5328 +    AC_MSG_RESULT(yes)
5329 +    AC_DEFINE(WITH_SYSLOG,1,[Whether to include experimental syslog support])
5330 +    ;;
5331 +  *)
5332 +    AC_MSG_RESULT(no)
5333 +    ;;
5334 +  esac ],
5335 +  AC_MSG_RESULT(no)
5336 +)
5337 +
5338 +#################################################
5339 +# check for a shared memory profiling support
5340 +AC_MSG_CHECKING(whether to use profiling)
5341 +AC_ARG_WITH(profiling-data,
5342 +[  --with-profiling-data   Include gathering source code profile information (default=no)],
5343 +[ case "$withval" in
5344 +  yes)
5345 +    AC_MSG_RESULT(yes)
5346 +    AC_DEFINE(WITH_PROFILE,1,[Whether to use profiling])
5347 +    ;;
5348 +  *)
5349 +    AC_MSG_RESULT(no)
5350 +    ;;
5351 +  esac ],
5352 +  AC_MSG_RESULT(no)
5353 +)
5354 +
5355 +
5356 +#################################################
5357 +# check for experimental disk-quotas support
5358 +
5359 +samba_cv_WITH_QUOTAS=auto
5360 +samba_cv_TRY_QUOTAS=no
5361 +samba_cv_RUN_QUOTA_TESTS=auto
5362 +samba_cv_WITH_SYS_QUOTAS=auto
5363 +samba_cv_TRY_SYS_QUOTAS=no
5364 +
5365 +AC_MSG_CHECKING(whether to try disk-quotas support)
5366 +AC_ARG_WITH(quotas,
5367 +[  --with-quotas           Include disk-quota support (default=no)],
5368 +[ case "$withval" in
5369 +  yes)
5370 +    AC_MSG_RESULT(yes)
5371 +    samba_cv_WITH_QUOTAS=yes
5372 +    samba_cv_TRY_QUOTAS=yes
5373 +    samba_cv_RUN_QUOTA_TESTS=yes
5374 +    #set sys quotas to auto in this case
5375 +    samba_cv_TRY_SYS_QUOTAS=auto
5376 +    ;;
5377 +  auto)
5378 +    AC_MSG_RESULT(auto)
5379 +    samba_cv_WITH_QUOTAS=auto
5380 +    samba_cv_TRY_QUOTAS=auto
5381 +    samba_cv_RUN_QUOTA_TESTS=auto
5382 +    #set sys quotas to auto in this case
5383 +    samba_cv_TRY_SYS_QUOTAS=auto
5384 +    ;;
5385 +  no)
5386 +    AC_MSG_RESULT(no)
5387 +    samba_cv_WITH_QUOTAS=no
5388 +    samba_cv_TRY_QUOTAS=no
5389 +    samba_cv_RUN_QUOTA_TESTS=no
5390 +    ;;
5391 +  *)
5392 +    AC_MSG_RESULT(${samba_cv_TRY_QUOTAS})
5393 +    ;;
5394 +  esac ],
5395 +  AC_MSG_RESULT(${samba_cv_TRY_QUOTAS})
5396 +)
5397 +
5398 +AC_MSG_CHECKING(whether to try the new lib/sysquotas.c interface)
5399 +AC_ARG_WITH(sys-quotas,
5400 +[  --with-sys-quotas       Include lib/sysquotas.c support (default=auto)],
5401 +[ case "$withval" in
5402 +  yes)
5403 +    AC_MSG_RESULT(yes)
5404 +    samba_cv_WITH_SYS_QUOTAS=yes
5405 +    samba_cv_TRY_SYS_QUOTAS=yes
5406 +    samba_cv_RUN_QUOTA_TESTS=yes
5407 +    ;;
5408 +  auto)
5409 +    AC_MSG_RESULT(auto)
5410 +    samba_cv_WITH_SYS_QUOTAS=auto
5411 +    samba_cv_TRY_SYS_QUOTAS=auto
5412 +    samba_cv_RUN_QUOTA_TESTS=auto
5413 +    ;;
5414 +  no)
5415 +    AC_MSG_RESULT(no)
5416 +    samba_cv_WITH_SYS_QUOTAS=no
5417 +    samba_cv_TRY_SYS_QUOTAS=no
5418 +    ;;
5419 +  *)
5420 +    AC_MSG_RESULT(${samba_cv_TRY_SYS_QUOTAS})
5421 +    ;;
5422 +  esac ],
5423 +  AC_MSG_RESULT(${samba_cv_TRY_SYS_QUOTAS})
5424 +)
5425 +
5426 +if test x"$samba_cv_TRY_SYS_QUOTAS" = x"auto"; then
5427 +AC_MSG_CHECKING(whether to try the lib/sysquotas.c interface on ${host_os})
5428 +  case "$host_os" in
5429 +       *linux*)
5430 +           AC_MSG_RESULT(yes)
5431 +            samba_cv_TRY_SYS_QUOTAS=yes
5432 +            samba_cv_RUN_QUOTA_TESTS=yes
5433 +           ;;
5434 +       *)
5435 +           AC_MSG_RESULT(no)
5436 +            samba_cv_TRY_SYS_QUOTAS=no
5437 +           ;;
5438 +  esac
5439 +fi
5440 +
5441 +#############################################
5442 +# only check for quota stuff if --with-quotas
5443 +if test x"$samba_cv_RUN_QUOTA_TESTS" != x"no"; then
5444 +
5445 +# For quotas on Veritas VxFS filesystems
5446 +AC_CHECK_HEADERS(sys/fs/vx_quota.h)
5447 +
5448 +# For sys/quota.h and linux/quota.h
5449 +AC_CHECK_HEADERS(sys/quota.h)
5450 +AC_CHECK_HEADERS(asm/types.h linux/quota.h)
5451 +
5452 +# For quotas on Linux XFS filesystems
5453 +AC_CHECK_HEADERS(linux/xqm.h linux/xfs_fs.h)
5454 +AC_CHECK_HEADERS(xfs/libxfs.h xfs/xqm.h xfs/xfs_fs.h)
5455 +# For linux > 2.5.56 
5456 +AC_CHECK_HEADERS(linux/dqblk_xfs.h)
5457 +
5458 +# if we have struct if_dqblk in <linux/quota.h> we should use it
5459 +AC_CACHE_CHECK([for struct if_dqblk in <linux/quota.h>],samba_cv_HAVE_STRUCT_IF_DQBLK, [
5460 +AC_TRY_COMPILE([
5461 +#include "confdefs.h"
5462 +#ifdef HAVE_SYS_TYPES_H
5463 +#include <sys/types.h>
5464 +#endif
5465 +#ifdef HAVE_ASM_TYPES_H
5466 +#include <asm/types.h>
5467 +#endif
5468 +#include <linux/quota.h>
5469 +],[struct if_dqblk D;],
5470 +samba_cv_HAVE_STRUCT_IF_DQBLK=yes,samba_cv_HAVE_STRUCT_IF_DQBLK=no)])
5471 +if test "$samba_cv_HAVE_STRUCT_IF_DQBLK"x = "yes"x; then
5472 +       AC_DEFINE(HAVE_STRUCT_IF_DQBLK,1,[struct if_dqblk])
5473 +fi
5474 +
5475 +# if we have struct mem_dqblk in <linux/quota.h> we should use it
5476 +AC_CACHE_CHECK([for struct mem_dqblk in <linux/quota.h>],samba_cv_HAVE_STRUCT_MEM_DQBLK, [
5477 +AC_TRY_COMPILE([
5478 +#include "confdefs.h"
5479 +#ifdef HAVE_SYS_TYPES_H
5480 +#include <sys/types.h>
5481 +#endif
5482 +#ifdef HAVE_ASM_TYPES_H
5483 +#include <asm/types.h>
5484 +#endif
5485 +#include <linux/quota.h>
5486 +],[struct mem_dqblk D;],
5487 +samba_cv_HAVE_STRUCT_MEM_DQBLK=yes,samba_cv_HAVE_STRUCT_MEM_DQBLK=no)])
5488 +if test "$samba_cv_HAVE_STRUCT_MEM_DQBLK"x = "yes"x; then
5489 +       AC_DEFINE(HAVE_STRUCT_MEM_DQBLK,1,[struct mem_dqblk])
5490 +fi
5491 +
5492 +# if we have struct dqblk .dqb_fsoftlimit instead of .dqb_isoftlimit on IRIX 
5493 +AC_CACHE_CHECK([if struct dqblk has .dqb_fsoftlimit],samba_cv_HAVE_DQB_FSOFTLIMIT, [
5494 +AC_TRY_COMPILE([
5495 +#include "confdefs.h"
5496 +#ifdef HAVE_SYS_QUOTA_H
5497 +#include <sys/quota.h>
5498 +#endif
5499 +],[
5500 +struct dqblk D;
5501 +D.dqb_fsoftlimit = 0;],
5502 +samba_cv_HAVE_DQB_FSOFTLIMIT=yes,samba_cv_HAVE_DQB_FSOFTLIMIT=no)])
5503 +if test "$samba_cv_HAVE_DQB_FSOFTLIMIT"x = "yes"x; then
5504 +       AC_DEFINE(HAVE_DQB_FSOFTLIMIT,1,[struct dqblk .dqb_fsoftlimit])
5505 +fi
5506 +
5507 +##################
5508 +# look for a working quota system
5509 +samba_cv_SYSQUOTA_FOUND=no;
5510 +
5511 +if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then
5512 +AC_CACHE_CHECK([for long quotactl(int cmd, char *special, qid_t id, caddr_t addr)],samba_cv_HAVE_QUOTACTL_4A,[
5513 +AC_TRY_RUN_STRICT([
5514 +#define HAVE_QUOTACTL_4A 1
5515 +#define AUTOCONF_TEST 1
5516 +#include "confdefs.h"
5517 +#include "${srcdir-.}/tests/sysquotas.c"],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
5518 +           samba_cv_HAVE_QUOTACTL_4A=yes,samba_cv_HAVE_QUOTACTL_4A=no,samba_cv_HAVE_QUOTACTL_4A=cross)])
5519 +if test x"$samba_cv_HAVE_QUOTACTL_4A" = x"yes"; then
5520 +    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])
5521 +fi
5522 +fi
5523 +
5524 +if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then
5525 +AC_CACHE_CHECK([for int quotactl(const char *path, int cmd, int id, char *addr)],samba_cv_HAVE_QUOTACTL_4B,[
5526 +AC_TRY_RUN_STRICT([
5527 +#define HAVE_QUOTACTL_4B 1
5528 +#define AUTOCONF_TEST 1
5529 +#include "confdefs.h"
5530 +#include "${srcdir-.}/tests/sysquotas.c"],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
5531 +           samba_cv_HAVE_QUOTACTL_4B=yes,samba_cv_HAVE_QUOTACTL_4B=no,samba_cv_HAVE_QUOTACTL_4B=cross)])
5532 +if test x"$samba_cv_HAVE_QUOTACTL_4B" = x"yes"; then
5533 +    echo "int quotactl(const char *path, int cmd, int id, char *addr) is not reworked for the new sys_quota api"
5534 +#    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])
5535 +fi
5536 +fi
5537 +
5538 +if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then
5539 +AC_CACHE_CHECK([for CRAY int quotactl (char *spec, int request, char *arg)],samba_cv_HAVE_QUOTACTL_3,[
5540 +AC_TRY_RUN_STRICT([
5541 +#define HAVE_QUOTACTL_3 1
5542 +#define AUTOCONF_TEST 1
5543 +#include "confdefs.h"
5544 +#include "${srcdir-.}/tests/sysquotas.c"],[$Werror_FLAGS],[$CPPFLAGS],[$LDFLAGS],
5545 +           samba_cv_HAVE_QUOTACTL_3=yes,samba_cv_HAVE_QUOTACTL_3=no,samba_cv_HAVE_QUOTACTL_3=cross)])
5546 +if test x"$samba_cv_HAVE_QUOTACTL_3" = x"yes"; then
5547 +    echo "CRAY int quotactl (char *spec, int request, char *arg) is NOT reworked for the sys_quota api"
5548 +#    samba_cv_SYSQUOTA_FOUND=yes;AC_DEFINE(HAVE_QUOTACTL_3,1,[Whether CRAY int quotactl (char *spec, int request, char *arg); is available])
5549 +fi
5550 +fi
5551 +
5552 +#################################################
5553 +# check for mntent.h and struct mntent
5554 +AC_CHECK_HEADERS(mntent.h)
5555 +#################################################
5556 +# check for setmntent,getmntent,endmntent
5557 +AC_CHECK_FUNCS(setmntent getmntent endmntent)
5558 +
5559 +#################################################
5560 +# check for devnm.h and struct mntent
5561 +AC_CHECK_HEADERS(devnm.h)
5562 +#################################################
5563 +# check for devnm
5564 +AC_CHECK_FUNCS(devnm)
5565 +
5566 +if test x"$samba_cv_WITH_SYS_QUOTAS" = x"yes"; then
5567 +    if test x"$samba_cv_SYSQUOTA_FOUND" != x"yes"; then
5568 +       # if --with-sys-quotas=yes then build it 
5569 +       # you have can use the get/set quota command smb.conf
5570 +       # options then
5571 +       samba_cv_SYSQUOTA_FOUND=auto
5572 +    fi
5573 +    if test x"$samba_cv_TRY_SYS_QUOTAS" != x"yes"; then
5574 +       # if --with-sys-quotas=yes then build it 
5575 +       # you have can use the get/set quota command smb.conf
5576 +       # options then
5577 +       samba_cv_TRY_SYS_QUOTAS=auto
5578 +    fi
5579 +fi
5580 +
5581 +if test x"$samba_cv_SYSQUOTA_FOUND" != x"no"; then
5582 +AC_CACHE_CHECK([whether the sys_quota interface works],samba_cv_SYSQUOTA_WORKS,[
5583 +SAVE_CPPFLAGS="$CPPFLAGS"
5584 +CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I. -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt  -I${srcdir-.}/smbwrapper -I${srcdir-.}/nsswitch"
5585 +AC_TRY_COMPILE([
5586 +#include "confdefs.h"
5587 +#define NO_PROTO_H 1
5588 +#define NO_CONFIG_H 1
5589 +#define HAVE_SYS_QUOTAS 1
5590 +#include "${srcdir-.}/lib/sysquotas.c"
5591 +],[],samba_cv_SYSQUOTA_WORKS=yes,samba_cv_SYSQUOTA_WORKS=no)
5592 +CPPFLAGS="$SAVE_CPPFLAGS"
5593 +])
5594 +if test x"$samba_cv_SYSQUOTA_WORKS" = x"yes"; then
5595 +AC_MSG_CHECKING(whether to use the new lib/sysquotas.c interface)
5596 +    if test x"$samba_cv_TRY_SYS_QUOTAS" != x"no"; then 
5597 +       AC_DEFINE(WITH_QUOTAS,1,[Whether to use disk quota support])
5598 +       AC_DEFINE(HAVE_SYS_QUOTAS,1,[Whether the new lib/sysquotas.c interface can be used])
5599 +       samba_cv_WE_USE_SYS_QUOTAS=yes
5600 +       AC_MSG_RESULT(yes)
5601 +    else
5602 +        AC_MSG_RESULT(no)
5603 +    fi
5604 +fi
5605 +fi
5606 +
5607 +AC_CACHE_CHECK([whether the old quota support works],samba_cv_QUOTA_WORKS,[
5608 +SAVE_CPPFLAGS="$CPPFLAGS"
5609 +CPPFLAGS="$CPPFLAGS -I${srcdir-.}/ -I. -I${srcdir-.}/include -I${srcdir-.}/ubiqx -I${srcdir-.}/popt  -I${srcdir-.}/smbwrapper -I${srcdir-.}/nsswitch"
5610 +AC_TRY_COMPILE([
5611 +#include "confdefs.h"
5612 +#define NO_PROTO_H 1
5613 +#define NO_CONFIG_H 1
5614 +#include "${srcdir-.}/smbd/quotas.c"
5615 +],[],samba_cv_QUOTA_WORKS=yes,samba_cv_QUOTA_WORKS=no)
5616 +CPPFLAGS="$SAVE_CPPFLAGS"
5617 +])
5618 +if test x"$samba_cv_QUOTA_WORKS" = x"yes"; then
5619 +AC_MSG_CHECKING(whether to use the old quota support)
5620 +    if test x"$samba_cv_WE_USE_SYS_QUOTAS" != x"yes"; then
5621 +      if test x"$samba_cv_TRY_QUOTAS" != x"no"; then
5622 +        AC_DEFINE(WITH_QUOTAS,1,[Whether to use disk quota support])
5623 +       AC_MSG_RESULT(yes)
5624 +      else
5625 +       AC_MSG_RESULT(no)
5626 +      fi
5627 +    else
5628 +      AC_MSG_RESULT(no)
5629 +    fi
5630 +fi
5631 +
5632 +####################
5633 +# End of quota check samba_cv_RUN_QUOTA_TESTS
5634 +fi
5635 +
5636 +#################################################
5637 +# check for experimental utmp accounting
5638 +
5639 +AC_MSG_CHECKING(whether to support utmp accounting)
5640 +WITH_UTMP=yes
5641 +AC_ARG_WITH(utmp,
5642 +[  --with-utmp             Include utmp accounting (default, if supported by OS)],
5643 +[ case "$withval" in
5644 +  no)
5645 +               WITH_UTMP=no
5646 +               ;;
5647 +  *)
5648 +               WITH_UTMP=yes
5649 +                ;;
5650 +  esac ],
5651 +)
5652 +
5653 +# utmp requires utmp.h
5654 +# Note similar check earlier, when checking utmp details.
5655 +
5656 +if test x"$WITH_UTMP" = x"yes" -a x"$ac_cv_header_utmp_h" = x"no"; then
5657 +       utmp_no_reason=", no utmp.h on $host_os"
5658 +       WITH_UTMP=no
5659 +fi
5660 +
5661 +# Display test results
5662 +
5663 +if test x"$WITH_UTMP" = x"yes"; then
5664 +        AC_MSG_RESULT(yes)
5665 +       AC_DEFINE(WITH_UTMP,1,[Whether to include experimental utmp accounting])
5666 +else
5667 +        AC_MSG_RESULT(no$utmp_no_reason)
5668 +fi
5669 +
5670 +#################################################
5671 +# choose native language(s) of man pages
5672 +AC_MSG_CHECKING(chosen man pages' language(s))
5673 +AC_ARG_WITH(manpages-langs,
5674 +[  --with-manpages-langs={en,ja,pl}  Choose man pages' language(s). (en)],
5675 +[ case "$withval" in
5676 +  yes|no)
5677 +    AC_MSG_WARN(--with-manpages-langs called without argument - will use default)
5678 +    manlangs="en"
5679 +  ;;
5680 +  *)
5681 +    manlangs="$withval"
5682 +  ;;
5683 +  esac
5684 +
5685 +  AC_MSG_RESULT($manlangs)
5686 +  manlangs=`echo $manlangs | sed "s/,/ /g"`   # replacing commas with spaces to produce a list
5687 +  AC_SUBST(manlangs)],
5688 +
5689 +  [manlangs="en"
5690 +  AC_MSG_RESULT($manlangs)
5691 +  AC_SUBST(manlangs)]
5692 +)
5693 +
5694 +#################################################
5695 +# should we build libsmbclient?
5696 +
5697 +INSTALLCLIENTCMD_SH=:
5698 +INSTALLCLIENTCMD_A=:
5699 +INSTALLCLIENT=
5700 +LIBSMBCLIENT_SHARED=
5701 +LIBSMBCLIENT=
5702 +AC_MSG_CHECKING(whether to build the libsmbclient shared library)
5703 +AC_ARG_WITH(libsmbclient,
5704 +[  --with-libsmbclient     Build the libsmbclient shared library (default=yes if shared libs supported)],
5705 +[ case "$withval" in
5706 +  no) 
5707 +     AC_MSG_RESULT(no)
5708 +     ;;
5709 +  *)
5710 +     if test $BLDSHARED = true; then
5711 +        INSTALLCLIENTCMD_SH="\$(INSTALLCMD)"
5712 +       ## build the static version of libsmbclient as well
5713 +       INSTALLCLIENTCMD_A="\$(INSTALLCMD)"
5714 +        LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
5715 +        LIBSMBCLIENT=libsmbclient
5716 +        AC_MSG_RESULT(yes)
5717 +     else
5718 +       enable_static=yes
5719 +        AC_MSG_RESULT(no shared library support -- will supply static library)
5720 +     fi
5721 +     if test $enable_static = yes; then
5722 +        INSTALLCLIENTCMD_A="\$(INSTALLCMD)"
5723 +        LIBSMBCLIENT=libsmbclient
5724 +     fi
5725 +     INSTALLCLIENT=installclientlib
5726 +     ;;
5727 +  esac ],
5728 +[
5729 +# if unspecified, default is to built it iff possible.
5730 +  if test $BLDSHARED = true; then
5731 +     INSTALLCLIENTCMD_SH="\$(INSTALLCMD)"
5732 +     LIBSMBCLIENT_SHARED=bin/libsmbclient.$SHLIBEXT
5733 +     LIBSMBCLIENT=libsmbclient
5734 +     AC_MSG_RESULT(yes)
5735 +   else
5736 +     enable_static=yes
5737 +     AC_MSG_RESULT(no shared library support -- will supply static library)
5738 +   fi
5739 +   if test $enable_static = yes; then
5740 +     INSTALLCLIENTCMD_A="\$(INSTALLCMD)"
5741 +     LIBSMBCLIENT=libsmbclient
5742 +  fi]
5743 +  INSTALLCLIENT=installclientlib
5744 +)
5745 +
5746 +
5747 +#################################################
5748 +# these tests are taken from the GNU fileutils package
5749 +AC_CHECKING(how to get filesystem space usage)
5750 +space=no
5751 +
5752 +# Test for statvfs64.
5753 +if test $space = no; then
5754 +  # SVR4
5755 +  AC_CACHE_CHECK([statvfs64 function (SVR4)], fu_cv_sys_stat_statvfs64,
5756 +  [AC_TRY_RUN([
5757 +#if defined(HAVE_UNISTD_H)
5758 +#include <unistd.h>
5759 +#endif
5760 +#include <sys/types.h>
5761 +#include <sys/statvfs.h>
5762 +  main ()
5763 +  {
5764 +    struct statvfs64 fsd;
5765 +    exit (statvfs64 (".", &fsd));
5766 +  }],
5767 +  fu_cv_sys_stat_statvfs64=yes,
5768 +  fu_cv_sys_stat_statvfs64=no,
5769 +  fu_cv_sys_stat_statvfs64=cross)])
5770 +  if test $fu_cv_sys_stat_statvfs64 = yes; then
5771 +    space=yes
5772 +    AC_DEFINE(STAT_STATVFS64,1,[Whether statvfs64() is available])
5773 +  fi
5774 +fi
5775 +
5776 +# Perform only the link test since it seems there are no variants of the
5777 +# statvfs function.  This check is more than just AC_CHECK_FUNCS(statvfs)
5778 +# because that got a false positive on SCO OSR5.  Adding the declaration
5779 +# of a `struct statvfs' causes this test to fail (as it should) on such
5780 +# systems.  That system is reported to work fine with STAT_STATFS4 which
5781 +# is what it gets when this test fails.
5782 +if test $space = no; then
5783 +  # SVR4
5784 +  AC_CACHE_CHECK([statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
5785 +                [AC_TRY_LINK([#include <sys/types.h>
5786 +#include <sys/statvfs.h>],
5787 +                             [struct statvfs fsd; statvfs (0, &fsd);],
5788 +                             fu_cv_sys_stat_statvfs=yes,
5789 +                             fu_cv_sys_stat_statvfs=no)])
5790 +  if test $fu_cv_sys_stat_statvfs = yes; then
5791 +    space=yes
5792 +    AC_DEFINE(STAT_STATVFS,1,[Whether statvfs() is available])
5793 +  fi
5794 +fi
5795 +
5796 +if test $space = no; then
5797 +  # DEC Alpha running OSF/1
5798 +  AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
5799 +  AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
5800 +  [AC_TRY_RUN([
5801 +#include <sys/param.h>
5802 +#include <sys/types.h>
5803 +#include <sys/mount.h>
5804 +  main ()
5805 +  {
5806 +    struct statfs fsd;
5807 +    fsd.f_fsize = 0;
5808 +    exit (statfs (".", &fsd, sizeof (struct statfs)));
5809 +  }],
5810 +  fu_cv_sys_stat_statfs3_osf1=yes,
5811 +  fu_cv_sys_stat_statfs3_osf1=no,
5812 +  fu_cv_sys_stat_statfs3_osf1=no)])
5813 +  AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
5814 +  if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
5815 +    space=yes
5816 +    AC_DEFINE(STAT_STATFS3_OSF1,1,[Whether statfs requires 3 arguments])
5817 +  fi
5818 +fi
5819 +
5820 +if test $space = no; then
5821 +# AIX
5822 +  AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
5823 +member (AIX, 4.3BSD)])
5824 +  AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
5825 +  [AC_TRY_RUN([
5826 +#ifdef HAVE_SYS_PARAM_H
5827 +#include <sys/param.h>
5828 +#endif
5829 +#ifdef HAVE_SYS_MOUNT_H
5830 +#include <sys/mount.h>
5831 +#endif
5832 +#ifdef HAVE_SYS_VFS_H
5833 +#include <sys/vfs.h>
5834 +#endif
5835 +  main ()
5836 +  {
5837 +  struct statfs fsd;
5838 +  fsd.f_bsize = 0;
5839 +  exit (statfs (".", &fsd));
5840 +  }],
5841 +  fu_cv_sys_stat_statfs2_bsize=yes,
5842 +  fu_cv_sys_stat_statfs2_bsize=no,
5843 +  fu_cv_sys_stat_statfs2_bsize=no)])
5844 +  AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
5845 +  if test $fu_cv_sys_stat_statfs2_bsize = yes; then
5846 +    space=yes
5847 +    AC_DEFINE(STAT_STATFS2_BSIZE,1,[Whether statfs requires two arguments and struct statfs has bsize property])
5848 +  fi
5849 +fi
5850 +
5851 +if test $space = no; then
5852 +# SVR3
5853 +  AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
5854 +  AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
5855 +  [AC_TRY_RUN([#include <sys/types.h>
5856 +#include <sys/statfs.h>
5857 +  main ()
5858 +  {
5859 +  struct statfs fsd;
5860 +  exit (statfs (".", &fsd, sizeof fsd, 0));
5861 +  }],
5862 +    fu_cv_sys_stat_statfs4=yes,
5863 +    fu_cv_sys_stat_statfs4=no,
5864 +    fu_cv_sys_stat_statfs4=no)])
5865 +  AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
5866 +  if test $fu_cv_sys_stat_statfs4 = yes; then
5867 +    space=yes
5868 +    AC_DEFINE(STAT_STATFS4,1,[Whether statfs requires 4 arguments])
5869 +  fi
5870 +fi
5871 +
5872 +if test $space = no; then
5873 +# 4.4BSD and NetBSD
5874 +  AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
5875 +member (4.4BSD and NetBSD)])
5876 +  AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
5877 +  [AC_TRY_RUN([#include <sys/types.h>
5878 +#ifdef HAVE_SYS_PARAM_H
5879 +#include <sys/param.h>
5880 +#endif
5881 +#ifdef HAVE_SYS_MOUNT_H
5882 +#include <sys/mount.h>
5883 +#endif
5884 +  main ()
5885 +  {
5886 +  struct statfs fsd;
5887 +  fsd.f_fsize = 0;
5888 +  exit (statfs (".", &fsd));
5889 +  }],
5890 +  fu_cv_sys_stat_statfs2_fsize=yes,
5891 +  fu_cv_sys_stat_statfs2_fsize=no,
5892 +  fu_cv_sys_stat_statfs2_fsize=no)])
5893 +  AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
5894 +  if test $fu_cv_sys_stat_statfs2_fsize = yes; then
5895 +    space=yes
5896 +       AC_DEFINE(STAT_STATFS2_FSIZE,1,[Whether statfs requires 2 arguments and struct statfs has fsize])
5897 +  fi
5898 +fi
5899 +
5900 +if test $space = no; then
5901 +  # Ultrix
5902 +  AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
5903 +  AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
5904 +  [AC_TRY_RUN([#include <sys/types.h>
5905 +#ifdef HAVE_SYS_PARAM_H
5906 +#include <sys/param.h>
5907 +#endif
5908 +#ifdef HAVE_SYS_MOUNT_H
5909 +#include <sys/mount.h>
5910 +#endif
5911 +#ifdef HAVE_SYS_FS_TYPES_H
5912 +#include <sys/fs_types.h>
5913 +#endif
5914 +  main ()
5915 +  {
5916 +  struct fs_data fsd;
5917 +  /* Ultrix's statfs returns 1 for success,
5918 +     0 for not mounted, -1 for failure.  */
5919 +  exit (statfs (".", &fsd) != 1);
5920 +  }],
5921 +  fu_cv_sys_stat_fs_data=yes,
5922 +  fu_cv_sys_stat_fs_data=no,
5923 +  fu_cv_sys_stat_fs_data=no)])
5924 +  AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
5925 +  if test $fu_cv_sys_stat_fs_data = yes; then
5926 +    space=yes
5927 +    AC_DEFINE(STAT_STATFS2_FS_DATA,1,[Whether statfs requires 2 arguments and struct fs_data is available])
5928 +  fi
5929 +fi
5930 +
5931 +#
5932 +# As a gating factor for large file support, in order to
5933 +# use <4GB files we must have the following minimal support
5934 +# available.
5935 +# long long, and a 64 bit off_t or off64_t.
5936 +# If we don't have all of these then disable large
5937 +# file support.
5938 +#
5939 +AC_MSG_CHECKING([if large file support can be enabled])
5940 +AC_TRY_COMPILE([
5941 +#if defined(HAVE_LONGLONG) && (defined(HAVE_OFF64_T) || (defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T == 8)))
5942 +#include <sys/types.h>
5943 +#else
5944 +__COMPILE_ERROR_
5945 +#endif
5946 +],
5947 +[int i],
5948 +samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=yes,samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT=no)
5949 +if test x"$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT" = x"yes"; then
5950 +       AC_DEFINE(HAVE_EXPLICIT_LARGEFILE_SUPPORT,1,[Whether large file support can be enabled])
5951 +fi
5952 +AC_MSG_RESULT([$samba_cv_HAVE_EXPLICIT_LARGEFILE_SUPPORT])
5953 +
5954 +AC_ARG_WITH(spinlocks, 
5955 +[  --with-spinlocks        Use spin locks instead of fcntl locks (default=no) ])
5956 +if test "x$with_spinlocks" = "xyes"; then
5957 +    AC_DEFINE(USE_SPINLOCKS,1,[Whether to use spin locks instead of fcntl locks])
5958 +
5959 +    case "$host_cpu" in
5960 +        sparc)
5961 +            AC_DEFINE(SPARC_SPINLOCKS,1,[Whether to use sparc spinlocks])
5962 +            ;;
5963 +
5964 +        i386|i486|i586|i686)
5965 +            AC_DEFINE(INTEL_SPINLOCKS,1,[Whether to use intel spinlocks])
5966 +            ;;
5967 +
5968 +        mips)
5969 +            AC_DEFINE(MIPS_SPINLOCKS,1,[Whether to use mips spinlocks])
5970 +            ;;
5971 +
5972 +        powerpc)
5973 +            AC_DEFINE(POWERPC_SPINLOCKS,1,[Whether to use powerpc spinlocks])
5974 +            ;;
5975 +    esac
5976 +fi
5977 +
5978 +#################################################
5979 +# check for ACL support
5980 +
5981 +AC_MSG_CHECKING(whether to support ACLs)
5982 +AC_ARG_WITH(acl-support,
5983 +[  --with-acl-support      Include ACL support (default=no)],
5984 +[ case "$withval" in
5985 +  yes)
5986 +
5987 +       case "$host_os" in
5988 +       *sysv5*)
5989 +               AC_MSG_RESULT(Using UnixWare ACLs)
5990 +               AC_DEFINE(HAVE_UNIXWARE_ACLS,1,[Whether UnixWare ACLs are available])
5991 +               ;;
5992 +       *solaris*)
5993 +               AC_MSG_RESULT(Using solaris ACLs)
5994 +               AC_DEFINE(HAVE_SOLARIS_ACLS,1,[Whether solaris ACLs are available])
5995 +               ;;
5996 +       *hpux*)
5997 +               AC_MSG_RESULT(Using HPUX ACLs)
5998 +               AC_DEFINE(HAVE_HPUX_ACLS,1,[Whether HPUX ACLs are available])
5999 +               ;;
6000 +       *irix*)
6001 +               AC_MSG_RESULT(Using IRIX ACLs)
6002 +               AC_DEFINE(HAVE_IRIX_ACLS,1,[Whether IRIX ACLs are available])
6003 +               ;;
6004 +       *aix*)
6005 +               AC_MSG_RESULT(Using AIX ACLs)
6006 +               AC_DEFINE(HAVE_AIX_ACLS,1,[Whether AIX ACLs are available])
6007 +               ;;
6008 +       *osf*)
6009 +               AC_MSG_RESULT(Using Tru64 ACLs)
6010 +               AC_DEFINE(HAVE_TRU64_ACLS,1,[Whether Tru64 ACLs are available])
6011 +               ACL_LIBS="$ACL_LIBS -lpacl"
6012 +               ;;
6013 +       *freebsd5*)
6014 +               AC_MSG_RESULT(Using FreeBSD posix ACLs)
6015 +               AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether FreeBSD POSIX ACLs are available])
6016 +               AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
6017 +               ;;
6018 +       *linux*)
6019 +               AC_CHECK_LIB(attr,getxattr,[ACL_LIBS="$ACL_LIBS -lattr"])
6020 +                       AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
6021 +               AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
6022 +               acl_LIBS=$LIBS
6023 +               LIBS="$LIBS -lacl"
6024 +               AC_TRY_LINK([#include <sys/types.h>
6025 +#include <sys/acl.h>],
6026 +[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
6027 +samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)
6028 +               LIBS=$acl_LIBS])
6029 +                       if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
6030 +                               AC_MSG_RESULT(Using posix ACLs)
6031 +                               AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
6032 +                               AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
6033 +                               acl_LIBS=$LIBS
6034 +                               LIBS="$LIBS -lacl"
6035 +                               AC_TRY_LINK([#include <sys/types.h>
6036 +#include <sys/acl.h>],
6037 +[ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);],
6038 +samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)
6039 +                               LIBS=$acl_LIBS])
6040 +                               if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
6041 +                                       AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
6042 +                               fi
6043 +                       fi
6044 +            ;;
6045 +         *)
6046 +               AC_CHECK_LIB(acl,acl_get_file,[ACL_LIBS="$ACL_LIBS -lacl"])
6047 +               AC_CACHE_CHECK([for ACL support],samba_cv_HAVE_POSIX_ACLS,[
6048 +               acl_LIBS=$LIBS
6049 +               LIBS="$LIBS -lacl"
6050 +               AC_TRY_LINK([#include <sys/types.h>
6051 +#include <sys/acl.h>],
6052 +[ acl_t acl; int entry_id; acl_entry_t *entry_p; return acl_get_entry( acl, entry_id, entry_p);],
6053 +samba_cv_HAVE_POSIX_ACLS=yes,samba_cv_HAVE_POSIX_ACLS=no)
6054 +               LIBS=$acl_LIBS])
6055 +                       if test x"$samba_cv_HAVE_POSIX_ACLS" = x"yes"; then
6056 +                               AC_MSG_RESULT(Using posix ACLs)
6057 +                               AC_DEFINE(HAVE_POSIX_ACLS,1,[Whether POSIX ACLs are available])
6058 +                               AC_CACHE_CHECK([for acl_get_perm_np],samba_cv_HAVE_ACL_GET_PERM_NP,[
6059 +                               acl_LIBS=$LIBS
6060 +                               LIBS="$LIBS -lacl"
6061 +                               AC_TRY_LINK([#include <sys/types.h>
6062 +#include <sys/acl.h>],
6063 +[ acl_permset_t permset_d; acl_perm_t perm; return acl_get_perm_np( permset_d, perm);],
6064 +samba_cv_HAVE_ACL_GET_PERM_NP=yes,samba_cv_HAVE_ACL_GET_PERM_NP=no)
6065 +                               LIBS=$acl_LIBS])
6066 +                               if test x"$samba_cv_HAVE_ACL_GET_PERM_NP" = x"yes"; then
6067 +                                       AC_DEFINE(HAVE_ACL_GET_PERM_NP,1,[Whether acl_get_perm_np() is available])
6068 +                               fi
6069 +                       fi
6070 +            ;;
6071 +        esac
6072 +        ;;
6073 +  *)
6074 +    AC_MSG_RESULT(no)
6075 +    AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support is available])
6076 +    ;;
6077 +  esac ],
6078 +  AC_DEFINE(HAVE_NO_ACLS,1,[Whether no ACLs support should be built in])
6079 +  AC_MSG_RESULT(no)
6080 +)
6081 +
6082 +#################################################
6083 +# check for sendfile support
6084 +
6085 +with_sendfile_support=yes
6086 +AC_MSG_CHECKING(whether to check to support sendfile)
6087 +AC_ARG_WITH(sendfile-support,
6088 +[  --with-sendfile-support Check for sendfile support (default=yes)],
6089 +[ case "$withval" in
6090 +  yes)
6091 +
6092 +       AC_MSG_RESULT(yes);
6093 +
6094 +       case "$host_os" in
6095 +       *linux*)
6096 +               AC_CACHE_CHECK([for linux sendfile64 support],samba_cv_HAVE_SENDFILE64,[
6097 +               AC_TRY_LINK([#include <sys/sendfile.h>],
6098 +[\
6099 +int tofd, fromfd;
6100 +off64_t offset;
6101 +size_t total;
6102 +ssize_t nwritten = sendfile64(tofd, fromfd, &offset, total);
6103 +],
6104 +samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)])
6105 +
6106 +               AC_CACHE_CHECK([for linux sendfile support],samba_cv_HAVE_SENDFILE,[
6107 +               AC_TRY_LINK([#include <sys/sendfile.h>],
6108 +[\
6109 +int tofd, fromfd;
6110 +off_t offset;
6111 +size_t total;
6112 +ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
6113 +],
6114 +samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
6115 +
6116 +# Try and cope with broken Linux sendfile....
6117 +               AC_CACHE_CHECK([for broken linux sendfile support],samba_cv_HAVE_BROKEN_LINUX_SENDFILE,[
6118 +               AC_TRY_LINK([\
6119 +#if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS == 64)
6120 +#undef _FILE_OFFSET_BITS
6121 +#endif
6122 +#include <sys/sendfile.h>],
6123 +[\
6124 +int tofd, fromfd;
6125 +off_t offset;
6126 +size_t total;
6127 +ssize_t nwritten = sendfile(tofd, fromfd, &offset, total);
6128 +],
6129 +samba_cv_HAVE_BROKEN_LINUX_SENDFILE=yes,samba_cv_HAVE_BROKEN_LINUX_SENDFILE=no)])
6130 +
6131 +       if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then
6132 +               AC_DEFINE(HAVE_SENDFILE64,1,[Whether 64-bit sendfile() is available])
6133 +               AC_DEFINE(LINUX_SENDFILE_API,1,[Whether linux sendfile() API is available])
6134 +               AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
6135 +       elif test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
6136 +               AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
6137 +               AC_DEFINE(LINUX_SENDFILE_API,1,[Whether linux sendfile() API is available])
6138 +               AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() should be used])
6139 +       elif test x"$samba_cv_HAVE_BROKEN_LINUX_SENDFILE" = x"yes"; then
6140 +               AC_DEFINE(LINUX_BROKEN_SENDFILE_API,1,[Whether (linux) sendfile() is broken])
6141 +               AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile should be used])
6142 +       else
6143 +               AC_MSG_RESULT(no);
6144 +       fi
6145 +
6146 +       ;;
6147 +       *freebsd*)
6148 +               AC_CACHE_CHECK([for freebsd sendfile support],samba_cv_HAVE_SENDFILE,[
6149 +               AC_TRY_LINK([\
6150 +#include <sys/types.h>
6151 +#include <unistd.h>
6152 +#include <sys/socket.h>
6153 +#include <sys/uio.h>],
6154 +[\
6155 +       int fromfd, tofd, ret, total=0;
6156 +       off_t offset, nwritten;
6157 +       struct sf_hdtr hdr;
6158 +       struct iovec hdtrl;
6159 +       hdr.headers = &hdtrl;
6160 +       hdr.hdr_cnt = 1;
6161 +       hdr.trailers = NULL;
6162 +       hdr.trl_cnt = 0;
6163 +       hdtrl.iov_base = NULL;
6164 +       hdtrl.iov_len = 0;
6165 +       ret = sendfile(fromfd, tofd, offset, total, &hdr, &nwritten, 0);
6166 +],
6167 +samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
6168 +
6169 +       if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
6170 +               AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() support is available])
6171 +               AC_DEFINE(FREEBSD_SENDFILE_API,1,[Whether the FreeBSD sendfile() API is available])
6172 +               AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
6173 +       else
6174 +               AC_MSG_RESULT(no);
6175 +       fi
6176 +       ;;
6177 +
6178 +       *hpux*)
6179 +               AC_CACHE_CHECK([for hpux sendfile64 support],samba_cv_HAVE_SENDFILE64,[
6180 +               AC_TRY_LINK([\
6181 +#include <sys/socket.h>
6182 +#include <sys/uio.h>],
6183 +[\
6184 +       int fromfd, tofd;
6185 +       size_t total=0;
6186 +       struct iovec hdtrl[2];
6187 +       ssize_t nwritten;
6188 +       off64_t offset;
6189 +
6190 +       hdtrl[0].iov_base = 0;
6191 +       hdtrl[0].iov_len = 0;
6192 +
6193 +       nwritten = sendfile64(tofd, fromfd, offset, total, &hdtrl[0], 0);
6194 +],
6195 +samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)])
6196 +       if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then
6197 +               AC_DEFINE(HAVE_SENDFILE64,1,[Whether sendfile64() is available])
6198 +               AC_DEFINE(HPUX_SENDFILE_API,1,[Whether the hpux sendfile() API is available])
6199 +               AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
6200 +       else
6201 +               AC_MSG_RESULT(no);
6202 +       fi
6203 +
6204 +               AC_CACHE_CHECK([for hpux sendfile support],samba_cv_HAVE_SENDFILE,[
6205 +               AC_TRY_LINK([\
6206 +#include <sys/socket.h>
6207 +#include <sys/uio.h>],
6208 +[\
6209 +       int fromfd, tofd;
6210 +       size_t total=0;
6211 +       struct iovec hdtrl[2];
6212 +       ssize_t nwritten;
6213 +       off_t offset;
6214 +
6215 +       hdtrl[0].iov_base = 0;
6216 +       hdtrl[0].iov_len = 0;
6217 +
6218 +       nwritten = sendfile(tofd, fromfd, offset, total, &hdtrl[0], 0);
6219 +],
6220 +samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
6221 +       if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
6222 +               AC_DEFINE(HAVE_SENDFILE,1,[Whether sendfile() is available])
6223 +               AC_DEFINE(HPUX_SENDFILE_API,1,[Whether the hpux sendfile() API is available])
6224 +               AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
6225 +       else
6226 +               AC_MSG_RESULT(no);
6227 +       fi
6228 +       ;;
6229 +
6230 +       *solaris*)
6231 +               AC_CHECK_LIB(sendfile,sendfilev)
6232 +               AC_CACHE_CHECK([for solaris sendfilev64 support],samba_cv_HAVE_SENDFILEV64,[
6233 +               AC_TRY_LINK([\
6234 +#include <sys/sendfile.h>],
6235 +[\
6236 +        int sfvcnt;
6237 +        size_t xferred;
6238 +        struct sendfilevec vec[2];
6239 +       ssize_t nwritten;
6240 +       int tofd;
6241 +
6242 +       sfvcnt = 2;
6243 +
6244 +       vec[0].sfv_fd = SFV_FD_SELF;
6245 +       vec[0].sfv_flag = 0;
6246 +       vec[0].sfv_off = 0;
6247 +       vec[0].sfv_len = 0;
6248 +
6249 +       vec[1].sfv_fd = 0;
6250 +       vec[1].sfv_flag = 0;
6251 +       vec[1].sfv_off = 0;
6252 +       vec[1].sfv_len = 0;
6253 +       nwritten = sendfilev64(tofd, vec, sfvcnt, &xferred);
6254 +],
6255 +samba_cv_HAVE_SENDFILEV64=yes,samba_cv_HAVE_SENDFILEV64=no)])
6256 +
6257 +       if test x"$samba_cv_HAVE_SENDFILEV64" = x"yes"; then
6258 +               AC_DEFINE(HAVE_SENDFILEV64,1,[Whether sendfilev64() is available])
6259 +               AC_DEFINE(SOLARIS_SENDFILE_API,1,[Whether the soloris sendfile() API is available])
6260 +               AC_DEFINE(WITH_SENDFILE,1,[Whether sendfile() support should be included])
6261 +       else
6262 +               AC_MSG_RESULT(no);
6263 +       fi
6264 +
6265 +               AC_CACHE_CHECK([for solaris sendfilev support],samba_cv_HAVE_SENDFILEV,[
6266 +               AC_TRY_LINK([\
6267 +#include <sys/sendfile.h>],
6268 +[\
6269 +        int sfvcnt;
6270 +        size_t xferred;
6271 +        struct sendfilevec vec[2];
6272 +       ssize_t nwritten;
6273 +       int tofd;
6274 +
6275 +       sfvcnt = 2;
6276 +
6277 +       vec[0].sfv_fd = SFV_FD_SELF;
6278 +       vec[0].sfv_flag = 0;
6279 +       vec[0].sfv_off = 0;
6280 +       vec[0].sfv_len = 0;
6281 +
6282 +       vec[1].sfv_fd = 0;
6283 +       vec[1].sfv_flag = 0;
6284 +       vec[1].sfv_off = 0;
6285 +       vec[1].sfv_len = 0;
6286 +       nwritten = sendfilev(tofd, vec, sfvcnt, &xferred);
6287 +],
6288 +samba_cv_HAVE_SENDFILEV=yes,samba_cv_HAVE_SENDFILEV=no)])
6289 +
6290 +       if test x"$samba_cv_HAVE_SENDFILEV" = x"yes"; then
6291 +               AC_DEFINE(HAVE_SENDFILEV,1,[Whether sendfilev() is available])
6292 +               AC_DEFINE(SOLARIS_SENDFILE_API,1,[Whether the solaris sendfile() API is available])
6293 +               AC_DEFINE(WITH_SENDFILE,1,[Whether to include sendfile() support])
6294 +       else
6295 +               AC_MSG_RESULT(no);
6296 +       fi
6297 +       ;;
6298 +
6299 +       *)
6300 +       ;;
6301 +        esac
6302 +        ;;
6303 +  *)
6304 +    AC_MSG_RESULT(no)
6305 +    ;;
6306 +  esac ],
6307 +  AC_MSG_RESULT(yes)
6308 +)
6309 +
6310 +
6311 +#################################################
6312 +# Check whether winbind is supported on this platform.  If so we need to
6313 +# build and install client programs, sbin programs and shared libraries
6314 +
6315 +AC_MSG_CHECKING(whether to build winbind)
6316 +
6317 +# Initially, the value of $host_os decides whether winbind is supported
6318 +
6319 +HAVE_WINBIND=yes
6320 +
6321 +# Define the winbind shared library name and any specific linker flags
6322 +# it needs to be built with.
6323 +
6324 +WINBIND_NSS="nsswitch/libnss_winbind.$SHLIBEXT"
6325 +WINBIND_WINS_NSS="nsswitch/libnss_wins.$SHLIBEXT"
6326 +WINBIND_NSS_LDSHFLAGS=$LDSHFLAGS
6327 +
6328 +case "$host_os" in
6329 +       *linux*)
6330 +               WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_linux.o"
6331 +               ;;
6332 +       *freebsd5*)
6333 +               WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_freebsd.o"
6334 +               ;;
6335 +       *irix*)
6336 +               # IRIX has differently named shared libraries
6337 +               WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_irix.o"
6338 +               WINBIND_NSS="nsswitch/libns_winbind.$SHLIBEXT"
6339 +               WINBIND_WINS_NSS="nsswitch/libns_wins.$SHLIBEXT"
6340 +               ;;
6341 +       *solaris*)
6342 +               # Solaris winbind client is implemented as a wrapper around
6343 +               # the Linux version.
6344 +               WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o \
6345 +                   nsswitch/winbind_nss_linux.o"
6346 +               WINBIND_NSS_EXTRA_LIBS="-lsocket"
6347 +               ;;
6348 +       *hpux11*)
6349 +               WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_solaris.o"
6350 +               ;;
6351 +       *aix*)
6352 +               # AIX has even differently named shared libraries.  No
6353 +               # WINS support has been implemented yet.
6354 +               WINBIND_NSS_EXTRA_OBJS="nsswitch/winbind_nss_aix.o"
6355 +               WINBIND_NSS_LDSHFLAGS="-Wl,-bexpall,-bM:SRE,-ewb_aix_init"
6356 +               WINBIND_NSS="nsswitch/WINBIND"
6357 +               WINBIND_WINS_NSS=""
6358 +               ;;
6359 +       *)
6360 +               HAVE_WINBIND=no
6361 +               winbind_no_reason=", unsupported on $host_os"
6362 +               ;;
6363 +esac
6364 +
6365 +AC_SUBST(WINBIND_NSS)
6366 +AC_SUBST(WINBIND_WINS_NSS)
6367 +AC_SUBST(WINBIND_NSS_LDSHFLAGS)
6368 +AC_SUBST(WINBIND_NSS_EXTRA_OBJS)
6369 +AC_SUBST(WINBIND_NSS_EXTRA_LIBS)
6370 +
6371 +# Check the setting of --with-winbindd
6372 +
6373 +AC_ARG_WITH(winbind,
6374 +[  --with-winbind          Build winbind (default, if supported by OS)],
6375 +[ 
6376 +  case "$withval" in
6377 +       yes)
6378 +               HAVE_WINBIND=yes
6379 +               ;;
6380 +        no)
6381 +               HAVE_WINBIND=no
6382 +                winbind_reason=""
6383 +                ;;
6384 +  esac ],
6385 +)
6386 +
6387 +# We need unix domain sockets for winbind
6388 +
6389 +if test x"$HAVE_WINBIND" = x"yes"; then
6390 +       if test x"$samba_cv_unixsocket" = x"no"; then
6391 +               winbind_no_reason=", no unix domain socket support on $host_os"
6392 +               HAVE_WINBIND=no
6393 +       fi
6394 +fi
6395 +
6396 +# Display test results
6397 +
6398 +if test x"$HAVE_WINBIND" = x"yes"; then
6399 +        AC_MSG_RESULT(yes)
6400 +       AC_DEFINE(WITH_WINBIND,1,[Whether to build winbind])
6401 +
6402 +       EXTRA_BIN_PROGS="$EXTRA_BIN_PROGS bin/wbinfo\$(EXEEXT)"
6403 +       EXTRA_SBIN_PROGS="$EXTRA_SBIN_PROGS bin/winbindd\$(EXEEXT)"
6404 +        if test x"$BLDSHARED" = x"true"; then
6405 +               SHLIB_PROGS="$SHLIB_PROGS $WINBIND_NSS $WINBIND_WINS_NSS"
6406 +
6407 +               if test x"$with_pam" = x"yes"; then
6408 +                       SHLIB_PROGS="$SHLIB_PROGS nsswitch/pam_winbind.$SHLIBEXT"
6409 +               fi
6410 +       fi
6411 +else
6412 +        AC_MSG_RESULT(no$winbind_no_reason)
6413 +fi
6414 +
6415 +# Solaris has some extra fields in struct passwd that need to be
6416 +# initialised otherwise nscd crashes.  
6417
6418 +AC_CHECK_MEMBER(struct passwd.pw_comment,
6419 +               AC_DEFINE(HAVE_PASSWD_PW_COMMENT, 1, [Defined if struct passwd has pw_comment field]),,
6420 +               [#include <pwd.h>])
6421 +
6422 +AC_CHECK_MEMBER(struct passwd.pw_age,
6423 +               AC_DEFINE(HAVE_PASSWD_PW_AGE, 1, [Defined if struct passwd has pw_age field]),,
6424 +               [#include <pwd.h>])
6425 +
6426 +#################################################
6427 +# Check to see if we should use the included popt 
6428 +
6429 +AC_ARG_WITH(included-popt,
6430 +[  --with-included-popt    use bundled popt library, not from system],
6431 +[ 
6432 +  case "$withval" in
6433 +       yes)
6434 +               INCLUDED_POPT=yes
6435 +               ;;
6436 +        no)
6437 +               INCLUDED_POPT=no
6438 +                ;;
6439 +  esac ],
6440 +)
6441 +if test x"$INCLUDED_POPT" != x"yes"; then
6442 +    AC_CHECK_LIB(popt, poptGetContext,
6443 +                INCLUDED_POPT=no, INCLUDED_POPT=yes)
6444 +fi
6445 +
6446 +AC_MSG_CHECKING(whether to use included popt)
6447 +if test x"$INCLUDED_POPT" = x"yes"; then
6448 +    AC_MSG_RESULT(yes)
6449 +    BUILD_POPT='$(POPT_OBJS)'
6450 +       POPTLIBS='$(POPT_OBJS)'
6451 +    FLAGS1="-I$srcdir/popt"
6452 +else
6453 +    AC_MSG_RESULT(no)
6454 +       BUILD_POPT=""
6455 +    POPTLIBS="-lpopt"
6456 +fi
6457 +AC_SUBST(BUILD_POPT)
6458 +AC_SUBST(POPTLIBS)
6459 +AC_SUBST(FLAGS1)
6460 +
6461 +#################################################
6462 +# Check if the user wants Python
6463 +
6464 +# At the moment, you can use this to set which Python binary to link
6465 +# against.  (Libraries built for Python2.2 can't be used by 2.1,
6466 +# though they can coexist in different directories.)  In the future
6467 +# this might make the Python stuff be built by default.
6468 +
6469 +# Defaulting python breaks the clean target if python isn't installed
6470 +
6471 +PYTHON=
6472 +
6473 +AC_ARG_WITH(python,
6474 +[  --with-python=PYTHONNAME  build Python libraries],
6475 +[ case "${withval-python}" in
6476 +  yes)
6477 +       PYTHON=python
6478 +       EXTRA_ALL_TARGETS="$EXTRA_ALL_TARGETS python_ext"
6479 +       ;;
6480 +  no)
6481 +       PYTHON=
6482 +       ;;
6483 +  *)
6484 +       PYTHON=${withval-python}
6485 +       ;;
6486 +  esac ])
6487 +AC_SUBST(PYTHON)
6488 +
6489 +for i in `echo $default_static_modules | sed -e's/,/ /g'`
6490 +do
6491 +       eval MODULE_DEFAULT_$i=STATIC
6492 +done
6493 +
6494 +for i in `echo $default_shared_modules | sed -e's/,/ /g'`
6495 +do
6496 +       dnl Fall back to static if dlopen() is not available
6497 +       eval MODULE_DEFAULT_$i=STATIC
6498 +
6499 +       if test x"$ac_cv_func_dlopen" = xyes; then
6500 +               eval MODULE_DEFAULT_$i=SHARED
6501 +       fi
6502 +done
6503 +
6504 +dnl Always built these modules static
6505 +MODULE_pdb_guest=STATIC
6506 +MODULE_rpc_spoolss=STATIC
6507 +MODULE_rpc_srv=STATIC
6508 +MODULE_idmap_tdb=STATIC
6509 +
6510 +AC_ARG_WITH(static-modules,
6511 +[  --with-static-modules=MODULES  Comma-seperated list of names of modules to statically link in],
6512 +[ if test $withval; then
6513 +       for i in `echo $withval | sed -e's/,/ /g'`
6514 +       do
6515 +               eval MODULE_$i=STATIC
6516 +       done
6517 +fi ])
6518 +
6519 +AC_ARG_WITH(shared-modules,
6520 +[  --with-shared-modules=MODULES  Comma-seperated list of names of modules to build shared],
6521 +[ if test $withval; then
6522 +       for i in `echo $withval | sed -e's/,/ /g'`
6523 +       do
6524 +                       eval MODULE_$i=SHARED
6525 +       done
6526 +fi ])
6527 +
6528 +###########################################################################
6529 +## contributed pdb_modules
6530 +
6531 +SMB_MODULE(pdb_xml, passdb/pdb_xml.o, "bin/xml.$SHLIBEXT", PDB,
6532 +                 [ PASSDB_LIBS="$PASSDB_LIBS $XML_LIBS" ] )
6533 +SMB_MODULE(pdb_mysql, passdb/pdb_mysql.o, "bin/mysql.$SHLIBEXT", PDB, 
6534 +                  [ PASSDB_LIBS="$PASSDB_LIBS $MYSQL_LIBS" ]   )
6535 +
6536 +## end of contributed pdb_modules
6537 +###########################################################################
6538 +
6539 +SMB_MODULE(pdb_ldap, passdb/pdb_ldap.o, "bin/ldapsam.$SHLIBEXT", PDB, 
6540 +                  [ PASSDB_LIBS="$PASSDB_LIBS $LDAP_LIBS" ] )
6541 +SMB_MODULE(pdb_smbpasswd, passdb/pdb_smbpasswd.o, "bin/smbpasswd.$SHLIBEXT", PDB)
6542 +SMB_MODULE(pdb_tdbsam, passdb/pdb_tdb.o, "bin/tdbsam.$SHLIBEXT", PDB)
6543 +SMB_MODULE(pdb_guest, passdb/pdb_guest.o, "bin/guest.$SHLIBEXT", PDB)
6544 +SMB_SUBSYSTEM(PDB,passdb/pdb_interface.o)
6545 +
6546 +SMB_MODULE(rpc_lsa, \$(RPC_LSA_OBJ), "bin/librpc_lsarpc.$SHLIBEXT", RPC)
6547 +SMB_MODULE(rpc_reg, \$(RPC_REG_OBJ), "bin/librpc_winreg.$SHLIBEXT", RPC)
6548 +SMB_MODULE(rpc_lsa_ds, \$(RPC_LSA_DS_OBJ), "bin/librpc_lsa_ds.$SHLIBEXT", RPC)
6549 +SMB_MODULE(rpc_wks, \$(RPC_WKS_OBJ), "bin/librpc_wkssvc.$SHLIBEXT", RPC)
6550 +SMB_MODULE(rpc_net, \$(RPC_NETLOG_OBJ), "bin/librpc_NETLOGON.$SHLIBEXT", RPC)
6551 +SMB_MODULE(rpc_dfs, \$(RPC_DFS_OBJ), "bin/librpc_netdfs.$SHLIBEXT", RPC)
6552 +SMB_MODULE(rpc_srv, \$(RPC_SVC_OBJ), "bin/librpc_srvsvc.$SHLIBEXT", RPC)
6553 +SMB_MODULE(rpc_spoolss, \$(RPC_SPOOLSS_OBJ), "bin/librpc_spoolss.$SHLIBEXT", RPC)
6554 +SMB_MODULE(rpc_samr, \$(RPC_SAMR_OBJ), "bin/librpc_samr.$SHLIBEXT", RPC)
6555 +SMB_MODULE(rpc_echo, \$(RPC_ECHO_OBJ), "bin/librpc_echo.$SHLIBEXT", RPC)
6556 +SMB_SUBSYSTEM(RPC,smbd/server.o)
6557 +
6558 +SMB_MODULE(idmap_ldap, sam/idmap_ldap.o, "bin/idmap_ldap.$SHLIBEXT", IDMAP)
6559 +SMB_MODULE(idmap_tdb, sam/idmap_tdb.o, "bin/idmap_tdb.$SHLIBEXT", IDMAP)
6560 +SMB_SUBSYSTEM(IDMAP,sam/idmap.o)
6561 +
6562 +SMB_MODULE(charset_weird, modules/weird.o, "bin/weird.$SHLIBEXT", CHARSET)
6563 +SMB_MODULE(charset_CP850, modules/CP850.o, "bin/CP850.$SHLIBEXT", CHARSET)
6564 +SMB_MODULE(charset_CP437, modules/CP437.o, "bin/CP437.$SHLIBEXT", CHARSET)
6565 +SMB_MODULE(charset_macosxfs, modules/charset_macosxfs.o,"bin/macosxfs.$SHLIBEXT", CHARSET)
6566 +SMB_SUBSYSTEM(CHARSET,lib/iconv.o)
6567 +
6568 +SMB_MODULE(auth_rhosts, \$(AUTH_RHOSTS_OBJ), "bin/rhosts.$SHLIBEXT", AUTH)
6569 +SMB_MODULE(auth_sam, \$(AUTH_SAM_OBJ), "bin/sam.$SHLIBEXT", AUTH)
6570 +SMB_MODULE(auth_unix, \$(AUTH_UNIX_OBJ), "bin/unix.$SHLIBEXT", AUTH)
6571 +SMB_MODULE(auth_winbind, \$(AUTH_WINBIND_OBJ), "bin/winbind.$SHLIBEXT", AUTH)
6572 +SMB_MODULE(auth_server, \$(AUTH_SERVER_OBJ), "bin/smbserver.$SHLIBEXT", AUTH)
6573 +SMB_MODULE(auth_domain, \$(AUTH_DOMAIN_OBJ), "bin/domain.$SHLIBEXT", AUTH)
6574 +SMB_MODULE(auth_builtin, \$(AUTH_BUILTIN_OBJ), "bin/builtin.$SHLIBEXT", AUTH)
6575 +SMB_SUBSYSTEM(AUTH,auth/auth.o)
6576 +
6577 +SMB_MODULE(vfs_recycle, \$(VFS_RECYCLE_OBJ), "bin/recycle.$SHLIBEXT", VFS)
6578 +SMB_MODULE(vfs_audit, \$(VFS_AUDIT_OBJ), "bin/audit.$SHLIBEXT", VFS)
6579 +SMB_MODULE(vfs_extd_audit, \$(VFS_EXTD_AUDIT_OBJ), "bin/extd_audit.$SHLIBEXT", VFS)
6580 +SMB_MODULE(vfs_netatalk, \$(VFS_NETATALK_OBJ), "bin/netatalk.$SHLIBEXT", VFS)
6581 +SMB_MODULE(vfs_fake_perms, \$(VFS_FAKE_PERMS_OBJ), "bin/fake_perms.$SHLIBEXT", VFS)
6582 +SMB_MODULE(vfs_default_quota, \$(VFS_DEFAULT_QUOTA_OBJ), "bin/default_quota.$SHLIBEXT", VFS)
6583 +SMB_MODULE(vfs_readonly, \$(VFS_READONLY_OBJ), "bin/readonly.$SHLIBEXT", VFS)
6584 +SMB_MODULE(vfs_cap, \$(VFS_CAP_OBJ), "bin/cap.$SHLIBEXT", VFS)
6585 +SMB_SUBSYSTEM(VFS,smbd/vfs.o)
6586 +
6587 +AC_DEFINE_UNQUOTED(STRING_STATIC_MODULES, "$string_static_modules", [String list of builtin modules])
6588 +
6589 +#################################################
6590 +# do extra things if we are running insure
6591 +
6592 +if test "${ac_cv_prog_CC}" = "insure"; then
6593 +       CPPFLAGS="$CPPFLAGS -D__INSURE__"
6594 +fi
6595 +
6596 +#################################################
6597 +# Display summary of libraries detected
6598 +
6599 +AC_MSG_RESULT([Using libraries:])
6600 +AC_MSG_RESULT([    LIBS = $LIBS])
6601 +if test x"$with_ads_support" != x"no"; then
6602 +   AC_MSG_RESULT([    KRB5_LIBS = $KRB5_LIBS])
6603 +fi
6604 +if test x"$with_ldap_support" != x"no"; then
6605 +   AC_MSG_RESULT([    LDAP_LIBS = $LDAP_LIBS])
6606 +fi
6607 +AC_MSG_RESULT([    AUTH_LIBS = $AUTH_LIBS])
6608 +
6609 +#################################################
6610 +# final configure stuff
6611 +
6612 +AC_MSG_CHECKING([configure summary])
6613 +AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
6614 +           AC_MSG_RESULT(yes),
6615 +          AC_MSG_ERROR([summary failure. Aborting config]); exit 1;,
6616 +          AC_MSG_WARN([cannot run when cross-compiling]))
6617 +
6618 +builddir=`pwd`
6619 +AC_SUBST(builddir)
6620 +
6621 +dnl Remove -L/usr/lib/? from LDFLAGS and LIBS
6622 +LIB_REMOVE_USR_LIB(LDFLAGS)
6623 +LIB_REMOVE_USR_LIB(LIBS)
6624 +
6625 +dnl Remove -I/usr/include/? from CFLAGS and CPPFLAGS
6626 +CFLAGS_REMOVE_USR_INCLUDE(CFLAGS)
6627 +CFLAGS_REMOVE_USR_INCLUDE(CPPFLAGS)
6628 +
6629 +AC_OUTPUT(include/stamp-h Makefile script/findsmb smbadduser script/gen-8bit-gap.sh)
6630 +
6631 +#################################################
6632 +# Print very concise instructions on building/use
6633 +if test "x$enable_dmalloc" = xyes
6634 +then
6635 +       AC_MSG_RESULT([Note: The dmalloc debug library will be included.  To turn it on use])
6636 +       AC_MSG_RESULT([      \$ eval \`dmalloc samba\`.])
6637 +fi
6638 diff -durN samba-3.0.1.orig/source/torture/nsstest.c samba-3.0.1/source/torture/nsstest.c
6639 --- samba-3.0.1.orig/source/torture/nsstest.c   2003-08-15 22:40:00.000000000 +0200
6640 +++ samba-3.0.1/source/torture/nsstest.c        2004-12-30 13:57:10.644768784 +0100
6641 @@ -21,7 +21,7 @@
6642  
6643  #include "includes.h"
6644  
6645 -static const char *so_path = "/lib/libnss_winbind.so";
6646 +static const char *so_path = "/lib64/libnss_winbind.so";
6647  static const char *nss_name = "winbind";
6648  static int nss_errno;
6649  static NSS_STATUS last_error;
6650 diff -durN samba-3.0.1.orig/source/torture/nsstest.c~ samba-3.0.1/source/torture/nsstest.c~
6651 --- samba-3.0.1.orig/source/torture/nsstest.c~  1970-01-01 01:00:00.000000000 +0100
6652 +++ samba-3.0.1/source/torture/nsstest.c~       2003-08-15 22:40:00.000000000 +0200
6653 @@ -0,0 +1,451 @@
6654 +/* 
6655 +   Unix SMB/CIFS implementation.
6656 +   nss tester for winbindd
6657 +   Copyright (C) Andrew Tridgell 2001
6658 +   Copyright (C) Tim Potter 2003
6659 +   
6660 +   This program is free software; you can redistribute it and/or modify
6661 +   it under the terms of the GNU General Public License as published by
6662 +   the Free Software Foundation; either version 2 of the License, or
6663 +   (at your option) any later version.
6664 +   
6665 +   This program is distributed in the hope that it will be useful,
6666 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
6667 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
6668 +   GNU General Public License for more details.
6669 +   
6670 +   You should have received a copy of the GNU General Public License
6671 +   along with this program; if not, write to the Free Software
6672 +   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
6673 +*/
6674 +
6675 +#include "includes.h"
6676 +
6677 +static const char *so_path = "/lib/libnss_winbind.so";
6678 +static const char *nss_name = "winbind";
6679 +static int nss_errno;
6680 +static NSS_STATUS last_error;
6681 +static int total_errors;
6682 +
6683 +static void *find_fn(const char *name)
6684 +{
6685 +       pstring s;
6686 +       static void *h;
6687 +       void *res;
6688 +
6689 +       pstr_sprintf(s, "_nss_%s_%s", nss_name, name);
6690 +
6691 +       if (!h) {
6692 +               h = sys_dlopen(so_path, RTLD_LAZY);
6693 +       }
6694 +       if (!h) {
6695 +               printf("Can't open shared library %s\n", so_path);
6696 +               exit(1);
6697 +       }
6698 +       res = sys_dlsym(h, s);
6699 +       if (!res) {
6700 +               printf("Can't find function %s\n", s);
6701 +               total_errors++;
6702 +               return NULL;
6703 +       }
6704 +       return res;
6705 +}
6706 +
6707 +static void report_nss_error(const char *who, NSS_STATUS status)
6708 +{
6709 +       last_error = status;
6710 +       total_errors++;
6711 +       printf("ERROR %s: NSS_STATUS=%d  %d (nss_errno=%d)\n", 
6712 +              who, status, NSS_STATUS_SUCCESS, nss_errno);
6713 +}
6714 +
6715 +static struct passwd *nss_getpwent(void)
6716 +{
6717 +       NSS_STATUS (*_nss_getpwent_r)(struct passwd *, char *, 
6718 +                                     size_t , int *) = find_fn("getpwent_r");
6719 +       static struct passwd pwd;
6720 +       static char buf[1000];
6721 +       NSS_STATUS status;
6722 +
6723 +       if (!_nss_getpwent_r)
6724 +               return NULL;
6725 +
6726 +       status = _nss_getpwent_r(&pwd, buf, sizeof(buf), &nss_errno);
6727 +       if (status == NSS_STATUS_NOTFOUND) {
6728 +               return NULL;
6729 +       }
6730 +       if (status != NSS_STATUS_SUCCESS) {
6731 +               report_nss_error("getpwent", status);
6732 +               return NULL;
6733 +       }
6734 +       return &pwd;
6735 +}
6736 +
6737 +static struct passwd *nss_getpwnam(const char *name)
6738 +{
6739 +       NSS_STATUS (*_nss_getpwnam_r)(const char *, struct passwd *, char *, 
6740 +                                     size_t , int *) = find_fn("getpwnam_r");
6741 +       static struct passwd pwd;
6742 +       static char buf[1000];
6743 +       NSS_STATUS status;
6744 +
6745 +       if (!_nss_getpwnam_r)
6746 +               return NULL;
6747 +       
6748 +       status = _nss_getpwnam_r(name, &pwd, buf, sizeof(buf), &nss_errno);
6749 +       if (status == NSS_STATUS_NOTFOUND) {
6750 +               return NULL;
6751 +       }
6752 +       if (status != NSS_STATUS_SUCCESS) {
6753 +               report_nss_error("getpwnam", status);
6754 +               return NULL;
6755 +       }
6756 +       return &pwd;
6757 +}
6758 +
6759 +static struct passwd *nss_getpwuid(uid_t uid)
6760 +{
6761 +       NSS_STATUS (*_nss_getpwuid_r)(uid_t , struct passwd *, char *, 
6762 +                                     size_t , int *) = find_fn("getpwuid_r");
6763 +       static struct passwd pwd;
6764 +       static char buf[1000];
6765 +       NSS_STATUS status;
6766 +
6767 +       if (!_nss_getpwuid_r)
6768 +               return NULL;
6769 +       
6770 +       status = _nss_getpwuid_r(uid, &pwd, buf, sizeof(buf), &nss_errno);
6771 +       if (status == NSS_STATUS_NOTFOUND) {
6772 +               return NULL;
6773 +       }
6774 +       if (status != NSS_STATUS_SUCCESS) {
6775 +               report_nss_error("getpwuid", status);
6776 +               return NULL;
6777 +       }
6778 +       return &pwd;
6779 +}
6780 +
6781 +static void nss_setpwent(void)
6782 +{
6783 +       NSS_STATUS (*_nss_setpwent)(void) = find_fn("setpwent");
6784 +       NSS_STATUS status;
6785 +       
6786 +       if (!_nss_setpwent)
6787 +               return;
6788 +
6789 +       status = _nss_setpwent();
6790 +       if (status != NSS_STATUS_SUCCESS) {
6791 +               report_nss_error("setpwent", status);
6792 +       }
6793 +}
6794 +
6795 +static void nss_endpwent(void)
6796 +{
6797 +       NSS_STATUS (*_nss_endpwent)(void) = find_fn("endpwent");
6798 +       NSS_STATUS status;
6799 +
6800 +       if (!_nss_endpwent)
6801 +               return;
6802 +
6803 +       status = _nss_endpwent();
6804 +       if (status != NSS_STATUS_SUCCESS) {
6805 +               report_nss_error("endpwent", status);
6806 +       }
6807 +}
6808 +
6809 +
6810 +static struct group *nss_getgrent(void)
6811 +{
6812 +       NSS_STATUS (*_nss_getgrent_r)(struct group *, char *, 
6813 +                                     size_t , int *) = find_fn("getgrent_r");
6814 +       static struct group grp;
6815 +       static char *buf;
6816 +       static int buflen = 1024;
6817 +       NSS_STATUS status;
6818 +
6819 +       if (!_nss_getgrent_r)
6820 +               return NULL;
6821 +
6822 +       if (!buf) 
6823 +               buf = malloc(buflen);
6824 +
6825 +again: 
6826 +       status = _nss_getgrent_r(&grp, buf, buflen, &nss_errno);
6827 +       if (status == NSS_STATUS_TRYAGAIN) {
6828 +               buflen *= 2;
6829 +               buf = realloc(buf, buflen);
6830 +               goto again;
6831 +       }
6832 +       if (status == NSS_STATUS_NOTFOUND) {
6833 +               return NULL;
6834 +       }
6835 +       if (status != NSS_STATUS_SUCCESS) {
6836 +               report_nss_error("getgrent", status);
6837 +               return NULL;
6838 +       }
6839 +       return &grp;
6840 +}
6841 +
6842 +static struct group *nss_getgrnam(const char *name)
6843 +{
6844 +       NSS_STATUS (*_nss_getgrnam_r)(const char *, struct group *, char *, 
6845 +                                     size_t , int *) = find_fn("getgrnam_r");
6846 +       static struct group grp;
6847 +       static char *buf;
6848 +       static int buflen = 1000;
6849 +       NSS_STATUS status;
6850 +
6851 +       if (!_nss_getgrnam_r)
6852 +               return NULL;
6853 +
6854 +       if (!buf) 
6855 +               buf = malloc(buflen);
6856 +again: 
6857 +       status = _nss_getgrnam_r(name, &grp, buf, buflen, &nss_errno);
6858 +       if (status == NSS_STATUS_TRYAGAIN) {
6859 +               buflen *= 2;
6860 +               buf = realloc(buf, buflen);
6861 +               goto again;
6862 +       }
6863 +       if (status == NSS_STATUS_NOTFOUND) {
6864 +               return NULL;
6865 +       }
6866 +       if (status != NSS_STATUS_SUCCESS) {
6867 +               report_nss_error("getgrnam", status);
6868 +               return NULL;
6869 +       }
6870 +       return &grp;
6871 +}
6872 +
6873 +static struct group *nss_getgrgid(gid_t gid)
6874 +{
6875 +       NSS_STATUS (*_nss_getgrgid_r)(gid_t , struct group *, char *, 
6876 +                                     size_t , int *) = find_fn("getgrgid_r");
6877 +       static struct group grp;
6878 +       static char *buf;
6879 +       static int buflen = 1000;
6880 +       NSS_STATUS status;
6881 +       
6882 +       if (!_nss_getgrgid_r)
6883 +               return NULL;
6884 +
6885 +       if (!buf) 
6886 +               buf = malloc(buflen);
6887 +
6888 +again: 
6889 +       status = _nss_getgrgid_r(gid, &grp, buf, buflen, &nss_errno);
6890 +       if (status == NSS_STATUS_TRYAGAIN) {
6891 +               buflen *= 2;
6892 +               buf = realloc(buf, buflen);
6893 +               goto again;
6894 +       }
6895 +       if (status == NSS_STATUS_NOTFOUND) {
6896 +               return NULL;
6897 +       }
6898 +       if (status != NSS_STATUS_SUCCESS) {
6899 +               report_nss_error("getgrgid", status);
6900 +               return NULL;
6901 +       }
6902 +       return &grp;
6903 +}
6904 +
6905 +static void nss_setgrent(void)
6906 +{
6907 +       NSS_STATUS (*_nss_setgrent)(void) = find_fn("setgrent");
6908 +       NSS_STATUS status;
6909 +
6910 +       if (!_nss_setgrent)
6911 +               return;
6912 +
6913 +       status = _nss_setgrent();
6914 +       if (status != NSS_STATUS_SUCCESS) {
6915 +               report_nss_error("setgrent", status);
6916 +       }
6917 +}
6918 +
6919 +static void nss_endgrent(void)
6920 +{
6921 +       NSS_STATUS (*_nss_endgrent)(void) = find_fn("endgrent");
6922 +       NSS_STATUS status;
6923 +
6924 +       if (!_nss_endgrent)
6925 +               return;
6926 +
6927 +       status = _nss_endgrent();
6928 +       if (status != NSS_STATUS_SUCCESS) {
6929 +               report_nss_error("endgrent", status);
6930 +       }
6931 +}
6932 +
6933 +static int nss_initgroups(char *user, gid_t group, gid_t **groups, long int *start, long int *size)
6934 +{
6935 +       NSS_STATUS (*_nss_initgroups)(char *, gid_t , long int *,
6936 +                                     long int *, gid_t **, long int , int *) = 
6937 +               find_fn("initgroups_dyn");
6938 +       NSS_STATUS status;
6939 +
6940 +       if (!_nss_initgroups) 
6941 +               return NSS_STATUS_UNAVAIL;
6942 +
6943 +       status = _nss_initgroups(user, group, start, size, groups, 0, &nss_errno);
6944 +       if (status != NSS_STATUS_SUCCESS) {
6945 +               report_nss_error("initgroups", status);
6946 +       }
6947 +       return status;
6948 +}
6949 +
6950 +static void print_passwd(struct passwd *pwd)
6951 +{
6952 +       printf("%s:%s:%lu:%lu:%s:%s:%s\n", 
6953 +              pwd->pw_name,
6954 +              pwd->pw_passwd,
6955 +              (unsigned long)pwd->pw_uid,
6956 +              (unsigned long)pwd->pw_gid,
6957 +              pwd->pw_gecos,
6958 +              pwd->pw_dir,
6959 +              pwd->pw_shell);
6960 +}
6961 +
6962 +static void print_group(struct group *grp)
6963 +{
6964 +       int i;
6965 +       printf("%s:%s:%lu: ", 
6966 +              grp->gr_name,
6967 +              grp->gr_passwd,
6968 +              (unsigned long)grp->gr_gid);
6969 +       
6970 +       if (!grp->gr_mem[0]) {
6971 +               printf("\n");
6972 +               return;
6973 +       }
6974 +       
6975 +       for (i=0; grp->gr_mem[i+1]; i++) {
6976 +               printf("%s, ", grp->gr_mem[i]);
6977 +       }
6978 +       printf("%s\n", grp->gr_mem[i]);
6979 +}
6980 +
6981 +static void nss_test_initgroups(char *name, gid_t gid)
6982 +{
6983 +       long int size = 16;
6984 +       long int start = 1;
6985 +       gid_t *groups = NULL;
6986 +       int i;
6987 +       NSS_STATUS status;
6988 +
6989 +       groups = (gid_t *)malloc(size * sizeof(gid_t));
6990 +       groups[0] = gid;
6991 +
6992 +       status = nss_initgroups(name, gid, &groups, &start, &size);
6993 +       if (status == NSS_STATUS_UNAVAIL) {
6994 +               printf("No initgroups fn\n");
6995 +               return;
6996 +       }
6997 +
6998 +       for (i=0; i<start-1; i++) {
6999 +               printf("%lu, ", (unsigned long)groups[i]);
7000 +       }
7001 +       printf("%lu\n", (unsigned long)groups[i]);
7002 +}
7003 +
7004 +
7005 +static void nss_test_users(void)
7006 +{
7007 +       struct passwd *pwd;
7008 +
7009 +       nss_setpwent();
7010 +       /* loop over all users */
7011 +       while ((pwd = nss_getpwent())) {
7012 +               printf("Testing user %s\n", pwd->pw_name);
7013 +               printf("getpwent:   "); print_passwd(pwd);
7014 +               pwd = nss_getpwuid(pwd->pw_uid);
7015 +               if (!pwd) {
7016 +                       total_errors++;
7017 +                       printf("ERROR: can't getpwuid\n");
7018 +                       continue;
7019 +               }
7020 +               printf("getpwuid:   "); print_passwd(pwd);
7021 +               pwd = nss_getpwnam(pwd->pw_name);
7022 +               if (!pwd) {
7023 +                       total_errors++;
7024 +                       printf("ERROR: can't getpwnam\n");
7025 +                       continue;
7026 +               }
7027 +               printf("getpwnam:   "); print_passwd(pwd);
7028 +               printf("initgroups: "); nss_test_initgroups(pwd->pw_name, pwd->pw_gid);
7029 +               printf("\n");
7030 +       }
7031 +       nss_endpwent();
7032 +}
7033 +
7034 +static void nss_test_groups(void)
7035 +{
7036 +       struct group *grp;
7037 +
7038 +       nss_setgrent();
7039 +       /* loop over all groups */
7040 +       while ((grp = nss_getgrent())) {
7041 +               printf("Testing group %s\n", grp->gr_name);
7042 +               printf("getgrent: "); print_group(grp);
7043 +               grp = nss_getgrnam(grp->gr_name);
7044 +               if (!grp) {
7045 +                       total_errors++;
7046 +                       printf("ERROR: can't getgrnam\n");
7047 +                       continue;
7048 +               }
7049 +               printf("getgrnam: "); print_group(grp);
7050 +               grp = nss_getgrgid(grp->gr_gid);
7051 +               if (!grp) {
7052 +                       total_errors++;
7053 +                       printf("ERROR: can't getgrgid\n");
7054 +                       continue;
7055 +               }
7056 +               printf("getgrgid: "); print_group(grp);
7057 +               printf("\n");
7058 +       }
7059 +       nss_endgrent();
7060 +}
7061 +
7062 +static void nss_test_errors(void)
7063 +{
7064 +       struct passwd *pwd;
7065 +       struct group *grp;
7066 +
7067 +       pwd = getpwnam("nosuchname");
7068 +       if (pwd || last_error != NSS_STATUS_NOTFOUND) {
7069 +               total_errors++;
7070 +               printf("ERROR Non existant user gave error %d\n", last_error);
7071 +       }
7072 +
7073 +       pwd = getpwuid(0xFFF0);
7074 +       if (pwd || last_error != NSS_STATUS_NOTFOUND) {
7075 +               total_errors++;
7076 +               printf("ERROR Non existant uid gave error %d\n", last_error);
7077 +       }
7078 +
7079 +       grp = getgrnam("nosuchgroup");
7080 +       if (grp || last_error != NSS_STATUS_NOTFOUND) {
7081 +               total_errors++;
7082 +               printf("ERROR Non existant group gave error %d\n", last_error);
7083 +       }
7084 +
7085 +       grp = getgrgid(0xFFF0);
7086 +       if (grp || last_error != NSS_STATUS_NOTFOUND) {
7087 +               total_errors++;
7088 +               printf("ERROR Non existant gid gave error %d\n", last_error);
7089 +       }
7090 +}
7091 +
7092 + int main(int argc, char *argv[])
7093 +{      
7094 +       if (argc > 1) so_path = argv[1];
7095 +       if (argc > 2) nss_name = argv[2];
7096 +
7097 +       nss_test_users();
7098 +       nss_test_groups();
7099 +       nss_test_errors();
7100 +
7101 +       printf("total_errors=%d\n", total_errors);
7102 +
7103 +       return total_errors;
7104 +}
This page took 0.505996 seconds and 4 git commands to generate.