The branch, master has been updated
       via  1d5aee6... s4-waf: python devel headers are mandatory for the 
source4 build
       via  06fa4c8... build: make python development headers not mandatory in 
standalone libs
       via  ab2555f... waftest: updated the cross compilation environment I 
test with
       via  612a34a... s4-server: show build host in samba -b output
       via  667f672... build: fixed uname output to be on target machine when 
cross compiling
      from  5e695de... s4-upgradeprovision: fixed --realm option duplicate in 
upgrade_from_s3

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 1d5aee6b91004d71609b3203c919ef39888c86cc
Author: Andrew Tridgell <[email protected]>
Date:   Wed Apr 21 16:21:30 2010 +1000

    s4-waf: python devel headers are mandatory for the source4 build

commit 06fa4c8ebcd5a3e4ef5c9d9a3b3d9516d3b94ce7
Author: Andrew Tridgell <[email protected]>
Date:   Wed Apr 21 16:17:08 2010 +1000

    build: make python development headers not mandatory in standalone libs
    
    This needed an update to the python tool in waf
    
    thanks to Kai for spotting this

commit ab2555faac253bdea46540aa1251977c46b02f35
Author: Andrew Tridgell <[email protected]>
Date:   Wed Apr 21 15:36:26 2010 +1000

    waftest: updated the cross compilation environment I test with

commit 612a34ad69c043e42970e01f2f026dff7dc07728
Author: Andrew Tridgell <[email protected]>
Date:   Wed Apr 21 15:35:55 2010 +1000

    s4-server: show build host in samba -b output

commit 667f672c94eb3e935ae3463a203dfa85b900726a
Author: Andrew Tridgell <[email protected]>
Date:   Wed Apr 21 15:15:55 2010 +1000

    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

-----------------------------------------------------------------------

Summary of changes:
 buildtools/bin/waf-svn                 |  Bin 107837 -> 107839 bytes
 buildtools/testwaf.sh                  |    2 +-
 buildtools/wafsamba/samba_autoconf.py  |   16 +++++++++++--
 buildtools/wafsamba/samba_conftests.py |   37 +++++++++++++++++++++++++------
 buildtools/wafsamba/samba_cross.py     |    2 +-
 buildtools/wafsamba/wscript            |   11 ++++++---
 lib/tdb/wscript                        |    2 +-
 source4/smbd/server.c                  |    5 ++++
 source4/wscript                        |    2 +-
 9 files changed, 59 insertions(+), 18 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/bin/waf-svn b/buildtools/bin/waf-svn
index 774fb71..08b64be 100755
Binary files a/buildtools/bin/waf-svn and b/buildtools/bin/waf-svn differ
diff --git a/buildtools/testwaf.sh b/buildtools/testwaf.sh
index 5f24bdd..b0771bb 100755
--- a/buildtools/testwaf.sh
+++ b/buildtools/testwaf.sh
@@ -57,6 +57,6 @@ popd
 
 echo "testing cross compiling"
 pushd lib/talloc
-CC=arm-linux-gnu-gcc ./configure -C --prefix=$PREFIX  --cross-compile 
--cross-execute='qemu-arm-static -L /usr/arm-linux-gnu'
+CC=arm-linux-gnueabi-gcc ./configure -C --prefix=$PREFIX  --cross-compile 
--cross-execute='runarm'
 make && make install
 popd
diff --git a/buildtools/wafsamba/samba_autoconf.py 
b/buildtools/wafsamba/samba_autoconf.py
index fa58e8f..c35db9b 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -307,7 +307,7 @@ def CHECK_SIZEOF(conf, vars, headers=None, define=None):
         if v_define is None:
             v_define = 'SIZEOF_%s' % v.upper().replace(' ', '_')
         if not CHECK_CODE(conf,
-                          'printf("%%u\\n", (unsigned)sizeof(%s))' % v,
+                          'printf("%%u", (unsigned)sizeof(%s))' % v,
                           define=v_define,
                           execute=True,
                           define_ret=True,
@@ -326,7 +326,8 @@ def CHECK_CODE(conf, code, define,
                add_headers=True, mandatory=False,
                headers=None, msg=None, cflags='', includes='# .',
                local_include=True, lib=None, link=True,
-               define_ret=False, quote=False):
+               define_ret=False, quote=False,
+               on_target=True):
     '''check if some code compiles and/or runs'''
 
     if CONFIG_SET(conf, define):
@@ -372,7 +373,12 @@ def CHECK_CODE(conf, code, define,
     cflags = TO_LIST(cflags)
     cflags.extend(ccflags)
 
-    exec_args = conf.SAMBA_CROSS_ARGS(msg=msg)
+    if on_target:
+        exec_args = conf.SAMBA_CROSS_ARGS(msg=msg)
+    else:
+        exec_args = []
+
+    conf.COMPOUND_START(msg)
 
     ret = conf.check(fragment=fragment,
                      execute=execute,
@@ -394,9 +400,13 @@ def CHECK_CODE(conf, code, define,
     if ret:
         if not define_ret:
             conf.DEFINE(define, 1)
+            conf.COMPOUND_END(True)
+        else:
+            conf.COMPOUND_END(conf.env[define])
         return True
     if always:
         conf.DEFINE(define, 0)
+    conf.COMPOUND_END(False)
     return False
 
 
diff --git a/buildtools/wafsamba/samba_conftests.py 
b/buildtools/wafsamba/samba_conftests.py
index 1794758..ecdf8e7 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
diff --git a/buildtools/wafsamba/samba_cross.py 
b/buildtools/wafsamba/samba_cross.py
index b20555f..3838e34 100644
--- a/buildtools/wafsamba/samba_cross.py
+++ b/buildtools/wafsamba/samba_cross.py
@@ -96,7 +96,7 @@ class cross_Popen(Utils.pproc.Popen):
                 global cross_answers_incomplete
                 cross_answers_incomplete = True
             (retcode, retstring) = ans
-            args = ['/bin/sh', '-c', "echo '%s'; exit %d" % (retstring, 
retcode)]
+            args = ['/bin/sh', '-c', "echo -n '%s'; exit %d" % (retstring, 
retcode)]
         real_Popen.__init__(*(obj, args), **kw)
 
 
diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript
index 66e1ae5..72e0e90 100644
--- a/buildtools/wafsamba/wscript
+++ b/buildtools/wafsamba/wscript
@@ -130,9 +130,6 @@ def configure(conf):
     conf.check_tool('gnu_dirs')
     conf.check_tool('wafsamba')
 
-    conf.CHECK_UNAME(msg='Checking system type', define='SYSTEM_UNAME')
-    conf.CHECK_UNAME(flags='-a')
-
     conf.CHECK_CC_ENV()
 
     conf.check_tool('compiler_cc')
@@ -177,8 +174,14 @@ def configure(conf):
     if Options.options.ABI_CHECK_DISABLE:
         conf.env.ABI_CHECK = False
 
+    conf.CHECK_COMMAND(['uname', '-a'],
+                       msg='Checking build system',
+                       define='BUILD_SYSTEM',
+                       on_target=False)
+    conf.CHECK_UNAME()
+
     # see if we can compile and run a simple C program
-    conf.CHECK_CODE('printf("hello world\\n")',
+    conf.CHECK_CODE('printf("hello world")',
                     define='HAVE_SIMPLE_C_PROG',
                     mandatory=True,
                     execute=True,
diff --git a/lib/tdb/wscript b/lib/tdb/wscript
index 899fe79..70eb8cf 100644
--- a/lib/tdb/wscript
+++ b/lib/tdb/wscript
@@ -46,7 +46,7 @@ def configure(conf):
         # also disable if we don't have the python libs installed
         conf.check_tool('python')
         conf.check_python_version((2,4,2))
-        conf.check_python_headers()
+        conf.check_python_headers(mandatory=False)
         if not conf.env.HAVE_PYTHON_H:
             Logs.warn('Disabling pytdb as python devel libs not found')
             conf.env.disable_python = True
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index 13b5608..1494215 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -263,6 +263,11 @@ static void show_build(void)
        };
        int i;
 
+       printf("Build environment:\n");
+#ifdef BUILD_SYSTEM
+       printf("   Build host:  %s\n", BUILD_SYSTEM);
+#endif
+
        printf("Paths:\n");
        for (i=0; config_options[i].name; i++) {
                printf("   %s: %s\n", config_options[i].name, 
config_options[i].value);
diff --git a/source4/wscript b/source4/wscript
index 13682a1..4f8042d 100644
--- a/source4/wscript
+++ b/source4/wscript
@@ -58,7 +58,7 @@ def configure(conf):
     # enable tool to build python extensions
     conf.check_tool('python')
     conf.check_python_version((2,4,2))
-    conf.check_python_headers()
+    conf.check_python_headers(mandatory=True)
 
     conf.RECURSE('dynconfig')
     conf.RECURSE('scripting/python')


-- 
Samba Shared Repository

Reply via email to