1 # a waf tool to add autoconf-like macros to the configure section
3 from Configure import conf
7 conf.define(d, v, quote=False)
8 conf.env.append_value('CCDEFINES', d + '=' + str(v))
11 def CHECK_HEADERS(conf, list):
12 for hdr in list.rsplit(' '):
13 if conf.check(header_name=hdr):
14 conf.env.hlist.append(hdr)
17 def CHECK_TYPES(conf, list):
18 for t in list.rsplit(' '):
19 conf.check(type_name=t, header_name=conf.env.hlist)
22 def CHECK_TYPE_IN(conf, t, hdr):
23 if conf.check(header_name=hdr):
24 conf.check(type_name=t, header_name=hdr)
27 def CHECK_TYPE(conf, t, alternate):
28 if not conf.check(type_name=t, header_name=conf.env.hlist):
29 conf.DEFUN(t, alternate)
32 def CHECK_FUNCS(conf, list):
33 for f in list.rsplit(' '):
34 conf.check(function_name=f, header_name=conf.env.hlist)
37 def CHECK_FUNCS_IN(conf, list, library):
38 if conf.check(lib=library, uselib_store=library):
39 for f in list.rsplit(' '):
40 conf.check(function_name=f, lib=library, header_name=conf.env.hlist)
42 # we want a different rpath when installing and when building
43 # this should really check if rpath is available on this platform
44 # and it should also honor an --enable-rpath option
47 if Options.is_install:
48 bld.env['RPATH'] = ['-Wl,-rpath=' + bld.env.PREFIX + '/lib']
50 bld.env.append_value('RPATH', '-Wl,-rpath=build/default')
53 Build.BuildContext.set_rpath = set_rpath