[Git][NTPsec/ntpsec][master] 2 commits: Further support for OpenBSD and make a few checks more robust.
Amar Takhar
gitlab at mg.gitlab.com
Sat Feb 6 21:24:36 UTC 2016
Amar Takhar pushed to branch master at NTPsec / ntpsec
Commits:
1d2ab8fb by Amar Takhar at 2016-02-06T16:16:04-05:00
Further support for OpenBSD and make a few checks more robust.
* Rather than explicitly listing platforms change it to check for the headers
* Add OpenBSD to the list of detected platforms.
* Add pthread.h to ntp_worker.h wrapped with PLATFORM_OPENBSD
Updates #31
- - - - -
e9da97da by Amar Takhar at 2016-02-06T16:16:47-05:00
OpenBSD requires curses for readline.
* Readline is also a separate library.
Fixes #31
- - - - -
5 changed files:
- include/ntp_worker.h
- ntpq/wscript
- ntptime/wscript
- pylib/configure.py
- util/wscript
Changes:
=====================================
include/ntp_worker.h
=====================================
--- a/include/ntp_worker.h
+++ b/include/ntp_worker.h
@@ -7,6 +7,11 @@
#include "ntp_workimpl.h"
+/* XXX: Why does OpenBSD need pthread.h here? */
+#ifdef PLATFORM_OPENBSD
+#include <pthread.h>
+#endif
+
#ifdef USE_WORKER
# if defined(USE_WORK_THREAD) && defined(USE_WORK_PIPE)
# ifdef HAVE_SEMAPHORE_H
=====================================
ntpq/wscript
=====================================
--- a/ntpq/wscript
+++ b/ntpq/wscript
@@ -26,7 +26,7 @@ def build(ctx):
target = "ntpq",
features = "c cprogram bld_include src_include libisc_include ntp_version",
source = ntpq_source,
- use = "ntp opts isc M RT READLINE EDIT PTHREAD CRYPTO",
+ use = "ntp opts isc M RT READLINE EDIT PTHREAD CRYPTO CURSES READLINE",
includes = [
"%s/ntpq/" % bldnode
],
=====================================
ntptime/wscript
=====================================
--- a/ntptime/wscript
+++ b/ntptime/wscript
@@ -1,7 +1,7 @@
from waflib import Utils
def build(ctx):
- if ctx.env.PLATFORM_TARGET not in ['osx']:
+ if ctx.env.HEADER_SYS_TIMEX_H:
srcnode = ctx.srcnode.abspath()
bldnode = ctx.bldnode.abspath()
=====================================
pylib/configure.py
=====================================
--- a/pylib/configure.py
+++ b/pylib/configure.py
@@ -158,13 +158,17 @@ def cmd_configure(ctx):
ctx.env.PLATFORM_TARGET = "freebsd"
elif platform.startswith("netbsd"):
ctx.env.PLATFORM_TARGET = "netbsd"
+ elif platform.startswith("openbsd"):
+ ctx.env.PLATFORM_TARGET = "openbsd"
else:
ctx.env.PLATFORM_TARGET = "unix"
ctx.end_msg(ctx.env.PLATFORM_TARGET )
+ ctx.define("PLATFORM_%s" % ctx.env.PLATFORM_TARGET.upper(), 1)
+
# XXX: hack
- if ctx.env.PLATFORM_TARGET in ["freebsd", "osx"]:
+ if ctx.env.PLATFORM_TARGET in ["freebsd", "osx", "openbsd"]:
ctx.env.PLATFORM_INCLUDES = ["/usr/local/include"]
ctx.env.PLATFORM_LIBPATH = ["/usr/local/lib"]
elif ctx.env.PLATFORM_TARGET == "netbsd":
@@ -248,7 +252,8 @@ def cmd_configure(ctx):
ctx.check_cc(lib="ossaudio", mandatory=False) # NetBSD audio
ctx.check_cc(lib="pthread", mandatory=False)
ctx.check_cc(lib="rt", mandatory=False)
- ctx.check_cc(lib="readline", mandatory=False)
+ ctx.check_cc(lib="curses", mandatory=False) # Required for readline on OpenBSD.
+ ctx.check_cc(lib="readline", use="CURSES", mandatory=False)
ctx.check_cc(lib="thr", mandatory=False)
ctx.check_cc(lib="gcc_s", mandatory=False)
@@ -343,7 +348,9 @@ def cmd_configure(ctx):
#HGM "sys/systune.h",
("timepps.h", ["inttypes.h"]),
("sys/timepps.h", ["inttypes.h", "sys/time.h"]),
- "utmpx.h" # missing on RTEMS and OpenBSD
+ "utmpx.h", # missing on RTEMS and OpenBSD
+ "sys/timex.h",
+ "sys/audio.h"
)
for hdr in optional_headers:
if type(hdr) == type(""):
@@ -376,6 +383,13 @@ def cmd_configure(ctx):
#HGM check_posix_thread_version(ctx)
#HGM ctx.define('HAVE_PTHREADS', ctx.env.POSIX_THREAD_VERISON)
+ # Some systems don't have sys/timex.h eg OS X, OpenBSD...
+ if ctx.get_define("HAVE_SYS_TIMEX_H"):
+ ctx.env.HEADER_SYS_TIMEX_H = True
+
+ # Some systems don't have sys/audio.h eg OS X, OpenBSD...
+ if ctx.get_define("HAVE_SYS_AUDIO_H"):
+ ctx.env.HEADER_SYS_AUDIO_H = True
if ctx.options.refclocks:
from refclock import refclock_config
=====================================
util/wscript
=====================================
--- a/util/wscript
+++ b/util/wscript
@@ -6,7 +6,7 @@ def build(ctx):
util = ['bumpclock', 'hist', 'propdelay', 'sht']
- if ctx.env.PLATFORM_TARGET not in ['osx']:
+ if ctx.env.HEADER_SYS_AUDIO_H:
util += ['tg2']
for name in util:
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/fa1cc41ad5b69f129d143c9f7a8ddbb532052acc...e9da97da22549863a98c65c7ccb52a77c9dbe4b1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160206/b8f48b50/attachment.html>
More information about the vc
mailing list