import string
from Configure import conf
from samba_utils import *
+import samba_cross
missing_headers = set()
msg="Checking for variable %s" % v
return CHECK_CODE(conf,
+ # we need to make sure the compiler doesn't
+ # optimize it out...
'''
#ifndef %s
- void *_x; _x=(void *)&%s;
+ void *_x; _x=(void *)&%s; return (int)_x;
#endif
return 0
''' % (v, v),
@conf
-def CHECK_DECLS(conf, vars, reverse=False, headers=None):
+def CHECK_DECLS(conf, vars, reverse=False, headers=None, always=False):
'''check a list of variable declarations, using the HAVE_DECL_xxx form
of define
if not CHECK_VARIABLE(conf, v,
define=define,
headers=headers,
- msg='Checking for declaration of %s' % v):
+ msg='Checking for declaration of %s' % v,
+ always=always):
ret = False
return ret
if not ret:
ret = CHECK_CODE(conf,
# it might be a macro
- 'void *__x = (void *)%s' % f,
+ # we need to make sure the compiler doesn't
+ # optimize it out...
+ 'void *__x = (void *)%s; return (int)__x' % f,
execute=False,
link=True,
addmain=True,
cflags = TO_LIST(cflags)
cflags.extend(ccflags)
+ exec_args = conf.SAMBA_CROSS_ARGS()
+
ret = conf.check(fragment=fragment,
execute=execute,
define_name = define,
type=type,
msg=msg,
quote=quote,
+ exec_args=exec_args,
define_ret=define_ret)
if not ret and CONFIG_SET(conf, define):
# sometimes conf.check() returns false, but it
liblist = TO_LIST(libs)
ret = True
for lib in liblist[:]:
- if GET_TARGET_TYPE(conf, lib):
+ if GET_TARGET_TYPE(conf, lib) == 'SYSLIB':
continue
(ccflags, ldflags) = library_flags(conf, lib)
def IN_LAUNCH_DIR(conf):
'''return True if this rule is being run from the launch directory'''
return os.path.realpath(conf.curdir) == os.path.realpath(Options.launch_dir)
+Options.Handler.IN_LAUNCH_DIR = IN_LAUNCH_DIR
@conf
-def CURRENT_CFLAGS(bld, target, cflags):
+def CURRENT_CFLAGS(bld, target, cflags, hide_symbols=False):
'''work out the current flags. local flags are added first'''
if not 'EXTRA_CFLAGS' in bld.env:
list = []
list = bld.env['EXTRA_CFLAGS'];
ret = TO_LIST(cflags)
ret.extend(list)
+ if hide_symbols and bld.env.HAVE_VISIBILITY_ATTR:
+ ret.append('-fvisibility=hidden')
return ret