build: cope with multiple libs in CHECK_FUNCS_IN()
authorAndrew Tridgell <tridge@samba.org>
Sat, 20 Mar 2010 06:17:56 +0000 (17:17 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:26:56 +0000 (20:26 +1000)
buildtools/wafsamba/samba_autoconf.py
lib/replace/wscript

index 028f5f269afb1f68858cde392cad46ffbdd0b4ec..6ad188b760928891eab40e74dc2fa503782e5df2 100644 (file)
@@ -299,21 +299,21 @@ def CHECK_FUNCS_IN(conf, list, library, mandatory=False, checklibc=False):
             SET_TARGET_TYPE(conf, library, 'EMPTY')
         return True
 
             SET_TARGET_TYPE(conf, library, '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
-
-    conf.define('HAVE_LIB%s' % string.replace(library.upper(),'-','_'), 1)
+    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')
+            return False
+        conf.define('HAVE_LIB%s' % string.replace(lib.upper(),'-','_'), 1)
+        conf.env['LIB_' + lib.upper()] = lib
+        LOCAL_CACHE_SET(conf, 'TARGET_TYPE', lib, 'SYSLIB')
 
     ret = True
     for f in remaining:
         if not conf.check(function_name=f, lib=library, header_name=conf.env.hlist):
             ret = False
 
     ret = True
     for f in remaining:
         if not conf.check(function_name=f, lib=library, header_name=conf.env.hlist):
             ret = False
-    conf.env['LIB_' + library.upper()] = library
-    LOCAL_CACHE_SET(conf, 'TARGET_TYPE', library, 'SYSLIB')
     return ret
 
 
     return ret
 
 
index 036df593525c3562ef8fa8cd27b0eabdb359638f..560a6990603f05e5e43076c2a5e0e10d611ce9ea 100644 (file)
@@ -189,7 +189,6 @@ def configure(conf):
     conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull')
     conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq memmem printf memset memcpy')
     conf.CHECK_FUNCS('connect gethostbyname if_nametoindex socketpair')
     conf.CHECK_FUNCS('asprintf vasprintf setenv unsetenv strnlen strtoull __strtoull')
     conf.CHECK_FUNCS('strtouq strtoll __strtoll strtoq memmem printf memset memcpy')
     conf.CHECK_FUNCS('connect gethostbyname if_nametoindex socketpair')
-    conf.CHECK_FUNCS('inet_ntoa inet_aton inet_ntop inet_pton')
     conf.CHECK_FUNCS('dirfd getdirentries getdents syslog getaddrinfo freeaddrinfo')
     conf.CHECK_FUNCS('gai_strerror get_current_dir_name')
     conf.CHECK_FUNCS('timegm getifaddrs freeifaddrs mmap setgroups setsid')
     conf.CHECK_FUNCS('dirfd getdirentries getdents syslog getaddrinfo freeaddrinfo')
     conf.CHECK_FUNCS('gai_strerror get_current_dir_name')
     conf.CHECK_FUNCS('timegm getifaddrs freeifaddrs mmap setgroups setsid')
@@ -197,6 +196,8 @@ def configure(conf):
     conf.CHECK_FUNCS('getpwent_r getpwnam_r getpwuid_r epoll_create')
 
 
     conf.CHECK_FUNCS('getpwent_r getpwnam_r getpwuid_r epoll_create')
 
 
+    conf.CHECK_FUNCS_IN('inet_ntoa inet_aton inet_ntop inet_pton', 'socket nsl')
+
     conf.CHECK_FUNCS_IN('dlopen dlsym dlerror dlclose', 'dl', checklibc=True)
     conf.CHECK_FUNCS_IN('poptGetContext', 'popt')
     conf.CHECK_FUNCS_IN('res_search', 'resolv', checklibc=True)
     conf.CHECK_FUNCS_IN('dlopen dlsym dlerror dlclose', 'dl', checklibc=True)
     conf.CHECK_FUNCS_IN('poptGetContext', 'popt')
     conf.CHECK_FUNCS_IN('res_search', 'resolv', checklibc=True)