summaryrefslogtreecommitdiff
path: root/source4/SConstruct
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2005-09-21 05:39:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:33 -0500
commitd191c7d9932b8e8ad96c4345a6ceca67326806ac (patch)
tree4849f856d446b363a64ab0e5900ac03db244e109 /source4/SConstruct
parent60cb7a42aa5a1cef0e65dee0a8efbde9341dcaf9 (diff)
downloadsamba-d191c7d9932b8e8ad96c4345a6ceca67326806ac.tar.gz
samba-d191c7d9932b8e8ad96c4345a6ceca67326806ac.tar.bz2
samba-d191c7d9932b8e8ad96c4345a6ceca67326806ac.zip
r10377: Save configuration stuff to sconf.cache so it isn't annoyingly run
at every single build. Run 'scons configure=1' or delete sconf.cache to force checks to be re-run. Jelmer, I think this stuff is cached in the .sconf_cache directory but the message is still displayed and it looks like it caches the compiled test object file not the actual result of the test. (This used to be commit 9d001dc083937bbf5642af90bc8a8b1a27825de0)
Diffstat (limited to 'source4/SConstruct')
-rw-r--r--source4/SConstruct93
1 files changed, 61 insertions, 32 deletions
diff --git a/source4/SConstruct b/source4/SConstruct
index 9a219bf036..58f2640d09 100644
--- a/source4/SConstruct
+++ b/source4/SConstruct
@@ -7,13 +7,16 @@
# Copyright (C) 2005 Jelmer Vernooij <jelmer@samba.org>
# Published under the GNU GPL
+import cPickle
+
# 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'),
- BoolOption('configh','use config.h file', 0)
+ BoolOption('configh','use config.h file', 0),
+ BoolOption('configure','run configure checks', False),
)
hostenv = Environment(
@@ -40,7 +43,25 @@ if hostenv['developer']:
hostenv.Append(CCFLAGS='-Wno-format-y2k')
hostenv.Append(CCFLAGS='-Wno-declaration-after-statement')
-defines = {}
+# Store configuration data in a dictionary.
+
+def saveconfig(data):
+ """Save configuration dict to a file."""
+ cached = cPickle.dump(data, open('sconf.cache', 'w'))
+
+def loadconfig():
+ """Load configuration dict from a file."""
+ try:
+ return cPickle.load(open('sconf.cache', 'r'))
+ except IOError:
+ return None
+
+defines = loadconfig()
+
+if defines == None:
+ hostenv['configure'] = 1
+ defines = {}
+
Export('defines')
hostenv.Append(CPPPATH = ['#heimdal_build', '#heimdal/lib/krb5',
@@ -80,36 +101,39 @@ paths = {
Export('paths')
-conf = hostenv.Configure()
-for h in ['sys/select.h','fcntl.h','sys/fcntl.h','sys/time.h'] + \
- ['utime.h','grp.h','sys/id.h','limits.h','memory.h'] + \
- ['compat.h','math.h','sys/param.h','ctype.h','sys/wait.h'] + \
- ['sys/resource.h','sys/ioctl.h','sys/ipc.h','sys/mode.h'] + \
- ['sys/mman.h','sys/filio.h','sys/priv.h','sys/shm.h','string.h'] + \
- ['strings.h','stdlib.h','sys/vfs.h','sys/fs/s5param.h','sys/filsys.h'] + \
- ['termios.h','termio.h','fnmatch.h','pwd.h','sys/termio.h'] + \
- ['sys/time.h','sys/statfs.h','sys/statvfs.h','stdarg.h'] + \
- ['security/pam_modules.h','security/_pam_macros.h','dlfcn.h'] + \
- ['sys/syslog.h','syslog.h','stdint.h','inttypes.h','locale.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']:
- 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'] + \
- ['strlcat','memmove','vsnprintf','snprintf','asprintf','vasprintf'] + \
- ['setsid','pipe','crypt16','getauthuid','strftime','sigprocmask'] + \
- ['sigblock','sigaction','innetgr','setnetgrent','getnetgrent'] + \
- ['endnetgrent','initgroups','setgroups','sysconf','mktime','rename'] + \
- ['ftruncate','chsize','getpwanam','setlinebuf','srandom','random'] + \
- ['srand','rand','setenv','usleep','syslog','vsyslog','timegm'] + \
- ['backtrace','setbuffer','pread','pwrite']:
- if conf.CheckFunc(f):
- defines['HAVE_' + f.upper()] = 1
-
-conf.Finish()
+if hostenv['configure']:
+
+ conf = hostenv.Configure()
+
+ for h in ['sys/select.h','fcntl.h','sys/fcntl.h','sys/time.h'] + \
+ ['utime.h','grp.h','sys/id.h','limits.h','memory.h'] + \
+ ['compat.h','math.h','sys/param.h','ctype.h','sys/wait.h'] + \
+ ['sys/resource.h','sys/ioctl.h','sys/ipc.h','sys/mode.h'] + \
+ ['sys/mman.h','sys/filio.h','sys/priv.h','sys/shm.h','string.h'] + \
+ ['strings.h','stdlib.h','sys/vfs.h','sys/fs/s5param.h','sys/filsys.h'] + \
+ ['termios.h','termio.h','fnmatch.h','pwd.h','sys/termio.h'] + \
+ ['sys/time.h','sys/statfs.h','sys/statvfs.h','stdarg.h'] + \
+ ['security/pam_modules.h','security/_pam_macros.h','dlfcn.h'] + \
+ ['sys/syslog.h','syslog.h','stdint.h','inttypes.h','locale.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']:
+ 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'] + \
+ ['strlcat','memmove','vsnprintf','snprintf','asprintf','vasprintf'] + \
+ ['setsid','pipe','crypt16','getauthuid','strftime','sigprocmask'] + \
+ ['sigblock','sigaction','innetgr','setnetgrent','getnetgrent'] + \
+ ['endnetgrent','initgroups','setgroups','sysconf','mktime','rename'] + \
+ ['ftruncate','chsize','getpwanam','setlinebuf','srandom','random'] + \
+ ['srand','rand','setenv','usleep','syslog','vsyslog','timegm'] + \
+ ['backtrace','setbuffer','pread','pwrite']:
+ if conf.CheckFunc(f):
+ defines['HAVE_' + f.upper()] = 1
+
+ conf.Finish()
[dynenv.Append(CPPDEFINES = {p: '\\"%s\\"' % paths[p]}) for p in paths]
@@ -127,6 +151,11 @@ SConscript(
hostenv.CProtoHeader(target='include/proto.h',source=proto_files)
+# Save configuration
+
+if hostenv['configure']:
+ saveconfig(defines)
+
if hostenv['configh']:
def create_config_h(env,target,source):
pass #FIXME