<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/38e49ac7719213a43e6957adb6bdee31f86cffbd">38e49ac7</a></strong>
<div>
<span>by Amar Takhar</span>
<i>at 2015-11-30T11:40:09Z</i>
</div>
<pre class='commit-message'>Make PPS API checks more robust.

  * Add a compile check to ensure the PPS capabilities exist.
  * Send a warning and automatically disable PPS clocks if they are requested by
    the user but the API is not available.

This fixes #17</pre>
</li>
</ul>
<h4>3 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
<span class='new-file'>
+
pylib/check_timepps.py
</span>
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
pylib/configure.py
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
pylib/refclock.py
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/38e49ac7719213a43e6957adb6bdee31f86cffbd#diff-0'>
<strong>
pylib/check_timepps.py
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- /dev/null
</span><span style="color: #000000;background-color: #ddffdd">+++ b/pylib/check_timepps.py
</span><span style="color: #aaaaaa">@@ -0,0 +1,29 @@
</span><span style="color: #000000;background-color: #ddffdd">+TIMEPPS_FRAG = """
+#include <sys/types.h>
+
+#ifdef HAVE_TIMEPPS_H
+# include <timepps.h>
+#else
+# ifdef HAVE_SYS_TIMEPPS_H
+#  include <sys/timepps.h>
+# endif
+#endif
+
+int main(void) {
+       pps_handle_t pps_h;
+       time_pps_destroya (pps_h);
+
+    return 0;
+}
+"""
+
+
+def check_timepps(ctx):
+       ctx.check_cc(
+               fragment        = TIMEPPS_FRAG,
+               define_name = "HAVE_PPSAPI",
+               features        = "c",
+               msg         = "Checking if PPS PAI works",
+               mandatory       = False
+       )
+
</span></code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/38e49ac7719213a43e6957adb6bdee31f86cffbd#diff-1'>
<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">@@ -303,7 +303,8 @@ def cmd_configure(ctx):
</span>                   print "Compilation check failed but include exists %s" % hdr
 
        if ctx.get_define("HAVE_TIMEPPS_H") or ctx.get_define("HAVE_SYS_TIMEPPS_H"):
<span style="color: #000000;background-color: #ffdddd">-                ctx.define("HAVE_PPSAPI", 1)
</span><span style="color: #000000;background-color: #ddffdd">+           from pylib.check_timepps import check_timepps
+               check_timepps(ctx)
</span> 
 
        ctx.check_cc(header_name="event2/event.h", includes=ctx.env.PLATFORM_INCLUDES)
<span style="color: #aaaaaa">@@ -485,5 +486,5 @@ def cmd_configure(ctx):
</span>   msg_setting("LDFLAGS", " ".join(ctx.env.LDFLAGS))
        msg_setting("PREFIX", ctx.env.PREFIX)
        msg_setting("Debug Support", yesno(ctx.options.enable_debug))
<span style="color: #000000;background-color: #ffdddd">-        msg_setting("Refclocks", ctx.options.refclocks)
</span><span style="color: #000000;background-color: #ddffdd">+   msg_setting("Refclocks", ", ".join(ctx.env.REFCLOCK_LIST))
</span>   msg_setting("Build Manpages", yesno(ctx.env.BIN_A2X and not ctx.env.DISABLE_MANPAGE))
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/38e49ac7719213a43e6957adb6bdee31f86cffbd#diff-2'>
<strong>
pylib/refclock.py
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/pylib/refclock.py
</span><span style="color: #000000;background-color: #ddffdd">+++ b/pylib/refclock.py
</span><span style="color: #aaaaaa">@@ -1,4 +1,5 @@
</span> from waflib.Configure import conf
<span style="color: #000000;background-color: #ddffdd">+from waflib.Logs import pprint
</span> 
 # Note: When you change this list. also check the following files:
 # doc/recflock.txt
<span style="color: #aaaaaa">@@ -110,6 +111,7 @@ refclock_map = {
</span>   30: {
                "descr":      "Motorola UT Oncore GPS",
                "define":     "CLOCK_ONCORE",
<span style="color: #000000;background-color: #ddffdd">+                "require":    ["ppsapi"],
</span>           "file":               "oncore"
        },
 
<span style="color: #aaaaaa">@@ -225,12 +227,21 @@ def refclock_config(ctx):
</span>                   for subtype in parse_clocks:
                                ctx.define(subtype, 1)
 
<span style="color: #000000;background-color: #ffdddd">-                ctx.start_msg("Enabling Refclock %s:" % id)
</span><span style="color: #000000;background-color: #ddffdd">+           ctx.start_msg("Enabling Refclock %s (%d):" % (rc["descr"], id))
+
+               if "require" in rc:
+                       if "ppsapi" in rc["require"]:
+                               if not ctx.get_define("HAVE_PPSAPI"):
+                                       ctx.end_msg("No")
+                                       pprint("RED", "Refclock \"%s\" disabled, PPS API has not been detected as working." % rc["descr"])
+                                       continue
+
</span>           ctx.env.REFCLOCK_SOURCE.append((rc["file"], rc["define"]))
<span style="color: #000000;background-color: #ffdddd">-                ctx.end_msg(rc["descr"])
</span>           ctx.env["REFCLOCK_%s" % rc["file"].upper()] = True
<span style="color: #000000;background-color: #ffdddd">-
</span>           ctx.define(rc["define"], 1)
<span style="color: #000000;background-color: #ddffdd">+                ctx.env.REFCLOCK_LIST += [str(id)]
+
+               ctx.end_msg("Yes")
</span> 
                refclock = True
 
</code></pre>

<br>
</li>

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

<br>
<a href="https://gitlab.com/NTPsec/ntpsec/commit/38e49ac7719213a43e6957adb6bdee31f86cffbd">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.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.com/NTPsec/ntpsec/commit/38e49ac7719213a43e6957adb6bdee31f86cffbd"}}</script>
</p>
</div>
</body>
</html>