summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/Makefile6
-rw-r--r--source4/auth/config.mk24
-rw-r--r--source4/auth/credentials/config.mk10
-rw-r--r--source4/auth/gensec/config.mk28
-rw-r--r--source4/auth/kerberos/config.mk5
-rw-r--r--source4/auth/ntlm/config.mk23
-rw-r--r--source4/auth/ntlmssp/config.mk10
-rw-r--r--source4/build/m4/public.m471
-rw-r--r--source4/build/make/rules.mk99
-rw-r--r--source4/build/make/templates.mk108
-rw-r--r--source4/build/smb_build/config_mk.pm15
-rw-r--r--source4/build/smb_build/main.pl17
-rw-r--r--source4/build/smb_build/makefile.pm11
-rw-r--r--source4/build/tests/unixsock.c93
-rw-r--r--source4/cldap_server/config.mk4
-rw-r--r--source4/client/config.mk4
-rw-r--r--source4/cluster/config.mk3
-rw-r--r--source4/cluster/ctdb/config.mk6
-rw-r--r--source4/configure.ac57
-rw-r--r--source4/dsdb/config.mk16
-rw-r--r--source4/dynconfig.mk11
-rw-r--r--source4/heimdal_build/config.mk727
-rw-r--r--source4/kdc/config.mk6
-rw-r--r--source4/ldap_server/config.mk4
-rw-r--r--source4/lib/appweb/config.mk6
-rw-r--r--source4/lib/basic.mk34
-rw-r--r--source4/lib/charset/config.mk7
-rw-r--r--source4/lib/cmdline/config.mk14
-rw-r--r--source4/lib/crypto/config.mk6
-rw-r--r--source4/lib/dbwrap/config.mk2
-rw-r--r--source4/lib/events/config.mk14
-rw-r--r--source4/lib/ldb-samba/config.mk4
-rwxr-xr-xsource4/lib/ldb/tests/python/ldap.py2
-rw-r--r--source4/lib/ldb_wrap.c2
-rw-r--r--source4/lib/messaging/config.mk3
-rw-r--r--source4/lib/nss_wrapper/config.mk2
-rw-r--r--source4/lib/registry/config.mk48
-rw-r--r--source4/lib/replace/libreplace.m41
-rw-r--r--source4/lib/replace/libreplace_network.m441
-rw-r--r--source4/lib/samba3/config.mk5
-rw-r--r--source4/lib/socket/config.m438
-rw-r--r--source4/lib/socket/config.mk11
-rw-r--r--source4/lib/socket_wrapper/config.mk2
-rw-r--r--source4/lib/stream/config.mk2
-rw-r--r--source4/lib/tdr/config.mk7
-rw-r--r--source4/lib/tls/config.mk2
-rw-r--r--source4/lib/torture/config.mk6
-rw-r--r--source4/lib/util/config.mk23
-rw-r--r--source4/libcli/auth/config.mk6
-rw-r--r--source4/libcli/config.mk70
-rw-r--r--source4/libcli/ldap/config.mk9
-rw-r--r--source4/libcli/security/config.mk6
-rw-r--r--source4/libcli/smb2/config.mk4
-rw-r--r--source4/libcli/wbclient/config.mk2
-rw-r--r--source4/libnet/config.mk7
-rw-r--r--source4/librpc/config.mk345
-rwxr-xr-xsource4/librpc/idl-deps.pl22
-rw-r--r--source4/librpc/idl/dcerpc.idl1
-rwxr-xr-xsource4/librpc/scripts/build_idl.sh (renamed from source4/script/build_idl.sh)16
-rw-r--r--source4/main.mk64
-rw-r--r--source4/nbt_server/config.mk25
-rw-r--r--source4/nsswitch/config.mk6
-rw-r--r--source4/ntptr/config.mk9
-rw-r--r--source4/ntvfs/common/config.mk5
-rw-r--r--source4/ntvfs/config.mk28
-rw-r--r--source4/ntvfs/posix/config.mk11
-rw-r--r--source4/ntvfs/sysdep/config.mk8
-rw-r--r--source4/ntvfs/unixuid/config.mk2
-rw-r--r--source4/param/config.mk29
-rw-r--r--source4/pidl/config.mk39
-rw-r--r--source4/rpc_server/config.mk50
-rw-r--r--source4/rpc_server/dcerpc_server.c12
-rwxr-xr-xsource4/scripting/bin/minschema.py4
-rwxr-xr-xsource4/scripting/bin/rpcclient4
-rwxr-xr-xsource4/scripting/bin/samba3dump5
-rwxr-xr-xsource4/scripting/bin/subunitrun6
-rwxr-xr-xsource4/scripting/bin/winreg.py4
-rw-r--r--source4/scripting/ejs/config.mk31
-rw-r--r--source4/scripting/ejs/ejsnet/config.mk4
-rw-r--r--source4/scripting/python/config.m41
-rw-r--r--source4/scripting/python/config.mk19
-rw-r--r--source4/scripting/python/smbpython.c34
-rwxr-xr-xsource4/selftest/samba4_tests.sh2
-rw-r--r--source4/selftest/target/Samba4.pm2
-rwxr-xr-xsource4/setup/newuser6
-rwxr-xr-xsource4/setup/provision3
-rwxr-xr-xsource4/setup/upgrade4
-rw-r--r--source4/smb_server/config.mk10
-rw-r--r--source4/smb_server/smb/config.mk4
-rw-r--r--source4/smb_server/smb2/config.mk4
-rw-r--r--source4/smbd/config.mk14
-rw-r--r--source4/smbd/process_model.mk13
-rw-r--r--source4/smbd/service_stream.c2
-rw-r--r--source4/smbd/service_stream.h6
-rw-r--r--source4/static_deps.mk7
-rw-r--r--source4/torture/config.mk80
-rw-r--r--source4/torture/local/config.mk60
-rw-r--r--source4/torture/rpc/rpc.c1
-rw-r--r--source4/torture/rpc/schannel.c285
-rw-r--r--source4/torture/rpc/testjoin.c6
-rw-r--r--source4/torture/smb2/config.mk6
-rw-r--r--source4/torture/winbind/config.mk6
-rw-r--r--source4/utils/config.mk16
-rw-r--r--source4/utils/net/config.mk7
-rw-r--r--source4/web_server/config.mk5
-rw-r--r--source4/winbind/config.mk15
-rw-r--r--source4/wrepl_server/config.mk4
-rw-r--r--source4/wrepl_server/wrepl_in_connection.c2
108 files changed, 1727 insertions, 1371 deletions
diff --git a/source4/Makefile b/source4/Makefile
index f2567e6ac4..0ee36ec830 100644
--- a/source4/Makefile
+++ b/source4/Makefile
@@ -4,6 +4,8 @@
include mkconfig.mk
+pidldir := $(srcdir)/pidl
+
VPATH = $(builddir):$(srcdir):heimdal_build:heimdal/lib/asn1:heimdal/lib/krb5:heimdal/lib/gssapi:heimdal/lib/hdb:heimdal/lib/roken:heimdal/lib/des
BASEDIR = $(prefix)
@@ -25,7 +27,7 @@ $(srcdir)/version.h: $(srcdir)/VERSION
.DEFAULT_GOAL := all
ifneq ($(automatic_dependencies),yes)
-ALL_PREDEP = proto
+ALL_PREDEP = basics
.NOTPARALLEL:
endif
@@ -41,7 +43,7 @@ pch:: clean_pch include/includes.h.gch
.DEFAULT_GOAL := all
ifneq ($(automatic_dependencies),yes)
-ALL_PREDEP = proto
+ALL_PREDEP = basics
.NOTPARALLEL:
endif
diff --git a/source4/auth/config.mk b/source4/auth/config.mk
index b13b8abf1f..7d31a6a0c0 100644
--- a/source4/auth/config.mk
+++ b/source4/auth/config.mk
@@ -1,4 +1,5 @@
# auth server subsystem
+gensecsrcdir := $(authsrcdir)/gensec
mkinclude gensec/config.mk
mkinclude kerberos/config.mk
mkinclude ntlmssp/config.mk
@@ -6,35 +7,38 @@ mkinclude ntlm/config.mk
mkinclude credentials/config.mk
[SUBSYSTEM::auth_session]
-PRIVATE_PROTO_HEADER = session_proto.h
PUBLIC_DEPENDENCIES = CREDENTIALS
-PUBLIC_HEADERS += auth/session.h
+PUBLIC_HEADERS += $(authsrcdir)/session.h
-auth_session_OBJ_FILES = $(addprefix auth/, session.o)
+auth_session_OBJ_FILES = $(addprefix $(authsrcdir)/, session.o)
+
+$(eval $(call proto_header_template,$(authsrcdir)/session_proto.h,$(auth_session_OBJ_FILES:.o=.c)))
[SUBSYSTEM::auth_system_session]
-PRIVATE_PROTO_HEADER = system_session_proto.h
PUBLIC_DEPENDENCIES = CREDENTIALS
PRIVATE_DEPENDENCIES = auth_session LIBSAMBA-UTIL LIBSECURITY
-auth_system_session_OBJ_FILES = $(addprefix auth/, system_session.o)
+auth_system_session_OBJ_FILES = $(addprefix $(authsrcdir)/, system_session.o)
+$(eval $(call proto_header_template,$(authsrcdir)/system_session_proto.h,$(auth_system_session_OBJ_FILES:.o=.c)))
[SUBSYSTEM::auth_sam]
-PRIVATE_PROTO_HEADER = auth_sam.h
PUBLIC_DEPENDENCIES = SAMDB UTIL_LDB LIBSECURITY
PRIVATE_DEPENDENCIES = LDAP_ENCODE
-auth_sam_OBJ_FILES = $(addprefix auth/, sam.o)
+auth_sam_OBJ_FILES = $(addprefix $(authsrcdir)/, sam.o)
+
+$(eval $(call proto_header_template,$(authsrcdir)/auth_sam.h,$(auth_sam_OBJ_FILES:.o=.c)))
[SUBSYSTEM::auth_sam_reply]
-PRIVATE_PROTO_HEADER = auth_sam_reply.h
-auth_sam_reply_OBJ_FILES = $(addprefix auth/, auth_sam_reply.o)
+auth_sam_reply_OBJ_FILES = $(addprefix $(authsrcdir)/, auth_sam_reply.o)
+
+$(eval $(call proto_header_template,$(authsrcdir)/auth_sam_reply.h,$(auth_sam_reply_OBJ_FILES:.o=.c)))
[PYTHON::swig_auth]
PUBLIC_DEPENDENCIES = auth_system_session
PRIVATE_DEPENDENCIES = SAMDB
SWIG_FILE = auth.i
-swig_auth_OBJ_FILES = auth/auth_wrap.o
+swig_auth_OBJ_FILES = $(authsrcdir)/auth_wrap.o
diff --git a/source4/auth/credentials/config.mk b/source4/auth/credentials/config.mk
index 6f3ec3997c..d71a8238a5 100644
--- a/source4/auth/credentials/config.mk
+++ b/source4/auth/credentials/config.mk
@@ -1,18 +1,20 @@
#################################
# Start SUBSYSTEM CREDENTIALS
[SUBSYSTEM::CREDENTIALS]
-PRIVATE_PROTO_HEADER = credentials_proto.h
PUBLIC_DEPENDENCIES = \
LIBCLI_AUTH SECRETS LIBCRYPTO KERBEROS UTIL_LDB HEIMDAL_GSSAPI
PRIVATE_DEPENDENCIES = \
SECRETS
-CREDENTIALS_OBJ_FILES = $(addprefix auth/credentials/, credentials.o credentials_files.o credentials_ntlm.o credentials_krb5.o ../kerberos/kerberos_util.o)
-PUBLIC_HEADERS += auth/credentials/credentials.h
+CREDENTIALS_OBJ_FILES = $(addprefix $(authsrcdir)/credentials/, credentials.o credentials_files.o credentials_ntlm.o credentials_krb5.o ../kerberos/kerberos_util.o)
+
+$(eval $(call proto_header_template,$(authsrcdir)/credentials/credentials_proto.h,$(CREDENTIALS_OBJ_FILES:.o=.c)))
+
+PUBLIC_HEADERS += $(authsrcdir)/credentials/credentials.h
[PYTHON::swig_credentials]
PUBLIC_DEPENDENCIES = CREDENTIALS LIBCMDLINE_CREDENTIALS
SWIG_FILE = credentials.i
-swig_credentials_OBJ_FILES = auth/credentials/credentials_wrap.o
+swig_credentials_OBJ_FILES = $(authsrcdir)/credentials/credentials_wrap.o
diff --git a/source4/auth/gensec/config.mk b/source4/auth/gensec/config.mk
index 8b602e75f0..f08ff2638a 100644
--- a/source4/auth/gensec/config.mk
+++ b/source4/auth/gensec/config.mk
@@ -1,19 +1,20 @@
#################################
# Start SUBSYSTEM gensec
[LIBRARY::gensec]
-PRIVATE_PROTO_HEADER = gensec_proto.h
PUBLIC_DEPENDENCIES = \
CREDENTIALS LIBSAMBA-UTIL LIBCRYPTO ASN1_UTIL samba-socket LIBPACKET
# End SUBSYSTEM gensec
#################################
-PC_FILES += auth/gensec/gensec.pc
+PC_FILES += $(gensecsrcdir)/gensec.pc
gensec_VERSION = 0.0.1
gensec_SOVERSION = 0
-gensec_OBJ_FILES = $(addprefix auth/gensec/, gensec.o socket.o)
+gensec_OBJ_FILES = $(addprefix $(gensecsrcdir)/, gensec.o socket.o)
-PUBLIC_HEADERS += auth/gensec/gensec.h
+PUBLIC_HEADERS += $(gensecsrcdir)/gensec.h
+
+$(eval $(call proto_header_template,$(gensecsrcdir)/gensec_proto.h,$(gensec_OBJ_FILES:.o=.c)))
################################################
# Start MODULE gensec_krb5
@@ -24,7 +25,7 @@ PRIVATE_DEPENDENCIES = CREDENTIALS KERBEROS auth_session auth_sam
# End MODULE gensec_krb5
################################################
-gensec_krb5_OBJ_FILES = $(addprefix auth/gensec/, gensec_krb5.o)
+gensec_krb5_OBJ_FILES = $(addprefix $(gensecsrcdir)/, gensec_krb5.o)
################################################
# Start MODULE gensec_gssapi
@@ -35,7 +36,7 @@ PRIVATE_DEPENDENCIES = HEIMDAL_GSSAPI CREDENTIALS KERBEROS
# End MODULE gensec_gssapi
################################################
-gensec_gssapi_OBJ_FILES = $(addprefix auth/gensec/, gensec_gssapi.o)
+gensec_gssapi_OBJ_FILES = $(addprefix $(gensecsrcdir)/, gensec_gssapi.o)
################################################
# Start MODULE cyrus_sasl
@@ -46,40 +47,41 @@ PRIVATE_DEPENDENCIES = CREDENTIALS SASL
# End MODULE cyrus_sasl
################################################
-cyrus_sasl_OBJ_FILES = $(addprefix auth/gensec/, cyrus_sasl.o)
+cyrus_sasl_OBJ_FILES = $(addprefix $(gensecsrcdir)/, cyrus_sasl.o)
################################################
# Start MODULE gensec_spnego
[MODULE::gensec_spnego]
SUBSYSTEM = gensec
INIT_FUNCTION = gensec_spnego_init
-PRIVATE_PROTO_HEADER = spnego_proto.h
PRIVATE_DEPENDENCIES = ASN1_UTIL CREDENTIALS
# End MODULE gensec_spnego
################################################
-gensec_spnego_OBJ_FILES = $(addprefix auth/gensec/, spnego.o spnego_parse.o)
+gensec_spnego_OBJ_FILES = $(addprefix $(gensecsrcdir)/, spnego.o spnego_parse.o)
+
+$(eval $(call proto_header_template,$(gensecsrcdir)/spnego_proto.h,$(gensec_spnego_OBJ_FILES:.o=.c)))
################################################
# Start MODULE gensec_schannel
[MODULE::gensec_schannel]
SUBSYSTEM = gensec
-PRIVATE_PROTO_HEADER = schannel_proto.h
INIT_FUNCTION = gensec_schannel_init
PRIVATE_DEPENDENCIES = SCHANNELDB NDR_SCHANNEL CREDENTIALS LIBNDR
OUTPUT_TYPE = MERGED_OBJ
# End MODULE gensec_schannel
################################################
-gensec_schannel_OBJ_FILES = $(addprefix auth/gensec/, schannel.o schannel_sign.o)
+gensec_schannel_OBJ_FILES = $(addprefix $(gensecsrcdir)/, schannel.o schannel_sign.o)
+$(eval $(call proto_header_template,$(gensecsrcdir)/schannel_proto.h,$(gensec_schannel_OBJ_FILES:.o=.c)))
################################################
# Start SUBSYSTEM SCHANNELDB
[SUBSYSTEM::SCHANNELDB]
-PRIVATE_PROTO_HEADER = schannel_state.h
PRIVATE_DEPENDENCIES = LDB_WRAP SAMDB
# End SUBSYSTEM SCHANNELDB
################################################
-SCHANNELDB_OBJ_FILES = $(addprefix auth/gensec/, schannel_state.o)
+SCHANNELDB_OBJ_FILES = $(addprefix $(gensecsrcdir)/, schannel_state.o)
+$(eval $(call proto_header_template,$(gensecsrcdir)/schannel_state.h,$(SCHANNELDB_OBJ_FILES:.o=.c)))
diff --git a/source4/auth/kerberos/config.mk b/source4/auth/kerberos/config.mk
index 762d6f8c49..951e247258 100644
--- a/source4/auth/kerberos/config.mk
+++ b/source4/auth/kerberos/config.mk
@@ -1,13 +1,12 @@
#################################
# Start SUBSYSTEM KERBEROS
[SUBSYSTEM::KERBEROS]
-PRIVATE_PROTO_HEADER = proto.h
PUBLIC_DEPENDENCIES = HEIMDAL_KRB5 NDR_KRB5PAC samba-socket LIBCLI_RESOLVE
PRIVATE_DEPENDENCIES = ASN1_UTIL auth_sam_reply LIBPACKET LIBNDR
# End SUBSYSTEM KERBEROS
#################################
-KERBEROS_OBJ_FILES = $(addprefix auth/kerberos/, \
+KERBEROS_OBJ_FILES = $(addprefix $(authsrcdir)/kerberos/, \
kerberos.o \
clikrb5.o \
kerberos_heimdal.o \
@@ -15,3 +14,5 @@ KERBEROS_OBJ_FILES = $(addprefix auth/kerberos/, \
gssapi_parse.o \
krb5_init_context.o)
+$(eval $(call proto_header_template,$(authsrcdir)/kerberos/proto.h,$(KERBEROS_OBJ_FILES:.o=.c)))
+
diff --git a/source4/auth/ntlm/config.mk b/source4/auth/ntlm/config.mk
index 319aca7318..d812816a91 100644
--- a/source4/auth/ntlm/config.mk
+++ b/source4/auth/ntlm/config.mk
@@ -3,7 +3,7 @@
[SUBSYSTEM::ntlm_check]
PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL
-ntlm_check_OBJ_FILES = $(addprefix auth/ntlm/, ntlm_check.o)
+ntlm_check_OBJ_FILES = $(addprefix $(authsrcdir)/ntlm/, ntlm_check.o)
#######################
# Start MODULE auth_sam
@@ -16,7 +16,7 @@ PRIVATE_DEPENDENCIES = \
# End MODULE auth_sam
#######################
-auth_sam_module_OBJ_FILES = $(addprefix auth/ntlm/, auth_sam.o)
+auth_sam_module_OBJ_FILES = $(addprefix $(authsrcdir)/ntlm/, auth_sam.o)
#######################
# Start MODULE auth_anonymous
@@ -26,7 +26,7 @@ SUBSYSTEM = auth
# End MODULE auth_anonymous
#######################
-auth_anonymous_OBJ_FILES = $(addprefix auth/ntlm/, auth_anonymous.o)
+auth_anonymous_OBJ_FILES = $(addprefix $(authsrcdir)/ntlm/, auth_anonymous.o)
#######################
# Start MODULE auth_anonymous
@@ -38,7 +38,7 @@ OUTPUT_TYPE = SHARED_LIBRARY
# End MODULE auth_server
#######################
-auth_server_OBJ_FILES = $(addprefix auth/ntlm/, auth_server.o)
+auth_server_OBJ_FILES = $(addprefix $(authsrcdir)/ntlm/, auth_server.o)
#######################
# Start MODULE auth_winbind
@@ -49,7 +49,7 @@ PRIVATE_DEPENDENCIES = NDR_WINBIND MESSAGING LIBWINBIND-CLIENT
# End MODULE auth_winbind
#######################
-auth_winbind_OBJ_FILES = $(addprefix auth/ntlm/, auth_winbind.o)
+auth_winbind_OBJ_FILES = $(addprefix $(authsrcdir)/ntlm/, auth_winbind.o)
#######################
# Start MODULE auth_developer
@@ -59,29 +59,30 @@ SUBSYSTEM = auth
# End MODULE auth_developer
#######################
-auth_developer_OBJ_FILES = $(addprefix auth/ntlm/, auth_developer.o)
+auth_developer_OBJ_FILES = $(addprefix $(authsrcdir)/ntlm/, auth_developer.o)
[MODULE::auth_unix]
INIT_FUNCTION = auth_unix_init
SUBSYSTEM = auth
PRIVATE_DEPENDENCIES = CRYPT PAM PAM_ERRORS NSS_WRAPPER
-auth_unix_OBJ_FILES = $(addprefix auth/ntlm/, auth_unix.o)
+auth_unix_OBJ_FILES = $(addprefix $(authsrcdir)/ntlm/, auth_unix.o)
[SUBSYSTEM::PAM_ERRORS]
-PRIVATE_PROTO_HEADER = pam_errors.h
+
+$(eval $(call proto_header_template,$(authsrcdir)/ntlm/pam_errors.h,$(auth_unix_OBJ_FILES:.o=.c)))
#VERSION = 0.0.1
#SO_VERSION = 0
-PAM_ERRORS_OBJ_FILES = $(addprefix auth/ntlm/, pam_errors.o)
+PAM_ERRORS_OBJ_FILES = $(addprefix $(authsrcdir)/ntlm/, pam_errors.o)
[MODULE::auth]
INIT_FUNCTION = server_service_auth_init
SUBSYSTEM = service
-PRIVATE_PROTO_HEADER = auth_proto.h
PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL LIBSECURITY SAMDB CREDENTIALS
-auth_OBJ_FILES = $(addprefix auth/ntlm/, auth.o auth_util.o auth_simple.o)
+auth_OBJ_FILES = $(addprefix $(authsrcdir)/ntlm/, auth.o auth_util.o auth_simple.o)
+$(eval $(call proto_header_template,$(authsrcdir)/auth_proto.h,$(auth_OBJ_FILES:.o=.c)))
# PUBLIC_HEADERS += auth/auth.h
diff --git a/source4/auth/ntlmssp/config.mk b/source4/auth/ntlmssp/config.mk
index 849448f5bb..ca58e28a24 100644
--- a/source4/auth/ntlmssp/config.mk
+++ b/source4/auth/ntlmssp/config.mk
@@ -1,17 +1,19 @@
[SUBSYSTEM::MSRPC_PARSE]
-PRIVATE_PROTO_HEADER = msrpc_parse.h
-MSRPC_PARSE_OBJ_FILES = $(addprefix auth/ntlmssp/, ntlmssp_parse.o)
+MSRPC_PARSE_OBJ_FILES = $(addprefix $(authsrcdir)/ntlmssp/, ntlmssp_parse.o)
+
+$(eval $(call proto_header_template,$(authsrcdir)/ntlmssp/msrpc_parse.h,$(MSRPC_PARSE_OBJ_FILES)))
################################################
# Start MODULE gensec_ntlmssp
[MODULE::gensec_ntlmssp]
SUBSYSTEM = gensec
INIT_FUNCTION = gensec_ntlmssp_init
-PRIVATE_PROTO_HEADER = proto.h
PRIVATE_DEPENDENCIES = MSRPC_PARSE CREDENTIALS auth
OUTPUT_TYPE = MERGED_OBJ
# End MODULE gensec_ntlmssp
################################################
-gensec_ntlmssp_OBJ_FILES = $(addprefix auth/ntlmssp/, ntlmssp.o ntlmssp_sign.o ntlmssp_client.o ntlmssp_server.o)
+gensec_ntlmssp_OBJ_FILES = $(addprefix $(authsrcdir)/ntlmssp/, ntlmssp.o ntlmssp_sign.o ntlmssp_client.o ntlmssp_server.o)
+
+$(eval $(call proto_header_template,$(authsrcdir)/ntlmssp/proto.h,$(gensec_ntlmssp_OBJ_FILES:.o=.c)))
diff --git a/source4/build/m4/public.m4 b/source4/build/m4/public.m4
index ba8251e65d..d932f09a69 100644
--- a/source4/build/m4/public.m4
+++ b/source4/build/m4/public.m4
@@ -12,6 +12,10 @@ dnl SMB_ENABLE(name,default_build)
dnl
dnl SMB_INCLUDE_MK(file)
dnl
+dnl SMB_WRITE_MAKEVARS(file)
+dnl
+dnl SMB_WRITE_PERLVARS(file)
+dnl
dnl #######################################################
dnl ### And now the implementation ###
dnl #######################################################
@@ -150,3 +154,70 @@ $1_ENABLE = $2
SMB_INFO_ENABLES="$SMB_INFO_ENABLES
\$enabled{$1} = \"$2\";"
])
+
+dnl SMB_WRITE_MAKEVARS(path)
+AC_DEFUN([SMB_WRITE_MAKEVARS],
+[
+echo "configure: creating $1"
+cat >$1<<CEOF
+# $1 - Autogenerated by configure, DO NOT EDIT!
+AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]), [
+AC_Var = $AC_Var])
+$MAKE_SETTINGS
+CEOF
+])
+
+dnl SMB_WRITE_PERLVARS(path)
+AC_DEFUN([SMB_WRITE_PERLVARS],
+[
+echo "configure: creating $1"
+cat >$1<<CEOF
+# config.pm - Autogenerate by configure. DO NOT EDIT!
+
+package config;
+require Exporter;
+@ISA = qw(Exporter);
+@EXPORT_OK = qw(%enabled %config);
+use strict;
+
+use vars qw(%enabled %config);
+
+%config = (AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]), [
+ AC_Var => '$AC_Var',])
+);
+
+$SMB_INFO_ENABLES
+1;
+CEOF
+])
+
+dnl SMB_BUILD_RUN(OUTPUT_FILE)
+AC_DEFUN([SMB_BUILD_RUN],
+[
+AC_OUTPUT_COMMANDS(
+[
+test "x$ac_abs_srcdir" != "x$ac_abs_builddir" && (
+ cd $builddir;
+ # NOTE: We *must* use -R so we don't follow symlinks (at least on BSD
+ # systems).
+ test -d heimdal || cp -R $srcdir/heimdal $builddir/
+ test -d heimdal_build || cp -R $srcdir/heimdal_build $builddir/
+ test -d build || builddir="$builddir" \
+ srcdir="$srcdir" \
+ $PERL ${srcdir}/script/buildtree.pl
+ )
+
+$PERL -I${builddir} -I${builddir}/build \
+ -I${srcdir} -I${srcdir}/build \
+ ${srcdir}/build/smb_build/main.pl --output=$1 main.mk || exit $?
+],
+[
+srcdir="$srcdir"
+builddir="$builddir"
+PERL="$PERL"
+
+export PERL
+export srcdir
+export builddir
+])
+])
diff --git a/source4/build/make/rules.mk b/source4/build/make/rules.mk
index c0359a8297..176e67a691 100644
--- a/source4/build/make/rules.mk
+++ b/source4/build/make/rules.mk
@@ -56,8 +56,6 @@ clean:: clean_pch
@echo Removing generated files
@-rm -f bin/*_init_module.c
@-rm -rf librpc/gen_*
- @echo Removing proto headers
- @-rm -f $(PROTO_HEADERS)
distclean:: clean
-rm -f include/config.h include/config_tmp.h include/build.h
@@ -88,102 +86,7 @@ unused_macros:
@mkdir -p $(@D)
@$(STLD) $(STLD_FLAGS) $@ $^
-###############################################################################
-# Templates
-###############################################################################
-
-# Partially link
-# Arguments: target object file, source object files
-define partial_link_template
-$(1): $(2) ;
- @echo Partially linking $$@
- @mkdir -p $$(@D)
- $$(PARTLINK) -o $$@ $$^
-endef
-
-# Link a binary
-# Arguments: target file, depends, flags
-define binary_link_template
-$(1): $(2) ;
- @echo Linking $$@
- @$$(BNLD) $$(BNLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3)
-endef
-
-# Link a host-machine binary
-# Arguments: target file, depends, flags
-define host_binary_link_template
-$(1): $(2) ;
- @echo Linking $$@
- @$$(HOSTLD) $$(HOSTLD_FLAGS) -L$${builddir}/bin/static -o $$@ $$(INSTALL_LINK_FLAGS) $(3)
-endef
-
-# Create a prototype header
-# Arguments: header file, c files
-define proto_header_template
-$(1): $(2) ;
- @echo "Creating $$@"
- @$$(PERL) $$(srcdir)/script/mkproto.pl --srcdir=$$(srcdir) --builddir=$$(builddir) --public=/dev/null --private=$$@ $$^
-endef
-
-# Shared module
-# Arguments: Target, dependencies, objects
-define shared_module_template
-
-$(1): $(2) ;
- @echo Linking $$@
- @mkdir -p $$(@D)
- @$$(MDLD) $$(LDFLAGS) $$(MDLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3)
-
-endef
-
-# Shared library
-# Arguments: Target, dependencies, link flags, soname
-define shared_library_template
-$(1): $(2)
- @echo Linking $$@
- @mkdir -p $$(@D)
- @$$(SHLD) $$(LDFLAGS) $$(SHLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) \
- $(3) \
- $$(if $$(SONAMEFLAG), $$(SONAMEFLAG)$(notdir $(4)))
-
-ifneq ($(notdir $(1)),$(notdir $(4)))
-$(4): $(1)
- @echo "Creating symbolic link for $$@"
- @ln -fs $$(<F) $$@
-endif
-
-ifneq ($(notdir $(1)),$(notdir $(5)))
-$(5): $(1)
- @echo "Creating symbolic link for $$@"
- @ln -fs $$(<F) $$@
-endif
-endef
-
-# Shared alias
-# Arguments: Target, subsystem name, alias name
-define shared_module_alias_template
-bin/modules/$(2)/$(3).$$(SHLIBEXT): $(1)
- @ln -fs $$(<F) $$@
-
-PLUGINS += bin/modules/$(2)/$(3).$$(SHLIBEXT)
-
-uninstallplugins::
- @-rm $$(DESTDIR)$$(modulesdir)/$(2)/$(3).$$(SHLIBEXT)
-installplugins::
- @ln -fs $(1) $$(DESTDIR)$$(modulesdir)/$(2)/$(3).$$(SHLIBEXT)
-
-endef
-
-define shared_module_install_template
-installplugins:: bin/modules/$(1)/$(2)
- @echo Installing $(2) as $$(DESTDIR)$$(modulesdir)/$(1)/$(2)
- @mkdir -p $$(DESTDIR)$$(modulesdir)/$(1)/
- @cp bin/modules/$(1)/$(2) $$(DESTDIR)$$(modulesdir)/$(1)/$(2)
-uninstallplugins::
- @echo Uninstalling $$(DESTDIR)$$(modulesdir)/$(1)/$(2)
- @-rm $$(DESTDIR)$$(modulesdir)/$(1)/$(2)
-
-endef
+include build/make/templates.mk
###############################################################################
# File types
diff --git a/source4/build/make/templates.mk b/source4/build/make/templates.mk
new file mode 100644
index 0000000000..48678c5603
--- /dev/null
+++ b/source4/build/make/templates.mk
@@ -0,0 +1,108 @@
+# Templates file for Samba 4
+# This relies on GNU make.
+#
+# © 2008 Jelmer Vernooij <jelmer@samba.org>
+#
+###############################################################################
+# Templates
+###############################################################################
+
+# Partially link
+# Arguments: target object file, source object files
+define partial_link_template
+$(1): $(2) ;
+ @echo Partially linking $$@
+ @mkdir -p $$(@D)
+ $$(PARTLINK) -o $$@ $$^
+endef
+
+# Link a binary
+# Arguments: target file, depends, flags
+define binary_link_template
+$(1): $(2) ;
+ @echo Linking $$@
+ @$$(BNLD) $$(BNLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3)
+endef
+
+# Link a host-machine binary
+# Arguments: target file, depends, flags
+define host_binary_link_template
+$(1): $(2) ;
+ @echo Linking $$@
+ @$$(HOSTLD) $$(HOSTLD_FLAGS) -L$${builddir}/bin/static -o $$@ $$(INSTALL_LINK_FLAGS) $(3)
+endef
+
+# Create a prototype header
+# Arguments: header file, c files
+define proto_header_template
+
+proto:: $(1) ;
+
+clean:: ;
+ rm -f $(1)
+
+$(1): $(2) ;
+ @echo "Creating $$@"
+ @$$(PERL) $$(srcdir)/script/mkproto.pl --srcdir=$$(srcdir) --builddir=$$(builddir) --public=/dev/null --private=$$@ $$^
+
+endef
+
+# Shared module
+# Arguments: Target, dependencies, objects
+define shared_module_template
+
+$(1): $(2) ;
+ @echo Linking $$@
+ @mkdir -p $$(@D)
+ @$$(MDLD) $$(LDFLAGS) $$(MDLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3)
+
+endef
+
+# Shared library
+# Arguments: Target, dependencies, link flags, soname
+define shared_library_template
+$(1): $(2)
+ @echo Linking $$@
+ @mkdir -p $$(@D)
+ @$$(SHLD) $$(LDFLAGS) $$(SHLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) \
+ $(3) \
+ $$(if $$(SONAMEFLAG), $$(SONAMEFLAG)$(notdir $(4)))
+
+ifneq ($(notdir $(1)),$(notdir $(4)))
+$(4): $(1)
+ @echo "Creating symbolic link for $$@"
+ @ln -fs $$(<F) $$@
+endif
+
+ifneq ($(notdir $(1)),$(notdir $(5)))
+$(5): $(1)
+ @echo "Creating symbolic link for $$@"
+ @ln -fs $$(<F) $$@
+endif
+endef
+
+# Shared alias
+# Arguments: Target, subsystem name, alias name
+define shared_module_alias_template
+bin/modules/$(2)/$(3).$$(SHLIBEXT): $(1)
+ @ln -fs $$(<F) $$@
+
+PLUGINS += bin/modules/$(2)/$(3).$$(SHLIBEXT)
+
+uninstallplugins::
+ @-rm $$(DESTDIR)$$(modulesdir)/$(2)/$(3).$$(SHLIBEXT)
+installplugins::
+ @ln -fs $(1) $$(DESTDIR)$$(modulesdir)/$(2)/$(3).$$(SHLIBEXT)
+
+endef
+
+define shared_module_install_template
+installplugins:: bin/modules/$(1)/$(2)
+ @echo Installing $(2) as $$(DESTDIR)$$(modulesdir)/$(1)/$(2)
+ @mkdir -p $$(DESTDIR)$$(modulesdir)/$(1)/
+ @cp bin/modules/$(1)/$(2) $$(DESTDIR)$$(modulesdir)/$(1)/$(2)
+uninstallplugins::
+ @echo Uninstalling $$(DESTDIR)$$(modulesdir)/$(1)/$(2)
+ @-rm $$(DESTDIR)$$(modulesdir)/$(1)/$(2)
+
+endef
diff --git a/source4/build/smb_build/config_mk.pm b/source4/build/smb_build/config_mk.pm
index 81c3363cfb..88e24a5876 100644
--- a/source4/build/smb_build/config_mk.pm
+++ b/source4/build/smb_build/config_mk.pm
@@ -33,8 +33,6 @@ my $section_types = {
"ENABLE" => "bool",
- "PRIVATE_PROTO_HEADER" => "string",
-
"CFLAGS" => "list",
"LDFLAGS" => "list",
"STANDARD_VISIBILITY" => "string",
@@ -53,8 +51,6 @@ my $section_types = {
"OUTPUT_TYPE" => "list",
- "PRIVATE_PROTO_HEADER" => "string",
-
"CFLAGS" => "list"
},
"BINARY" => {
@@ -64,8 +60,6 @@ my $section_types = {
"ENABLE" => "bool",
"INSTALLDIR" => "string",
- "PRIVATE_PROTO_HEADER" => "string",
-
"CFLAGS" => "list",
"LDFLAGS" => "list",
"STANDARD_VISIBILITY" => "string",
@@ -84,8 +78,6 @@ my $section_types = {
"ENABLE" => "bool",
- "PRIVATE_PROTO_HEADER" => "string",
-
"CFLAGS" => "list",
"LDFLAGS" => "list",
"STANDARD_VISIBILITY" => "string"
@@ -96,14 +88,11 @@ use vars qw(@parsed_files);
@parsed_files = ();
-sub _read_config_file
+sub _read_config_file($$$)
{
- use File::Basename;
use Cwd;
- my $srcdir = shift;
- my $builddir = shift;
- my $filename = shift;
+ my ($srcdir, $builddir, $filename) = @_;
my @dirlist;
# We need to change our working directory because config.mk files can
diff --git a/source4/build/smb_build/main.pl b/source4/build/smb_build/main.pl
index d31bea73f3..3ff34eedcf 100644
--- a/source4/build/smb_build/main.pl
+++ b/source4/build/smb_build/main.pl
@@ -11,10 +11,22 @@ use smb_build::config_mk;
use smb_build::output;
use smb_build::summary;
use smb_build::config;
+use Getopt::Long;
use strict;
+my $output_file = "data.mk";
+
+my $result = GetOptions (
+ 'output=s' => \$output_file);
+
+if (not $result) {
+ exit(1);
+}
+
+my $input_file = shift @ARGV;
+
my $INPUT = {};
-my $mkfile = smb_build::config_mk::run_config_mk($INPUT, $config::config{srcdir}, $config::config{builddir}, "main.mk");
+my $mkfile = smb_build::config_mk::run_config_mk($INPUT, $config::config{srcdir}, $config::config{builddir}, $input_file);
my $subsys_output_type = ["MERGED_OBJ"];
@@ -80,11 +92,10 @@ foreach my $key (values %$OUTPUT) {
grep(/SHARED_LIBRARY/, @{$key->{OUTPUT_TYPE}}));
$mkenv->PythonModule($key) if ($key->{TYPE} eq "PYTHON");
$mkenv->Binary($key) if grep(/BINARY/, @{$key->{OUTPUT_TYPE}});
- $mkenv->ProtoHeader($key) if defined($key->{PRIVATE_PROTO_HEADER});
$mkenv->InitFunctions($key) if defined($key->{INIT_FUNCTIONS});
}
-$mkenv->write("data.mk");
+$mkenv->write($output_file);
summary::show($OUTPUT, \%config::config);
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index 43c4252f9d..a0fee2736b 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -223,21 +223,14 @@ sub PythonFiles($$)
}
}
-sub ProtoHeader($$)
-{
- my ($self,$ctx) = @_;
-
- my $target = "\$(addprefix $ctx->{BASEDIR}/, $ctx->{PRIVATE_PROTO_HEADER})";
- $self->output("PROTO_HEADERS += $target\n");
- $self->output("\$(call proto_header_template, $target, \$($ctx->{NAME}_OBJ_FILES:.o=.c))\n");
-}
-
sub write($$)
{
my ($self, $file) = @_;
$self->_prepare_mk_files();
+ $self->output("ALL_OBJS = " . array2oneperline($self->{all_objs}) . "\n");
+
open(MAKEFILE,">$file") || die ("Can't open $file\n");
print MAKEFILE $self->{output};
close(MAKEFILE);
diff --git a/source4/build/tests/unixsock.c b/source4/build/tests/unixsock.c
deleted file mode 100644
index f2765d68f6..0000000000
--- a/source4/build/tests/unixsock.c
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- c-file-style: "linux" -*-
- *
- * Try creating a Unix-domain socket, opening it, and reading from it.
- * The POSIX name for these is AF_LOCAL/PF_LOCAL.
- *
- * This is used by the Samba autoconf scripts to detect systems which
- * don't have Unix-domain sockets, such as (probably) VMS, or systems
- * on which they are broken under some conditions, such as RedHat 7.0
- * (unpatched). We can't build WinBind there at the moment.
- *
- * Coding standard says to always use exit() for this, not return, so
- * we do.
- *
- * Martin Pool <mbp@samba.org>, June 2000. */
-
-/* TODO: Look for AF_LOCAL (most standard), AF_UNIX, and AF_FILE. */
-
-#include <stdio.h>
-
-#ifdef HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
-
-#ifdef HAVE_SYS_UN_H
-# include <sys/un.h>
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-
-#if HAVE_ERRNO_DECL
-# include <errno.h>
-#else
-extern int errno;
-#endif
-
-static int bind_socket(char const *filename)
-{
- int sock_fd;
- struct sockaddr_un name;
- size_t size;
-
- /* Create the socket. */
- if ((sock_fd = socket(PF_LOCAL, SOCK_STREAM, 0)) < 0) {
- perror ("socket(PF_LOCAL, SOCK_STREAM)");
- exit(1);
- }
-
- /* Bind a name to the socket. */
- name.sun_family = AF_LOCAL;
- strncpy(name.sun_path, filename, sizeof (name.sun_path));
-
- /* The size of the address is
- the offset of the start of the filename,
- plus its length,
- plus one for the terminating null byte.
- Alternatively you can just do:
- size = SUN_LEN (&name);
- */
- size = SUN_LEN(&name);
- /* XXX: This probably won't work on unfriendly libcs */
-
- if (bind(sock_fd, (struct sockaddr *) &name, size) < 0) {
- perror ("bind");
- exit(1);
- }
-
- return sock_fd;
-}
-
-
-int main(void)
-{
- int sock_fd;
- int kid;
- char const *filename = "conftest.unixsock.sock";
-
- /* abolish hanging */
- alarm(15); /* secs */
-
- if ((sock_fd = bind_socket(filename)) < 0)
- exit(1);
-
- /* the socket will be deleted when autoconf cleans up these
- files. */
-
- exit(0);
-}
diff --git a/source4/cldap_server/config.mk b/source4/cldap_server/config.mk
index 0773412bfd..137a44d0f7 100644
--- a/source4/cldap_server/config.mk
+++ b/source4/cldap_server/config.mk
@@ -5,14 +5,14 @@
[MODULE::CLDAPD]
INIT_FUNCTION = server_service_cldapd_init
SUBSYSTEM = smbd
-PRIVATE_PROTO_HEADER = proto.h
PRIVATE_DEPENDENCIES = \
LIBCLI_CLDAP LIBNETIF process_model
# End SUBSYSTEM CLDAPD
#######################
-CLDAPD_OBJ_FILES = $(addprefix cldap_server/, \
+CLDAPD_OBJ_FILES = $(addprefix $(cldap_serversrcdir)/, \
cldap_server.o \
netlogon.o \
rootdse.o)
+$(eval $(call proto_header_template,$(cldap_serversrcdir)/proto.h,$(CLDAPD_OBJ_FILES:.o=.c)))
diff --git a/source4/client/config.mk b/source4/client/config.mk
index 5cfa542fba..877544a09a 100644
--- a/source4/client/config.mk
+++ b/source4/client/config.mk
@@ -18,7 +18,7 @@ PRIVATE_DEPENDENCIES = \
# End BINARY smbclient
#################################
-smbclient_OBJ_FILES = client/client.o
+smbclient_OBJ_FILES = $(clientsrcdir)/client.o
#################################
# Start BINARY cifsdd
@@ -33,4 +33,4 @@ PRIVATE_DEPENDENCIES = \
# End BINARY sdd
#################################
-cifsdd_OBJ_FILES = client/cifsdd.o client/cifsddio.o
+cifsdd_OBJ_FILES = $(addprefix $(clientsrcdir)/, cifsdd.o cifsddio.o)
diff --git a/source4/cluster/config.mk b/source4/cluster/config.mk
index 00ac597f94..e841956a0c 100644
--- a/source4/cluster/config.mk
+++ b/source4/cluster/config.mk
@@ -1,6 +1,7 @@
+ctdbsrcdir = $(clustersrcdir)/ctdb
mkinclude ctdb/config.mk
[SUBSYSTEM::CLUSTER]
PRIVATE_DEPENDENCIES = ctdb
-CLUSTER_OBJ_FILES = cluster/cluster.o cluster/local.o
+CLUSTER_OBJ_FILES = $(addprefix $(clustersrcdir)/, cluster.o local.o)
diff --git a/source4/cluster/ctdb/config.mk b/source4/cluster/ctdb/config.mk
index 01c639d142..28b18c17ce 100644
--- a/source4/cluster/ctdb/config.mk
+++ b/source4/cluster/ctdb/config.mk
@@ -2,19 +2,19 @@
[SUBSYSTEM::brlock_ctdb]
PUBLIC_DEPENDENCIES = ctdb
-brlock_ctdb_OBJ_FILES = cluster/ctdb/brlock_ctdb.o
+brlock_ctdb_OBJ_FILES = $(ctdbsrcdir)/brlock_ctdb.o
##################
[SUBSYSTEM::opendb_ctdb]
PUBLIC_DEPENDENCIES = ctdb
-opendb_ctdb_OBJ_FILES = cluster/ctdb/opendb_ctdb.o
+opendb_ctdb_OBJ_FILES = $(ctdbsrcdir)/opendb_ctdb.o
##################
[SUBSYSTEM::ctdb]
PUBLIC_DEPENDENCIES = TDB_WRAP LIBTALLOC
-ctdb_OBJ_FILES = $(addprefix cluster/ctdb/, \
+ctdb_OBJ_FILES = $(addprefix $(ctdbsrcdir)/, \
ctdb_cluster.o \
client/ctdb_client.o \
common/ctdb_io.o \
diff --git a/source4/configure.ac b/source4/configure.ac
index d07632a291..34657cf6f9 100644
--- a/source4/configure.ac
+++ b/source4/configure.ac
@@ -160,27 +160,9 @@ fi
CPPFLAGS="$builddir_headers-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -I\$(srcdir)/lib/replace -I\$(srcdir)/lib/talloc -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H $CPPFLAGS"
-echo "configure: creating build/smb_build/config.pm"
-cat >build/smb_build/config.pm<<CEOF
-# config.pm - Autogenerate by configure. DO NOT EDIT!
+SMB_WRITE_PERLVARS(build/smb_build/config.pm)
-package config;
-require Exporter;
-@ISA = qw(Exporter);
-@EXPORT_OK = qw(%enabled %config);
-use strict;
-
-use vars qw(%enabled %config);
-
-%config = (AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]), [
- AC_Var => '$AC_Var',])
-);
-
-$SMB_INFO_ENABLES
-1;
-CEOF
-
-echo "configure: creating config.mk"
+../../source/echo "configure: creating config.mk"
cat >config.mk<<CEOF
# config.mk - Autogenerated by configure, DO NOT EDIT!
$SMB_INFO_EXT_LIBS
@@ -188,32 +170,7 @@ $SMB_INFO_SUBSYSTEMS
$SMB_INFO_LIBRARIES
CEOF
-AC_OUTPUT_COMMANDS(
-[
-test "x$ac_abs_srcdir" != "x$ac_abs_builddir" && (
- cd $builddir;
- # NOTE: We *must* use -R so we don't follow symlinks (at least on BSD
- # systems).
- test -d heimdal || cp -R $srcdir/heimdal $builddir/
- test -d heimdal_build || cp -R $srcdir/heimdal_build $builddir/
- test -d build || builddir="$builddir" \
- srcdir="$srcdir" \
- $PERL ${srcdir}/script/buildtree.pl
- )
-
-$PERL -I${builddir} -I${builddir}/build \
- -I${srcdir} -I${srcdir}/build \
- ${srcdir}/build/smb_build/main.pl || exit $?
-],
-[
-srcdir="$srcdir"
-builddir="$builddir"
-PERL="$PERL"
-
-export PERL
-export srcdir
-export builddir
-])
+SMB_BUILD_RUN(data.mk)
AC_OUTPUT
cmp include/config_tmp.h include/config.h >/dev/null 2>&1
@@ -222,13 +179,7 @@ if test $CMP_RET != 0; then
cp include/config_tmp.h include/config.h
fi
-echo "configure: creating mkconfig.mk"
-cat >mkconfig.mk<<CEOF
-# mkconfig.mk - Autogenerated by configure, DO NOT EDIT!
-AC_FOREACH([AC_Var], m4_defn([_AC_SUBST_VARS]), [
-AC_Var = $AC_Var])
-$MAKE_SETTINGS
-CEOF
+SMB_WRITE_MAKEVARS(mkconfig.mk)
if test $USESHARED = true
then
diff --git a/source4/dsdb/config.mk b/source4/dsdb/config.mk
index e621391617..7b700fda22 100644
--- a/source4/dsdb/config.mk
+++ b/source4/dsdb/config.mk
@@ -5,39 +5,39 @@ mkinclude samdb/ldb_modules/config.mk
################################################
# Start SUBSYSTEM SAMDB
[SUBSYSTEM::SAMDB]
-PRIVATE_PROTO_HEADER = samdb/samdb_proto.h
PUBLIC_DEPENDENCIES = HEIMDAL_KRB5
PRIVATE_DEPENDENCIES = LIBNDR NDR_MISC NDR_DRSUAPI NDR_DRSBLOBS NSS_WRAPPER \
auth_system_session LDAP_ENCODE LIBCLI_AUTH LIBNDR \
SAMDB_SCHEMA LDB_WRAP SAMDB_COMMON
-SAMDB_OBJ_FILES = $(addprefix dsdb/, \
+SAMDB_OBJ_FILES = $(addprefix $(dsdbsrcdir)/, \
samdb/samdb.o \
samdb/samdb_privilege.o \
samdb/cracknames.o \
repl/replicated_objects.o)
+$(eval $(call proto_header_template,$(dsdbsrcdir)/samdb/samdb_proto.h,$(SAMDB_OBJ_FILES:.o=.c)))
# PUBLIC_HEADERS += dsdb/samdb/samdb.h
[SUBSYSTEM::SAMDB_COMMON]
-PRIVATE_PROTO_HEADER = common/proto.h
PRIVATE_DEPENDENCIES = LIBLDB
-SAMDB_COMMON_OBJ_FILES = $(addprefix dsdb/common/, \
+SAMDB_COMMON_OBJ_FILES = $(addprefix $(dsdbsrcdir)/common/, \
sidmap.o \
flag_mapping.o \
util.o)
+$(eval $(call proto_header_template,$(dsdbsrcdir)/common/proto.h,$(SAMDB_COMMON_OBJ_FILES:.o=.c)))
[SUBSYSTEM::SAMDB_SCHEMA]
-PRIVATE_PROTO_HEADER = schema/proto.h
PRIVATE_DEPENDENCIES = SAMDB_COMMON NDR_DRSUAPI NDR_DRSBLOBS
-SAMDB_SCHEMA_OBJ_FILES = $(addprefix dsdb/schema/, \
+SAMDB_SCHEMA_OBJ_FILES = $(addprefix $(dsdbsrcdir)/schema/, \
schema_init.o \
schema_syntax.o \
schema_constructed.o)
+$(eval $(call proto_header_template,$(dsdbsrcdir)/schema/proto.h,$(SAMDB_SCHEMA_OBJ_FILES:.o=.c)))
# PUBLIC_HEADERS += dsdb/schema/schema.h
#######################
@@ -45,17 +45,17 @@ SAMDB_SCHEMA_OBJ_FILES = $(addprefix dsdb/schema/, \
[MODULE::DREPL_SRV]
INIT_FUNCTION = server_service_drepl_init
SUBSYSTEM = smbd
-PRIVATE_PROTO_HEADER = repl/drepl_service_proto.h
PRIVATE_DEPENDENCIES = \
SAMDB \
process_model
# End SUBSYSTEM DREPL_SRV
#######################
-DREPL_SRV_OBJ_FILES = $(addprefix dsdb/repl/, \
+DREPL_SRV_OBJ_FILES = $(addprefix $(dsdbsrcdir)/repl/, \
drepl_service.o \
drepl_periodic.o \
drepl_partitions.o \
drepl_out_pull.o \
drepl_out_helpers.o)
+$(eval $(call proto_header_template,$(dsdbsrcdir)/repl/drepl_service_proto.h,$(DREPL_SRV_OBJ_FILES:.o=.c)))
diff --git a/source4/dynconfig.mk b/source4/dynconfig.mk
index 487d924036..f365911c6a 100644
--- a/source4/dynconfig.mk
+++ b/source4/dynconfig.mk
@@ -9,8 +9,11 @@ CONFIGFILE = $(sysconfdir)/smb.conf
PKGCONFIGDIR = $(libdir)/pkgconfig
LMHOSTSFILE = $(sysconfdir)/lmhosts
-PATH_FLAGS = -DCONFIGFILE=\"$(CONFIGFILE)\" \
- -DBINDIR=\"$(bindir)\" -DLMHOSTSFILE=\"$(LMHOSTSFILE)\" \
+dynconfig.o: dynconfig.c Makefile
+ @echo Compiling $<
+ @$(CC) $(CFLAGS) $(CPPFLAGS) $(PICFLAG) -c $< -o $@ \
+ -DCONFIGFILE=\"$(CONFIGFILE)\" -DBINDIR=\"$(bindir)\" \
+ -DLMHOSTSFILE=\"$(LMHOSTSFILE)\" \
-DLOCKDIR=\"$(lockdir)\" -DPIDDIR=\"$(piddir)\" -DDATADIR=\"$(datadir)\" \
-DLOGFILEBASE=\"$(logfilebase)\" \
-DCONFIGDIR=\"$(sysconfdir)\" -DNCALRPCDIR=\"$(NCALRPCDIR)\" \
@@ -20,6 +23,4 @@ PATH_FLAGS = -DCONFIGFILE=\"$(CONFIGFILE)\" \
-DTORTUREDIR=\"$(TORTUREDIR)\" \
-DSETUPDIR=\"$(SETUPDIR)\" -DWINBINDD_SOCKET_DIR=\"$(winbindd_socket_dir)\"
-dynconfig.o: dynconfig.c Makefile
- @echo Compiling $<
- @$(CC) $(CFLAGS) $(CPPFLAGS) $(PICFLAG) $(PATH_FLAGS) -c $< -o $@
+
diff --git a/source4/heimdal_build/config.mk b/source4/heimdal_build/config.mk
index fc46381a23..a4f24c9026 100644
--- a/source4/heimdal_build/config.mk
+++ b/source4/heimdal_build/config.mk
@@ -7,34 +7,35 @@ PUBLIC_DEPENDENCIES = HEIMDAL_NTLM HEIMDAL_HCRYPTO
# End SUBSYSTEM HEIMDAL_KDC
#######################
+
HEIMDAL_KDC_OBJ_FILES = \
- ./heimdal/kdc/default_config.o \
- ./heimdal/kdc/kerberos5.o \
- ./heimdal/kdc/krb5tgs.o \
- ./heimdal/kdc/pkinit.o \
- ./heimdal/kdc/log.o \
- ./heimdal/kdc/misc.o \
- ./heimdal/kdc/524.o \
- ./heimdal/kdc/kerberos4.o \
- ./heimdal/kdc/kaserver.o \
- ./heimdal/kdc/digest.o \
- ./heimdal/kdc/process.o \
- ./heimdal/kdc/windc.o \
- ./heimdal/kdc/kx509.o
+ $(heimdalsrcdir)/kdc/default_config.o \
+ $(heimdalsrcdir)/kdc/kerberos5.o \
+ $(heimdalsrcdir)/kdc/krb5tgs.o \
+ $(heimdalsrcdir)/kdc/pkinit.o \
+ $(heimdalsrcdir)/kdc/log.o \
+ $(heimdalsrcdir)/kdc/misc.o \
+ $(heimdalsrcdir)/kdc/524.o \
+ $(heimdalsrcdir)/kdc/kerberos4.o \
+ $(heimdalsrcdir)/kdc/kaserver.o \
+ $(heimdalsrcdir)/kdc/digest.o \
+ $(heimdalsrcdir)/kdc/process.o \
+ $(heimdalsrcdir)/kdc/windc.o \
+ $(heimdalsrcdir)/kdc/kx509.o
[SUBSYSTEM::HEIMDAL_NTLM]
CFLAGS = -Iheimdal_build -Iheimdal/lib/ntlm
PRIVATE_DEPENDENCIES = HEIMDAL_ROKEN HEIMDAL_HCRYPTO HEIMDAL_KRB5
HEIMDAL_NTLM_OBJ_FILES = \
- ./heimdal/lib/ntlm/ntlm.o
+ $(heimdalsrcdir)/lib/ntlm/ntlm.o
[SUBSYSTEM::HEIMDAL_HDB_KEYS]
CFLAGS = -Iheimdal_build -Iheimdal/lib/hdb
PRIVATE_DEPENDENCIES = HEIMDAL_ROKEN HEIMDAL_HCRYPTO HEIMDAL_KRB5 \
HEIMDAL_HDB_ASN1
-HEIMDAL_HDB_KEYS_OBJ_FILES = ./heimdal/lib/hdb/keys.o
+HEIMDAL_HDB_KEYS_OBJ_FILES = $(heimdalsrcdir)/lib/hdb/keys.o
#######################
# Start SUBSYSTEM HEIMDAL_HDB
@@ -45,14 +46,14 @@ PRIVATE_DEPENDENCIES = HDB_LDB HEIMDAL_KRB5 HEIMDAL_HDB_KEYS HEIMDAL_ROKEN HEIMD
#######################
HEIMDAL_HDB_OBJ_FILES = \
- ./heimdal/lib/hdb/db.o \
- ./heimdal/lib/hdb/dbinfo.o \
- ./heimdal/lib/hdb/hdb.o \
- ./heimdal/lib/hdb/ext.o \
- ./heimdal/lib/hdb/keytab.o \
- ./heimdal/lib/hdb/mkey.o \
- ./heimdal/lib/hdb/ndbm.o \
- ./heimdal/lib/hdb/hdb_err.o
+ $(heimdalsrcdir)/lib/hdb/db.o \
+ $(heimdalsrcdir)/lib/hdb/dbinfo.o \
+ $(heimdalsrcdir)/lib/hdb/hdb.o \
+ $(heimdalsrcdir)/lib/hdb/ext.o \
+ $(heimdalsrcdir)/lib/hdb/keytab.o \
+ $(heimdalsrcdir)/lib/hdb/mkey.o \
+ $(heimdalsrcdir)/lib/hdb/ndbm.o \
+ $(heimdalsrcdir)/lib/hdb/hdb_err.o
#######################
# Start SUBSYSTEM HEIMDAL_GSSAPI
@@ -64,112 +65,112 @@ PUBLIC_DEPENDENCIES = HEIMDAL_ROKEN HEIMDAL_KRB5
#######################
HEIMDAL_GSSAPI_OBJ_FILES = \
- ./heimdal/lib/gssapi/mech/context.o \
- ./heimdal/lib/gssapi/mech/gss_krb5.o \
- ./heimdal/lib/gssapi/mech/gss_mech_switch.o \
- ./heimdal/lib/gssapi/mech/gss_process_context_token.o \
- ./heimdal/lib/gssapi/mech/gss_buffer_set.o \
- ./heimdal/lib/gssapi/mech/gss_add_cred.o \
- ./heimdal/lib/gssapi/mech/gss_add_oid_set_member.o \
- ./heimdal/lib/gssapi/mech/gss_compare_name.o \
- ./heimdal/lib/gssapi/mech/gss_release_oid_set.o \
- ./heimdal/lib/gssapi/mech/gss_create_empty_oid_set.o \
- ./heimdal/lib/gssapi/mech/gss_decapsulate_token.o \
- ./heimdal/lib/gssapi/mech/gss_inquire_cred_by_oid.o \
- ./heimdal/lib/gssapi/mech/gss_canonicalize_name.o \
- ./heimdal/lib/gssapi/mech/gss_inquire_sec_context_by_oid.o \
- ./heimdal/lib/gssapi/mech/gss_inquire_names_for_mech.o \
- ./heimdal/lib/gssapi/mech/gss_inquire_mechs_for_name.o \
- ./heimdal/lib/gssapi/mech/gss_wrap_size_limit.o \
- ./heimdal/lib/gssapi/mech/gss_names.o \
- ./heimdal/lib/gssapi/mech/gss_verify.o \
- ./heimdal/lib/gssapi/mech/gss_display_name.o \
- ./heimdal/lib/gssapi/mech/gss_duplicate_oid.o \
- ./heimdal/lib/gssapi/mech/gss_display_status.o \
- ./heimdal/lib/gssapi/mech/gss_release_buffer.o \
- ./heimdal/lib/gssapi/mech/gss_release_oid.o \
- ./heimdal/lib/gssapi/mech/gss_test_oid_set_member.o \
- ./heimdal/lib/gssapi/mech/gss_release_cred.o \
- ./heimdal/lib/gssapi/mech/gss_set_sec_context_option.o \
- ./heimdal/lib/gssapi/mech/gss_export_name.o \
- ./heimdal/lib/gssapi/mech/gss_seal.o \
- ./heimdal/lib/gssapi/mech/gss_acquire_cred.o \
- ./heimdal/lib/gssapi/mech/gss_unseal.o \
- ./heimdal/lib/gssapi/mech/gss_verify_mic.o \
- ./heimdal/lib/gssapi/mech/gss_accept_sec_context.o \
- ./heimdal/lib/gssapi/mech/gss_inquire_cred_by_mech.o \
- ./heimdal/lib/gssapi/mech/gss_indicate_mechs.o \
- ./heimdal/lib/gssapi/mech/gss_delete_sec_context.o \
- ./heimdal/lib/gssapi/mech/gss_sign.o \
- ./heimdal/lib/gssapi/mech/gss_utils.o \
- ./heimdal/lib/gssapi/mech/gss_init_sec_context.o \
- ./heimdal/lib/gssapi/mech/gss_oid_equal.o \
- ./heimdal/lib/gssapi/mech/gss_oid_to_str.o \
- ./heimdal/lib/gssapi/mech/gss_context_time.o \
- ./heimdal/lib/gssapi/mech/gss_encapsulate_token.o \
- ./heimdal/lib/gssapi/mech/gss_get_mic.o \
- ./heimdal/lib/gssapi/mech/gss_import_sec_context.o \
- ./heimdal/lib/gssapi/mech/gss_inquire_cred.o \
- ./heimdal/lib/gssapi/mech/gss_wrap.o \
- ./heimdal/lib/gssapi/mech/gss_import_name.o \
- ./heimdal/lib/gssapi/mech/gss_duplicate_name.o \
- ./heimdal/lib/gssapi/mech/gss_unwrap.o \
- ./heimdal/lib/gssapi/mech/gss_export_sec_context.o \
- ./heimdal/lib/gssapi/mech/gss_inquire_context.o \
- ./heimdal/lib/gssapi/mech/gss_release_name.o \
- ./heimdal/lib/gssapi/mech/gss_set_cred_option.o \
- ./heimdal/lib/gssapi/asn1_GSSAPIContextToken.o \
- ./heimdal/lib/gssapi/spnego/init_sec_context.o \
- ./heimdal/lib/gssapi/spnego/external.o \
- ./heimdal/lib/gssapi/spnego/compat.o \
- ./heimdal/lib/gssapi/spnego/context_stubs.o \
- ./heimdal/lib/gssapi/spnego/cred_stubs.o \
- ./heimdal/lib/gssapi/spnego/accept_sec_context.o \
- ./heimdal/lib/gssapi/krb5/copy_ccache.o \
- ./heimdal/lib/gssapi/krb5/delete_sec_context.o \
- ./heimdal/lib/gssapi/krb5/init_sec_context.o \
- ./heimdal/lib/gssapi/krb5/context_time.o \
- ./heimdal/lib/gssapi/krb5/init.o \
- ./heimdal/lib/gssapi/krb5/address_to_krb5addr.o \
- ./heimdal/lib/gssapi/krb5/get_mic.o \
- ./heimdal/lib/gssapi/krb5/inquire_context.o \
- ./heimdal/lib/gssapi/krb5/add_cred.o \
- ./heimdal/lib/gssapi/krb5/inquire_cred.o \
- ./heimdal/lib/gssapi/krb5/inquire_cred_by_oid.o \
- ./heimdal/lib/gssapi/krb5/inquire_cred_by_mech.o \
- ./heimdal/lib/gssapi/krb5/inquire_mechs_for_name.o \
- ./heimdal/lib/gssapi/krb5/inquire_names_for_mech.o \
- ./heimdal/lib/gssapi/krb5/indicate_mechs.o \
- ./heimdal/lib/gssapi/krb5/inquire_sec_context_by_oid.o \
- ./heimdal/lib/gssapi/krb5/export_sec_context.o \
- ./heimdal/lib/gssapi/krb5/import_sec_context.o \
- ./heimdal/lib/gssapi/krb5/duplicate_name.o \
- ./heimdal/lib/gssapi/krb5/import_name.o \
- ./heimdal/lib/gssapi/krb5/compare_name.o \
- ./heimdal/lib/gssapi/krb5/export_name.o \
- ./heimdal/lib/gssapi/krb5/canonicalize_name.o \
- ./heimdal/lib/gssapi/krb5/unwrap.o \
- ./heimdal/lib/gssapi/krb5/wrap.o \
- ./heimdal/lib/gssapi/krb5/release_name.o \
- ./heimdal/lib/gssapi/krb5/cfx.o \
- ./heimdal/lib/gssapi/krb5/8003.o \
- ./heimdal/lib/gssapi/krb5/arcfour.o \
- ./heimdal/lib/gssapi/krb5/encapsulate.o \
- ./heimdal/lib/gssapi/krb5/display_name.o \
- ./heimdal/lib/gssapi/krb5/sequence.o \
- ./heimdal/lib/gssapi/krb5/display_status.o \
- ./heimdal/lib/gssapi/krb5/release_buffer.o \
- ./heimdal/lib/gssapi/krb5/external.o \
- ./heimdal/lib/gssapi/krb5/compat.o \
- ./heimdal/lib/gssapi/krb5/acquire_cred.o \
- ./heimdal/lib/gssapi/krb5/release_cred.o \
- ./heimdal/lib/gssapi/krb5/set_cred_option.o \
- ./heimdal/lib/gssapi/krb5/decapsulate.o \
- ./heimdal/lib/gssapi/krb5/verify_mic.o \
- ./heimdal/lib/gssapi/krb5/accept_sec_context.o \
- ./heimdal/lib/gssapi/krb5/set_sec_context_option.o \
- ./heimdal/lib/gssapi/krb5/process_context_token.o \
- ./heimdal/lib/gssapi/krb5/prf.o
+ $(heimdalsrcdir)/lib/gssapi/mech/context.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_krb5.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_mech_switch.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_process_context_token.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_buffer_set.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_add_cred.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_add_oid_set_member.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_compare_name.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_release_oid_set.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_create_empty_oid_set.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_decapsulate_token.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_inquire_cred_by_oid.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_canonicalize_name.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_inquire_sec_context_by_oid.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_inquire_names_for_mech.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_inquire_mechs_for_name.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_wrap_size_limit.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_names.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_verify.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_display_name.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_duplicate_oid.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_display_status.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_release_buffer.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_release_oid.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_test_oid_set_member.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_release_cred.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_set_sec_context_option.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_export_name.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_seal.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_acquire_cred.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_unseal.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_verify_mic.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_accept_sec_context.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_inquire_cred_by_mech.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_indicate_mechs.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_delete_sec_context.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_sign.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_utils.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_init_sec_context.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_oid_equal.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_oid_to_str.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_context_time.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_encapsulate_token.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_get_mic.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_import_sec_context.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_inquire_cred.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_wrap.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_import_name.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_duplicate_name.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_unwrap.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_export_sec_context.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_inquire_context.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_release_name.o \
+ $(heimdalsrcdir)/lib/gssapi/mech/gss_set_cred_option.o \
+ $(heimdalsrcdir)/lib/gssapi/asn1_GSSAPIContextToken.o \
+ $(heimdalsrcdir)/lib/gssapi/spnego/init_sec_context.o \
+ $(heimdalsrcdir)/lib/gssapi/spnego/external.o \
+ $(heimdalsrcdir)/lib/gssapi/spnego/compat.o \
+ $(heimdalsrcdir)/lib/gssapi/spnego/context_stubs.o \
+ $(heimdalsrcdir)/lib/gssapi/spnego/cred_stubs.o \
+ $(heimdalsrcdir)/lib/gssapi/spnego/accept_sec_context.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/copy_ccache.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/delete_sec_context.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/init_sec_context.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/context_time.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/init.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/address_to_krb5addr.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/get_mic.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/inquire_context.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/add_cred.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/inquire_cred.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/inquire_cred_by_oid.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/inquire_cred_by_mech.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/inquire_mechs_for_name.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/inquire_names_for_mech.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/indicate_mechs.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/inquire_sec_context_by_oid.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/export_sec_context.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/import_sec_context.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/duplicate_name.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/import_name.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/compare_name.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/export_name.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/canonicalize_name.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/unwrap.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/wrap.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/release_name.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/cfx.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/8003.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/arcfour.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/encapsulate.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/display_name.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/sequence.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/display_status.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/release_buffer.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/external.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/compat.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/acquire_cred.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/release_cred.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/set_cred_option.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/decapsulate.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/verify_mic.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/accept_sec_context.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/set_sec_context_option.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/process_context_token.o \
+ $(heimdalsrcdir)/lib/gssapi/krb5/prf.o
#######################
@@ -182,92 +183,92 @@ PUBLIC_DEPENDENCIES = HEIMDAL_KRB5_ASN1 HEIMDAL_GLUE HEIMDAL_HX509 HEIMDAL_HCRYP
#######################
HEIMDAL_KRB5_OBJ_FILES = \
- ./heimdal/lib/krb5/acache.o \
- ./heimdal/lib/krb5/add_et_list.o \
- ./heimdal/lib/krb5/addr_families.o \
- ./heimdal/lib/krb5/appdefault.o \
- ./heimdal/lib/krb5/asn1_glue.o \
- ./heimdal/lib/krb5/auth_context.o \
- ./heimdal/lib/krb5/build_ap_req.o \
- ./heimdal/lib/krb5/build_auth.o \
- ./heimdal/lib/krb5/cache.o \
- ./heimdal/lib/krb5/changepw.o \
- ./heimdal/lib/krb5/codec.o \
- ./heimdal/lib/krb5/config_file.o \
- ./heimdal/lib/krb5/config_file_netinfo.o \
- ./heimdal/lib/krb5/constants.o \
- ./heimdal/lib/krb5/context.o \
- ./heimdal/lib/krb5/convert_creds.o \
- ./heimdal/lib/krb5/copy_host_realm.o \
- ./heimdal/lib/krb5/crc.o \
- ./heimdal/lib/krb5/creds.o \
- ./heimdal/lib/krb5/crypto.o \
- ./heimdal/lib/krb5/data.o \
- ./heimdal/lib/krb5/eai_to_heim_errno.o \
- ./heimdal/lib/krb5/error_string.o \
- ./heimdal/lib/krb5/expand_hostname.o \
- ./heimdal/lib/krb5/fcache.o \
- ./heimdal/lib/krb5/free.o \
- ./heimdal/lib/krb5/free_host_realm.o \
- ./heimdal/lib/krb5/generate_seq_number.o \
- ./heimdal/lib/krb5/generate_subkey.o \
- ./heimdal/lib/krb5/get_cred.o \
- ./heimdal/lib/krb5/get_default_principal.o \
- ./heimdal/lib/krb5/get_default_realm.o \
- ./heimdal/lib/krb5/get_for_creds.o \
- ./heimdal/lib/krb5/get_host_realm.o \
- ./heimdal/lib/krb5/get_in_tkt.o \
- ./heimdal/lib/krb5/get_in_tkt_with_keytab.o \
- ./heimdal/lib/krb5/get_port.o \
- ./heimdal/lib/krb5/init_creds.o \
- ./heimdal/lib/krb5/init_creds_pw.o \
- ./heimdal/lib/krb5/kcm.o \
- ./heimdal/lib/krb5/keyblock.o \
- ./heimdal/lib/krb5/keytab.o \
- ./heimdal/lib/krb5/keytab_any.o \
- ./heimdal/lib/krb5/keytab_file.o \
- ./heimdal/lib/krb5/keytab_memory.o \
- ./heimdal/lib/krb5/keytab_keyfile.o \
- ./heimdal/lib/krb5/keytab_krb4.o \
- ./heimdal/lib/krb5/krbhst.o \
- ./heimdal/lib/krb5/log.o \
- ./heimdal/lib/krb5/mcache.o \
- ./heimdal/lib/krb5/misc.o \
- ./heimdal/lib/krb5/mk_error.o \
- ./heimdal/lib/krb5/mk_priv.o \
- ./heimdal/lib/krb5/mk_rep.o \
- ./heimdal/lib/krb5/mk_req.o \
- ./heimdal/lib/krb5/mk_req_ext.o \
- ./heimdal/lib/krb5/mit_glue.o \
- ./heimdal/lib/krb5/n-fold.o \
- ./heimdal/lib/krb5/padata.o \
- ./heimdal/lib/krb5/pkinit.o \
- ./heimdal/lib/krb5/plugin.o \
- ./heimdal/lib/krb5/principal.o \
- ./heimdal/lib/krb5/pac.o \
- ./heimdal/lib/krb5/prompter_posix.o \
- ./heimdal/lib/krb5/rd_cred.o \
- ./heimdal/lib/krb5/rd_error.o \
- ./heimdal/lib/krb5/rd_priv.o \
- ./heimdal/lib/krb5/rd_rep.o \
- ./heimdal/lib/krb5/rd_req.o \
- ./heimdal/lib/krb5/replay.o \
- ./heimdal/lib/krb5/send_to_kdc.o \
- ./heimdal/lib/krb5/set_default_realm.o \
- ./heimdal/lib/krb5/store.o \
- ./heimdal/lib/krb5/store_emem.o \
- ./heimdal/lib/krb5/store_fd.o \
- ./heimdal/lib/krb5/store_mem.o \
- ./heimdal/lib/krb5/ticket.o \
- ./heimdal/lib/krb5/time.o \
- ./heimdal/lib/krb5/transited.o \
- ./heimdal/lib/krb5/v4_glue.o \
- ./heimdal/lib/krb5/version.o \
- ./heimdal/lib/krb5/warn.o \
- ./heimdal/lib/krb5/krb5_err.o \
- ./heimdal/lib/krb5/heim_err.o \
- ./heimdal/lib/krb5/k524_err.o \
- ./heimdal/lib/krb5/krb_err.o
+ $(heimdalsrcdir)/lib/krb5/acache.o \
+ $(heimdalsrcdir)/lib/krb5/add_et_list.o \
+ $(heimdalsrcdir)/lib/krb5/addr_families.o \
+ $(heimdalsrcdir)/lib/krb5/appdefault.o \
+ $(heimdalsrcdir)/lib/krb5/asn1_glue.o \
+ $(heimdalsrcdir)/lib/krb5/auth_context.o \
+ $(heimdalsrcdir)/lib/krb5/build_ap_req.o \
+ $(heimdalsrcdir)/lib/krb5/build_auth.o \
+ $(heimdalsrcdir)/lib/krb5/cache.o \
+ $(heimdalsrcdir)/lib/krb5/changepw.o \
+ $(heimdalsrcdir)/lib/krb5/codec.o \
+ $(heimdalsrcdir)/lib/krb5/config_file.o \
+ $(heimdalsrcdir)/lib/krb5/config_file_netinfo.o \
+ $(heimdalsrcdir)/lib/krb5/constants.o \
+ $(heimdalsrcdir)/lib/krb5/context.o \
+ $(heimdalsrcdir)/lib/krb5/convert_creds.o \
+ $(heimdalsrcdir)/lib/krb5/copy_host_realm.o \
+ $(heimdalsrcdir)/lib/krb5/crc.o \
+ $(heimdalsrcdir)/lib/krb5/creds.o \
+ $(heimdalsrcdir)/lib/krb5/crypto.o \
+ $(heimdalsrcdir)/lib/krb5/data.o \
+ $(heimdalsrcdir)/lib/krb5/eai_to_heim_errno.o \
+ $(heimdalsrcdir)/lib/krb5/error_string.o \
+ $(heimdalsrcdir)/lib/krb5/expand_hostname.o \
+ $(heimdalsrcdir)/lib/krb5/fcache.o \
+ $(heimdalsrcdir)/lib/krb5/free.o \
+ $(heimdalsrcdir)/lib/krb5/free_host_realm.o \
+ $(heimdalsrcdir)/lib/krb5/generate_seq_number.o \
+ $(heimdalsrcdir)/lib/krb5/generate_subkey.o \
+ $(heimdalsrcdir)/lib/krb5/get_cred.o \
+ $(heimdalsrcdir)/lib/krb5/get_default_principal.o \
+ $(heimdalsrcdir)/lib/krb5/get_default_realm.o \
+ $(heimdalsrcdir)/lib/krb5/get_for_creds.o \
+ $(heimdalsrcdir)/lib/krb5/get_host_realm.o \
+ $(heimdalsrcdir)/lib/krb5/get_in_tkt.o \
+ $(heimdalsrcdir)/lib/krb5/get_in_tkt_with_keytab.o \
+ $(heimdalsrcdir)/lib/krb5/get_port.o \
+ $(heimdalsrcdir)/lib/krb5/init_creds.o \
+ $(heimdalsrcdir)/lib/krb5/init_creds_pw.o \
+ $(heimdalsrcdir)/lib/krb5/kcm.o \
+ $(heimdalsrcdir)/lib/krb5/keyblock.o \
+ $(heimdalsrcdir)/lib/krb5/keytab.o \
+ $(heimdalsrcdir)/lib/krb5/keytab_any.o \
+ $(heimdalsrcdir)/lib/krb5/keytab_file.o \
+ $(heimdalsrcdir)/lib/krb5/keytab_memory.o \
+ $(heimdalsrcdir)/lib/krb5/keytab_keyfile.o \
+ $(heimdalsrcdir)/lib/krb5/keytab_krb4.o \
+ $(heimdalsrcdir)/lib/krb5/krbhst.o \
+ $(heimdalsrcdir)/lib/krb5/log.o \
+ $(heimdalsrcdir)/lib/krb5/mcache.o \
+ $(heimdalsrcdir)/lib/krb5/misc.o \
+ $(heimdalsrcdir)/lib/krb5/mk_error.o \
+ $(heimdalsrcdir)/lib/krb5/mk_priv.o \
+ $(heimdalsrcdir)/lib/krb5/mk_rep.o \
+ $(heimdalsrcdir)/lib/krb5/mk_req.o \
+ $(heimdalsrcdir)/lib/krb5/mk_req_ext.o \
+ $(heimdalsrcdir)/lib/krb5/mit_glue.o \
+ $(heimdalsrcdir)/lib/krb5/n-fold.o \
+ $(heimdalsrcdir)/lib/krb5/padata.o \
+ $(heimdalsrcdir)/lib/krb5/pkinit.o \
+ $(heimdalsrcdir)/lib/krb5/plugin.o \
+ $(heimdalsrcdir)/lib/krb5/principal.o \
+ $(heimdalsrcdir)/lib/krb5/pac.o \
+ $(heimdalsrcdir)/lib/krb5/prompter_posix.o \
+ $(heimdalsrcdir)/lib/krb5/rd_cred.o \
+ $(heimdalsrcdir)/lib/krb5/rd_error.o \
+ $(heimdalsrcdir)/lib/krb5/rd_priv.o \
+ $(heimdalsrcdir)/lib/krb5/rd_rep.o \
+ $(heimdalsrcdir)/lib/krb5/rd_req.o \
+ $(heimdalsrcdir)/lib/krb5/replay.o \
+ $(heimdalsrcdir)/lib/krb5/send_to_kdc.o \
+ $(heimdalsrcdir)/lib/krb5/set_default_realm.o \
+ $(heimdalsrcdir)/lib/krb5/store.o \
+ $(heimdalsrcdir)/lib/krb5/store_emem.o \
+ $(heimdalsrcdir)/lib/krb5/store_fd.o \
+ $(heimdalsrcdir)/lib/krb5/store_mem.o \
+ $(heimdalsrcdir)/lib/krb5/ticket.o \
+ $(heimdalsrcdir)/lib/krb5/time.o \
+ $(heimdalsrcdir)/lib/krb5/transited.o \
+ $(heimdalsrcdir)/lib/krb5/v4_glue.o \
+ $(heimdalsrcdir)/lib/krb5/version.o \
+ $(heimdalsrcdir)/lib/krb5/warn.o \
+ $(heimdalsrcdir)/lib/krb5/krb5_err.o \
+ $(heimdalsrcdir)/lib/krb5/heim_err.o \
+ $(heimdalsrcdir)/lib/krb5/k524_err.o \
+ $(heimdalsrcdir)/lib/krb5/krb_err.o
#######################
# Start SUBSYSTEM HEIMDAL_HEIM_ASN1
@@ -278,16 +279,16 @@ PRIVATE_DEPENDENCIES = HEIMDAL_ROKEN HEIMDAL_COM_ERR
#######################
HEIMDAL_HEIM_ASN1_OBJ_FILES = \
- ./heimdal/lib/asn1/der_get.o \
- ./heimdal/lib/asn1/der_put.o \
- ./heimdal/lib/asn1/der_free.o \
- ./heimdal/lib/asn1/der_format.o \
- ./heimdal/lib/asn1/der_length.o \
- ./heimdal/lib/asn1/der_copy.o \
- ./heimdal/lib/asn1/der_cmp.o \
- ./heimdal/lib/asn1/extra.o \
- ./heimdal/lib/asn1/timegm.o \
- ./heimdal/lib/asn1/asn1_err.o
+ $(heimdalsrcdir)/lib/asn1/der_get.o \
+ $(heimdalsrcdir)/lib/asn1/der_put.o \
+ $(heimdalsrcdir)/lib/asn1/der_free.o \
+ $(heimdalsrcdir)/lib/asn1/der_format.o \
+ $(heimdalsrcdir)/lib/asn1/der_length.o \
+ $(heimdalsrcdir)/lib/asn1/der_copy.o \
+ $(heimdalsrcdir)/lib/asn1/der_cmp.o \
+ $(heimdalsrcdir)/lib/asn1/extra.o \
+ $(heimdalsrcdir)/lib/asn1/timegm.o \
+ $(heimdalsrcdir)/lib/asn1/asn1_err.o
#######################
# Start SUBSYSTEM HEIMDAL_HCRYPTO_IMATH
@@ -298,8 +299,8 @@ PRIVATE_DEPENDENCIES = HEIMDAL_ROKEN
#######################
HEIMDAL_HCRYPTO_IMATH_OBJ_FILES = \
- ./heimdal/lib/hcrypto/imath/imath.o \
- ./heimdal/lib/hcrypto/imath/iprime.o
+ $(heimdalsrcdir)/lib/hcrypto/imath/imath.o \
+ $(heimdalsrcdir)/lib/hcrypto/imath/iprime.o
[SUBSYSTEM::HEIMDAL_HCRYPTO]
CFLAGS = -Iheimdal_build -Iheimdal/lib/hcrypto -Iheimdal/lib
@@ -308,36 +309,36 @@ PRIVATE_DEPENDENCIES = HEIMDAL_ROKEN HEIMDAL_HEIM_ASN1 HEIMDAL_HCRYPTO_IMATH HEI
#######################
HEIMDAL_HCRYPTO_OBJ_FILES = \
- ./heimdal/lib/hcrypto/aes.o \
- ./heimdal/lib/hcrypto/bn.o \
- ./heimdal/lib/hcrypto/dh.o \
- ./heimdal/lib/hcrypto/dh-imath.o \
- ./heimdal/lib/hcrypto/des.o \
- ./heimdal/lib/hcrypto/dsa.o \
- ./heimdal/lib/hcrypto/engine.o \
- ./heimdal/lib/hcrypto/md2.o \
- ./heimdal/lib/hcrypto/md4.o \
- ./heimdal/lib/hcrypto/md5.o \
- ./heimdal/lib/hcrypto/rsa.o \
- ./heimdal/lib/hcrypto/rsa-imath.o \
- ./heimdal/lib/hcrypto/rc2.o \
- ./heimdal/lib/hcrypto/rc4.o \
- ./heimdal/lib/hcrypto/rijndael-alg-fst.o \
- ./heimdal/lib/hcrypto/rnd_keys.o \
- ./heimdal/lib/hcrypto/sha.o \
- ./heimdal/lib/hcrypto/sha256.o \
- ./heimdal/lib/hcrypto/ui.o \
- ./heimdal/lib/hcrypto/evp.o \
- ./heimdal/lib/hcrypto/pkcs5.o \
- ./heimdal/lib/hcrypto/pkcs12.o \
- ./heimdal/lib/hcrypto/rand.o \
- ./heimdal/lib/hcrypto/rand-egd.o \
- ./heimdal/lib/hcrypto/rand-unix.o \
- ./heimdal/lib/hcrypto/rand-fortuna.o \
- ./heimdal/lib/hcrypto/rand-timer.o \
- ./heimdal/lib/hcrypto/hmac.o \
- ./heimdal/lib/hcrypto/camellia.o \
- ./heimdal/lib/hcrypto/camellia-ntt.o
+ $(heimdalsrcdir)/lib/hcrypto/aes.o \
+ $(heimdalsrcdir)/lib/hcrypto/bn.o \
+ $(heimdalsrcdir)/lib/hcrypto/dh.o \
+ $(heimdalsrcdir)/lib/hcrypto/dh-imath.o \
+ $(heimdalsrcdir)/lib/hcrypto/des.o \
+ $(heimdalsrcdir)/lib/hcrypto/dsa.o \
+ $(heimdalsrcdir)/lib/hcrypto/engine.o \
+ $(heimdalsrcdir)/lib/hcrypto/md2.o \
+ $(heimdalsrcdir)/lib/hcrypto/md4.o \
+ $(heimdalsrcdir)/lib/hcrypto/md5.o \
+ $(heimdalsrcdir)/lib/hcrypto/rsa.o \
+ $(heimdalsrcdir)/lib/hcrypto/rsa-imath.o \
+ $(heimdalsrcdir)/lib/hcrypto/rc2.o \
+ $(heimdalsrcdir)/lib/hcrypto/rc4.o \
+ $(heimdalsrcdir)/lib/hcrypto/rijndael-alg-fst.o \
+ $(heimdalsrcdir)/lib/hcrypto/rnd_keys.o \
+ $(heimdalsrcdir)/lib/hcrypto/sha.o \
+ $(heimdalsrcdir)/lib/hcrypto/sha256.o \
+ $(heimdalsrcdir)/lib/hcrypto/ui.o \
+ $(heimdalsrcdir)/lib/hcrypto/evp.o \
+ $(heimdalsrcdir)/lib/hcrypto/pkcs5.o \
+ $(heimdalsrcdir)/lib/hcrypto/pkcs12.o \
+ $(heimdalsrcdir)/lib/hcrypto/rand.o \
+ $(heimdalsrcdir)/lib/hcrypto/rand-egd.o \
+ $(heimdalsrcdir)/lib/hcrypto/rand-unix.o \
+ $(heimdalsrcdir)/lib/hcrypto/rand-fortuna.o \
+ $(heimdalsrcdir)/lib/hcrypto/rand-timer.o \
+ $(heimdalsrcdir)/lib/hcrypto/hmac.o \
+ $(heimdalsrcdir)/lib/hcrypto/camellia.o \
+ $(heimdalsrcdir)/lib/hcrypto/camellia-ntt.o
#######################
# Start SUBSYSTEM HEIMDAL_HX509
@@ -355,29 +356,29 @@ PRIVATE_DEPENDENCIES = \
#######################
HEIMDAL_HX509_OBJ_FILES = \
- ./heimdal/lib/hx509/ca.o \
- ./heimdal/lib/hx509/cert.o \
- ./heimdal/lib/hx509/cms.o \
- ./heimdal/lib/hx509/collector.o \
- ./heimdal/lib/hx509/crypto.o \
- ./heimdal/lib/hx509/error.o \
- ./heimdal/lib/hx509/env.o \
- ./heimdal/lib/hx509/file.o \
- ./heimdal/lib/hx509/keyset.o \
- ./heimdal/lib/hx509/ks_dir.o \
- ./heimdal/lib/hx509/ks_file.o \
- ./heimdal/lib/hx509/ks_keychain.o \
- ./heimdal/lib/hx509/ks_mem.o \
- ./heimdal/lib/hx509/ks_null.o \
- ./heimdal/lib/hx509/ks_p11.o \
- ./heimdal/lib/hx509/ks_p12.o \
- ./heimdal/lib/hx509/lock.o \
- ./heimdal/lib/hx509/name.o \
- ./heimdal/lib/hx509/peer.o \
- ./heimdal/lib/hx509/print.o \
- ./heimdal/lib/hx509/req.o \
- ./heimdal/lib/hx509/revoke.o \
- ./heimdal/lib/hx509/hx509_err.o
+ $(heimdalsrcdir)/lib/hx509/ca.o \
+ $(heimdalsrcdir)/lib/hx509/cert.o \
+ $(heimdalsrcdir)/lib/hx509/cms.o \
+ $(heimdalsrcdir)/lib/hx509/collector.o \
+ $(heimdalsrcdir)/lib/hx509/crypto.o \
+ $(heimdalsrcdir)/lib/hx509/error.o \
+ $(heimdalsrcdir)/lib/hx509/env.o \
+ $(heimdalsrcdir)/lib/hx509/file.o \
+ $(heimdalsrcdir)/lib/hx509/keyset.o \
+ $(heimdalsrcdir)/lib/hx509/ks_dir.o \
+ $(heimdalsrcdir)/lib/hx509/ks_file.o \
+ $(heimdalsrcdir)/lib/hx509/ks_keychain.o \
+ $(heimdalsrcdir)/lib/hx509/ks_mem.o \
+ $(heimdalsrcdir)/lib/hx509/ks_null.o \
+ $(heimdalsrcdir)/lib/hx509/ks_p11.o \
+ $(heimdalsrcdir)/lib/hx509/ks_p12.o \
+ $(heimdalsrcdir)/lib/hx509/lock.o \
+ $(heimdalsrcdir)/lib/hx509/name.o \
+ $(heimdalsrcdir)/lib/hx509/peer.o \
+ $(heimdalsrcdir)/lib/hx509/print.o \
+ $(heimdalsrcdir)/lib/hx509/req.o \
+ $(heimdalsrcdir)/lib/hx509/revoke.o \
+ $(heimdalsrcdir)/lib/hx509/hx509_err.o
#######################
# Start SUBSYSTEM HEIMDAL_WIND
@@ -387,37 +388,37 @@ PRIVATE_DEPENDENCIES = \
HEIMDAL_ROKEN HEIMDAL_COM_ERR
HEIMDAL_WIND_OBJ_FILES = \
- ./heimdal/lib/wind/wind_err.o \
- ./heimdal/lib/wind/stringprep.o \
- ./heimdal/lib/wind/errorlist.o \
- ./heimdal/lib/wind/errorlist_table.o \
- ./heimdal/lib/wind/normalize.o \
- ./heimdal/lib/wind/normalize_table.o \
- ./heimdal/lib/wind/combining.o \
- ./heimdal/lib/wind/combining_table.o \
- ./heimdal/lib/wind/utf8.o \
- ./heimdal/lib/wind/bidi.o \
- ./heimdal/lib/wind/bidi_table.o \
- ./heimdal/lib/wind/ldap.o \
- ./heimdal/lib/wind/map.o \
- ./heimdal/lib/wind/map_table.o
+ $(heimdalsrcdir)/lib/wind/wind_err.o \
+ $(heimdalsrcdir)/lib/wind/stringprep.o \
+ $(heimdalsrcdir)/lib/wind/errorlist.o \
+ $(heimdalsrcdir)/lib/wind/errorlist_table.o \
+ $(heimdalsrcdir)/lib/wind/normalize.o \
+ $(heimdalsrcdir)/lib/wind/normalize_table.o \
+ $(heimdalsrcdir)/lib/wind/combining.o \
+ $(heimdalsrcdir)/lib/wind/combining_table.o \
+ $(heimdalsrcdir)/lib/wind/utf8.o \
+ $(heimdalsrcdir)/lib/wind/bidi.o \
+ $(heimdalsrcdir)/lib/wind/bidi_table.o \
+ $(heimdalsrcdir)/lib/wind/ldap.o \
+ $(heimdalsrcdir)/lib/wind/map.o \
+ $(heimdalsrcdir)/lib/wind/map_table.o
# End SUBSYSTEM HEIMDAL_WIND
#######################
[SUBSYSTEM::HEIMDAL_ROKEN_GETPROGNAME]
CFLAGS = -Iheimdal_build -Iheimdal/lib/roken -Ilib/socket_wrapper
-HEIMDAL_ROKEN_GETPROGNAME_OBJ_FILES = ./heimdal/lib/roken/getprogname.o
+HEIMDAL_ROKEN_GETPROGNAME_OBJ_FILES = $(heimdalsrcdir)/lib/roken/getprogname.o
[SUBSYSTEM::HEIMDAL_ROKEN_CLOSEFROM]
CFLAGS = -Iheimdal_build -Iheimdal/lib/roken -Ilib/socket_wrapper
-HEIMDAL_ROKEN_CLOSEFROM_OBJ_FILES = ./heimdal/lib/roken/closefrom.o
+HEIMDAL_ROKEN_CLOSEFROM_OBJ_FILES = $(heimdalsrcdir)/lib/roken/closefrom.o
[SUBSYSTEM::HEIMDAL_ROKEN_GETPROGNAME_H]
CFLAGS = -Iheimdal_build -Iheimdal/lib/roken -Ilib/socket_wrapper
-HEIMDAL_ROKEN_GETPROGNAME_H_OBJ_FILES = ./heimdal/lib/roken/getprogname.ho
+HEIMDAL_ROKEN_GETPROGNAME_H_OBJ_FILES = $(heimdalsrcdir)/lib/roken/getprogname.ho
#######################
# Start SUBSYSTEM HEIMDAL_ROKEN
@@ -432,34 +433,34 @@ PUBLIC_DEPENDENCIES = \
#######################
HEIMDAL_ROKEN_OBJ_FILES = \
- ./heimdal/lib/roken/base64.o \
- ./heimdal/lib/roken/hex.o \
- ./heimdal/lib/roken/bswap.o \
- ./heimdal/lib/roken/dumpdata.o \
- ./heimdal/lib/roken/emalloc.o \
- ./heimdal/lib/roken/ecalloc.o \
- ./heimdal/lib/roken/get_window_size.o \
- ./heimdal/lib/roken/h_errno.o \
- ./heimdal/lib/roken/issuid.o \
- ./heimdal/lib/roken/net_read.o \
- ./heimdal/lib/roken/net_write.o \
- ./heimdal/lib/roken/socket.o \
- ./heimdal/lib/roken/parse_time.o \
- ./heimdal/lib/roken/parse_units.o \
- ./heimdal/lib/roken/resolve.o \
- ./heimdal/lib/roken/roken_gethostby.o \
- ./heimdal/lib/roken/signal.o \
- ./heimdal/lib/roken/vis.o \
- ./heimdal/lib/roken/strlwr.o \
- ./heimdal/lib/roken/strsep_copy.o \
- ./heimdal/lib/roken/strsep.o \
- ./heimdal/lib/roken/strupr.o \
- ./heimdal/lib/roken/strpool.o \
- ./heimdal/lib/roken/estrdup.o \
- ./heimdal/lib/roken/erealloc.o \
- ./heimdal/lib/roken/simple_exec.o \
- ./heimdal/lib/roken/strcollect.o \
- ./heimdal/lib/roken/rtbl.o \
+ $(heimdalsrcdir)/lib/roken/base64.o \
+ $(heimdalsrcdir)/lib/roken/hex.o \
+ $(heimdalsrcdir)/lib/roken/bswap.o \
+ $(heimdalsrcdir)/lib/roken/dumpdata.o \
+ $(heimdalsrcdir)/lib/roken/emalloc.o \
+ $(heimdalsrcdir)/lib/roken/ecalloc.o \
+ $(heimdalsrcdir)/lib/roken/get_window_size.o \
+ $(heimdalsrcdir)/lib/roken/h_errno.o \
+ $(heimdalsrcdir)/lib/roken/issuid.o \
+ $(heimdalsrcdir)/lib/roken/net_read.o \
+ $(heimdalsrcdir)/lib/roken/net_write.o \
+ $(heimdalsrcdir)/lib/roken/socket.o \
+ $(heimdalsrcdir)/lib/roken/parse_time.o \
+ $(heimdalsrcdir)/lib/roken/parse_units.o \
+ $(heimdalsrcdir)/lib/roken/resolve.o \
+ $(heimdalsrcdir)/lib/roken/roken_gethostby.o \
+ $(heimdalsrcdir)/lib/roken/signal.o \
+ $(heimdalsrcdir)/lib/roken/vis.o \
+ $(heimdalsrcdir)/lib/roken/strlwr.o \
+ $(heimdalsrcdir)/lib/roken/strsep_copy.o \
+ $(heimdalsrcdir)/lib/roken/strsep.o \
+ $(heimdalsrcdir)/lib/roken/strupr.o \
+ $(heimdalsrcdir)/lib/roken/strpool.o \
+ $(heimdalsrcdir)/lib/roken/estrdup.o \
+ $(heimdalsrcdir)/lib/roken/erealloc.o \
+ $(heimdalsrcdir)/lib/roken/simple_exec.o \
+ $(heimdalsrcdir)/lib/roken/strcollect.o \
+ $(heimdalsrcdir)/lib/roken/rtbl.o \
./heimdal_build/replace.o
#######################
@@ -481,8 +482,8 @@ PRIVATE_DEPENDENCIES = HEIMDAL_ROKEN
#######################
HEIMDAL_COM_ERR_OBJ_FILES = \
- ./heimdal/lib/com_err/com_err.o \
- ./heimdal/lib/com_err/error.o
+ $(heimdalsrcdir)/lib/com_err/com_err.o \
+ $(heimdalsrcdir)/lib/com_err/error.o
#######################
# Start SUBSYSTEM HEIMDAL_ASN1_COMPILE_LEX
@@ -491,7 +492,7 @@ CFLAGS = -Iheimdal_build -Iheimdal/lib/asn1 -Iheimdal/lib/roken -Ilib/socket_wr
# End SUBSYSTEM HEIMDAL_ASN1_COMPILE_LEX
#######################
-HEIMDAL_ASN1_COMPILE_LEX_OBJ_FILES = ./heimdal/lib/asn1/lex.ho
+HEIMDAL_ASN1_COMPILE_LEX_OBJ_FILES = $(heimdalsrcdir)/lib/asn1/lex.ho
#######################
# Start BINARY asn1_compile
@@ -501,26 +502,26 @@ USE_HOSTCC = YES
PRIVATE_DEPENDENCIES = HEIMDAL_ASN1_COMPILE_LEX HEIMDAL_ROKEN_GETPROGNAME_H LIBREPLACE_NETWORK
asn1_compile_OBJ_FILES = \
- ./heimdal/lib/asn1/main.ho \
- ./heimdal/lib/asn1/gen.ho \
- ./heimdal/lib/asn1/gen_copy.ho \
- ./heimdal/lib/asn1/gen_decode.ho \
- ./heimdal/lib/asn1/gen_encode.ho \
- ./heimdal/lib/asn1/gen_free.ho \
- ./heimdal/lib/asn1/gen_glue.ho \
- ./heimdal/lib/asn1/gen_length.ho \
- ./heimdal/lib/asn1/gen_seq.ho \
- ./heimdal/lib/asn1/hash.ho \
- ./heimdal/lib/asn1/parse.ho \
- ./heimdal/lib/roken/emalloc.ho \
- ./heimdal/lib/roken/getarg.ho \
- ./heimdal/lib/roken/setprogname.ho \
- ./heimdal/lib/roken/strupr.ho \
- ./heimdal/lib/roken/get_window_size.ho \
- ./heimdal/lib/roken/estrdup.ho \
- ./heimdal/lib/roken/ecalloc.ho \
- ./heimdal/lib/asn1/symbol.ho \
- ./heimdal/lib/vers/print_version.ho \
+ $(heimdalsrcdir)/lib/asn1/main.ho \
+ $(heimdalsrcdir)/lib/asn1/gen.ho \
+ $(heimdalsrcdir)/lib/asn1/gen_copy.ho \
+ $(heimdalsrcdir)/lib/asn1/gen_decode.ho \
+ $(heimdalsrcdir)/lib/asn1/gen_encode.ho \
+ $(heimdalsrcdir)/lib/asn1/gen_free.ho \
+ $(heimdalsrcdir)/lib/asn1/gen_glue.ho \
+ $(heimdalsrcdir)/lib/asn1/gen_length.ho \
+ $(heimdalsrcdir)/lib/asn1/gen_seq.ho \
+ $(heimdalsrcdir)/lib/asn1/hash.ho \
+ $(heimdalsrcdir)/lib/asn1/parse.ho \
+ $(heimdalsrcdir)/lib/roken/emalloc.ho \
+ $(heimdalsrcdir)/lib/roken/getarg.ho \
+ $(heimdalsrcdir)/lib/roken/setprogname.ho \
+ $(heimdalsrcdir)/lib/roken/strupr.ho \
+ $(heimdalsrcdir)/lib/roken/get_window_size.ho \
+ $(heimdalsrcdir)/lib/roken/estrdup.ho \
+ $(heimdalsrcdir)/lib/roken/ecalloc.ho \
+ $(heimdalsrcdir)/lib/asn1/symbol.ho \
+ $(heimdalsrcdir)/lib/vers/print_version.ho \
./lib/socket_wrapper/socket_wrapper.ho \
./heimdal_build/replace.ho
@@ -534,7 +535,7 @@ CFLAGS = -Iheimdal_build -Iheimdal/lib/com_err -Iheimdal/lib/roken -Ilib/socket
# End SUBSYSTEM HEIMDAL_COM_ERR_COMPILE_LEX
#######################
-HEIMDAL_COM_ERR_COMPILE_LEX_OBJ_FILES = ./heimdal/lib/com_err/lex.ho
+HEIMDAL_COM_ERR_COMPILE_LEX_OBJ_FILES = $(heimdalsrcdir)/lib/com_err/lex.ho
#######################
# Start BINARY compile_et
@@ -545,13 +546,13 @@ PRIVATE_DEPENDENCIES = HEIMDAL_COM_ERR_COMPILE_LEX HEIMDAL_ROKEN_GETPROGNAME_H L
# End BINARY compile_et
#######################
-compile_et_OBJ_FILES = ./heimdal/lib/vers/print_version.ho \
- ./heimdal/lib/com_err/parse.ho \
- ./heimdal/lib/com_err/compile_et.ho \
- ./heimdal/lib/roken/getarg.ho \
- ./heimdal/lib/roken/get_window_size.ho \
- ./heimdal/lib/roken/strupr.ho \
- ./heimdal/lib/roken/setprogname.ho \
+compile_et_OBJ_FILES = $(heimdalsrcdir)/lib/vers/print_version.ho \
+ $(heimdalsrcdir)/lib/com_err/parse.ho \
+ $(heimdalsrcdir)/lib/com_err/compile_et.ho \
+ $(heimdalsrcdir)/lib/roken/getarg.ho \
+ $(heimdalsrcdir)/lib/roken/get_window_size.ho \
+ $(heimdalsrcdir)/lib/roken/strupr.ho \
+ $(heimdalsrcdir)/lib/roken/setprogname.ho \
./lib/socket_wrapper/socket_wrapper.ho \
./heimdal_build/replace.ho
@@ -596,7 +597,7 @@ PUBLIC_DEPENDENCIES = \
# End SUBSYSTEM HEIMDAL
#######################
-HEIMDAL_OBJ_FILES = ./heimdal/lib/vers/print_version.o
+HEIMDAL_OBJ_FILES = $(heimdalsrcdir)/lib/vers/print_version.o
#######################
# Start BINARY compile_et
@@ -606,10 +607,10 @@ PRIVATE_DEPENDENCIES = HEIMDAL_KRB5 HEIMDAL_NTLM
# End BINARY compile_et
#######################
-samba4kinit_OBJ_FILES = ./heimdal/kuser/kinit.o \
- ./heimdal/lib/vers/print_version.o \
- ./heimdal/lib/roken/setprogname.o \
- ./heimdal/lib/roken/getarg.o
+samba4kinit_OBJ_FILES = $(heimdalsrcdir)/kuser/kinit.o \
+ $(heimdalsrcdir)/lib/vers/print_version.o \
+ $(heimdalsrcdir)/lib/roken/setprogname.o \
+ $(heimdalsrcdir)/lib/roken/getarg.o
-dist:: heimdal/lib/asn1/lex.c heimdal/lib/com_err/lex.c \
- heimdal/lib/asn1/parse.c heimdal/lib/com_err/parse.c
+dist:: $(heimdalsrcdir)/lib/asn1/lex.c $(heimdalsrcdir)/lib/com_err/lex.c \
+ $(heimdalsrcdir)/lib/asn1/parse.c $(heimdalsrcdir)/lib/com_err/parse.c
diff --git a/source4/kdc/config.mk b/source4/kdc/config.mk
index 7a96cf6432..b3b8b216f0 100644
--- a/source4/kdc/config.mk
+++ b/source4/kdc/config.mk
@@ -10,17 +10,17 @@ PRIVATE_DEPENDENCIES = \
# End SUBSYSTEM KDC
#######################
-KDC_OBJ_FILES = $(addprefix kdc/, kdc.o kpasswdd.o)
+KDC_OBJ_FILES = $(addprefix $(kdcsrcdir)/, kdc.o kpasswdd.o)
#######################
# Start SUBSYSTEM KDC
[SUBSYSTEM::HDB_LDB]
CFLAGS = -Iheimdal/kdc -Iheimdal/lib/hdb
-PRIVATE_PROTO_HEADER = pac_glue.h
PRIVATE_DEPENDENCIES = \
LIBLDB auth_sam auth_sam_reply HEIMDAL CREDENTIALS \
HEIMDAL_HDB_ASN1
# End SUBSYSTEM KDC
#######################
-HDB_LDB_OBJ_FILES = $(addprefix kdc/, hdb-ldb.o pac-glue.o)
+HDB_LDB_OBJ_FILES = $(addprefix $(kdcsrcdir)/, hdb-ldb.o pac-glue.o)
+$(eval $(call proto_header_template,$(kdcsrcdir)/pac_glue.h,$(HDB_LDB_OBJ_FILES:.o=.c)))
diff --git a/source4/ldap_server/config.mk b/source4/ldap_server/config.mk
index 47eb85cab9..65f5b17f9a 100644
--- a/source4/ldap_server/config.mk
+++ b/source4/ldap_server/config.mk
@@ -5,7 +5,6 @@
[MODULE::LDAP]
INIT_FUNCTION = server_service_ldap_init
SUBSYSTEM = smbd
-PRIVATE_PROTO_HEADER = proto.h
PRIVATE_DEPENDENCIES = CREDENTIALS \
LIBCLI_LDAP SAMDB \
process_model \
@@ -14,9 +13,10 @@ PRIVATE_DEPENDENCIES = CREDENTIALS \
# End SUBSYSTEM SMB
#######################
-LDAP_OBJ_FILES = $(addprefix ldap_server/, \
+LDAP_OBJ_FILES = $(addprefix $(ldap_serversrcdir)/, \
ldap_server.o \
ldap_backend.o \
ldap_bind.o \
ldap_extended.o)
+$(eval $(call proto_header_template,$(ldap_serversrcdir)/proto.h,$(LDAP_OBJ_FILES:.o=.c)))
diff --git a/source4/lib/appweb/config.mk b/source4/lib/appweb/config.mk
index c0bba35ba5..4d27b69fb5 100644
--- a/source4/lib/appweb/config.mk
+++ b/source4/lib/appweb/config.mk
@@ -4,7 +4,7 @@
# End SUBSYSTEM MPR
#######################
-MPR_OBJ_FILES = $(addprefix lib/appweb/mpr/, miniMpr.o var.o)
+MPR_OBJ_FILES = $(addprefix $(appwebsrcdir)/mpr/, miniMpr.o var.o)
#######################
# Start SUBSYSTEM EJS
@@ -13,7 +13,7 @@ PUBLIC_DEPENDENCIES = MPR
# End SUBSYSTEM EJS
#######################
-EJS_OBJ_FILES = $(addprefix lib/appweb/ejs/, ejsLib.o ejsLex.o ejsParser.o ejsProcs.o)
+EJS_OBJ_FILES = $(addprefix $(appwebsrcdir)/ejs/, ejsLib.o ejsLex.o ejsParser.o ejsProcs.o)
#######################
# Start SUBSYSTEM ESP
@@ -22,4 +22,4 @@ PUBLIC_DEPENDENCIES = EJS
# End SUBSYSTEM ESP
#######################
-ESP_OBJ_FILES = $(addprefix lib/appweb/esp/, esp.o espProcs.o)
+ESP_OBJ_FILES = $(addprefix $(appwebsrcdir)/esp/, esp.o espProcs.o)
diff --git a/source4/lib/basic.mk b/source4/lib/basic.mk
index e7e0ba80c4..b86df5dc9f 100644
--- a/source4/lib/basic.mk
+++ b/source4/lib/basic.mk
@@ -1,45 +1,25 @@
-# LIB BASIC subsystem
-mkinclude samba3/config.mk
-mkinclude socket/config.mk
-mkinclude charset/config.mk
-mkinclude ldb-samba/config.mk
-mkinclude tls/config.mk
-mkinclude registry/config.mk
-mkinclude messaging/config.mk
-mkinclude events/config.mk
-mkinclude cmdline/config.mk
-mkinclude socket_wrapper/config.mk
-mkinclude nss_wrapper/config.mk
-mkinclude appweb/config.mk
-mkinclude stream/config.mk
-mkinclude util/config.mk
-mkinclude tdr/config.mk
-mkinclude dbwrap/config.mk
-mkinclude crypto/config.mk
-mkinclude torture/config.mk
-
[SUBSYSTEM::LIBCOMPRESSION]
-LIBCOMPRESSION_OBJ_FILES = lib/compression/mszip.o
+LIBCOMPRESSION_OBJ_FILES = $(libcompressionsrcdir)/mszip.o
[SUBSYSTEM::GENCACHE]
PRIVATE_DEPENDENCIES = TDB_WRAP
-GENCACHE_OBJ_FILES = gencache/gencache.o
+GENCACHE_OBJ_FILES = $(libgencachesrcdir)/gencache.o
-# PUBLIC_HEADERS += lib/gencache/gencache.h
+# PUBLIC_HEADERS += $(libgencachesrcdir)/gencache.h
[SUBSYSTEM::LDB_WRAP]
PUBLIC_DEPENDENCIES = LIBLDB
PRIVATE_DEPENDENCIES = LDBSAMBA UTIL_LDB
-LDB_WRAP_OBJ_FILES = lib/ldb_wrap.o
-PUBLIC_HEADERS += lib/ldb_wrap.h
+LDB_WRAP_OBJ_FILES = $(libsrcdir)/ldb_wrap.o
+PUBLIC_HEADERS += $(libsrcdir)/ldb_wrap.h
[SUBSYSTEM::TDB_WRAP]
PUBLIC_DEPENDENCIES = LIBTDB
-TDB_WRAP_OBJ_FILES = lib/tdb_wrap.o
-PUBLIC_HEADERS += lib/tdb_wrap.h
+TDB_WRAP_OBJ_FILES = $(libsrcdir)/tdb_wrap.o
+PUBLIC_HEADERS += $(libsrcdir)/tdb_wrap.h
SMBREADLINE_OBJ_LIST = $(SMBREADLINE_OBJ_FILES)
diff --git a/source4/lib/charset/config.mk b/source4/lib/charset/config.mk
index e5e5bd4560..12c2f5f321 100644
--- a/source4/lib/charset/config.mk
+++ b/source4/lib/charset/config.mk
@@ -1,12 +1,13 @@
################################################
# Start SUBSYSTEM CHARSET
[SUBSYSTEM::CHARSET]
-PRIVATE_PROTO_HEADER = charset_proto.h
PUBLIC_DEPENDENCIES = ICONV
PRIVATE_DEPENDENCIES = DYNCONFIG
# End SUBSYSTEM CHARSET
################################################
-CHARSET_OBJ_FILES = $(addprefix lib/charset/, iconv.o charcnv.o util_unistr.o)
+CHARSET_OBJ_FILES = $(addprefix $(libcharsetsrcdir)/, iconv.o charcnv.o util_unistr.o)
-PUBLIC_HEADERS += lib/charset/charset.h
+PUBLIC_HEADERS += $(libcharsetsrcdir)/charset.h
+
+$(eval $(call proto_header_template,$(libcharsetsrcdir)/charset_proto.h,$(CHARSET_OBJ_FILES:.o=.c)))
diff --git a/source4/lib/cmdline/config.mk b/source4/lib/cmdline/config.mk
index f8a971a063..4434ff3701 100644
--- a/source4/lib/cmdline/config.mk
+++ b/source4/lib/cmdline/config.mk
@@ -1,19 +1,21 @@
[SUBSYSTEM::LIBCMDLINE_CREDENTIALS]
-PRIVATE_PROTO_HEADER = credentials.h
PUBLIC_DEPENDENCIES = CREDENTIALS LIBPOPT
-LIBCMDLINE_CREDENTIALS_OBJ_FILES = lib/cmdline/credentials.o
+LIBCMDLINE_CREDENTIALS_OBJ_FILES = $(libcmdlinesrcdir)/credentials.o
+
+$(eval $(call proto_header_template,$(libcmdlinesrcdir)/credentials.h,$(LIBCMDLINE_CREDENTIALS_OBJ_FILES:.o=.c)))
[SUBSYSTEM::POPT_SAMBA]
PUBLIC_DEPENDENCIES = LIBPOPT
-POPT_SAMBA_OBJ_FILES = lib/cmdline/popt_common.o
+POPT_SAMBA_OBJ_FILES = $(libcmdlinesrcdir)/popt_common.o
-PUBLIC_HEADERS += lib/cmdline/popt_common.h
+PUBLIC_HEADERS += $(libcmdlinesrcdir)/popt_common.h
[SUBSYSTEM::POPT_CREDENTIALS]
-PRIVATE_PROTO_HEADER = popt_credentials.h
PUBLIC_DEPENDENCIES = CREDENTIALS LIBCMDLINE_CREDENTIALS LIBPOPT
PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL
-POPT_CREDENTIALS_OBJ_FILES = lib/cmdline/popt_credentials.o
+POPT_CREDENTIALS_OBJ_FILES = $(libcmdlinesrcdir)/popt_credentials.o
+
+$(eval $(call proto_header_template,$(libcmdlinesrcdir)/popt_credentials.h,$(POPT_CREDENTIALS_OBJ_FILES:.o=.c)))
diff --git a/source4/lib/crypto/config.mk b/source4/lib/crypto/config.mk
index 8e0cba17f0..b9a7f7cb9e 100644
--- a/source4/lib/crypto/config.mk
+++ b/source4/lib/crypto/config.mk
@@ -4,7 +4,7 @@
# End SUBSYSTEM LIBCRYPTO
##############################
-LIBCRYPTO_OBJ_FILES = $(addprefix lib/crypto/, \
+LIBCRYPTO_OBJ_FILES = $(addprefix $(libcryptosrcdir)/, \
crc32.o md5.o hmacmd5.o md4.o \
arcfour.o sha1.o hmacsha1.o)
@@ -12,8 +12,8 @@ LIBCRYPTO_OBJ_FILES = $(addprefix lib/crypto/, \
[MODULE::TORTURE_LIBCRYPTO]
SUBSYSTEM = smbtorture
PRIVATE_DEPENDENCIES = LIBCRYPTO
-PRIVATE_PROTO_HEADER = test_proto.h
-TORTURE_LIBCRYPTO_OBJ_FILES = $(addprefix lib/crypto/, \
+TORTURE_LIBCRYPTO_OBJ_FILES = $(addprefix $(libcryptosrcdir)/, \
md4test.o md5test.o hmacmd5test.o sha1test.o hmacsha1test.o)
+$(eval $(call proto_header_template,$(libcryptosrcdir)/test_proto.h,$(TORTURE_LIBCRYPTO_OBJ_FILES:.o=.c)))
diff --git a/source4/lib/dbwrap/config.mk b/source4/lib/dbwrap/config.mk
index 9038873d32..34e2629b16 100644
--- a/source4/lib/dbwrap/config.mk
+++ b/source4/lib/dbwrap/config.mk
@@ -2,5 +2,5 @@
PUBLIC_DEPENDENCIES = \
LIBTDB ctdb
-LIBDBWRAP_OBJ_FILES = $(addprefix lib/dbwrap/, dbwrap.o dbwrap_tdb.o dbwrap_ctdb.o)
+LIBDBWRAP_OBJ_FILES = $(addprefix $(libdbwrapsrcdir)/, dbwrap.o dbwrap_tdb.o dbwrap_ctdb.o)
diff --git a/source4/lib/events/config.mk b/source4/lib/events/config.mk
index 34c24f76f5..3a20770427 100644
--- a/source4/lib/events/config.mk
+++ b/source4/lib/events/config.mk
@@ -15,7 +15,7 @@ SUBSYSTEM = LIBEVENTS
INIT_FUNCTION = s4_events_aio_init
##############################
-EVENTS_AIO_OBJ_FILES = lib/events/events_aio.o
+EVENTS_AIO_OBJ_FILES = $(libeventssrcdir)/events_aio.o
##############################
[MODULE::EVENTS_EPOLL]
@@ -23,7 +23,7 @@ SUBSYSTEM = LIBEVENTS
INIT_FUNCTION = s4_events_epoll_init
##############################
-EVENTS_EPOLL_OBJ_FILES = lib/events/events_epoll.o
+EVENTS_EPOLL_OBJ_FILES = $(libeventssrcdir)/events_epoll.o
##############################
[MODULE::EVENTS_SELECT]
@@ -31,7 +31,7 @@ SUBSYSTEM = LIBEVENTS
INIT_FUNCTION = s4_events_select_init
##############################
-EVENTS_SELECT_OBJ_FILES = lib/events/events_select.o
+EVENTS_SELECT_OBJ_FILES = $(libeventssrcdir)/events_select.o
##############################
[MODULE::EVENTS_STANDARD]
@@ -39,7 +39,7 @@ SUBSYSTEM = LIBEVENTS
INIT_FUNCTION = s4_events_standard_init
##############################
-EVENTS_STANDARD_OBJ_FILES = lib/events/events_standard.o
+EVENTS_STANDARD_OBJ_FILES = $(libeventssrcdir)/events_standard.o
##############################
# Start SUBSYSTEM LIBEVENTS
@@ -47,12 +47,12 @@ EVENTS_STANDARD_OBJ_FILES = lib/events/events_standard.o
# End SUBSYSTEM LIBEVENTS
##############################
-LIBEVENTS_OBJ_FILES = $(addprefix lib/events/, events.o events_timed.o events_signal.o)
+LIBEVENTS_OBJ_FILES = $(addprefix $(libeventssrcdir)/, events.o events_timed.o events_signal.o)
-PUBLIC_HEADERS += $(addprefix lib/events/, events.h events_internal.h)
+PUBLIC_HEADERS += $(addprefix $(libeventssrcdir)/, events.h events_internal.h)
[PYTHON::swig_events]
SWIG_FILE = events.i
PRIVATE_DEPENDENCIES = LIBEVENTS LIBSAMBA-HOSTCONFIG
-swig_events_OBJ_FILES = lib/events/events_wrap.o
+swig_events_OBJ_FILES = $(libeventssrcdir)/events_wrap.o
diff --git a/source4/lib/ldb-samba/config.mk b/source4/lib/ldb-samba/config.mk
index 6a0b842fff..84007f3833 100644
--- a/source4/lib/ldb-samba/config.mk
+++ b/source4/lib/ldb-samba/config.mk
@@ -2,10 +2,10 @@
# Start SUBSYSTEM LDBSAMBA
[SUBSYSTEM::LDBSAMBA]
PUBLIC_DEPENDENCIES = LIBLDB
-PRIVATE_PROTO_HEADER = ldif_handlers.h
PRIVATE_DEPENDENCIES = LIBSECURITY SAMDB_SCHEMA LIBNDR NDR_MISC
# End SUBSYSTEM LDBSAMBA
################################################
-LDBSAMBA_OBJ_FILES = lib/ldb-samba/ldif_handlers.o
+LDBSAMBA_OBJ_FILES = $(ldb_sambasrcdir)/ldif_handlers.o
+$(eval $(call proto_header_template,$(ldb_sambasrcdir)/ldif_handlers.h,$(LDBSAMBA_OBJ_FILES:.o=.c)))
diff --git a/source4/lib/ldb/tests/python/ldap.py b/source4/lib/ldb/tests/python/ldap.py
index ead5796b7b..7cbe6e5e7d 100755
--- a/source4/lib/ldb/tests/python/ldap.py
+++ b/source4/lib/ldb/tests/python/ldap.py
@@ -6,6 +6,8 @@ import getopt
import optparse
import sys
+sys.path.append("bin/python")
+
import samba.getopt as options
from auth import system_session
diff --git a/source4/lib/ldb_wrap.c b/source4/lib/ldb_wrap.c
index b564976524..f47d0d5d39 100644
--- a/source4/lib/ldb_wrap.c
+++ b/source4/lib/ldb_wrap.c
@@ -44,7 +44,7 @@ static void ldb_wrap_debug(void *context, enum ldb_debug_level level,
static void ldb_wrap_debug(void *context, enum ldb_debug_level level,
const char *fmt, va_list ap)
{
- int samba_level;
+ int samba_level = -1;
char *s = NULL;
switch (level) {
case LDB_DEBUG_FATAL:
diff --git a/source4/lib/messaging/config.mk b/source4/lib/messaging/config.mk
index 0a0097bdf3..eaf7e3581e 100644
--- a/source4/lib/messaging/config.mk
+++ b/source4/lib/messaging/config.mk
@@ -13,5 +13,4 @@ PUBLIC_DEPENDENCIES = \
# End SUBSYSTEM MESSAGING
################################################
-
-MESSAGING_OBJ_FILES = lib/messaging/messaging.o
+MESSAGING_OBJ_FILES = $(libmessagingsrcdir)/messaging.o
diff --git a/source4/lib/nss_wrapper/config.mk b/source4/lib/nss_wrapper/config.mk
index 5f136a465d..015fbe511c 100644
--- a/source4/lib/nss_wrapper/config.mk
+++ b/source4/lib/nss_wrapper/config.mk
@@ -4,4 +4,4 @@
# End SUBSYSTEM NSS_WRAPPER
##############################
-NSS_WRAPPER_OBJ_FILES = lib/nss_wrapper/nss_wrapper.o
+NSS_WRAPPER_OBJ_FILES = $(nsswrappersrcdir)/nss_wrapper.o
diff --git a/source4/lib/registry/config.mk b/source4/lib/registry/config.mk
index ce19d8512e..c0ad613c52 100644
--- a/source4/lib/registry/config.mk
+++ b/source4/lib/registry/config.mk
@@ -1,19 +1,19 @@
[SUBSYSTEM::TDR_REGF]
PUBLIC_DEPENDENCIES = TDR
-TDR_REGF_OBJ_FILES = lib/registry/tdr_regf.o
+TDR_REGF_OBJ_FILES = $(libregistrysrcdir)/tdr_regf.o
# Special support for external builddirs
-lib/registry/regf.c: lib/registry/tdr_regf.c
-$(srcdir)/lib/registry/regf.c: lib/registry/tdr_regf.c
-lib/registry/tdr_regf.h: lib/registry/tdr_regf.c
-lib/registry/tdr_regf.c: $(srcdir)/lib/registry/regf.idl
+$(libregistrysrcdir)/regf.c: $(libregistrysrcdir)/tdr_regf.c
+$(srcdir)/$(libregistrysrcdir)/regf.c: $(libregistrysrcdir)/tdr_regf.c
+$(libregistrysrcdir)/tdr_regf.h: $(libregistrysrcdir)/tdr_regf.c
+$(libregistrysrcdir)/tdr_regf.c: $(srcdir)/$(libregistrysrcdir)/regf.idl
@CPP="$(CPP)" srcdir="$(srcdir)" $(PERL) $(srcdir)/pidl/pidl $(PIDL_ARGS) \
--header --outputdir=lib/registry \
- --tdr-parser -- $(srcdir)/lib/registry/regf.idl
+ --tdr-parser -- $(srcdir)/$(libregistrysrcdir)/regf.idl
clean::
- @-rm -f lib/registry/regf.h lib/registry/tdr_regf*
+ @-rm -f $(libregistrysrcdir)/regf.h $(libregistrysrcdir)/tdr_regf*
################################################
# Start SUBSYSTEM registry
@@ -24,22 +24,23 @@ PUBLIC_DEPENDENCIES = \
# End MODULE registry_ldb
################################################
-PC_FILES += lib/registry/registry.pc
+PC_FILES += $(libregistrysrcdir)/registry.pc
registry_VERSION = 0.0.1
registry_SOVERSION = 0
-registry_OBJ_FILES = $(addprefix lib/registry/, interface.o util.o samba.o \
+registry_OBJ_FILES = $(addprefix $(libregistrysrcdir)/, interface.o util.o samba.o \
patchfile_dotreg.o patchfile_preg.o patchfile.o regf.o \
hive.o local.o ldb.o dir.o rpc.o)
-PUBLIC_HEADERS += lib/registry/registry.h
+PUBLIC_HEADERS += $(libregistrysrcdir)/registry.h
[SUBSYSTEM::registry_common]
PUBLIC_DEPENDENCIES = registry
-PRIVATE_PROTO_HEADER = tools/common.h
-registry_common_OBJ_FILES = lib/registry/tools/common.o
+registry_common_OBJ_FILES = $(libregistrysrcdir)/tools/common.o
+
+$(eval $(call proto_header_template,$(libregistrysrcdir)/tools/common.h,$(registry_common_OBJ_FILES:.o=.c)))
################################################
# Start BINARY regdiff
@@ -50,9 +51,9 @@ PRIVATE_DEPENDENCIES = \
# End BINARY regdiff
################################################
-regdiff_OBJ_FILES = lib/registry/tools/regdiff.o
+regdiff_OBJ_FILES = $(libregistrysrcdir)/tools/regdiff.o
-MANPAGES += lib/registry/man/regdiff.1
+MANPAGES += $(libregistrysrcdir)/man/regdiff.1
################################################
# Start BINARY regpatch
@@ -64,9 +65,9 @@ PRIVATE_DEPENDENCIES = \
# End BINARY regpatch
################################################
-regpatch_OBJ_FILES = lib/registry/tools/regpatch.o
+regpatch_OBJ_FILES = $(libregistrysrcdir)/tools/regpatch.o
-MANPAGES += lib/registry/man/regpatch.1
+MANPAGES += $(libregistrysrcdir)/man/regpatch.1
################################################
# Start BINARY regshell
@@ -78,9 +79,9 @@ PRIVATE_DEPENDENCIES = \
# End BINARY regshell
################################################
-regshell_OBJ_FILES = lib/registry/tools/regshell.o
+regshell_OBJ_FILES = $(libregistrysrcdir)/tools/regshell.o
-MANPAGES += lib/registry/man/regshell.1
+MANPAGES += $(libregistrysrcdir)/man/regshell.1
################################################
# Start BINARY regtree
@@ -92,18 +93,19 @@ PRIVATE_DEPENDENCIES = \
# End BINARY regtree
################################################
-regtree_OBJ_FILES = lib/registry/tools/regtree.o
+regtree_OBJ_FILES = $(libregistrysrcdir)/tools/regtree.o
-MANPAGES += lib/registry/man/regtree.1
+MANPAGES += $(libregistrysrcdir)/man/regtree.1
[SUBSYSTEM::torture_registry]
PRIVATE_DEPENDENCIES = registry
-PRIVATE_PROTO_HEADER = tests/proto.h
-torture_registry_OBJ_FILES = $(addprefix lib/registry/tests/, generic.o hive.o diff.o registry.o)
+torture_registry_OBJ_FILES = $(addprefix $(libregistrysrcdir)/tests/, generic.o hive.o diff.o registry.o)
+
+$(eval $(call proto_header_template,$(libregistrysrcdir)/tests/proto.h,$(torture_registry_OBJ_FILES:.o=.c)))
[PYTHON::swig_registry]
PUBLIC_DEPENDENCIES = registry
SWIG_FILE = registry.i
-swig_registry_OBJ_FILES = lib/registry/registry_wrap.o
+swig_registry_OBJ_FILES = $(libregistrysrcdir)/registry_wrap.o
diff --git a/source4/lib/replace/libreplace.m4 b/source4/lib/replace/libreplace.m4
index 2b33d97989..6a85ff5a82 100644
--- a/source4/lib/replace/libreplace.m4
+++ b/source4/lib/replace/libreplace.m4
@@ -96,7 +96,6 @@ fi
AC_CHECK_HEADERS(sys/syslog.h syslog.h)
AC_CHECK_HEADERS(sys/time.h time.h)
AC_CHECK_HEADERS(stdarg.h vararg.h)
-AC_CHECK_HEADERS(sys/sockio.h sys/un.h)
AC_CHECK_HEADERS(sys/mount.h mntent.h)
AC_CHECK_HEADERS(stropts.h)
diff --git a/source4/lib/replace/libreplace_network.m4 b/source4/lib/replace/libreplace_network.m4
index 5ab71f160a..f2d177b165 100644
--- a/source4/lib/replace/libreplace_network.m4
+++ b/source4/lib/replace/libreplace_network.m4
@@ -8,6 +8,7 @@ LIBREPLACE_NETWORK_LIBS=""
AC_CHECK_HEADERS(sys/socket.h netinet/in.h netdb.h arpa/inet.h)
AC_CHECK_HEADERS(netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/in_ip.h)
+AC_CHECK_HEADERS(sys/sockio.h sys/un.h)
dnl we need to check that net/if.h really can be used, to cope with hpux
dnl where including it always fails
@@ -62,6 +63,46 @@ AC_CHECK_MEMBER(struct sockaddr_storage.__ss_family,
fi
fi
+AC_CACHE_CHECK([for sin_len in sock],libreplace_cv_HAVE_SOCK_SIN_LEN,[
+ AC_TRY_COMPILE(
+ [
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+ ],[
+struct sockaddr_in sock; sock.sin_len = sizeof(sock);
+ ],[
+ libreplace_cv_HAVE_SOCK_SIN_LEN=yes
+ ],[
+ libreplace_cv_HAVE_SOCK_SIN_LEN=no
+ ])
+])
+if test x"$libreplace_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
+ AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
+fi
+
+############################################
+# check for unix domain sockets
+AC_CACHE_CHECK([for unix domain sockets],libreplace_cv_HAVE_UNIXSOCKET,[
+ AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+ ],[
+struct sockaddr_un sunaddr;
+sunaddr.sun_family = AF_UNIX;
+ ],[
+ libreplace_cv_HAVE_UNIXSOCKET=yes
+ ],[
+ libreplace_cv_HAVE_UNIXSOCKET=no
+ ])
+])
+if test x"$libreplace_cv_HAVE_UNIXSOCKET" = x"yes"; then
+ AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixscoket support])
+fi
+
dnl The following test is roughl taken from the cvs sources.
dnl
dnl If we can't find connect, try looking in -lsocket, -lnsl, and -linet.
diff --git a/source4/lib/samba3/config.mk b/source4/lib/samba3/config.mk
index d33b38cab0..e089149393 100644
--- a/source4/lib/samba3/config.mk
+++ b/source4/lib/samba3/config.mk
@@ -1,9 +1,10 @@
################################################
# Start SUBSYSTEM LIBSAMBA3
[SUBSYSTEM::SMBPASSWD]
-PRIVATE_PROTO_HEADER = samba3_smbpasswd_proto.h
PRIVATE_DEPENDENCIES = CHARSET LIBSAMBA-UTIL
# End SUBSYSTEM LIBSAMBA3
################################################
-SMBPASSWD_OBJ_FILES = lib/samba3/smbpasswd.o
+SMBPASSWD_OBJ_FILES = $(libsrcdir)/samba3/smbpasswd.o
+
+$(eval $(call proto_header_template,$(libsrcdir)/samba3/samba3_smbpasswd_proto.h,$(SMBPASSWD_OBJ_FILES:.o=.c)))
diff --git a/source4/lib/socket/config.m4 b/source4/lib/socket/config.m4
index b40002b321..871c57f97c 100644
--- a/source4/lib/socket/config.m4
+++ b/source4/lib/socket/config.m4
@@ -1,44 +1,12 @@
AC_CHECK_FUNCS(writev)
AC_CHECK_FUNCS(readv)
-AC_CACHE_CHECK([for sin_len in sock],samba_cv_HAVE_SOCK_SIN_LEN,[
-AC_TRY_COMPILE([#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>],
-[struct sockaddr_in sock; sock.sin_len = sizeof(sock);],
-samba_cv_HAVE_SOCK_SIN_LEN=yes,samba_cv_HAVE_SOCK_SIN_LEN=no)])
-if test x"$samba_cv_HAVE_SOCK_SIN_LEN" = x"yes"; then
- AC_DEFINE(HAVE_SOCK_SIN_LEN,1,[Whether the sockaddr_in struct has a sin_len property])
-fi
-
############################################
# check for unix domain sockets
-AC_CACHE_CHECK([for unix domain sockets],samba_cv_unixsocket, [
- AC_TRY_COMPILE([
-#include <sys/types.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <sys/socket.h>
-#include <sys/un.h>],
-[
- struct sockaddr_un sunaddr;
- sunaddr.sun_family = AF_UNIX;
-],
- samba_cv_unixsocket=yes,samba_cv_unixsocket=no)])
+# done by AC_LIBREPLACE_NETWORK_CHECKS
SMB_ENABLE(socket_unix, NO)
-if test x"$samba_cv_unixsocket" = x"yes"; then
- SMB_ENABLE(socket_unix, YES)
- AC_DEFINE(HAVE_UNIXSOCKET,1,[If we need to build with unixscoket support])
-fi
-
-AC_CACHE_CHECK([for AF_LOCAL socket support], samba_cv_HAVE_WORKING_AF_LOCAL, [
-AC_TRY_RUN([#include "${srcdir-.}/build/tests/unixsock.c"],
- samba_cv_HAVE_WORKING_AF_LOCAL=yes,
- samba_cv_HAVE_WORKING_AF_LOCAL=no,
- samba_cv_HAVE_WORKING_AF_LOCAL=cross)])
-if test x"$samba_cv_HAVE_WORKING_AF_LOCAL" != xno
-then
- AC_DEFINE(HAVE_WORKING_AF_LOCAL, 1, [Define if you have working AF_LOCAL sockets])
+if test x"$libreplace_cv_HAVE_UNIXSOCKET" = x"yes"; then
+ SMB_ENABLE(socket_unix, YES)
fi
dnl test for ipv6 using the gethostbyname2() function. That should be sufficient
diff --git a/source4/lib/socket/config.mk b/source4/lib/socket/config.mk
index 2400190175..18aa806e41 100644
--- a/source4/lib/socket/config.mk
+++ b/source4/lib/socket/config.mk
@@ -1,12 +1,13 @@
##############################
# Start SUBSYSTEM LIBNETIF
[SUBSYSTEM::LIBNETIF]
-PRIVATE_PROTO_HEADER = netif_proto.h
PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL LIBREPLACE_NETWORK
# End SUBSYSTEM LIBNETIF
##############################
-LIBNETIF_OBJ_FILES = $(addprefix lib/socket/, interface.o netif.o)
+LIBNETIF_OBJ_FILES = $(addprefix $(libsocketsrcdir)/, interface.o netif.o)
+
+$(eval $(call proto_header_template,$(libsocketsrcdir)/netif_proto.h,$(LIBNETIF_OBJ_FILES:.o=.c)))
################################################
# Start MODULE socket_ip
@@ -17,7 +18,7 @@ PRIVATE_DEPENDENCIES = LIBSAMBA-ERRORS LIBREPLACE_NETWORK
# End MODULE socket_ip
################################################
-socket_ip_OBJ_FILES = lib/socket/socket_ip.o
+socket_ip_OBJ_FILES = $(libsocketsrcdir)/socket_ip.o
################################################
# Start MODULE socket_unix
@@ -28,7 +29,7 @@ PRIVATE_DEPENDENCIES = LIBREPLACE_NETWORK
# End MODULE socket_unix
################################################
-socket_unix_OBJ_FILES = lib/socket/socket_unix.o
+socket_unix_OBJ_FILES = $(libsocketsrcdir)/socket_unix.o
################################################
# Start SUBSYSTEM SOCKET
@@ -38,5 +39,5 @@ PRIVATE_DEPENDENCIES = SOCKET_WRAPPER LIBCLI_COMPOSITE LIBCLI_RESOLVE
# End SUBSYSTEM SOCKET
################################################
-samba-socket_OBJ_FILES = $(addprefix lib/socket/, socket.o access.o connect_multi.o connect.o)
+samba-socket_OBJ_FILES = $(addprefix $(libsocketsrcdir)/, socket.o access.o connect_multi.o connect.o)
diff --git a/source4/lib/socket_wrapper/config.mk b/source4/lib/socket_wrapper/config.mk
index 2067d988cb..60cfb3209a 100644
--- a/source4/lib/socket_wrapper/config.mk
+++ b/source4/lib/socket_wrapper/config.mk
@@ -5,4 +5,4 @@ PRIVATE_DEPENDENCIES = LIBREPLACE_NETWORK
# End SUBSYSTEM SOCKET_WRAPPER
##############################
-SOCKET_WRAPPER_OBJ_FILES = lib/socket_wrapper/socket_wrapper.o
+SOCKET_WRAPPER_OBJ_FILES = $(socketwrappersrcdir)/socket_wrapper.o
diff --git a/source4/lib/stream/config.mk b/source4/lib/stream/config.mk
index 52c8525483..56d117e7bd 100644
--- a/source4/lib/stream/config.mk
+++ b/source4/lib/stream/config.mk
@@ -1,4 +1,4 @@
[SUBSYSTEM::LIBPACKET]
PRIVATE_DEPENDENCIES = LIBTLS
-LIBPACKET_OBJ_FILES = lib/stream/packet.o
+LIBPACKET_OBJ_FILES = $(libstreamsrcdir)/packet.o
diff --git a/source4/lib/tdr/config.mk b/source4/lib/tdr/config.mk
index 3e05f6c30c..07506ec647 100644
--- a/source4/lib/tdr/config.mk
+++ b/source4/lib/tdr/config.mk
@@ -1,8 +1,9 @@
[SUBSYSTEM::TDR]
CFLAGS = -Ilib/tdr
-PRIVATE_PROTO_HEADER = tdr_proto.h
PUBLIC_DEPENDENCIES = LIBTALLOC LIBSAMBA-UTIL
-TDR_OBJ_FILES = lib/tdr/tdr.o
+TDR_OBJ_FILES = $(libtdrsrcdir)/tdr.o
-PUBLIC_HEADERS += lib/tdr/tdr.h
+$(eval $(call proto_header_template,$(libtdrsrcdir)/tdr_proto.h,$(TDR_OBJ_FILES:.o=.c)))
+
+PUBLIC_HEADERS += $(libtdrsrcdir)/tdr.h
diff --git a/source4/lib/tls/config.mk b/source4/lib/tls/config.mk
index e2d7cd517a..e01f79ce10 100644
--- a/source4/lib/tls/config.mk
+++ b/source4/lib/tls/config.mk
@@ -2,4 +2,4 @@
PUBLIC_DEPENDENCIES = \
LIBTALLOC GNUTLS LIBSAMBA-HOSTCONFIG samba-socket
-LIBTLS_OBJ_FILES = lib/tls/tls.o lib/tls/tlscert.o
+LIBTLS_OBJ_FILES = $(addprefix $(libtlssrcdir)/, tls.o tlscert.o)
diff --git a/source4/lib/torture/config.mk b/source4/lib/torture/config.mk
index 888e285e95..49e7b1a171 100644
--- a/source4/lib/torture/config.mk
+++ b/source4/lib/torture/config.mk
@@ -8,7 +8,7 @@ PUBLIC_DEPENDENCIES = \
torture_VERSION = 0.0.1
torture_SOVERSION = 0
-PC_FILES += lib/torture/torture.pc
-torture_OBJ_FILES = $(addprefix lib/torture/, torture.o)
+PC_FILES += $(libtorturesrcdir)/torture.pc
+torture_OBJ_FILES = $(addprefix $(libtorturesrcdir)/, torture.o)
-PUBLIC_HEADERS += lib/torture/torture.h
+PUBLIC_HEADERS += $(libtorturesrcdir)/torture.h
diff --git a/source4/lib/util/config.mk b/source4/lib/util/config.mk
index 5a4b831ed5..925713a53c 100644
--- a/source4/lib/util/config.mk
+++ b/source4/lib/util/config.mk
@@ -4,7 +4,7 @@ PUBLIC_DEPENDENCIES = \
SOCKET_WRAPPER LIBREPLACE_NETWORK \
CHARSET EXECINFO
-LIBSAMBA-UTIL_OBJ_FILES = $(addprefix lib/util/, \
+LIBSAMBA-UTIL_OBJ_FILES = $(addprefix $(libutilsrcdir)/, \
xfile.o \
debug.o \
fault.o \
@@ -25,7 +25,7 @@ LIBSAMBA-UTIL_OBJ_FILES = $(addprefix lib/util/, \
become_daemon.o \
params.o)
-PUBLIC_HEADERS += $(addprefix lib/util/, util.h \
+PUBLIC_HEADERS += $(addprefix $(libutilsrcdir)/, util.h \
attr.h \
byteorder.h \
data_blob.h \
@@ -37,14 +37,16 @@ PUBLIC_HEADERS += $(addprefix lib/util/, util.h \
xfile.h)
[SUBSYSTEM::ASN1_UTIL]
-PRIVATE_PROTO_HEADER = asn1_proto.h
-ASN1_UTIL_OBJ_FILES = lib/util/asn1.o
+ASN1_UTIL_OBJ_FILES = $(libutilsrcdir)/asn1.o
+
+$(eval $(call proto_header_template,$(libutilsrcdir)/asn1_proto.h,$(ASN1_UTIL_OBJ_FILES:.o=.c)))
[SUBSYSTEM::UNIX_PRIVS]
-PRIVATE_PROTO_HEADER = unix_privs.h
-UNIX_PRIVS_OBJ_FILES = lib/util/unix_privs.o
+UNIX_PRIVS_OBJ_FILES = $(libutilsrcdir)/unix_privs.o
+
+$(eval $(call proto_header_template,$(libutilsrcdir)/unix_privs.h,$(UNIX_PRIVS_OBJ_FILES:.o=.c)))
################################################
# Start SUBSYSTEM WRAP_XATTR
@@ -54,15 +56,16 @@ PUBLIC_DEPENDENCIES = XATTR
# End SUBSYSTEM WRAP_XATTR
################################################
-WRAP_XATTR_OBJ_FILES = lib/util/wrap_xattr.o
+WRAP_XATTR_OBJ_FILES = $(libutilsrcdir)/wrap_xattr.o
[SUBSYSTEM::UTIL_TDB]
-PRIVATE_PROTO_HEADER = util_tdb.h
PUBLIC_DEPENDENCIES = LIBTDB
-UTIL_TDB_OBJ_FILES = lib/util/util_tdb.o
+UTIL_TDB_OBJ_FILES = $(libutilsrcdir)/util_tdb.o
+
+$(eval $(call proto_header_template,$(libutilsrcdir)/util_tdb.h,$(UTIL_TDB_OBJ_FILES:.o=.c)))
[SUBSYSTEM::UTIL_LDB]
PUBLIC_DEPENDENCIES = LIBLDB
-UTIL_LDB_OBJ_FILES = lib/util/util_ldb.o
+UTIL_LDB_OBJ_FILES = $(libutilsrcdir)/util_ldb.o
diff --git a/source4/libcli/auth/config.mk b/source4/libcli/auth/config.mk
index 85fc4ab527..498c2af258 100644
--- a/source4/libcli/auth/config.mk
+++ b/source4/libcli/auth/config.mk
@@ -1,17 +1,17 @@
#################################
# Start SUBSYSTEM LIBCLI_AUTH
[SUBSYSTEM::LIBCLI_AUTH]
-PRIVATE_PROTO_HEADER = proto.h
PUBLIC_DEPENDENCIES = \
MSRPC_PARSE \
LIBSAMBA-HOSTCONFIG
# End SUBSYSTEM LIBCLI_AUTH
#################################
-LIBCLI_AUTH_OBJ_FILES = $(addprefix libcli/auth/, \
+LIBCLI_AUTH_OBJ_FILES = $(addprefix $(libclisrcdir)/auth/, \
credentials.o \
session.o \
smbencrypt.o \
smbdes.o)
-PUBLIC_HEADERS += libcli/auth/credentials.h
+PUBLIC_HEADERS += $(libclisrcdir)/auth/credentials.h
+$(eval $(call proto_header_template,$(libclisrcdir)/auth/proto.h,$(LIBCLI_AUTH_OBJ_FILES:.o=.c)))
diff --git a/source4/libcli/config.mk b/source4/libcli/config.mk
index 4350cd7b04..68d718abaf 100644
--- a/source4/libcli/config.mk
+++ b/source4/libcli/config.mk
@@ -5,28 +5,28 @@ mkinclude wbclient/config.mk
[SUBSYSTEM::LIBSAMBA-ERRORS]
-LIBSAMBA-ERRORS_OBJ_FILES = $(addprefix libcli/util/, doserr.o errormap.o nterr.o)
+LIBSAMBA-ERRORS_OBJ_FILES = $(addprefix $(libclisrcdir)/util/, doserr.o errormap.o nterr.o)
-PUBLIC_HEADERS += $(addprefix libcli/, util/error.h util/ntstatus.h util/doserr.h util/werror.h)
+PUBLIC_HEADERS += $(addprefix $(libclisrcdir)/, util/error.h util/ntstatus.h util/doserr.h util/werror.h)
[SUBSYSTEM::LIBCLI_LSA]
-PRIVATE_PROTO_HEADER = util/clilsa.h
PUBLIC_DEPENDENCIES = RPC_NDR_LSA
PRIVATE_DEPENDENCIES = LIBSECURITY
-LIBCLI_LSA_OBJ_FILES = libcli/util/clilsa.o
+LIBCLI_LSA_OBJ_FILES = $(libclisrcdir)/util/clilsa.o
+
+$(eval $(call proto_header_template,$(libclisrcdir)/util/clilsa.h,$(LIBCLI_LSA_OBJ_FILES:.o=.c)))
[SUBSYSTEM::LIBCLI_COMPOSITE]
-PRIVATE_PROTO_HEADER = composite/proto.h
PUBLIC_DEPENDENCIES = LIBEVENTS
-LIBCLI_COMPOSITE_OBJ_FILES = libcli/composite/composite.o
+LIBCLI_COMPOSITE_OBJ_FILES = $(libclisrcdir)/composite/composite.o
+$(eval $(call proto_header_template,$(libclisrcdir)/composite/proto.h,$(LIBCLI_COMPOSITE_OBJ_FILES:.o=.c)))
[SUBSYSTEM::LIBCLI_SMB_COMPOSITE]
-PRIVATE_PROTO_HEADER = smb_composite/proto.h
PUBLIC_DEPENDENCIES = LIBCLI_COMPOSITE CREDENTIALS gensec LIBCLI_RESOLVE
-LIBCLI_SMB_COMPOSITE_OBJ_FILES = $(addprefix libcli/smb_composite/, \
+LIBCLI_SMB_COMPOSITE_OBJ_FILES = $(addprefix $(libclisrcdir)/smb_composite/, \
loadfile.o \
savefile.o \
connect.o \
@@ -36,40 +36,43 @@ LIBCLI_SMB_COMPOSITE_OBJ_FILES = $(addprefix libcli/smb_composite/, \
fsinfo.o \
smb2.o)
+$(eval $(call proto_header_template,$(libclisrcdir)/smb_composite/proto.h,$(LIBCLI_SMB_COMPOSITE_OBJ_FILES:.o=.c)))
[SUBSYSTEM::NDR_NBT_BUF]
-PRIVATE_PROTO_HEADER = nbt/nbtname.h
-NDR_NBT_BUF_OBJ_FILES = libcli/nbt/nbtname.o
+NDR_NBT_BUF_OBJ_FILES = $(libclisrcdir)/nbt/nbtname.o
+
+$(eval $(call proto_header_template,$(libclisrcdir)/nbt/nbtname.h,$(NDR_NBT_BUF_OBJ_FILES:.o=.c)))
[SUBSYSTEM::LIBCLI_NBT]
-PRIVATE_PROTO_HEADER = nbt/nbt_proto.h
PUBLIC_DEPENDENCIES = LIBNDR NDR_NBT LIBCLI_COMPOSITE LIBEVENTS \
NDR_SECURITY samba-socket LIBSAMBA-UTIL
-LIBCLI_NBT_OBJ_FILES = $(addprefix libcli/nbt/, \
+LIBCLI_NBT_OBJ_FILES = $(addprefix $(libclisrcdir)/nbt/, \
nbtsocket.o \
namequery.o \
nameregister.o \
namerefresh.o \
namerelease.o)
+$(eval $(call proto_header_template,$(libclisrcdir)/nbt/nbt_proto.h,$(LIBCLI_NBT_OBJ_FILES:.o=.c)))
+
[PYTHON::python_libcli_nbt]
SWIG_FILE = swig/libcli_nbt.i
PUBLIC_DEPENDENCIES = LIBCLI_NBT DYNCONFIG LIBSAMBA-HOSTCONFIG
-python_libcli_nbt_OBJ_FILES = libcli/swig/libcli_nbt_wrap.o
+python_libcli_nbt_OBJ_FILES = $(libclisrcdir)/swig/libcli_nbt_wrap.o
[PYTHON::python_libcli_smb]
SWIG_FILE = swig/libcli_smb.i
PUBLIC_DEPENDENCIES = LIBCLI_SMB DYNCONFIG LIBSAMBA-HOSTCONFIG
-python_libcli_smb_OBJ_FILES = libcli/swig/libcli_smb_wrap.o
+python_libcli_smb_OBJ_FILES = $(libclisrcdir)/swig/libcli_smb_wrap.o
[SUBSYSTEM::LIBCLI_DGRAM]
PUBLIC_DEPENDENCIES = LIBCLI_NBT LIBNDR LIBCLI_RESOLVE
-LIBCLI_DGRAM_OBJ_FILES = $(addprefix libcli/dgram/, \
+LIBCLI_DGRAM_OBJ_FILES = $(addprefix $(libclisrcdir)/dgram/, \
dgramsocket.o \
mailslot.o \
netlogon.o \
@@ -80,43 +83,46 @@ LIBCLI_DGRAM_OBJ_FILES = $(addprefix libcli/dgram/, \
PUBLIC_DEPENDENCIES = LIBCLI_LDAP
PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL LIBLDB
-LIBCLI_CLDAP_OBJ_FILES = libcli/cldap/cldap.o
-# PUBLIC_HEADERS += libcli/cldap/cldap.h
+LIBCLI_CLDAP_OBJ_FILES = $(libclisrcdir)/cldap/cldap.o
+# PUBLIC_HEADERS += $(libclisrcdir)/cldap/cldap.h
[SUBSYSTEM::LIBCLI_WREPL]
-PRIVATE_PROTO_HEADER = wrepl/winsrepl_proto.h
PUBLIC_DEPENDENCIES = NDR_WINSREPL samba-socket LIBCLI_RESOLVE LIBEVENTS \
LIBPACKET LIBNDR
-LIBCLI_WREPL_OBJ_FILES = libcli/wrepl/winsrepl.o
+LIBCLI_WREPL_OBJ_FILES = $(libclisrcdir)/wrepl/winsrepl.o
+
+$(eval $(call proto_header_template,$(libclisrcdir)/wrepl/winsrepl_proto.h,$(LIBCLI_WREPL_OBJ_FILES:.o=.c)))
[SUBSYSTEM::LIBCLI_RESOLVE]
-PRIVATE_PROTO_HEADER = resolve/proto.h
PUBLIC_DEPENDENCIES = NDR_NBT
-LIBCLI_RESOLVE_OBJ_FILES = libcli/resolve/resolve.o
+LIBCLI_RESOLVE_OBJ_FILES = $(libclisrcdir)/resolve/resolve.o
+
+$(eval $(call proto_header_template,$(libclisrcdir)/resolve/proto.h,$(LIBCLI_RESOLVE_OBJ_FILES:.o=.c)))
[SUBSYSTEM::LP_RESOLVE]
-PRIVATE_PROTO_HEADER = resolve/lp_proto.h
PRIVATE_DEPENDENCIES = LIBCLI_NBT LIBSAMBA-HOSTCONFIG LIBNETIF
-LP_RESOLVE_OBJ_FILES = $(addprefix libcli/resolve/, \
+LP_RESOLVE_OBJ_FILES = $(addprefix $(libclisrcdir)/resolve/, \
bcast.o nbtlist.o wins.o \
host.o resolve_lp.o)
+$(eval $(call proto_header_template,$(libclisrcdir)/resolve/lp_proto.h,$(LP_RESOLVE_OBJ_FILES:.o=.c)))
+
[SUBSYSTEM::LIBCLI_FINDDCS]
-PRIVATE_PROTO_HEADER = finddcs.h
PUBLIC_DEPENDENCIES = LIBCLI_NBT MESSAGING
-LIBCLI_FINDDCS_OBJ_FILES = libcli/finddcs.o
+LIBCLI_FINDDCS_OBJ_FILES = $(libclisrcdir)/finddcs.o
+
+$(eval $(call proto_header_template,$(libclisrcdir)/finddcs.h,$(LIBCLI_FINDDCS_OBJ_FILES:.o=.c)))
[SUBSYSTEM::LIBCLI_SMB]
-PRIVATE_PROTO_HEADER = libcli_proto.h
PUBLIC_DEPENDENCIES = LIBCLI_RAW LIBSAMBA-ERRORS LIBCLI_AUTH \
LIBCLI_SMB_COMPOSITE LIBCLI_NBT LIBSECURITY LIBCLI_RESOLVE \
LIBCLI_DGRAM LIBCLI_SMB2 LIBCLI_FINDDCS samba-socket
-LIBCLI_SMB_OBJ_FILES = $(addprefix libcli/, \
+LIBCLI_SMB_OBJ_FILES = $(addprefix $(libclisrcdir)/, \
clireadwrite.o \
cliconnect.o \
clifile.o \
@@ -125,18 +131,22 @@ LIBCLI_SMB_OBJ_FILES = $(addprefix libcli/, \
climessage.o \
clideltree.o)
-# PUBLIC_HEADERS += libcli/libcli.h
+$(eval $(call proto_header_template,$(libclisrcdir)/libcli_proto.h,$(LIBCLI_SMB_OBJ_FILES:.o=.c)))
+
+# PUBLIC_HEADERS += $(libclisrcdir)/libcli.h
[SUBSYSTEM::LIBCLI_RAW]
-PRIVATE_PROTO_HEADER = raw/raw_proto.h
PRIVATE_DEPENDENCIES = LIBCLI_COMPOSITE LP_RESOLVE gensec LIBCLI_RESOLVE LIBSECURITY LIBNDR
#LDFLAGS = $(LIBCLI_SMB_COMPOSITE_OUTPUT)
PUBLIC_DEPENDENCIES = samba-socket LIBPACKET gensec LIBCRYPTO CREDENTIALS
-LIBCLI_RAW_OBJ_FILES = $(addprefix libcli/raw/, rawfile.o smb_signing.o clisocket.o \
+LIBCLI_RAW_OBJ_FILES = $(addprefix $(libclisrcdir)/raw/, rawfile.o smb_signing.o clisocket.o \
clitransport.o clisession.o clitree.o clierror.o rawrequest.o \
rawreadwrite.o rawsearch.o rawsetfileinfo.o raweas.o rawtrans.o \
clioplock.o rawnegotiate.o rawfsinfo.o rawfileinfo.o rawnotify.o \
rawioctl.o rawacl.o rawdate.o rawlpq.o rawshadow.o)
+
+$(eval $(call proto_header_template,$(libclisrcdir)/raw/raw_proto.h,$(LIBCLI_RAW_OBJ_FILES:.o=.c)))
+
mkinclude smb2/config.mk
diff --git a/source4/libcli/ldap/config.mk b/source4/libcli/ldap/config.mk
index 33e32c7417..02678eed7a 100644
--- a/source4/libcli/ldap/config.mk
+++ b/source4/libcli/ldap/config.mk
@@ -1,17 +1,18 @@
[SUBSYSTEM::LIBCLI_LDAP]
-PRIVATE_PROTO_HEADER = ldap_proto.h
PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBEVENTS LIBPACKET
PRIVATE_DEPENDENCIES = LIBCLI_COMPOSITE samba-socket NDR_SAMR LIBTLS ASN1_UTIL \
LDAP_ENCODE LIBNDR LP_RESOLVE gensec
-LIBCLI_LDAP_OBJ_FILES = $(addprefix libcli/ldap/, \
+LIBCLI_LDAP_OBJ_FILES = $(addprefix $(libclisrcdir)/ldap/, \
ldap.o ldap_client.o ldap_bind.o \
ldap_msg.o ldap_ildap.o ldap_controls.o)
-PUBLIC_HEADERS += libcli/ldap/ldap.h libcli/ldap/ldap_ndr.h
+PUBLIC_HEADERS += $(libclisrcdir)/ldap/ldap.h $(libclisrcdir)/ldap/ldap_ndr.h
+
+$(eval $(call proto_header_template,$(libclisrcdir)/ldap/ldap_proto.h,$(LIBCLI_LDAP_OBJ_FILES:.o=.c)))
[SUBSYSTEM::LDAP_ENCODE]
# FIXME PRIVATE_DEPENDENCIES = LIBLDB
-LDAP_ENCODE_OBJ_FILES = libcli/ldap/ldap_ndr.o
+LDAP_ENCODE_OBJ_FILES = $(libclisrcdir)/ldap/ldap_ndr.o
diff --git a/source4/libcli/security/config.mk b/source4/libcli/security/config.mk
index fde065aa34..63e54fac8a 100644
--- a/source4/libcli/security/config.mk
+++ b/source4/libcli/security/config.mk
@@ -1,14 +1,14 @@
[SUBSYSTEM::LIBSECURITY]
-PRIVATE_PROTO_HEADER = proto.h
PUBLIC_DEPENDENCIES = NDR_MISC LIBNDR
-LIBSECURITY_OBJ_FILES = $(addprefix libcli/security/, \
+LIBSECURITY_OBJ_FILES = $(addprefix $(libclisrcdir)/security/, \
security_token.o security_descriptor.o \
dom_sid.o access_check.o privilege.o sddl.o)
+$(eval $(call proto_header_template,$(libclisrcdir)/security/proto.h,$(LIBSECURITY_OBJ_FILES:.o=.c)))
[PYTHON::swig_security]
SWIG_FILE = security.i
PRIVATE_DEPENDENCIES = LIBSECURITY
-swig_security_OBJ_FILES = libcli/security/security_wrap.o
+swig_security_OBJ_FILES = $(libclisrcdir)/security/security_wrap.o
diff --git a/source4/libcli/smb2/config.mk b/source4/libcli/smb2/config.mk
index 18f6245a3e..e653fbac1c 100644
--- a/source4/libcli/smb2/config.mk
+++ b/source4/libcli/smb2/config.mk
@@ -1,10 +1,10 @@
[SUBSYSTEM::LIBCLI_SMB2]
-PRIVATE_PROTO_HEADER = smb2_proto.h
PUBLIC_DEPENDENCIES = LIBCLI_RAW LIBPACKET gensec
-LIBCLI_SMB2_OBJ_FILES = $(addprefix libcli/smb2/, \
+LIBCLI_SMB2_OBJ_FILES = $(addprefix $(libclisrcdir)/smb2/, \
transport.o request.o negprot.o session.o tcon.o \
create.o close.o connect.o getinfo.o write.o read.o \
setinfo.o find.o ioctl.o logoff.o tdis.o flush.o \
lock.o notify.o cancel.o keepalive.o break.o)
+$(eval $(call proto_header_template,$(libclisrcdir)/smb2/smb2_proto.h,$(LIBCLI_SMB2_OBJ_FILES:.o=.c)))
diff --git a/source4/libcli/wbclient/config.mk b/source4/libcli/wbclient/config.mk
index 94e30d44f1..00df5dbb22 100644
--- a/source4/libcli/wbclient/config.mk
+++ b/source4/libcli/wbclient/config.mk
@@ -2,4 +2,4 @@
PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBEVENTS
PRIVATE_DEPENDENCIES = NDR_WINBIND MESSAGING
-LIBWBCLIENT_OBJ_FILES = libcli/wbclient/wbclient.o
+LIBWBCLIENT_OBJ_FILES = $(libclisrcdir)/wbclient/wbclient.o
diff --git a/source4/libnet/config.mk b/source4/libnet/config.mk
index 243fc1813a..f60ca6d94d 100644
--- a/source4/libnet/config.mk
+++ b/source4/libnet/config.mk
@@ -1,8 +1,7 @@
[SUBSYSTEM::LIBSAMBA-NET]
-PRIVATE_PROTO_HEADER = libnet_proto.h
PUBLIC_DEPENDENCIES = CREDENTIALS dcerpc dcerpc_samr RPC_NDR_LSA RPC_NDR_SRVSVC RPC_NDR_DRSUAPI LIBCLI_COMPOSITE LIBCLI_RESOLVE LIBCLI_FINDDCS LIBCLI_CLDAP LIBCLI_FINDDCS gensec_schannel LIBCLI_AUTH LIBNDR SMBPASSWD PROVISION
-LIBSAMBA-NET_OBJ_FILES = $(addprefix libnet/, \
+LIBSAMBA-NET_OBJ_FILES = $(addprefix $(libnetsrcdir)/, \
libnet.o libnet_passwd.o libnet_time.o libnet_rpc.o \
libnet_join.o libnet_site.o libnet_become_dc.o libnet_unbecome_dc.o \
libnet_vampire.o libnet_samdump.o libnet_samdump_keytab.o \
@@ -10,7 +9,9 @@ LIBSAMBA-NET_OBJ_FILES = $(addprefix libnet/, \
libnet_lookup.o libnet_domain.o userinfo.o groupinfo.o userman.o \
groupman.o prereq_domain.o libnet_samsync.o)
+$(eval $(call proto_header_template,$(libnetsrcdir)/libnet_proto.h,$(LIBSAMBA-NET_OBJ_FILES:.o=.c)))
+
[PYTHON::python_net]
PRIVATE_DEPENDENCIES = LIBSAMBA-NET
-python_net_OBJ_FILES = libnet/py_net.o
+python_net_OBJ_FILES = $(libnetsrcdir)/py_net.o
diff --git a/source4/librpc/config.mk b/source4/librpc/config.mk
index 24fad8c9c4..b9f79a51e6 100644
--- a/source4/librpc/config.mk
+++ b/source4/librpc/config.mk
@@ -1,20 +1,25 @@
+ndrsrcdir = $(librpcsrcdir)/ndr
+gen_ndrsrcdir = $(librpcsrcdir)/gen_ndr
+dcerpcsrcdir = $(librpcsrcdir)/rpc
+
################################################
# Start SUBSYSTEM LIBNDR
[LIBRARY::LIBNDR]
-PRIVATE_PROTO_HEADER = ndr/libndr_proto.h
PUBLIC_DEPENDENCIES = LIBSAMBA-ERRORS LIBTALLOC LIBSAMBA-UTIL CHARSET \
LIBSAMBA-HOSTCONFIG
-LIBNDR_OBJ_FILES = $(addprefix librpc/ndr/, ndr.o ndr_basic.o ndr_string.o uuid.o)
+LIBNDR_OBJ_FILES = $(addprefix $(ndrsrcdir)/, ndr.o ndr_basic.o ndr_string.o uuid.o)
+
+$(eval $(call proto_header_template,$(ndrsrcdir)/libndr_proto.h,$(LIBNDR_OBJ_FILES:.o=.c)))
-PC_FILES += librpc/ndr.pc
+PC_FILES += $(librpcsrcdir)/ndr.pc
LIBNDR_VERSION = 0.0.1
LIBNDR_SOVERSION = 0
# End SUBSYSTEM LIBNDR
################################################
-PUBLIC_HEADERS += librpc/ndr/libndr.h
+PUBLIC_HEADERS += $(ndrsrcdir)/libndr.h
#################################
# Start BINARY ndrdump
@@ -31,332 +36,333 @@ PRIVATE_DEPENDENCIES = \
# End BINARY ndrdump
#################################
-ndrdump_OBJ_FILES = librpc/tools/ndrdump.o
+ndrdump_OBJ_FILES = $(librpcsrcdir)/tools/ndrdump.o
-MANPAGES += librpc/tools/ndrdump.1
+MANPAGES += $(librpcsrcdir)/tools/ndrdump.1
################################################
# Start SUBSYSTEM NDR_COMPRESSION
[SUBSYSTEM::NDR_COMPRESSION]
-PRIVATE_PROTO_HEADER = ndr/ndr_compression.h
PUBLIC_DEPENDENCIES = LIBCOMPRESSION LIBSAMBA-ERRORS LIBNDR
# End SUBSYSTEM NDR_COMPRESSION
################################################
-NDR_COMPRESSION_OBJ_FILES = librpc/ndr/ndr_compression.o
+NDR_COMPRESSION_OBJ_FILES = $(ndrsrcdir)/ndr_compression.o
+
+$(eval $(call proto_header_template,$(ndrsrcdir)/ndr_compression.h,$(NDR_COMPRESSION_OBJ_FILES:.o=.c)))
[SUBSYSTEM::NDR_SECURITY]
PUBLIC_DEPENDENCIES = NDR_MISC LIBSECURITY
-NDR_SECURITY_OBJ_FILES = librpc/gen_ndr/ndr_security.o librpc/ndr/ndr_sec_helper.o
+NDR_SECURITY_OBJ_FILES = $(gen_ndrsrcdir)/ndr_security.o $(ndrsrcdir)/ndr_sec_helper.o
-PUBLIC_HEADERS += librpc/gen_ndr/security.h
+PUBLIC_HEADERS += $(gen_ndrsrcdir)/security.h
[SUBSYSTEM::NDR_AUDIOSRV]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_AUDIOSRV_OBJ_FILES = librpc/gen_ndr/ndr_audiosrv.o
+NDR_AUDIOSRV_OBJ_FILES = $(gen_ndrsrcdir)/ndr_audiosrv.o
[SUBSYSTEM::NDR_DNSSERVER]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_DNSSERVER_OBJ_FILES = librpc/gen_ndr/ndr_dnsserver.o
+NDR_DNSSERVER_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dnsserver.o
[SUBSYSTEM::NDR_WINSTATION]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_WINSTATION_OBJ_FILES = librpc/gen_ndr/ndr_winstation.o
+NDR_WINSTATION_OBJ_FILES = $(gen_ndrsrcdir)/ndr_winstation.o
[SUBSYSTEM::NDR_ECHO]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_ECHO_OBJ_FILES = librpc/gen_ndr/ndr_echo.o
+NDR_ECHO_OBJ_FILES = $(gen_ndrsrcdir)/ndr_echo.o
[SUBSYSTEM::NDR_IRPC]
PUBLIC_DEPENDENCIES = LIBNDR NDR_SECURITY NDR_NBT
-NDR_IRPC_OBJ_FILES = librpc/gen_ndr/ndr_irpc.o
+NDR_IRPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_irpc.o
[SUBSYSTEM::NDR_DSBACKUP]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_DSBACKUP_OBJ_FILES = librpc/gen_ndr/ndr_dsbackup.o
+NDR_DSBACKUP_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dsbackup.o
[SUBSYSTEM::NDR_EFS]
PUBLIC_DEPENDENCIES = LIBNDR NDR_SECURITY
-NDR_EFS_OBJ_FILES = librpc/gen_ndr/ndr_efs.o
+NDR_EFS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_efs.o
[SUBSYSTEM::NDR_MISC]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_MISC_OBJ_FILES = librpc/gen_ndr/ndr_misc.o librpc/ndr/ndr_misc.o
+NDR_MISC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_misc.o $(ndrsrcdir)/ndr_misc.o
-PUBLIC_HEADERS += librpc/gen_ndr/misc.h librpc/gen_ndr/ndr_misc.h
+PUBLIC_HEADERS += $(gen_ndrsrcdir)/misc.h $(gen_ndrsrcdir)/ndr_misc.h
[SUBSYSTEM::NDR_ROT]
PUBLIC_DEPENDENCIES = LIBNDR NDR_ORPC
-NDR_ROT_OBJ_FILES = librpc/gen_ndr/ndr_rot.o
+NDR_ROT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_rot.o
[SUBSYSTEM::NDR_LSA]
PUBLIC_DEPENDENCIES = LIBNDR NDR_SECURITY
-NDR_LSA_OBJ_FILES = librpc/gen_ndr/ndr_lsa.o
+NDR_LSA_OBJ_FILES = $(gen_ndrsrcdir)/ndr_lsa.o
-PUBLIC_HEADERS += librpc/gen_ndr/lsa.h
+PUBLIC_HEADERS += $(gen_ndrsrcdir)/lsa.h
[SUBSYSTEM::NDR_DFS]
PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC
-NDR_DFS_OBJ_FILES = librpc/gen_ndr/ndr_dfs.o
+NDR_DFS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dfs.o
[SUBSYSTEM::NDR_FRSRPC]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_FRSRPC_OBJ_FILES = librpc/gen_ndr/ndr_frsrpc.o
+NDR_FRSRPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_frsrpc.o
[SUBSYSTEM::NDR_FRSAPI]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_FRSAPI_OBJ_FILES = librpc/gen_ndr/ndr_frsapi.o
+NDR_FRSAPI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_frsapi.o
[SUBSYSTEM::NDR_DRSUAPI]
PUBLIC_DEPENDENCIES = LIBNDR NDR_COMPRESSION NDR_SECURITY NDR_SAMR ASN1_UTIL
-NDR_DRSUAPI_OBJ_FILES = librpc/gen_ndr/ndr_drsuapi.o librpc/ndr/ndr_drsuapi.o
+NDR_DRSUAPI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_drsuapi.o $(ndrsrcdir)/ndr_drsuapi.o
[SUBSYSTEM::NDR_DRSBLOBS]
PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC NDR_DRSUAPI
-NDR_DRSBLOBS_OBJ_FILES = librpc/gen_ndr/ndr_drsblobs.o
+NDR_DRSBLOBS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_drsblobs.o
[SUBSYSTEM::NDR_SASL_HELPERS]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_SASL_HELPERS_OBJ_FILES = librpc/gen_ndr/ndr_sasl_helpers.o
+NDR_SASL_HELPERS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_sasl_helpers.o
[SUBSYSTEM::NDR_POLICYAGENT]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_POLICYAGENT_OBJ_FILES = librpc/gen_ndr/ndr_policyagent.o
+NDR_POLICYAGENT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_policyagent.o
[SUBSYSTEM::NDR_UNIXINFO]
PUBLIC_DEPENDENCIES = LIBNDR NDR_SECURITY
-NDR_UNIXINFO_OBJ_FILES = librpc/gen_ndr/ndr_unixinfo.o
+NDR_UNIXINFO_OBJ_FILES = $(gen_ndrsrcdir)/ndr_unixinfo.o
[SUBSYSTEM::NDR_SAMR]
PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC NDR_LSA NDR_SECURITY
-NDR_SAMR_OBJ_FILES = librpc/gen_ndr/ndr_samr.o
+NDR_SAMR_OBJ_FILES = $(gen_ndrsrcdir)/ndr_samr.o
-PUBLIC_HEADERS += $(addprefix librpc/, gen_ndr/samr.h gen_ndr/ndr_samr.h gen_ndr/ndr_samr_c.h)
+PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, gen_ndr/samr.h gen_ndr/ndr_samr.h gen_ndr/ndr_samr_c.h)
[SUBSYSTEM::NDR_NFS4ACL]
PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC NDR_SECURITY
-NDR_NFS4ACL_OBJ_FILES = librpc/gen_ndr/ndr_nfs4acl.o
+NDR_NFS4ACL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_nfs4acl.o
[SUBSYSTEM::NDR_SPOOLSS]
PUBLIC_DEPENDENCIES = LIBNDR NDR_SPOOLSS_BUF NDR_SECURITY
-NDR_SPOOLSS_OBJ_FILES = librpc/gen_ndr/ndr_spoolss.o
+NDR_SPOOLSS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_spoolss.o
[SUBSYSTEM::NDR_SPOOLSS_BUF]
-PRIVATE_PROTO_HEADER = ndr/ndr_spoolss_buf.h
-NDR_SPOOLSS_BUF_OBJ_FILES = librpc/ndr/ndr_spoolss_buf.o
+NDR_SPOOLSS_BUF_OBJ_FILES = $(ndrsrcdir)/ndr_spoolss_buf.o
+
+$(eval $(call proto_header_template,$(ndrsrcdir)/ndr_spoolss_buf.h,$(NDR_SPOOLSS_BUF_OBJ_FILES:.o=.c)))
[SUBSYSTEM::NDR_WKSSVC]
PUBLIC_DEPENDENCIES = LIBNDR NDR_SRVSVC NDR_MISC NDR_SECURITY
-NDR_WKSSVC_OBJ_FILES = librpc/gen_ndr/ndr_wkssvc.o
+NDR_WKSSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wkssvc.o
[SUBSYSTEM::NDR_SRVSVC]
PUBLIC_DEPENDENCIES = LIBNDR NDR_SVCCTL NDR_SECURITY
-NDR_SRVSVC_OBJ_FILES = librpc/gen_ndr/ndr_srvsvc.o
+NDR_SRVSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_srvsvc.o
[SUBSYSTEM::NDR_SVCCTL]
PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC
-NDR_SVCCTL_OBJ_FILES = librpc/gen_ndr/ndr_svcctl.o
+NDR_SVCCTL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_svcctl.o
-PUBLIC_HEADERS += $(addprefix librpc/, gen_ndr/ndr_svcctl.h gen_ndr/svcctl.h)
+PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, gen_ndr/ndr_svcctl.h gen_ndr/svcctl.h)
[SUBSYSTEM::NDR_ATSVC]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_ATSVC_OBJ_FILES = librpc/gen_ndr/ndr_atsvc.o
+NDR_ATSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_atsvc.o
-PUBLIC_HEADERS += $(addprefix librpc/, gen_ndr/atsvc.h gen_ndr/ndr_atsvc.h)
+PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, gen_ndr/atsvc.h gen_ndr/ndr_atsvc.h)
[SUBSYSTEM::NDR_EVENTLOG]
PUBLIC_DEPENDENCIES = LIBNDR NDR_LSA
-NDR_EVENTLOG_OBJ_FILES = librpc/gen_ndr/ndr_eventlog.o
+NDR_EVENTLOG_OBJ_FILES = $(gen_ndrsrcdir)/ndr_eventlog.o
[SUBSYSTEM::NDR_EPMAPPER]
PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC
-NDR_EPMAPPER_OBJ_FILES = librpc/gen_ndr/ndr_epmapper.o
+NDR_EPMAPPER_OBJ_FILES = $(gen_ndrsrcdir)/ndr_epmapper.o
[SUBSYSTEM::NDR_DBGIDL]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_DBGIDL_OBJ_FILES = librpc/gen_ndr/ndr_dbgidl.o
+NDR_DBGIDL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dbgidl.o
[SUBSYSTEM::NDR_DSSETUP]
PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC
-NDR_DSSETUP_OBJ_FILES = librpc/gen_ndr/ndr_dssetup.o
+NDR_DSSETUP_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dssetup.o
[SUBSYSTEM::NDR_MSGSVC]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_MSGSVC_OBJ_FILES = librpc/gen_ndr/ndr_msgsvc.o
+NDR_MSGSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_msgsvc.o
[SUBSYSTEM::NDR_WINS]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_WINS_OBJ_FILES = librpc/gen_ndr/ndr_wins.o
+NDR_WINS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wins.o
[SUBSYSTEM::NDR_WINREG]
PUBLIC_DEPENDENCIES = LIBNDR NDR_INITSHUTDOWN NDR_SECURITY NDR_MISC
-NDR_WINREG_OBJ_FILES = librpc/gen_ndr/ndr_winreg.o
+NDR_WINREG_OBJ_FILES = $(gen_ndrsrcdir)/ndr_winreg.o
[SUBSYSTEM::NDR_INITSHUTDOWN]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_INITSHUTDOWN_OBJ_FILES = librpc/gen_ndr/ndr_initshutdown.o
+NDR_INITSHUTDOWN_OBJ_FILES = $(gen_ndrsrcdir)/ndr_initshutdown.o
[SUBSYSTEM::NDR_MGMT]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_MGMT_OBJ_FILES = librpc/gen_ndr/ndr_mgmt.o
+NDR_MGMT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_mgmt.o
[SUBSYSTEM::NDR_PROTECTED_STORAGE]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_PROTECTED_STORAGE_OBJ_FILES = librpc/gen_ndr/ndr_protected_storage.o
+NDR_PROTECTED_STORAGE_OBJ_FILES = $(gen_ndrsrcdir)/ndr_protected_storage.o
[SUBSYSTEM::NDR_ORPC]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_ORPC_OBJ_FILES = librpc/gen_ndr/ndr_orpc.o librpc/ndr/ndr_orpc.o
+NDR_ORPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_orpc.o $(ndrsrcdir)/ndr_orpc.o
[SUBSYSTEM::NDR_OXIDRESOLVER]
PUBLIC_DEPENDENCIES = LIBNDR NDR_ORPC NDR_MISC
-NDR_OXIDRESOLVER_OBJ_FILES = librpc/gen_ndr/ndr_oxidresolver.o
+NDR_OXIDRESOLVER_OBJ_FILES = $(gen_ndrsrcdir)/ndr_oxidresolver.o
[SUBSYSTEM::NDR_REMACT]
PUBLIC_DEPENDENCIES = LIBNDR NDR_ORPC NDR_MISC
-NDR_REMACT_OBJ_FILES = librpc/gen_ndr/ndr_remact.o
+NDR_REMACT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_remact.o
[SUBSYSTEM::NDR_WZCSVC]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_WZCSVC_OBJ_FILES = librpc/gen_ndr/ndr_wzcsvc.o
+NDR_WZCSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wzcsvc.o
[SUBSYSTEM::NDR_BROWSER]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_BROWSER_OBJ_FILES = librpc/gen_ndr/ndr_browser.o
+NDR_BROWSER_OBJ_FILES = $(gen_ndrsrcdir)/ndr_browser.o
[SUBSYSTEM::NDR_W32TIME]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_W32TIME_OBJ_FILES = librpc/gen_ndr/ndr_w32time.o
+NDR_W32TIME_OBJ_FILES = $(gen_ndrsrcdir)/ndr_w32time.o
[SUBSYSTEM::NDR_SCERPC]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_SCERPC_OBJ_FILES = librpc/gen_ndr/ndr_scerpc.o
+NDR_SCERPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_scerpc.o
[SUBSYSTEM::NDR_NTSVCS]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_NTSVCS_OBJ_FILES = librpc/gen_ndr/ndr_ntsvcs.o
+NDR_NTSVCS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_ntsvcs.o
[SUBSYSTEM::NDR_NETLOGON]
PUBLIC_DEPENDENCIES = LIBNDR NDR_SAMR NDR_LSA NDR_SECURITY
-NDR_NETLOGON_OBJ_FILES = librpc/gen_ndr/ndr_netlogon.o
+NDR_NETLOGON_OBJ_FILES = $(gen_ndrsrcdir)/ndr_netlogon.o
-PUBLIC_HEADERS += $(addprefix librpc/, gen_ndr/netlogon.h)
+PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, gen_ndr/netlogon.h)
[SUBSYSTEM::NDR_TRKWKS]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_TRKWKS_OBJ_FILES = librpc/gen_ndr/ndr_trkwks.o
+NDR_TRKWKS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_trkwks.o
[SUBSYSTEM::NDR_KEYSVC]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_KEYSVC_OBJ_FILES = librpc/gen_ndr/ndr_keysvc.o
+NDR_KEYSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_keysvc.o
[SUBSYSTEM::NDR_KRB5PAC]
PUBLIC_DEPENDENCIES = LIBNDR NDR_NETLOGON NDR_SECURITY
-NDR_KRB5PAC_OBJ_FILES = librpc/gen_ndr/ndr_krb5pac.o librpc/ndr/ndr_krb5pac.o
+NDR_KRB5PAC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_krb5pac.o $(ndrsrcdir)/ndr_krb5pac.o
[SUBSYSTEM::NDR_XATTR]
PUBLIC_DEPENDENCIES = LIBNDR NDR_SECURITY
-NDR_XATTR_OBJ_FILES = librpc/gen_ndr/ndr_xattr.o
+NDR_XATTR_OBJ_FILES = $(gen_ndrsrcdir)/ndr_xattr.o
[SUBSYSTEM::NDR_OPENDB]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_OPENDB_OBJ_FILES = librpc/gen_ndr/ndr_opendb.o
+NDR_OPENDB_OBJ_FILES = $(gen_ndrsrcdir)/ndr_opendb.o
[SUBSYSTEM::NDR_NOTIFY]
PUBLIC_DEPENDENCIES = LIBNDR
-NDR_NOTIFY_OBJ_FILES = librpc/gen_ndr/ndr_notify.o
+NDR_NOTIFY_OBJ_FILES = $(gen_ndrsrcdir)/ndr_notify.o
[SUBSYSTEM::NDR_SCHANNEL]
PUBLIC_DEPENDENCIES = LIBNDR NDR_NBT
-NDR_SCHANNEL_OBJ_FILES = librpc/gen_ndr/ndr_schannel.o
+NDR_SCHANNEL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_schannel.o
[SUBSYSTEM::NDR_NBT]
PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC NDR_NBT_BUF NDR_SVCCTL NDR_SECURITY
-NDR_NBT_OBJ_FILES = librpc/gen_ndr/ndr_nbt.o
+NDR_NBT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_nbt.o
-PUBLIC_HEADERS += librpc/gen_ndr/nbt.h
+PUBLIC_HEADERS += $(gen_ndrsrcdir)/nbt.h
[SUBSYSTEM::NDR_WINSREPL]
PUBLIC_DEPENDENCIES = LIBNDR NDR_NBT
-NDR_WINSREPL_OBJ_FILES = librpc/gen_ndr/ndr_winsrepl.o
+NDR_WINSREPL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_winsrepl.o
[SUBSYSTEM::NDR_WINBIND]
PUBLIC_DEPENDENCIES = LIBNDR NDR_NETLOGON
-NDR_WINBIND_OBJ_FILES = librpc/gen_ndr/ndr_winbind.o
-#PUBLIC_HEADERS += librpc/gen_ndr/winbind.h
+NDR_WINBIND_OBJ_FILES = $(gen_ndrsrcdir)/ndr_winbind.o
+#PUBLIC_HEADERS += $(gen_ndrsrcdir)/winbind.h
-librpc/idl-deps:
- ./librpc/idl-deps.pl librpc/idl/*.idl >$@
+$(librpcsrcdir)/idl-deps:
+ ./$(librpcsrcdir)/idl-deps.pl $(librpcsrcdir)/idl/*.idl >$@
clean::
- rm -f librpc/idl-deps
+ rm -f $(librpcsrcdir)/idl-deps
-include librpc/idl-deps
+include $(librpcsrcdir)/idl-deps
-librpc/gen_ndr/tables.c: $(IDL_NDR_PARSE_H_FILES)
+$(gen_ndrsrcdir)/tables.c: $(IDL_NDR_PARSE_H_FILES)
@echo Generating $@
- @$(PERL) $(srcdir)/librpc/tables.pl --output=$@ $^ > librpc/gen_ndr/tables.x
- @mv librpc/gen_ndr/tables.x $@
+ @$(PERL) $(librpcsrcdir)/tables.pl --output=$@ $^ > $(gen_ndrsrcdir)/tables.x
+ @mv $(gen_ndrsrcdir)/tables.x $@
[SUBSYSTEM::NDR_TABLE]
-PRIVATE_PROTO_HEADER = ndr/ndr_table.h
PUBLIC_DEPENDENCIES = \
NDR_AUDIOSRV NDR_ECHO NDR_DCERPC \
NDR_DSBACKUP NDR_EFS NDR_MISC NDR_LSA NDR_DFS NDR_DRSUAPI \
@@ -369,93 +375,95 @@ PUBLIC_DEPENDENCIES = \
NDR_INITSHUTDOWN NDR_DNSSERVER NDR_WINSTATION NDR_IRPC NDR_OPENDB \
NDR_SASL_HELPERS NDR_NOTIFY NDR_WINBIND NDR_FRSRPC NDR_FRSAPI NDR_NFS4ACL
-NDR_TABLE_OBJ_FILES = librpc/ndr/ndr_table.o librpc/gen_ndr/tables.o
+NDR_TABLE_OBJ_FILES = $(ndrsrcdir)/ndr_table.o $(gen_ndrsrcdir)/tables.o
+
+$(eval $(call proto_header_template,$(ndrsrcdir)/ndr_table.h,$(NDR_TABLE_OBJ_FILES:.o=.c)))
[SUBSYSTEM::RPC_NDR_ROT]
PUBLIC_DEPENDENCIES = NDR_ROT dcerpc
-RPC_NDR_ROT_OBJ_FILES = librpc/gen_ndr/ndr_rot_c.o
+RPC_NDR_ROT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_rot_c.o
[SUBSYSTEM::RPC_NDR_AUDIOSRV]
PUBLIC_DEPENDENCIES = NDR_AUDIOSRV dcerpc
-RPC_NDR_AUDIOSRV_OBJ_FILES = librpc/gen_ndr/ndr_audiosrv_c.o
+RPC_NDR_AUDIOSRV_OBJ_FILES = $(gen_ndrsrcdir)/ndr_audiosrv_c.o
[SUBSYSTEM::RPC_NDR_ECHO]
PUBLIC_DEPENDENCIES = dcerpc NDR_ECHO
-RPC_NDR_ECHO_OBJ_FILES = librpc/gen_ndr/ndr_echo_c.o
+RPC_NDR_ECHO_OBJ_FILES = $(gen_ndrsrcdir)/ndr_echo_c.o
[SUBSYSTEM::RPC_NDR_DSBACKUP]
PUBLIC_DEPENDENCIES = dcerpc NDR_DSBACKUP
-RPC_NDR_DSBACKUP_OBJ_FILES = librpc/gen_ndr/ndr_dsbackup_c.o
+RPC_NDR_DSBACKUP_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dsbackup_c.o
[SUBSYSTEM::RPC_NDR_EFS]
PUBLIC_DEPENDENCIES = dcerpc NDR_EFS
-RPC_NDR_EFS_OBJ_FILES = librpc/gen_ndr/ndr_efs_c.o
+RPC_NDR_EFS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_efs_c.o
[SUBSYSTEM::RPC_NDR_LSA]
PUBLIC_DEPENDENCIES = dcerpc NDR_LSA
-RPC_NDR_LSA_OBJ_FILES = librpc/gen_ndr/ndr_lsa_c.o
+RPC_NDR_LSA_OBJ_FILES = $(gen_ndrsrcdir)/ndr_lsa_c.o
[SUBSYSTEM::RPC_NDR_DFS]
PUBLIC_DEPENDENCIES = dcerpc NDR_DFS
-RPC_NDR_DFS_OBJ_FILES = librpc/gen_ndr/ndr_dfs_c.o
+RPC_NDR_DFS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dfs_c.o
[SUBSYSTEM::RPC_NDR_FRSAPI]
PUBLIC_DEPENDENCIES = dcerpc NDR_FRSAPI
-RPC_NDR_FRSAPI_OBJ_FILES = librpc/gen_ndr/ndr_frsapi_c.o
+RPC_NDR_FRSAPI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_frsapi_c.o
[SUBSYSTEM::RPC_NDR_DRSUAPI]
PUBLIC_DEPENDENCIES = dcerpc NDR_DRSUAPI
-RPC_NDR_DRSUAPI_OBJ_FILES = librpc/gen_ndr/ndr_drsuapi_c.o
+RPC_NDR_DRSUAPI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_drsuapi_c.o
[SUBSYSTEM::RPC_NDR_POLICYAGENT]
PUBLIC_DEPENDENCIES = dcerpc NDR_POLICYAGENT
-RPC_NDR_POLICYAGENT_OBJ_FILES = librpc/gen_ndr/ndr_policyagent_c.o
+RPC_NDR_POLICYAGENT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_policyagent_c.o
[SUBSYSTEM::RPC_NDR_UNIXINFO]
PUBLIC_DEPENDENCIES = dcerpc NDR_UNIXINFO
-RPC_NDR_UNIXINFO_OBJ_FILES = librpc/gen_ndr/ndr_unixinfo_c.o
+RPC_NDR_UNIXINFO_OBJ_FILES = $(gen_ndrsrcdir)/ndr_unixinfo_c.o
[LIBRARY::dcerpc_samr]
PUBLIC_DEPENDENCIES = dcerpc NDR_SAMR
-PC_FILES += librpc/dcerpc_samr.pc
+PC_FILES += $(librpcsrcdir)/dcerpc_samr.pc
dcerpc_samr_VERSION = 0.0.1
dcerpc_samr_SOVERSION = 0
-dcerpc_samr_OBJ_FILES = librpc/gen_ndr/ndr_samr_c.o
+dcerpc_samr_OBJ_FILES = $(gen_ndrsrcdir)/ndr_samr_c.o
[SUBSYSTEM::RPC_NDR_SPOOLSS]
PUBLIC_DEPENDENCIES = dcerpc NDR_SPOOLSS
-RPC_NDR_SPOOLSS_OBJ_FILES = librpc/gen_ndr/ndr_spoolss_c.o
+RPC_NDR_SPOOLSS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_spoolss_c.o
[SUBSYSTEM::RPC_NDR_WKSSVC]
PUBLIC_DEPENDENCIES = dcerpc NDR_WKSSVC
-RPC_NDR_WKSSVC_OBJ_FILES = librpc/gen_ndr/ndr_wkssvc_c.o
+RPC_NDR_WKSSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wkssvc_c.o
[SUBSYSTEM::RPC_NDR_SRVSVC]
PUBLIC_DEPENDENCIES = dcerpc NDR_SRVSVC
-RPC_NDR_SRVSVC_OBJ_FILES = librpc/gen_ndr/ndr_srvsvc_c.o
+RPC_NDR_SRVSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_srvsvc_c.o
[SUBSYSTEM::RPC_NDR_SVCCTL]
PUBLIC_DEPENDENCIES = dcerpc NDR_SVCCTL
-RPC_NDR_SVCCTL_OBJ_FILES = librpc/gen_ndr/ndr_svcctl_c.o
+RPC_NDR_SVCCTL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_svcctl_c.o
-PUBLIC_HEADERS += librpc/gen_ndr/ndr_svcctl_c.h
+PUBLIC_HEADERS += $(gen_ndrsrcdir)/ndr_svcctl_c.h
[LIBRARY::dcerpc_atsvc]
PUBLIC_DEPENDENCIES = dcerpc NDR_ATSVC
@@ -463,117 +471,116 @@ PUBLIC_DEPENDENCIES = dcerpc NDR_ATSVC
dcerpc_atsvc_VERSION = 0.0.1
dcerpc_atsvc_SOVERSION = 0
-dcerpc_atsvc_OBJ_FILES = librpc/gen_ndr/ndr_atsvc_c.o
-PC_FILES += librpc/dcerpc_atsvc.pc
+dcerpc_atsvc_OBJ_FILES = $(gen_ndrsrcdir)/ndr_atsvc_c.o
+PC_FILES += $(librpcsrcdir)/dcerpc_atsvc.pc
-PUBLIC_HEADERS += librpc/gen_ndr/ndr_atsvc_c.h
+PUBLIC_HEADERS += $(gen_ndrsrcdir)/ndr_atsvc_c.h
[SUBSYSTEM::RPC_NDR_EVENTLOG]
PUBLIC_DEPENDENCIES = dcerpc NDR_EVENTLOG
-RPC_NDR_EVENTLOG_OBJ_FILES = librpc/gen_ndr/ndr_eventlog_c.o
+RPC_NDR_EVENTLOG_OBJ_FILES = $(gen_ndrsrcdir)/ndr_eventlog_c.o
[SUBSYSTEM::RPC_NDR_EPMAPPER]
PUBLIC_DEPENDENCIES = NDR_EPMAPPER
-RPC_NDR_EPMAPPER_OBJ_FILES = librpc/gen_ndr/ndr_epmapper_c.o
+RPC_NDR_EPMAPPER_OBJ_FILES = $(gen_ndrsrcdir)/ndr_epmapper_c.o
[SUBSYSTEM::RPC_NDR_DBGIDL]
PUBLIC_DEPENDENCIES = dcerpc NDR_DBGIDL
-RPC_NDR_DBGIDL_OBJ_FILES = librpc/gen_ndr/ndr_dbgidl_c.o
+RPC_NDR_DBGIDL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dbgidl_c.o
[SUBSYSTEM::RPC_NDR_DSSETUP]
PUBLIC_DEPENDENCIES = dcerpc NDR_DSSETUP
-RPC_NDR_DSSETUP_OBJ_FILES = librpc/gen_ndr/ndr_dssetup_c.o
+RPC_NDR_DSSETUP_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dssetup_c.o
[SUBSYSTEM::RPC_NDR_MSGSVC]
PUBLIC_DEPENDENCIES = dcerpc NDR_MSGSVC
-RPC_NDR_MSGSVC_OBJ_FILES = librpc/gen_ndr/ndr_msgsvc_c.o
+RPC_NDR_MSGSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_msgsvc_c.o
[SUBSYSTEM::RPC_NDR_WINS]
PUBLIC_DEPENDENCIES = dcerpc NDR_WINS
-RPC_NDR_WINS_OBJ_FILES = librpc/gen_ndr/ndr_wins_c.o
+RPC_NDR_WINS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wins_c.o
[SUBSYSTEM::RPC_NDR_WINREG]
PUBLIC_DEPENDENCIES = dcerpc NDR_WINREG
-RPC_NDR_WINREG_OBJ_FILES = librpc/gen_ndr/ndr_winreg_c.o
+RPC_NDR_WINREG_OBJ_FILES = $(gen_ndrsrcdir)/ndr_winreg_c.o
[SUBSYSTEM::RPC_NDR_INITSHUTDOWN]
PUBLIC_DEPENDENCIES = dcerpc NDR_INITSHUTDOWN
-RPC_NDR_INITSHUTDOWN_OBJ_FILES = librpc/gen_ndr/ndr_initshutdown_c.o
+RPC_NDR_INITSHUTDOWN_OBJ_FILES = $(gen_ndrsrcdir)/ndr_initshutdown_c.o
[SUBSYSTEM::RPC_NDR_MGMT]
PRIVATE_DEPENDENCIES = NDR_MGMT
-RPC_NDR_MGMT_OBJ_FILES = librpc/gen_ndr/ndr_mgmt_c.o
+RPC_NDR_MGMT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_mgmt_c.o
[SUBSYSTEM::RPC_NDR_PROTECTED_STORAGE]
PUBLIC_DEPENDENCIES = dcerpc NDR_PROTECTED_STORAGE
-RPC_NDR_PROTECTED_STORAGE_OBJ_FILES = librpc/gen_ndr/ndr_protected_storage_c.o
+RPC_NDR_PROTECTED_STORAGE_OBJ_FILES = $(gen_ndrsrcdir)/ndr_protected_storage_c.o
[SUBSYSTEM::RPC_NDR_OXIDRESOLVER]
PUBLIC_DEPENDENCIES = dcerpc NDR_OXIDRESOLVER
-RPC_NDR_OXIDRESOLVER_OBJ_FILES = librpc/gen_ndr/ndr_oxidresolver_c.o
+RPC_NDR_OXIDRESOLVER_OBJ_FILES = $(gen_ndrsrcdir)/ndr_oxidresolver_c.o
[SUBSYSTEM::RPC_NDR_REMACT]
PUBLIC_DEPENDENCIES = dcerpc NDR_REMACT
-RPC_NDR_REMACT_OBJ_FILES = librpc/gen_ndr/ndr_remact_c.o
+RPC_NDR_REMACT_OBJ_FILES = $(gen_ndrsrcdir)/ndr_remact_c.o
[SUBSYSTEM::RPC_NDR_WZCSVC]
PUBLIC_DEPENDENCIES = dcerpc NDR_WZCSVC
-RPC_NDR_WZCSVC_OBJ_FILES = librpc/gen_ndr/ndr_wzcsvc_c.o
+RPC_NDR_WZCSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wzcsvc_c.o
[SUBSYSTEM::RPC_NDR_W32TIME]
PUBLIC_DEPENDENCIES = dcerpc NDR_W32TIME
-RPC_NDR_W32TIME_OBJ_FILES = librpc/gen_ndr/ndr_w32time_c.o
+RPC_NDR_W32TIME_OBJ_FILES = $(gen_ndrsrcdir)/ndr_w32time_c.o
[SUBSYSTEM::RPC_NDR_SCERPC]
PUBLIC_DEPENDENCIES = dcerpc NDR_SCERPC
-RPC_NDR_SCERPC_OBJ_FILES = librpc/gen_ndr/ndr_scerpc_c.o
+RPC_NDR_SCERPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_scerpc_c.o
[SUBSYSTEM::RPC_NDR_NTSVCS]
PUBLIC_DEPENDENCIES = dcerpc NDR_NTSVCS
-RPC_NDR_NTSVCS_OBJ_FILES = librpc/gen_ndr/ndr_ntsvcs_c.o
+RPC_NDR_NTSVCS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_ntsvcs_c.o
[SUBSYSTEM::RPC_NDR_NETLOGON]
PUBLIC_DEPENDENCIES = NDR_NETLOGON
-RPC_NDR_NETLOGON_OBJ_FILES = librpc/gen_ndr/ndr_netlogon_c.o
+RPC_NDR_NETLOGON_OBJ_FILES = $(gen_ndrsrcdir)/ndr_netlogon_c.o
[SUBSYSTEM::RPC_NDR_TRKWKS]
PUBLIC_DEPENDENCIES = dcerpc NDR_TRKWKS
-RPC_NDR_TRKWKS_OBJ_FILES = librpc/gen_ndr/ndr_trkwks_c.o
+RPC_NDR_TRKWKS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_trkwks_c.o
[SUBSYSTEM::RPC_NDR_KEYSVC]
PUBLIC_DEPENDENCIES = dcerpc NDR_KEYSVC
-RPC_NDR_KEYSVC_OBJ_FILES = librpc/gen_ndr/ndr_keysvc_c.o
+RPC_NDR_KEYSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_keysvc_c.o
[SUBSYSTEM::NDR_DCERPC]
PUBLIC_DEPENDENCIES = LIBNDR NDR_MISC
-NDR_DCERPC_OBJ_FILES = librpc/gen_ndr/ndr_dcerpc.o
+NDR_DCERPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dcerpc.o
-PUBLIC_HEADERS += $(addprefix librpc/, gen_ndr/dcerpc.h gen_ndr/ndr_dcerpc.h)
+PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, gen_ndr/dcerpc.h gen_ndr/ndr_dcerpc.h)
################################################
# Start SUBSYSTEM dcerpc
[LIBRARY::dcerpc]
-PRIVATE_PROTO_HEADER = rpc/dcerpc_proto.h
PRIVATE_DEPENDENCIES = \
samba-socket LIBCLI_RESOLVE LIBCLI_SMB LIBCLI_SMB2 \
LIBNDR NDR_DCERPC RPC_NDR_EPMAPPER \
@@ -585,15 +592,17 @@ PUBLIC_DEPENDENCIES = CREDENTIALS
# End SUBSYSTEM dcerpc
################################################
-PC_FILES += librpc/dcerpc.pc
+PC_FILES += $(librpcsrcdir)/dcerpc.pc
dcerpc_VERSION = 0.0.1
dcerpc_SOVERSION = 0
-dcerpc_OBJ_FILES = $(addprefix librpc/rpc/, dcerpc.o dcerpc_auth.o dcerpc_schannel.o dcerpc_util.o binding.o \
+dcerpc_OBJ_FILES = $(addprefix $(dcerpcsrcdir)/, dcerpc.o dcerpc_auth.o dcerpc_schannel.o dcerpc_util.o binding.o \
dcerpc_error.o dcerpc_smb.o dcerpc_smb2.o dcerpc_sock.o dcerpc_connect.o dcerpc_secondary.o)
+$(eval $(call proto_header_template,$(dcerpcsrcdir)/dcerpc_proto.h,$(dcerpc_OBJ_FILES:.o=.c)))
+
-PUBLIC_HEADERS += $(addprefix librpc/, rpc/dcerpc.h \
+PUBLIC_HEADERS += $(addprefix $(librpcsrcdir)/, rpc/dcerpc.h \
gen_ndr/mgmt.h gen_ndr/ndr_mgmt.h gen_ndr/ndr_mgmt_c.h \
gen_ndr/epmapper.h gen_ndr/ndr_epmapper.h gen_ndr/ndr_epmapper_c.h)
@@ -603,49 +612,49 @@ INIT_FUNCTION = ejs_init_rpcecho
SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_ECHO EJSRPC
-RPC_EJS_ECHO_OBJ_FILES = librpc/gen_ndr/ndr_echo_ejs.o
+RPC_EJS_ECHO_OBJ_FILES = $(gen_ndrsrcdir)/ndr_echo_ejs.o
[MODULE::RPC_EJS_MISC]
INIT_FUNCTION = ejs_init_misc
SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_MISC EJSRPC
-RPC_EJS_MISC_OBJ_FILES = librpc/gen_ndr/ndr_misc_ejs.o
+RPC_EJS_MISC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_misc_ejs.o
[MODULE::RPC_EJS_SAMR]
INIT_FUNCTION = ejs_init_samr
SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_SAMR EJSRPC RPC_EJS_LSA RPC_EJS_SECURITY RPC_EJS_MISC
-RPC_EJS_SAMR_OBJ_FILES = librpc/gen_ndr/ndr_samr_ejs.o
+RPC_EJS_SAMR_OBJ_FILES = $(gen_ndrsrcdir)/ndr_samr_ejs.o
[MODULE::RPC_EJS_SECURITY]
INIT_FUNCTION = ejs_init_security
SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_SECURITY EJSRPC
-RPC_EJS_SECURITY_OBJ_FILES = librpc/gen_ndr/ndr_security_ejs.o
+RPC_EJS_SECURITY_OBJ_FILES = $(gen_ndrsrcdir)/ndr_security_ejs.o
[MODULE::RPC_EJS_LSA]
INIT_FUNCTION = ejs_init_lsarpc
SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_LSA EJSRPC RPC_EJS_SECURITY RPC_EJS_MISC
-RPC_EJS_LSA_OBJ_FILES = librpc/gen_ndr/ndr_lsa_ejs.o
+RPC_EJS_LSA_OBJ_FILES = $(gen_ndrsrcdir)/ndr_lsa_ejs.o
[MODULE::RPC_EJS_DFS]
INIT_FUNCTION = ejs_init_netdfs
SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_DFS EJSRPC
-RPC_EJS_DFS_OBJ_FILES = librpc/gen_ndr/ndr_dfs_ejs.o
+RPC_EJS_DFS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_dfs_ejs.o
[MODULE::RPC_EJS_DRSUAPI]
INIT_FUNCTION = ejs_init_drsuapi
SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_DRSUAPI EJSRPC RPC_EJS_MISC RPC_EJS_SAMR
-RPC_EJS_DRSUAPI_OBJ_FILES = librpc/gen_ndr/ndr_drsuapi_ejs.o
+RPC_EJS_DRSUAPI_OBJ_FILES = $(gen_ndrsrcdir)/ndr_drsuapi_ejs.o
[MODULE::RPC_EJS_SPOOLSS]
INIT_FUNCTION = ejs_init_spoolss
@@ -653,28 +662,28 @@ SUBSYSTEM = smbcalls
ENABLE = NO
PRIVATE_DEPENDENCIES = dcerpc NDR_SPOOLSS EJSRPC
-RPC_EJS_SPOOLSS_OBJ_FILES = librpc/gen_ndr/ndr_spoolss_ejs.o
+RPC_EJS_SPOOLSS_OBJ_FILES = $(gen_ndrsrcdir)/ndr_spoolss_ejs.o
[MODULE::RPC_EJS_WKSSVC]
INIT_FUNCTION = ejs_init_wkssvc
SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_WKSSVC EJSRPC RPC_EJS_SRVSVC RPC_EJS_MISC
-RPC_EJS_WKSSVC_OBJ_FILES = librpc/gen_ndr/ndr_wkssvc_ejs.o
+RPC_EJS_WKSSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_wkssvc_ejs.o
[MODULE::RPC_EJS_SRVSVC]
INIT_FUNCTION = ejs_init_srvsvc
SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_SRVSVC EJSRPC RPC_EJS_MISC RPC_EJS_SVCCTL RPC_EJS_SECURITY
-RPC_EJS_SRVSVC_OBJ_FILES = librpc/gen_ndr/ndr_srvsvc_ejs.o
+RPC_EJS_SRVSVC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_srvsvc_ejs.o
[MODULE::RPC_EJS_EVENTLOG]
INIT_FUNCTION = ejs_init_eventlog
SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_EVENTLOG EJSRPC RPC_EJS_MISC
-RPC_EJS_EVENTLOG_OBJ_FILES = librpc/gen_ndr/ndr_eventlog_ejs.o
+RPC_EJS_EVENTLOG_OBJ_FILES = $(gen_ndrsrcdir)/ndr_eventlog_ejs.o
[MODULE::RPC_EJS_WINREG]
INIT_FUNCTION = ejs_init_winreg
@@ -682,113 +691,127 @@ SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_WINREG EJSRPC RPC_EJS_INITSHUTDOWN \
RPC_EJS_MISC RPC_EJS_SECURITY
-RPC_EJS_WINREG_OBJ_FILES = librpc/gen_ndr/ndr_winreg_ejs.o
+RPC_EJS_WINREG_OBJ_FILES = $(gen_ndrsrcdir)/ndr_winreg_ejs.o
[MODULE::RPC_EJS_INITSHUTDOWN]
INIT_FUNCTION = ejs_init_initshutdown
SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_INITSHUTDOWN EJSRPC
-RPC_EJS_INITSHUTDOWN_OBJ_FILES = librpc/gen_ndr/ndr_initshutdown_ejs.o
+RPC_EJS_INITSHUTDOWN_OBJ_FILES = $(gen_ndrsrcdir)/ndr_initshutdown_ejs.o
[MODULE::RPC_EJS_NETLOGON]
INIT_FUNCTION = ejs_init_netlogon
SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_NETLOGON EJSRPC RPC_EJS_SAMR RPC_EJS_SECURITY RPC_EJS_MISC
-RPC_EJS_NETLOGON_OBJ_FILES = librpc/gen_ndr/ndr_netlogon_ejs.o
+RPC_EJS_NETLOGON_OBJ_FILES = $(gen_ndrsrcdir)/ndr_netlogon_ejs.o
[MODULE::RPC_EJS_SVCCTL]
INIT_FUNCTION = ejs_init_svcctl
SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_SVCCTL EJSRPC RPC_EJS_MISC
-RPC_EJS_SVCCTL_OBJ_FILES = librpc/gen_ndr/ndr_svcctl_ejs.o
+RPC_EJS_SVCCTL_OBJ_FILES = $(gen_ndrsrcdir)/ndr_svcctl_ejs.o
[MODULE::RPC_EJS_IRPC]
INIT_FUNCTION = ejs_init_irpc
SUBSYSTEM = smbcalls
PRIVATE_DEPENDENCIES = dcerpc NDR_IRPC EJSRPC
-RPC_EJS_IRPC_OBJ_FILES = librpc/gen_ndr/ndr_irpc_ejs.o
+RPC_EJS_IRPC_OBJ_FILES = $(gen_ndrsrcdir)/ndr_irpc_ejs.o
[PYTHON::swig_dcerpc]
SWIG_FILE = rpc/dcerpc.i
PUBLIC_DEPENDENCIES = LIBCLI_SMB NDR_MISC LIBSAMBA-UTIL LIBSAMBA-HOSTCONFIG dcerpc_samr RPC_NDR_LSA DYNCONFIG
-swig_dcerpc_OBJ_FILES = librpc/rpc/dcerpc_wrap.o
+swig_dcerpc_OBJ_FILES = $(dcerpcsrcdir)/dcerpc_wrap.o
[PYTHON::python_echo]
PRIVATE_DEPENDENCIES = RPC_NDR_ECHO PYTALLOC param swig_credentials
-python_echo_OBJ_FILES = librpc/gen_ndr/py_echo.o
+python_echo_OBJ_FILES = $(gen_ndrsrcdir)/py_echo.o
[PYTHON::python_winreg]
PRIVATE_DEPENDENCIES = RPC_NDR_WINREG python_misc PYTALLOC param swig_credentials
-python_winreg_OBJ_FILES = librpc/gen_ndr/py_winreg.o
+python_winreg_OBJ_FILES = $(gen_ndrsrcdir)/py_winreg.o
[PYTHON::python_dcerpc_misc]
PRIVATE_DEPENDENCIES = PYTALLOC
-python_dcerpc_misc_OBJ_FILES = librpc/gen_ndr/py_misc.o
+python_dcerpc_misc_OBJ_FILES = $(gen_ndrsrcdir)/py_misc.o
[PYTHON::python_initshutdown]
PRIVATE_DEPENDENCIES = RPC_NDR_INITSHUTDOWN PYTALLOC param swig_credentials
-python_initshutdown_OBJ_FILES = librpc/gen_ndr/py_initshutdown.o
+python_initshutdown_OBJ_FILES = $(gen_ndrsrcdir)/py_initshutdown.o
[PYTHON::python_epmapper]
PRIVATE_DEPENDENCIES = PYTALLOC param swig_credentials
-python_epmapper_OBJ_FILES = librpc/gen_ndr/py_epmapper.o
+python_epmapper_OBJ_FILES = $(gen_ndrsrcdir)/py_epmapper.o
[PYTHON::python_mgmt]
PRIVATE_DEPENDENCIES = dcerpc_mgmt PYTALLOC param swig_credentials
-python_mgmt_OBJ_FILES = librpc/gen_ndr/py_mgmt.o
+python_mgmt_OBJ_FILES = $(gen_ndrsrcdir)/py_mgmt.o
[PYTHON::python_atsvc]
PRIVATE_DEPENDENCIES = dcerpc_atsvc PYTALLOC param swig_credentials
-python_atsvc_OBJ_FILES = librpc/gen_ndr/py_atsvc.o
+python_atsvc_OBJ_FILES = $(gen_ndrsrcdir)/py_atsvc.o
[PYTHON::python_samr]
PRIVATE_DEPENDENCIES = dcerpc_samr PYTALLOC python_dcerpc_security python_lsa python_dcerpc_misc swig_credentials param
-python_samr_OBJ_FILES = librpc/gen_ndr/py_samr.o
+python_samr_OBJ_FILES = $(gen_ndrsrcdir)/py_samr.o
[PYTHON::python_svcctl]
PRIVATE_DEPENDENCIES = RPC_NDR_SVCCTL PYTALLOC param swig_credentials
-python_svcctl_OBJ_FILES = librpc/gen_ndr/py_svcctl.o
+python_svcctl_OBJ_FILES = $(gen_ndrsrcdir)/py_svcctl.o
[PYTHON::python_lsa]
PRIVATE_DEPENDENCIES = RPC_NDR_LSA PYTALLOC param swig_credentials
-python_lsa_OBJ_FILES = librpc/gen_ndr/py_lsa.o
+python_lsa_OBJ_FILES = $(gen_ndrsrcdir)/py_lsa.o
[PYTHON::python_wkssvc]
PRIVATE_DEPENDENCIES = RPC_NDR_WKSSVC PYTALLOC param swig_credentials
-python_wkssvc_OBJ_FILES = librpc/gen_ndr/py_wkssvc.o
+python_wkssvc_OBJ_FILES = $(gen_ndrsrcdir)/py_wkssvc.o
[PYTHON::python_dfs]
PRIVATE_DEPENDENCIES = RPC_NDR_DFS PYTALLOC param swig_credentials
-python_dfs_OBJ_FILES = librpc/gen_ndr/py_dfs.o
+python_dfs_OBJ_FILES = $(gen_ndrsrcdir)/py_dfs.o
[PYTHON::python_unixinfo]
PRIVATE_DEPENDENCIES = RPC_NDR_UNIXINFO PYTALLOC param swig_credentials python_dcerpc_security python_dcerpc_misc
-python_unixinfo_OBJ_FILES = librpc/gen_ndr/py_unixinfo.o
+python_unixinfo_OBJ_FILES = $(gen_ndrsrcdir)/py_unixinfo.o
[PYTHON::python_drsuapi]
PRIVATE_DEPENDENCIES = RPC_NDR_DRSUAPI PYTALLOC param swig_credentials
-python_drsuapi_OBJ_FILES = librpc/gen_ndr/py_drsuapi.o
+python_drsuapi_OBJ_FILES = $(gen_ndrsrcdir)/py_drsuapi.o
[PYTHON::python_dcerpc_security]
PRIVATE_DEPENDENCIES = PYTALLOC
-python_dcerpc_security_OBJ_FILES = librpc/gen_ndr/py_security.o
+python_dcerpc_security_OBJ_FILES = $(gen_ndrsrcdir)/py_security.o
+
+$(IDL_HEADER_FILES) $(IDL_NDR_PARSE_H_FILES) $(IDL_NDR_PARSE_C_FILES) \
+ $(IDL_NDR_CLIENT_C_FILES) $(IDL_NDR_CLIENT_H_FILES) \
+ $(IDL_NDR_SERVER_C_FILES) $(IDL_SWIG_FILES) \
+ $(IDL_NDR_EJS_C_FILES) $(IDL_NDR_EJS_H_FILES) \
+ $(IDL_NDR_PY_C_FILES) $(IDL_NDR_PY_H_FILES): idl
+
+idl_full:: $(pidldir)/lib/Parse/Pidl/IDL.pm $(pidldir)/lib/Parse/Pidl/Expr.pm
+ @CPP="$(CPP)" PIDL="$(PIDL)" $(librpcsrcdir)/scripts/build_idl.sh FULL $(librpcsrcdir)/idl $(librpcsrcdir)/gen_ndr
+
+idl:: $(pidldir)/lib/Parse/Pidl/IDL.pm $(pidldir)/lib/Parse/Pidl/Expr.pm
+ @CPP="$(CPP)" PIDL="$(PIDL)" $(librpcsrcdir)/scripts/build_idl.sh PARTIAL $(librpcsrcdir)/idl $(librpcsrcdir)/gen_ndr
+
+
diff --git a/source4/librpc/idl-deps.pl b/source4/librpc/idl-deps.pl
index d5bfe0b2ec..e630ee4f61 100755
--- a/source4/librpc/idl-deps.pl
+++ b/source4/librpc/idl-deps.pl
@@ -6,17 +6,17 @@ my %vars = ();
foreach(@ARGV) {
push (@{$vars{IDL_FILES}}, $_);
my $b = $_; $b =~ s/.*\/(.*?).idl$/$1/;
- push (@{$vars{IDL_HEADER_FILES}}, "librpc/gen_ndr/$b.h");
- push (@{$vars{IDL_NDR_PARSE_H_FILES}}, "librpc/gen_ndr/ndr_$b.h");
- push (@{$vars{IDL_NDR_PARSE_C_FILES}}, "librpc/gen_ndr/ndr_$b.c");
- push (@{$vars{IDL_NDR_CLIENT_C_FILES}}, "librpc/gen_ndr/ndr_$b\_c.c");
- push (@{$vars{IDL_NDR_CLIENT_H_FILES}}, "librpc/gen_ndr/ndr_$b\_c.h");
- push (@{$vars{IDL_SWIG_FILES}}, "librpc/gen_ndr/$b.i");
- push (@{$vars{IDL_NDR_SERVER_C_FILES}}, "librpc/gen_ndr/ndr_$b\_s.c");
- push (@{$vars{IDL_NDR_EJS_C_FILES}}, "librpc/gen_ndr/ndr_$b\_ejs.c");
- push (@{$vars{IDL_NDR_EJS_H_FILES}}, "librpc/gen_ndr/ndr_$b\_ejs.h");
- push (@{$vars{IDL_NDR_PY_C_FILES}}, "librpc/gen_ndr/py_$b.c");
- push (@{$vars{IDL_NDR_PY_H_FILES}}, "librpc/gen_ndr/py_$b.h");
+ push (@{$vars{IDL_HEADER_FILES}}, "\$(librpcsrcdir)/gen_ndr/$b.h");
+ push (@{$vars{IDL_NDR_PARSE_H_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b.h");
+ push (@{$vars{IDL_NDR_PARSE_C_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b.c");
+ push (@{$vars{IDL_NDR_CLIENT_C_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b\_c.c");
+ push (@{$vars{IDL_NDR_CLIENT_H_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b\_c.h");
+ push (@{$vars{IDL_SWIG_FILES}}, "\$(librpcsrcdir)/gen_ndr/$b.i");
+ push (@{$vars{IDL_NDR_SERVER_C_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b\_s.c");
+ push (@{$vars{IDL_NDR_EJS_C_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b\_ejs.c");
+ push (@{$vars{IDL_NDR_EJS_H_FILES}}, "\$(librpcsrcdir)/gen_ndr/ndr_$b\_ejs.h");
+ push (@{$vars{IDL_NDR_PY_C_FILES}}, "\$(librpcsrcdir)/gen_ndr/py_$b.c");
+ push (@{$vars{IDL_NDR_PY_H_FILES}}, "\$(librpcsrcdir)/gen_ndr/py_$b.h");
}
foreach (keys %vars) {
diff --git a/source4/librpc/idl/dcerpc.idl b/source4/librpc/idl/dcerpc.idl
index b2c67542f5..e228d85c46 100644
--- a/source4/librpc/idl/dcerpc.idl
+++ b/source4/librpc/idl/dcerpc.idl
@@ -116,6 +116,7 @@ interface dcerpc
uint16 context_id;
uint8 cancel_count;
uint32 status;
+ [flag(NDR_REMAINING)] DATA_BLOB _pad;
} dcerpc_fault;
/* the auth types we know about */
diff --git a/source4/script/build_idl.sh b/source4/librpc/scripts/build_idl.sh
index ea0cb78b0e..5796f40c61 100755
--- a/source4/script/build_idl.sh
+++ b/source4/librpc/scripts/build_idl.sh
@@ -1,24 +1,26 @@
#!/bin/sh
FULLBUILD=$1
-shift 1
+IDLDIR=$2
+OUTDIR=$3
+shift 3
PIDL_EXTRA_ARGS="$*"
-[ -d librpc/gen_ndr ] || mkdir -p librpc/gen_ndr || exit 1
+[ -d $OUTDIR ] || mkdir -p $OUTDIR || exit 1
-PIDL="$PERL $srcdir/pidl/pidl --outputdir librpc/gen_ndr --header --ndr-parser --server --client --swig --ejs --python $PIDL_EXTRA_ARGS"
+PIDL="$PIDL --outputdir $OUTDIR --header --ndr-parser --server --client --swig --ejs --python $PIDL_EXTRA_ARGS"
if [ x$FULLBUILD = xFULL ]; then
- echo Rebuilding all idl files in librpc/idl
- $PIDL $srcdir/librpc/idl/*.idl || exit 1
+ echo Rebuilding all idl files in $IDLDIR
+ $PIDL $IDLDIR/*.idl || exit 1
exit 0
fi
list=""
-for f in $srcdir/librpc/idl/*.idl ; do
+for f in $IDLDIR/*.idl ; do
basename=`basename $f .idl`
- ndr="librpc/gen_ndr/ndr_$basename.c"
+ ndr="$OUTDIR/ndr_$basename.c"
# blergh - most shells don't have the -nt function
if [ -f $ndr ]; then
if [ x`find $f -newer $ndr -print` = x$f ]; then
diff --git a/source4/main.mk b/source4/main.mk
index b8364aca5a..5e31044c09 100644
--- a/source4/main.mk
+++ b/source4/main.mk
@@ -1,31 +1,95 @@
mkinclude dynconfig.mk
+heimdalsrcdir := heimdal
mkinclude heimdal_build/config.mk
mkinclude config.mk
+dsdbsrcdir := dsdb
mkinclude dsdb/config.mk
+smbdsrcdir := smbd
mkinclude smbd/config.mk
+clustersrcdir := cluster
mkinclude cluster/config.mk
mkinclude smbd/process_model.mk
+libnetsrcdir := libnet
mkinclude libnet/config.mk
+authsrcdir := auth
mkinclude auth/config.mk
+nsswitchsrcdir := nsswitch
mkinclude nsswitch/config.mk
+libsrcdir := lib
+mkinclude lib/samba3/config.mk
+libsocketsrcdir := lib/socket
+mkinclude lib/socket/config.mk
+libcharsetsrcdir := lib/charset
+mkinclude lib/charset/config.mk
+ldb_sambasrcdir := lib/ldb-samba
+mkinclude lib/ldb-samba/config.mk
+libtlssrcdir := lib/tls
+mkinclude lib/tls/config.mk
+libregistrysrcdir := lib/registry
+mkinclude lib/registry/config.mk
+libmessagingsrcdir := lib/messaging
+mkinclude lib/messaging/config.mk
+libeventssrcdir := lib/events
+mkinclude lib/events/config.mk
+libcmdlinesrcdir := lib/cmdline
+mkinclude lib/cmdline/config.mk
+socketwrappersrcdir := lib/socket_wrapper
+mkinclude lib/socket_wrapper/config.mk
+nsswrappersrcdir := lib/nss_wrapper
+mkinclude lib/nss_wrapper/config.mk
+appwebsrcdir := lib/appweb
+mkinclude lib/appweb/config.mk
+libstreamsrcdir := lib/stream
+mkinclude lib/stream/config.mk
+libutilsrcdir := lib/util
+mkinclude lib/util/config.mk
+libtdrsrcdir := lib/tdr
+mkinclude lib/tdr/config.mk
+libdbwrapsrcdir := lib/dbwrap
+mkinclude lib/dbwrap/config.mk
+libcryptosrcdir := lib/crypto
+mkinclude lib/crypto/config.mk
+libtorturesrcdir := lib/torture
+mkinclude lib/torture/config.mk
+libcompressionsrcdir := lib/compression
+libgencachesrcdir := lib
mkinclude lib/basic.mk
+paramsrcdir := param
mkinclude param/config.mk
+smb_serversrcdir := smb_server
mkinclude smb_server/config.mk
+rpc_serversrcdir := rpc_server
mkinclude rpc_server/config.mk
+ldap_serversrcdir := ldap_server
mkinclude ldap_server/config.mk
+web_serversrcdir := web_server
mkinclude web_server/config.mk
+winbindsrcdir := winbind
mkinclude winbind/config.mk
+nbt_serversrcdir := nbt_server
mkinclude nbt_server/config.mk
+wrepl_serversrcdir := wrepl_server
mkinclude wrepl_server/config.mk
+cldap_serversrcdir := cldap_server
mkinclude cldap_server/config.mk
+utilssrcdir := utils
mkinclude utils/net/config.mk
mkinclude utils/config.mk
+ntvfssrcdir := ntvfs
mkinclude ntvfs/config.mk
+ntptrsrcdir := ntptr
mkinclude ntptr/config.mk
+torturesrcdir := torture
mkinclude torture/config.mk
+librpcsrcdir := librpc
mkinclude librpc/config.mk
+clientsrcdir := client
mkinclude client/config.mk
+libclisrcdir := libcli
mkinclude libcli/config.mk
+ejsscriptsrcdir := scripting/ejs
mkinclude scripting/ejs/config.mk
+pyscriptsrcdir := scripting/python
mkinclude scripting/python/config.mk
+kdcsrcdir := kdc
mkinclude kdc/config.mk
diff --git a/source4/nbt_server/config.mk b/source4/nbt_server/config.mk
index 84e6b661bf..bb5dec7661 100644
--- a/source4/nbt_server/config.mk
+++ b/source4/nbt_server/config.mk
@@ -3,13 +3,14 @@
#######################
# Start SUBSYSTEM WINSDB
[SUBSYSTEM::WINSDB]
-PRIVATE_PROTO_HEADER = wins/winsdb_proto.h
PUBLIC_DEPENDENCIES = \
LIBLDB
# End SUBSYSTEM WINSDB
#######################
-WINSDB_OBJ_FILES = $(addprefix nbt_server/wins/, winsdb.o wins_hook.o)
+WINSDB_OBJ_FILES = $(addprefix $(nbt_serversrcdir)/wins/, winsdb.o wins_hook.o)
+
+$(eval $(call proto_header_template,$(nbt_serversrcdir)/wins/winsdb_proto.h,$(WINSDB_OBJ_FILES:.o=.c)))
#######################
# Start MODULE ldb_wins_ldb
@@ -22,40 +23,42 @@ PRIVATE_DEPENDENCIES = \
# End MODULE ldb_wins_ldb
#######################
-ldb_wins_ldb_OBJ_FILES = nbt_server/wins/wins_ldb.o
+ldb_wins_ldb_OBJ_FILES = $(nbt_serversrcdir)/wins/wins_ldb.o
#######################
# Start SUBSYSTEM NBTD_WINS
[SUBSYSTEM::NBTD_WINS]
-PRIVATE_PROTO_HEADER = wins/winsserver_proto.h
PRIVATE_DEPENDENCIES = \
LIBCLI_NBT WINSDB
# End SUBSYSTEM NBTD_WINS
#######################
-NBTD_WINS_OBJ_FILES = $(addprefix nbt_server/wins/, winsserver.o winsclient.o winswack.o wins_dns_proxy.o)
+
+NBTD_WINS_OBJ_FILES = $(addprefix $(nbt_serversrcdir)/wins/, winsserver.o winsclient.o winswack.o wins_dns_proxy.o)
+
+$(eval $(call proto_header_template,$(nbt_serversrcdir)/wins/winsserver_proto.h,$(NBTD_WINS_OBJ_FILES:.o=.c)))
#######################
# Start SUBSYSTEM NBTD_DGRAM
[SUBSYSTEM::NBTD_DGRAM]
-PRIVATE_PROTO_HEADER = dgram/proto.h
PRIVATE_DEPENDENCIES = \
LIBCLI_DGRAM
# End SUBSYSTEM NBTD_DGRAM
#######################
-NBTD_DGRAM_OBJ_FILES = $(addprefix nbt_server/dgram/, request.o netlogon.o ntlogon.o browse.o)
+NBTD_DGRAM_OBJ_FILES = $(addprefix $(nbt_serversrcdir)/dgram/, request.o netlogon.o ntlogon.o browse.o)
+
+$(eval $(call proto_header_template,$(nbt_serversrcdir)/dgram/proto.h,$(NBTD_DGRAM_OBJ_FILES:.o=.c)))
#######################
# Start SUBSYSTEM NBTD
[SUBSYSTEM::NBT_SERVER]
-PRIVATE_PROTO_HEADER = nbt_server_proto.h
PRIVATE_DEPENDENCIES = \
LIBCLI_NBT NBTD_WINS NBTD_DGRAM
# End SUBSYSTEM NBTD
#######################
-NBT_SERVER_OBJ_FILES = $(addprefix nbt_server/, \
+NBT_SERVER_OBJ_FILES = $(addprefix $(nbt_serversrcdir)/, \
interfaces.o \
register.o \
query.o \
@@ -64,10 +67,12 @@ NBT_SERVER_OBJ_FILES = $(addprefix nbt_server/, \
packet.o \
irpc.o)
+$(eval $(call proto_header_template,$(nbt_serversrcdir)/nbt_server_proto.h,$(NBT_SERVER_OBJ_FILES:.o=.c)))
+
[MODULE::service_nbtd]
INIT_FUNCTION = server_service_nbtd_init
SUBSYSTEM = smbd
PRIVATE_DEPENDENCIES = NBT_SERVER process_model
service_nbtd_OBJ_FILES = \
- nbt_server/nbt_server.o
+ $(nbt_serversrcdir)/nbt_server.o
diff --git a/source4/nsswitch/config.mk b/source4/nsswitch/config.mk
index a0ceff0033..e8b9600882 100644
--- a/source4/nsswitch/config.mk
+++ b/source4/nsswitch/config.mk
@@ -1,7 +1,7 @@
[SUBSYSTEM::LIBWINBIND-CLIENT]
PRIVATE_DEPENDENCIES = SOCKET_WRAPPER
-LIBWINBIND-CLIENT_OBJ_FILES = nsswitch/wb_common.o
+LIBWINBIND-CLIENT_OBJ_FILES = $(nsswitchsrcdir)/wb_common.o
#################################
# Start BINARY nsstest
@@ -14,7 +14,7 @@ PRIVATE_DEPENDENCIES = \
# End BINARY nsstest
#################################
-nsstest_OBJ_FILES = nsswitch/nsstest.o
+nsstest_OBJ_FILES = $(nsswitchsrcdir)/nsstest.o
#################################
# Start BINARY wbinfo
@@ -31,4 +31,4 @@ PRIVATE_DEPENDENCIES = \
#################################
wbinfo_OBJ_FILES = \
- nsswitch/wbinfo.o
+ $(nsswitchsrcdir)/wbinfo.o
diff --git a/source4/ntptr/config.mk b/source4/ntptr/config.mk
index dda4c29444..71b3bc05a8 100644
--- a/source4/ntptr/config.mk
+++ b/source4/ntptr/config.mk
@@ -10,17 +10,18 @@ PRIVATE_DEPENDENCIES = \
# End MODULE ntptr_simple_ldb
################################################
-ntptr_simple_ldb_OBJ_FILES = ntptr/simple_ldb/ntptr_simple_ldb.o
+ntptr_simple_ldb_OBJ_FILES = $(ntptrsrcdir)/simple_ldb/ntptr_simple_ldb.o
################################################
# Start SUBSYSTEM ntptr
[SUBSYSTEM::ntptr]
-PRIVATE_PROTO_HEADER = ntptr_proto.h
PUBLIC_DEPENDENCIES = DCERPC_COMMON
#
# End SUBSYSTEM ntptr
################################################
ntptr_OBJ_FILES = \
- ntptr/ntptr_base.o \
- ntptr/ntptr_interface.o
+ $(ntptrsrcdir)/ntptr_base.o \
+ $(ntptrsrcdir)/ntptr_interface.o
+
+$(eval $(call proto_header_template,$(ntptrsrcdir)/ntptr_proto.h,$(ntptr_OBJ_FILES:.o=.c)))
diff --git a/source4/ntvfs/common/config.mk b/source4/ntvfs/common/config.mk
index c66257b73f..1fe093bb69 100644
--- a/source4/ntvfs/common/config.mk
+++ b/source4/ntvfs/common/config.mk
@@ -1,11 +1,12 @@
################################################
# Start LIBRARY ntvfs_common
[SUBSYSTEM::ntvfs_common]
-PRIVATE_PROTO_HEADER = proto.h
PUBLIC_DEPENDENCIES = NDR_OPENDB NDR_NOTIFY sys_notify sys_lease share LIBDBWRAP
PRIVATE_DEPENDENCIES = brlock_ctdb opendb_ctdb
# End LIBRARY ntvfs_common
################################################
-ntvfs_common_OBJ_FILES = $(addprefix ntvfs/common/, init.o brlock.o brlock_tdb.o opendb.o opendb_tdb.o notify.o)
+ntvfs_common_OBJ_FILES = $(addprefix $(ntvfssrcdir)/common/, init.o brlock.o brlock_tdb.o opendb.o opendb_tdb.o notify.o)
+
+$(eval $(call proto_header_template,$(ntvfssrcdir)/common/proto.h,$(ntvfs_common_OBJ_FILES:.o=.c)))
diff --git a/source4/ntvfs/config.mk b/source4/ntvfs/config.mk
index ceb952d25c..bf34c4082a 100644
--- a/source4/ntvfs/config.mk
+++ b/source4/ntvfs/config.mk
@@ -14,7 +14,7 @@ PRIVATE_DEPENDENCIES = \
# End MODULE ntvfs_cifs
################################################
-ntvfs_cifs_OBJ_FILES = ntvfs/cifs/vfs_cifs.o
+ntvfs_cifs_OBJ_FILES = $(ntvfssrcdir)/cifs/vfs_cifs.o
################################################
@@ -35,11 +35,12 @@ ntvfs_smb2_OBJ_FILES = ntvfs/smb2/vfs_smb2.o
[MODULE::ntvfs_simple]
INIT_FUNCTION = ntvfs_simple_init
SUBSYSTEM = ntvfs
-PRIVATE_PROTO_HEADER = simple/proto.h
# End MODULE ntvfs_simple
################################################
-ntvfs_simple_OBJ_FILES = $(addprefix ntvfs/simple/, vfs_simple.o svfs_util.o)
+ntvfs_simple_OBJ_FILES = $(addprefix $(ntvfssrcdir)/simple/, vfs_simple.o svfs_util.o)
+
+$(eval $(call proto_header_template,$(ntvfssrcdir)/simple/proto.h,$(ntvfs_simple_OBJ_FILES:.o=.c)))
################################################
# Start MODULE ntvfs_cifsposix
@@ -47,12 +48,13 @@ ntvfs_simple_OBJ_FILES = $(addprefix ntvfs/simple/, vfs_simple.o svfs_util.o)
#ENABLE = NO
INIT_FUNCTION = ntvfs_cifs_posix_init
SUBSYSTEM = ntvfs
-PRIVATE_PROTO_HEADER = cifs_posix_cli/proto.h
# End MODULE ntvfs_cifsposix
################################################
ntvfs_cifsposix_OBJ_FILES = \
- $(addprefix ntvfs/cifs_posix_cli/, vfs_cifs_posix.o svfs_util.o)
+ $(addprefix $(ntvfssrcdir)/cifs_posix_cli/, vfs_cifs_posix.o svfs_util.o)
+
+$(eval $(call proto_header_template,$(ntvfssrcdir)/cifs_posix_cli/proto.h,$(ntvfs_cifsposix_OBJ_FILES:.o=.c)))
################################################
# Start MODULE ntvfs_print
@@ -62,19 +64,20 @@ SUBSYSTEM = ntvfs
# End MODULE ntvfs_print
################################################
-ntvfs_print_OBJ_FILES = ntvfs/print/vfs_print.o
+ntvfs_print_OBJ_FILES = $(ntvfssrcdir)/print/vfs_print.o
################################################
# Start MODULE ntvfs_ipc
[MODULE::ntvfs_ipc]
SUBSYSTEM = ntvfs
INIT_FUNCTION = ntvfs_ipc_init
-PRIVATE_PROTO_HEADER = ipc/proto.h
PRIVATE_DEPENDENCIES = dcerpc_server DCERPC_COMMON
# End MODULE ntvfs_ipc
################################################
-ntvfs_ipc_OBJ_FILES = $(addprefix ntvfs/ipc/, vfs_ipc.o ipc_rap.o rap_server.o)
+ntvfs_ipc_OBJ_FILES = $(addprefix $(ntvfssrcdir)/ipc/, vfs_ipc.o ipc_rap.o rap_server.o)
+
+$(eval $(call proto_header_template,$(ntvfssrcdir)/ipc/proto.h,$(ntvfs_ipc_OBJ_FILES:.o=.c)))
################################################
# Start MODULE ntvfs_nbench
@@ -84,16 +87,17 @@ INIT_FUNCTION = ntvfs_nbench_init
# End MODULE ntvfs_nbench
################################################
-ntvfs_nbench_OBJ_FILES = ntvfs/nbench/vfs_nbench.o
+ntvfs_nbench_OBJ_FILES = $(ntvfssrcdir)/nbench/vfs_nbench.o
################################################
# Start SUBSYSTEM NTVFS
[SUBSYSTEM::ntvfs]
-PRIVATE_PROTO_HEADER = ntvfs_proto.h
-ntvfs_OBJ_FILES = $(addprefix ntvfs/, ntvfs_base.o ntvfs_generic.o ntvfs_interface.o ntvfs_util.o)
+ntvfs_OBJ_FILES = $(addprefix $(ntvfssrcdir)/, ntvfs_base.o ntvfs_generic.o ntvfs_interface.o ntvfs_util.o)
+
+$(eval $(call proto_header_template,$(ntvfssrcdir)/ntvfs_proto.h,$(ntvfs_OBJ_FILES:.o=.c)))
-# PUBLIC_HEADERS += ntvfs/ntvfs.h
+# PUBLIC_HEADERS += $(ntvfssrcdir)/ntvfs.h
#
# End SUBSYSTEM NTVFS
################################################
diff --git a/source4/ntvfs/posix/config.mk b/source4/ntvfs/posix/config.mk
index 865a0ffd4a..0ee3e3be16 100644
--- a/source4/ntvfs/posix/config.mk
+++ b/source4/ntvfs/posix/config.mk
@@ -7,7 +7,7 @@ PRIVATE_DEPENDENCIES = NDR_XATTR ntvfs_posix
# End MODULE pvfs_acl_xattr
################################################
-pvfs_acl_xattr_OBJ_FILES = ntvfs/posix/pvfs_acl_xattr.o
+pvfs_acl_xattr_OBJ_FILES = $(ntvfssrcdir)/posix/pvfs_acl_xattr.o
################################################
# Start MODULE pvfs_acl_nfs4
@@ -18,7 +18,7 @@ PRIVATE_DEPENDENCIES = NDR_NFS4ACL SAMDB ntvfs_posix
# End MODULE pvfs_acl_nfs4
################################################
-pvfs_acl_nfs4_OBJ_FILES = ntvfs/posix/pvfs_acl_nfs4.o
+pvfs_acl_nfs4_OBJ_FILES = $(ntvfssrcdir)/posix/pvfs_acl_nfs4.o
################################################
[MODULE::pvfs_aio]
@@ -26,7 +26,7 @@ SUBSYSTEM = ntvfs
PRIVATE_DEPENDENCIES = LIBAIO_LINUX
################################################
-pvfs_aio_OBJ_FILES = ntvfs/posix/pvfs_aio.o
+pvfs_aio_OBJ_FILES = $(ntvfssrcdir)/posix/pvfs_aio.o
################################################
# Start MODULE ntvfs_posix
@@ -34,14 +34,13 @@ pvfs_aio_OBJ_FILES = ntvfs/posix/pvfs_aio.o
SUBSYSTEM = ntvfs
OUTPUT_TYPE = MERGED_OBJ
INIT_FUNCTION = ntvfs_posix_init
-PRIVATE_PROTO_HEADER = vfs_posix_proto.h
#PRIVATE_DEPENDENCIES = pvfs_acl_xattr pvfs_acl_nfs4
PRIVATE_DEPENDENCIES = NDR_XATTR WRAP_XATTR BLKID ntvfs_common MESSAGING pvfs_aio \
LIBWBCLIENT
# End MODULE ntvfs_posix
################################################
-ntvfs_posix_OBJ_FILES = $(addprefix ntvfs/posix/, \
+ntvfs_posix_OBJ_FILES = $(addprefix $(ntvfssrcdir)/posix/, \
vfs_posix.o \
pvfs_util.o \
pvfs_search.o \
@@ -71,3 +70,5 @@ ntvfs_posix_OBJ_FILES = $(addprefix ntvfs/posix/, \
xattr_system.o \
xattr_tdb.o)
+$(eval $(call proto_header_template,$(ntvfssrcdir)/posix/vfs_posix_proto.h,$(ntvfs_posix_OBJ_FILES:.o=.c)))
+
diff --git a/source4/ntvfs/sysdep/config.mk b/source4/ntvfs/sysdep/config.mk
index 68be660049..1122d5c39d 100644
--- a/source4/ntvfs/sysdep/config.mk
+++ b/source4/ntvfs/sysdep/config.mk
@@ -6,7 +6,7 @@ INIT_FUNCTION = sys_notify_inotify_init
# End MODULE sys_notify_inotify
################################################
-sys_notify_inotify_OBJ_FILES = ntvfs/sysdep/inotify.o
+sys_notify_inotify_OBJ_FILES = $(ntvfssrcdir)/sysdep/inotify.o
################################################
# Start SUBSYSTEM sys_notify
@@ -14,12 +14,12 @@ sys_notify_inotify_OBJ_FILES = ntvfs/sysdep/inotify.o
# End SUBSYSTEM sys_notify
################################################
-sys_notify_OBJ_FILES = ntvfs/sysdep/sys_notify.o
+sys_notify_OBJ_FILES = $(ntvfssrcdir)/sysdep/sys_notify.o
[SUBSYSTEM::sys_lease_linux]
-sys_lease_linux_OBJ_FILES = ntvfs/sysdep/sys_lease_linux.o
+sys_lease_linux_OBJ_FILES = $(ntvfssrcdir)/sysdep/sys_lease_linux.o
[SUBSYSTEM::sys_lease]
-sys_lease_OBJ_FILES = ntvfs/sysdep/sys_lease.o
+sys_lease_OBJ_FILES = $(ntvfssrcdir)/sysdep/sys_lease.o
diff --git a/source4/ntvfs/unixuid/config.mk b/source4/ntvfs/unixuid/config.mk
index 968e56bde4..6377657cec 100644
--- a/source4/ntvfs/unixuid/config.mk
+++ b/source4/ntvfs/unixuid/config.mk
@@ -7,4 +7,4 @@ PRIVATE_DEPENDENCIES = SAMDB NSS_WRAPPER
# End MODULE ntvfs_unixuid
################################################
-ntvfs_unixuid_OBJ_FILES = ntvfs/unixuid/vfs_unixuid.o
+ntvfs_unixuid_OBJ_FILES = $(ntvfssrcdir)/unixuid/vfs_unixuid.o
diff --git a/source4/param/config.mk b/source4/param/config.mk
index 4c202dc6de..a25dd32194 100644
--- a/source4/param/config.mk
+++ b/source4/param/config.mk
@@ -5,35 +5,28 @@ PRIVATE_DEPENDENCIES = DYNCONFIG LIBREPLACE_EXT CHARSET
LIBSAMBA-HOSTCONFIG_VERSION = 0.0.1
LIBSAMBA-HOSTCONFIG_SOVERSION = 0
-LIBSAMBA-HOSTCONFIG_OBJ_FILES = param/loadparm.o \
- param/generic.o \
- param/util.o \
- lib/version.o
-
-LIBSAMBA-CONFIG_OBJ_FILES = param/loadparm.o \
- param/params.o \
- param/generic.o \
- param/util.o \
- lib/version.o
+LIBSAMBA-HOSTCONFIG_OBJ_FILES = $(addprefix $(paramsrcdir)/, \
+ loadparm.o generic.o util.o) lib/version.o
PUBLIC_HEADERS += param/param.h
-PC_FILES += param/samba-hostconfig.pc
+PC_FILES += $(paramsrcdir)/samba-hostconfig.pc
[SUBSYSTEM::PROVISION]
PRIVATE_DEPENDENCIES = LIBPYTHON
-PROVISION_OBJ_FILES = param/provision.o
+PROVISION_OBJ_FILES = $(paramsrcdir)/provision.o
#################################
# Start SUBSYSTEM share
[SUBSYSTEM::share]
-PRIVATE_PROTO_HEADER = share_proto.h
PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL
# End SUBSYSTEM share
#################################
-share_OBJ_FILES = param/share.o
+share_OBJ_FILES = $(paramsrcdir)/share.o
+
+$(eval $(call proto_header_template,$(paramsrcdir)/share_proto.h,$(share_OBJ_FILES:.o=.c)))
PUBLIC_HEADERS += param/share.h
@@ -46,7 +39,7 @@ PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL
# End MODULE share_classic
################################################
-share_classic_OBJ_FILES = param/share_classic.o
+share_classic_OBJ_FILES = $(paramsrcdir)/share_classic.o
################################################
# Start MODULE share_ldb
@@ -57,15 +50,15 @@ PRIVATE_DEPENDENCIES = LIBLDB LDB_WRAP
# End MODULE share_ldb
################################################
-share_ldb_OBJ_FILES = param/share_ldb.o
+share_ldb_OBJ_FILES = $(paramsrcdir)/share_ldb.o
[SUBSYSTEM::SECRETS]
PRIVATE_DEPENDENCIES = LIBLDB TDB_WRAP UTIL_TDB NDR_SECURITY
-SECRETS_OBJ_FILES = param/secrets.o
+SECRETS_OBJ_FILES = $(paramsrcdir)/secrets.o
[PYTHON::param]
SWIG_FILE = param.i
PRIVATE_DEPENDENCIES = LIBSAMBA-HOSTCONFIG
-param_OBJ_FILES = param/param_wrap.o
+param_OBJ_FILES = $(paramsrcdir)/param_wrap.o
diff --git a/source4/pidl/config.mk b/source4/pidl/config.mk
index 19b2d53659..07c8647ecd 100644
--- a/source4/pidl/config.mk
+++ b/source4/pidl/config.mk
@@ -1,11 +1,13 @@
-pidl/Makefile: pidl/Makefile.PL
- cd pidl && $(PERL) Makefile.PL PREFIX=$(prefix)
+PIDL = $(PERL) $(pidldir)/pidl
-pidl-testcov: pidl/Makefile
- cd pidl && cover -test
+$(pidldir)/Makefile: $(pidldir)/Makefile.PL
+ cd $(pidldir) && $(PERL) Makefile.PL PREFIX=$(prefix)
-installpidl:: pidl/Makefile
- $(MAKE) -C pidl install_vendor VENDORPREFIX=$(prefix) \
+pidl-testcov: $(pidldir)/Makefile
+ cd $(pidldir) && cover -test
+
+installpidl:: $(pidldir)/Makefile
+ $(MAKE) -C $(pidldir) install_vendor VENDORPREFIX=$(prefix) \
INSTALLVENDORLIB=$(datarootdir)/perl5 \
INSTALLVENDORBIN=$(bindir) \
INSTALLVENDORSCRIPT=$(bindir) \
@@ -16,27 +18,14 @@ ifeq ($(HAVE_PERL_EXTUTILS_MAKEMAKER),1)
install:: installpidl
endif
-idl_full:: pidl/lib/Parse/Pidl/IDL.pm pidl/lib/Parse/Pidl/Expr.pm
- @CPP="$(CPP)" PERL="$(PERL)" srcdir=$(srcdir) $(srcdir)/script/build_idl.sh FULL
-
-idl:: pidl/lib/Parse/Pidl/IDL.pm pidl/lib/Parse/Pidl/Expr.pm
- @CPP="$(CPP)" PERL="$(PERL)" srcdir=$(srcdir) $(srcdir)/script/build_idl.sh PARTIAL
+$(pidldir)/lib/Parse/Pidl/IDL.pm: $(pidldir)/idl.yp
+ -$(YAPP) -m 'Parse::Pidl::IDL' -o $(pidldir)/lib/Parse/Pidl/IDL.pm $(pidldir)/idl.yp ||\
+ touch $(pidldir)/lib/Parse/Pidl/IDL.pm
-pidl/lib/Parse/Pidl/IDL.pm: pidl/idl.yp
- -$(YAPP) -m 'Parse::Pidl::IDL' -o pidl/lib/Parse/Pidl/IDL.pm pidl/idl.yp ||\
- touch pidl/lib/Parse/Pidl/IDL.pm
-
-pidl/lib/Parse/Pidl/Expr.pm: pidl/idl.yp
- -$(YAPP) -m 'Parse::Pidl::Expr' -o pidl/lib/Parse/Pidl/Expr.pm pidl/expr.yp ||\
- touch pidl/lib/Parse/Pidl/Expr.pm
+$(pidldir)/lib/Parse/Pidl/Expr.pm: $(pidldir)/idl.yp
+ -$(YAPP) -m 'Parse::Pidl::Expr' -o $(pidldir)/lib/Parse/Pidl/Expr.pm $(pidldir)/expr.yp ||\
+ touch $(pidldir)/lib/Parse/Pidl/Expr.pm
testcov-html:: pidl-testcov
-$(IDL_HEADER_FILES) \
- $(IDL_NDR_PARSE_H_FILES) $(IDL_NDR_PARSE_C_FILES) \
- $(IDL_NDR_CLIENT_C_FILES) $(IDL_NDR_CLIENT_H_FILES) \
- $(IDL_NDR_SERVER_C_FILES) $(IDL_SWIG_FILES) \
- $(IDL_NDR_EJS_C_FILES) $(IDL_NDR_EJS_H_FILES) \
- $(IDL_NDR_PY_C_FILES) $(IDL_NDR_PY_H_FILES): idl
-
diff --git a/source4/rpc_server/config.mk b/source4/rpc_server/config.mk
index 974d12c882..6b1813544e 100644
--- a/source4/rpc_server/config.mk
+++ b/source4/rpc_server/config.mk
@@ -3,14 +3,15 @@
################################################
# Start SUBSYSTEM DCERPC_COMMON
[SUBSYSTEM::DCERPC_COMMON]
-PRIVATE_PROTO_HEADER = common/proto.h
#
# End SUBSYSTEM DCERPC_COMMON
################################################
-DCERPC_COMMON_OBJ_FILES = $(addprefix rpc_server/common/, server_info.o share_info.o)
+DCERPC_COMMON_OBJ_FILES = $(addprefix $(rpc_serversrcdir)/common/, server_info.o share_info.o)
-PUBLIC_HEADERS += rpc_server/common/common.h
+$(eval $(call proto_header_template,$(rpc_serversrcdir)/common/proto.h,$(DCERPC_COMMON_OBJ_FILES:.o=.c)))
+
+PUBLIC_HEADERS += $(rpc_serversrcdir)/common/common.h
################################################
# Start MODULE dcerpc_rpcecho
@@ -21,7 +22,7 @@ PRIVATE_DEPENDENCIES = NDR_ECHO
# End MODULE dcerpc_rpcecho
################################################
-dcerpc_rpcecho_OBJ_FILES = rpc_server/echo/rpc_echo.o
+dcerpc_rpcecho_OBJ_FILES = $(rpc_serversrcdir)/echo/rpc_echo.o
################################################
# Start MODULE dcerpc_epmapper
@@ -32,7 +33,7 @@ PRIVATE_DEPENDENCIES = NDR_EPMAPPER
# End MODULE dcerpc_epmapper
################################################
-dcerpc_epmapper_OBJ_FILES = rpc_server/epmapper/rpc_epmapper.o
+dcerpc_epmapper_OBJ_FILES = $(rpc_serversrcdir)/epmapper/rpc_epmapper.o
################################################
# Start MODULE dcerpc_remote
@@ -44,20 +45,22 @@ PRIVATE_DEPENDENCIES = \
# End MODULE dcerpc_remote
################################################
-dcerpc_remote_OBJ_FILES = rpc_server/remote/dcesrv_remote.o
+dcerpc_remote_OBJ_FILES = $(rpc_serversrcdir)/remote/dcesrv_remote.o
################################################
# Start MODULE dcerpc_srvsvc
[MODULE::dcerpc_srvsvc]
INIT_FUNCTION = dcerpc_server_srvsvc_init
-PRIVATE_PROTO_HEADER = srvsvc/proto.h
SUBSYSTEM = DCESRV
PRIVATE_DEPENDENCIES = \
DCERPC_COMMON NDR_SRVSVC share
# End MODULE dcerpc_srvsvc
################################################
-dcerpc_srvsvc_OBJ_FILES = $(addprefix rpc_server/srvsvc/, dcesrv_srvsvc.o srvsvc_ntvfs.o)
+
+dcerpc_srvsvc_OBJ_FILES = $(addprefix $(rpc_serversrcdir)/srvsvc/, dcesrv_srvsvc.o srvsvc_ntvfs.o)
+
+$(eval $(call proto_header_template,$(rpc_serversrcdir)/srvsvc/proto.h,$(dcerpc_srvsvc_OBJ_FILES:.o=.c)))
################################################
# Start MODULE dcerpc_wkssvc
@@ -69,7 +72,7 @@ PRIVATE_DEPENDENCIES = \
# End MODULE dcerpc_wkssvc
################################################
-dcerpc_wkssvc_OBJ_FILES = rpc_server/wkssvc/dcesrv_wkssvc.o
+dcerpc_wkssvc_OBJ_FILES = $(rpc_serversrcdir)/wkssvc/dcesrv_wkssvc.o
################################################
# Start MODULE dcerpc_unixinfo
@@ -85,13 +88,12 @@ PRIVATE_DEPENDENCIES = \
# End MODULE dcerpc_unixinfo
################################################
-dcerpc_unixinfo_OBJ_FILES = rpc_server/unixinfo/dcesrv_unixinfo.o
+dcerpc_unixinfo_OBJ_FILES = $(rpc_serversrcdir)/unixinfo/dcesrv_unixinfo.o
################################################
# Start MODULE dcesrv_samr
[MODULE::dcesrv_samr]
INIT_FUNCTION = dcerpc_server_samr_init
-PRIVATE_PROTO_HEADER = samr/proto.h
SUBSYSTEM = DCESRV
PRIVATE_DEPENDENCIES = \
SAMDB \
@@ -100,7 +102,9 @@ PRIVATE_DEPENDENCIES = \
# End MODULE dcesrv_samr
################################################
-dcesrv_samr_OBJ_FILES = $(addprefix rpc_server/samr/, dcesrv_samr.o samr_password.o)
+dcesrv_samr_OBJ_FILES = $(addprefix $(rpc_serversrcdir)/samr/, dcesrv_samr.o samr_password.o)
+
+$(eval $(call proto_header_template,$(rpc_serversrcdir)/samr/proto.h,$(dcesrv_samr_OBJ_FILES:.o=.c)))
################################################
# Start MODULE dcerpc_winreg
@@ -113,7 +117,7 @@ PRIVATE_DEPENDENCIES = \
# End MODULE dcerpc_winreg
################################################
-dcerpc_winreg_OBJ_FILES = rpc_server/winreg/rpc_winreg.o
+dcerpc_winreg_OBJ_FILES = $(rpc_serversrcdir)/winreg/rpc_winreg.o
################################################
# Start MODULE dcerpc_netlogon
@@ -128,14 +132,13 @@ PRIVATE_DEPENDENCIES = \
# End MODULE dcerpc_netlogon
################################################
-dcerpc_netlogon_OBJ_FILES = rpc_server/netlogon/dcerpc_netlogon.o
+dcerpc_netlogon_OBJ_FILES = $(rpc_serversrcdir)/netlogon/dcerpc_netlogon.o
################################################
# Start MODULE dcerpc_lsa
[MODULE::dcerpc_lsarpc]
INIT_FUNCTION = dcerpc_server_lsa_init
SUBSYSTEM = DCESRV
-PRIVATE_PROTO_HEADER= lsa/proto.h
PRIVATE_DEPENDENCIES = \
SAMDB \
DCERPC_COMMON \
@@ -145,7 +148,9 @@ PRIVATE_DEPENDENCIES = \
# End MODULE dcerpc_lsa
################################################
-dcerpc_lsarpc_OBJ_FILES = $(addprefix rpc_server/lsa/, dcesrv_lsa.o lsa_init.o lsa_lookup.o)
+dcerpc_lsarpc_OBJ_FILES = $(addprefix $(rpc_serversrcdir)/lsa/, dcesrv_lsa.o lsa_init.o lsa_lookup.o)
+
+$(eval $(call proto_header_template,$(rpc_serversrcdir)/lsa/proto.h,$(dcerpc_lsarpc_OBJ_FILES:.o=.c)))
################################################
@@ -162,7 +167,7 @@ PRIVATE_DEPENDENCIES = \
# End MODULE dcerpc_spoolss
################################################
-dcerpc_spoolss_OBJ_FILES = rpc_server/spoolss/dcesrv_spoolss.o
+dcerpc_spoolss_OBJ_FILES = $(rpc_serversrcdir)/spoolss/dcesrv_spoolss.o
################################################
# Start MODULE dcerpc_drsuapi
@@ -176,31 +181,32 @@ PRIVATE_DEPENDENCIES = \
# End MODULE dcerpc_drsuapi
################################################
-dcerpc_drsuapi_OBJ_FILES = rpc_server/drsuapi/dcesrv_drsuapi.o
+dcerpc_drsuapi_OBJ_FILES = $(rpc_serversrcdir)/drsuapi/dcesrv_drsuapi.o
################################################
# Start SUBSYSTEM dcerpc_server
[SUBSYSTEM::dcerpc_server]
-PRIVATE_PROTO_HEADER = dcerpc_server_proto.h
PRIVATE_DEPENDENCIES = \
LIBCLI_AUTH \
LIBNDR \
dcerpc
-dcerpc_server_OBJ_FILES = $(addprefix rpc_server/, \
+dcerpc_server_OBJ_FILES = $(addprefix $(rpc_serversrcdir)/, \
dcerpc_server.o \
dcesrv_auth.o \
dcesrv_mgmt.o \
handles.o)
+$(eval $(call proto_header_template,$(rpc_serversrcdir)/dcerpc_server_proto.h,$(dcerpc_server_OBJ_FILES:.o=.c)))
+
# End SUBSYSTEM DCERPC
################################################
-PUBLIC_HEADERS += rpc_server/dcerpc_server.h
+PUBLIC_HEADERS += $(rpc_serversrcdir)/dcerpc_server.h
[MODULE::DCESRV]
INIT_FUNCTION = server_service_rpc_init
SUBSYSTEM = smbd
PRIVATE_DEPENDENCIES = dcerpc_server
-DCESRV_OBJ_FILES = rpc_server/service_rpc.o
+DCESRV_OBJ_FILES = $(rpc_serversrcdir)/service_rpc.o
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c
index 1962a97d5b..e0351bb259 100644
--- a/source4/rpc_server/dcerpc_server.c
+++ b/source4/rpc_server/dcerpc_server.c
@@ -445,6 +445,7 @@ static NTSTATUS dcesrv_fault(struct dcesrv_call_state *call, uint32_t fault_code
{
struct ncacn_packet pkt;
struct data_blob_list_item *rep;
+ uint8_t zeros[4];
NTSTATUS status;
/* setup a bind_ack */
@@ -458,6 +459,9 @@ static NTSTATUS dcesrv_fault(struct dcesrv_call_state *call, uint32_t fault_code
pkt.u.fault.cancel_count = 0;
pkt.u.fault.status = fault_code;
+ ZERO_STRUCT(zeros);
+ pkt.u.fault._pad = data_blob_const(zeros, sizeof(zeros));
+
rep = talloc(call, struct data_blob_list_item);
if (!rep) {
return NT_STATUS_NO_MEMORY;
@@ -684,6 +688,7 @@ static NTSTATUS dcesrv_alter_new_context(struct dcesrv_call_state *call, uint32_
struct dcesrv_connection_context *context;
const struct dcesrv_interface *iface;
struct GUID uuid, *transfer_syntax_uuid;
+ NTSTATUS status;
if_version = call->pkt.u.alter.ctx_list[0].abstract_syntax.if_version;
uuid = call->pkt.u.alter.ctx_list[0].abstract_syntax.uuid;
@@ -717,6 +722,13 @@ static NTSTATUS dcesrv_alter_new_context(struct dcesrv_call_state *call, uint32_
DLIST_ADD(call->conn->contexts, context);
call->context = context;
+ if (iface) {
+ status = iface->bind(call, iface);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+ }
+
return NT_STATUS_OK;
}
diff --git a/source4/scripting/bin/minschema.py b/source4/scripting/bin/minschema.py
index fb9d7b05aa..6dd5b42aff 100755
--- a/source4/scripting/bin/minschema.py
+++ b/source4/scripting/bin/minschema.py
@@ -4,6 +4,10 @@
#
import optparse
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
import samba
from samba import getopt as options
import sys
diff --git a/source4/scripting/bin/rpcclient b/source4/scripting/bin/rpcclient
index 34efafdf73..aba4f9ddb3 100755
--- a/source4/scripting/bin/rpcclient
+++ b/source4/scripting/bin/rpcclient
@@ -1,6 +1,10 @@
#!/usr/bin/python
import sys, os, string
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
from cmd import Cmd
from optparse import OptionParser
from pprint import pprint
diff --git a/source4/scripting/bin/samba3dump b/source4/scripting/bin/samba3dump
index 8f56d423d8..d89667233f 100755
--- a/source4/scripting/bin/samba3dump
+++ b/source4/scripting/bin/samba3dump
@@ -7,7 +7,10 @@
import optparse
import os, sys
-sys.path.append(os.path.join(os.path.dirname(__file__), "../python"))
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
import samba
import samba.samba3
diff --git a/source4/scripting/bin/subunitrun b/source4/scripting/bin/subunitrun
index fbbffde42c..de11aba3cc 100755
--- a/source4/scripting/bin/subunitrun
+++ b/source4/scripting/bin/subunitrun
@@ -17,8 +17,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-from subunit import SubunitTestRunner
import sys
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
+from subunit import SubunitTestRunner
from unittest import TestProgram
import optparse
import os
diff --git a/source4/scripting/bin/winreg.py b/source4/scripting/bin/winreg.py
index 1e39ee8f78..19d39e56ab 100755
--- a/source4/scripting/bin/winreg.py
+++ b/source4/scripting/bin/winreg.py
@@ -7,6 +7,10 @@
#
import sys
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
import winreg
import optparse
import samba.getopt as options
diff --git a/source4/scripting/ejs/config.mk b/source4/scripting/ejs/config.mk
index 896b292e23..c1a1ca1f0f 100644
--- a/source4/scripting/ejs/config.mk
+++ b/source4/scripting/ejs/config.mk
@@ -1,13 +1,13 @@
[SUBSYSTEM::EJSRPC]
-EJSRPC_OBJ_FILES = scripting/ejs/ejsrpc.o
+EJSRPC_OBJ_FILES = $(ejsscriptsrcdir)/ejsrpc.o
[MODULE::smbcalls_config]
OUTPUT_TYPE = MERGED_OBJ
SUBSYSTEM = smbcalls
INIT_FUNCTION = smb_setup_ejs_config
-smbcalls_config_OBJ_FILES = scripting/ejs/smbcalls_config.o
+smbcalls_config_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_config.o
[MODULE::smbcalls_ldb]
OUTPUT_TYPE = MERGED_OBJ
@@ -15,7 +15,7 @@ SUBSYSTEM = smbcalls
INIT_FUNCTION = smb_setup_ejs_ldb
PRIVATE_DEPENDENCIES = LIBLDB SAMDB LIBNDR
-smbcalls_ldb_OBJ_FILES = scripting/ejs/smbcalls_ldb.o
+smbcalls_ldb_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_ldb.o
[MODULE::smbcalls_reg]
SUBSYSTEM = smbcalls
@@ -23,21 +23,21 @@ OUTPUT_TYPE = MERGED_OBJ
INIT_FUNCTION = smb_setup_ejs_reg
PRIVATE_DEPENDENCIES = registry SAMDB LIBNDR
-smbcalls_reg_OBJ_FILES = scripting/ejs/smbcalls_reg.o
+smbcalls_reg_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_reg.o
[MODULE::smbcalls_nbt]
SUBSYSTEM = smbcalls
OUTPUT_TYPE = MERGED_OBJ
INIT_FUNCTION = smb_setup_ejs_nbt
-smbcalls_nbt_OBJ_FILES = scripting/ejs/smbcalls_nbt.o
+smbcalls_nbt_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_nbt.o
[MODULE::smbcalls_rand]
SUBSYSTEM = smbcalls
OUTPUT_TYPE = MERGED_OBJ
INIT_FUNCTION = smb_setup_ejs_random
-smbcalls_rand_OBJ_FILES = scripting/ejs/smbcalls_rand.o
+smbcalls_rand_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_rand.o
[MODULE::smbcalls_nss]
SUBSYSTEM = smbcalls
@@ -45,14 +45,14 @@ OUTPUT_TYPE = MERGED_OBJ
INIT_FUNCTION = smb_setup_ejs_nss
PRIVATE_DEPENDENCIES = NSS_WRAPPER
-smbcalls_nss_OBJ_FILES = scripting/ejs/smbcalls_nss.o
+smbcalls_nss_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_nss.o
[MODULE::smbcalls_data]
SUBSYSTEM = smbcalls
OUTPUT_TYPE = MERGED_OBJ
INIT_FUNCTION = smb_setup_ejs_datablob
-smbcalls_data_OBJ_FILES = scripting/ejs/smbcalls_data.o
+smbcalls_data_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_data.o
[MODULE::smbcalls_auth]
OUTPUT_TYPE = MERGED_OBJ
@@ -60,28 +60,27 @@ SUBSYSTEM = smbcalls
INIT_FUNCTION = smb_setup_ejs_auth
PRIVATE_DEPENDENCIES = service_auth
-smbcalls_auth_OBJ_FILES = scripting/ejs/smbcalls_auth.o
+smbcalls_auth_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_auth.o
-smbcalls_auth_OBJ_FILES = scripting/ejs/smbcalls_auth.o
+smbcalls_auth_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_auth.o
[MODULE::smbcalls_string]
SUBSYSTEM = smbcalls
OUTPUT_TYPE = MERGED_OBJ
INIT_FUNCTION = smb_setup_ejs_string
-smbcalls_string_OBJ_FILES = scripting/ejs/smbcalls_string.o
+smbcalls_string_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_string.o
[MODULE::smbcalls_sys]
SUBSYSTEM = smbcalls
OUTPUT_TYPE = MERGED_OBJ
INIT_FUNCTION = smb_setup_ejs_system
-smbcalls_sys_OBJ_FILES = scripting/ejs/smbcalls_sys.o
+smbcalls_sys_OBJ_FILES = $(ejsscriptsrcdir)/smbcalls_sys.o
mkinclude ejsnet/config.mk
[SUBSYSTEM::smbcalls]
-PRIVATE_PROTO_HEADER = proto.h
PRIVATE_DEPENDENCIES = \
EJS LIBSAMBA-UTIL \
EJSRPC MESSAGING \
@@ -90,7 +89,7 @@ PRIVATE_DEPENDENCIES = \
dcerpc \
NDR_TABLE
-smbcalls_OBJ_FILES = $(addprefix scripting/ejs/, \
+smbcalls_OBJ_FILES = $(addprefix $(ejsscriptsrcdir)/, \
smbcalls.o \
smbcalls_cli.o \
smbcalls_rpc.o \
@@ -100,6 +99,8 @@ smbcalls_OBJ_FILES = $(addprefix scripting/ejs/, \
mprutil.o \
literal.o)
+$(eval $(call proto_header_template,$(ejsscriptsrcdir)/proto.h,$(smbcalls_OBJ_FILES:.o=.c)))
+
#######################
# Start BINARY SMBSCRIPT
[BINARY::smbscript]
@@ -107,4 +108,4 @@ PRIVATE_DEPENDENCIES = EJS LIBSAMBA-UTIL smbcalls LIBSAMBA-HOSTCONFIG
# End BINARY SMBSCRIPT
#######################
-smbscript_OBJ_FILES = scripting/ejs/smbscript.o
+smbscript_OBJ_FILES = $(ejsscriptsrcdir)/smbscript.o
diff --git a/source4/scripting/ejs/ejsnet/config.mk b/source4/scripting/ejs/ejsnet/config.mk
index 85a5b2bf09..710221e37d 100644
--- a/source4/scripting/ejs/ejsnet/config.mk
+++ b/source4/scripting/ejs/ejsnet/config.mk
@@ -1,13 +1,13 @@
[MODULE::smbcalls_net]
SUBSYSTEM = smbcalls
INIT_FUNCTION = smb_setup_ejs_net
-PRIVATE_PROTO_HEADER = proto.h
PRIVATE_DEPENDENCIES = LIBSAMBA-NET LIBCLI_SMB CREDENTIALS
-smbcalls_net_OBJ_FILES = $(addprefix scripting/ejs/ejsnet/, \
+smbcalls_net_OBJ_FILES = $(addprefix $(ejsscriptsrcdir)/ejsnet/, \
net_ctx.o \
net_user.o \
mpr_user.o \
net_host.o \
mpr_host.o)
+$(eval $(call proto_header_template,$(ejsscriptsrcdir)/ejsnet/proto.h,$(smbcalls_net_OBJ_FILES:.o=.c)))
diff --git a/source4/scripting/python/config.m4 b/source4/scripting/python/config.m4
index a61d541049..1a86951bfb 100644
--- a/source4/scripting/python/config.m4
+++ b/source4/scripting/python/config.m4
@@ -64,7 +64,6 @@ SMB_EXT_LIB(EXT_LIB_PYTHON, [$PYTHON_LDFLAGS], [$PYTHON_CFLAGS])
AC_MSG_CHECKING(working python module support)
if test $working_python = yes; then
SMB_ENABLE(EXT_LIB_PYTHON,YES)
- SMB_ENABLE(smbpython,YES)
SMB_ENABLE(LIBPYTHON,YES)
AC_MSG_RESULT([yes])
else
diff --git a/source4/scripting/python/config.mk b/source4/scripting/python/config.mk
index e57ff1d1ac..1fa273e99d 100644
--- a/source4/scripting/python/config.mk
+++ b/source4/scripting/python/config.mk
@@ -1,31 +1,28 @@
-[BINARY::smbpython]
-PRIVATE_DEPENDENCIES = LIBPYTHON
-
-smbpython_OBJ_FILES = scripting/python/smbpython.o
-
[SUBSYSTEM::LIBPYTHON]
PUBLIC_DEPENDENCIES = EXT_LIB_PYTHON
PRIVATE_DEPENDENCIES = PYTALLOC
INIT_FUNCTION_SENTINEL = { NULL, NULL }
-LIBPYTHON_OBJ_FILES = $(addprefix scripting/python/, modules.o)
+LIBPYTHON_OBJ_FILES = $(addprefix $(pyscriptsrcdir)/, modules.o)
[SUBSYSTEM::PYTALLOC]
PUBLIC_DEPENDENCIES = EXT_LIB_PYTHON
-PYTALLOC_OBJ_FILES = $(addprefix scripting/python/, pytalloc.o)
+PYTALLOC_OBJ_FILES = $(addprefix $(pyscriptsrcdir)/, pytalloc.o)
[PYTHON::python_uuid]
PRIVATE_DEPENDENCIES = LIBNDR
-python_uuid_OBJ_FILES = scripting/python/uuidmodule.o
+python_uuid_OBJ_FILES = $(pyscriptsrcdir)/uuidmodule.o
[PYTHON::python_misc]
PRIVATE_DEPENDENCIES = LIBNDR LIBLDB SAMDB CREDENTIALS
SWIG_FILE = misc.i
-python_misc_OBJ_FILES = scripting/python/misc_wrap.o
+python_misc_OBJ_FILES = $(pyscriptsrcdir)/misc_wrap.o
+
+_PY_FILES = $(shell find $(pyscriptsrcdir) -name "*.py")
-_PY_FILES = $(shell find scripting/python -name "*.py")
+$(foreach pyfile, $(_PY_FILES),$(eval $(call python_py_module_template,$(patsubst $(pyscriptsrcdir)/%,%,$(pyfile)),$(pyfile))))
-$(foreach pyfile, $(_PY_FILES),$(eval $(call python_py_module_template,$(patsubst scripting/python/%,%,$(pyfile)),$(pyfile))))
+install:: installpython
diff --git a/source4/scripting/python/smbpython.c b/source4/scripting/python/smbpython.c
deleted file mode 100644
index c5de53fd60..0000000000
--- a/source4/scripting/python/smbpython.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
- Samba utility functions
- Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include <Python.h>
-#include "scripting/python/modules.h"
-
-int main(int argc, char **argv)
-{
- py_load_samba_modules();
- Py_Initialize();
- if (strchr(argv[0], '/') != NULL) {
- char *bindir = strndup(argv[0], strrchr(argv[0], '/')-argv[0]);
- py_update_path(bindir);
- free(bindir);
- }
- return Py_Main(argc,argv);
-}
diff --git a/source4/selftest/samba4_tests.sh b/source4/selftest/samba4_tests.sh
index 9c7e93906c..5a9cdafe3b 100755
--- a/source4/selftest/samba4_tests.sh
+++ b/source4/selftest/samba4_tests.sh
@@ -328,7 +328,7 @@ then
plantest "nss.test using winbind" member $VALGRIND $samba4bindir/nsstest $samba4bindir/shared/libnss_winbind.so
fi
-PYTHON=bin/smbpython
+PYTHON=/usr/bin/python
SUBUNITRUN="$PYTHON ./scripting/bin/subunitrun"
plantest "ldb.python" none PYTHONPATH="$PYTHONPATH:lib/ldb/tests/python/" $SUBUNITRUN api
plantest "credentials.python" none PYTHONPATH="$PYTHONPATH:auth/credentials/tests" $SUBUNITRUN bindings
diff --git a/source4/selftest/target/Samba4.pm b/source4/selftest/target/Samba4.pm
index 9488ae3e04..a12939b0a1 100644
--- a/source4/selftest/target/Samba4.pm
+++ b/source4/selftest/target/Samba4.pm
@@ -705,7 +705,7 @@ nogroup:x:65534:nobody
push (@provision_options, "$self->{bindir}/smbscript");
push (@provision_options, "$self->{setupdir}/provision.js");
} else {
- push (@provision_options, "$self->{bindir}/smbpython");
+# push (@provision_options, "$self->{bindir}/smbpython");
push (@provision_options, "$self->{setupdir}/provision");
}
push (@provision_options, split(' ', $configuration));
diff --git a/source4/setup/newuser b/source4/setup/newuser
index 04a5440ee1..26bac76f02 100755
--- a/source4/setup/newuser
+++ b/source4/setup/newuser
@@ -6,10 +6,14 @@
# Released under the GNU GPL version 3 or later
#
+import sys
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
import samba.getopt as options
import optparse
import pwd
-import sys
from getpass import getpass
from auth import system_session
from samba.samdb import SamDB
diff --git a/source4/setup/provision b/source4/setup/provision
index b748dab339..2579bc4f19 100755
--- a/source4/setup/provision
+++ b/source4/setup/provision
@@ -26,6 +26,9 @@ import getopt
import optparse
import os, sys
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
import samba
import param
diff --git a/source4/setup/upgrade b/source4/setup/upgrade
index 3bcc57ab64..b1d9ffa37c 100755
--- a/source4/setup/upgrade
+++ b/source4/setup/upgrade
@@ -7,6 +7,10 @@
import getopt
import optparse
import os, sys
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
import param
import samba
import samba.getopt as options
diff --git a/source4/smb_server/config.mk b/source4/smb_server/config.mk
index 1e3da1fab6..e11968a100 100644
--- a/source4/smb_server/config.mk
+++ b/source4/smb_server/config.mk
@@ -3,15 +3,15 @@
[MODULE::SERVICE_SMB]
INIT_FUNCTION = server_service_smb_init
SUBSYSTEM = smbd
-PRIVATE_PROTO_HEADER = service_smb_proto.h
PRIVATE_DEPENDENCIES = SMB_SERVER
-SERVICE_SMB_OBJ_FILES = smb_server/smb_server.o
+SERVICE_SMB_OBJ_FILES = $(smb_serversrcdir)/smb_server.o
+
+$(eval $(call proto_header_template,$(smb_serversrcdir)/service_smb_proto.h,$(SERVICE_SMB_OBJ_FILES:.o=.c)))
#######################
# Start SUBSYSTEM SMB
[SUBSYSTEM::SMB_SERVER]
-PRIVATE_PROTO_HEADER = smb_server_proto.h
PUBLIC_DEPENDENCIES = \
share \
LIBPACKET \
@@ -20,12 +20,14 @@ PUBLIC_DEPENDENCIES = \
# End SUBSYSTEM SMB
#######################
-SMB_SERVER_OBJ_FILES = $(addprefix smb_server/, \
+SMB_SERVER_OBJ_FILES = $(addprefix $(smb_serversrcdir)/, \
handle.o \
tcon.o \
session.o \
blob.o \
management.o)
+$(eval $(call proto_header_template,$(smb_serversrcdir)/smb_server_proto.h,$(SMB_SERVER_OBJ_FILES:.o=.c)))
+
mkinclude smb/config.mk
mkinclude smb2/config.mk
diff --git a/source4/smb_server/smb/config.mk b/source4/smb_server/smb/config.mk
index 3d4aa8ba38..9adf334850 100644
--- a/source4/smb_server/smb/config.mk
+++ b/source4/smb_server/smb/config.mk
@@ -1,13 +1,12 @@
#######################
# Start SUBSYSTEM SMB_PROTOCOL
[SUBSYSTEM::SMB_PROTOCOL]
-PRIVATE_PROTO_HEADER = smb_proto.h
PUBLIC_DEPENDENCIES = \
ntvfs LIBPACKET CREDENTIALS
# End SUBSYSTEM SMB_PROTOCOL
#######################
-SMB_PROTOCOL_OBJ_FILES = $(addprefix smb_server/smb/, \
+SMB_PROTOCOL_OBJ_FILES = $(addprefix $(smb_serversrcdir)/smb/, \
receive.o \
negprot.o \
nttrans.o \
@@ -20,3 +19,4 @@ SMB_PROTOCOL_OBJ_FILES = $(addprefix smb_server/smb/, \
trans2.o \
signing.o)
+$(eval $(call proto_header_template,$(smb_serversrcdir)/smb/smb_proto.h,$(SMB_PROTOCOL_OBJ_FILES:.o=.c)))
diff --git a/source4/smb_server/smb2/config.mk b/source4/smb_server/smb2/config.mk
index c9ba3269fa..68ee6e58f6 100644
--- a/source4/smb_server/smb2/config.mk
+++ b/source4/smb_server/smb2/config.mk
@@ -1,13 +1,12 @@
#######################
# Start SUBSYSTEM SMB2_PROTOCOL
[SUBSYSTEM::SMB2_PROTOCOL]
-PRIVATE_PROTO_HEADER = smb2_proto.h
PUBLIC_DEPENDENCIES = \
ntvfs LIBPACKET LIBCLI_SMB2
# End SUBSYSTEM SMB2_PROTOCOL
#######################
-SMB2_PROTOCOL_OBJ_FILES = $(addprefix smb_server/smb2/, \
+SMB2_PROTOCOL_OBJ_FILES = $(addprefix $(smb_serversrcdir)/smb2/, \
receive.o \
negprot.o \
sesssetup.o \
@@ -17,3 +16,4 @@ SMB2_PROTOCOL_OBJ_FILES = $(addprefix smb_server/smb2/, \
find.o \
keepalive.o)
+$(eval $(call proto_header_template,$(smb_serversrcdir)/smb2/smb2_proto.h,$(SMB2_PROTOCOL_OBJ_FILES:.o=.c)))
diff --git a/source4/smbd/config.mk b/source4/smbd/config.mk
index 006135f818..e60f444456 100644
--- a/source4/smbd/config.mk
+++ b/source4/smbd/config.mk
@@ -1,19 +1,21 @@
# server subsystem
[SUBSYSTEM::service]
-PRIVATE_PROTO_HEADER = service_proto.h
PRIVATE_DEPENDENCIES = \
MESSAGING samba-socket
-service_OBJ_FILES = $(addprefix smbd/, \
+service_OBJ_FILES = $(addprefix $(smbdsrcdir)/, \
service.o \
service_stream.o \
service_task.o)
+$(eval $(call proto_header_template,$(smbdsrcdir)/service_proto.h,$(service_OBJ_FILES:.o=.c)))
+
[SUBSYSTEM::PIDFILE]
-PRIVATE_PROTO_HEADER = pidfile.h
-PIDFILE_OBJ_FILES = smbd/pidfile.o
+PIDFILE_OBJ_FILES = $(smbdsrcdir)/pidfile.o
+
+$(eval $(call proto_header_template,$(smbdsrcdir)/pidfile.h,$(PIDFILE_OBJ_FILES:.o=.c)))
#################################
# Start BINARY smbd
@@ -34,8 +36,8 @@ PRIVATE_DEPENDENCIES = \
share \
CLUSTER
-smbd_OBJ_FILES = smbd/server.o
+smbd_OBJ_FILES = $(smbdsrcdir)/server.o
-MANPAGES += smbd/smbd.8
+MANPAGES += $(smbdsrcdir)/smbd.8
# End BINARY smbd
#################################
diff --git a/source4/smbd/process_model.mk b/source4/smbd/process_model.mk
index 48899078f7..5ed8471a9d 100644
--- a/source4/smbd/process_model.mk
+++ b/source4/smbd/process_model.mk
@@ -8,7 +8,7 @@ SUBSYSTEM = process_model
# End MODULE process_model_single
################################################
-process_model_single_OBJ_FILES = smbd/process_single.o
+process_model_single_OBJ_FILES = $(smbdsrcdir)/process_single.o
################################################
# Start MODULE process_model_standard
@@ -19,7 +19,7 @@ PRIVATE_DEPENDENCIES = SETPROCTITLE
# End MODULE process_model_standard
################################################
-process_model_standard_OBJ_FILES = smbd/process_standard.o
+process_model_standard_OBJ_FILES = $(smbdsrcdir)/process_standard.o
################################################
# Start MODULE process_model_thread
@@ -30,7 +30,7 @@ PRIVATE_DEPENDENCIES = PTHREAD
# End MODULE process_model_thread
################################################
-process_model_thread_OBJ_FILES = smbd/process_thread.o
+process_model_thread_OBJ_FILES = $(smbdsrcdir)/process_thread.o
################################################
# Start MODULE process_model_prefork
@@ -40,10 +40,11 @@ SUBSYSTEM = process_model
# End MODULE process_model_thread
################################################
-process_model_prefork_OBJ_FILES = smbd/process_prefork.o
+process_model_prefork_OBJ_FILES = $(smbdsrcdir)/process_prefork.o
[SUBSYSTEM::process_model]
-PRIVATE_PROTO_HEADER = process_model_proto.h
PRIVATE_DEPENDENCIES = LIBSAMBA-UTIL LIBSAMBA-HOSTCONFIG
-process_model_OBJ_FILES = smbd/process_model.o
+process_model_OBJ_FILES = $(smbdsrcdir)/process_model.o
+
+$(eval $(call proto_header_template,$(smbdsrcdir)/process_model_proto.h,$(process_model_OBJ_FILES:.o=.c)))
diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c
index 9f744efa81..e27d87ec75 100644
--- a/source4/smbd/service_stream.c
+++ b/source4/smbd/service_stream.c
@@ -119,6 +119,7 @@ void stream_io_handler_callback(void *private, uint16_t flags)
a server connection
*/
NTSTATUS stream_new_connection_merge(struct event_context *ev,
+ struct loadparm_context *lp_ctx,
const struct model_ops *model_ops,
struct socket_context *sock,
const struct stream_server_ops *stream_ops,
@@ -140,6 +141,7 @@ NTSTATUS stream_new_connection_merge(struct event_context *ev,
srv_conn->ops = stream_ops;
srv_conn->msg_ctx = msg_ctx;
srv_conn->event.ctx = ev;
+ srv_conn->lp_ctx = lp_ctx;
srv_conn->event.fde = event_add_fd(ev, srv_conn, socket_get_fd(sock),
EVENT_FD_READ,
stream_io_handler_fde, srv_conn);
diff --git a/source4/smbd/service_stream.h b/source4/smbd/service_stream.h
index 04d23a56f2..d57a54cdc9 100644
--- a/source4/smbd/service_stream.h
+++ b/source4/smbd/service_stream.h
@@ -50,6 +50,12 @@ struct stream_connection {
struct messaging_context *msg_ctx;
struct loadparm_context *lp_ctx;
+ /*
+ * this transport layer session info, normally NULL
+ * which means the same as an anonymous session info
+ */
+ struct auth_session_info *session_info;
+
bool processing;
const char *terminate;
};
diff --git a/source4/static_deps.mk b/source4/static_deps.mk
index a442b01025..7eb8fa10fe 100644
--- a/source4/static_deps.mk
+++ b/source4/static_deps.mk
@@ -38,8 +38,5 @@ heimdal_basics: \
heimdal/lib/hx509/hx509_err.h \
heimdal/lib/wind/wind_err.h
-proto: basics
-basics: include/includes.h \
- idl \
- $(PROTO_HEADERS) \
- heimdal_basics
+proto::
+basics:: include/includes.h idl proto heimdal_basics
diff --git a/source4/torture/config.mk b/source4/torture/config.mk
index ee9f8b71b5..5fde227031 100644
--- a/source4/torture/config.mk
+++ b/source4/torture/config.mk
@@ -2,15 +2,13 @@
PRIVATE_DEPENDENCIES = LIBCLI_RAW LIBPYTHON smbcalls PROVISION
PUBLIC_DEPENDENCIES = POPT_CREDENTIALS
-TORTURE_UTIL_OBJ_FILES = $(addprefix torture/, util_smb.o)
+TORTURE_UTIL_OBJ_FILES = $(addprefix $(torturesrcdir)/, util_smb.o)
#################################
# Start SUBSYSTEM TORTURE_BASIC
[MODULE::TORTURE_BASIC]
SUBSYSTEM = smbtorture
INIT_FUNCTION = torture_base_init
-PRIVATE_PROTO_HEADER = \
- basic/proto.h
PRIVATE_DEPENDENCIES = \
LIBCLI_SMB POPT_CREDENTIALS \
TORTURE_UTIL LIBCLI_RAW \
@@ -18,7 +16,7 @@ PRIVATE_DEPENDENCIES = \
# End SUBSYSTEM TORTURE_BASIC
#################################
-TORTURE_BASIC_OBJ_FILES = $(addprefix torture/basic/, \
+TORTURE_BASIC_OBJ_FILES = $(addprefix $(torturesrcdir)/basic/, \
base.o \
misc.o \
scanner.o \
@@ -38,21 +36,20 @@ TORTURE_BASIC_OBJ_FILES = $(addprefix torture/basic/, \
attr.o \
properties.o)
+$(eval $(call proto_header_template,$(torturesrcdir)/basic/proto.h,$(TORTURE_BASIC_OBJ_FILES:.o=.c)))
#################################
# Start SUBSYSTEM TORTURE_RAW
[MODULE::TORTURE_RAW]
SUBSYSTEM = smbtorture
INIT_FUNCTION = torture_raw_init
-PRIVATE_PROTO_HEADER = \
- raw/proto.h
PRIVATE_DEPENDENCIES = \
LIBCLI_SMB LIBCLI_LSA LIBCLI_SMB_COMPOSITE \
POPT_CREDENTIALS TORTURE_UTIL
# End SUBSYSTEM TORTURE_RAW
#################################
-TORTURE_RAW_OBJ_FILES = $(addprefix torture/raw/, \
+TORTURE_RAW_OBJ_FILES = $(addprefix $(torturesrcdir)/raw/, \
qfsinfo.o \
qfileinfo.o \
setfileinfo.o \
@@ -85,22 +82,22 @@ TORTURE_RAW_OBJ_FILES = $(addprefix torture/raw/, \
raw.o \
offline.o)
+$(eval $(call proto_header_template,$(torturesrcdir)/raw/proto.h,$(TORTURE_RAW_OBJ_FILES:.o=.c)))
mkinclude smb2/config.mk
mkinclude winbind/config.mk
[SUBSYSTEM::TORTURE_NDR]
-PRIVATE_PROTO_HEADER = ndr/proto.h
-TORTURE_NDR_OBJ_FILES = $(addprefix torture/ndr/, ndr.o winreg.o atsvc.o lsa.o epmap.o dfs.o netlogon.o drsuapi.o spoolss.o samr.o)
+TORTURE_NDR_OBJ_FILES = $(addprefix $(torturesrcdir)/ndr/, ndr.o winreg.o atsvc.o lsa.o epmap.o dfs.o netlogon.o drsuapi.o spoolss.o samr.o)
+
+$(eval $(call proto_header_template,$(torturesrcdir)/ndr/proto.h,$(TORTURE_NDR_OBJ_FILES:.o=.c)))
[MODULE::torture_rpc]
# TORTURE_NET and TORTURE_NBT use functions from torture_rpc...
#OUTPUT_TYPE = MERGED_OBJ
SUBSYSTEM = smbtorture
INIT_FUNCTION = torture_rpc_init
-PRIVATE_PROTO_HEADER = \
- rpc/proto.h
PRIVATE_DEPENDENCIES = \
NDR_TABLE RPC_NDR_UNIXINFO dcerpc_samr RPC_NDR_WINREG RPC_NDR_INITSHUTDOWN \
RPC_NDR_OXIDRESOLVER RPC_NDR_EVENTLOG RPC_NDR_ECHO RPC_NDR_SVCCTL \
@@ -111,7 +108,7 @@ PRIVATE_DEPENDENCIES = \
LIBCLI_AUTH POPT_CREDENTIALS TORTURE_LDAP TORTURE_UTIL TORTURE_RAP \
dcerpc_server service process_model ntvfs SERVICE_SMB
-torture_rpc_OBJ_FILES = $(addprefix torture/rpc/, \
+torture_rpc_OBJ_FILES = $(addprefix $(torturesrcdir)/rpc/, \
join.o lsa.o lsa_lookup.o session_key.o echo.o dfs.o drsuapi.o \
drsuapi_cracknames.o dssync.o spoolss.o spoolss_notify.o spoolss_win.o \
unixinfo.o samr.o samr_accessmask.o wkssvc.o srvsvc.o svcctl.o atsvc.o \
@@ -120,32 +117,34 @@ torture_rpc_OBJ_FILES = $(addprefix torture/rpc/, \
samsync.o bind.o dssetup.o alter_context.o bench.o samba3rpc.o rpc.o async_bind.o \
handles.o frsapi.o)
+$(eval $(call proto_header_template,$(torturesrcdir)/rpc/proto.h,$(torture_rpc_OBJ_FILES:.o=.c)))
+
#################################
# Start SUBSYSTEM TORTURE_RAP
[MODULE::TORTURE_RAP]
SUBSYSTEM = smbtorture
INIT_FUNCTION = torture_rap_init
-PRIVATE_PROTO_HEADER = \
- rap/proto.h
PRIVATE_DEPENDENCIES = TORTURE_UTIL LIBCLI_SMB
# End SUBSYSTEM TORTURE_RAP
#################################
-TORTURE_RAP_OBJ_FILES = torture/rap/rap.o
+TORTURE_RAP_OBJ_FILES = $(torturesrcdir)/rap/rap.o
+
+$(eval $(call proto_header_template,$(torturesrcdir)/rap/proto.h,$(TORTURE_RAP_OBJ_FILES:.o=.c)))
#################################
# Start SUBSYSTEM TORTURE_AUTH
[MODULE::TORTURE_AUTH]
SUBSYSTEM = smbtorture
-PRIVATE_PROTO_HEADER = \
- auth/proto.h
PRIVATE_DEPENDENCIES = \
LIBCLI_SMB gensec auth KERBEROS \
POPT_CREDENTIALS SMBPASSWD
# End SUBSYSTEM TORTURE_AUTH
#################################
-TORTURE_AUTH_OBJ_FILES = $(addprefix torture/auth/, ntlmssp.o pac.o)
+TORTURE_AUTH_OBJ_FILES = $(addprefix $(torturesrcdir)/auth/, ntlmssp.o pac.o)
+
+$(eval $(call proto_header_template,$(torturesrcdir)/auth/proto.h,$(TORTURE_AUTH_OBJ_FILES:.o=.c)))
mkinclude local/config.mk
@@ -155,12 +154,12 @@ mkinclude local/config.mk
SUBSYSTEM = smbtorture
INIT_FUNCTION = torture_nbench_init
PRIVATE_DEPENDENCIES = TORTURE_UTIL
-PRIVATE_PROTO_HEADER = \
- nbench/proto.h
# End MODULE TORTURE_NBENCH
#################################
-TORTURE_NBENCH_OBJ_FILES = $(addprefix torture/nbench/, nbio.o nbench.o)
+TORTURE_NBENCH_OBJ_FILES = $(addprefix $(torturesrcdir)/nbench/, nbio.o nbench.o)
+
+$(eval $(call proto_header_template,$(torturesrcdir)/nbench/proto.h,$(TORTURE_NBENCH_OBJ_FILES:.o=.c)))
#################################
# Start MODULE TORTURE_UNIX
@@ -168,51 +167,47 @@ TORTURE_NBENCH_OBJ_FILES = $(addprefix torture/nbench/, nbio.o nbench.o)
SUBSYSTEM = smbtorture
INIT_FUNCTION = torture_unix_init
PRIVATE_DEPENDENCIES = TORTURE_UTIL
-PRIVATE_PROTO_HEADER = \
- unix/proto.h
# End MODULE TORTURE_UNIX
#################################
-TORTURE_UNIX_OBJ_FILES = $(addprefix torture/unix/, unix.o whoami.o unix_info2.o)
+TORTURE_UNIX_OBJ_FILES = $(addprefix $(torturesrcdir)/unix/, unix.o whoami.o unix_info2.o)
+
+$(eval $(call proto_header_template,$(torturesrcdir)/unix/proto.h,$(TORTURE_UNIX_OBJ_FILES:.o=.c)))
#################################
# Start SUBSYSTEM TORTURE_LDAP
[MODULE::TORTURE_LDAP]
SUBSYSTEM = smbtorture
INIT_FUNCTION = torture_ldap_init
-PRIVATE_PROTO_HEADER = \
- ldap/proto.h
PRIVATE_DEPENDENCIES = \
LIBCLI_LDAP LIBCLI_CLDAP SAMDB POPT_CREDENTIALS
# End SUBSYSTEM TORTURE_LDAP
#################################
-TORTURE_LDAP_OBJ_FILES = $(addprefix torture/ldap/, common.o basic.o schema.o uptodatevector.o cldap.o cldapbench.o)
+TORTURE_LDAP_OBJ_FILES = $(addprefix $(torturesrcdir)/ldap/, common.o basic.o schema.o uptodatevector.o cldap.o cldapbench.o)
+$(eval $(call proto_header_template,$(torturesrcdir)/ldap/proto.h,$(TORTURE_LDAP_OBJ_FILES:.o=.c)))
#################################
# Start SUBSYSTEM TORTURE_NBT
[MODULE::TORTURE_NBT]
SUBSYSTEM = smbtorture
INIT_FUNCTION = torture_nbt_init
-PRIVATE_PROTO_HEADER = \
- nbt/proto.h
PRIVATE_DEPENDENCIES = \
LIBCLI_SMB LIBCLI_NBT LIBCLI_DGRAM LIBCLI_WREPL torture_rpc
# End SUBSYSTEM TORTURE_NBT
#################################
-TORTURE_NBT_OBJ_FILES = $(addprefix torture/nbt/, query.o register.o \
+TORTURE_NBT_OBJ_FILES = $(addprefix $(torturesrcdir)/nbt/, query.o register.o \
wins.o winsbench.o winsreplication.o dgram.o nbt.o)
+$(eval $(call proto_header_template,$(torturesrcdir)/nbt/proto.h,$(TORTURE_NBT_OBJ_FILES:.o=.c)))
#################################
# Start SUBSYSTEM TORTURE_NET
[MODULE::TORTURE_NET]
SUBSYSTEM = smbtorture
INIT_FUNCTION = torture_net_init
-PRIVATE_PROTO_HEADER = \
- libnet/proto.h
PRIVATE_DEPENDENCIES = \
LIBSAMBA-NET \
POPT_CREDENTIALS \
@@ -220,11 +215,12 @@ PRIVATE_DEPENDENCIES = \
# End SUBSYSTEM TORTURE_NET
#################################
-TORTURE_NET_OBJ_FILES = $(addprefix torture/libnet/, libnet.o \
+TORTURE_NET_OBJ_FILES = $(addprefix $(torturesrcdir)/libnet/, libnet.o \
utils.o userinfo.o userman.o groupinfo.o groupman.o \
domain.o libnet_lookup.o libnet_user.o libnet_group.o \
libnet_share.o libnet_rpc.o libnet_domain.o libnet_BecomeDC.o)
+$(eval $(call proto_header_template,$(torturesrcdir)/libnet/proto.h,$(TORTURE_NET_OBJ_FILES:.o=.c)))
#################################
# Start BINARY smbtorture
@@ -241,10 +237,10 @@ PRIVATE_DEPENDENCIES = \
# End BINARY smbtorture
#################################
-smbtorture_OBJ_FILES = torture/smbtorture.o torture/torture.o
+smbtorture_OBJ_FILES = $(torturesrcdir)/smbtorture.o $(torturesrcdir)/torture.o
-PUBLIC_HEADERS += torture/smbtorture.h
-MANPAGES += torture/man/smbtorture.1
+PUBLIC_HEADERS += $(torturesrcdir)/smbtorture.h
+MANPAGES += $(torturesrcdir)/man/smbtorture.1
#################################
# Start BINARY gentest
@@ -261,9 +257,9 @@ PRIVATE_DEPENDENCIES = \
# End BINARY gentest
#################################
-gentest_OBJ_FILES = torture/gentest.o
+gentest_OBJ_FILES = $(torturesrcdir)/gentest.o
-MANPAGES += torture/man/gentest.1
+MANPAGES += $(torturesrcdir)/man/gentest.1
#################################
# Start BINARY masktest
@@ -279,9 +275,9 @@ PRIVATE_DEPENDENCIES = \
# End BINARY masktest
#################################
-masktest_OBJ_FILES = torture/masktest.o
+masktest_OBJ_FILES = $(torturesrcdir)/masktest.o
-MANPAGES += torture/man/masktest.1
+MANPAGES += $(torturesrcdir)/man/masktest.1
#################################
# Start BINARY locktest
@@ -297,9 +293,9 @@ PRIVATE_DEPENDENCIES = \
# End BINARY locktest
#################################
-locktest_OBJ_FILES = torture/locktest.o
+locktest_OBJ_FILES = $(torturesrcdir)/locktest.o
-MANPAGES += torture/man/locktest.1
+MANPAGES += $(torturesrcdir)/man/locktest.1
GCOV=0
diff --git a/source4/torture/local/config.mk b/source4/torture/local/config.mk
index d7cac101df..cd1c7b1422 100644
--- a/source4/torture/local/config.mk
+++ b/source4/torture/local/config.mk
@@ -3,8 +3,6 @@
[MODULE::TORTURE_LOCAL]
SUBSYSTEM = smbtorture
INIT_FUNCTION = torture_local_init
-PRIVATE_PROTO_HEADER = \
- proto.h
PRIVATE_DEPENDENCIES = \
RPC_NDR_ECHO \
TDR \
@@ -21,32 +19,34 @@ PRIVATE_DEPENDENCIES = \
#################################
TORTURE_LOCAL_OBJ_FILES = \
- lib/charset/tests/iconv.o \
- lib/talloc/testsuite.o \
- lib/replace/test/getifaddrs.o \
- lib/replace/test/os2_delete.o \
- lib/replace/test/strptime.o \
- lib/replace/test/testsuite.o \
- lib/messaging/tests/messaging.o \
- lib/messaging/tests/irpc.o \
- librpc/tests/binding_string.o \
- lib/util/tests/idtree.o \
- lib/socket/testsuite.o \
- lib/socket_wrapper/testsuite.o \
- libcli/resolve/testsuite.o \
- lib/util/tests/strlist.o \
- lib/util/tests/str.o \
- lib/util/tests/file.o \
- lib/util/tests/genrand.o \
- lib/compression/testsuite.o \
- lib/charset/tests/charset.o \
- libcli/security/tests/sddl.o \
- lib/tdr/testsuite.o \
- lib/events/testsuite.o \
- param/tests/share.o \
- param/tests/loadparm.o \
- auth/credentials/tests/simple.o \
- torture/local/local.o \
- torture/local/dbspeed.o \
- torture/local/torture.o
+ $(torturesrcdir)/../lib/charset/tests/iconv.o \
+ $(torturesrcdir)/../lib/talloc/testsuite.o \
+ $(torturesrcdir)/../lib/replace/test/getifaddrs.o \
+ $(torturesrcdir)/../lib/replace/test/os2_delete.o \
+ $(torturesrcdir)/../lib/replace/test/strptime.o \
+ $(torturesrcdir)/../lib/replace/test/testsuite.o \
+ $(torturesrcdir)/../lib/messaging/tests/messaging.o \
+ $(torturesrcdir)/../lib/messaging/tests/irpc.o \
+ $(torturesrcdir)/../librpc/tests/binding_string.o \
+ $(torturesrcdir)/../lib/util/tests/idtree.o \
+ $(torturesrcdir)/../lib/socket/testsuite.o \
+ $(torturesrcdir)/../lib/socket_wrapper/testsuite.o \
+ $(torturesrcdir)/../libcli/resolve/testsuite.o \
+ $(torturesrcdir)/../lib/util/tests/strlist.o \
+ $(torturesrcdir)/../lib/util/tests/str.o \
+ $(torturesrcdir)/../lib/util/tests/file.o \
+ $(torturesrcdir)/../lib/util/tests/genrand.o \
+ $(torturesrcdir)/../lib/compression/testsuite.o \
+ $(torturesrcdir)/../lib/charset/tests/charset.o \
+ $(torturesrcdir)/../libcli/security/tests/sddl.o \
+ $(torturesrcdir)/../lib/tdr/testsuite.o \
+ $(torturesrcdir)/../lib/events/testsuite.o \
+ $(torturesrcdir)/../param/tests/share.o \
+ $(torturesrcdir)/../param/tests/loadparm.o \
+ $(torturesrcdir)/../auth/credentials/tests/simple.o \
+ $(torturesrcdir)/local/local.o \
+ $(torturesrcdir)/local/dbspeed.o \
+ $(torturesrcdir)/local/torture.o
+
+$(eval $(call proto_header_template,$(torturesrcdir)/local/proto.h,$(TORTURE_LOCAL_OBJ_FILES:.o=.c)))
diff --git a/source4/torture/rpc/rpc.c b/source4/torture/rpc/rpc.c
index fdb88b13dc..acc1220ccc 100644
--- a/source4/torture/rpc/rpc.c
+++ b/source4/torture/rpc/rpc.c
@@ -399,6 +399,7 @@ NTSTATUS torture_rpc_init(void)
torture_suite_add_simple_test(suite, "SAMSYNC", torture_rpc_samsync);
torture_suite_add_simple_test(suite, "SCHANNEL", torture_rpc_schannel);
torture_suite_add_simple_test(suite, "SCHANNEL2", torture_rpc_schannel2);
+ torture_suite_add_simple_test(suite, "BENCH-SCHANNEL1", torture_rpc_schannel_bench1);
torture_suite_add_suite(suite, torture_rpc_srvsvc(suite));
torture_suite_add_suite(suite, torture_rpc_svcctl(suite));
torture_suite_add_suite(suite, torture_rpc_samr_accessmask(suite));
diff --git a/source4/torture/rpc/schannel.c b/source4/torture/rpc/schannel.c
index c89b71baaf..f0279f0d04 100644
--- a/source4/torture/rpc/schannel.c
+++ b/source4/torture/rpc/schannel.c
@@ -33,6 +33,8 @@
#include "param/param.h"
#include "librpc/rpc/dcerpc_proto.h"
#include "auth/gensec/gensec.h"
+#include "libcli/composite/composite.h"
+#include "lib/events/events.h"
#define TEST_MACHINE_NAME "schannel"
@@ -484,3 +486,286 @@ bool torture_rpc_schannel2(struct torture_context *torture)
return true;
}
+struct torture_schannel_bench;
+
+struct torture_schannel_bench_conn {
+ struct torture_schannel_bench *s;
+ int index;
+ struct cli_credentials *wks_creds;
+ struct dcerpc_pipe *pipe;
+ struct netr_LogonSamLogonEx r;
+ struct netr_NetworkInfo ninfo;
+ TALLOC_CTX *tmp;
+ uint64_t total;
+ uint32_t count;
+};
+
+struct torture_schannel_bench {
+ struct torture_context *tctx;
+ bool progress;
+ int timelimit;
+ int nprocs;
+ int nconns;
+ struct torture_schannel_bench_conn *conns;
+ struct test_join *join_ctx1;
+ struct cli_credentials *wks_creds1;
+ struct test_join *join_ctx2;
+ struct cli_credentials *wks_creds2;
+ struct cli_credentials *user1_creds;
+ struct cli_credentials *user2_creds;
+ struct dcerpc_binding *b;
+ NTSTATUS error;
+ uint64_t total;
+ uint32_t count;
+ bool stopped;
+};
+
+static void torture_schannel_bench_connected(struct composite_context *c)
+{
+ struct torture_schannel_bench_conn *conn =
+ (struct torture_schannel_bench_conn *)c->async.private_data;
+ struct torture_schannel_bench *s = talloc_get_type(conn->s,
+ struct torture_schannel_bench);
+
+ s->error = dcerpc_pipe_connect_b_recv(c, s->conns, &conn->pipe);
+ torture_comment(s->tctx, "conn[%u]: %s\n", conn->index, nt_errstr(s->error));
+ if (NT_STATUS_IS_OK(s->error)) {
+ s->nconns++;
+ }
+}
+
+static void torture_schannel_bench_recv(struct rpc_request *req);
+
+static bool torture_schannel_bench_start(struct torture_schannel_bench_conn *conn)
+{
+ struct torture_schannel_bench *s = conn->s;
+ NTSTATUS status;
+ DATA_BLOB names_blob, chal, lm_resp, nt_resp;
+ int flags = CLI_CRED_NTLM_AUTH;
+ struct rpc_request *req;
+ struct cli_credentials *user_creds;
+
+ if (conn->total % 2) {
+ user_creds = s->user1_creds;
+ } else {
+ user_creds = s->user2_creds;
+ }
+
+ if (lp_client_lanman_auth(s->tctx->lp_ctx)) {
+ flags |= CLI_CRED_LANMAN_AUTH;
+ }
+
+ if (lp_client_ntlmv2_auth(s->tctx->lp_ctx)) {
+ flags |= CLI_CRED_NTLMv2_AUTH;
+ }
+
+ talloc_free(conn->tmp);
+ conn->tmp = talloc_new(s);
+ ZERO_STRUCT(conn->ninfo);
+ ZERO_STRUCT(conn->r);
+
+ cli_credentials_get_ntlm_username_domain(user_creds, conn->tmp,
+ &conn->ninfo.identity_info.account_name.string,
+ &conn->ninfo.identity_info.domain_name.string);
+
+ generate_random_buffer(conn->ninfo.challenge,
+ sizeof(conn->ninfo.challenge));
+ chal = data_blob_const(conn->ninfo.challenge,
+ sizeof(conn->ninfo.challenge));
+
+ names_blob = NTLMv2_generate_names_blob(conn->tmp, lp_iconv_convenience(s->tctx->lp_ctx),
+ cli_credentials_get_workstation(conn->wks_creds),
+ cli_credentials_get_domain(conn->wks_creds));
+
+ status = cli_credentials_get_ntlm_response(user_creds, conn->tmp,
+ &flags,
+ chal,
+ names_blob,
+ &lm_resp, &nt_resp,
+ NULL, NULL);
+ torture_assert_ntstatus_ok(s->tctx, status,
+ "cli_credentials_get_ntlm_response failed");
+
+ conn->ninfo.lm.data = lm_resp.data;
+ conn->ninfo.lm.length = lm_resp.length;
+
+ conn->ninfo.nt.data = nt_resp.data;
+ conn->ninfo.nt.length = nt_resp.length;
+
+ conn->ninfo.identity_info.parameter_control = 0;
+ conn->ninfo.identity_info.logon_id_low = 0;
+ conn->ninfo.identity_info.logon_id_high = 0;
+ conn->ninfo.identity_info.workstation.string = cli_credentials_get_workstation(conn->wks_creds);
+
+ conn->r.in.server_name = talloc_asprintf(conn->tmp, "\\\\%s", dcerpc_server_name(conn->pipe));
+ conn->r.in.computer_name = cli_credentials_get_workstation(conn->wks_creds);
+ conn->r.in.logon_level = 2;
+ conn->r.in.logon.network = &conn->ninfo;
+ conn->r.in.flags = 0;
+ conn->r.in.validation_level = 2;
+
+ req = dcerpc_netr_LogonSamLogonEx_send(conn->pipe, conn->tmp, &conn->r);
+ torture_assert(s->tctx, req, "Failed to setup LogonSamLogonEx request");
+
+ req->async.callback = torture_schannel_bench_recv;
+ req->async.private_data = conn;
+
+ return true;
+}
+
+static void torture_schannel_bench_recv(struct rpc_request *req)
+{
+ bool ret;
+ struct torture_schannel_bench_conn *conn =
+ (struct torture_schannel_bench_conn *)req->async.private_data;
+ struct torture_schannel_bench *s = talloc_get_type(conn->s,
+ struct torture_schannel_bench);
+
+ s->error = dcerpc_ndr_request_recv(req);
+ if (!NT_STATUS_IS_OK(s->error)) {
+ return;
+ }
+
+ conn->total++;
+ conn->count++;
+
+ if (s->stopped) {
+ return;
+ }
+
+ ret = torture_schannel_bench_start(conn);
+ if (!ret) {
+ s->error = NT_STATUS_INTERNAL_ERROR;
+ }
+}
+
+/*
+ test multiple schannel connection in parallel
+ */
+bool torture_rpc_schannel_bench1(struct torture_context *torture)
+{
+ bool ret = true;
+ NTSTATUS status;
+ const char *binding = torture_setting_string(torture, "binding", NULL);
+ struct torture_schannel_bench *s;
+ struct timeval start;
+ struct timeval end;
+ int i;
+ const char *tmp;
+
+ s = talloc_zero(torture, struct torture_schannel_bench);
+ s->tctx = torture;
+ s->progress = torture_setting_bool(torture, "progress", true);
+ s->timelimit = torture_setting_int(torture, "timelimit", 10);
+ s->nprocs = torture_setting_int(torture, "nprocs", 4);
+ s->conns = talloc_zero_array(s, struct torture_schannel_bench_conn, s->nprocs);
+
+ s->user1_creds = (struct cli_credentials *)talloc_memdup(s,
+ cmdline_credentials,
+ sizeof(*s->user1_creds));
+ tmp = torture_setting_string(s->tctx, "extra_user1", NULL);
+ if (tmp) {
+ cli_credentials_parse_string(s->user1_creds, tmp, CRED_SPECIFIED);
+ }
+ s->user2_creds = (struct cli_credentials *)talloc_memdup(s,
+ cmdline_credentials,
+ sizeof(*s->user1_creds));
+ tmp = torture_setting_string(s->tctx, "extra_user2", NULL);
+ if (tmp) {
+ cli_credentials_parse_string(s->user1_creds, tmp, CRED_SPECIFIED);
+ }
+
+ s->join_ctx1 = torture_join_domain(s->tctx, talloc_asprintf(s, "%sb", TEST_MACHINE_NAME),
+ ACB_WSTRUST, &s->wks_creds1);
+ torture_assert(torture, s->join_ctx1 != NULL,
+ "Failed to join domain with acct_flags=ACB_WSTRUST");
+ s->join_ctx2 = torture_join_domain(s->tctx, talloc_asprintf(s, "%sc", TEST_MACHINE_NAME),
+ ACB_WSTRUST, &s->wks_creds2);
+ torture_assert(torture, s->join_ctx2 != NULL,
+ "Failed to join domain with acct_flags=ACB_WSTRUST");
+
+ cli_credentials_set_kerberos_state(s->wks_creds1, CRED_DONT_USE_KERBEROS);
+ cli_credentials_set_kerberos_state(s->wks_creds2, CRED_DONT_USE_KERBEROS);
+
+ for (i=0; i < s->nprocs; i++) {
+ s->conns[i].s = s;
+ s->conns[i].index = i;
+ s->conns[i].wks_creds = (struct cli_credentials *)talloc_memdup(
+ s->conns, s->wks_creds1,sizeof(*s->wks_creds1));
+ if ((i % 2) && (torture_setting_bool(torture, "multijoin", false))) {
+ memcpy(s->conns[i].wks_creds, s->wks_creds2,
+ talloc_get_size(s->conns[i].wks_creds));
+ }
+ s->conns[i].wks_creds->netlogon_creds = NULL;
+ }
+
+ status = dcerpc_parse_binding(s, binding, &s->b);
+ torture_assert_ntstatus_ok(torture, status, "Bad binding string");
+ s->b->flags &= ~DCERPC_AUTH_OPTIONS;
+ s->b->flags |= DCERPC_SCHANNEL | DCERPC_SIGN;
+
+ torture_comment(torture, "Opening %d connections in parallel\n", s->nprocs);
+ for (i=0; i < s->nprocs; i++) {
+#if 1
+ s->error = dcerpc_pipe_connect_b(s->conns, &s->conns[i].pipe, s->b,
+ &ndr_table_netlogon,
+ s->conns[i].wks_creds,
+ torture->ev, torture->lp_ctx);
+ torture_assert_ntstatus_ok(torture, s->error, "Failed to connect with schannel");
+#else
+ /*
+ * This path doesn't work against windows,
+ * because of windows drops the connections
+ * which haven't reached a session setup yet
+ *
+ * The same as the reset on zero vc stuff.
+ */
+ struct composite_context *c;
+ c = dcerpc_pipe_connect_b_send(s->conns, s->b,
+ &ndr_table_netlogon,
+ s->conns[i].wks_creds,
+ torture->ev,
+ torture->lp_ctx);
+ torture_assert(torture, c != NULL, "Failed to setup connect");
+ c->async.fn = torture_schannel_bench_connected;
+ c->async.private_data = &s->conns[i];
+ }
+
+ while (NT_STATUS_IS_OK(s->error) && s->nprocs != s->nconns) {
+ int ev_ret = event_loop_once(torture->ev);
+ torture_assert(torture, ev_ret == 0, "event_loop_once failed");
+#endif
+ }
+ torture_assert_ntstatus_ok(torture, s->error, "Failed establish a connect");
+
+ torture_comment(torture, "Start looping LogonSamLogonEx on %d connections for %d secs\n",
+ s->nprocs, s->timelimit);
+ for (i=0; i < s->nprocs; i++) {
+ ret = torture_schannel_bench_start(&s->conns[i]);
+ torture_assert(torture, ret, "Failed to setup LogonSamLogonEx");
+ }
+
+ start = timeval_current();
+ end = timeval_add(&start, s->timelimit, 0);
+
+ while (NT_STATUS_IS_OK(s->error) && !timeval_expired(&end)) {
+ int ev_ret = event_loop_once(torture->ev);
+ torture_assert(torture, ev_ret == 0, "event_loop_once failed");
+ }
+ torture_assert_ntstatus_ok(torture, s->error, "Failed some request");
+ s->stopped = true;
+ talloc_free(s->conns);
+
+ for (i=0; i < s->nprocs; i++) {
+ s->total += s->conns[i].total;
+ }
+
+ torture_comment(torture,
+ "Total ops[%llu] (%u ops/s)\n",
+ (unsigned long long)s->total,
+ (unsigned)s->total/s->timelimit);
+
+ torture_leave_domain(s->join_ctx1);
+ torture_leave_domain(s->join_ctx2);
+ return true;
+}
diff --git a/source4/torture/rpc/testjoin.c b/source4/torture/rpc/testjoin.c
index 100e7cead2..51efd99bd8 100644
--- a/source4/torture/rpc/testjoin.c
+++ b/source4/torture/rpc/testjoin.c
@@ -508,9 +508,11 @@ _PUBLIC_ void torture_leave_domain(struct test_join *join)
/* Delete machine account */
status = dcerpc_samr_DeleteUser(join->p, join, &d);
if (!NT_STATUS_IS_OK(status)) {
- printf("Delete of machine account failed\n");
+ printf("Delete of machine account %s failed\n",
+ join->netbios_name);
} else {
- printf("Delete of machine account was successful.\n");
+ printf("Delete of machine account %s was successful.\n",
+ join->netbios_name);
}
if (join->libnet_r) {
diff --git a/source4/torture/smb2/config.mk b/source4/torture/smb2/config.mk
index 4e0cac0029..11c4e1fa2c 100644
--- a/source4/torture/smb2/config.mk
+++ b/source4/torture/smb2/config.mk
@@ -4,14 +4,12 @@
[MODULE::TORTURE_SMB2]
SUBSYSTEM = smbtorture
INIT_FUNCTION = torture_smb2_init
-PRIVATE_PROTO_HEADER = \
- proto.h
PRIVATE_DEPENDENCIES = \
LIBCLI_SMB2 POPT_CREDENTIALS
# End SUBSYSTEM TORTURE_SMB2
#################################
-TORTURE_SMB2_OBJ_FILES = $(addprefix torture/smb2/, \
+TORTURE_SMB2_OBJ_FILES = $(addprefix $(torturesrcdir)/smb2/, \
connect.o \
scan.o \
util.o \
@@ -24,3 +22,5 @@ TORTURE_SMB2_OBJ_FILES = $(addprefix torture/smb2/, \
persistent_handles.o \
oplocks.o)
+
+$(eval $(call proto_header_template,$(torturesrcdir)/smb2/proto.h,$(TORTURE_SMB2_OBJ_FILES:.o=.c)))
diff --git a/source4/torture/winbind/config.mk b/source4/torture/winbind/config.mk
index ee8ff950a6..15bc51daba 100644
--- a/source4/torture/winbind/config.mk
+++ b/source4/torture/winbind/config.mk
@@ -4,12 +4,12 @@
[MODULE::TORTURE_WINBIND]
SUBSYSTEM = smbtorture
INIT_FUNCTION = torture_winbind_init
-PRIVATE_PROTO_HEADER = \
- proto.h
PRIVATE_DEPENDENCIES = \
LIBWINBIND-CLIENT
# End SUBSYSTEM TORTURE_WINBIND
#################################
-TORTURE_WINBIND_OBJ_FILES = $(addprefix torture/winbind/, winbind.o struct_based.o)
+TORTURE_WINBIND_OBJ_FILES = $(addprefix $(torturesrcdir)/winbind/, winbind.o struct_based.o)
+
+$(eval $(call proto_header_template,$(torturesrcdir)/winbind/proto.h,$(TORTURE_WINBIND_OBJ_FILES:.o=.c)))
diff --git a/source4/utils/config.mk b/source4/utils/config.mk
index 13f3b0a145..d47b36ea7c 100644
--- a/source4/utils/config.mk
+++ b/source4/utils/config.mk
@@ -19,9 +19,9 @@ PRIVATE_DEPENDENCIES = \
# End BINARY ntlm_auth
#################################
-ntlm_auth_OBJ_FILES = utils/ntlm_auth.o
+ntlm_auth_OBJ_FILES = $(utilssrcdir)/ntlm_auth.o
-MANPAGES += utils/man/ntlm_auth.1
+MANPAGES += $(utilssrcdir)/man/ntlm_auth.1
#################################
# Start BINARY getntacl
@@ -34,12 +34,12 @@ PRIVATE_DEPENDENCIES = \
WRAP_XATTR \
LIBSAMBA-ERRORS
-getntacl_OBJ_FILES = utils/getntacl.o
+getntacl_OBJ_FILES = $(utilssrcdir)/getntacl.o
# End BINARY getntacl
#################################
-MANPAGES += utils/man/getntacl.1
+MANPAGES += $(utilssrcdir)/man/getntacl.1
#################################
# Start BINARY setntacl
@@ -49,7 +49,7 @@ MANPAGES += utils/man/getntacl.1
# End BINARY setntacl
#################################
-setntacl_OBJ_FILES = utils/setntacl.o
+setntacl_OBJ_FILES = $(utilssrcdir)/setntacl.o
#################################
# Start BINARY setnttoken
@@ -59,7 +59,7 @@ PRIVATE_DEPENDENCIES =
# End BINARY setnttoken
#################################
-setnttoken_OBJ_FILES = utils/setnttoken.o
+setnttoken_OBJ_FILES = $(utilssrcdir)/setnttoken.o
#################################
# Start BINARY nmblookup
@@ -76,7 +76,7 @@ PRIVATE_DEPENDENCIES = \
# End BINARY nmblookup
#################################
-nmblookup_OBJ_FILES = utils/nmblookup.o
+nmblookup_OBJ_FILES = $(utilssrcdir)/nmblookup.o
#################################
# Start BINARY testparm
@@ -93,4 +93,4 @@ PRIVATE_DEPENDENCIES = \
# End BINARY testparm
#################################
-testparm_OBJ_FILES = utils/testparm.o
+testparm_OBJ_FILES = $(utilssrcdir)/testparm.o
diff --git a/source4/utils/net/config.mk b/source4/utils/net/config.mk
index 4423c44c15..93b51e1e28 100644
--- a/source4/utils/net/config.mk
+++ b/source4/utils/net/config.mk
@@ -1,10 +1,9 @@
-# utils/net subsystem
+# $(utilssrcdir)/net subsystem
#################################
# Start BINARY net
[BINARY::net]
INSTALLDIR = BINDIR
-PRIVATE_PROTO_HEADER = net_proto.h
PRIVATE_DEPENDENCIES = \
LIBSAMBA-HOSTCONFIG \
LIBSAMBA-UTIL \
@@ -15,7 +14,7 @@ PRIVATE_DEPENDENCIES = \
# End BINARY net
#################################
-net_OBJ_FILES = $(addprefix utils/net/, \
+net_OBJ_FILES = $(addprefix $(utilssrcdir)/net/, \
net.o \
net_password.o \
net_time.o \
@@ -23,3 +22,5 @@ net_OBJ_FILES = $(addprefix utils/net/, \
net_vampire.o \
net_user.o)
+
+$(eval $(call proto_header_template,$(utilssrcdir)/net/net_proto.h,$(net_OBJ_FILES:.o=.c)))
diff --git a/source4/web_server/config.mk b/source4/web_server/config.mk
index 86ad04fb7e..fe78687794 100644
--- a/source4/web_server/config.mk
+++ b/source4/web_server/config.mk
@@ -5,9 +5,10 @@
[MODULE::WEB]
INIT_FUNCTION = server_service_web_init
SUBSYSTEM = smbd
-PRIVATE_PROTO_HEADER = proto.h
PRIVATE_DEPENDENCIES = ESP LIBTLS smbcalls process_model
# End SUBSYSTEM WEB
#######################
-WEB_OBJ_FILES = $(addprefix web_server/, web_server.o http.o)
+WEB_OBJ_FILES = $(addprefix $(web_serversrcdir)/, web_server.o http.o)
+
+$(eval $(call proto_header_template,$(web_serversrcdir)/proto.h,$(WEB_OBJ_FILES:.o=.c)))
diff --git a/source4/winbind/config.mk b/source4/winbind/config.mk
index 3c5b740e68..b5eb2c23f0 100644
--- a/source4/winbind/config.mk
+++ b/source4/winbind/config.mk
@@ -5,7 +5,6 @@
[MODULE::WINBIND]
INIT_FUNCTION = server_service_winbind_init
SUBSYSTEM = smbd
-PRIVATE_PROTO_HEADER = wb_proto.h
PRIVATE_DEPENDENCIES = \
WB_HELPER \
IDMAP \
@@ -18,7 +17,7 @@ PRIVATE_DEPENDENCIES = \
# End SUBSYSTEM WINBIND
#######################
-WINBIND_OBJ_FILES = $(addprefix winbind/, \
+WINBIND_OBJ_FILES = $(addprefix $(winbindsrcdir)/, \
wb_server.o \
wb_irpc.o \
wb_samba3_protocol.o \
@@ -50,22 +49,26 @@ WINBIND_OBJ_FILES = $(addprefix winbind/, \
wb_pam_auth.o \
wb_sam_logon.o)
+$(eval $(call proto_header_template,$(winbindsrcdir)/wb_proto.h,$(WINBIND_OBJ_FILES:.o=.c)))
+
################################################
# Start SUBYSTEM WB_HELPER
[SUBSYSTEM::WB_HELPER]
-PRIVATE_PROTO_HEADER = wb_helper.h
PUBLIC_DEPENDENCIES = RPC_NDR_LSA dcerpc_samr
# End SUBSYSTEM WB_HELPER
################################################
-WB_HELPER_OBJ_FILES = $(addprefix winbind/, wb_async_helpers.o wb_utils.o)
+WB_HELPER_OBJ_FILES = $(addprefix $(winbindsrcdir)/, wb_async_helpers.o wb_utils.o)
+
+$(eval $(call proto_header_template,$(winbindsrcdir)/wb_helper.h,$(WB_HELPER_OBJ_FILES:.o=.c)))
################################################
# Start SUBYSTEM IDMAP
[SUBSYSTEM::IDMAP]
-PRIVATE_PROTO_HEADER = idmap_proto.h
PUBLIC_DEPENDENCIES = SAMDB_COMMON
# End SUBSYSTEM IDMAP
################################################
-IDMAP_OBJ_FILES = winbind/idmap.o
+IDMAP_OBJ_FILES = $(winbindsrcdir)/idmap.o
+
+$(eval $(call proto_header_template,$(winbindsrcdir)/idmap_proto.h,$(IDMAP_OBJ_FILES:.o=.c)))
diff --git a/source4/wrepl_server/config.mk b/source4/wrepl_server/config.mk
index 6428a353b1..235a897503 100644
--- a/source4/wrepl_server/config.mk
+++ b/source4/wrepl_server/config.mk
@@ -5,13 +5,12 @@
[MODULE::WREPL_SRV]
INIT_FUNCTION = server_service_wrepl_init
SUBSYSTEM = smbd
-PRIVATE_PROTO_HEADER = wrepl_server_proto.h
PRIVATE_DEPENDENCIES = \
LIBCLI_WREPL WINSDB process_model
# End SUBSYSTEM WREPL_SRV
#######################
-WREPL_SRV_OBJ_FILES = $(addprefix wrepl_server/, \
+WREPL_SRV_OBJ_FILES = $(addprefix $(wrepl_serversrcdir)/, \
wrepl_server.o \
wrepl_in_connection.o \
wrepl_in_call.o \
@@ -22,3 +21,4 @@ WREPL_SRV_OBJ_FILES = $(addprefix wrepl_server/, \
wrepl_out_push.o \
wrepl_out_helpers.o)
+$(eval $(call proto_header_template,$(wrepl_serversrcdir)/wrepl_server_proto.h,$(WREPL_SRV_OBJ_FILES:.o=.c)))
diff --git a/source4/wrepl_server/wrepl_in_connection.c b/source4/wrepl_server/wrepl_in_connection.c
index 34d94d73a6..25227481b8 100644
--- a/source4/wrepl_server/wrepl_in_connection.c
+++ b/source4/wrepl_server/wrepl_in_connection.c
@@ -230,7 +230,7 @@ NTSTATUS wreplsrv_in_connection_merge(struct wreplsrv_partner *partner,
wrepl_in->service = service;
wrepl_in->partner = partner;
- status = stream_new_connection_merge(service->task->event_ctx, model_ops,
+ status = stream_new_connection_merge(service->task->event_ctx, service->task->lp_ctx, model_ops,
sock, &wreplsrv_stream_ops, service->task->msg_ctx,
wrepl_in, &conn);
NT_STATUS_NOT_OK_RETURN(status);