[ntpsec commit] Fix up ntpdsim.c until it compiles. Linkage doesn' t quite work right...

Eric S. Raymond esr at ntpsec.org
Tue Oct 13 10:24:31 UTC 2015


Module:    ntpsec
Branch:    master
Commit:    dd64dd1c04d24333b37033d02bac5aa833b91f76
Changeset: http://git.ntpsec.org/ntpsec/commit/?id=dd64dd1c04d24333b37033d02bac5aa833b91f76

Author:    Eric S. Raymond <esr at thyrsus.com>
Date:      Tue Oct 13 06:21:41 2015 -0400

Fix up ntpdsim.c until it compiles.  Linkage doesn't quite work right...

...so condition our that ctx() in the wscript, for now.

---

 devel-docs/TODO |  3 +++
 ntpd/ntpsim.c   |  6 +++---
 ntpd/wscript    | 17 +++++++++++++++++
 3 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/devel-docs/TODO b/devel-docs/TODO
index 557909a..42ec609 100644
--- a/devel-docs/TODO
+++ b/devel-docs/TODO
@@ -41,6 +41,9 @@ None right now. (Sep-22 2015)
 
 * Add monkeypatch for rmdir, rmtree under Windows.
 
+* ntpdsim does not quite build.  There is something wrong with the way waf is
+  setting up the linkage.  To reproduce, remove the "if 0" near the snd of
+  mtpd/wscript.
 
 === Code ===
 
diff --git a/ntpd/ntpsim.c b/ntpd/ntpsim.c
index ff3a1f2..ffc983f 100644
--- a/ntpd/ntpsim.c
+++ b/ntpd/ntpsim.c
@@ -126,15 +126,15 @@ ntpsim(
 	init_mon();
 	init_timer();
 	init_lib();
-	init_request();
+	//init_request();
 	init_control();
 	init_peer();
-	init_proto();
+	init_proto(false);
 	init_loopfilter();
 	mon_start(MON_OFF);
 
 	/* Call getconfig to parse the configuration file */
-	getconfig(argc, argv);
+	getconfig(NULL);
 	loop_config(LOOP_DRIFTINIT, 0);
 	initializing = false;
 
diff --git a/ntpd/wscript b/ntpd/wscript
index 15422d3..839b3c7 100644
--- a/ntpd/wscript
+++ b/ntpd/wscript
@@ -142,7 +142,24 @@ def build(ctx):
 	)
 
 	ntpdsim_source = [
+		"ntp_config.c",
+		"ntp_io.c",
+		"ntp_scanner.c",
+		"ntpd.c",
 		"ntp_prio_q.c",
 		"ntpsim.c"
 	]
 
+	if 0:
+		ctx(
+			target		= "ntpdsim",
+			features	= "c cprogram bld_include src_include libisc_include libisc_pthread_include ntp_version",
+			source		= ntpdsim_source,
+			defines		= ["SIM"],
+			use		= "libntpd_obj bison_obj isc ntp opts M parse GCC_S RT CAP THR PTHREAD CRYPTO DNS_SD DNS_SD_INCLUDES %s" % use_refclock,
+			includes	= [
+							"%s/ntpd/" % bldnode,
+							"%s/ntpd/" % srcnode
+						],
+			install_path= "${PREFIX}/bin/",
+		)



More information about the vc mailing list