third_party/popt: Initial support for popt.
[nivanova/samba-autobuild/.git] / buildtools / wafsamba / samba_third_party.py
1 # functions to support third party libraries
2
3 from Configure import conf
4 import sys, Logs, os
5 from samba_bundled import *
6
7 @conf
8 def CHECK_FOR_THIRD_PARTY(conf):
9     return os.path.exists('third_party')
10
11 Build.BuildContext.CHECK_FOR_THIRD_PARTY = CHECK_FOR_THIRD_PARTY
12
13 @conf
14 def CHECK_INIPARSER(conf):
15     return conf.CHECK_BUNDLED_SYSTEM('iniparser', checkfunctions='iniparser_load', headers='iniparser.h')
16
17 Build.BuildContext.CHECK_INIPARSER = CHECK_INIPARSER
18
19 @conf
20 def CHECK_ZLIB(conf):
21     version_check='''
22     #if (ZLIB_VERNUM >= 0x1230)
23     #else
24     #error "ZLIB_VERNUM < 0x1230"
25     #endif
26     z_stream *z;
27     inflateInit2(z, -15);
28     '''
29     return conf.CHECK_BUNDLED_SYSTEM('z', minversion='1.2.3', pkg='zlib',
30                                      checkfunctions='zlibVersion',
31                                      headers='zlib.h',
32                                      checkcode=version_check,
33                                      implied_deps='replace')
34
35 Build.BuildContext.CHECK_ZLIB = CHECK_ZLIB
36
37 @conf
38 def CHECK_POPT(conf):
39     return conf.CHECK_BUNDLED_SYSTEM('popt', checkfunctions='poptGetContext', headers='popt.h')
40
41 Build.BuildContext.CHECK_POPT = CHECK_POPT