cURL / Mailing Lists / curl-users / Single Mail

curl-users

Building cURL passing the -R option to linker

From: John Goebel <jgoebel_at_forrestsmusic.com>
Date: Mon, 03 Nov 2014 11:43:06 -0800

On Ubuntu 10.04 (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)) passing
the -R option using LDFLAGS works.
CPPFLAGS="-I/opt/openssl/include" LDFLAGS="-L/opt/openssl/lib"
LDFLAGS="-R/opt/openssl/lib" ./configure --with-ssl=/opt/openssl
--prefix=/opt/curl
gcc 4.4.3 reported "unrecognized option '-R/opt/openssl/lib'" but continued.

On Ubuntu 12.04 (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5))
configure failed with error "configure: error: C compiler cannot create
executables".
gcc 4.6.3 reported "gcc: error: unrecognized option '-R'" and then
terminated. configure failed with " C compiler cannot create executables".

The solution is to not pass 'LDFLAGS="-R/opt/openssl/lib"', replace it
with '-Xlinker -rpath=/opt/openssl/lib"'.
CPPFLAGS="-I/opt/openssl/include" LDFLAGS="-L/opt/openssl/lib -Xlinker
-rpath=/opt/openssl/lib" ./configure --with-ssl=/opt/openssl
--prefix=/opt/curl

I don't know if this is an Ubuntu oddity, or if there is a better
solution. In any even it worked for me, and perhaps should be added to
the INSTALL file.

John Goebel
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-11-03