build: fixed popt subsystem on systems without popt
authorAndrew Tridgell <tridge@samba.org>
Sun, 28 Mar 2010 07:33:25 +0000 (18:33 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:27:13 +0000 (20:27 +1000)
buildtools/wafsamba/samba_autoconf.py
buildtools/wafsamba/samba_bundled.py

index ff2fa012c44e24b98d5a2b07f8943b367d4feb1a..b98d9645a2de5d59fb8ef50613e514d0e420aeb3 100644 (file)
@@ -387,7 +387,7 @@ def library_flags(conf, libs):
 
 
 @conf
-def CHECK_LIB(conf, libs, mandatory=False):
+def CHECK_LIB(conf, libs, mandatory=False, empty_decl=True):
     '''check if a set of libraries exist'''
 
     liblist  = TO_LIST(libs)
@@ -402,8 +402,9 @@ def CHECK_LIB(conf, libs, mandatory=False):
             if mandatory:
                 print("Mandatory library '%s' not found for functions '%s'" % (lib, list))
                 sys.exit(1)
-            # if it isn't a mandatory library, then remove it from dependency lists
-            SET_TARGET_TYPE(conf, lib, 'EMPTY')
+            if empty_decl:
+                # if it isn't a mandatory library, then remove it from dependency lists
+                SET_TARGET_TYPE(conf, lib, 'EMPTY')
             ret = False
         else:
             conf.define('HAVE_LIB%s' % lib.upper().replace('-','_'), 1)
@@ -426,7 +427,8 @@ def CHECK_LIB(conf, libs, mandatory=False):
 #
 # optionally check for the functions first in libc
 @conf
-def CHECK_FUNCS_IN(conf, list, library, mandatory=False, checklibc=False, headers=None, link=None):
+def CHECK_FUNCS_IN(conf, list, library, mandatory=False, checklibc=False,
+                   headers=None, link=None, empty_decl=True):
     remaining = TO_LIST(list)
     liblist   = TO_LIST(library)
 
@@ -443,11 +445,11 @@ def CHECK_FUNCS_IN(conf, list, library, mandatory=False, checklibc=False, header
 
     if remaining == []:
         for lib in liblist:
-            if GET_TARGET_TYPE(conf, lib) != 'SYSLIB':
+            if GET_TARGET_TYPE(conf, lib) != 'SYSLIB' and empty_decl:
                 SET_TARGET_TYPE(conf, lib, 'EMPTY')
         return True
 
-    conf.CHECK_LIB(liblist)
+    conf.CHECK_LIB(liblist, empty_decl=empty_decl)
     for lib in liblist[:]:
         if not GET_TARGET_TYPE(conf, lib) == 'SYSLIB':
             if mandatory:
index 6e3753a7908e1161383e3301b4983018b456022d..a494907af0316cc96c112e84a45c5f5e3053021b 100644 (file)
@@ -59,7 +59,7 @@ def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
         conf.env[found] = True
         return True
     if checkfunctions is not None:
-        if conf.CHECK_FUNCS_IN(checkfunctions, libname, headers=headers):
+        if conf.CHECK_FUNCS_IN(checkfunctions, libname, headers=headers, empty_decl=False):
             conf.env[found] = True
             return True
     conf.env[found] = False