[darcs-devel] Re: darcs patch: Include autoconf-detected libs in LDFLAGS

Wim Lewis wiml at hhhh.org
Fri Jul 29 10:59:47 PDT 2005


On Fri, Jul 29, 2005 at 08:05:53AM -0400, David Roundy wrote:
> On Wed, Jul 27, 2005 at 08:34:40PM -0700, Joshua J. Berry wrote:
> > I noticed when trying to build Darcs with git support (just to play
> > around), the linker was reporting that it couldn't find the SHA1
> > functions (even though ./configure correctly detected them in -lcrypto).
> > After poking at your Makefiles for a bit, I came up with the following
> > patch.
> 
> This patch looks all right to me, but I'm a bit hesitant to stick such a
> large change directly into darcs-stable, especially since the only compile
> error I've seen had to do with git support (which isn't yet high
> priority).

I think it's a safe change --- as Josh points out, this is what autoconf
expects the makefile to be doing anyway. I've had a similar change in
my repo for a couple of days now but haven't recorded it.

On my system, -lcrypto is already pulled in by curl (since curl was
compiled with SSL support), but I think that if libcurl were SSL-free
or if I disabled libcurl, then this fix would be needed to get darcs
to compile.

> > I did notice the patch has the relatively-harmless side effect of
> > including some libraries twice.  On the other hand, modern linkers are
> > smart enough to only take what you need anyway, so I don't think it will
> > be an issue.

AFAIK it's always been safe to have duplicate -lfoo options. In some
cases with statically linked libraries it's even necessary. Though I
assume that there's some system somewhere which can't handle it...





More information about the darcs-devel mailing list