All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Libcurl : to depend or not to depend ?
@ 2012-03-21 15:06 Sagaert Johan
  2012-03-21 15:20 ` Thomas Petazzoni
  0 siblings, 1 reply; 6+ messages in thread
From: Sagaert Johan @ 2012-03-21 15:06 UTC (permalink / raw)
  To: buildroot

 
Hi
 
After my issue last week with libcurl it seems that libcurl uses openssl if it has been found. (if it was build before libcurl)
If its not found then libcurl simply has no SSL support.
So libcurl is'nt really dependend of openssl.
It may be better i think to have an option in the config to enable/disable ssl for libcurl.
In case ssl is enabled then libcurl should be made dependend of openssl.
 

Sagaert Johan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] Libcurl : to depend or not to depend ?
  2012-03-21 15:06 [Buildroot] Libcurl : to depend or not to depend ? Sagaert Johan
@ 2012-03-21 15:20 ` Thomas Petazzoni
  2012-03-21 16:50   ` Sagaert Johan
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2012-03-21 15:20 UTC (permalink / raw)
  To: buildroot

Hello,

Le Wed, 21 Mar 2012 16:06:52 +0100,
"Sagaert Johan" <sagaert.johan@skynet.be> a ?crit :

> After my issue last week with libcurl it seems that libcurl uses openssl if it has been found. (if it was build before libcurl)
> If its not found then libcurl simply has no SSL support.
> So libcurl is'nt really dependend of openssl.
> It may be better i think to have an option in the config to enable/disable ssl for libcurl.
> In case ssl is enabled then libcurl should be made dependend of openssl.

libcurl already has the following code:

ifeq ($(BR2_PACKAGE_OPENSSL),y)
LIBCURL_DEPENDENCIES += openssl
LIBCURL_CONF_ENV += ac_cv_lib_crypto_CRYPTO_lock=yes
# configure adds the cross openssl dir to LD_LIBRARY_PATH which screws up
# native stuff during the rest of configure when target == host.
# Fix it by setting LD_LIBRARY_PATH to something sensible so those libs
# are found first.
LIBCURL_CONF_ENV += LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/lib:/usr/lib
LIBCURL_CONF_OPT += --with-ssl=$(STAGING_DIR)/usr --with-random=/dev/urandom
else
LIBCURL_CONF_OPT += --without-ssl
endif

Which means that:

 * If the OpenSSL package is selected, then we guarantee that it is
   build *before* libcurl, and libcurl is built with OpenSSL support.

 * If the OpenSSL package is not selected, then we force libcurl to be
   compiled without SSL support

It doesn't work for you?

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] Libcurl : to depend or not to depend ?
  2012-03-21 15:20 ` Thomas Petazzoni
@ 2012-03-21 16:50   ` Sagaert Johan
  2012-03-21 17:05     ` Thomas Petazzoni
  2012-03-21 22:00     ` Peter Korsgaard
  0 siblings, 2 replies; 6+ messages in thread
From: Sagaert Johan @ 2012-03-21 16:50 UTC (permalink / raw)
  To: buildroot

 
Thomas

I know what to do, but in case you need openssl and you also want libcurl BUT without SSL there is no way to build it like it is
now.

The trick i use now to build libcurl without ssl is 
	disabling openssl
	build (libcurl gets build without SSL)
	enable openssl
	build (libcurl does'nt change and i also have openssl now.)


-----Oorspronkelijk bericht-----
Van: Thomas Petazzoni [mailto:thomas.petazzoni at free-electrons.com] 
Verzonden: woensdag 21 maart 2012 16:20
Aan: Sagaert Johan
CC: buildroot at busybox.net
Onderwerp: Re: [Buildroot] Libcurl : to depend or not to depend ?

Hello,

Le Wed, 21 Mar 2012 16:06:52 +0100,
"Sagaert Johan" <sagaert.johan@skynet.be> a ?crit :

> After my issue last week with libcurl it seems that libcurl uses 
> openssl if it has been found. (if it was build before libcurl) If its not found then libcurl simply has no SSL support.
> So libcurl is'nt really dependend of openssl.
> It may be better i think to have an option in the config to enable/disable ssl for libcurl.
> In case ssl is enabled then libcurl should be made dependend of openssl.

libcurl already has the following code:

ifeq ($(BR2_PACKAGE_OPENSSL),y)
LIBCURL_DEPENDENCIES += openssl
LIBCURL_CONF_ENV += ac_cv_lib_crypto_CRYPTO_lock=yes # configure adds the cross openssl dir to LD_LIBRARY_PATH which screws up #
native stuff during the rest of configure when target == host.
# Fix it by setting LD_LIBRARY_PATH to something sensible so those libs # are found first.
LIBCURL_CONF_ENV += LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:/lib:/usr/lib
LIBCURL_CONF_OPT += --with-ssl=$(STAGING_DIR)/usr --with-random=/dev/urandom else LIBCURL_CONF_OPT += --without-ssl endif

Which means that:

 * If the OpenSSL package is selected, then we guarantee that it is
   build *before* libcurl, and libcurl is built with OpenSSL support.

 * If the OpenSSL package is not selected, then we force libcurl to be
   compiled without SSL support

It doesn't work for you?

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] Libcurl : to depend or not to depend ?
  2012-03-21 16:50   ` Sagaert Johan
@ 2012-03-21 17:05     ` Thomas Petazzoni
  2012-03-21 22:00     ` Peter Korsgaard
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2012-03-21 17:05 UTC (permalink / raw)
  To: buildroot

Hello,

Le Wed, 21 Mar 2012 17:50:26 +0100,
"Sagaert Johan" <sagaert.johan@skynet.be> a ?crit :

> I know what to do, but in case you need openssl and you also want libcurl BUT without SSL there is no way to build it like it is
> now.

Correct. Presumably, the size impact of OpenSSL support in libcurl is
pretty small (OpenSSL itself is huge, but the OpenSSL support in
libcurl is most likely relatively small), so it is generally not
necessary.

We might of course add a libcurl suboption to make this configurable,
but for most packages, the OpenSSL support is automatically enabled if
OpenSSL is present.

> The trick i use now to build libcurl without ssl is 
> 	disabling openssl
> 	build (libcurl gets build without SSL)
> 	enable openssl
> 	build (libcurl does'nt change and i also have openssl now.)

Or just modify libcurl.mk so that it always passes --without-ssl
regardless of whether OpenSSL is selected or not. I think it's much
easier.

I don't think Buildroot can really adapt to each and every situation
(and still be maintainable), and some special situations require direct
modifications of the .mk file. For example, not later than today, I had
to:

 * Change openssl.mk because I wanted to build only the static version
   (OpenSSL in my case was used only by one application, and linking
   OpenSSL statically against this application allowed some space
   savings)

 * Change avahi.mk to build the Avahi libraries statically, for the
   same reasons (only used by Avahi programs themselves, so it allows
   some space savings)

I just maintain those project-specific tweaks in a Git branch. They are
simple, so when I need to upgrade Buildroot they are not a big issue.

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] Libcurl : to depend or not to depend ?
  2012-03-21 16:50   ` Sagaert Johan
  2012-03-21 17:05     ` Thomas Petazzoni
@ 2012-03-21 22:00     ` Peter Korsgaard
  2012-03-21 22:30       ` Thomas Petazzoni
  1 sibling, 1 reply; 6+ messages in thread
From: Peter Korsgaard @ 2012-03-21 22:00 UTC (permalink / raw)
  To: buildroot

>>>>> "Sagaert" == Sagaert Johan <sagaert.johan@skynet.be> writes:

 Sagaert> Thomas

 Sagaert> I know what to do, but in case you need openssl and you also
 Sagaert> want libcurl BUT without SSL there is no way to build it like
 Sagaert> it is now.

What is the use case for wanting openssl and no ssl support in libcurl?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Buildroot] Libcurl : to depend or not to depend ?
  2012-03-21 22:00     ` Peter Korsgaard
@ 2012-03-21 22:30       ` Thomas Petazzoni
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2012-03-21 22:30 UTC (permalink / raw)
  To: buildroot

Le Wed, 21 Mar 2012 23:00:01 +0100,
Peter Korsgaard <jacmet@uclibc.org> a ?crit :

>  Sagaert> I know what to do, but in case you need openssl and you also
>  Sagaert> want libcurl BUT without SSL there is no way to build it like
>  Sagaert> it is now.
> 
> What is the use case for wanting openssl and no ssl support in libcurl?

Well, you might want OpenSSL for say the web server on the device, but
you don't necessarily need SSL support in the curl you're using on your
device to do some misc HTTP downloads.

But again, I think the size impact of the SSL support in curl is most
likely very limited, so it's probably not very useful to make this
configurable.

Regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-03-21 22:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-21 15:06 [Buildroot] Libcurl : to depend or not to depend ? Sagaert Johan
2012-03-21 15:20 ` Thomas Petazzoni
2012-03-21 16:50   ` Sagaert Johan
2012-03-21 17:05     ` Thomas Petazzoni
2012-03-21 22:00     ` Peter Korsgaard
2012-03-21 22:30       ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.