diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-04-21 15:15:55 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-21 15:16:01 +1000 |
commit | 667f672c94eb3e935ae3463a203dfa85b900726a (patch) | |
tree | 12af1bd5078a2f3a6c80514483ae7646dec60ec4 /buildtools/wafsamba/samba_conftests.py | |
parent | 5e695dec2af347dd9211a1dec45f10f751bbafb5 (diff) | |
download | samba-667f672c94eb3e935ae3463a203dfa85b900726a.tar.gz samba-667f672c94eb3e935ae3463a203dfa85b900726a.tar.bz2 samba-667f672c94eb3e935ae3463a203dfa85b900726a.zip |
build: fixed uname output to be on target machine when cross compiling
this also makes the output of define_ret configure tests show up
in the configure output
Diffstat (limited to 'buildtools/wafsamba/samba_conftests.py')
-rw-r--r-- | buildtools/wafsamba/samba_conftests.py | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py index 17947582eb..ecdf8e7abd 100644 --- a/buildtools/wafsamba/samba_conftests.py +++ b/buildtools/wafsamba/samba_conftests.py @@ -240,15 +240,19 @@ WriteMakefile( @conf -def CHECK_UNAME(conf, flags=None, msg=None, define=None): - '''return uname result''' - cmd = ['uname'] - if flags is not None: - cmd.append(flags) +def CHECK_COMMAND(conf, cmd, msg=None, define=None, on_target=True): + '''run a command and return result''' if msg is None: - msg = 'Checking uname' + msg = 'Checking %s' % ' '.join(cmd) conf.COMPOUND_START(msg) - ret = Utils.cmd_output(cmd) + cmd = cmd[:] + if on_target: + cmd.extend(conf.SAMBA_CROSS_ARGS(msg=msg)) + try: + ret = Utils.cmd_output(cmd) + except: + conf.COMPOUND_END(False) + return False ret = ret.strip() conf.COMPOUND_END(ret) if define: @@ -256,3 +260,22 @@ def CHECK_UNAME(conf, flags=None, msg=None, define=None): return ret +@conf +def CHECK_UNAME(conf): + '''setup SYSTEM_UNAME_* defines''' + ret = True + for v in "sysname machine release version".split(): + if not conf.CHECK_CODE(''' + struct utsname n; + if (uname(&n) != 0) return -1; + printf("%%s", n.%s); + ''' % v, + define='SYSTEM_UNAME_%s' % v.upper(), + execute=True, + define_ret=True, + quote=True, + headers='sys/utsname.h', + local_include=False, + msg="Checking uname %s type" % v): + ret = False + return ret |