svn commit: r220370 - in head: etc/mtree include lib/libedit lib/libedit/edit lib/libedit/edit/readline sbin/gvinum usr.sbin/ntp/ntpdc usr.sbin/ntp/ntpq usr.sbin/wpa/wpa_cli

David E. O'Brien obrien at FreeBSD.org
Tue Apr 5 18:41:01 UTC 2011


Author: obrien
Date: Tue Apr  5 18:41:01 2011
New Revision: 220370
URL: http://svn.freebsd.org/changeset/base/220370

Log:
  * Add the readline(3) API to libedit.  The libedit versions of
    {readline,history}.h are in /usr/include/edit so as to not conflict with
    the GNU libreadline versions.  To use the libedit readline(3) one should
    add "-I/usr/include/edit" to their Makefile
    (spelled "-I${DESTDIR}/${INCLUDEDIR}/edit" within the FreeBSD source tree).
  
  * Enable its use in the BSD licensed utilities that support readline(3).
  
  * To make it easier to sync libedit development with NetBSD, histedit.h
    is moved into libedit's directory as history shows shown we keep merging
    it into that location.
  
  Obtained from:	NetBSD
  Sponsored by:	Juniper Networks

Added:
  head/lib/libedit/chartype.h
     - copied unchanged from r220331, vendor/NetBSD/libedit/dist/chartype.h
  head/lib/libedit/edit/
  head/lib/libedit/edit/readline/
     - copied from r220330, vendor/NetBSD/libedit/dist/readline/
  head/lib/libedit/edit/readline/history.h   (contents, props changed)
  head/lib/libedit/histedit.h
     - copied, changed from r220247, head/include/histedit.h
  head/lib/libedit/readline.c
     - copied, changed from r220331, vendor/NetBSD/libedit/dist/readline.c
Deleted:
  head/include/histedit.h
Modified:
  head/etc/mtree/BSD.include.dist
  head/include/Makefile
  head/lib/libedit/Makefile
  head/lib/libedit/edit/readline/Makefile
  head/lib/libedit/read.c
  head/sbin/gvinum/Makefile
  head/sbin/gvinum/gvinum.c
  head/usr.sbin/ntp/ntpdc/Makefile
  head/usr.sbin/ntp/ntpq/Makefile
  head/usr.sbin/wpa/wpa_cli/Makefile

Modified: head/etc/mtree/BSD.include.dist
==============================================================================
--- head/etc/mtree/BSD.include.dist	Tue Apr  5 18:40:19 2011	(r220369)
+++ head/etc/mtree/BSD.include.dist	Tue Apr  5 18:41:01 2011	(r220370)
@@ -137,6 +137,10 @@
         wi
         ..
     ..
+    edit
+        readline
+        ..
+    ..
     fs
         devfs
         ..

Modified: head/include/Makefile
==============================================================================
--- head/include/Makefile	Tue Apr  5 18:40:19 2011	(r220369)
+++ head/include/Makefile	Tue Apr  5 18:41:01 2011	(r220370)
@@ -11,7 +11,7 @@ INCS=	a.out.h ar.h assert.h bitstring.h 
 	db.h \
 	dirent.h dlfcn.h elf.h elf-hints.h err.h fmtmsg.h fnmatch.h fstab.h \
 	fts.h ftw.h getopt.h glob.h grp.h gssapi.h \
-	histedit.h ieeefp.h ifaddrs.h \
+	ieeefp.h ifaddrs.h \
 	inttypes.h iso646.h kenv.h langinfo.h libgen.h limits.h link.h \
 	locale.h malloc.h malloc_np.h memory.h monetary.h mpool.h mqueue.h \
 	ndbm.h netconfig.h \

Modified: head/lib/libedit/Makefile
==============================================================================
--- head/lib/libedit/Makefile	Tue Apr  5 18:40:19 2011	(r220369)
+++ head/lib/libedit/Makefile	Tue Apr  5 18:41:01 2011	(r220370)
@@ -26,18 +26,23 @@ MLINKS=	editline.3 el_deletestr.3 editli
 	editline.3 tok_line.3 editline.3 tok_str.3
 
 # For speed and debugging
-#SRCS=   ${OSRCS} tokenizer.c history.c
+#SRCS=   ${OSRCS}
 # For protection
-SRCS=	editline.c tokenizer.c history.c
+SRCS=	editline.c
+SRCS+=	tokenizer.c history.c readline.c
 SRCS+=	common.h emacs.h fcns.h help.h vi.h
 CLEANFILES+= common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h
 
-CFLAGS+= -I. -I${.CURDIR}
+INCS=	histedit.h
+
+CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/edit
 CFLAGS+= #-DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH
 CFLAGS+= #-DDEBUG_PASTE -DDEBUG_EDIT
 
 WARNS?=	1
 
+SUBDIR= edit/readline
+
 AHDR=	vi.h emacs.h common.h
 ASRC=	${.CURDIR}/vi.c ${.CURDIR}/emacs.c ${.CURDIR}/common.c
 

Copied: head/lib/libedit/chartype.h (from r220331, vendor/NetBSD/libedit/dist/chartype.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libedit/chartype.h	Tue Apr  5 18:41:01 2011	(r220370, copy of r220331, vendor/NetBSD/libedit/dist/chartype.h)
@@ -0,0 +1,245 @@
+/*	$NetBSD: chartype.h,v 1.6 2010/04/20 02:01:13 christos Exp $	*/
+
+/*-
+ * Copyright (c) 2009 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _h_chartype_f
+#define _h_chartype_f
+
+
+
+#ifdef WIDECHAR
+
+/* Ideally we should also test the value of the define to see if it
+ * supports non-BMP code points without requiring UTF-16, but nothing
+ * seems to actually advertise this properly, despite Unicode 3.1 having
+ * been around since 2001... */
+#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__))
+#ifndef __STDC_ISO_10646__
+/* In many places it is assumed that the first 127 code points are ASCII
+ * compatible, so ensure wchar_t indeed does ISO 10646 and not some other
+ * funky encoding that could break us in weird and wonderful ways. */
+	#error wchar_t must store ISO 10646 characters
+#endif
+#endif
+
+/* Oh for a <uchar.h> with char32_t and __STDC_UTF_32__ in it...
+ * ref: ISO/IEC DTR 19769
+ */
+#if WCHAR_MAX < INT32_MAX
+#warning Build environment does not support non-BMP characters
+#endif
+
+#define ct_mbtowc            mbtowc
+#define ct_mbtowc_reset      mbtowc(0,0,0)
+#define ct_wctomb            wctomb
+#define ct_wctomb_reset      wctomb(0,0)
+#define ct_wcstombs          wcstombs
+#define ct_mbstowcs          mbstowcs
+
+#define Char			wchar_t
+#define Int			wint_t
+#define FUN(prefix,rest)	prefix ## _w ## rest
+#define FUNW(type)		type ## _w
+#define TYPE(type)		type ## W
+#define FSTR			"%ls"
+#define STR(x) 			L ## x
+#define UC(c)			c
+#define Isalpha(x)  iswalpha(x)
+#define Isalnum(x)  iswalnum(x)
+#define Isgraph(x)  iswgraph(x)
+#define Isspace(x)  iswspace(x)
+#define Isdigit(x)  iswdigit(x)
+#define Iscntrl(x)  iswcntrl(x)
+#define Isprint(x)  iswprint(x)
+
+#define Isupper(x)  iswupper(x)
+#define Islower(x)  iswlower(x)
+#define Toupper(x)  towupper(x)
+#define Tolower(x)  towlower(x)
+
+#define IsASCII(x)  (x < 0x100)
+
+#define Strlen(x)       wcslen(x)
+#define Strchr(s,c)     wcschr(s,c)
+#define Strrchr(s,c)    wcsrchr(s,c)
+#define Strstr(s,v)     wcsstr(s,v)
+#define Strdup(x)       wcsdup(x)
+#define Strcpy(d,s)     wcscpy(d,s)
+#define Strncpy(d,s,n)  wcsncpy(d,s,n)
+#define Strncat(d,s,n)  wcsncat(d,s,n)
+
+#define Strcmp(s,v)     wcscmp(s,v)
+#define Strncmp(s,v,n)  wcsncmp(s,v,n)
+#define Strcspn(s,r)    wcscspn(s,r)
+
+#define Strtol(p,e,b)   wcstol(p,e,b)
+
+#define Width(c)	wcwidth(c)
+
+#else /* NARROW */
+
+#define ct_mbtowc            error
+#define ct_mbtowc_reset      
+#define ct_wctomb            error
+#define ct_wctomb_reset      
+#define ct_wcstombs(a, b, c)    (strncpy(a, b, c), strlen(a))
+#define ct_mbstowcs(a, b, c)    (strncpy(a, b, c), strlen(a))
+
+#define Char			char
+#define Int			int
+#define FUN(prefix,rest)	prefix ## _ ## rest
+#define FUNW(type)		type
+#define TYPE(type)		type
+#define FSTR			"%s"
+#define STR(x) 			x
+#define UC(c)			(unsigned char)(c)
+
+#define Isalpha(x)  isalpha((unsigned char)x)
+#define Isalnum(x)  isalnum((unsigned char)x)
+#define Isgraph(x)  isgraph((unsigned char)x)
+#define Isspace(x)  isspace((unsigned char)x)
+#define Isdigit(x)  isdigit((unsigned char)x)
+#define Iscntrl(x)  iscntrl((unsigned char)x)
+#define Isprint(x)  isprint((unsigned char)x)
+
+#define Isupper(x)  isupper((unsigned char)x)
+#define Islower(x)  islower((unsigned char)x)
+#define Toupper(x)  toupper((unsigned char)x)
+#define Tolower(x)  tolower((unsigned char)x)
+
+#define IsASCII(x)  isascii((unsigned char)x)
+
+#define Strlen(x)       strlen(x)
+#define Strchr(s,c)     strchr(s,c)
+#define Strrchr(s,c)    strrchr(s,c)
+#define Strstr(s,v)     strstr(s,v)
+#define Strdup(x)       strdup(x)
+#define Strcpy(d,s)     strcpy(d,s)
+#define Strncpy(d,s,n)  strncpy(d,s,n)
+#define Strncat(d,s,n)  strncat(d,s,n)
+
+#define Strcmp(s,v)     strcmp(s,v)
+#define Strncmp(s,v,n)  strncmp(s,v,n)
+#define Strcspn(s,r)    strcspn(s,r)
+
+#define Strtol(p,e,b)   strtol(p,e,b)
+
+#define Width(c)	1
+
+#endif
+
+
+#ifdef WIDECHAR
+/*
+ * Conversion buffer
+ */
+typedef struct ct_buffer_t {
+        char    *cbuff;
+        size_t  csize;
+        Char *wbuff;
+        size_t  wsize;
+} ct_buffer_t;
+
+#define ct_encode_string __ct_encode_string
+/* Encode a wide character string and return the UTF-8 encoded result. */
+public char *ct_encode_string(const Char *, ct_buffer_t *);
+
+#define ct_decode_string __ct_decode_string
+/* Decode a (multi)?byte string and return the wide character string result. */
+public Char *ct_decode_string(const char *, ct_buffer_t *);
+
+/* Decode a (multi)?byte argv string array.
+ * The pointer returned must be free()d when done. */
+protected Char **ct_decode_argv(int, const char *[],  ct_buffer_t *);
+
+/* Resizes the conversion buffer(s) if needed. */
+protected void ct_conv_buff_resize(ct_buffer_t *, size_t, size_t);
+protected ssize_t ct_encode_char(char *, size_t, Char);
+protected size_t ct_enc_width(Char);
+
+#define ct_free_argv(s)	el_free(s)
+
+#else
+#define	ct_encode_string(s, b)	(s)
+#define ct_decode_string(s, b)	(s)
+#define ct_decode_argv(l, s, b)	(s)
+#define ct_conv_buff_resize(b, os, ns)
+#define ct_encode_char(d, l, s)	(*d = s, 1)
+#define ct_free_argv(s)
+#endif
+
+#ifndef NARROWCHAR
+/* Encode a characted into the destination buffer, provided there is sufficent
+ * buffer space available. Returns the number of bytes used up (zero if the
+ * character cannot be encoded, -1 if there was not enough space available). */
+
+/* The maximum buffer size to hold the most unwieldly visual representation,
+ * in this case \U+nnnnn. */
+#define VISUAL_WIDTH_MAX 8
+
+/* The terminal is thought of in terms of X columns by Y lines. In the cases
+ * where a wide character takes up more than one column, the adjacent 
+ * occupied column entries will contain this faux character. */
+#define MB_FILL_CHAR ((Char)-1)
+
+/* Visual width of character c, taking into account ^? , \0177 and \U+nnnnn
+ * style visual expansions. */
+protected int ct_visual_width(Char);
+
+/* Turn the given character into the appropriate visual format, matching
+ * the width given by ct_visual_width(). Returns the number of characters used
+ * up, or -1 if insufficient space. Buffer length is in count of Char's. */
+protected ssize_t ct_visual_char(Char *, size_t, Char);
+
+/* Convert the given string into visual format, using the ct_visual_char()
+ * function. Uses a static buffer, so not threadsafe. */
+protected const Char *ct_visual_string(const Char *);
+
+
+/* printable character, use ct_visual_width() to find out display width */
+#define CHTYPE_PRINT        ( 0)
+/* control character found inside the ASCII portion of the charset */
+#define CHTYPE_ASCIICTL     (-1)
+/* a \t */
+#define CHTYPE_TAB          (-2)
+/* a \n */
+#define CHTYPE_NL           (-3)
+/* non-printable character */
+#define CHTYPE_NONPRINT     (-4)
+/* classification of character c, as one of the above defines */
+protected int ct_chr_class(Char c);
+#endif
+
+
+#endif /* _chartype_f */

Modified: head/lib/libedit/edit/readline/Makefile
==============================================================================
--- vendor/NetBSD/libedit/dist/readline/Makefile	Mon Apr  4 16:24:05 2011	(r220330)
+++ head/lib/libedit/edit/readline/Makefile	Tue Apr  5 18:41:01 2011	(r220370)
@@ -1,13 +1,8 @@
-#	$NetBSD: Makefile,v 1.7 2003/08/03 09:23:15 lukem Exp $	
+# Copyright (c) 2011 David E O'Brien
+# $FreeBSD$
 
-NOOBJ=		# defined
+INCS=	readline.h history.h
 
-.include <bsd.own.mk>
+INCSDIR= ${INCLUDEDIR}/edit/readline
 
-.PATH:	${NETBSDSRCDIR}/lib/libedit
-
-INCS=		readline.h
-INCSDIR=	/usr/include/readline
-INCSYMLINKS=	readline.h ${INCSDIR}/history.h
-
-.include <bsd.prog.mk>
+.include <bsd.lib.mk>

Added: head/lib/libedit/edit/readline/history.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lib/libedit/edit/readline/history.h	Tue Apr  5 18:41:01 2011	(r220370)
@@ -0,0 +1,32 @@
+/*-
+ * Copyright (c) 2011 David E. O'Brien
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the author nor the names of contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include <edit/readline/readline.h>

Copied and modified: head/lib/libedit/histedit.h (from r220247, head/include/histedit.h)
==============================================================================
--- head/include/histedit.h	Fri Apr  1 14:13:49 2011	(r220247, copy source)
+++ head/lib/libedit/histedit.h	Tue Apr  5 18:41:01 2011	(r220370)
@@ -44,6 +44,9 @@
 #include <stdio.h>
 
 __BEGIN_DECLS
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /*
  * ==== Editing ====
@@ -87,7 +90,7 @@ void		 el_reset(EditLine *);
  */
 const char	*el_gets(EditLine *, int *);
 int		 el_getc(EditLine *, char *);
-void		 el_push(EditLine *, char *);
+void		 el_push(EditLine *, const char *);
 
 /*
  * Beep!
@@ -132,6 +135,10 @@ unsigned char	_el_fn_sh_complete(EditLin
 #define	EL_GETTC	17	/* , const char *, ..., NULL);	*/
 #define	EL_GETFP	18	/* , int, FILE **)		*/
 #define	EL_SETFP	19	/* , int, FILE *)		*/
+#define	EL_REFRESH	20	/* , void);			      set     */
+#define	EL_PROMPT_ESC	21	/* , prompt_func, Char);	      set/get */
+#define	EL_RPROMPT_ESC	22	/* , prompt_func, Char);	      set/get */
+#define	EL_RESIZE	23	/* , el_zfunc_t, void *);	      set     */
 
 #define	EL_BUILTIN_GETCFN	(NULL)
 
@@ -205,6 +212,9 @@ int		history(History *, HistEvent *, int
 #define	H_SETUNIQUE	20	/* , int);		*/
 #define	H_GETUNIQUE	21	/* , void);		*/
 #define	H_DEL		22	/* , int);		*/
+#define	H_NEXT_EVDATA	23	/* , const int, histdata_t *);	*/
+#define	H_DELDATA	24	/* , int, histdata_t *);*/
+#define	H_REPLACE	25	/* , const char *, histdata_t);	*/
 
 
 /*
@@ -225,5 +235,8 @@ int		 tok_str(Tokenizer *, const char *,
 		    int *, const char ***);
 
 __END_DECLS
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* _HISTEDIT_H_ */

Modified: head/lib/libedit/read.c
==============================================================================
--- head/lib/libedit/read.c	Tue Apr  5 18:40:19 2011	(r220369)
+++ head/lib/libedit/read.c	Tue Apr  5 18:41:01 2011	(r220370)
@@ -211,7 +211,7 @@ read_preread(EditLine *el)
  *	Push a macro
  */
 public void
-el_push(EditLine *el, char *str)
+el_push(EditLine *el, const char *str)
 {
 	c_macro_t *ma = &el->el_chared.c_macro;
 

Copied and modified: head/lib/libedit/readline.c (from r220331, vendor/NetBSD/libedit/dist/readline.c)
==============================================================================
--- vendor/NetBSD/libedit/dist/readline.c	Mon Apr  4 16:47:42 2011	(r220331, copy source)
+++ head/lib/libedit/readline.c	Tue Apr  5 18:41:01 2011	(r220370)
@@ -29,10 +29,9 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "config.h"
-#if !defined(lint) && !defined(SCCSID)
+#include <sys/cdefs.h>
 __RCSID("$NetBSD: readline.c,v 1.90 2010/08/04 20:29:18 christos Exp $");
-#endif /* not lint && not SCCSID */
+__FBSDID("$FreeBSD$");
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -47,12 +46,10 @@ __RCSID("$NetBSD: readline.c,v 1.90 2010
 #include <errno.h>
 #include <fcntl.h>
 #include <setjmp.h>
-#ifdef HAVE_VIS_H
 #include <vis.h>
-#else
-#include "np/vis.h"
-#endif
+#include "sys.h"
 #include "readline/readline.h"
+#include "chartype.h"
 #include "el.h"
 #include "fcns.h"		/* for EL_NUM_FCNS */
 #include "histedit.h"
@@ -1769,7 +1766,7 @@ rl_complete(int ignore __attribute__((__
 	    _rl_completion_append_character_function,
 	    (size_t)rl_completion_query_items,
 	    &rl_completion_type, &rl_attempted_completion_over,
-	    &rl_point, &rl_end);
+	    &rl_point, &rl_end, NULL, NULL, NULL);
 }
 
 

Modified: head/sbin/gvinum/Makefile
==============================================================================
--- head/sbin/gvinum/Makefile	Tue Apr  5 18:40:19 2011	(r220369)
+++ head/sbin/gvinum/Makefile	Tue Apr  5 18:41:01 2011	(r220370)
@@ -5,10 +5,10 @@ SRCS=	gvinum.c gvinum.h geom_vinum_share
 MAN=	gvinum.8
 
 WARNS?=	2
-CFLAGS+=	-I${.CURDIR}/../../sys
+CFLAGS=	-I${.CURDIR}/../../sys -I${DESTDIR}/${INCLUDEDIR}/edit
 
-DPADD=	${LIBREADLINE} ${LIBTERMCAP} ${LIBDEVSTAT} ${LIBKVM} ${LIBGEOM}
-LDADD=	-lreadline -ltermcap -ldevstat -lkvm -lgeom
+DPADD=	${LIBEDIT} ${LIBTERMCAP} ${LIBDEVSTAT} ${LIBKVM} ${LIBGEOM}
+LDADD=	-ledit -ltermcap -ldevstat -lkvm -lgeom
 
 .PATH: ${.CURDIR}/../../sys/geom/vinum
 

Modified: head/sbin/gvinum/gvinum.c
==============================================================================
--- head/sbin/gvinum/gvinum.c	Tue Apr  5 18:40:19 2011	(r220369)
+++ head/sbin/gvinum/gvinum.c	Tue Apr  5 18:41:01 2011	(r220370)
@@ -50,6 +50,7 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 #include <paths.h>
 #include <readline/readline.h>
 #include <readline/history.h>

Modified: head/usr.sbin/ntp/ntpdc/Makefile
==============================================================================
--- head/usr.sbin/ntp/ntpdc/Makefile	Tue Apr  5 18:40:19 2011	(r220369)
+++ head/usr.sbin/ntp/ntpdc/Makefile	Tue Apr  5 18:41:01 2011	(r220370)
@@ -15,16 +15,14 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/n
 DPADD=	${LIBNTP} ${LIBM} ${LIBMD} ${LIBOPTS}
 LDADD=	${LIBNTP} -lm -lmd ${LIBOPTS}
 
-.if ${MK_GNU_SUPPORT} != "no"
-DPADD+=		${LIBREADLINE} ${LIBTERMCAP}
-LDADD+=		-lreadline -ltermcap
-CFLAGS+=	-DHAVE_LIBREADLINE -DHAVE_READLINE_HISTORY_H \
-		-DHAVE_READLINE_READLINE_H
-.endif
+DPADD+=		${LIBEDIT} ${LIBTERMCAP}
+LDADD+=		-ledit -ltermcap
+CFLAGS+=	-DHAVE_LIBEDIT -DHAVE_READLINE_READLINE_H \
+		-I${DESTDIR}/${INCLUDEDIR}/edit
 
 CLEANFILES+= .version version.c
 
-version.c: 
+version.c:
 	sh -e ${.CURDIR}/../scripts/mkver ntpdc
 
 afterinstall:

Modified: head/usr.sbin/ntp/ntpq/Makefile
==============================================================================
--- head/usr.sbin/ntp/ntpq/Makefile	Tue Apr  5 18:40:19 2011	(r220369)
+++ head/usr.sbin/ntp/ntpq/Makefile	Tue Apr  5 18:41:01 2011	(r220370)
@@ -17,16 +17,14 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/n
 DPADD=	${LIBNTP} ${LIBM} ${LIBMD} ${LIBOPTS}
 LDADD=	${LIBNTP} -lm -lmd ${LIBOPTS}
 
-.if ${MK_GNU_SUPPORT} != "no"
-DPADD+=		${LIBREADLINE} ${LIBTERMCAP}
-LDADD+=		-lreadline -ltermcap
-CFLAGS+=	-DHAVE_LIBREADLINE -DHAVE_READLINE_HISTORY_H \
-		-DHAVE_READLINE_READLINE_H
-.endif
+DPADD+=		${LIBEDIT} ${LIBTERMCAP}
+LDADD+=		-ledit -ltermcap
+CFLAGS+=	-DHAVE_LIBEDIT -DHAVE_READLINE_READLINE_H \
+		-I${DESTDIR}/${INCLUDEDIR}/edit
 
 CLEANFILES+= .version version.c
 
-version.c: 
+version.c:
 	sh -e ${.CURDIR}/../scripts/mkver ntpq
 
 .include <bsd.prog.mk>

Modified: head/usr.sbin/wpa/wpa_cli/Makefile
==============================================================================
--- head/usr.sbin/wpa/wpa_cli/Makefile	Tue Apr  5 18:40:19 2011	(r220369)
+++ head/usr.sbin/wpa/wpa_cli/Makefile	Tue Apr  5 18:41:01 2011	(r220370)
@@ -14,8 +14,8 @@ CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX
 # enable use of d_type to identify unix domain sockets
 CFLAGS+= -D_DIRENT_HAVE_D_TYPE
 
-#CFLAGS+= -DCONFIG_READLINE
-#LDADD+= -ledit -ltermcap
-#DPADD+= ${LIBEDIT} ${LIBTERMCAP}
+CFLAGS+= -DCONFIG_READLINE -I${DESTDIR}/${INCLUDEDIR}/edit
+LDADD+= -ledit -ltermcap
+DPADD+= ${LIBEDIT} ${LIBTERMCAP}
 
 .include <bsd.prog.mk>


More information about the svn-src-all mailing list