[ntpsec commit] In configure.py, test for multicast.

Eric S. Raymond esr at ntpsec.org
Wed Sep 30 21:37:29 UTC 2015


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

Author:    Eric S. Raymond <esr at thyrsus.com>
Date:      Wed Sep 30 17:03:06 2015 -0400

In configure.py, test for multicast.

Also, document the check for HAVE_STRUCT_SND_SIZE.

---

 pylib/configure.py | 45 +++++++++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 18 deletions(-)

diff --git a/pylib/configure.py b/pylib/configure.py
index 921daa5..2f6aae4 100644
--- a/pylib/configure.py
+++ b/pylib/configure.py
@@ -135,24 +135,18 @@ def cmd_configure(ctx):
 
 	ctx.define("OPENSSL_VERSION_TEXT", "#XXX: Fixme")
 
-	# Checking for multicast capability:
-	#
-	#    AC_COMPILE_IFELSE(
-	#	[AC_LANG_PROGRAM(
-	#	    [[
-	#		#ifdef HAVE_NETINET_IN_H
-	#		# include <netinet/in.h>
-	#		#endif
-	#	    ]],
-	#	    [[
-	#		struct ip_mreq ipmr;
-	#		ipmr.imr_interface.s_addr = 0;
-	#	    ]]
-	#	)],
-	#	[ntp_cv_multicast=yes],
-	#	[]
-	#   )
-	ctx.define("MCAST", 1) # XXX: check for mcast support
+	ctx.check_cc(
+		fragment="""
+#include <netinet/in.h>
+int main() {
+	struct ip_mreq ipmr;
+	ipmr.imr_interface.s_addr = 0;
+	return 0;
+}
+""",
+		define_name="MCAST",
+		msg = "Checking for multicast capability",
+		mandatory = False)
 
 	ctx.define("TYPEOF_IP_MULTICAST_LOOP", "u_char", quote=False) #XXX: check for mcast type
 
@@ -383,6 +377,21 @@ int main() { return 0; }
 	# and test carefully.
 	# ctx.define("ENABLE_SIGNALED_IO", 1)
 
+	# Used in libntp/audio.c:
+	#	[[
+	#	    #ifdef HAVE_MACHINE_SOUNDCARD_H
+	#	    # include <machine/soundcard.h>
+	#	    #endif
+	#	    #ifdef HAVE_SYS_SOUNDCARD_H
+	#	    # include <sys/soundcard.h>
+	#	    #endif
+	#	]],
+	#	[[
+	#	    extern struct snd_size *ss;
+	#	    return ss->rec_size;
+	#	]]
+	# ctx.define("HAVE_STRUCT_SND_SIZE", 1)
+
         # These are required by the SHA2 code and various refclocks
         if sys.byteorder == "little":
                 pass



More information about the vc mailing list