[Git][NTPsec/ntpsec][master] Add an option to disable line editing support

Eric S. Raymond gitlab at mg.gitlab.com
Sun Aug 21 11:33:22 UTC 2016


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


Commits:
7d728511 by Stephen Walker at 2016-08-21T06:58:44-04:00
Add an option to disable line editing support

Implement NTP classic's --without-lineeditlibs option to allow the explicit disabling of line editing dependencies

Signed-off-by: Stephen Walker <stephendwalker+github at gmail.com>

- - - - -


2 changed files:

- wafhelpers/configure.py
- wafhelpers/options.py


Changes:

=====================================
wafhelpers/configure.py
=====================================
--- a/wafhelpers/configure.py
+++ b/wafhelpers/configure.py
@@ -268,13 +268,14 @@ def cmd_configure(ctx, config):
 	ctx.define("OPEN_BCAST_SOCKET", 1, comment="Whether to open a broadcast socket")
 	ctx.define("HAS_ROUTING_SOCKET", 1, comment="Whether a routing socket exists")
 
-	ctx.check_cc(lib="edit", mandatory=False, comment="libedit library")
 	ctx.check_cc(lib="m", comment="Math library")
 	ctx.check_cc(lib="rt", mandatory=False, comment="realtime library")
-	ctx.check_cc(lib="curses", mandatory=False, comment="curses library, required for readline on OpenBSD") # Required for readline on OpenBSD.
-	ctx.check_cc(lib="ncurses", mandatory=False, comment="ncurses library, required for readline on LEDE") # Required for readline on LEDE.
-	ctx.check_cc(lib="readline", use="CURSES", mandatory=False, comment="readline library")
-	ctx.check_cc(lib="readline", use="NCURSES", mandatory=False, comment="readline library")
+	if not ctx.options.disable_lineeditlibs:
+		ctx.check_cc(lib="edit", mandatory=False, comment="libedit library")
+		ctx.check_cc(lib="curses", mandatory=False, comment="curses library, required for readline on OpenBSD") # Required for readline on OpenBSD.
+		ctx.check_cc(lib="ncurses", mandatory=False, comment="ncurses library, required for readline on LEDE") # Required for readline on LEDE.
+		ctx.check_cc(lib="readline", use="CURSES", mandatory=False, comment="readline library")
+		ctx.check_cc(lib="readline", use="NCURSES", mandatory=False, comment="readline library")
 
 	# Find OpenSSL. Must happen before function checks
 	if ctx.options.enable_crypto:
@@ -327,7 +328,6 @@ def cmd_configure(ctx, config):
 	# be removed.
 	optional_headers = (
 		"dns_sd.h",		# NetBSD, Apple, mDNS
-		"histedit.h",		# Apple
 		("ifaddrs.h", ["sys/types.h"]),
 		"libscf.h",		# Solaris
 		("linux/if_addr.h", ["sys/socket.h"]),
@@ -338,8 +338,6 @@ def cmd_configure(ctx, config):
 		("net/route.h", ["sys/types.h","sys/socket.h","net/if.h"]),
 		"netinfo/ni.h",		# Apple
 		"priv.h",               # Solaris
-		("readline/readline.h",["stdio.h"]),
-		("readline/history.h", ["stdio.h","readline/readline.h"]),
 		("resolv.h", ["sys/types.h","netinet/in.h","arpa/nameser.h"]),
 		"semaphore.h",
 		"stdatomic.h",
@@ -353,6 +351,12 @@ def cmd_configure(ctx, config):
 		"utmpx.h",       # missing on RTEMS and OpenBSD
 		("sys/timex.h", ["sys/time.h"]),
 	)
+	if not ctx.options.disable_lineeditlibs:
+		optional_headers += (
+			"histedit.h",	# Apple
+			("readline/readline.h",["stdio.h"]),
+			("readline/history.h", ["stdio.h","readline/readline.h"]),
+		)
 	for hdr in optional_headers:
 		if type(hdr) == type(""):
 			if ctx.check_cc(header_name=hdr, mandatory=False, comment="<%s> header" % hdr):
@@ -541,6 +545,7 @@ def cmd_configure(ctx, config):
 	msg_setting("Debug Support", yesno(not ctx.options.disable_debug))
 	msg_setting("Refclocks", ", ".join(ctx.env.REFCLOCK_LIST))
 	msg_setting("Build Manpages", yesno(ctx.env.ENABLE_DOC and not ctx.env.DISABLE_MANPAGE))
+	msg_setting("Line Editing Support", yesno(not ctx.options.disable_lineeditlibs))
 
 	if ctx.options.enable_debug:
 		msg("")


=====================================
wafhelpers/options.py
=====================================
--- a/wafhelpers/options.py
+++ b/wafhelpers/options.py
@@ -18,6 +18,7 @@ def options_cmd(ctx, config):
 	grp.add_option('--disable-dns-retry', action='store_true', default=False, help="Disable retrying DNS lookups.")
 	grp.add_option('--disable-mdns-registration', action='store_true', default=False, help="Disable MDNS registration.")
 	grp.add_option('--enable-classic-mode', action='store_true', default=False, help="Strict configuration and log-format compatibility with NTP Classic")
+	grp.add_option('--disable-lineeditlibs', action='store_true', default=False, help="Disable line editing support")
 
 	grp = ctx.add_option_group("NTP cross compile options")
 	grp.add_option('--cross-compiler', type='string', help="Path to cross compiler CC. (enables cross-compiling)")



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/7d7285114420f560fafbc4fbe342d22e680e496b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160821/d96d2773/attachment.html>


More information about the vc mailing list