Subject: Re: ld --as-needed broken ?
To: Luke Mewburn <lukem@NetBSD.org>
From: Patrick Welche <prlw1@newn.cam.ac.uk>
List: tech-toolchain
Date: 05/13/2005 16:10:54
--n8g4imXOkfNTN/H1
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Fri, May 13, 2005 at 02:58:23PM +1000, Luke Mewburn wrote:
> On Fri, May 13, 2005 at 12:10:58AM -0400, Todd Vierling wrote:
>   | In essence, though, I *would* like to see inter-.so dependencies in
>   | src/lib/, because it's TRT to do.
> 
> We already do this for some shared libraries, and have done so for a while:
> 
> 	> uname -sr
> 	NetBSD 3.0_BETA
> 
> 	> ldd /usr/lib/libkrb5.so
> 	/usr/lib/libkrb5.so:
> 		-lcrypt.0 => /lib/libcrypt.so.0
> 		-lcrypto.2 => /usr/lib/libcrypto.so.2
> 		-lasn1.6 => /usr/lib/libasn1.so.6
> 		-lcom_err.4 => /usr/lib/libcom_err.so.4
> 		-lroken.12 => /usr/lib/libroken.so.12
> 
> Take a look at the LIBDPLIBS support in <bsd.lib.mk>

Excellent! The following make psql compile. I am a bit surprised about
the completion_matches part: it is declared in readline/readline.h, yet
static in filecomplete.c - so once someone who knows about these things
casts an eye over it, could the following patch go in?

Cheers,

Patrick

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

Index: Makefile
===================================================================
RCS file: /cvsroot/src/lib/libedit/Makefile,v
retrieving revision 1.31
diff -u -r1.31 Makefile
--- Makefile	7 May 2005 16:22:59 -0000	1.31
+++ Makefile	13 May 2005 15:04:23 -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: filecomplete.c
===================================================================
RCS file: /cvsroot/src/lib/libedit/filecomplete.c,v
retrieving revision 1.4
diff -u -r1.4 filecomplete.c
--- filecomplete.c	12 May 2005 15:48:40 -0000	1.4
+++ filecomplete.c	13 May 2005 15:04:23 -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: filecomplete.h
===================================================================
RCS file: /cvsroot/src/lib/libedit/filecomplete.h,v
retrieving revision 1.2
diff -u -r1.2 filecomplete.h
--- filecomplete.h	7 May 2005 16:28:32 -0000	1.2
+++ filecomplete.h	13 May 2005 15:04:23 -0000
@@ -47,5 +47,8 @@
 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 *);
 
 #endif

--n8g4imXOkfNTN/H1--