1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

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)
This commit is contained in:
Tim Potter 2005-09-21 05:39:18 +00:00 committed by Gerald (Jerry) Carter
parent 60cb7a42aa
commit d191c7d993
7 changed files with 90 additions and 52 deletions

View File

@ -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
if hostenv['configure']:
conf = hostenv.Configure()
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
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
conf.Finish()
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

View File

@ -7,9 +7,10 @@ hostenv.StaticLibrary('auth_domain.c')
hostenv.StaticLibrary('auth_developer.c')
hostenv.StaticLibrary('auth_unix.c')
conf = hostenv.Configure()
have_pam = conf.CheckLibWithHeader('pam', 'security/pam_appl.h', 'c', 'pam_start')
conf.Finish()
if hostenv['configure']:
conf = hostenv.Configure()
have_pam = conf.CheckLibWithHeader('pam', 'security/pam_appl.h', 'c', 'pam_start')
conf.Finish()
hostenv.StaticLibrary('pam_errors.c')
hostenv.StaticLibrary('auth',['auth.c','auth_util.c','auth_sam_reply.c','ntlm_check.c'])

View File

@ -1,5 +1,6 @@
Import('hostenv')
Import('talloc')
Import('defines')
hostenv.StaticLibrary('modules/timestamps.c')
hostenv.StaticLibrary('modules/rdn_name.c')
@ -7,12 +8,14 @@ hostenv.StaticLibrary('modules/schema.c')
hostenv.StaticLibrary('ldb_ildap/ldb_ildap.c')
hostenv.StaticLibrary('modules/ldb_map.c')
conf = Configure(hostenv)
have_sqlite3 = conf.CheckLibWithHeader("sqlite3","sqlite3.h",'c',"sqlite3_open()")
have_popt = conf.CheckLibWithHeader("popt","popt.h",'c',"poptGetArgs(NULL);")
conf.Finish()
if hostenv['configure']:
conf = Configure(hostenv)
if conf.CheckLibWithHeader("sqlite3","sqlite3.h",'c',"sqlite3_open()"):
defines['HAVE_SQLITE3'] = 1
conf.CheckLibWithHeader("popt","popt.h",'c',"poptGetArgs(NULL);")
conf.Finish()
if have_sqlite3:
if defines.has_key('HAVE_SQLITE3'):
hostenv.StaticLibrary('ldb_sqlite3/ldb_sqlite3.c')
hostenv.StaticLibrary('ldb_tdb',

View File

@ -1,9 +1,11 @@
Import('hostenv')
# tastes like -*- python -*-
Import('hostenv')
conf = hostenv.Configure()
conf.env['HAVE_EXTERNAL_POPT'] = conf.CheckLibWithHeader('popt', 'popt.h', 'c', 'poptGetArgs(NULL);')
conf.Finish()
if hostenv['configure']:
conf = hostenv.Configure()
conf.env['HAVE_EXTERNAL_POPT'] = conf.CheckLibWithHeader('popt', 'popt.h', 'c', 'poptGetArgs(NULL);')
conf.Finish()
popt = hostenv.StaticLibrary('popt', ['findme.c','popt.c','poptconfig.c','popthelp.c','poptparse.c'])
Export('popt')

View File

@ -1,11 +1,12 @@
Import('hostenv')
conf = Configure(hostenv)
#FIXME: conf.CheckBrokenInetNtoa()
for f in ['strtoull','__strtoull','strtouq','strtoll','__strtoll','strtoq',
'seteuid','setresuid','setegid','setresgid']:
conf.CheckFunc(f,'c')
conf.Finish()
if hostenv['configure']:
conf = Configure(hostenv)
#FIXME: conf.CheckBrokenInetNtoa()
for f in ['strtoull','__strtoull','strtouq','strtoll','__strtoll','strtoq',
'seteuid','setresuid','setegid','setresgid']:
conf.CheckFunc(f,'c')
conf.Finish()
hostenv.StaticLibrary('repdir', ['repdir/repdir.c'])
hostenv.StaticLibrary('replace', ['replace.c', 'snprintf.c'])

View File

@ -1,6 +1,7 @@
Import('hostenv')
hostenv.StaticLibrary('tls', ['tls.c', 'tlscert.c'])
conf = hostenv.Configure()
conf.CheckLibWithHeader('gnutls', 'gnutls/gnutls.h', 'c', 'gnutls_global_init()')
conf.Finish()
if hostenv['configure']:
conf = hostenv.Configure()
conf.CheckLibWithHeader('gnutls', 'gnutls/gnutls.h', 'c', 'gnutls_global_init()')
conf.Finish()

View File

@ -12,7 +12,7 @@ hostenv.StaticLibrary('rpc_base',
'rpc/dcerpc_sock.c'])
'''
[SUBSYSTEM::NDR_AUDIOSRV]
INIT_FUNCTION = dcerpc_audiosrv_init
INIT_OBJ_FILES = librpc/gen_ndr/ndr_audiosrv.o
@ -631,3 +631,4 @@ REQUIRED_SUBSYSTEMS = RPC_EJS_ECHO RPC_EJS_MISC RPC_EJS_SAMR RPC_EJS_SECURITY \
RPC_EJS_INITSHUTDOWN
# End SUBSYSTEM RPC_EJS
################################################
'''