summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-04-07 07:34:12 -0600
committerKai Blin <kai@samba.org>2010-05-20 22:16:13 +0200
commit419873f2ee9997edd06f95758f7ab10aa1a8d15b (patch)
treeaad5d9f3fa2bf89ef063fc1923b168c2027946ca
parent538edd5fc0668e08d955f75a3524811c1e987e93 (diff)
downloadsamba-419873f2ee9997edd06f95758f7ab10aa1a8d15b.tar.gz
samba-419873f2ee9997edd06f95758f7ab10aa1a8d15b.tar.bz2
samba-419873f2ee9997edd06f95758f7ab10aa1a8d15b.zip
s3-waf: All sorts of nasty hacks to finally get smbd to build/link
Pair-Programmed-With: Kai Blin <kai@samba.org>
-rw-r--r--nsswitch/libwbclient/wscript_build3
-rw-r--r--source3/build/wscript5
-rw-r--r--source3/wscript17
-rw-r--r--source3/wscript_build64
4 files changed, 64 insertions, 25 deletions
diff --git a/nsswitch/libwbclient/wscript_build b/nsswitch/libwbclient/wscript_build
index a4a8742baf..7d1ed2e690 100644
--- a/nsswitch/libwbclient/wscript_build
+++ b/nsswitch/libwbclient/wscript_build
@@ -7,6 +7,7 @@ bld.SAMBA_SUBSYSTEM('LIBWBCLIENT',
bld.SAMBA_SUBSYSTEM('LIBWBCLIENT_ASYNC',
source='wbc_async.c wbc_idmap_async.c wbc_pam_async.c wbc_sid_async.c wbc_util_async.c wb_reqtrans.c',
- public_deps='LIBASYNC_REQ tevent talloc UTIL_TEVENT LIBWBCLIENT'
+ public_deps='LIBASYNC_REQ tevent talloc UTIL_TEVENT LIBWBCLIENT',
+ enabled=False, # we don't have LIBASYNC_REQ yet
)
diff --git a/source3/build/wscript b/source3/build/wscript
index 2940dd569d..17c6748404 100644
--- a/source3/build/wscript
+++ b/source3/build/wscript
@@ -14,6 +14,9 @@ def set_options(opt):
help=(help + ' [%s]' % default),
action="store", dest=varname, default=default)
+
+cflags_vars = [ 'CONFIGFILE' ]
+
def configure(conf):
# get all the basic GNU options from the gnu_dirs tool
conf.check_tool('gnu_dirs')
@@ -31,6 +34,8 @@ def configure(conf):
conf.ASSERT(v != '', "Empty dynconfig value for %s" % f)
conf.ASSERT(v.find('${') == -1, "Unsubstituted variable in %s : %s : %s" % (f, dyn_cflags[f], v))
conf.env[f] = v
+ if f in cflags_vars:
+ conf.DEFINE(f, v, quote=True)
def build(bld):
cflags = dynconfig_cflags(bld)
diff --git a/source3/wscript b/source3/wscript
index e489b8d62e..4716008e0b 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -16,7 +16,7 @@ def set_options(opt):
opt.RECURSE('build')
opt.RECURSE('../lib/nss_wrapper')
opt.RECURSE('../lib/socket_wrapper')
- opt.RECURSE('../lib/uid_wrapper')
+ opt.RECURSE('../lib/tevent')
opt.add_option('--with-static-modules',
help=("Comma-separated list of names of modules to statically link in"),
@@ -50,9 +50,9 @@ def configure(conf):
conf.RECURSE('../lib/tdb')
conf.RECURSE('../lib/talloc')
conf.RECURSE('../lib/tevent')
+ conf.RECURSE('../lib/popt')
conf.RECURSE('../lib/nss_wrapper')
conf.RECURSE('../lib/socket_wrapper')
- conf.RECURSE('../lib/uid_wrapper')
conf.CHECK_HEADERS('execinfo.h libexc.h libunwind.h')
@@ -76,6 +76,7 @@ def configure(conf):
conf.CHECK_FUNCS('shmget')
conf.CHECK_FUNCS_IN('shm_open', 'rt', checklibc=True)
conf.CHECK_FUNCS('gettext dgettext bindtextdomain textdomain')
+ conf.CHECK_FUNCS_IN('yp_get_default_domain', 'nsl')
# Check for inotify support
conf.CHECK_HEADERS('linux/inotify.h asm/unistd.h sys/inotify.h')
@@ -309,17 +310,17 @@ yp_get_default_domain
# last but not least, if ldap_init() exists, we want to use ldap
if conf.CONFIG_SET('HAVE_LDAP_INIT'):
conf.DEFINE('HAVE_LDAP', '1')
+ conf.DEFINE('LDAP_DEPRECATED', '1')
conf.env['SMBLDAP'] = 'lib/smbldap.c'
conf.env['SMBLDAPUTIL'] = 'lib/smbldap_util.c'
- #TODO: We also need to add -DLDAP_DEPRECATED to the build flags.
# Check for kerberos
conf.find_program('krb5-config', var='KRB5_CONFIG')
if conf.env.KRB5_CONFIG:
conf.check_cfg(path="krb5-config", args="--cflags --libs",
- package="gssapi", uselib_store="KRB5")
- conf.CHECK_HEADERS('krb5.h krb5/locate_plugin.h', lib='KRB5')
- conf.CHECK_HEADERS('gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h com_err.h', lib='KRB5')
+ package="gssapi", uselib_store="krb5")
+ conf.CHECK_HEADERS('krb5.h krb5/locate_plugin.h', lib='krb5')
+ conf.CHECK_HEADERS('gssapi.h gssapi/gssapi_generic.h gssapi/gssapi.h com_err.h', lib='krb5')
if conf.CONFIG_SET('HAVE_KRB5_LOCATE_PLUGIN_H'):
conf.env['WINBIND_KRB5_LOCATOR'] = 'bin/winbind_krb5_locator.so'
@@ -356,10 +357,10 @@ krb5_get_init_creds_opt_free krb5_get_init_creds_opt_get_error
krb5_enctype_to_string krb5_fwd_tgt_creds krb5_auth_con_set_req_cksumtype
krb5_get_creds_opt_alloc krb5_get_creds_opt_set_impersonate krb5_get_creds
krb5_get_credentials_for_user krb5_get_host_realm krb5_free_host_realm''',
- lib='KRB5')
+ lib='krb5')
conf.CHECK_DECLS('''krb5_get_credentials_for_user
krb5_auth_con_set_req_cksumtype''',
headers='krb5.h', always=True)
conf.SAMBA_CONFIG_H('include/config.h')
-#define static_init_idmap { idmap_tdb_init(); idmap_passdb_init(); idmap_nss_init();}
+
diff --git a/source3/wscript_build b/source3/wscript_build
index d4ce660035..5c86f8f943 100644
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -215,8 +215,7 @@ LIBADS_SERVER_SRC = '''libads/kerberos_verify.c libads/authdata.c
../librpc/ndr/ndr_krb5pac.c
../librpc/gen_ndr/ndr_krb5pac.c'''
-SECRETS_SRC = '''passdb/secrets.c passdb/machine_sid.c
- librpc/gen_ndr/ndr_secrets.c'''
+SECRETS_SRC = '''librpc/gen_ndr/ndr_secrets.c'''
LIBNBT_SRC = '''../libcli/nbt/nbtname.c
../libcli/netlogon.c
@@ -432,13 +431,26 @@ PASSDB_GET_SET_SRC = '''passdb/pdb_get_set.c'''
#FIXME: Hack around the missing AC_MODULE
PDB_STATIC = 'passdb/pdb_tdb.c'
+PASSDB_MODULES_SRC = '''passdb/pdb_nds.c passdb/pdb_wbc_sam.c passdb/pdb_ads.c
+passdb/pdb_smbpasswd.c passdb/secrets.c passdb/machine_sid.c
+passdb/pdb_ldap.c'''
+
PASSDB_SRC = '''${PASSDB_GET_SET_SRC} passdb/passdb.c passdb/pdb_interface.c
passdb/util_wellknown.c passdb/util_builtin.c passdb/pdb_compat.c
passdb/util_unixsids.c passdb/lookup_sid.c
passdb/login_cache.c ${PDB_STATIC}
- lib/account_pol.c ${PRIVILEGES_SRC}
+ lib/account_pol.c ${PRIVILEGES_SRC} ${PASSDB_MODULES_SRC}
lib/util_nscd.c lib/winbind_util.c ${SERVER_MUTEX_SRC}'''
+
+
+EXTRA_SRC = '''lib/smbldap.c lib/tldap.c lib/tldap_util.c
+lib/util_tsock.c lib/smbldap_util.c'''
+
+AUTH_SRC1 = '''${AUTH_BUILTIN_SRC} ${AUTH_DOMAIN_SRC} ${AUTH_SAM_SRC}
+${AUTH_SERVER_SRC} ${AUTH_UNIX_SRC} ${AUTH_WINBIND_SRC}
+${AUTH_WBC_SRC} ${AUTH_SCRIPT_SRC} ${AUTH_NETLOGOND_SRC}'''
+
DEVEL_HELP_WEIRD_SRC = '''modules/weird.c'''
CP850_SRC = '''modules/CP850.c'''
CP437_SRC = '''modules/CP437.c'''
@@ -526,7 +538,7 @@ AUTH_WBC_SRC = 'auth/auth_wbc.c'
AUTH_SCRIPT_SRC = 'auth/auth_script.c'
AUTH_NETLOGOND_SRC = 'auth/auth_netlogond.c'
-AUTH_SRC = '''auth/auth.c ${AUTH_STATIC} auth/auth_util.c auth/token_util.c
+AUTH_SRC = '''${AUTH_SRC1} auth/auth.c ${AUTH_STATIC} auth/auth_util.c auth/token_util.c
auth/auth_compat.c auth/auth_ntlmssp.c
${PLAINTEXT_AUTH_SRC} ${SLCACHE_SRC} ${DCUTIL_SRC}'''
@@ -613,16 +625,24 @@ SMBD_SRC_SRV = '''smbd/files.c smbd/chgpasswd.c smbd/connection.c
../libcli/smb/smb2_create_blob.c
${MANGLE_SRC} ${VFS_DEFAULT_SRC}'''
-SMBD_SRC_BASE = '''${PARAM_WITHOUT_REG_SRC} ${SMBD_SRC_SRV} ${LIBSMB_SRC}
- ${RPC_SERVER_SRC} ${RPC_PARSE_SRC}
- ${LOCKING_SRC} ${PASSDB_SRC} ${PRINTING_SRC} ${PROFILE_SRC}
- ${LIB_SRC} ${PRINTBACKEND_SRC} ${OPLOCK_SRC}
- ${NOTIFY_SRC} ${FNAME_UTIL_SRC} ${GROUPDB_SRC} ${AUTH_SRC}
- ${LIBMSRPC_SRC} ${LIBMSRPC_GEN_SRC} ${AVAHI_SRC}
- ${LIBADS_SRC} ${KRBCLIENT_SRC} ${LIBADS_SERVER_SRC}
- ${REG_FULL_SRC} ${POPT_LIB_SRC} ${BUILDOPT_SRC}
- ${SMBLDAP_SRC} ${LDB_SRC} ${LIBNET_SRC}
- ${LIBSMBCONF_SRC}
+SMBD_SRC_BASE = '''${PARAM_WITHOUT_REG_SRC} ${SMBD_SRC_SRV}
+ ${LIBSMB_SRC} ${RPC_SERVER_SRC} ${RPC_PARSE_SRC}
+ ${LOCKING_SRC} ${PASSDB_SRC} ${PRINTING_SRC}
+ ${PROFILE_SRC} ${LIB_SRC} ${PRINTBACKEND_SRC}
+ ${OPLOCK_SRC} ${NOTIFY_SRC} ${FNAME_UTIL_SRC}
+ ${GROUPDB_SRC} ${LIBMSRPC_SRC}
+ ${LIBMSRPC_GEN_SRC} ${AVAHI_SRC} ${LIBADS_SRC}
+ ${KRBCLIENT_SRC} ${LIBADS_SERVER_SRC} ${REG_FULL_SRC}
+ ${POPT_LIB_SRC} ${BUILDOPT_SRC} ${SMBLDAP_SRC}
+ ${LDB_SRC} ${LIBNET_SRC} ${LIBSMBCONF_SRC}
+ ${WBCOMMON_SRC} ${RPC_LSA_SRC}
+ ${RPC_NETLOG_SRC} ${RPC_SAMR_SRC}
+ ${RPC_INITSHUTDOWN_SRC} ${RPC_REG_SRC}
+ ${RPC_DSSETUP_SRC} ${RPC_SVC_SRC} ${RPC_WKS_SRC}
+ ${RPC_SVCCTL_SRC} ${RPC_NTSVCS_SRC} ${RPC_DFS_SRC}
+ ${RPC_SPOOLSS_SRC} ${RPC_EVENTLOG_SRC}
+ ${RPC_ECHO_SRC}
+ ${EXTRA_SRC} ${AUTH_SRC}
${PRIVILEGES_BASIC_SRC}'''
PRINTING_SRC = '''printing/pcap.c printing/print_svid.c printing/print_aix.c
@@ -644,6 +664,15 @@ bld.SAMBA_GENERATOR('build_options',
target='smbd/build_options.c',
rule='${AWK} -f ${SRC[1].abspath(env)} > ${TGT} < ${SRC[0].abspath(env)}')
+t = bld.SAMBA_GENERATOR('build_env.h',
+ source='script/build_env.sh',
+ target='include/build_env.h',
+ rule='${SRC} ${SRCDIR} ${BUILDDIR} ${CC} > ${TGT}')
+# todo: work out what is really wanted here
+t.env.SRCDIR = bld.path.abspath()
+t.env.BUILDDIR = bld.path.abspath()
+
+
bld.SETUP_BUILD_GROUPS()
bld.RECURSE('../lib/replace')
@@ -654,14 +683,17 @@ bld.SAMBA_MKVERSION('include/version.h')
bld.SAMBA_BINARY('smbd/smbd',
source=SMBD_SRC,
- deps='tdb DYNCONFIG',
+ deps='tdb DYNCONFIG tevent popt dl krb5 ldap gssapi gssapi_krb5 NSS_WRAPPER LIBWBCLIENT crypt nsl',
+ includes='lib',
vars=locals())
bld.RECURSE('../lib/socket_wrapper')
bld.RECURSE('../lib/talloc')
bld.RECURSE('../lib/tdb')
bld.RECURSE('../lib/nss_wrapper')
-bld.RECURSE('../lib/uid_wrapper')
+bld.RECURSE('../lib/tevent')
+bld.RECURSE('../lib/popt')
+bld.RECURSE('../nsswitch/libwbclient')
bld.ENFORCE_GROUP_ORDERING()
bld.CHECK_PROJECT_RULES()