Use common signal helper implementation.
[samba.git] / source3 / Makefile.in
index 828740c9da2a19bc7b4229f52846f33b6b03f04d..d1eb3d5538530b8d4eb97e23d6ea45d180582547 100644 (file)
@@ -25,7 +25,7 @@ SHLD=@SHLD@
 LIB_PATH_VAR=@LIB_PATH_VAR@
 
 ## Dynamic shared libraries build settings
-DSO_EXPORTS_CMD=-Wl,--version-script,$(srcdir)/exports/`basename $@ | sed 's/@SHLIBEXT@\(.[0-9]\+\)\?$$/@SYMSEXT@/'`
+DSO_EXPORTS_CMD=-Wl,--version-script,$(srcdir)/exports/`basename $@ | sed 's/@SHLIBEXT@\(.[0-9]\{1,\}\)\{0,1\}$$/@SYMSEXT@/'`
 DSO_EXPORTS=@DSO_EXPORTS@
 SHLD_DSO = $(SHLD) $(LDSHFLAGS) $(DSO_EXPORTS) -o $@
 
@@ -34,8 +34,8 @@ SHLD_DSO = $(SHLD) $(LDSHFLAGS) $(DSO_EXPORTS) -o $@
 MODULE_EXPORTS=@MODULE_EXPORTS@
 
 # Add $(DEVELOPER_CFLAGS) to $(CFLAGS) to enable extra compiler
-# (GCC) warnings. This is done automtically for --enable-developer
-# and --enable-krb5developer.
+# (GCC) warnings. This is done automtically for --enable-developer,
+# --enable-picky-developer and --enable-krb5developer.
 DEVELOPER_CFLAGS=@DEVELOPER_CFLAGS@
 CFLAGS=@CFLAGS@
 CPPFLAGS=-DHAVE_CONFIG_H @CPPFLAGS@
@@ -65,7 +65,14 @@ LDAP_LIBS=@LDAP_LIBS@
 NSCD_LIBS=@NSCD_LIBS@
 UUID_LIBS=@UUID_LIBS@
 WINBIND_LIBS=@WINBIND_LIBS@
+WINBIND_NSS_EXTRA_LIBS=@WINBIND_NSS_EXTRA_LIBS@
+WINBIND_NSS_PTHREAD=@WINBIND_NSS_PTHREAD@
+PAM_WINBIND_EXTRA_LIBS=@PAM_WINBIND_EXTRA_LIBS@
 DNSSD_LIBS=@DNSSD_LIBS@
+POPT_LIBS=@POPTLIBS@
+LIBTALLOC_LIBS=@LIBTALLOC_LIBS@
+LIBTDB_LIBS=@LIBTDB_LIBS@
+LIBNETAPI_LIBS=@LIBNETAPI_LIBS@
 
 INSTALLCMD=@INSTALL@
 INSTALLLIBCMD_SH=@INSTALLLIBCMD_SH@
@@ -92,17 +99,18 @@ BINDIR = @bindir@
 SBINDIR = @sbindir@
 ROOTSBINDIR = @rootsbindir@
 LIBDIR = @libdir@
+MODULESDIR = @modulesdir@
 INCLUDEDIR=@includedir@
 PAMMODULESDIR = @pammodulesdir@
-VFSLIBDIR = $(LIBDIR)/vfs
-PDBLIBDIR = $(LIBDIR)/pdb
-RPCLIBDIR = $(LIBDIR)/rpc
-IDMAPLIBDIR = $(LIBDIR)/idmap
-NSSINFOLIBDIR = $(LIBDIR)/nss_info
-CHARSETLIBDIR = $(LIBDIR)/charset
-AUTHLIBDIR = $(LIBDIR)/auth
-CONFIGLIBDIR = $(LIBDIR)/config
-GPEXTLIBDIR = $(LIBDIR)/gpext
+VFSLIBDIR = $(MODULESDIR)/vfs
+PDBLIBDIR = $(MODULESDIR)/pdb
+RPCLIBDIR = $(MODULESDIR)/rpc
+IDMAPLIBDIR = $(MODULESDIR)/idmap
+NSSINFOLIBDIR = $(MODULESDIR)/nss_info
+CHARSETLIBDIR = $(MODULESDIR)/charset
+AUTHLIBDIR = $(MODULESDIR)/auth
+CONFIGLIBDIR = $(MODULESDIR)/config
+GPEXTLIBDIR = $(MODULESDIR)/gpext
 CONFIGDIR = @configdir@
 VARDIR = @localstatedir@
 MANDIR = @mandir@
@@ -119,6 +127,7 @@ LOGFILEBASE = @logfilebase@
 CONFIGFILE = $(CONFIGDIR)/smb.conf
 LMHOSTSFILE = $(CONFIGDIR)/lmhosts
 CTDBDIR = @ctdbdir@
+NCALRPCDIR = @ncalrpcdir@
 
 # This is where smbpasswd et al go
 PRIVATEDIR = @privatedir@
@@ -142,12 +151,7 @@ CODEPAGEDIR = @codepagedir@
 # the directory where pid files go
 PIDDIR = @piddir@
 
-FLAGS1 = $(CFLAGS) @FLAGS1@ @SAMBA_CPPFLAGS@ $(CPPFLAGS)
-FLAGS2 =
-FLAGS3 =
-FLAGS4 = -I$(CTDBDIR)/include
-FLAGS5 = $(FLAGS1) $(FLAGS2) $(FLAGS3) $(FLAGS4)
-FLAGS  = $(ISA) $(FLAGS5) -I$(srcdir)/lib -D_SAMBA_BUILD_=3
+FLAGS = -I. -I$(srcdir) @FLAGS1@ @SAMBA_CPPFLAGS@ $(CPPFLAGS) -I$(CTDBDIR)/include $(ISA) -I$(srcdir)/lib -D_SAMBA_BUILD_=3
 
 PATH_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" \
        -DPRIVATE_DIR=\"$(PRIVATE_DIR)\" \
@@ -159,9 +163,11 @@ PATH_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" \
        -DLOCKDIR=\"$(LOCKDIR)\" \
        -DPIDDIR=\"$(PIDDIR)\" \
        -DLIBDIR=\"$(LIBDIR)\" \
+       -DMODULESDIR=\"$(MODULESDIR)\" \
        -DLOGFILEBASE=\"$(LOGFILEBASE)\" \
        -DSHLIBEXT=\"@SHLIBEXT@\" \
        -DCTDBDIR=\"$(CTDBDIR)\" \
+       -DNCALRPCDIR=\"$(NCALRPCDIR)\" \
        -DCONFIGDIR=\"$(CONFIGDIR)\" \
        -DCODEPAGEDIR=\"$(CODEPAGEDIR)\" \
        -DCACHEDIR=\"$(CACHEDIR)\" \
@@ -171,7 +177,7 @@ PATH_FLAGS = -DSMB_PASSWD_FILE=\"$(SMB_PASSWD_FILE)\" \
 
 SBIN_PROGS = bin/smbd@EXEEXT@ bin/nmbd@EXEEXT@ @SWAT_SBIN_TARGETS@ @EXTRA_SBIN_PROGS@
 
-ROOT_SBIN_PROGS = @CIFSMOUNT_PROGS@ @CIFSSPNEGO_PROGS@
+ROOT_SBIN_PROGS = @CIFSMOUNT_PROGS@
 
 BIN_PROGS1 = bin/smbclient@EXEEXT@ bin/net@EXEEXT@ bin/smbspool@EXEEXT@ \
        bin/testparm@EXEEXT@ bin/smbstatus@EXEEXT@ bin/smbget@EXEEXT@
@@ -221,9 +227,9 @@ MODULES = $(VFS_MODULES) $(PDB_MODULES) $(RPC_MODULES) $(IDMAP_MODULES) \
 # object file lists
 ######################################################################
 
-TDB_OBJ = lib/util_tdb.o \
+TDB_LIB_OBJ = lib/util_tdb.o \
          lib/dbwrap.o lib/dbwrap_tdb.o \
-         lib/dbwrap_tdb2.o lib/dbwrap_ctdb.o \
+         lib/dbwrap_ctdb.o \
          lib/dbwrap_rbt.o @LIBTDB_STATIC@
 
 SMBLDAP_OBJ = @SMBLDAP@ @SMBLDAPUTIL@
@@ -245,7 +251,7 @@ LIBNDR_DRSUAPI_OBJ = librpc/ndr/ndr_drsuapi.o \
                     librpc/gen_ndr/ndr_drsuapi.o \
                     librpc/gen_ndr/ndr_drsblobs.o
 
-COMPRESSION_OBJ = lib/compression/mszip.o
+COMPRESSION_OBJ = ../lib/compression/mszip.o
 
 DRSUAPI_OBJ = $(LIBNDR_DRSUAPI_OBJ) \
              $(COMPRESSION_OBJ)
@@ -262,16 +268,20 @@ LIBNDR_OBJ = librpc/ndr/ndr_basic.o \
 
 RPCCLIENT_NDR_OBJ = rpc_client/ndr.o
 
+LIBNDR_GEN_OBJ0 = librpc/gen_ndr/ndr_samr.o \
+                 librpc/gen_ndr/ndr_lsa.o
+
+LIBNDR_GEN_OBJ1 = librpc/gen_ndr/ndr_netlogon.o
+
 LIBNDR_GEN_OBJ = librpc/gen_ndr/ndr_wkssvc.o \
-                librpc/gen_ndr/ndr_lsa.o \
+                $(LIBNDR_GEN_OBJ0) \
                 librpc/gen_ndr/ndr_dfs.o \
                 librpc/gen_ndr/ndr_echo.o \
                 librpc/gen_ndr/ndr_winreg.o \
                 librpc/gen_ndr/ndr_initshutdown.o \
                 librpc/gen_ndr/ndr_srvsvc.o \
                 librpc/gen_ndr/ndr_eventlog.o \
-                librpc/gen_ndr/ndr_netlogon.o \
-                librpc/gen_ndr/ndr_samr.o \
+                $(LIBNDR_GEN_OBJ1) \
                 librpc/gen_ndr/ndr_dssetup.o \
                 librpc/gen_ndr/ndr_notify.o \
                 librpc/gen_ndr/ndr_xattr.o \
@@ -304,28 +314,30 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) \
          lib/messages_ctdbd.o lib/packet.o lib/ctdbd_conn.o lib/talloc_stack.o \
          lib/interfaces.o lib/rbtree.o lib/memcache.o \
          lib/util_transfer_file.o lib/async_req.o \
-         $(TDB_OBJ) \
+         lib/async_sock.o \
+         $(TDB_LIB_OBJ) \
          $(VERSION_OBJ) lib/charcnv.o lib/debug.o lib/fault.o \
-         lib/interface.o lib/md4.o \
+         lib/interface.o ../lib/crypto/md4.o \
          lib/pidfile.o \
-         lib/signal.o lib/system.o lib/sendfile.o lib/recvfile.o lib/time.o \
+         ../lib/util/signal.o lib/system.o lib/sendfile.o lib/recvfile.o lib/time.o \
+         ../lib/util/time.o \
          lib/ufc.o lib/genrand.o lib/username.o \
          lib/util_pw.o lib/access.o lib/smbrun.o \
-         lib/bitmap.o lib/crc32.o lib/dprintf.o \
-         lib/xfile.o lib/wins_srv.o $(UTIL_REG_OBJ) \
+         lib/bitmap.o ../lib/crypto/crc32.o lib/dprintf.o $(UTIL_REG_OBJ) \
+         ../lib/util/xfile.o ../lib/util/util_strlist.o lib/wins_srv.o \
          lib/util_str.o lib/clobber.o lib/util_sid.o lib/util_uuid.o \
-         lib/util_unistr.o lib/util_file.o lib/data_blob.o \
+         lib/util_unistr.o lib/util_file.o ../lib/util/data_blob.o \
          lib/util.o lib/util_sock.o lib/sock_exec.o lib/util_sec.o \
          lib/substitute.o lib/fsusage.o lib/dbwrap_util.o \
          lib/ms_fnmatch.o lib/select.o lib/errmap_unix.o \
          lib/tallocmsg.o lib/dmallocmsg.o libsmb/smb_signing.o \
-         lib/md5.o lib/hmacmd5.o lib/arc4.o lib/iconv.o \
-         lib/pam_errors.o intl/lang_tdb.o lib/conn_tdb.o \
+         ../lib/crypto/md5.o ../lib/crypto/hmacmd5.o ../lib/crypto/arcfour.o \
+         lib/iconv.o lib/pam_errors.o intl/lang_tdb.o lib/conn_tdb.o \
          lib/adt_tree.o lib/gencache.o \
          lib/module.o lib/events.o lib/ldap_escape.o @CHARSET_STATIC@ \
          lib/secdesc.o lib/util_seaccess.o lib/secace.o lib/secacl.o \
          libads/krb5_errs.o lib/system_smbd.o lib/audit.o $(LIBNDR_OBJ) \
-         lib/file_id.o
+         lib/file_id.o lib/idmap_cache.o
 
 LIB_DUMMY_OBJ = lib/dummysmbd.o lib/dummyroot.o
 LIB_NONSMBD_OBJ = $(LIB_OBJ) $(LIB_DUMMY_OBJ)
@@ -367,7 +379,9 @@ LIBADS_SERVER_OBJ = libads/kerberos_verify.o libads/authdata.o \
 
 SECRETS_OBJ = passdb/secrets.o passdb/machine_sid.o
 
-LIBNBT_OBJ = libcli/nbt/nbtname.o \
+LIBNBT_OBJ = ../libcli/nbt/nbtname.o \
+            ../libcli/netlogon.o \
+            ../libcli/ndr_netlogon.o \
             librpc/gen_ndr/ndr_nbt.o \
             librpc/gen_ndr/ndr_svcctl.o
 
@@ -609,6 +623,8 @@ VFS_TSMSM_OBJ = modules/vfs_tsmsm.o
 VFS_FILEID_OBJ = modules/vfs_fileid.o
 VFS_AIO_FORK_OBJ = modules/vfs_aio_fork.o
 VFS_SYNCOPS_OBJ = modules/vfs_syncops.o
+VFS_ACL_XATTR_OBJ = modules/vfs_acl_xattr.o
+VFS_SMB_TRAFFIC_ANALYZER_OBJ = modules/vfs_smb_traffic_analyzer.o
 
 PLAINTEXT_AUTH_OBJ = auth/pampass.o auth/pass_check.o
 
@@ -623,6 +639,7 @@ AUTH_SERVER_OBJ = auth/auth_server.o
 AUTH_UNIX_OBJ = auth/auth_unix.o
 AUTH_WINBIND_OBJ = auth/auth_winbind.o
 AUTH_SCRIPT_OBJ = auth/auth_script.o
+AUTH_NETLOGOND_OBJ = auth/auth_netlogond.o
 
 AUTH_OBJ = auth/auth.o @AUTH_STATIC@ auth/auth_util.o auth/token_util.o \
           auth/auth_compat.o auth/auth_ntlmssp.o \
@@ -693,7 +710,7 @@ NMBD_OBJ1 = nmbd/asyncdns.o nmbd/nmbd.o nmbd/nmbd_become_dmb.o \
 
 NMBD_OBJ = $(NMBD_OBJ1) $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
            $(PROFILE_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) \
-          librpc/gen_ndr/ndr_samr.o librpc/gen_ndr/ndr_lsa.o
+          $(LIBNDR_GEN_OBJ0)
 
 SWAT_OBJ1 = web/cgi.o web/diagnose.o web/startstop.o web/statuspage.o \
            web/swat.o web/neg_lang.o
@@ -726,6 +743,10 @@ TESTPARM_OBJ = utils/testparm.o \
                $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) \
               $(LIBSAMBA_OBJ)
 
+TEST_LP_LOAD_OBJ = param/test_lp_load.o \
+                  $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
+                  $(POPT_LIB_OBJ) $(LIBSAMBA_OBJ)
+
 PASSWD_UTIL_OBJ = utils/passwd_util.o
 
 SMBPASSWD_OBJ = utils/smbpasswd.o $(PASSWD_UTIL_OBJ) $(PASSCHANGE_OBJ) \
@@ -865,13 +886,13 @@ NET_OBJ = $(NET_OBJ1) \
 
 CUPS_OBJ = client/smbspool.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
          $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) $(POPT_LIB_OBJ) \
-         librpc/gen_ndr/ndr_samr.o librpc/gen_ndr/ndr_lsa.o
+         $(LIBNDR_GEN_OBJ0)
 
 CIFS_MOUNT_OBJ = client/mount.cifs.o
 
 CIFS_UMOUNT_OBJ = client/umount.cifs.o
 
-CIFS_SPNEGO_OBJ = client/cifs.spnego.o
+CIFS_UPCALL_OBJ = client/cifs.upcall.o
 
 NMBLOOKUP_OBJ = utils/nmblookup.o $(PARAM_OBJ) $(LIBNMB_OBJ) \
                $(LIB_NONSMBD_OBJ) $(POPT_LIB_OBJ) $(LIBSAMBA_OBJ)
@@ -881,28 +902,28 @@ SMBTORTURE_OBJ1 = torture/torture.o torture/nbio.o torture/scanner.o torture/uta
 
 SMBTORTURE_OBJ = $(SMBTORTURE_OBJ1) $(PARAM_OBJ) \
        $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) \
-       librpc/gen_ndr/ndr_samr.o librpc/gen_ndr/ndr_lsa.o
+       $(LIBNDR_GEN_OBJ0)
 
 MASKTEST_OBJ = torture/masktest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
                  $(LIB_NONSMBD_OBJ) \
-                librpc/gen_ndr/ndr_samr.o librpc/gen_ndr/ndr_lsa.o
+                $(LIBNDR_GEN_OBJ0)
 
 MSGTEST_OBJ = torture/msgtest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
                  $(LIB_NONSMBD_OBJ) \
-                librpc/gen_ndr/ndr_samr.o librpc/gen_ndr/ndr_lsa.o
+                $(LIBNDR_GEN_OBJ0)
 
 LOCKTEST_OBJ = torture/locktest.o $(PARAM_OBJ) $(LOCKING_OBJ) $(KRBCLIENT_OBJ) \
                $(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) \
-               librpc/gen_ndr/ndr_samr.o librpc/gen_ndr/ndr_lsa.o
+               $(LIBNDR_GEN_OBJ0)
 
 NSSTEST_OBJ = torture/nsstest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
                  $(LIB_NONSMBD_OBJ) \
-                librpc/gen_ndr/ndr_samr.o librpc/gen_ndr/ndr_lsa.o
+                $(LIBNDR_GEN_OBJ0)
 
 PDBTEST_OBJ = torture/pdbtest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
                $(LIB_NONSMBD_OBJ) $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(GROUPDB_OBJ) \
                $(SMBLDAP_OBJ) $(POPT_LIB_OBJ) $(LDB_OBJ) \
-               librpc/gen_ndr/ndr_samr.o librpc/gen_ndr/ndr_lsa.o
+               $(LIBNDR_GEN_OBJ0)
 
 VFSTEST_OBJ = torture/cmd_vfs.o torture/vfstest.o $(SMBD_OBJ_BASE) $(READLINE_OBJ)
 
@@ -912,7 +933,7 @@ LOG2PCAP_OBJ = utils/log2pcaphex.o
 
 LOCKTEST2_OBJ = torture/locktest2.o $(PARAM_OBJ) $(LOCKING_OBJ) $(LIBSMB_OBJ) \
                $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) \
-               librpc/gen_ndr/ndr_samr.o librpc/gen_ndr/ndr_lsa.o
+               $(LIBNDR_GEN_OBJ0)
 
 SMBCACLS_OBJ = utils/smbcacls.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
                $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) $(RPC_PARSE_OBJ) \
@@ -936,13 +957,14 @@ SHARESEC_OBJ  = $(SHARESEC_OBJ0) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
                $(LIBSAMBA_OBJ) \
                 $(POPT_LIB_OBJ)
 
-TALLOCTORT_OBJ = @tallocdir@/testsuite.o $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) \
-                 $(LIBSAMBA_OBJ)
+TALLOCTORT_OBJ = @tallocdir@/testsuite.o @tallocdir@/testsuite_main.o \
+               $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(LIBSAMBA_OBJ)
 
-REPLACETORT_OBJ = lib/replace/test/testsuite.o \
-               lib/replace/test/getifaddrs.o \
-               lib/replace/test/os2_delete.o \
-               lib/replace/test/strptime.o \
+REPLACETORT_OBJ = @libreplacedir@/test/testsuite.o \
+               @libreplacedir@/test/getifaddrs.o \
+               @libreplacedir@/test/os2_delete.o \
+               @libreplacedir@/test/strptime.o \
+               @libreplacedir@/test/main.o \
                $(LIBREPLACE_OBJ)
 
 NDRDUMP_OBJ = librpc/tools/ndrdump.o \
@@ -954,11 +976,11 @@ DEBUG2HTML_OBJ = utils/debug2html.o utils/debugparse.o
 
 SMBFILTER_OBJ = utils/smbfilter.o $(PARAM_OBJ) $(LIBSMB_OBJ) \
                  $(LIB_NONSMBD_OBJ) $(KRBCLIENT_OBJ) \
-                librpc/gen_ndr/ndr_samr.o librpc/gen_ndr/ndr_lsa.o
+                $(LIBNDR_GEN_OBJ0)
 
 WINBIND_WINS_NSS_OBJ = nsswitch/wins.o $(PARAM_OBJ) \
        $(LIBSMB_OBJ) $(LIB_NONSMBD_OBJ) $(NSSWINS_OBJ) $(KRBCLIENT_OBJ) \
-       librpc/gen_ndr/ndr_samr.o librpc/gen_ndr/ndr_lsa.o
+       $(LIBNDR_GEN_OBJ0)
 
 PAM_SMBPASS_OBJ_0 = pam_smbpass/pam_smb_auth.o pam_smbpass/pam_smb_passwd.o \
                pam_smbpass/pam_smb_acct.o pam_smbpass/support.o
@@ -966,10 +988,22 @@ PAM_SMBPASS_OBJ = $(PAM_SMBPASS_OBJ_0) $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(PASSDB_
                $(SMBLDAP_OBJ) $(LIBSAMBA_OBJ) \
                $(LDB_OBJ)
 
-IDMAP_OBJ     = winbindd/idmap.o winbindd/idmap_cache.o winbindd/idmap_util.o @IDMAP_STATIC@
+IDMAP_OBJ     = winbindd/idmap.o winbindd/idmap_util.o @IDMAP_STATIC@
 
 NSS_INFO_OBJ = winbindd/nss_info.o @NSS_INFO_STATIC@
 
+IDMAP_HASH_OBJ = \
+               winbindd/idmap_hash/idmap_hash.o \
+               winbindd/idmap_hash/mapfile.o
+
+IDMAP_ADEX_OBJ = \
+               winbindd/idmap_adex/idmap_adex.o \
+               winbindd/idmap_adex/cell_util.o \
+               winbindd/idmap_adex/likewise_cell.o \
+               winbindd/idmap_adex/provider_unified.o \
+               winbindd/idmap_adex/gc_util.o \
+               winbindd/idmap_adex/domain_util.o
+
 WINBINDD_OBJ1 = \
                winbindd/winbindd.o       \
                winbindd/winbindd_user.o  \
@@ -1045,10 +1079,10 @@ LDBDEL_OBJ = $(LDB_CMDLINE_OBJ) lib/ldb/tools/ldbdel.o
 LDBMODIFY_OBJ = $(LDB_CMDLINE_OBJ) lib/ldb/tools/ldbmodify.o
 
 WINBIND_KRB5_LOCATOR_OBJ1 = nsswitch/winbind_krb5_locator.o
-WINBIND_KRB5_LOCATOR_OBJ = $(WINBIND_KRB5_LOCATOR_OBJ1) $(WBCOMMON_OBJ) $(LIBREPLACE_OBJ)
+WINBIND_KRB5_LOCATOR_OBJ = $(WINBIND_KRB5_LOCATOR_OBJ1) $(LIBREPLACE_OBJ)
 
-POPT_OBJ=popt/findme.o popt/popt.o popt/poptconfig.o \
-          popt/popthelp.o popt/poptparse.o
+POPT_OBJ=../lib/popt/findme.o ../lib/popt/popt.o ../lib/popt/poptconfig.o \
+          ../lib/popt/popthelp.o ../lib/popt/poptparse.o
 
 INIPARSER_OBJ = iniparser_build/iniparser.o iniparser_build/dictionary.o \
                iniparser_build/strlib.o
@@ -1074,9 +1108,7 @@ NTLM_AUTH_OBJ = ${NTLM_AUTH_OBJ1} $(LIBSAMBA_OBJ) $(POPT_LIB_OBJ) \
                $(PASSDB_OBJ) $(GROUPDB_OBJ) \
                $(SMBLDAP_OBJ) $(LIBNMB_OBJ) \
                $(LDB_OBJ) $(WBCOMMON_OBJ) @LIBWBCLIENT_STATIC@ \
-               librpc/gen_ndr/ndr_samr.o \
-               librpc/gen_ndr/ndr_lsa.o \
-               librpc/gen_ndr/ndr_netlogon.o
+               $(LIBNDR_GEN_OBJ0) $(LIBNDR_GEN_OBJ1)
 
 
 VLP_OBJ1 = ../testsuite/printing/vlp.o $(RPC_CLIENT_OBJ1) $(RPC_PARSE_OBJ2) $(RPC_CLIENT_OBJ) librpc/rpc/binding.o
@@ -1115,6 +1147,8 @@ pam_smbpass: SHOWFLAGS bin/pam_smbpass.@SHLIBEXT@
 
 pam_winbind: SHOWFLAGS bin/pam_winbind.@SHLIBEXT@
 
+gpext_modules:: $(GPEXT_MODULES)
+
 torture:: SHOWFLAGS $(TORTURE_PROGS)
 
 smbtorture : SHOWFLAGS bin/smbtorture@EXEEXT@
@@ -1157,14 +1191,13 @@ modules:: SHOWFLAGS $(MODULES)
 
 #####################################################################
 ## Perl IDL Compiler
-IDL_FILES = lsa.idl dfs.idl echo.idl winreg.idl initshutdown.idl \
-       srvsvc.idl svcctl.idl eventlog.idl wkssvc.idl netlogon.idl notify.idl \
-       epmapper.idl messaging.idl xattr.idl misc.idl samr.idl security.idl \
-       dssetup.idl krb5pac.idl ntsvcs.idl libnetapi.idl drsuapi.idl drsblobs.idl \
-       nbt.idl
-
-idl::
-       @IDL_FILES="$(IDL_FILES)" CPP="$(CPP)" PERL="$(PERL)" \
+samba3-idl::
+       @IDL_FILES="lsa.idl dfs.idl echo.idl winreg.idl initshutdown.idl \
+               srvsvc.idl svcctl.idl eventlog.idl wkssvc.idl netlogon.idl notify.idl \
+               epmapper.idl messaging.idl xattr.idl misc.idl samr.idl security.idl \
+               dssetup.idl krb5pac.idl ntsvcs.idl libnetapi.idl drsuapi.idl drsblobs.idl \
+               nbt.idl" \
+               CPP="$(CPP)" PIDL="../pidl/pidl" \
         srcdir="$(srcdir)" $(srcdir)/script/build_idl.sh $(PIDL_ARGS)
 
 
@@ -1178,7 +1211,7 @@ everything:: all libtalloc libsmbclient libnetapi debug2html smbfilter talloctor
 .SUFFIXES: .c .o .lo
 
 SHOWFLAGS::
-       @echo "Using FLAGS      = $(FLAGS)"
+       @echo "Using CFLAGS     = $(CFLAGS)"
        @echo "      PICFLAG    = $(PICFLAG)"
        @echo "      LIBS       = $(LIBS)"
        @echo "      LDFLAGS    = $(LDFLAGS)"
@@ -1196,11 +1229,11 @@ MAKEDIR = || exec false; \
          exec false; fi || exec false
 
 # Run a static checker.
-CHECK_CC = $(CC_CHECKER) -I. -I$(srcdir) $(FLAGS) $(PICFLAG) -c $< -o $@
+CHECK_CC = $(CC_CHECKER) $(CFLAGS) $(PICFLAG) -c $< -o $@
 # Compile a source file.
-COMPILE_CC = $(CC) -I. -I$(srcdir) $(FLAGS) $(PICFLAG) -c $< -o $@
+COMPILE_CC = $(CC) $(CFLAGS) $(PICFLAG) -c $< -o $@
 # Compile a source file with the installation paths defined.
-COMPILE_CC_PATH = $(CC) -I. -I$(srcdir) $(PATH_FLAGS) $(FLAGS) $(PICFLAG) -c $< -o $@
+COMPILE_CC_PATH = $(CC) $(PATH_FLAGS) $(CFLAGS) $(PICFLAG) -c $< -o $@
 
 COMPILE = $(COMPILE_CC)
 
@@ -1214,7 +1247,7 @@ COMPILE = $(COMPILE_CC)
        @echo Compiling $*.c
        @$(COMPILE) && exit 0;\
                echo "The following command failed:" 1>&2;\
-               echo "$(COMPILE_CC)" 1>&2;\
+               echo "$(subst ",\",$(COMPILE_CC))" 1>&2;\
                $(COMPILE_CC) >/dev/null 2>&1
 @BROKEN_CC@    -mv `echo $@ | sed 's%^.*/%%g'` $@
 
@@ -1279,258 +1312,258 @@ bin/smbd@EXEEXT@: $(BINARY_PREREQS) $(SMBD_OBJ) @LIBTALLOC_SHARED@ @LIBTDB_SHARE
        @$(CC) $(FLAGS) -o $@ $(SMBD_OBJ) $(LDFLAGS) $(LDAP_LIBS) \
                $(KRB5LIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) \
                $(ACL_LIBS) $(PASSDB_LIBS) $(LIBS) $(DNSSD_LIBS) \
-               @POPTLIBS@ @SMBD_LIBS@ @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ \
-               @WINBIND_LIBS@
+               $(POPT_LIBS) @SMBD_LIBS@ $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) \
+               $(WINBIND_LIBS)
 
 bin/nmbd@EXEEXT@: $(BINARY_PREREQS) $(NMBD_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(NMBD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @POPTLIBS@ \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(POPT_LIBS) \
                $(KRB5LIBS) $(LDAP_LIBS)
 
 bin/swat@EXEEXT@: $(BINARY_PREREQS) $(SWAT_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SWAT_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINT_LIBS) \
-         $(AUTH_LIBS) $(LIBS) $(PASSDB_LIBS) @POPTLIBS@ $(KRB5LIBS) \
-         $(LDAP_LIBS) @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+         $(AUTH_LIBS) $(LIBS) $(PASSDB_LIBS) $(POPT_LIBS) $(KRB5LIBS) \
+         $(LDAP_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/rpcclient@EXEEXT@: $(BINARY_PREREQS) $(RPCCLIENT_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(PASSDB_LIBS) $(RPCCLIENT_OBJ) \
-               $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ \
-               $(KRB5LIBS) $(LDAP_LIBS) @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ \
-               @WINBIND_LIBS@
+               $(DYNEXP) $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) $(POPT_LIBS) \
+               $(KRB5LIBS) $(LDAP_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) \
+               $(WINBIND_LIBS)
 
 bin/smbclient@EXEEXT@: $(BINARY_PREREQS) $(CLIENT_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(CLIENT_OBJ) $(LDFLAGS) $(DYNEXP) \
-               $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ \
+               $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) $(POPT_LIBS) \
                $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) $(DNSSD_LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/net@EXEEXT@: $(BINARY_PREREQS) $(NET_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@ @LIBNETAPI_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(NET_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
-               @POPTLIBS@ $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) \
+               $(POPT_LIBS) $(KRB5LIBS) $(UUID_LIBS) $(LDAP_LIBS) \
                $(PASSDB_LIBS) $(TERMLDFLAGS) $(TERMLIBS) $(NSCD_LIBS) \
-               @INIPARSERLIBS@ @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@ @LIBNETAPI_LIBS@
+               @INIPARSERLIBS@ $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS) $(LIBNETAPI_LIBS)
 
 bin/profiles@EXEEXT@: $(BINARY_PREREQS) $(PROFILES_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(PROFILES_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
-               $(LDAP_LIBS) @POPTLIBS@ @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LDAP_LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/smbspool@EXEEXT@: $(BINARY_PREREQS) $(CUPS_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(CUPS_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
-               $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(KRB5LIBS) $(LDAP_LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/mount.cifs@EXEEXT@: $(BINARY_PREREQS) $(CIFS_MOUNT_OBJ) @BUILD_POPT@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(CIFS_MOUNT_OBJ) $(DYNEXP) $(LDFLAGS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(CIFS_MOUNT_OBJ) $(DYNEXP) $(LDFLAGS) $(POPT_LIBS)
 
 bin/umount.cifs@EXEEXT@: $(BINARY_PREREQS) $(CIFS_UMOUNT_OBJ) @BUILD_POPT@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(CIFS_UMOUNT_OBJ) $(DYNEXP) $(LDFLAGS) @POPTLIBS@
+       @$(CC) $(FLAGS) -o $@ $(CIFS_UMOUNT_OBJ) $(DYNEXP) $(LDFLAGS) $(POPT_LIBS)
 
-bin/cifs.spnego@EXEEXT@: $(BINARY_PREREQS) $(CIFS_SPNEGO_OBJ) $(LIBSMBCLIENT_OBJ1) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
+bin/cifs.upcall@EXEEXT@: $(BINARY_PREREQS) $(CIFS_UPCALL_OBJ) $(LIBSMBCLIENT_OBJ1) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
-       @$(CC) $(FLAGS) -o $@ $(CIFS_SPNEGO_OBJ) $(DYNEXP) $(LDFLAGS) \
+       @$(CC) $(FLAGS) -o $@ $(CIFS_UPCALL_OBJ) $(DYNEXP) $(LDFLAGS) \
                -lkeyutils $(LIBS) $(LIBSMBCLIENT_OBJ1) $(KRB5LIBS) \
-               $(LDAP_LIBS) @POPTLIBS@ @LIBTALLOC_LIBS@ @LIBWBCLIENT_SHARED@ \
-               @LIBTDB_LIBS@
+               $(LDAP_LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS) $(WINBIND_LIBS) \
+               $(LIBTDB_LIBS) $(NSCD_LIBS)
 
 bin/testparm@EXEEXT@: $(BINARY_PREREQS) $(TESTPARM_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(TESTPARM_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
-               $(LDAP_LIBS) @POPTLIBS@ @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LDAP_LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/smbstatus@EXEEXT@: $(BINARY_PREREQS) $(STATUS_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(STATUS_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
-               $(LDAP_LIBS) @POPTLIBS@ @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LDAP_LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/smbcontrol@EXEEXT@: $(BINARY_PREREQS) $(SMBCONTROL_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) -DUSING_SMBCONTROL $(FLAGS) -o $@ \
                $(SMBCONTROL_OBJ) $(DYNEXP) $(LDFLAGS) \
-               $(LIBS) $(LDAP_LIBS) @LIBUNWIND_PTRACE@ @POPTLIBS@ \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LIBS) $(LDAP_LIBS) @LIBUNWIND_PTRACE@ $(POPT_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/smbtree@EXEEXT@: $(BINARY_PREREQS) $(SMBTREE_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBTREE_OBJ) $(LDFLAGS) $(DYNEXP) \
-               $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(LIBS) $(POPT_LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/smbpasswd@EXEEXT@: $(BINARY_PREREQS) $(SMBPASSWD_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBPASSWD_OBJ) $(LDFLAGS) $(PASSDB_LIBS) \
-               $(DYNEXP) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(DYNEXP) $(LIBS) $(POPT_LIBS) $(KRB5LIBS) $(LDAP_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/pdbedit@EXEEXT@: $(BINARY_PREREQS) $(PDBEDIT_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(PDBEDIT_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
-               @POPTLIBS@ $(PASSDB_LIBS) $(LDAP_LIBS) @LIBTALLOC_LIBS@ \
-               @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(POPT_LIBS) $(PASSDB_LIBS) $(LDAP_LIBS) $(LIBTALLOC_LIBS) \
+               $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/smbget@EXEEXT@: $(BINARY_PREREQS) $(SMBGET_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBGET_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
-               @POPTLIBS@  $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(POPT_LIBS)  $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/nmblookup@EXEEXT@: $(BINARY_PREREQS) $(NMBLOOKUP_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(NMBLOOKUP_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
-               @POPTLIBS@ $(LDAP_LIBS) @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(POPT_LIBS) $(LDAP_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/smbtorture@EXEEXT@: $(BINARY_PREREQS) $(SMBTORTURE_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBTORTURE_OBJ) $(LDFLAGS) $(DYNEXP) \
-               $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTALLOC_LIBS@ \
-               @LIBTDB_LIBS@
+               $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS) \
+               $(LIBTDB_LIBS)
 
 bin/talloctort@EXEEXT@: $(BINARY_PREREQS) $(TALLOCTORT_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(TALLOCTORT_OBJ) $(LDFLAGS) \
-               $(DYNEXP) $(LIBS) $(LDAP_LIBS) @POPTLIBS@ \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(DYNEXP) $(LIBS) $(LDAP_LIBS) $(POPT_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/replacetort@EXEEXT@: $(REPLACETORT_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(REPLACETORT_OBJ) $(LDFLAGS) \
-               $(DYNEXP) $(LIBS) @POPTLIBS@ @LIBTALLOC_LIBS@
+               $(DYNEXP) $(LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS)
 
 bin/smbconftort@EXEEXT@: $(SMBCONFTORT_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBCONFTORT_OBJ) $(LDFLAGS) \
-               $(DYNEXP) $(LIBS) $(LDAP_LIBS) @POPTLIBS@ \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(DYNEXP) $(LIBS) $(LDAP_LIBS) $(POPT_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/masktest@EXEEXT@: $(BINARY_PREREQS) $(MASKTEST_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(MASKTEST_OBJ) $(LDFLAGS) $(DYNEXP) \
-               $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(POPT_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/msgtest@EXEEXT@: $(BINARY_PREREQS) $(MSGTEST_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(MSGTEST_OBJ) $(LDFLAGS) $(DYNEXP) \
-               $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(POPT_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/smbcacls@EXEEXT@: $(BINARY_PREREQS) $(SMBCACLS_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBCACLS_OBJ) $(DYNEXP) $(LDFLAGS) \
-               $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(LIBS) $(POPT_LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/smbcquotas@EXEEXT@: $(BINARY_PREREQS) $(SMBCQUOTAS_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBCQUOTAS_OBJ) $(DYNEXP) $(LDFLAGS) \
-               $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(LIBS) $(POPT_LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/eventlogadm@EXEEXT@: $(BINARY_PREREQS) $(EVTLOGADM_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(EVTLOGADM_OBJ) $(DYNEXP) $(LDFLAGS) \
-               $(LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LIBS) $(LDAP_LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/sharesec@EXEEXT@: $(BINARY_PREREQS) $(SHARESEC_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SHARESEC_OBJ) $(DYNEXP) $(LDFLAGS) \
-               $(LIBS) $(LDAP_LIBS) @POPTLIBS@ @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LIBS) $(LDAP_LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/locktest@EXEEXT@: $(BINARY_PREREQS) $(LOCKTEST_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LOCKTEST_OBJ) $(LDFLAGS) $(DYNEXP) \
-               $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(POPT_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/nsstest@EXEEXT@: $(BINARY_PREREQS) $(NSSTEST_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(NSSTEST_OBJ) $(LDFLAGS) $(DYNEXP) \
-               $(LIBS) $(KRB5LIBS)  $(LDAP_LIBS) @POPTLIBS@ \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LIBS) $(KRB5LIBS)  $(LDAP_LIBS) $(POPT_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/pdbtest@EXEEXT@: $(BINARY_PREREQS) $(PDBTEST_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(PDBTEST_OBJ) $(LDFLAGS) $(DYNEXP) \
                $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) \
-               @POPTLIBS@ @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @LIBWBCLIENT_SHARED@
+               $(POPT_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/vfstest@EXEEXT@: $(BINARY_PREREQS) $(VFSTEST_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(VFSTEST_OBJ) $(LDFLAGS) $(TERMLDFLAGS) \
                $(TERMLIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) \
-               $(ACL_LIBS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) \
-               @SMBD_LIBS@ $(NSCD_LIBS) @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ \
-               @LIBWBCLIENT_SHARED@
+               $(ACL_LIBS) $(LIBS) $(POPT_LIBS) $(KRB5LIBS) $(LDAP_LIBS) \
+               @SMBD_LIBS@ $(NSCD_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) \
+               $(WINBIND_LIBS)
 
 bin/smbiconv@EXEEXT@: $(BINARY_PREREQS) $(SMBICONV_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBICONV_OBJ) $(LDFLAGS) $(TERMLDFLAGS) \
-               $(TERMLIBS) $(DYNEXP) $(LIBS) $(LDAP_LIBS) @POPTLIBS@ \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(TERMLIBS) $(DYNEXP) $(LIBS) $(LDAP_LIBS) $(POPT_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/log2pcap@EXEEXT@: $(BINARY_PREREQS) $(LOG2PCAP_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LOG2PCAP_OBJ) $(LDFLAGS) $(DYNEXP) \
-               @POPTLIBS@ $(LIBS) @LIBTALLOC_LIBS@
+               $(POPT_LIBS) $(LIBS) $(LIBTALLOC_LIBS)
 
 bin/locktest2@EXEEXT@: $(BINARY_PREREQS) $(LOCKTEST2_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LOCKTEST2_OBJ) $(LDFLAGS) $(DYNEXP) \
-               $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(POPT_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/ndrdump@EXEEXT@: $(BINARY_PREREQS) $(NDRDUMP_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(NDRDUMP_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) \
-               @POPTLIBS@ @LDAP_LIBS@ @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(POPT_LIBS) $(LDAP_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/debug2html@EXEEXT@: $(BINARY_PREREQS) $(DEBUG2HTML_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(DEBUG2HTML_OBJ) $(LDFLAGS) $(DYNEXP) \
-               $(LIBS) @LIBTALLOC_LIBS@
+               $(LIBS) $(LIBTALLOC_LIBS)
 
 bin/smbfilter@EXEEXT@: $(BINARY_PREREQS) $(SMBFILTER_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(SMBFILTER_OBJ) $(LDFLAGS) $(LIBS) \
-               $(KRB5LIBS) $(LDAP_LIBS) @POPTLIBS@ \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(KRB5LIBS) $(LDAP_LIBS) $(POPT_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/ldbedit: $(BINARY_PREREQS) $(LDBEDIT_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDBEDIT_OBJ) $(DYNEXP) $(LDFLAGS) \
-               $(LIBS) @POPTLIBS@ $(LDAP_LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(LIBS) $(POPT_LIBS) $(LDAP_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/ldbsearch: $(BINARY_PREREQS) $(LDBSEARCH_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDBSEARCH_OBJ) $(DYNEXP) $(LDFLAGS) \
-               $(LIBS) @POPTLIBS@ $(LDAP_LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(LIBS) $(POPT_LIBS) $(LDAP_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/ldbadd: $(BINARY_PREREQS) $(LDBADD_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDBADD_OBJ) $(DYNEXP) $(LDFLAGS) \
-               $(LIBS) @POPTLIBS@ $(LDAP_LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(LIBS) $(POPT_LIBS) $(LDAP_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/ldbmodify: $(BINARY_PREREQS) $(LDBMODIFY_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDBMODIFY_OBJ) $(DYNEXP) $(LDFLAGS) \
-               $(LIBS) @POPTLIBS@ $(LDAP_LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(LIBS) $(POPT_LIBS) $(LDAP_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/ldbdel: $(BINARY_PREREQS) $(LDBDEL_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDBDEL_OBJ) $(DYNEXP) $(LDFLAGS) \
-               $(LIBS) @POPTLIBS@ $(LDAP_LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(LIBS) $(POPT_LIBS) $(LDAP_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 
 #####################################################################
@@ -1548,9 +1581,8 @@ MKSYMS_SH = $(srcdir)/script/mksyms.sh
 #
 #-------------------------------------------------------------------
 
-TALLOC_OBJ = @TALLOC_OBJS@
 
-LIBTALLOC_OBJ0 = $(TALLOC_OBJ)
+LIBTALLOC_OBJ0 = @LIBTALLOC_OBJ0@
 LIBTALLOC_OBJ = $(LIBTALLOC_OBJ0) $(LIBREPLACE_OBJ)
 
 LIBTALLOC_SHARED_TARGET=@LIBTALLOC_SHARED_TARGET@
@@ -1589,7 +1621,7 @@ installlibtalloc:: installdirs libtalloc
        @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(LIBDIR)
        -$(INSTALLLIBCMD_SH) $(LIBTALLOC_SHARED_TARGET_SONAME) $(DESTDIR)$(LIBDIR)
        @rm -f $(DESTDIR)$(LIBDIR)/`basename $(LIBTALLOC_SHARED_TARGET)`
-       -if test -e $(LIBTALLOC_SHARD_TARGET_SONAME) ; then \
+       -if test -e $(LIBTALLOC_SHARED_TARGET_SONAME) ; then \
                ln -s -f `basename $(LIBTALLOC_SHARED_TARGET_SONAME)` \
                        $(DESTDIR)$(LIBDIR)/`basename $(LIBTALLOC_SHARED_TARGET)` ; \
        fi
@@ -1615,7 +1647,7 @@ shlibs test_shlibs: @LIBTALLOC_SHARED@
 #
 #-------------------------------------------------------------------
 
-LIBTDB_OBJ0 = @TDB_OBJS@
+LIBTDB_OBJ0 = @LIBTDB_OBJ0@
 LIBTDB_OBJ = $(LIBTDB_OBJ0) $(LIBREPLACE_OBJ)
 
 LIBTDB_SHARED_TARGET=@LIBTDB_SHARED_TARGET@
@@ -1687,6 +1719,7 @@ LIBWBCLIENT_OBJ0 = nsswitch/libwbclient/wbclient.o \
                  nsswitch/libwbclient/wbc_pwd.o \
                  nsswitch/libwbclient/wbc_idmap.o \
                  nsswitch/libwbclient/wbc_sid.o \
+                 nsswitch/libwbclient/wbc_guid.o \
                  nsswitch/libwbclient/wbc_pam.o
 LIBWBCLIENT_OBJ = $(LIBWBCLIENT_OBJ0) \
                  $(WBCOMMON_OBJ) \
@@ -1705,7 +1738,7 @@ $(LIBWBCLIENT_SYMS): $(LIBWBCLIENT_HEADERS)
 
 $(LIBWBCLIENT_SHARED_TARGET_SONAME): $(BINARY_PREREQS) $(LIBWBCLIENT_OBJ) $(LIBWBCLIENT_SYMS) @LIBTALLOC_SHARED@
        @echo Linking shared library $@
-       @$(SHLD_DSO) @LIBTALLOC_LIBS@ $(LIBWBCLIENT_OBJ) \
+       @$(SHLD_DSO) $(LIBTALLOC_LIBS) $(LIBWBCLIENT_OBJ) \
                @SONAMEFLAG@`basename $@`
 
 $(LIBWBCLIENT_SHARED_TARGET): $(LIBWBCLIENT_SHARED_TARGET_SONAME)
@@ -1766,7 +1799,7 @@ LIBADDNS_HEADERS=$(srcdir)/libaddns/addns.h
 $(LIBADDNS_SHARED_TARGET_SONAME): $(BINARY_PREREQS) $(LIBADDNS_OBJ) @LIBTALLOC_SHARED@
        @echo Linking shared library $@
        @$(SHLD_DSO) $(LIBADDNS_OBJ) $(LIBS) \
-               $(KRB5LIBS) $(UUID_LIBS) @LIBTALLOC_LIBS@ \
+               $(KRB5LIBS) $(UUID_LIBS) $(LIBTALLOC_LIBS) \
                @SONAMEFLAG@`basename $@`
 
 $(LIBADDNS_SHARED_TARGET): $(LIBADDNS_SHARED_TARGET_SONAME)
@@ -1812,7 +1845,7 @@ shlibs test_shlibs: @LIBADDNS_SHARED@
 #
 #-------------------------------------------------------------------
 
-LIBNETAPI_OBJ1 = lib/netapi/netapi.o \
+LIBNETAPI_OBJ0 = lib/netapi/netapi.o \
                 lib/netapi/cm.o \
                 librpc/gen_ndr/ndr_libnetapi.o \
                 lib/netapi/libnetapi.o \
@@ -1822,16 +1855,20 @@ LIBNETAPI_OBJ1 = lib/netapi/netapi.o \
                 lib/netapi/user.o \
                 lib/netapi/group.o \
                 lib/netapi/localgroup.o \
-                lib/netapi/samr.o
+                lib/netapi/samr.o \
+                lib/netapi/sid.o \
+                lib/netapi/share.o \
+                lib/netapi/file.o
 
-LIBNETAPI_OBJ  = $(LIBNETAPI_OBJ1) $(LIBNET_OBJ) \
+LIBNETAPI_OBJ  = $(LIBNETAPI_OBJ0) $(LIBNET_OBJ) \
                 $(LIBSMBCONF_OBJ) \
                 $(REG_SMBCONF_OBJ) \
                 $(PARAM_WITHOUT_REG_OBJ) $(LIB_NONSMBD_OBJ) \
                 $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
                 $(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(RPC_PARSE_OBJ) \
                 $(PASSDB_OBJ) @LIBWBCLIENT_STATIC@ $(SMBLDAP_OBJ) $(GROUPDB_OBJ) $(LDB_OBJ) \
-                $(DCUTIL_OBJ) $(LIBADS_OBJ) $(PRIVILEGES_BASIC_OBJ)
+                $(DCUTIL_OBJ) $(LIBADS_OBJ) $(PRIVILEGES_BASIC_OBJ) \
+                auth/token_util.o
 
 LIBNETAPI_SHARED_TARGET=@LIBNETAPI_SHARED_TARGET@
 LIBNETAPI_SOVER=@LIBNETAPI_SOVER@
@@ -1847,7 +1884,7 @@ $(LIBNETAPI_SYMS): $(LIBNETAPI_HEADERS)
 $(LIBNETAPI_SHARED_TARGET_SONAME): $(BINARY_PREREQS) $(LIBNETAPI_OBJ) $(LIBNETAPI_SYMS) @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking shared library $@
        @$(SHLD_DSO) $(LIBNETAPI_OBJ) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @LIBWBCLIENT_SHARED@ $(LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS) $(LIBS) \
                $(LDAP_LIBS) $(KRB5LIBS) $(NSCD_LIBS) \
                @SONAMEFLAG@`basename $@`
 
@@ -1855,9 +1892,9 @@ $(LIBNETAPI_SHARED_TARGET): $(LIBNETAPI_SHARED_TARGET_SONAME)
        @rm -f $@
        @ln -s -f `basename $(LIBNETAPI_SHARED_TARGET_SONAME)` $@
 
-$(LIBNETAPI_STATIC_TARGET): $(BINARY_PREREQS) $(LIBNETAPI_OBJ1)
+$(LIBNETAPI_STATIC_TARGET): $(BINARY_PREREQS) $(LIBNETAPI_OBJ0)
        @echo Linking non-shared library $@
-       @-$(AR) -rc $@ $(LIBNETAPI_OBJ1)
+       @-$(AR) -rc $@ $(LIBNETAPI_OBJ0)
 
 libnetapi: $(LIBNETAPI)
 
@@ -1903,13 +1940,16 @@ LIBSMBCLIENT_SOVER=@LIBSMBCLIENT_SOVER@
 LIBSMBCLIENT_SHARED_TARGET_SONAME=$(LIBSMBCLIENT_SHARED_TARGET).$(LIBSMBCLIENT_SOVER)
 LIBSMBCLIENT_STATIC_TARGET=@LIBSMBCLIENT_STATIC_TARGET@
 LIBSMBCLIENT=$(LIBSMBCLIENT_STATIC_TARGET) @LIBSMBCLIENT_SHARED@
-#LIBSMBCLIENT_SYMS=$(srcdir)/exports/libsmbclient.@SYMSEXT@
+LIBSMBCLIENT_SYMS=$(srcdir)/exports/libsmbclient.@SYMSEXT@
 LIBSMBCLIENT_HEADERS=$(srcdir)/include/libsmbclient.h
 
-$(LIBSMBCLIENT_SHARED_TARGET_SONAME): $(BINARY_PREREQS) $(LIBSMBCLIENT_OBJ) @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
+$(LIBSMBCLIENT_SYMS): $(LIBSMBCLIENT_HEADERS)
+       @$(MKSYMS_SH) $(AWK) $@ $(LIBSMBCLIENT_HEADERS)
+
+$(LIBSMBCLIENT_SHARED_TARGET_SONAME): $(BINARY_PREREQS) $(LIBSMBCLIENT_OBJ) $(LIBSMBCLIENT_SYMS) @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking shared library $@
        @$(SHLD_DSO) $(LIBSMBCLIENT_OBJ) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @LIBWBCLIENT_SHARED@ $(LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS) $(LIBS) \
                $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
                @SONAMEFLAG@`basename $@`
 
@@ -1972,15 +2012,16 @@ LIBSMBSHAREMODES_SOVER=@LIBSMBSHAREMODES_SOVER@
 LIBSMBSHAREMODES_SHARED_TARGET_SONAME=$(LIBSMBSHAREMODES_SHARED_TARGET).$(LIBSMBSHAREMODES_SOVER)
 LIBSMBSHAREMODES_STATIC_TARGET=@LIBSMBSHAREMODES_STATIC_TARGET@
 LIBSMBSHAREMODES=$(LIBSMBSHAREMODES_STATIC_TARGET) @LIBSMBSHAREMODES_SHARED@
-#LIBSMBSHAREMODES_SYMS=$(srcdir)/exports/libsmbsharemodes.@SYMSEXT@
+LIBSMBSHAREMODES_SYMS=$(srcdir)/exports/libsmbsharemodes.@SYMSEXT@
 LIBSMBSHAREMODES_HEADERS=$(srcdir)/include/smb_share_modes.h
 
-LIBSMBSHAREMODES=bin/libsmbsharemodes.a @LIBSMBSHAREMODES_SHARED@
+$(LIBSMBSHAREMODES_SYMS): $(LIBSMBSHAREMODES_HEADERS)
+       @$(MKSYMS_SH) $(AWK) $@ $(LIBSMBSHAREMODES_HEADERS)
 
-$(LIBSMBSHAREMODES_SHARED_TARGET_SONAME): $(BINARY_PREREQS) $(LIBSMBSHAREMODES_OBJ) @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
+$(LIBSMBSHAREMODES_SHARED_TARGET_SONAME): $(BINARY_PREREQS) $(LIBSMBSHAREMODES_OBJ) $(LIBSMBSHAREMODES_SYMS) @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking shared library $@
        @$(SHLD_DSO) $(LIBSMBSHAREMODES_OBJ) \
-               $(LIBS) @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ \
+               $(LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) \
                $(KRB5LIBS) $(LDAP_LIBS) \
                @SONAMEFLAG@`basename $@`
 
@@ -2034,7 +2075,7 @@ shlibs test_shlibs: @LIBSMBSHAREMODES_SHARED@
 bin/libbigballofmud.@SHLIBEXT@: $(BINARY_PREREQS) $(LIBBIGBALLOFMUD_OBJ) @LIBTALLOC_SHARED@
        @echo Linking shared library $@
        @$(SHLD) $(LDSHFLAGS) -o $@ $(LIBBIGBALLOFMUD_OBJ) \
-               $(LIBS) @LIBTALLOC_LIBS@ \
+               $(LIBS) $(LIBTALLOC_LIBS) \
                $(PASSDB_LIBS) $(IDMAP_LIBS) $(KRB5LIBS) $(LDAP_LIBS) \
                @SONAMEFLAG@`basename $@`.$(LIBBIGBALLOFMUD_MAJOR)
        ln -snf libbigballofmud.so bin/libbigballofmud.so.0
@@ -2115,37 +2156,37 @@ bin/librpc_echo.@SHLIBEXT@: $(BINARY_PREREQS) $(RPC_ECHO_OBJ)
 bin/winbindd@EXEEXT@: $(BINARY_PREREQS) $(WINBINDD_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo "Linking $@"
        @$(CC) $(FLAGS) -o $@ $(WINBINDD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
-               @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) \
-               $(PASSDB_LIBS) @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(POPT_LIBS) $(KRB5LIBS) $(LDAP_LIBS) \
+               $(PASSDB_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/vlp@EXEEXT@: $(BINARY_PREREQS) $(VLP_OBJ) @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo "Linking $@"
        @$(CC) $(FLAGS) -o $@ $(VLP_OBJ) $(LDFLAGS) $(DYNEXP) \
-               $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) @POPTLIBS@ \
+               $(TERMLDFLAGS) $(TERMLIBS) $(LIBS) $(POPT_LIBS) \
                $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @LIBWBCLIENT_SHARED@
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 @WINBIND_NSS@: $(BINARY_PREREQS) $(WINBIND_NSS_OBJ)
        @echo "Linking $@"
        @$(SHLD) $(WINBIND_NSS_LDSHFLAGS) -o $@ $(WINBIND_NSS_OBJ) \
-               @WINBIND_NSS_EXTRA_LIBS@ @WINBIND_NSS_PTHREAD@ \
+               $(WINBIND_NSS_EXTRA_LIBS) $(WINBIND_NSS_PTHREAD) \
                @SONAMEFLAG@`basename $@`@NSSSONAMEVERSIONSUFFIX@
 
 @WINBIND_WINS_NSS@: $(BINARY_PREREQS) $(WINBIND_WINS_NSS_OBJ) @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo "Linking $@"
        @$(SHLD) $(LDSHFLAGS) -o $@ $(WINBIND_WINS_NSS_OBJ) \
-               $(LDAP_LIBS) $(KRB5LIBS) $(LIBS) @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ \
+               $(LDAP_LIBS) $(KRB5LIBS) $(LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) \
                @SONAMEFLAG@`basename $@`@NSSSONAMEVERSIONSUFFIX@
 
-bin/winbind_krb5_locator.@SHLIBEXT@: $(BINARY_PREREQS) $(WINBIND_KRB5_LOCATOR_OBJ)
+bin/winbind_krb5_locator.@SHLIBEXT@: $(BINARY_PREREQS) $(WINBIND_KRB5_LOCATOR_OBJ) @LIBWBCLIENT_SHARED@
        @echo "Linking $@"
-       @$(SHLD) $(LDSHFLAGS) -o $@ $(WINBIND_KRB5_LOCATOR_OBJ) \
+       @$(SHLD) $(LDSHFLAGS) -o $@ $(WINBIND_KRB5_LOCATOR_OBJ) $(WINBIND_LIBS) \
                @SONAMEFLAG@`basename $@`
 
-bin/pam_winbind.@SHLIBEXT@: $(BINARY_PREREQS) $(PAM_WINBIND_OBJ)
+bin/pam_winbind.@SHLIBEXT@: $(BINARY_PREREQS) $(PAM_WINBIND_OBJ) @LIBTALLOC_SHARED@ @LIBWBCLIENT_SHARED@
        @echo "Linking shared library $@"
        @$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_WINBIND_OBJ) -lpam @INIPARSERLIBS@ \
-               @PAM_WINBIND_EXTRA_LIBS@ @SONAMEFLAG@`basename $@`
+               $(PAM_WINBIND_EXTRA_LIBS) $(LIBTALLOC_LIBS) $(WINBIND_LIBS) @SONAMEFLAG@`basename $@`
 
 bin/builtin.@SHLIBEXT@: $(BINARY_PREREQS) $(AUTH_BUILTIN_OBJ)
        @echo "Building plugin $@"
@@ -2159,6 +2200,10 @@ bin/script.@SHLIBEXT@: $(BINARY_PREREQS) $(AUTH_SCRIPT_OBJ)
        @echo "Building plugin $@"
        @$(SHLD_MODULE) $(AUTH_SCRIPT_OBJ)
 
+bin/netlogond.@SHLIBEXT@: $(BINARY_PREREQS) $(AUTH_NETLOGOND_OBJ)
+       @echo "Building plugin $@"
+       @$(SHLD_MODULE) $(AUTH_NETLOGOND_OBJ)
+
 bin/smbserver.@SHLIBEXT@: $(BINARY_PREREQS) $(AUTH_SERVER_OBJ)
        @echo "Building plugin $@"
        @$(SHLD_MODULE) $(AUTH_SERVER_OBJ)
@@ -2195,6 +2240,14 @@ bin/ad.@SHLIBEXT@: $(BINARY_PREREQS) winbindd/idmap_ad.o
        @echo "Building plugin $@"
        @$(SHLD_MODULE) winbindd/idmap_ad.o
 
+bin/hash.@SHLIBEXT@: $(BINARY_PREREQS) $(IDMAP_HASH_OBJ)
+       @echo "Building plugin $@"
+       @$(SHLD_MODULE) $(IDMAP_HASH_OBJ)
+
+bin/adex.@SHLIBEXT@: $(BINARY_PREREQS) $(IDMAP_ADEX_OBJ)
+       @echo "Building plugin $@"
+       @$(SHLD_MODULE) $(IDMAP_ADEX_OBJ)
+
 bin/tdb2.@SHLIBEXT@: $(BINARY_PREREQS) winbindd/idmap_tdb2.o
        @echo "Building plugin $@"
        @$(SHLD_MODULE) winbindd/idmap_tdb2.o
@@ -2362,6 +2415,14 @@ bin/aio_fork.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_AIO_FORK_OBJ)
        @echo "Building plugin $@"
        @$(SHLD_MODULE) $(VFS_AIO_FORK_OBJ)
 
+bin/acl_xattr.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_ACL_XATTR_OBJ)
+       @echo "Building plugin $@"
+       @$(SHLD_MODULE) $(VFS_ACL_XATTR_OBJ)
+
+bin/smb_traffic_analyzer.@SHLIBEXT@: $(BINARY_PREREQS) $(VFS_SMB_TRAFFIC_ANALYZER_OBJ)
+       @echo "Building plugin $@"
+       @$(SHLD_MODULE) $(VFS_SMB_TRAFFIC_ANALYZER_OBJ)
+
 bin/registry.@SHLIBEXT@: $(BINARY_PREREQS) libgpo/gpext/registry.o
        @echo "Building plugin $@"
        @$(SHLD_MODULE) libgpo/gpext/registry.o
@@ -2370,6 +2431,10 @@ bin/scripts.@SHLIBEXT@: $(BINARY_PREREQS) libgpo/gpext/scripts.o
        @echo "Building plugin $@"
        @$(SHLD_MODULE) libgpo/gpext/scripts.o
 
+bin/security.@SHLIBEXT@: $(BINARY_PREREQS) libgpo/gpext/security.o
+       @echo "Building plugin $@"
+       @$(SHLD_MODULE) libgpo/gpext/security.o
+
 #########################################################
 ## IdMap NSS plugins
 
@@ -2379,53 +2444,53 @@ bin/scripts.@SHLIBEXT@: $(BINARY_PREREQS) libgpo/gpext/scripts.o
 bin/wbinfo@EXEEXT@: $(BINARY_PREREQS) $(WBINFO_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(WBINFO_OBJ) $(DYNEXP) $(LIBS) \
-               $(LDAP_LIBS) @POPTLIBS@ @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ \
-               @WINBIND_LIBS@
+               $(LDAP_LIBS) $(POPT_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) \
+               $(WINBIND_LIBS)
 
 bin/ntlm_auth@EXEEXT@: $(BINARY_PREREQS) $(NTLM_AUTH_OBJ) $(PARAM_OBJ) \
        $(LIB_NONSMBD_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(DYNEXP) $(NTLM_AUTH_OBJ) \
                $(PARAM_OBJ) $(LIB_NONSMBD_OBJ) $(LIBS) \
-               @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(POPT_LIBS) $(KRB5LIBS) $(LDAP_LIBS) $(NSCD_LIBS) \
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/pam_smbpass.@SHLIBEXT@: $(BINARY_PREREQS) $(PAM_SMBPASS_OBJ) @LIBTALLOC_SHARED@ @LIBWBCLIENT_SHARED@ @LIBTDB_SHARED@
        @echo "Linking shared library $@"
        @$(SHLD) $(LDSHFLAGS) -o $@ $(PAM_SMBPASS_OBJ) -lpam $(DYNEXP) \
                $(LIBS) $(LDAP_LIBS) $(KRB5LIBS) $(NSCD_LIBS) \
-               @LIBTALLOC_LIBS@ @LIBTDB_LIBS@ @WINBIND_LIBS@
+               $(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(WINBIND_LIBS)
 
 bin/tdbbackup@EXEEXT@: $(BINARY_PREREQS) $(TDBBACKUP_OBJ) @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(TDBBACKUP_OBJ) $(DYNEXP) \
-               $(LIBS) @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/tdbtool@EXEEXT@: $(BINARY_PREREQS) $(TDBTOOL_OBJ) @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(TDBTOOL_OBJ) $(DYNEXP) \
-               $(LIBS) @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/tdbdump@EXEEXT@: $(BINARY_PREREQS) $(TDBDUMP_OBJ) @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(TDBDUMP_OBJ) $(DYNEXP) \
-               $(LIBS) @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/tdbtorture@EXEEXT@: $(BINARY_PREREQS) $(TDBTORTURE_OBJ) @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
        @echo Linking $@
        @$(CC) $(FLAGS) -o $@ $(LDFLAGS) $(TDBTORTURE_OBJ) $(DYNEXP) \
-               $(LIBS) @LIBTALLOC_LIBS@ @LIBTDB_LIBS@
+               $(LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 bin/t_strcmp@EXEEXT@: $(BINARY_PREREQS) @LIBTALLOC_SHARED@ bin/libbigballofmud.@SHLIBEXT@ torture/t_strcmp.o
-       $(CC) $(FLAGS) -o $@ $(DYNEXP) $(LIBS) @LIBTALLOC_LIBS@ \
+       $(CC) $(FLAGS) -o $@ $(DYNEXP) $(LIBS) $(LIBTALLOC_LIBS) \
                torture/t_strcmp.o -L ./bin -lbigballofmud
 
 bin/t_strstr@EXEEXT@: $(BINARY_PREREQS) @LIBTALLOC_SHARED@ bin/libbigballofmud.@SHLIBEXT@ torture/t_strstr.o
-       $(CC) $(FLAGS) -o $@ $(DYNEXP) $(LIBS) @LIBTALLOC_LIBS@ \
+       $(CC) $(FLAGS) -o $@ $(DYNEXP) $(LIBS) $(LIBTALLOC_LIBS) \
                torture/t_strstr.o -L ./bin -lbigballofmud
 
 bin/t_strappend@EXEEXT@: $(BINARY_PREREQS) @LIBTALLOC_SHARED@ bin/libbigballofmud.@SHLIBEXT@ torture/t_strappend.o
-       $(CC) $(FLAGS) -o $@ $(DYNEXP) $(LIBS) @LIBTALLOC_LIBS@ \
+       $(CC) $(FLAGS) -o $@ $(DYNEXP) $(LIBS) $(LIBTALLOC_LIBS) \
                torture/t_strappend.o -L ./bin -lbigballofmud
 
 bin/t_stringoverflow@EXEEXT@: $(BINARY_PREREQS) bin/libbigballofmud.@SHLIBEXT@ torture/t_stringoverflow.o
@@ -2439,10 +2504,17 @@ bin/timelimit@EXEEXT@: script/tests/timelimit.o
 bin/rpc_open_tcp@EXEEXT@: $(BINARY_PREREQS) $(RPC_OPEN_TCP_OBJ) @LIBTALLOC_SHARED@ @LIBTDB_SHARED@ @LIBWBCLIENT_SHARED@
        @echo "Linking $@"
        @$(CC) $(FLAGS) -o $@ $(RPC_OPEN_TCP_OBJ) $(LDFLAGS) $(DYNEXP) \
-               $(LIBS) @LIBTALLOC_LIBS@ @LIBTDB_SHARED@ @WINBIND_LIBS@ \
+               $(LIBS) $(LIBTALLOC_LIBS) @LIBTDB_SHARED@ $(WINBIND_LIBS) \
                $(LDAP_LIBS) $(KRB5LIBS) $(NSCD_LIBS)
 
-install:: installservers installbin @INSTALL_CIFSMOUNT@ @INSTALL_CIFSSPNEGO@ installman \
+bin/test_lp_load@EXEEXT@: $(BINARY_PREREQS) $(TEST_LP_LOAD_OBJ) @BUILD_POPT@ @LIBTALLOC_SHARED@ @LIBTDB_SHARED@
+       @echo "Linking $@"
+       @$(CC) $(FLAGS) -o $@ $(TEST_LP_LOAD_OBJ) \
+               $(LDFLAGS) $(DYNEEXP) $(LIBS) \
+               $(LDAP_LIBS) \
+               $(POPT_LIBS) $(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
+
+install:: installservers installbin @INSTALL_CIFSMOUNT@ @INSTALL_CIFSUPCALL@ installman \
                installscripts installdat installmodules @SWAT_INSTALL_TARGETS@ \
                @INSTALL_PAM_MODULES@ installlibs
 
@@ -2457,7 +2529,7 @@ install-everything:: install installmodules
 # is not used
 
 installdirs::
-       @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(prefix) $(BINDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(PRIVATEDIR) $(PIDDIR) $(LOCKDIR) $(MANDIR)
+       @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(prefix) $(BINDIR) $(SBINDIR) $(LIBDIR) $(VARDIR) $(PRIVATEDIR) $(PIDDIR) $(LOCKDIR) $(MANDIR) $(CODEPAGEDIR) $(MODULESDIR)
 
 installservers:: all installdirs
        @$(SHELL) script/installbin.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(prefix) $(SBINDIR) $(SBIN_PROGS)
@@ -2469,9 +2541,9 @@ installcifsmount:: @CIFSMOUNT_PROGS@
        @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(ROOTSBINDIR)
        @$(SHELL) script/installbin.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(prefix) $(ROOTSBINDIR) @CIFSMOUNT_PROGS@
 
-installcifsspnego:: @CIFSSPNEGO_PROGS@
-       @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(ROOTSBINDIR)
-       @$(SHELL) script/installbin.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(prefix) $(ROOTSBINDIR) @CIFSSPNEGO_PROGS@
+installcifsupcall:: @CIFSUPCALL_PROGS@
+       @$(SHELL) $(srcdir)/script/installdirs.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(SBINDIR)
+       @$(SHELL) script/installbin.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(prefix) $(SBINDIR) @CIFSUPCALL_PROGS@
 
 # Some symlinks are required for the 'probing' of modules.
 # This mechanism should go at some point..
@@ -2492,6 +2564,8 @@ installmodules:: modules installdirs
        @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) domain.@SHLIBEXT@ trustdomain.@SHLIBEXT@ ntdomain.@SHLIBEXT@
        @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(AUTHLIBDIR) builtin.@SHLIBEXT@ guest.@SHLIBEXT@ fixed_challenge.@SHLIBEXT@ name_to_ntstatus.@SHLIBEXT@
        @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(NSSINFOLIBDIR) ../idmap/ad.@SHLIBEXT@ rfc2307.@SHLIBEXT@ sfu.@SHLIBEXT@ sfu20.@SHLIBEXT@
+       @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(NSSINFOLIBDIR) ../idmap/adex.@SHLIBEXT@ adex.@SHLIBEXT@
+       @$(SHELL) $(srcdir)/script/linkmodules.sh $(DESTDIR)$(NSSINFOLIBDIR) ../idmap/hash.@SHLIBEXT@ hash.@SHLIBEXT@
 
 installscripts:: installdirs
        @$(SHELL) $(srcdir)/script/installscripts.sh $(INSTALLPERMS_BIN) $(DESTDIR)$(BINDIR) $(SCRIPTS)
@@ -2529,6 +2603,7 @@ showlayout::
        @echo "  bindir:      $(BINDIR)"
        @echo "  sbindir:     $(SBINDIR)"
        @echo "  libdir:      $(LIBDIR)"
+       @echo "  modulesdir:  $(MODULESDIR)"
        @echo "  vardir:      $(VARDIR)"
        @echo "  mandir:      $(MANDIR)"
        @echo "  privatedir:  $(PRIVATE_DIR)"
@@ -2536,9 +2611,10 @@ showlayout::
        @echo "  lockdir:     $(LOCKDIR)"
        @echo "  piddir:      $(PIDDIR)"
        @echo "  swatdir:     $(SWATDIR)"
+       @echo "  codepagedir: $(CODEPAGEDIR)"
 
 
-uninstall:: uninstallman uninstallservers uninstallbin @UNINSTALL_CIFSMOUNT@ @UNINSTALL_CIFSSPNEGO@ uninstallscripts uninstalldat uninstallswat uninstallmodules uninstalllibs @UNINSTALL_PAM_MODULES@
+uninstall:: uninstallman uninstallservers uninstallbin @UNINSTALL_CIFSMOUNT@ @UNINSTALL_CIFSUPCALL@ uninstallscripts uninstalldat uninstallswat uninstallmodules uninstalllibs @UNINSTALL_PAM_MODULES@
 
 uninstallman::
        @$(SHELL) $(srcdir)/script/uninstallman.sh $(DESTDIR)$(MANDIR) $(srcdir) C
@@ -2552,8 +2628,8 @@ uninstallbin::
 uninstallcifsmount::
        @$(SHELL) script/uninstallbin.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(prefix) $(ROOTSBINDIR) @CIFSMOUNT_PROGS@
 
-uninstallcifsspnego::
-       @$(SHELL) script/uninstallbin.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(prefix) $(ROOTSBINDIR) @CIFSSPNEGO_PROGS@
+uninstallcifsupcall::
+       @$(SHELL) script/uninstallbin.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(prefix) $(ROOTSBINDIR) @CIFSUPCALL_PROGS@
 
 uninstallmodules::
        @$(SHELL) $(srcdir)/script/uninstallmodules.sh $(INSTALLPERMS_BIN) $(DESTDIR) $(prefix) $(VFSLIBDIR) $(VFS_MODULES)
@@ -2585,6 +2661,10 @@ uninstallpammodules::
 # Toplevel clean files
 TOPFILES=dynconfig.o
 
+cleanlibs::
+       -rm -f ../lib/*/*.o ../lib/*/*/*.o \
+               ../libcli/*.o ../libcli/*/*.o
+
 clean:: cleanlibs
        -rm -f include/build_env.h
        -rm -f smbd/build_options.c
@@ -2597,7 +2677,9 @@ clean:: cleanlibs
                $(MODULES) $(TORTURE_PROGS) \
                $(EVERYTHING_PROGS) \
                bin/timelimit \
-               .headers.stamp */src/*.o
+               .headers.stamp */src/*.o \
+               ../lib/*/*.o \
+               ../libcli/*.o ../libcli/*/*.o
        -rm -rf t_dir
 
 include/build_env.h: script/build_env.sh
@@ -2606,18 +2688,12 @@ include/build_env.h: script/build_env.sh
          > $(builddir)/include/build_env.h
 
 proto::
-       @echo
-       @echo "NOTE: 'proto' is no longer a valid make target as proto.h"
-       @echo "and other prototype headers are not generated anymore."
-       @echo
-
-.PHONY: proto
 
-etags:
-       etags `find $(srcdir) -name "*.[ch]" | grep -v /.svn/`
+etags::
+       etags `find $(srcdir)/.. -name "*.[ch]"`
 
-ctags:
-       ctags `find $(srcdir) -name "*.[ch]" | grep -v /.svn/`
+ctags::
+       ctags `find $(srcdir)/.. -name "*.[ch]"`
 
 realclean:: clean
        -rm -f config.log bin/.dummy script/findsmb script/gen-8bit-gap.sh
@@ -2700,3 +2776,24 @@ valgrindtest:: all torture timelimit
         SMBD_VALGRIND="xterm -n smbd -e valgrind -q --db-attach=yes --num-callers=30" \
         VALGRIND="valgrind -q --num-callers=30 --log-file=${selftest_prefix}/valgrind.log" \
         PERL="$(PERL)" $(srcdir)/script/tests/selftest.sh ${selftest_prefix} all "${smbtorture4_path}"
+
+# Check for Winbind struct 32/64bit padding
+test_wbpad:
+       @echo "Testing winbind request/response structure for 32/64bit padding"
+       @./script/tests/wb_pad.sh || exit 1;
+
+##
+## Examples:
+##
+
+libsmbclient_examples: libsmbclient
+       $(MAKE) -C ../examples/libsmbclient -f Makefile.internal
+
+clean_libsmbclient_examples:
+       $(MAKE) -C ../examples/libsmbclient -f Makefile.internal clean
+
+libnetapi_examples: libnetapi
+       $(MAKE) -C lib/netapi/examples
+
+clean_libnetapi_examples:
+       $(MAKE) -C lib/netapi/examples clean