r10374: Add HAVE_* defines (on command-line or in config.h file) for scons +
authorJelmer Vernooij <jelmer@samba.org>
Wed, 21 Sep 2005 00:38:23 +0000 (00:38 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:38:33 +0000 (13:38 -0500)
some other minor updates
(This used to be commit f142c15de1afb2f13a5e23ceb40ce70f0115c8bf)

source4/SConstruct
source4/client/SConscript
source4/gtk/SConscript
source4/lib/SConscript
source4/lib/cmdline/SConscript
source4/lib/socket_wrapper/SConscript
source4/param/SConscript

index a5d02038eb35a0b2546b05c27610d589b1dffca3..1d1a945d73e5a71fcdf4c0658a5fabdb68e815c5 100644 (file)
@@ -7,10 +7,13 @@
 # Copyright (C) 2005 Jelmer Vernooij <jelmer@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 @@ hostenv = Environment(
                 CPPDEFINES={'_SAMBA_BUILD_': None},
                )
 
+hostenv.SetOption('max_drift', 1)
+
 if hostenv['developer']:
        hostenv.Append(CCFLAGS='-Wall')
        hostenv.Append(CCFLAGS='-Wshadow')
@@ -35,7 +40,8 @@ if hostenv['developer']:
        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',
@@ -88,7 +94,8 @@ for h in ['sys/select.h','fcntl.h','sys/fcntl.h','sys/time.h'] + \
        ['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 @@ for f in ['dlopen','dlsym','dlerror','waitpid','getcwd','strdup'] + \
        ['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 @@ proto_files = []
 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]
index 40b81e23c85954bcee6b8cf074a8dc856bfaf4a4..4ba6deedc5de128a09fadc2045b9b5a3ed47bcb6 100644 (file)
@@ -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])
index 97caf4db56e6f9b69f749ff9e42626b1810875ca..4c45991c860c0e6c7cd52cfff0489eebc8a61583 100644 (file)
@@ -3,7 +3,7 @@ gtksmb = hostenv.StaticLibrary('gtksmb',
                ['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])
index 9c5631082907be70611a1cc01d100a2dea40a5ec..387f557932550316dc530fa87b0e6180f21c55d5 100644 (file)
@@ -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('gencache',['gencache.c'])
 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'])
+
index a99a2b48929950db0e2bbf8442e4ea150a38bdfd..12f4f7c11c4e8fb1911bf59a6aed4b51f28d6ac6 100644 (file)
@@ -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')
index ac9e0466b2f9270059eb8463119a161c9246cb9b..1c0253a0d4eb9905fe00f2a8e576fc0b4a046d06 100644 (file)
@@ -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 = []
index a959351e906a123d1f7793f4df120e4d8c28ac01..4dfca40d4a5c6aefbfce181c23ee3dc602fef6ff 100644 (file)
@@ -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')