Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] tcl: add support for static builds
@ 2015-03-06 22:30 Vicente Olivert Riera
  2015-03-06 22:30 ` [Buildroot] [PATCH 2/2] tcl: rename BR2_PACKAGE_TCL_SHLIB_ONLY to be more consistent Vicente Olivert Riera
  2015-03-07 10:11 ` [Buildroot] [PATCH 1/2] tcl: add support for static builds Thomas Petazzoni
  0 siblings, 2 replies; 6+ messages in thread
From: Vicente Olivert Riera @ 2015-03-06 22:30 UTC (permalink / raw)
  To: buildroot

tcl fails to build statically for two reasons. The first one is because
it tries to build the tclsh binary with dynamic loading support, which
uses dlopen() and friends. This is because the '--enable-load' configure
option is 'on' by default. The second one is because it builds the
'packages' by default. These 'packages' are shared objects which are
intended to be loaded dynamically.

In order to fix this, we add '--disable-load' to the configure options
and avoid building the 'packages' when BR2_STATIC_LIBS is set.

Related upstream mailing list thread:

  http://sourceforge.net/p/tcl/mailman/message/33388034/

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
 package/tcl/tcl.mk |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/package/tcl/tcl.mk b/package/tcl/tcl.mk
index 1ebba1e..ad76e9b 100644
--- a/package/tcl/tcl.mk
+++ b/package/tcl/tcl.mk
@@ -29,6 +29,21 @@ HOST_TCL_CONF_OPTS = \
 	--disable-langinfo \
 	--disable-framework
 
+ifeq ($(BR2_STATIC_LIBS),y)
+# Do not build tclsh with dynamic loading support when building it
+# statically because it needs dlopen() and friends.
+TCL_CONF_OPTS += --disable-load
+HOST_TCL_CONF_OPTS += --disable-load
+# Also, build only the binaries and libraries and don't build the
+# 'packages' because they are shared objects which are intended to be
+# loaded dynamically.
+TCL_MAKE_OPTS = binaries libraries
+HOST_TCL_MAKE_OPTS = binaries libraries
+TCL_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) install-binaries install-libraries
+TCL_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) install-binaries
+HOST_TCL_INSTALL_OPTS = DESTDIR=$(STAGING_DIR) install-binaries install-libraries
+endif
+
 # I haven't found a good way to force pkgs to not build
 # or configure without just removing the entire pkg directory.
 define HOST_TCL_REMOVE_PACKAGES
-- 
1.7.1

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

* [Buildroot] [PATCH 2/2] tcl: rename BR2_PACKAGE_TCL_SHLIB_ONLY to be more consistent
  2015-03-06 22:30 [Buildroot] [PATCH 1/2] tcl: add support for static builds Vicente Olivert Riera
@ 2015-03-06 22:30 ` Vicente Olivert Riera
  2015-03-06 22:42   ` Thomas Petazzoni
  2015-03-07 10:11 ` [Buildroot] [PATCH 1/2] tcl: add support for static builds Thomas Petazzoni
  1 sibling, 1 reply; 6+ messages in thread
From: Vicente Olivert Riera @ 2015-03-06 22:30 UTC (permalink / raw)
  To: buildroot

The BR2_PACKAGE_TCL_SHLIB_ONLY is confusing because someone could think
that only shared libraries would be installed. But, what actually does
is removing the 'tclsh' binary, so better to reword it in order to be
consistent with what actually does.

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
 package/tcl/Config.in |    7 +++----
 package/tcl/tcl.mk    |    2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/package/tcl/Config.in b/package/tcl/Config.in
index c3d0d87..996dc96 100644
--- a/package/tcl/Config.in
+++ b/package/tcl/Config.in
@@ -25,12 +25,11 @@ config BR2_PACKAGE_TCL_DEL_ENCODINGS
 
 	  It saves approx. 1.6 Mb of space.
 
-config BR2_PACKAGE_TCL_SHLIB_ONLY
-	bool "install only shared library"
+config BR2_PACKAGE_TCL_REMOVE_TCLSH
+	bool "do not install tclsh"
 	default y
 	help
-	  Install only TCL shared library and not binary tcl
-	  interpreter (tclsh).
+	  Do not install the tcl interpreter (tclsh).
 
 	  Saves ~14kb.
 
diff --git a/package/tcl/tcl.mk b/package/tcl/tcl.mk
index ad76e9b..b6c86be 100644
--- a/package/tcl/tcl.mk
+++ b/package/tcl/tcl.mk
@@ -72,7 +72,7 @@ endef
 TCL_POST_INSTALL_TARGET_HOOKS += TCL_REMOVE_ENCODINGS
 endif
 
-ifeq ($(BR2_PACKAGE_TCL_SHLIB_ONLY),y)
+ifeq ($(BR2_PACKAGE_TCL_REMOVE_TCLSH),y)
 define TCL_REMOVE_TCLSH
 	rm -f $(TARGET_DIR)/usr/bin/tclsh$(TCL_VERSION_MAJOR)
 endef
-- 
1.7.1

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

* [Buildroot] [PATCH 2/2] tcl: rename BR2_PACKAGE_TCL_SHLIB_ONLY to be more consistent
  2015-03-06 22:30 ` [Buildroot] [PATCH 2/2] tcl: rename BR2_PACKAGE_TCL_SHLIB_ONLY to be more consistent Vicente Olivert Riera
@ 2015-03-06 22:42   ` Thomas Petazzoni
  2015-03-07 12:14     ` Vicente Olivert Riera
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2015-03-06 22:42 UTC (permalink / raw)
  To: buildroot

Dear Vicente Olivert Riera,

On Fri, 6 Mar 2015 22:30:22 +0000, Vicente Olivert Riera wrote:
> The BR2_PACKAGE_TCL_SHLIB_ONLY is confusing because someone could think
> that only shared libraries would be installed. But, what actually does
> is removing the 'tclsh' binary, so better to reword it in order to be
> consistent with what actually does.
> 
> Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
> ---
>  package/tcl/Config.in |    7 +++----
>  package/tcl/tcl.mk    |    2 +-
>  2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/package/tcl/Config.in b/package/tcl/Config.in
> index c3d0d87..996dc96 100644
> --- a/package/tcl/Config.in
> +++ b/package/tcl/Config.in
> @@ -25,12 +25,11 @@ config BR2_PACKAGE_TCL_DEL_ENCODINGS
>  
>  	  It saves approx. 1.6 Mb of space.
>  
> -config BR2_PACKAGE_TCL_SHLIB_ONLY
> -	bool "install only shared library"
> +config BR2_PACKAGE_TCL_REMOVE_TCLSH

Renaming options requires Config.in.legacy handling.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 1/2] tcl: add support for static builds
  2015-03-06 22:30 [Buildroot] [PATCH 1/2] tcl: add support for static builds Vicente Olivert Riera
  2015-03-06 22:30 ` [Buildroot] [PATCH 2/2] tcl: rename BR2_PACKAGE_TCL_SHLIB_ONLY to be more consistent Vicente Olivert Riera
@ 2015-03-07 10:11 ` Thomas Petazzoni
  2015-03-07 12:20   ` Vicente Olivert Riera
  1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2015-03-07 10:11 UTC (permalink / raw)
  To: buildroot

Dear Vicente Olivert Riera,

On Fri, 6 Mar 2015 22:30:21 +0000, Vicente Olivert Riera wrote:

> +ifeq ($(BR2_STATIC_LIBS),y)
> +# Do not build tclsh with dynamic loading support when building it
> +# statically because it needs dlopen() and friends.
> +TCL_CONF_OPTS += --disable-load
> +HOST_TCL_CONF_OPTS += --disable-load
> +# Also, build only the binaries and libraries and don't build the
> +# 'packages' because they are shared objects which are intended to be
> +# loaded dynamically.
> +TCL_MAKE_OPTS = binaries libraries
> +HOST_TCL_MAKE_OPTS = binaries libraries
> +TCL_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) install-binaries install-libraries
> +TCL_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) install-binaries
> +HOST_TCL_INSTALL_OPTS = DESTDIR=$(STAGING_DIR) install-binaries install-libraries
> +endif

BR2_STATIC_LIBS indicates that the *target* packages are built static
only. Host packages continue to be built dynamically. So I believe all
the HOST_* assignments in here are wrong.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH 2/2] tcl: rename BR2_PACKAGE_TCL_SHLIB_ONLY to be more consistent
  2015-03-06 22:42   ` Thomas Petazzoni
@ 2015-03-07 12:14     ` Vicente Olivert Riera
  0 siblings, 0 replies; 6+ messages in thread
From: Vicente Olivert Riera @ 2015-03-07 12:14 UTC (permalink / raw)
  To: buildroot

Dear Thomas Petazzoni,

On 06/03/15 23:42, Thomas Petazzoni wrote:
> Dear Vicente Olivert Riera,
> 
> On Fri, 6 Mar 2015 22:30:22 +0000, Vicente Olivert Riera wrote:
>> The BR2_PACKAGE_TCL_SHLIB_ONLY is confusing because someone could think
>> that only shared libraries would be installed. But, what actually does
>> is removing the 'tclsh' binary, so better to reword it in order to be
>> consistent with what actually does.
>>
>> Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
>> ---
>>  package/tcl/Config.in |    7 +++----
>>  package/tcl/tcl.mk    |    2 +-
>>  2 files changed, 4 insertions(+), 5 deletions(-)
>>
>> diff --git a/package/tcl/Config.in b/package/tcl/Config.in
>> index c3d0d87..996dc96 100644
>> --- a/package/tcl/Config.in
>> +++ b/package/tcl/Config.in
>> @@ -25,12 +25,11 @@ config BR2_PACKAGE_TCL_DEL_ENCODINGS
>>  
>>  	  It saves approx. 1.6 Mb of space.
>>  
>> -config BR2_PACKAGE_TCL_SHLIB_ONLY
>> -	bool "install only shared library"
>> +config BR2_PACKAGE_TCL_REMOVE_TCLSH
> 
> Renaming options requires Config.in.legacy handling.

ooops!!! You are right, sorry. I will send a v2. Thanks!

--
Vincent

> Thomas
> 

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

* [Buildroot] [PATCH 1/2] tcl: add support for static builds
  2015-03-07 10:11 ` [Buildroot] [PATCH 1/2] tcl: add support for static builds Thomas Petazzoni
@ 2015-03-07 12:20   ` Vicente Olivert Riera
  0 siblings, 0 replies; 6+ messages in thread
From: Vicente Olivert Riera @ 2015-03-07 12:20 UTC (permalink / raw)
  To: buildroot

Dear Thomas Petazzoni,

On 07/03/15 11:11, Thomas Petazzoni wrote:
> Dear Vicente Olivert Riera,
> 
> On Fri, 6 Mar 2015 22:30:21 +0000, Vicente Olivert Riera wrote:
> 
>> +ifeq ($(BR2_STATIC_LIBS),y)
>> +# Do not build tclsh with dynamic loading support when building it
>> +# statically because it needs dlopen() and friends.
>> +TCL_CONF_OPTS += --disable-load
>> +HOST_TCL_CONF_OPTS += --disable-load
>> +# Also, build only the binaries and libraries and don't build the
>> +# 'packages' because they are shared objects which are intended to be
>> +# loaded dynamically.
>> +TCL_MAKE_OPTS = binaries libraries
>> +HOST_TCL_MAKE_OPTS = binaries libraries
>> +TCL_INSTALL_STAGING_OPTS = DESTDIR=$(STAGING_DIR) install-binaries install-libraries
>> +TCL_INSTALL_TARGET_OPTS = DESTDIR=$(TARGET_DIR) install-binaries
>> +HOST_TCL_INSTALL_OPTS = DESTDIR=$(STAGING_DIR) install-binaries install-libraries
>> +endif
> 
> BR2_STATIC_LIBS indicates that the *target* packages are built static
> only. Host packages continue to be built dynamically. So I believe all
> the HOST_* assignments in here are wrong.

Noted. I will fix that in the v2. Thanks!

--
Vincent

> Best regards,
> 
> Thomas
> 

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

end of thread, other threads:[~2015-03-07 12:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-06 22:30 [Buildroot] [PATCH 1/2] tcl: add support for static builds Vicente Olivert Riera
2015-03-06 22:30 ` [Buildroot] [PATCH 2/2] tcl: rename BR2_PACKAGE_TCL_SHLIB_ONLY to be more consistent Vicente Olivert Riera
2015-03-06 22:42   ` Thomas Petazzoni
2015-03-07 12:14     ` Vicente Olivert Riera
2015-03-07 10:11 ` [Buildroot] [PATCH 1/2] tcl: add support for static builds Thomas Petazzoni
2015-03-07 12:20   ` Vicente Olivert Riera

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox