cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Building the static libcurl and $LIBS

From: Mason <mpeg.blue_at_free.fr>
Date: Fri, 09 Mar 2012 11:15:43 +0100

Dan Fandrich wrote:

> Mason wrote:
>
>> I'm trying to build the static libcurl.
>>
>> In the configure script, I asked the linker to add the
>> network stack library (where all the network related
>> functions live) with
>>
>> ./configure LIBS="lwip_files/lwip.a" ...
>>
>> But when I try to build the library, it looks like the
>> system is trying to cram lwip.a into libcurl.a ?
>
> Are you sure? What are the commands libtool is running for this? I don't
> think anything is ever linked into libcurl.a from another library, ever.

Running make produced the following output.

[ Note the first few arguments to sh4ar:
sh4ar cru .libs/libcurl.a lwip_files/lwip.a .libs/libcurl.lax/lt1-lwip.a
where lt1-lwip.a is a copy of lwip.a ]

*** Warning: Trying to link with static lib archive lwip_files/lwip.a.
*** I have the capability to make that library automatically link in when
*** you link to this library. But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because the file extensions .a of this argument makes me believe
*** that it is just a static archive that I should not use here.
copying selected object files to avoid basename conflicts...
libtool: link: ln lwip_files/lwip.a .libs/libcurl.lax/lt1-lwip.a || cp lwip_files/lwip.a .libs/libcurl.lax/lt1-lwip.a
libtool: link: sh4ar cru .libs/libcurl.a lwip_files/lwip.a .libs/libcurl.lax/lt1-lwip.a file.o timeval.o base64.o hostip.o progress.o formdata.o cookie.o http.o sendf.o ftp.o url.o dict.o if2ip.o speedcheck.o ldap.o ssluse.o version.o getenv.o escape.o mprintf.o telnet.o netrc.o getinfo.o transfer.o strequal.o easy.o security.o krb4.o curl_fnmatch.o fileinfo.o ftplistparser.o wildcard.o krb5.o memdebug.o http_chunks.o strtok.o connect.o llist.o hash.o multi.o content_encoding.o share.o http_digest.o md4.o md5.o curl_rand.o http_negotiate.o inet_pton.o strtoofft.o strerror.o hostasyn.o hostip4.o hostip6.o hostsyn.o inet_ntop.o parsedate.o select.o gtls.o sslgen.o tftp.o splay.o strdup.o socks.o ssh.o nss.o qssl.o rawstr.o curl_addrinfo.o socks_gssapi.o socks_sspi.o curl_sspi.o slist.o nonblock.o curl_memrchr.o imap.o pop3.o smtp.o pingpong.o rtsp.o curl_threads.o warnless.o hmac.o polarssl.o curl_rtmp.o openldap.o curl_gethostname.o gopher.o axtls.o idn_win32.o http_negotiate_
 sspi.o
cyassl.o http_proxy.o non-ascii.o asyn-ares.o asyn-thread.o curl_gssapi.o curl_ntlm.o curl_ntlm_wb.o curl_ntlm_core.o curl_ntlm_msgs.o
libtool: link: sh-superh-elf-ranlib .libs/libcurl.a
libtool: link: rm -fr .libs/libcurl.lax
libtool: link: ( cd ".libs" && rm -f "libcurl.la" && ln -s "../libcurl.la" "libcurl.la" )

And if I run sh4nm on the resulting libcurl.a, then it complains:
lwip.a: File format not recognized
lt1-lwip.a: File format not recognized

Since lt1-lwip.a is a copy of lwip.a, it looks like the build system
is, in fact, trying to include the library twice?

>> How do I get configure to use the appropriate library
>> when running the link tests, but the actual build should
>> ignore whatever LIBS I provided to configure?
>
> You could try adding "-Llwip_files -llwip" to LDFLAGS instead.

Good idea. Will try ASAP.

-- 
Regards.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-03-09