Author: tpot
Date: 2005-09-30 07:30:37 +0000 (Fri, 30 Sep 2005)
New Revision: 10646

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

Log:
Hey Jelmer what do you think of this?  The SConscript for the libcli 
directory now looks like the config.mk file but with different 
punctuation.  

The only weird bit is that it creates a proto.h file for each subsystem.

Modified:
   branches/SAMBA_4_0/source/SConstruct
   branches/SAMBA_4_0/source/libcli/SConscript


Changeset:
Modified: branches/SAMBA_4_0/source/SConstruct
===================================================================
--- branches/SAMBA_4_0/source/SConstruct        2005-09-30 06:45:34 UTC (rev 
10645)
+++ branches/SAMBA_4_0/source/SConstruct        2005-09-30 07:30:37 UTC (rev 
10646)
@@ -5,6 +5,8 @@
 # eventually replace this system.
 #
 # Copyright (C) 2005 Jelmer Vernooij <[EMAIL PROTECTED]>
+# Copyright (C) 2005 Tim Potter <[EMAIL PROTECTED]>
+#
 # Published under the GNU GPL
 #
 # TODO:
@@ -22,7 +24,34 @@
                BoolOption('configure','run configure checks', False),
 )
 
-hostenv = Environment(
+class SambaEnvironment(Environment):
+    def Subsystem(self, target, source, **kwargs):
+        """Create a Samba subsystem, basically a static library.
+
+       By default a prototype file for the subsystem is created,
+       unless the keyword argument 'noproto' is present.  A variable
+       corresponding to the target name is exported, unless the
+       keyword argument 'noexport' is present."""
+
+       # Generate prototype file for subsystem
+
+       if not kwargs.has_key('noproto'):
+           self.proto_headers += self.CProtoHeader(
+               '%s_proto.h' % target, [str(x) for x in source])
+
+       # Maketh the library
+
+       result = self.Library(target, source, **kwargs)
+
+       # Export library symbol
+
+       if not kwargs.has_key('noexport'):
+           locals()[target] = result   # Eww
+           Export(target)
+
+       return result
+
+hostenv = SambaEnvironment(
                toolpath=['build/scons','.'],
                tools=['default','pidl','proto','et','asn1','samba'],
                options=opts,

Modified: branches/SAMBA_4_0/source/libcli/SConscript
===================================================================
--- branches/SAMBA_4_0/source/libcli/SConscript 2005-09-30 06:45:34 UTC (rev 
10645)
+++ branches/SAMBA_4_0/source/libcli/SConscript 2005-09-30 07:30:37 UTC (rev 
10646)
@@ -1,70 +1,119 @@
 Import('hostenv')
-proto_files = []
-cli_utils_files = ['util/asn1.c', 
'util/doserr.c','util/errormap.c','util/clierror.c', 
'util/nterr.c','util/smbdes.c']
-proto_files += cli_utils_files
-hostenv.Library('cli_utils', cli_utils_files)
 
-hostenv.Library('cli_lsa', ['util/clilsa.c'])
-hostenv.Library('cli_composite_base', ['composite/composite.c'])
+hostenv.Subsystem(
+    'cli_utils',
+    ['util/asn1.c',
+     'util/doserr.c',
+     'util/errormap.c',
+     'util/clierror.c',
+     'util/nterr.c',
+     'util/smbdes.c'])
 
-cli_composite_files = 
['smb_composite/loadfile.c','smb_composite/savefile.c','smb_composite/connect.c',
-        
'smb_composite/sesssetup.c','smb_composite/fetchfile.c','smb_composite/appendacl.c',
-        'smb_composite/fsinfo.c']
+hostenv.Subsystem(
+    'cli_lsa',
+    ['util/clilsa.c'])
 
-hostenv.Library('cli_composite', cli_composite_files)
-proto_files += ['util/clilsa.c', 'composite/composite.c'] + cli_composite_files
+hostenv.Subsystem(
+    'cli_composite_base',
+    ['composite/composite.c'])
 
-cli_nbt_files = 
['nbt/nbtname.c','nbt/nbtsocket.c','nbt/namequery.c','nbt/nameregister.c',
-       'nbt/namerefresh.c','nbt/namerelease.c']
+hostenv.Subsystem(
+    'cli_composite',
+    ['smb_composite/loadfile.c',
+     'smb_composite/savefile.c',
+     'smb_composite/connect.c',
+     'smb_composite/sesssetup.c',
+     'smb_composite/fetchfile.c',
+     'smb_composite/appendacl.c',
+     'smb_composite/fsinfo.c'])
 
-hostenv.Library('cli_nbt', cli_nbt_files)
-proto_files += cli_nbt_files
+hostenv.Subsystem(
+    'cli_nbt',
+    ['nbt/nbtname.c',
+     'nbt/nbtsocket.c',
+     'nbt/namequery.c',
+     'nbt/nameregister.c',
+     'nbt/namerefresh.c',
+     'nbt/namerelease.c'])
 
-hostenv.Library('cli_dgram',
-       [ 'dgram/dgramsocket.c','dgram/mailslot.c','dgram/netlogon.c',
-        'dgram/ntlogon.c','dgram/browse.c'])
+hostenv.Subsystem(
+    'cli_dgram',
+    ['dgram/dgramsocket.c',
+     'dgram/mailslot.c',
+     'dgram/netlogon.c',
+     'dgram/ntlogon.c',
+     'dgram/browse.c'])
 
-hostenv.Library('cli_cldap', ['cldap/cldap.c'])
-hostenv.Library('cli_wrepl', ['wrepl/winsrepl.c'])
+hostenv.Subsystem(
+    'cli_cldap',
+    ['cldap/cldap.c'])
 
-cli_resolve_files = 
['resolve/resolve.c','resolve/nbtlist.c','resolve/bcast.c','resolve/wins.c',
-       'resolve/host.c']
+hostenv.Subsystem(
+    'cli_wrepl',
+    ['wrepl/winsrepl.c'])
 
-hostenv.Library('cli_resolve', cli_resolve_files)
-proto_files += cli_resolve_files
+hostenv.Subsystem(
+    'cli_resolve',
+    ['resolve/resolve.c',
+     'resolve/nbtlist.c',
+     'resolve/bcast.c',
+     'resolve/wins.c',
+     'resolve/host.c'])
 
-smb_files = ['clireadwrite.c', 
'cliconnect.c','clifile.c','clilist.c','clitrans2.c',
-               'climessage.c','clideltree.c']
+hostenv.Subsystem(
+    'smb',
+    ['clireadwrite.c',
+     'cliconnect.c',
+     'clifile.c',
+     'clilist.c',
+     'clitrans2.c',
+     'climessage.c',
+     'clideltree.c'])
+    
+hostenv.Subsystem(
+    'cli_raw',
+    ['raw/rawfile.c',
+     'raw/smb_signing.c',
+     'raw/clisocket.c',
+     'raw/clitransport.c',
+     'raw/clisession.c',
+     'raw/clitree.c',
+     'raw/rawrequest.c',
+     'raw/rawreadwrite.c',
+     'raw/rawsearch.c',
+     'raw/rawsetfileinfo.c',
+     'raw/raweas.c',
+     'raw/rawtrans.c',
+     'raw/clioplock.c',
+     'raw/rawnegotiate.c',
+     'raw/rawfsinfo.c',
+     'raw/rawfileinfo.c',
+     'raw/rawnotify.c',
+     'raw/rawioctl.c',
+     'raw/rawacl.c',
+     'raw/rawdate.c',
+     'raw/rawlpq.c'])
 
-hostenv.Library('smb', smb_files)
-proto_files += smb_files
+hostenv.Subsystem(
+    'cli_security',
+    ['security/security_token.c',
+     'security/security_descriptor.c',
+     'security/dom_sid.c',
+     'security/access_check.c',
+     'security/privilege.c',
+     '../librpc/ndr/ndr_sec_helper.c'])
 
-cli_raw_files = ['raw/rawfile.c','raw/smb_signing.c','raw/clisocket.c',
-               'raw/clitransport.c','raw/clisession.c','raw/clitree.c',
-               'raw/rawrequest.c','raw/rawreadwrite.c','raw/rawsearch.c',
-               'raw/rawsetfileinfo.c','raw/raweas.c','raw/rawtrans.c',
-               'raw/clioplock.c','raw/rawnegotiate.c','raw/rawfsinfo.c',
-               'raw/rawfileinfo.c','raw/rawnotify.c','raw/rawioctl.c',
-               'raw/rawacl.c','raw/rawdate.c','raw/rawlpq.c']
+hostenv.Subsystem(
+    'cli_auth',
+    ['auth/credentials.c',
+     'auth/session.c',
+     'auth/smbencrypt.c'])
 
-hostenv.Library('cli_raw', cli_raw_files)
-proto_files += cli_raw_files
-
-security_files = ['security/security_token.c','security/security_descriptor.c',
-                          'security/dom_sid.c', 'security/access_check.c',
-                          'security/privilege.c', 
'../librpc/ndr/ndr_sec_helper.c']
-proto_files += security_files
-hostenv.Library('cli_security', security_files)
-
-auth_files = ['auth/credentials.c','auth/session.c','auth/smbencrypt.c']
-proto_files += auth_files
-hostenv.Library('cli_auth',auth_files)
-
-ldap_files = ['ldap/ldap.c','ldap/ldap_client.c','ldap/ldap_bind.c',
-                  'ldap/ldap_msg.c','ldap/ldap_ndr.c','ldap/ldap_ildap.c']
-proto_files += ldap_files
-cli_ldap = hostenv.Library('cli_ldap',ldap_files)
-
-Export('cli_ldap')
-
-hostenv.proto_headers += hostenv.CProtoHeader('proto.h', proto_files)
+hostenv.Subsystem(
+    'cli_ldap',
+    ['ldap/ldap.c',
+     'ldap/ldap_client.c',
+     'ldap/ldap_bind.c',
+     'ldap/ldap_msg.c',
+     'ldap/ldap_ndr.c',
+     'ldap/ldap_ildap.c'])

Reply via email to