[Git][NTPsec/ntpsec][master] Move more blocks under 'host', fix doc building with --only-docs.

Amar Takhar gitlab at mg.gitlab.com
Thu Jan 21 04:04:03 UTC 2016


Amar Takhar pushed to branch master at NTPsec / ntpsec


Commits:
6415d014 by Amar Takhar at 2016-01-20T23:02:46-05:00
Move more blocks under 'host', fix doc building with --only-docs.

I will split configure into two sections to make it easier to read.

- - - - -


2 changed files:

- pylib/configure.py
- wscript


Changes:

=====================================
pylib/configure.py
=====================================
--- a/pylib/configure.py
+++ b/pylib/configure.py
@@ -15,6 +15,17 @@ def cmd_configure(ctx):
 		opt_map[opt] = ctx.env.OPT_STORE[flag]
 
 
+
+
+
+
+
+
+
+
+
+
+
 	msg("--- Configuring host ---")
 	ctx.setenv('host', ctx.env.derive())
 
@@ -29,6 +40,72 @@ def cmd_configure(ctx):
 
 
 
+	if ctx.options.enable_rtems_trace:
+		ctx.find_program("rtems-tld", var="BIN_RTEMS_TLD", path_list=[ctx.options.rtems_trace_path, ctx.env.BINDIR])
+		ctx.env.RTEMS_TEST_ENABLE = True
+		ctx.env.RTEMS_TEST_FLAGS = ["-C", "%s/devel/trace/ntpsec-trace.ini" % srcnode,
+									"-W", "%s/ntpsec-wrapper" % bldnode,
+									"-P", "%s/devel/trace/" % srcnode,
+									"-f", "-I%s" % bldnode,
+									"-f", "-I%s/include/" % srcnode,
+									"-f", "-I%s/libisc/include/" % srcnode,
+									"-f", "-I%s/libisc/unix/include/" % srcnode]
+
+	ctx.find_program("awk", var="BIN_AWK")
+	ctx.find_program("perl", var="BIN_PERL")
+	ctx.find_program("sh", var="BIN_SH")
+	ctx.find_program("asciidoc", var="BIN_ASCIIDOC", mandatory=False)
+	ctx.find_program("a2x", var="BIN_A2X", mandatory=False)
+
+	if (ctx.options.enable_doc or ctx.options.enable_doc_only) and not ctx.env.BIN_ASCIIDOC:
+		ctx.fatal("asciidoc is required in order to build documentation")
+	elif (ctx.options.enable_doc or ctx.options.enable_doc_only):
+		ctx.env.ASCIIDOC_FLAGS = ["-f", "%s/docs/asciidoc.conf" % ctx.srcnode.abspath()]
+		ctx.env.ENABLE_DOC = True
+		ctx.env.ENABLE_DOC_ONLY = ctx.options.enable_doc_only
+		ctx.env.PATH_DOC = ctx.options.path_doc
+
+	# XXX: conditionally build this with --disable-man?  Should it build without docs enabled?
+	ctx.env.A2X_FLAGS = ["--format", "manpage", "--asciidoc-opts=--conf-file=%s/docs/asciidoc.conf" % ctx.srcnode.abspath()]
+	if not ctx.options.enable_a2x_xmllint:
+		ctx.env.A2X_FLAGS += ["--no-xmllint"]
+
+	# The rest is not needed for documentation building.
+	if ctx.options.enable_doc_only:
+		return
+
+	# Disable manpages within build()
+	if ctx.options.disable_manpage:
+		ctx.env.DISABLE_MANPAGE = True
+
+	from os.path import exists
+	from waflib.Utils import subprocess
+	if exists(".git") and ctx.find_program("git", var="BIN_GIT", mandatory=False):
+		ctx.start_msg("DEVEL: Getting revision")
+		cmd = ["git", "log", "-1", "--format=%H"]
+		p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=None)
+		ctx.env.NTPS_REVISION, stderr = p.communicate()
+		ctx.env.NTPS_REVISION = ctx.env.NTPS_REVISION.replace("\n", "")
+		ctx.end_msg(ctx.env.NTPS_REVISION)
+
+	ctx.start_msg("Building version")
+	ctx.env.NTPS_VERSION_STRING = ctx.env.NTPS_VERSION
+
+	if ctx.env.NTPS_REVISION:
+		ctx.env.NTPS_VERSION_STRING += "-%s" % ctx.env.NTPS_REVISION[:7]
+
+	if ctx.options.build_version_tag:
+		ctx.env.NTPS_VERSION_STRING += "-%s" % ctx.options.build_version_tag
+
+	ctx.define("NTPS_VERSION_STRING", ctx.env.NTPS_VERSION_STRING)
+	ctx.end_msg(ctx.env.NTPS_VERSION_STRING)
+
+
+
+
+
+
+
 	msg("--- Configuring main ---")
 	ctx.setenv("main", ctx.env.derive())
 
@@ -65,8 +142,6 @@ def cmd_configure(ctx):
 
 		return
 
-
-
 	# This needs to be at the top since it modifies CC and AR
 	if ctx.options.enable_fortify:
 		from check_fortify import check_fortify
@@ -112,66 +187,6 @@ def cmd_configure(ctx):
 	if ctx.env.PLATFORM_TARGET == "osx":
 		ctx.define("__APPLE_USE_RFC_3542", 1)
 
-	if ctx.options.enable_rtems_trace:
-		ctx.find_program("rtems-tld", var="BIN_RTEMS_TLD", path_list=[ctx.options.rtems_trace_path, ctx.env.BINDIR])
-		ctx.env.RTEMS_TEST_ENABLE = True
-		ctx.env.RTEMS_TEST_FLAGS = ["-C", "%s/devel/trace/ntpsec-trace.ini" % srcnode,
-									"-W", "%s/ntpsec-wrapper" % bldnode,
-									"-P", "%s/devel/trace/" % srcnode,
-									"-f", "-I%s" % bldnode,
-									"-f", "-I%s/include/" % srcnode,
-									"-f", "-I%s/libisc/include/" % srcnode,
-									"-f", "-I%s/libisc/unix/include/" % srcnode]
-
-	ctx.find_program("awk", var="BIN_AWK")
-	ctx.find_program("perl", var="BIN_PERL")
-	ctx.find_program("sh", var="BIN_SH")
-	ctx.find_program("asciidoc", var="BIN_ASCIIDOC", mandatory=False)
-	ctx.find_program("a2x", var="BIN_A2X", mandatory=False)
-
-	if (ctx.options.enable_doc or ctx.options.enable_doc_only) and not ctx.env.BIN_ASCIIDOC:
-		ctx.fatal("asciidoc is required in order to build documentation")
-	elif (ctx.options.enable_doc or ctx.options.enable_doc_only):
-		ctx.env.ASCIIDOC_FLAGS = ["-f", "%s/docs/asciidoc.conf" % ctx.srcnode.abspath()]
-		ctx.env.ENABLE_DOC = True
-		ctx.env.ENABLE_DOC_ONLY = ctx.options.enable_doc_only
-		ctx.env.PATH_DOC = ctx.options.path_doc
-
-	# XXX: conditionally build this with --disable-man?  Should it build without docs enabled?
-	ctx.env.A2X_FLAGS = ["--format", "manpage", "--asciidoc-opts=--conf-file=%s/docs/asciidoc.conf" % ctx.srcnode.abspath()]
-	if not ctx.options.enable_a2x_xmllint:
-		ctx.env.A2X_FLAGS += ["--no-xmllint"]
-
-	# The rest is not needed for documentation building.
-	if ctx.options.enable_doc_only:
-		return
-
-	# Disable manpages within build()
-	if ctx.options.disable_manpage:
-		ctx.env.DISABLE_MANPAGE = True
-
-	from os.path import exists
-	from waflib.Utils import subprocess
-	if exists(".git") and ctx.find_program("git", var="BIN_GIT", mandatory=False):
-		ctx.start_msg("DEVEL: Getting revision")
-		cmd = ["git", "log", "-1", "--format=%H"]
-		p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=None)
-		ctx.env.NTPS_REVISION, stderr = p.communicate()
-		ctx.env.NTPS_REVISION = ctx.env.NTPS_REVISION.replace("\n", "")
-		ctx.end_msg(ctx.env.NTPS_REVISION)
-
-	ctx.start_msg("Building version")
-	ctx.env.NTPS_VERSION_STRING = ctx.env.NTPS_VERSION
-
-	if ctx.env.NTPS_REVISION:
-		ctx.env.NTPS_VERSION_STRING += "-%s" % ctx.env.NTPS_REVISION[:7]
-
-	if ctx.options.build_version_tag:
-		ctx.env.NTPS_VERSION_STRING += "-%s" % ctx.options.build_version_tag
-
-	ctx.define("NTPS_VERSION_STRING", ctx.env.NTPS_VERSION_STRING)
-	ctx.end_msg(ctx.env.NTPS_VERSION_STRING)
-
 	# int32_t and uint32_t probes aren't really needed, POSIX guarantees
 	# them.  But int64_t and uint64_t are not guaranteed to exist on 32-bit
 	# machines.


=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -175,16 +175,18 @@ def build(ctx):
 	ctx.load('asciidoc', tooldir='pylib/')
 	ctx.load('rtems_trace', tooldir='pylib/')
 
-	if ctx.variant == "host":
-		ctx.recurse("ntpd")
-		return
-
 	if ctx.env.ENABLE_DOC:
 		ctx.recurse("docs")
 
 	if ctx.env.ENABLE_DOC_ONLY:
 		return
 
+
+	if ctx.variant == "host":
+		ctx.recurse("ntpd")
+		return
+
+
 	ctx.recurse("libisc")
 	if ctx.env.REFCLOCK_PARSE: # Only required by the parse refclock
 		ctx.recurse("libparse")



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/6415d01485395af5a0c36df8734dc6be8bdc847f
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160121/36d544d3/attachment.html>


More information about the vc mailing list