<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/e14a9946d219b3cf25bc8a0afced1195e77f1e14">e14a9946</a></strong>
<div>
<span>by Amar Takhar</span>
<i>at 2015-11-30T13:26:50Z</i>
</div>
<pre class='commit-message'>Fix typo s/PAI/API/</pre>
</li>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/a6c7b0235396cf9fe0fb60e9103891e469b7affe">a6c7b023</a></strong>
<div>
<span>by Amar Takhar</span>
<i>at 2015-11-30T13:44:58Z</i>
</div>
<pre class='commit-message'>Add a more robust check for libevent2.

  * Rely on 'event_core' vs 'event' to leave out protocol code.
  * Check for event2/thread.h
  * Add support for alternate platform includes
  * Send a prominent notice if libevent2 is not detected along with the
    consequences.
  * Remove event2/util.h from ntpdig/main.c as it is not used.
  * Disable ntpdig if libevent2 is not detected.
  * Build a small test binary with one func from each library.

This fixes #16</pre>
</li>
</ul>
<h4>7 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
ntpdig/main.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
ntpdig/wscript
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
<span class='new-file'>
+
pylib/check_libevent2.py
</span>
</a>
</li>
<li class='file-stats'>
<a href='#diff-3'>
pylib/check_timepps.py
</a>
</li>
<li class='file-stats'>
<a href='#diff-4'>
pylib/configure.py
</a>
</li>
<li class='file-stats'>
<a href='#diff-5'>
tests/wscript
</a>
</li>
<li class='file-stats'>
<a href='#diff-6'>
wscript
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/38e49ac7719213a43e6957adb6bdee31f86cffbd...a6c7b0235396cf9fe0fb60e9103891e469b7affe#diff-0'>
<strong>
ntpdig/main.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpdig/main.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpdig/main.c
</span><span style="color: #aaaaaa">@@ -1,6 +1,5 @@
</span> #include <config.h>
 
<span style="color: #000000;background-color: #ffdddd">-#include <event2/util.h>
</span> #include <event2/event.h>
 
 #include "ntp_workimpl.h"
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/38e49ac7719213a43e6957adb6bdee31f86cffbd...a6c7b0235396cf9fe0fb60e9103891e469b7affe#diff-1'>
<strong>
ntpdig/wscript
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpdig/wscript
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpdig/wscript
</span><span style="color: #aaaaaa">@@ -14,7 +14,7 @@ def build(ctx):
</span>   ctx(
                target          = "ntpdig_obj",
                features        = "c bld_include src_include libisc_include",
<span style="color: #000000;background-color: #ffdddd">-                use                     = "ntp isc opts M PTHREAD LIBEVENT LIBEVENT_CORE LIBEVENT_PTHREADS RT CRYPTO",
</span><span style="color: #000000;background-color: #ddffdd">+           use                     = "ntp isc opts M PTHREAD LIBEVENT_CORE LIBEVENT_PTHREADS RT CRYPTO",
</span>           source          = ntpdig_obj_source,
                includes        = [
                                                "%s/ntpdig/" % bldnode
<span style="color: #aaaaaa">@@ -28,7 +28,7 @@ def build(ctx):
</span>   ctx(
                target          = "ntpdig",
                features        = "c cprogram bld_include src_include libisc_include ntp_version",
<span style="color: #000000;background-color: #ffdddd">-                use                     = "ntp isc opts ntpdig_obj M PTHREAD ntpdig_obj LIBEVENT LIBEVENT_CORE LIBEVENT_PTHREADS RT CRYPTO",
</span><span style="color: #000000;background-color: #ddffdd">+           use                     = "ntp isc opts ntpdig_obj M PTHREAD ntpdig_obj LIBEVENT_CORE LIBEVENT_PTHREADS RT CRYPTO",
</span>           source          = ntpdig_source,
                includes        = [
                                                "%s/ntpdig/" % bldnode
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/38e49ac7719213a43e6957adb6bdee31f86cffbd...a6c7b0235396cf9fe0fb60e9103891e469b7affe#diff-2'>
<strong>
pylib/check_libevent2.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_libevent2.py
</span><span style="color: #aaaaaa">@@ -0,0 +1,50 @@
</span><span style="color: #000000;background-color: #ddffdd">+from waflib.Logs import pprint
+LIBEVENT2_FRAG = """
+#include <event2/thread.h>
+#include <event2/event.h>
+
+int main(void) {
+       struct event_config *   evcfg;
+
+       evthread_use_pthreads();
+       evcfg = event_config_new();
+       return 0;
+}
+"""
+
+
+def check_libevent2(ctx):
+       check_libevent2.false = False
+
+       def check(**kwargs):
+               if not ctx.check_cc(**kwargs):
+                       check_libevent2.false = True
+
+
+       check(header_name="event2/event.h", includes=ctx.env.PLATFORM_INCLUDES, mandatory = False)
+       check(header_name="event2/thread.h", includes=ctx.env.PLATFORM_INCLUDES, mandatory = False)
+       check(feature="c cshlib", lib="event_core", libpath=ctx.env.PLATFORM_LIBPATH, uselib_store="LIBEVENT_CORE", mandatory = False)
+       check(feature="c cshlib", lib="event_pthreads", libpath=ctx.env.PLATFORM_LIBPATH, uselib_store="LIBEVENT_PTHREADS", use="LIBEVENT_CORE", mandatory = False)
+
+
+       ctx.check(
+               fragment        = LIBEVENT2_FRAG,
+               define_name = "HAVE_LIBEVENT2",
+               features        = "c",
+               use                     = "LIBEVENT, LIBEVENT_CORE, LIBEVENT_PTHREADS",
+               msg         = "Checking if libevent2 works",
+               includes        = ctx.env.PLATFORM_INCLUDES,
+               export_includes = ctx.env.PLATFORM_INCLUDES,
+               mandatory       = False
+       )
+
+
+       if check_libevent2.false:
+               print("")
+               pprint("RED", "Warning libevent2 does not work")
+               pprint("RED", "This means ntpdig will not be built")
+               pprint("RED", "While not nessicary you will lose 'ntpdate' functionality.")
+               print("")
+       else:
+               ctx.env.LIBEVENT2_ENABLE=True
+               ctx.define("HAVE_LIBEVENT2", 1)
</span></code></pre>

<br>
</li>
<li id='diff-3'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/38e49ac7719213a43e6957adb6bdee31f86cffbd...a6c7b0235396cf9fe0fb60e9103891e469b7affe#diff-3'>
<strong>
pylib/check_timepps.py
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/pylib/check_timepps.py
</span><span style="color: #000000;background-color: #ddffdd">+++ b/pylib/check_timepps.py
</span><span style="color: #aaaaaa">@@ -23,7 +23,7 @@ def check_timepps(ctx):
</span>           fragment        = TIMEPPS_FRAG,
                define_name = "HAVE_PPSAPI",
                features        = "c",
<span style="color: #000000;background-color: #ffdddd">-                msg         = "Checking if PPS PAI works",
</span><span style="color: #000000;background-color: #ddffdd">+           msg         = "Checking if PPS API works",
</span>           mandatory       = False
        )
 
</code></pre>

<br>
</li>
<li id='diff-4'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/38e49ac7719213a43e6957adb6bdee31f86cffbd...a6c7b0235396cf9fe0fb60e9103891e469b7affe#diff-4'>
<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">@@ -307,10 +307,9 @@ def cmd_configure(ctx):
</span>           check_timepps(ctx)
 
 
<span style="color: #000000;background-color: #ffdddd">-        ctx.check_cc(header_name="event2/event.h", includes=ctx.env.PLATFORM_INCLUDES)
-       ctx.check_cc(feature="c cshlib", lib="event", libpath=ctx.env.PLATFORM_LIBPATH, uselib_store="LIBEVENT")
-       ctx.check_cc(feature="c cshlib", lib="event_core", libpath=ctx.env.PLATFORM_LIBPATH, uselib_store="LIBEVENT_CORE")
-       ctx.check_cc(feature="c cshlib", lib="event_pthreads", libpath=ctx.env.PLATFORM_LIBPATH, uselib_store="LIBEVENT_PTHREADS", use="LIBEVENT")
</span><span style="color: #000000;background-color: #ddffdd">+   # Check for libevent and whether it is working.
+       from pylib.check_libevent2 import check_libevent2
+       check_libevent2(ctx)
</span> 
 
        # Check for Linux capability.
</code></pre>

<br>
</li>
<li id='diff-5'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/38e49ac7719213a43e6957adb6bdee31f86cffbd...a6c7b0235396cf9fe0fb60e9103891e469b7affe#diff-5'>
<strong>
tests/wscript
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/tests/wscript
</span><span style="color: #000000;background-color: #ddffdd">+++ b/tests/wscript
</span><span style="color: #aaaaaa">@@ -33,19 +33,20 @@ def build(ctx):
</span> 
 
        # ntpdig/
<span style="color: #000000;background-color: #ffdddd">-        ctx.ntp_test(
-               features    = "c cprogram bld_include src_include libisc_include test",
-        target      = "test_ntpdig",
-               defines         = ["TEST_NTPDIG=1"],
-               includes        = [
-                       "%s/tests/unity/" % srcnode,
-                       "%s/tests/common/" % srcnode,
-                       "%s/ntpdig/" % srcnode
-               ],
-               use                     = "unity ntpdig_obj ntp",
-        source      = ntpdig_source,
-               test_args       = ["%s/tests/ntpdig/data/" % srcnode, "%s/tests/ntpdig/" % bldnode]
-       )
</span><span style="color: #000000;background-color: #ddffdd">+   if ctx.env.LIBEVENT2_ENABLE:
+               ctx.ntp_test(
+                       features    = "c cprogram bld_include src_include libisc_include test",
+               target      = "test_ntpdig",
+                       defines         = ["TEST_NTPDIG=1"],
+                       includes        = [
+                               "%s/tests/unity/" % srcnode,
+                               "%s/tests/common/" % srcnode,
+                               "%s/ntpdig/" % srcnode
+                       ],
+                       use                     = "unity ntpdig_obj ntp",
+               source      = ntpdig_source,
+                       test_args       = ["%s/tests/ntpdig/data/" % srcnode, "%s/tests/ntpdig/" % bldnode]
+               )
</span> 
 
        # libntp/
</code></pre>

<br>
</li>
<li id='diff-6'>
<a href='https://gitlab.com/NTPsec/ntpsec/compare/38e49ac7719213a43e6957adb6bdee31f86cffbd...a6c7b0235396cf9fe0fb60e9103891e469b7affe#diff-6'>
<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">@@ -114,7 +114,8 @@ def build(ctx):
</span>   if ctx.env.REFCLOCK_PARSE: # Only required by the parse refclock
                ctx.recurse("libparse")
        ctx.recurse("libntp")
<span style="color: #000000;background-color: #ffdddd">-        ctx.recurse("ntpdig")
</span><span style="color: #000000;background-color: #ddffdd">+   if ctx.env.LIBEVENT2_ENABLE:
+               ctx.recurse("ntpdig")
</span>   ctx.recurse("libsodium")
        ctx.recurse("ntpd")
        ctx.recurse("ntpfrob")
</code></pre>

<br>
</li>

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

<br>
<a href="https://gitlab.com/NTPsec/ntpsec/compare/38e49ac7719213a43e6957adb6bdee31f86cffbd...a6c7b0235396cf9fe0fb60e9103891e469b7affe">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":["merge_requests","issues","commit"],"url":"https://gitlab.com/NTPsec/ntpsec/compare/38e49ac7719213a43e6957adb6bdee31f86cffbd...a6c7b0235396cf9fe0fb60e9103891e469b7affe"}}</script>
</p>
</div>
</body>
</html>