build: lib needs to take a list when more than 1
[nivanova/samba-autobuild/.git] / buildtools / wafsamba / samba_autoconf.py
index 4d6ac26a6cca86d7bed0e5f00f40d12414566a7d..0b2686003344f6921984c7100637bb13c4fedd77 100644 (file)
@@ -295,24 +295,31 @@ def CHECK_FUNCS_IN(conf, list, library, mandatory=False, checklibc=False):
         remaining = TO_LIST(list)
 
     if remaining == []:
-        SET_TARGET_TYPE(conf, library, 'EMPTY')
+        for lib in TO_LIST(library):
+            if GET_TARGET_TYPE(conf, lib) != 'SYSLIB':
+                SET_TARGET_TYPE(conf, lib, 'EMPTY')
         return True
 
-    if not conf.check(lib=library, uselib_store=library):
-        conf.ASSERT(not mandatory,
-                    "Mandatory library '%s' not found for functions '%s'" % (library, list))
-        # if it isn't a mandatory library, then remove it from dependency lists
-        SET_TARGET_TYPE(conf, library, 'EMPTY')
-        return False
+    ret = True
+    for lib in TO_LIST(library):
+        if not conf.check(lib=lib, uselib_store=lib):
+            conf.ASSERT(not mandatory,
+                        "Mandatory library '%s' not found for functions '%s'" % (library, list))
+            # if it isn't a mandatory library, then remove it from dependency lists
+            SET_TARGET_TYPE(conf, library, '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')
 
-    conf.define('HAVE_LIB%s' % string.replace(library.upper(),'-','_'), 1)
+    if not ret:
+        return ret
 
     ret = True
     for f in remaining:
-        if not conf.check(function_name=f, lib=library, header_name=conf.env.hlist):
+        if not conf.check(function_name=f, lib=TO_LIST(library), header_name=conf.env.hlist):
             ret = False
-    conf.env['LIB_' + library.upper()] = library
-    LOCAL_CACHE_SET(conf, 'TARGET_TYPE', library, 'SYSLIB')
     return ret