svn commit: samba r10374 - in branches/SAMBA_4_0/source: . client gtk lib lib/cmdline lib/socket_wrapper param

jelmer at samba.org jelmer at samba.org
Wed Sep 21 00:38:24 GMT 2005


Author: jelmer
Date: 2005-09-21 00:38:23 +0000 (Wed, 21 Sep 2005)
New Revision: 10374

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10374

Log:
Add HAVE_* defines (on command-line or in config.h file) for scons + 
some other minor updates

Modified:
   branches/SAMBA_4_0/source/SConstruct
   branches/SAMBA_4_0/source/client/SConscript
   branches/SAMBA_4_0/source/gtk/SConscript
   branches/SAMBA_4_0/source/lib/SConscript
   branches/SAMBA_4_0/source/lib/cmdline/SConscript
   branches/SAMBA_4_0/source/lib/socket_wrapper/SConscript
   branches/SAMBA_4_0/source/param/SConscript


Changeset:
Modified: branches/SAMBA_4_0/source/SConstruct
===================================================================
--- branches/SAMBA_4_0/source/SConstruct	2005-09-21 00:27:10 UTC (rev 10373)
+++ branches/SAMBA_4_0/source/SConstruct	2005-09-21 00:38:23 UTC (rev 10374)
@@ -7,10 +7,13 @@
 # Copyright (C) 2005 Jelmer Vernooij <jelmer at samba.org>
 # Published under the GNU GPL
 
+# We don't care about NFS builds...
+
 opts = Options(None, ARGUMENTS)
 opts.AddOptions(
 		BoolOption('developer','enable developer flags', 0),
-		PathOption('prefix','installation prefix','/usr/local/samba')
+		PathOption('prefix','installation prefix','/usr/local/samba'),
+		BoolOption('configh','use config.h file', 0)
 )
 
 hostenv = Environment(
@@ -21,6 +24,8 @@
                 CPPDEFINES={'_SAMBA_BUILD_': None},
 		)
 
+hostenv.SetOption('max_drift', 1)
+
 if hostenv['developer']:
 	hostenv.Append(CCFLAGS='-Wall')
 	hostenv.Append(CCFLAGS='-Wshadow')
@@ -35,8 +40,9 @@
 	hostenv.Append(CCFLAGS='-Wno-format-y2k')
 	hostenv.Append(CCFLAGS='-Wno-declaration-after-statement')
 
+defines = {}
+Export('defines')
 
-
 hostenv.Append(CPPPATH = ['#heimdal_build', '#heimdal/lib/krb5',
 			  '#heimdal/lib/hdb', '#heimdal/lib/gssapi',
 			  '#heimdal/lib/asn1', '#heimdal/lib/des',
@@ -88,7 +94,8 @@
 	['shadow.h','nss.h','nss_common.h','ns_api.h','sys/security.h'] + \
 	['security/pam_appl.h','sys/capability.h','syscall.h','sys/syscall.h'] + \
 	['sys/acl.h']:
-	conf.CheckCHeader(h)
+	if conf.CheckCHeader(h):
+		defines['HAVE_' + h.upper().replace('.','_').replace('/','_')] = 1
 
 for f in ['dlopen','dlsym','dlerror','waitpid','getcwd','strdup'] + \
 	['strndup','strnlen','strerror','chroot','bzero','memset','strlcpy'] + \
@@ -99,7 +106,8 @@
 	['ftruncate','chsize','getpwanam','setlinebuf','srandom','random'] + \
 	['srand','rand','setenv','usleep','syslog','vsyslog','timegm'] + \
 	['backtrace','setbuffer','pread','pwrite']:
-	conf.CheckFunc(f)
+	if conf.CheckFunc(f):
+		defines['HAVE_' + f.upper()] = 1
 
 conf.Finish()
 
@@ -112,9 +120,17 @@
 Export('proto_files')
 
 SConscript(
-		dirs=['param','lib','torture','rpc_server','cldap_server','libcli',
+		dirs=['lib','torture','rpc_server','cldap_server','libcli',
 		'nbt_server','client','ldap_server','libnet','nsswitch','web_server',
 		'smbd','dsdb','heimdal_build','ntptr','kdc','smb_server','ntvfs',
 		'winbind','scripting','auth'])
 
 hostenv.CProtoHeader(target='include/proto.h',source=proto_files)
+
+if hostenv['configh']:
+	def create_config_h(env,target,source):
+		pass #FIXME
+	hostenv.Command('include/config.h',[],create_config_h)
+	hostenv.Append(CPPDEFINES = {HAVE_CONFIG_H: 1})
+else:
+	[hostenv.Append(CPPDEFINES = {p: defines[p]}) for p in defines]

Modified: branches/SAMBA_4_0/source/client/SConscript
===================================================================
--- branches/SAMBA_4_0/source/client/SConscript	2005-09-21 00:27:10 UTC (rev 10373)
+++ branches/SAMBA_4_0/source/client/SConscript	2005-09-21 00:38:23 UTC (rev 10374)
@@ -1,2 +1,2 @@
-Import('hostenv')
-hostenv.Program('smbclient', ['client.c'])
+Import('hostenv popt_common basic talloc param')
+hostenv.Program('smbclient', ['client.c',popt_common,talloc,basic,param])

Modified: branches/SAMBA_4_0/source/gtk/SConscript
===================================================================
--- branches/SAMBA_4_0/source/gtk/SConscript	2005-09-21 00:27:10 UTC (rev 10373)
+++ branches/SAMBA_4_0/source/gtk/SConscript	2005-09-21 00:38:23 UTC (rev 10374)
@@ -3,7 +3,7 @@
 		['common/gtk-smb.c','common/select.c',
 		'common/gtk_events.c','common/credentials.c'])
 
-hostenv.Program('gregedit', [gtksmb,'tools/gregedit.c'])
-hostenv.Program('gepdump', [gtksmb,'tools/gepdump.c'])
-hostenv.Program('gwcrontab', [gtksmb,'tools/gwcrontab.c'])
-hostenv.Program('gwsam', [gtksmb,'tools/gwsam.c','tools/gwsam_user.c'])
+hostenv.Program('gregedit', [gtksmb,'tools/gregedit.c',gtksmb])
+hostenv.Program('gepdump', [gtksmb,'tools/gepdump.c',gtksmb])
+hostenv.Program('gwcrontab', [gtksmb,'tools/gwcrontab.c',gtksmb])
+hostenv.Program('gwsam', [gtksmb,'tools/gwsam.c','tools/gwsam_user.c',gtksmb])

Modified: branches/SAMBA_4_0/source/lib/SConscript
===================================================================
--- branches/SAMBA_4_0/source/lib/SConscript	2005-09-21 00:27:10 UTC (rev 10373)
+++ branches/SAMBA_4_0/source/lib/SConscript	2005-09-21 00:38:23 UTC (rev 10374)
@@ -1,13 +1,16 @@
 Import('hostenv')
 #            tastes like -*- python -*-
 
+SConscript(dirs=['talloc','charset'])
+Import('talloc dynconfig charset')
+
 basic_files = ['version.c', 'xfile.c', 'debug.c', 'fault.c', 
 	 'signal.c', 'system.c', 'time.c', 'genrand.c', 'dprintf.c',
 	 'util_str.c', 'util_strlist.c', 'util_unistr.c', 'util_file.c',
 	 'data_blob.c', 'util.c', 'util_sock.c', 'substitute.c', 
 	 'fsusage.c', 'ms_fnmatch.c', 'select.c', 'mutex.c', 'idtree.c',
-	 'db_wrap.c', 'gendb.c', 'credentials.c']
-basic = hostenv.StaticLibrary('basic', basic_files)
+	 'db_wrap.c']
+basic = hostenv.StaticLibrary('basic', [dynconfig,charset,talloc,basic_files])
 Export('basic')
 
 hostenv.StaticLibrary('netif', ['netif/interface.c', 'netif/netif.c'])
@@ -20,5 +23,14 @@
 hostenv.StaticLibrary('pidfile',['pidfile.c'])
 hostenv.StaticLibrary('unix_privs',['unix_privs.c'])
 
-SConscript(dirs=['replace','tdb','popt','cmdline','talloc','registry','charset', 'ldb','tls','samba3','socket','socket_wrapper','messaging','com','events',
-		   'appweb'])
+SConscript(dirs=['ldb'])
+
+Import('ldb')
+gendb = hostenv.StaticLibrary('gendb', ['gendb.c',ldb])
+Export('gendb')
+
+credentials = hostenv.StaticLibrary('credentials',['credentials.c',basic,gendb])
+Export('credentials')
+
+SConscript(dirs=['../param/','replace','tdb','popt','cmdline','registry', 'tls','samba3','socket','socket_wrapper','messaging','com','events', 'appweb'])
+

Modified: branches/SAMBA_4_0/source/lib/cmdline/SConscript
===================================================================
--- branches/SAMBA_4_0/source/lib/cmdline/SConscript	2005-09-21 00:27:10 UTC (rev 10373)
+++ branches/SAMBA_4_0/source/lib/cmdline/SConscript	2005-09-21 00:38:23 UTC (rev 10374)
@@ -1,6 +1,6 @@
 Import('hostenv')
 #            tastes like -*- python -*-
 
-Import('basic param')
-popt_common = hostenv.StaticLibrary('popt_common',['popt_common.c',basic,param])
+Import('basic param credentials')
+popt_common = hostenv.StaticLibrary('popt_common',['popt_common.c',basic,param,credentials])
 Export('popt_common')

Modified: branches/SAMBA_4_0/source/lib/socket_wrapper/SConscript
===================================================================
--- branches/SAMBA_4_0/source/lib/socket_wrapper/SConscript	2005-09-21 00:27:10 UTC (rev 10373)
+++ branches/SAMBA_4_0/source/lib/socket_wrapper/SConscript	2005-09-21 00:38:23 UTC (rev 10374)
@@ -1,7 +1,14 @@
 Import('hostenv')
-hostenv.StaticLibrary('socket_wrapper',['socket_wrapper.c'])
 
 opts = Options(None, ARGUMENTS)
 opts.AddOptions(
-	BoolOption('socket-wrapper','enable socket wrapper',0)
+	BoolOption('socket_wrapper','enable socket wrapper',0)
 )
+
+opts.Update(hostenv)
+
+if hostenv['socket_wrapper']:
+	hostenv.Append(CPPDEFINES = {'HAVE_SOCKET_WRAPPER': 1})
+	socket_wrapper = hostenv.StaticLibrary('socket_wrapper',['socket_wrapper.c'])
+else:
+	socket_wrapper = []

Modified: branches/SAMBA_4_0/source/param/SConscript
===================================================================
--- branches/SAMBA_4_0/source/param/SConscript	2005-09-21 00:27:10 UTC (rev 10373)
+++ branches/SAMBA_4_0/source/param/SConscript	2005-09-21 00:38:23 UTC (rev 10374)
@@ -1,8 +1,8 @@
 Import('hostenv')
 #            tastes like -*- python -*-
 
-Import('dynconfig')
-param = StaticLibrary('loadparm',['loadparm.c','params.c',dynconfig])
+Import('dynconfig basic')
+param = hostenv.StaticLibrary('loadparm',['loadparm.c','params.c',dynconfig,basic])
 Export('param')
-generic = StaticLibrary('generic',['generic.c'])
+generic = hostenv.StaticLibrary('generic',['generic.c'])
 Export('generic')



More information about the samba-cvs mailing list