[Git][NTPsec/ntpsec][master] 2 commits: Build recipe cleanup as recommended by waf maintainer.

Eric S. Raymond gitlab at mg.gitlab.com
Mon Oct 17 19:19:00 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
3de0aff4 by Eric S. Raymond at 2016-10-17T15:13:14-04:00
Build recipe cleanup as recommended by waf maintainer.

- - - - -
028c907d by Eric S. Raymond at 2016-10-17T15:18:47-04:00
More uniform naming.

- - - - -


5 changed files:

- ntpd/wscript
- ntpdig/wscript
- ntpq/wscript
- pylib/wscript
- util/wscript


Changes:

=====================================
ntpd/wscript
=====================================
--- a/ntpd/wscript
+++ b/ntpd/wscript
@@ -2,6 +2,7 @@
 def build(ctx):
 	srcnode = ctx.srcnode.abspath()
 	bldnode = ctx.bldnode.abspath()
+	ntpdnode = ctx.bldnode.make_node('ntpd')
 
 	if ctx.variant == "host":
 
@@ -15,8 +16,8 @@ def build(ctx):
 				features	= "c src_include bld_include libisc_include",
 				source		= bison_source,
 				includes    = [
-								"%s/ntpd/" % srcnode,
-								"%s/" % ctx.bldnode.parent.abspath()
+						"%s/ntpd/" % srcnode,
+						"%s/" % ctx.bldnode.parent.abspath()
 				]
 			)
 
@@ -31,20 +32,19 @@ def build(ctx):
 			features    = "c cprogram bld_include src_include libisc_include",
 			source      = keyword_gen_source,
 			includes    = [
-							"%s/ntpd/" % bldnode,
-							"%s/" % ctx.bldnode.parent.abspath()
+					ntpdnode,
+					"%s/" % ctx.bldnode.parent.abspath()
 			],
 			install_path= None,
 		)
 
-		# XXX: needs a dependency to rebuild ntp_keyword.h when keyword-gen is rebuilt
-
 		ctx.add_group() # Make sure keyword-gen is created next.
 
 		ctx(
-			rule        = "%s/ntpd/keyword-gen ${SRC} > ${TGT}" % bldnode,
+			rule        = "keyword-gen ${SRC} > ${TGT}",
+			cwd         = ntpdnode,
 			features    = "c bld_include src_include",
-			source      = "ntp_parser.tab.h",
+			source      = ["keyword-gen", "ntp_parser.tab.h"],
 			target      = "ntp_keyword.h"
 		)
 


=====================================
ntpdig/wscript
=====================================
--- a/ntpdig/wscript
+++ b/ntpdig/wscript
@@ -1,6 +1,5 @@
 def build(ctx):
-	srcnode = ctx.srcnode.abspath()
-	bldnode = ctx.bldnode.abspath()
+	bldnode = ctx.bldnode.make_node('ntpdig')
 
 	ntpdig_obj_source = [
 		"crypto.c",
@@ -14,11 +13,12 @@ def build(ctx):
 	ctx(
 		target		= "ntpdig_obj",
 		features	= "c bld_include src_include libisc_include",
-		use			= "ntp isc opts M PTHREAD LIBEVENT_CORE LIBEVENT_PTHREADS RT CRYPTO",
+		use		= "ntp isc opts M PTHREAD LIBEVENT_CORE LIBEVENT_PTHREADS RT CRYPTO",
 		source		= ntpdig_obj_source,
+		cwd             = bldnode,
 		includes	= [
-						"%s/ntpdig/" % bldnode
-					] + ctx.env.PLATFORM_INCLUDES, # XXX: Hack needs to use libevent_inc or something else.
+					bldnode,
+				] + ctx.env.PLATFORM_INCLUDES, # XXX: Hack needs to use libevent_inc or something else.
 	)
 
 	ntpdig_source = [
@@ -28,11 +28,12 @@ def build(ctx):
 	ctx(
 		target		= "ntpdig",
 		features	= "c cprogram bld_include src_include libisc_include ntp_version",
-		use			= "ntp isc opts ntpdig_obj M PTHREAD ntpdig_obj LIBEVENT_CORE LIBEVENT_PTHREADS RT CRYPTO",
+		use		= "ntp isc opts ntpdig_obj M PTHREAD ntpdig_obj LIBEVENT_CORE LIBEVENT_PTHREADS RT CRYPTO",
 		source		= ntpdig_source,
+		cwd             = bldnode,
 		includes	= [
-						"%s/ntpdig/" % bldnode
-					] + ctx.env.PLATFORM_INCLUDES, # XXX: Hack needs to use libevent_inc or something else.
+					bldnode
+				] + ctx.env.PLATFORM_INCLUDES, # XXX: Hack needs to use libevent_inc or something else.
 		install_path= "${PREFIX}/bin/",
 	)
 


=====================================
ntpq/wscript
=====================================
--- a/ntpq/wscript
+++ b/ntpq/wscript
@@ -1,6 +1,6 @@
 def build(ctx):
 	srcnode = ctx.srcnode.abspath()
-	bldnode = ctx.bldnode.abspath()
+	bldnode = ctx.bldnode.make_node('ntpq')
 
 	ntpq_source = [
 		"ntpq.c",
@@ -11,11 +11,9 @@ 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 CURSES NCURSES READLINE",
-		includes	= [
-						"%s/ntpq/" % bldnode
-		],
-		install_path= "${PREFIX}/bin/",
+		use		= "ntp opts isc M RT READLINE EDIT PTHREAD CRYPTO CURSES NCURSES READLINE",
+		includes	= [bldnode],
+		install_path    = "${PREFIX}/bin/",
 	)
 
 	ctx.manpage(1, "ntpq-man.txt")


=====================================
pylib/wscript
=====================================
--- a/pylib/wscript
+++ b/pylib/wscript
@@ -5,5 +5,5 @@ def configure(conf):
     conf.load('python')
     conf.check_python_version((2,6,0))
 
-def build(bld):
-    bld(features='py', source=bld.path.ant_glob('*.py'), install_from='.',install_path='${PYTHONDIR}/ntp')
+def build(ctx):
+    ctx(features='py', source=ctx.path.ant_glob('*.py'), install_from='.',install_path='${PYTHONDIR}/ntp')


=====================================
util/wscript
=====================================
--- a/util/wscript
+++ b/util/wscript
@@ -1,7 +1,6 @@
 from waflib import Utils
 
 def build(ctx):
-	srcnode = ctx.srcnode.abspath()
 	bldnode = ctx.bldnode.abspath()
 
 	util = ['sht']



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/20e0adb3530bddb3713f095ab01f4e750dccb247...028c907d472615c9207a4d8cf765b0d3af7f6951
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161017/6bf2c000/attachment.html>


More information about the vc mailing list