Subject: Re: ld --as-needed broken ?
To: Patrick Welche <prlw1@newn.cam.ac.uk>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: tech-toolchain
Date: 05/18/2005 20:21:21
--W/nzBZO5zC0uMSeA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Mon, May 16, 2005 at 05:00:28PM +0100, Patrick Welche wrote:
> On Mon, May 16, 2005 at 04:51:35PM +0100, Patrick Welche wrote:
> > Re adding a libedit -> libtermcap dependency and publishing the
> > completion_matches function, I missed the .WAIT magic in the Makefile
> > above - I also think the .WAIT before libpam and libssh are superfluous...
> > So the complete patch should now be attached.
> 
> .. and of course now that I try a build.sh release, 
> 
> In file included from /usr/src/lib/libedit/readline.c:68:
> /usr/src/lib/libedit/filecomplete.h:51: error: redefinition of `CPFunction'
> /usr/src/lib/libedit/readline/readline.h:48: error: `CPFunction' previously declared here
> 
> 
> .. I can't just declare CPFunction in filecomplete.h...

This does the trick (make release, make build, and gmake psql all successful
- anyone care to commit?)

Would it be better to only make completion_matches visible in readline.c ?

Cheers,

Patrick

--W/nzBZO5zC0uMSeA
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=editpat

Index: Makefile
===================================================================
RCS file: /cvsroot/src/lib/Makefile,v
retrieving revision 1.95
diff -u -r1.95 Makefile
--- Makefile	20 Feb 2005 00:52:02 -0000	1.95
+++ Makefile	18 May 2005 19:18:02 -0000
@@ -4,7 +4,7 @@
 .include <bsd.own.mk>
 
 SUBDIR=	csu libc .WAIT libarch libbsdmalloc libbz2 libcompat libcrypt \
-	libcurses libedit libevent libform libintl libkvm libl libm libmagic \
+	libcurses libevent libform libintl libkvm libl libm libmagic \
 	libmenu libossaudio libpcap libpci libpmc libposix libpthread \
 	libpthread_dbg libradius libresolv librmt librpcsvc librt libterm \
 	libusbhid libutil libwrap liby libz
@@ -58,7 +58,7 @@
 # (and those that depend upon these [and ...])
 #
 SUBDIR+=	.WAIT
-SUBDIR+=	libcdk 
+SUBDIR+=	libcdk libedit
 .if (${MKCRYPTO} != "no")
 SUBDIR+=	libssl
 .endif
@@ -70,11 +70,11 @@
 .endif
 
 .if (${MKCRYPTO} != "no")
-SUBDIR+=	.WAIT libssh
+SUBDIR+=	libssh
 .endif
 
 .if (${MKPAM} != "no")
-SUBDIR+=	.WAIT libpam
+SUBDIR+=	libpam
 .endif
 
 .include <bsd.subdir.mk>
Index: libedit/Makefile
===================================================================
RCS file: /cvsroot/src/lib/libedit/Makefile,v
retrieving revision 1.31
diff -u -r1.31 Makefile
--- libedit/Makefile	7 May 2005 16:22:59 -0000	1.31
+++ libedit/Makefile	18 May 2005 19:18:06 -0000
@@ -6,6 +6,8 @@
 WARNS=	3
 LIB=	edit
 
+LIBDPLIBS=	termcap	${.CURDIR}/../libterm
+
 OSRCS=	chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c hist.c \
 	key.c map.c \
 	parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c
Index: libedit/filecomplete.c
===================================================================
RCS file: /cvsroot/src/lib/libedit/filecomplete.c,v
retrieving revision 1.4
diff -u -r1.4 filecomplete.c
--- libedit/filecomplete.c	12 May 2005 15:48:40 -0000	1.4
+++ libedit/filecomplete.c	18 May 2005 19:18:06 -0000
@@ -261,7 +261,7 @@
 /*
  * returns list of completions for text given
  */
-static char **
+char **
 completion_matches(const char *text, char *(*genfunc)(const char *, int))
 {
 	char **match_list = NULL, *retstr, *prevstr;
Index: libedit/filecomplete.h
===================================================================
RCS file: /cvsroot/src/lib/libedit/filecomplete.h,v
retrieving revision 1.2
diff -u -r1.2 filecomplete.h
--- libedit/filecomplete.h	7 May 2005 16:28:32 -0000	1.2
+++ libedit/filecomplete.h	18 May 2005 19:18:06 -0000
@@ -47,5 +47,10 @@
 void fn_display_match_list(EditLine *, char **, int, int);
 char *tilde_expand(char *txt);
 char *filename_completion_function(const char *, int);
+/* from/for readline */
+/* typedef char *CPFunction(const char *, int);
+char **completion_matches(const char *, CPFunction *);
+*/
+char **completion_matches(const char *, char *(*genfunc)(const char *, int));
 
 #endif

--W/nzBZO5zC0uMSeA--