On 8 February 2012 21:30, Daniel Stenberg <[email protected]> wrote: > Hi friends, > > I found this patch of curl's configure.ac in the Yocto project: > > http://git.yoctoproject.org/**cgit/cgit.cgi/poky/tree/meta/** > recipes-support/curl/c<http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-support/curl/c> > url/noldlibpath.patch > > While being quite hard-coded, it does have a point in that we should not > touch LD_LIBRARY_PATH when cross-compiling. Any taker on fixing it properly? > > -- > > / daniel.haxx.se >
Couldn't something as simple as what I have attached achieve the same. Note I am not a make system expert and this was done very quickly as a proof on concept, while I have tested this building natively and it seems to be fine I have not done any cross compiling yet. I will try and test this on an arm cross compile tonight(unless anyone beats me to it) and check. Comments on if this approach will/won't work or if it could be modified would be appreciated, and if it is completely wrong please tell me, I won't take it personally :-) Cheers, Rob -- ------------------------------ Rob Ward www.rob-ward.co.uk
From a3dad125dccbe2bf068b388b104eb477aa024f34 Mon Sep 17 00:00:00 2001 From: Rob Ward <[email protected]> Date: Thu, 9 Feb 2012 14:45:22 +0000 Subject: [PATCH] Improve crosscompile support Implements a method of preventing LD_LIBRARY_PATH from being changed when cross compiling --- configure.ac | 55 ++++++++++++++++++++++++++++++------------------------- 1 files changed, 30 insertions(+), 25 deletions(-) diff --git a/configure.ac b/configure.ac index 8920280..7f74dca 100644 --- a/configure.ac +++ b/configure.ac @@ -1548,10 +1548,11 @@ if test X"$OPT_SSL" != Xno; then dnl when the ssl shared libs were found in a path that the run-time dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH dnl to prevent further configure tests to fail due to this - - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH]) + if test "x$cross_compiling" != "xyes"; then + LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL" + export LD_LIBRARY_PATH + AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH]) + fi fi CURL_CHECK_OPENSSL_API fi @@ -1787,10 +1788,11 @@ if test "$OPENSSL_ENABLED" != "1"; then dnl linker doesn't search through, we need to add it to dnl LD_LIBRARY_PATH to prevent further configure tests to fail dnl due to this - - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH]) + if test "x$cross_compiling" != "xyes"; then + LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib" + export LD_LIBRARY_PATH + AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH]) + fi fi fi @@ -1913,12 +1915,12 @@ if test "$OPENSSL_ENABLED" != "1"; then dnl linker doesn't search through, we need to add it to dnl LD_LIBRARY_PATH to prevent further configure tests to fail dnl due to this - - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH]) + if test "x$cross_compiling" != "xyes"; then + LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib" + export LD_LIBRARY_PATH + AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH]) + fi fi - fi fi dnl PolarSSL not disabled @@ -2002,10 +2004,11 @@ if test "$OPENSSL_ENABLED" != "1"; then dnl linker doesn't search through, we need to add it to dnl LD_LIBRARY_PATH to prevent further configure tests to fail dnl due to this - - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$cyassllib" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $cyassllib to LD_LIBRARY_PATH]) + if test "x$cross_compiling" != "xyes"; then + LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$cyassllib" + export LD_LIBRARY_PATH + AC_MSG_NOTICE([Added $cyassllib to LD_LIBRARY_PATH]) + fi fi fi @@ -2098,10 +2101,11 @@ if test "$OPENSSL_ENABLED" != "1" -a "$GNUTLS_ENABLED" != "1"; then dnl linker doesn't search through, we need to add it to dnl LD_LIBRARY_PATH to prevent further configure tests to fail dnl due to this - - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH]) + if test "x$cross_compiling" != "xyes"; then + LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff" + export LD_LIBRARY_PATH + AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH]) + fi fi fi @@ -2258,10 +2262,11 @@ if test X"$OPT_LIBSSH2" != Xno; then dnl libssh2_session_handshake was added in 1.2.8 AC_CHECK_FUNCS( libssh2_version libssh2_init libssh2_exit \ libssh2_scp_send64 libssh2_session_handshake) - - LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2" - export LD_LIBRARY_PATH - AC_MSG_NOTICE([Added $DIR_SSH2 to LD_LIBRARY_PATH]) + if test "x$cross_compiling" != "xyes"; then + LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2" + export LD_LIBRARY_PATH + AC_MSG_NOTICE([Added $DIR_SSH2 to LD_LIBRARY_PATH]) + fi fi else dnl no libssh2, revert back to clean variables -- 1.7.1
------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
