summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-20 18:36:33 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:26:57 +1000
commitf2f8fc440e24cf92213b33f1f913ec9beda8d46e (patch)
tree5deee9dcda5178d44c25a768125c30f7a4b3b32d /buildtools
parentd148461101f4709d8e1a8b9eb64535e0bd15d874 (diff)
downloadsamba-f2f8fc440e24cf92213b33f1f913ec9beda8d46e.tar.gz
samba-f2f8fc440e24cf92213b33f1f913ec9beda8d46e.tar.bz2
samba-f2f8fc440e24cf92213b33f1f913ec9beda8d46e.zip
build: more careful library list handling
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_autoconf.py43
1 files changed, 29 insertions, 14 deletions
diff --git a/buildtools/wafsamba/samba_autoconf.py b/buildtools/wafsamba/samba_autoconf.py
index 3959644217..8589906dcb 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -288,41 +288,56 @@ Build.BuildContext.CONFIG_SET = CONFIG_SET
# optionally check for the functions first in libc
@conf
def CHECK_FUNCS_IN(conf, list, library, mandatory=False, checklibc=False):
- # first see if the functions are in libc
+ remaining = TO_LIST(list)
+ liblist = TO_LIST(library)
+
+ # check if some already found
+ for f in remaining[:]:
+ if CONFIG_SET(conf, 'HAVE_%s' % f.upper()):
+ remaining.remove(f)
+
+ # see if the functions are in libc
if checklibc:
- remaining = []
- for f in TO_LIST(list):
- if not CHECK_FUNC(conf, f):
- remaining.append(f)
- else:
- remaining = TO_LIST(list)
+ for f in remaining[:]:
+ if CHECK_FUNC(conf, f):
+ remaining.remove(f)
if remaining == []:
- for lib in TO_LIST(library):
+ for lib in liblist:
if GET_TARGET_TYPE(conf, lib) != 'SYSLIB':
SET_TARGET_TYPE(conf, lib, 'EMPTY')
return True
ret = True
- for lib in TO_LIST(library):
+ for lib in liblist[:]:
+ if GET_TARGET_TYPE(conf, lib):
+ continue
if not conf.check(lib=lib, uselib_store=lib):
conf.ASSERT(not mandatory,
- "Mandatory library '%s' not found for functions '%s'" % (library, list))
+ "Mandatory library '%s' not found for functions '%s'" % (lib, list))
# if it isn't a mandatory library, then remove it from dependency lists
- SET_TARGET_TYPE(conf, library, 'EMPTY')
+ SET_TARGET_TYPE(conf, lib, 'EMPTY')
ret = False
else:
conf.define('HAVE_LIB%s' % string.replace(lib.upper(),'-','_'), 1)
- conf.env['LIB_' + lib.upper()] = lib
- LOCAL_CACHE_SET(conf, 'TARGET_TYPE', lib, 'SYSLIB')
if not ret:
return ret
ret = True
for f in remaining:
- if not conf.check(function_name=f, lib=TO_LIST(library), header_name=conf.env.hlist):
+ if not conf.check(function_name=f, lib=liblist, header_name=conf.env.hlist):
ret = False
+
+ if not ret:
+ return ret
+
+ for lib in liblist:
+ if GET_TARGET_TYPE(conf, lib):
+ continue
+ conf.env['LIB_' + lib.upper()] = lib
+ LOCAL_CACHE_SET(conf, 'TARGET_TYPE', lib, 'SYSLIB')
+
return ret