[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] Can't build wget with GnuTLS on Mac OS X

From: Tim Rühsen
Subject: Re: [Bug-wget] Can't build wget with GnuTLS on Mac OS X
Date: Sun, 06 Dec 2015 11:59:13 +0100
User-agent: KMail/4.14.10 (Linux/4.2.0-1-amd64; KDE/4.14.13; x86_64; ; )

Am Sonntag, 6. Dezember 2015, 12:48:45 schrieb 桃源老師:
> Hello, Tim-san,
> > 2015/12/06 7:47 A.M. Tim Rühsen <address@hidden> wrote:
> > 
> > Am Sonntag, 6. Dezember 2015, 01:29:17 schrieb 桃源老師:
> >> my configure statement:
> >> $ export TARGET ="/Volumes/ffmpeg_compile"
> >> $ LDFLAGS=-L${TARGET}/lib LIBS=-lgmp  ./configure --prefix=${TAREGT}
> > 
> > Is this correct ?
> > --prefix=${TAREGT}
> > 
> > Maybe TARGET ?
> Sorry it's my typo error...
> > "_wrap_nettle_pk_generate_params in libgnutls.a(pk.o)"
> > You statically link  GnuTLS ? Try it dynamically, else you need libnettle
> > linked *after* libgnutls.
> Well, now I can build wget with dynamically linked GnuTLS.
> But if I can, I'd like to have a statically linked one.  You mentioned that
> "need libnettle linked after libgnutls", but I don't know how should I.
> Could you please provide the way to build statically linked binary of wget?

IMO, it's a bad idea... (and I have not much experience with that), please 
read http://www.akkadia.org/drepper/no_static_linking.html and reconsider 
before reading on.

If wget links dynamically, you can 'ldd wget' to see all the libraries need 
for static linking. You have to figure out the order on the command line 
yourself. Gcc option -static is helpful (tells the linker to use static .a 
libraries instead of dynamic .so - if static ones are available).

Just modify/extend your original command line:
gcc  -I/Volumes/ffmpeg_compile/include -DHAVE_LIBGNUTLS -
I/Volumes/ffmpeg_compile/include -DNDEBUG   -L/Volumes/ffmpeg_compile/lib -o 
wget connect.o convert.o cookies.o ftp.o css_.o css-url.o ftp-basic.o ftp-ls.o 
hash.o host.o hsts.o html-parse.o html-url.o http.o init.o log.o main.o 
netrc.o progress.o ptimer.o recur.o res.o retr.o spider.o url.o warc.o utils.o 
exits.o build_info.o   version.o ftp-opie.o gnutls.o http-ntlm.o 
../lib/libgnu.a /Volumes/ffmpeg_compile/lib/libiconv.a  -lnettle -
L/Volumes/ffmpeg_compile/lib -lgnutls -L/Volumes/ffmpeg_compile/lib -lz -lgmp

gnutls is using nettle functions, so here the order is wrong. Link nettle 
after gnutls, followed by gmp. 

Be warned that your executable might be huge after linking.

Also, it might be that you need a different C standard library for static 
linking, just search the net for detailed infos.


Attachment: signature.asc
Description: This is a digitally signed message part.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]