<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
  img {
    max-width: 100%;
    height: auto;
  }
  p.details {
    font-style:italic;
    color:#777
  }
  .footer p {
    font-size:small;
    color:#777
  }
  pre.commit-message {
    white-space: pre-wrap;
  }
  .file-stats a {
    text-decoration: none;
  }
  .file-stats .new-file {
    color: #090;
  }
  .file-stats .deleted-file {
    color: #B00;
  }
</style>
<body>
<div class='content'>
<h3>
Amar Takhar pushed to branch master
at <a href="https://gitlab.com/NTPsec/ntpsec">NTPsec / ntpsec</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/b0a9944c4cc18e6212a35efd90501df823d1655a">b0a9944c</a></strong>
<div>
<span>by Amar Takhar</span>
<i>at 2016-01-15T16:34:07-05:00</i>
</div>
<pre class='commit-message'>Fix typo which reenables detection of libevent2 and building of ntpdig.</pre>
</li>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/62dd53daa07bc8f83d3f38be796c7bd32e0c4871">62dd53da</a></strong>
<div>
<span>by Amar Takhar</span>
<i>at 2016-01-15T16:36:35-05:00</i>
</div>
<pre class='commit-message'>Add a variant build for 'host'.

This is the initial work for splitting 'host' tasks from 'architecture' tasks.
The next step is to push all host tasks to the 'host' part of the build and
everything else under the 'main' build.</pre>
</li>
</ul>
<h4>5 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
ntpd/wscript
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
pylib/check_libevent2.py
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
pylib/configure.py
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
pylib/waf.py
</a>
</li>
<li class='file-stats'>
<a href='#diff-4'>
wscript
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/5549b6a2c90ae5992b9956be18be1201d8f9bb7f...62dd53daa07bc8f83d3f38be796c7bd32e0c4871#diff-0'>
<strong>
ntpd/wscript
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/wscript
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/wscript
</span><span style="color: #aaaaaa">@@ -3,52 +3,56 @@ def build(ctx):
</span>   srcnode = ctx.srcnode.abspath()
        bldnode = ctx.bldnode.abspath()
 
<span style="color: #000000;background-color: #ffdddd">-        bison_source = [
-               "ntp_parser.y"
-       ]
</span> 
<span style="color: #000000;background-color: #ffdddd">-        ctx(
-               target          = "bison_obj",
-               features        = "c src_include bld_include libisc_include",
-               source          = bison_source,
-               includes    = [
-                                               "%s/ntpd/" % srcnode
</span><span style="color: #000000;background-color: #ddffdd">+   if ctx.variant == "host":
+
+               bison_source = [
+                       "ntp_parser.y"
</span>           ]
<span style="color: #000000;background-color: #ffdddd">-        )
</span> 
<span style="color: #000000;background-color: #ffdddd">-        ctx.add_group() # Generate Bison files first.
</span><span style="color: #000000;background-color: #ddffdd">+           ctx(
+                       target          = "bison_obj",
+                       features        = "c src_include bld_include libisc_include",
+                       source          = bison_source,
+                       includes    = [
+                                                       "%s/ntpd/" % srcnode,
+                                                       "%s/" % ctx.bldnode.parent.abspath()
+                       ]
+               )
+
+               ctx.add_group() # Generate Bison files first.
</span> 
 
<span style="color: #000000;background-color: #ffdddd">-        keyword_gen_source = [
-               "keyword-gen.c",
-    ]
</span><span style="color: #000000;background-color: #ddffdd">+           keyword_gen_source = [
+                       "keyword-gen.c",
+        ]
</span> 
<span style="color: #000000;background-color: #ffdddd">-        ctx(
-               target      = "keyword-gen",
-               features    = "c cprogram bld_include src_include libisc_include",
-# src_include libisc_include",
-               source      = keyword_gen_source,
-#              use                     = "ntp isc RT THR PTHREAD",
-               includes    = [
-                                               "%s/ntpd/" % bldnode
-               ],
-               install_path= False
-       )
</span><span style="color: #000000;background-color: #ddffdd">+           ctx(
+                       target      = "keyword-gen",
+                       features    = "c cprogram bld_include src_include libisc_include",
+                       source      = keyword_gen_source,
+                       includes    = [
+                                                       "%s/ntpd/" % bldnode,
+                                                       "%s/" % ctx.bldnode.parent.abspath()
+                       ],
+                       install_path= False
+               )
</span> 
<span style="color: #000000;background-color: #ffdddd">-        # XXX: needs a dependency to rebuild ntp_keyword.h when keyword-gen is rebuilt
</span><span style="color: #000000;background-color: #ddffdd">+           # XXX: needs a dependency to rebuild ntp_keyword.h when keyword-gen is rebuilt
</span> 
<span style="color: #000000;background-color: #ffdddd">-        ctx.add_group() # Make sure keyword-gen is created next.
</span><span style="color: #000000;background-color: #ddffdd">+           ctx.add_group() # Make sure keyword-gen is created next.
</span> 
<span style="color: #000000;background-color: #ffdddd">-        ctx(
-               rule        = "%s/ntpd/keyword-gen ${SRC} > ${TGT}" % bldnode,
-               features    = "c bld_include src_include",
-               source      = "ntp_parser.tab.h",
-               target      = "ntp_keyword.h"
-       )
</span><span style="color: #000000;background-color: #ddffdd">+           ctx(
+                       rule        = "%s/ntpd/keyword-gen ${SRC} > ${TGT}" % bldnode,
+                       features    = "c bld_include src_include",
+                       source      = "ntp_parser.tab.h",
+                       target      = "ntp_keyword.h"
+               )
</span> 
 
<span style="color: #000000;background-color: #ffdddd">-        ctx.add_group() # Make sure ntp_keyword.h is created last.
</span><span style="color: #000000;background-color: #ddffdd">+           ctx.add_group() # Make sure ntp_keyword.h is created last.
</span> 
<span style="color: #000000;background-color: #ddffdd">+                return
</span> 
 
        libntpd_source = [
<span style="color: #aaaaaa">@@ -107,14 +111,12 @@ def build(ctx):
</span>                   )
                        use_refclock += " refclock_%s" % file
 
<span style="color: #000000;background-color: #ffdddd">-
-
-
</span>   ntpd_source = [
                "ntp_config.c",
                "ntp_io.c",
                "ntp_scanner.c",
                "ntpd.c",
<span style="color: #000000;background-color: #ddffdd">+                ctx.bldnode.parent.find_node("host/ntpd/ntp_parser.tab.c")
</span>   ]
 
 
<span style="color: #aaaaaa">@@ -137,8 +139,8 @@ def build(ctx):
</span>           source          = ntpd_source,
                use                     = "libntpd_obj bison_obj isc ntp sodium opts OSSAUDIO M parse GCC_S RT CAP THR PTHREAD CRYPTO DNS_SD DNS_SD_INCLUDES %s" % use_refclock,
                includes        = [
<span style="color: #000000;background-color: #ffdddd">-                        "%s/ntpd/" % bldnode,
-                       "%s/ntpd/" % srcnode,
</span><span style="color: #000000;background-color: #ddffdd">+                                           "%s/host/ntpd/" % ctx.bldnode.parent.abspath(),
+                                               "%s/ntpd/" % srcnode,
</span>                         "%s/libsodium/include" % srcnode
                ],
                install_path= "${PREFIX}/sbin/",
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/5549b6a2c90ae5992b9956be18be1201d8f9bb7f...62dd53daa07bc8f83d3f38be796c7bd32e0c4871#diff-1'>
<strong>
pylib/check_libevent2.py
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/pylib/check_libevent2.py
</span><span style="color: #000000;background-color: #ddffdd">+++ b/pylib/check_libevent2.py
</span><span style="color: #aaaaaa">@@ -29,7 +29,7 @@ def check_libevent2_run(ctx):
</span>           if ctx.env.EVENT2_HEADER: # XXX Remove when variant builds exist
                        ctx.define("HAVE_LIBEVENT2", 1)
                        ctx.env.LIBEVENT2_ENABLE = True
<span style="color: #000000;background-color: #ffdddd">-        return
</span><span style="color: #000000;background-color: #ddffdd">+           return
</span> 
        ctx.check(
                fragment        = LIBEVENT2_FRAG,
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/5549b6a2c90ae5992b9956be18be1201d8f9bb7f...62dd53daa07bc8f83d3f38be796c7bd32e0c4871#diff-2'>
<strong>
pylib/configure.py
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/pylib/configure.py
</span><span style="color: #000000;background-color: #ddffdd">+++ b/pylib/configure.py
</span><span style="color: #aaaaaa">@@ -483,7 +483,6 @@ def cmd_configure(ctx):
</span>   ctx.define("HAVE_IFLIST_SYSCTL", 1)
 
 
<span style="color: #000000;background-color: #ffdddd">-
</span>   # Header checks
        from pylib.check_cap import check_cap_header
        check_cap_header(ctx)
</code></pre>

<br>
</li>
<li id='diff-3'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/5549b6a2c90ae5992b9956be18be1201d8f9bb7f...62dd53daa07bc8f83d3f38be796c7bd32e0c4871#diff-3'>
<strong>
pylib/waf.py
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/pylib/waf.py
</span><span style="color: #000000;background-color: #ddffdd">+++ b/pylib/waf.py
</span><span style="color: #aaaaaa">@@ -6,7 +6,7 @@ from waflib.Task import Task
</span> @before_method('apply_incpaths')
 @feature('bld_include')
 def insert_blddir(self):
<span style="color: #000000;background-color: #ffdddd">-        bldnode = self.bld.bldnode.abspath()
</span><span style="color: #000000;background-color: #ddffdd">+   bldnode = self.bld.bldnode.parent.abspath()
</span>   self.includes += [bldnode]
 
 @before_method('apply_incpaths')
</code></pre>

<br>
</li>
<li id='diff-4'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/5549b6a2c90ae5992b9956be18be1201d8f9bb7f...62dd53daa07bc8f83d3f38be796c7bd32e0c4871#diff-4'>
<strong>
wscript
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/wscript
</span><span style="color: #000000;background-color: #ddffdd">+++ b/wscript
</span><span style="color: #aaaaaa">@@ -1,4 +1,8 @@
</span> from waflib import Utils
<span style="color: #000000;background-color: #ddffdd">+from waflib.Build import BuildContext, CleanContext, InstallContext, UninstallContext, StepContext, ListContext
+from waflib import Context, Errors
+from waflib import Scripting
+from waflib.Logs import pprint
</span> 
 out="build"
 
<span style="color: #aaaaaa">@@ -102,6 +106,57 @@ class check(BuildContext):
</span>   cmd = 'check'
 
 
<span style="color: #000000;background-color: #ddffdd">+# Borrowed from https://www.rtems.org/
+variant_cmd = (
+       ("build",   BuildContext),
+       ("clean",   CleanContext),
+       ("install", InstallContext),
+       ("step",    StepContext),
+       ("list",    ListContext),
+       ("check",   BuildContext)
+)
+
+def init_handler(ctx):
+       cmd = ctx.cmd
+       if cmd == 'init_handler':
+               cmd = 'build'
+
+       def make_context(name):
+               for x in Context.classes:
+                       if x.cmd == name and x.fun != 'init_handler':
+                               return x()
+               ctx.fatal('No class for %r' % cmd)
+
+       # By default we want to iterate over each variant.
+       for v in ["host", "main"]:
+               obj = make_context(cmd)
+               obj.variant = v
+               pprint("YELLOW", "--- %sing %s ---" % (cmd, v))
+               obj.execute()
+
+commands = (
+       ("install",     "init_handler", None),
+       ("uninstall",   "init_handler", None),
+       ("build",       "init_handler", None),
+       ("clean",       "init_handler", None),
+       ("list",        "init_handler", None),
+       ("step",        "init_handler", None),
+#      ("info",        "cmd_info",     "Show build information / configuration.")
+)
+
+
+for command, func, descr in commands:
+       class tmp(Context.Context):
+               if descr:
+                       __doc__ = descr
+               cmd = command
+               fun = func
+               if command in 'install uninstall build clean list step docs bsp info':
+                       execute = Scripting.autoconfigure(Context.Context.execute)
+# end borrowed code
+
+
+
</span> def build(ctx):
 
        ctx.load('waf', tooldir='pylib/')
<span style="color: #aaaaaa">@@ -109,6 +164,10 @@ def build(ctx):
</span>   ctx.load('asciidoc', tooldir='pylib/')
        ctx.load('rtems_trace', tooldir='pylib/')
 
<span style="color: #000000;background-color: #ddffdd">+        if ctx.variant == "host":
+               ctx.recurse("ntpd")
+               return
+
</span>   if ctx.env.ENABLE_DOC:
                ctx.recurse("docs")
 
<span style="color: #aaaaaa">@@ -149,17 +208,20 @@ def build(ctx):
</span>   ctx.manpage(1, "ntptrace/ntptrace-man.txt")
 
 
<span style="color: #000000;background-color: #ffdddd">-        # Force re-running of tests.  Same as 'waf --alltests'
-       if ctx.cmd == "check":
-               ctx.options.all_tests = True
-
-               # Print log if -v is supplied
-               if ctx.options.verbose:
-                       ctx.add_post_fun(test_print_log)
</span><span style="color: #000000;background-color: #ddffdd">+   # Skip running unit tests on a cross compile build
+       if not ctx.env.ENABLE_CROSS:
+               # Force re-running of tests.  Same as 'waf --alltests'
+               if ctx.cmd == "check":
+                       ctx.options.all_tests = True
</span> 
<span style="color: #000000;background-color: #ffdddd">-        # Write test log to a file
-       ctx.add_post_fun(test_write_log)
</span><span style="color: #000000;background-color: #ddffdd">+                   # Print log if -v is supplied
+                       if ctx.options.verbose:
+                               ctx.add_post_fun(test_print_log)
</span> 
<span style="color: #000000;background-color: #ffdddd">-        # Print a summary at the end
-       ctx.add_post_fun(waf_unit_test.summary)
</span><span style="color: #000000;background-color: #ddffdd">+           # Write test log to a file
+               ctx.add_post_fun(test_write_log)
</span> 
<span style="color: #000000;background-color: #ddffdd">+                # Print a summary at the end
+               ctx.add_post_fun(waf_unit_test.summary)
+       else:
+               pprint("YELLOW", "Unit test runner skipped on a cross-compiled build.")
</span></code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://gitlab.com/NTPsec/ntpsec/compare/5549b6a2c90ae5992b9956be18be1201d8f9bb7f...62dd53daa07bc8f83d3f38be796c7bd32e0c4871">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can adjust your notification settings.

</p>
</div>
</body>
</html>