From b9aa63887c005971b1b812893d6c1bbc50ea21b2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 28 Mar 2010 17:05:30 +1100 Subject: s4-waf: cleanup use of LIBPOPT vs popt dependency --- buildtools/wafsamba/samba_bundled.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'buildtools/wafsamba/samba_bundled.py') diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py index 2a6d75f7c9..6e3753a790 100644 --- a/buildtools/wafsamba/samba_bundled.py +++ b/buildtools/wafsamba/samba_bundled.py @@ -42,15 +42,27 @@ def BUNDLED_EXTENSION_DEFAULT(opt, extension, noextenion=''): Options.Handler.BUNDLED_EXTENSION_DEFAULT = BUNDLED_EXTENSION_DEFAULT +@runonce @conf -def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0'): +def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0', + checkfunctions=None, headers=None): if 'ALL' in conf.env.BUNDLED_LIBS or libname in conf.env.BUNDLED_LIBS: return False + found = 'FOUND_SYSTEMLIB_%s' % libname + if found in conf.env: + return conf.env[found] + # try pkgconfig first if conf.check_cfg(package=libname, args='"%s >= %s" --cflags --libs' % (libname, minversion), msg='Checking for system %s >= %s' % (libname, minversion)): conf.SET_TARGET_TYPE(libname, 'SYSLIB') + conf.env[found] = True return True + if checkfunctions is not None: + if conf.CHECK_FUNCS_IN(checkfunctions, libname, headers=headers): + conf.env[found] = True + return True + conf.env[found] = False if 'NONE' in conf.env.BUNDLED_LIBS or '!'+libname in conf.env.BUNDLED_LIBS: print('ERROR: System library %s of version %s not found, and bundling disabled' % (libname, minversion)) sys.exit(1) -- cgit