[Git][NTPsec/ntpsec][master] In waf, make magic links properly with a post_fun.

Eric S. Raymond gitlab at mg.gitlab.com
Mon Nov 7 09:42:35 UTC 2016


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


Commits:
80de2d33 by Eric S. Raymond at 2016-11-07T04:41:37-05:00
In waf, make magic links properly with a post_fun.

- - - - -


1 changed file:

- wscript


Changes:

=====================================
wscript
=====================================
--- a/wscript
+++ b/wscript
@@ -122,7 +122,19 @@ for command, func, descr in commands:
 			execute = Scripting.autoconfigure(Context.Context.execute)
 # end borrowed code
 
-
+def linkmaker(ctx):
+    # Make magic links to support in-tree testing.
+    # The idea is that all directories where the Python tools
+    # listed above live should have an 'ntp' symlink so they
+    # can import compiled Python modules from the build directory.
+    # Also, they need to be able to see the Python extension
+    # module built in libntp.
+    print("Making in-tree links...") 
+    bldnode = ctx.bldnode.abspath()
+    srcnode = ctx.srcnode.abspath()
+    for d in ("ntpq", "ntpstats", "ntpsweep", "ntptrace", "ntpwait"):
+	    os.system("ln -sf %s/pylib %s/%s/ntp" % (bldnode, srcnode, d))
+    os.system("ln -sf %s/libntp/ntpc.so %s/pylib/ntpc.so " % (bldnode, bldnode))
 
 def build(ctx):
 	ctx.load('waf', tooldir='wafhelpers/')
@@ -175,17 +187,7 @@ def build(ctx):
 		install_path = "${PREFIX}/bin/"
 	)
 
-	# Make magic links to support in-tree testing.
-	# The idea is that all directories where the Python tools
-	# listed above live should have an 'ntp' symlink so they
-	# can import compiled Python modules from the build directory.
-	# Also, they need to be able to see the Python extension
-	# module built in libntp.
-	bldnode = ctx.bldnode.abspath()
-	srcnode = ctx.srcnode.abspath()
-	for d in ("ntpq", "ntpstats", "ntpsweep", "ntptrace", "ntpwait"):
-		os.system("ln -sf %s/pylib %s/%s/ntp" % (bldnode, srcnode, d))
-	os.system("ln -sf %s/libntp/ntpc.so %s/pylib/ntpc.so " % (bldnode, bldnode))
+	ctx.add_post_fun(linkmaker)
 
 	ctx.manpage(8, "ntpleapfetch/ntpleapfetch-man.txt")
 	ctx.manpage(1, "ntptrace/ntptrace-man.txt")



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/80de2d33066c273629d576b1680fc90df1ff128a
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161107/760ee8ec/attachment.html>


More information about the vc mailing list