diff mbox

intltool: fix build

Message ID 1413571681-27963-1-git-send-email-francois.perrad@gadz.org
State Accepted
Headers show

Commit Message

Francois Perrad Oct. 17, 2014, 6:48 p.m. UTC
fix various build failures caused by host-perl serie

Currently, the variables PERL & PERL2LIB are available
only during the configure step of host-intltool.
There are also needed when running host-intltool,
in all package which depends on host-intltool.

So, there are now global, but in the perl infrastructure,
we cannot use them.

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/Makefile.in          | 9 +++++++--
 package/intltool/intltool.mk | 3 ---
 package/pkg-perl.mk          | 2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

Comments

Bernd Kuhls Oct. 19, 2014, 10:40 a.m. UTC | #1
Francois Perrad <fperrad@gmail.com> wrote in 
news:1413571681-27963-1-git-send-email-francois.perrad@gadz.org:

> fix various build failures caused by host-perl serie

Hi,

please add some links to the autobuilder errors fixed by your patch,
apart from that:

Reviewed-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Arnout Vandecappelle Oct. 19, 2014, 10:50 p.m. UTC | #2
On 17/10/14 20:48, Francois Perrad wrote:
> fix various build failures caused by host-perl serie
> 
> Currently, the variables PERL & PERL2LIB are available
> only during the configure step of host-intltool.
> There are also needed when running host-intltool,
> in all package which depends on host-intltool.
> 
> So, there are now global, but in the perl infrastructure,
> we cannot use them.
> 
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
>  package/Makefile.in          | 9 +++++++--
>  package/intltool/intltool.mk | 3 ---
>  package/pkg-perl.mk          | 2 +-
>  3 files changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index ab59b54..b5d407c 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -232,6 +232,9 @@ HOST_LDFLAGS  += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/
>  HOSTCC_VERSION := $(shell $(HOSTCC_NOCCACHE) --version | \
>  	sed -n 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)[ ]*.*$$/\1\2\3/p')
>  
> +export PERL=$(shell which perl)

 Isn't this the default, i.e. redundant?

> +export PERL5LIB=$(HOST_DIR)/usr/lib/perl

 This one is probably needed indeed.

> +
>  TARGET_CONFIGURE_OPTS = PATH=$(BR_PATH) \
>  		AR="$(TARGET_AR)" \
>  		AS="$(TARGET_AS)" \
> @@ -267,7 +270,8 @@ TARGET_CONFIGURE_OPTS = PATH=$(BR_PATH) \
>  		LDFLAGS="$(TARGET_LDFLAGS)" \
>  		FCFLAGS="$(TARGET_FCFLAGS)" \
>  		PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
> -		STAGING_DIR="$(STAGING_DIR)"
> +		STAGING_DIR="$(STAGING_DIR)" \
> +		INTLTOOL_PERL=$(PERL)

 This will only be used by intltool itself (to replace the @INTLTOOL_PERL@
stanza in the intltool-*.in files), so it should move to the host-intltool package.

 Actually, I even think that it's quite wrong for the TARGET_CONFIGURE_OPTS
because it would only be used by the target intltool, which shouldn't use
whatever path the system's perl is in.

>  
>  TARGET_MAKE_ENV = PATH=$(BR_PATH)
>  
> @@ -292,7 +296,8 @@ HOST_CONFIGURE_OPTS = PATH=$(BR_PATH) \
>  		PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
>  		PKG_CONFIG_SYSROOT_DIR="/" \
>  		PKG_CONFIG_LIBDIR="$(HOST_DIR)/usr/lib/pkgconfig:$(HOST_DIR)/usr/share/pkgconfig" \
> -		LD_LIBRARY_PATH="$(HOST_DIR)/usr/lib:$(LD_LIBRARY_PATH)"
> +		LD_LIBRARY_PATH="$(HOST_DIR)/usr/lib:$(LD_LIBRARY_PATH)" \
> +		INTLTOOL_PERL=$(PERL)

 So it's this one that should move to intltool


 Regards,
 Arnout.

>  
>  HOST_MAKE_ENV = PATH=$(BR_PATH) \
>  		LD_LIBRARY_PATH="$(HOST_DIR)/usr/lib:$(LD_LIBRARY_PATH)" \
> diff --git a/package/intltool/intltool.mk b/package/intltool/intltool.mk
> index a7afe0d..549cb3b 100644
> --- a/package/intltool/intltool.mk
> +++ b/package/intltool/intltool.mk
> @@ -10,9 +10,6 @@ INTLTOOL_LICENSE = GPLv2+
>  INTLTOOL_LICENSE_FILES = COPYING
>  
>  HOST_INTLTOOL_DEPENDENCIES = host-gettext host-libxml-parser-perl
> -HOST_INTLTOOL_CONF_OPTS = \
> -	PERL=`which perl` \
> -	PERL5LIB=$(HOST_DIR)/usr/lib/perl
>  
>  $(eval $(autotools-package))
>  $(eval $(host-autotools-package))
> diff --git a/package/pkg-perl.mk b/package/pkg-perl.mk
> index f41a2f9..6577588 100644
> --- a/package/pkg-perl.mk
> +++ b/package/pkg-perl.mk
> @@ -20,7 +20,7 @@
>  ################################################################################
>  
>  PERL_ARCHNAME = $(ARCH)-linux
> -PERL_RUN = $(HOST_DIR)/usr/bin/perl
> +PERL_RUN = PERL5LIB= $(HOST_DIR)/usr/bin/perl
>  
>  ################################################################################
>  # inner-perl-package -- defines how the configuration, compilation and
>
Thomas Petazzoni Oct. 22, 2014, 4:03 p.m. UTC | #3
Dear Francois Perrad,

On Fri, 17 Oct 2014 20:48:01 +0200, Francois Perrad wrote:
> fix various build failures caused by host-perl serie
> 
> Currently, the variables PERL & PERL2LIB are available
> only during the configure step of host-intltool.
> There are also needed when running host-intltool,
> in all package which depends on host-intltool.
> 
> So, there are now global, but in the perl infrastructure,
> we cannot use them.
> 
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
>  package/Makefile.in          | 9 +++++++--
>  package/intltool/intltool.mk | 3 ---
>  package/pkg-perl.mk          | 2 +-
>  3 files changed, 8 insertions(+), 6 deletions(-)

Can you cook an updated version of this patch that takes into account
the comment you have received? It would help us fix a number of Perl
related autobuilder issues.

Thanks,

Thomas
Francois Perrad Oct. 22, 2014, 5:15 p.m. UTC | #4
2014-10-22 18:03 GMT+02:00 Thomas Petazzoni
<thomas.petazzoni@free-electrons.com>:
> Dear Francois Perrad,
>
> On Fri, 17 Oct 2014 20:48:01 +0200, Francois Perrad wrote:
>> fix various build failures caused by host-perl serie
>>
>> Currently, the variables PERL & PERL2LIB are available
>> only during the configure step of host-intltool.
>> There are also needed when running host-intltool,
>> in all package which depends on host-intltool.
>>
>> So, there are now global, but in the perl infrastructure,
>> we cannot use them.
>>
>> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
>> ---
>>  package/Makefile.in          | 9 +++++++--
>>  package/intltool/intltool.mk | 3 ---
>>  package/pkg-perl.mk          | 2 +-
>>  3 files changed, 8 insertions(+), 6 deletions(-)
>
> Can you cook an updated version of this patch that takes into account
> the comment you have received? It would help us fix a number of Perl
> related autobuilder issues.
>

When I try to do that you suggest, I only obtain no working result.

I think that comments from Arnout, come from a pure review but no from
testing or experiment.

This patch doesn't try to fix the package host-intltool, it fixes the
packages which depend on host-intltool.
Currently, this kind of package is broken in the configure step
because they can not find the correct perl.
So, the variable INTLTOOL_PERL=$(PERL) in *_CONFIGURE_OPTS is mandatory.

When PATH=$(BR_PATH), `which perl` find the system perl when host-perl
is not yet installed, after it find the host-perl.
So, it is important to save the result of `which perl` with the
original PATH (ie. without $(HOST_DIR)/usr/bin).

The current patch stay the best that I can do (the commit message can
always be improved).

François

> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Thomas Petazzoni Oct. 23, 2014, 8:08 p.m. UTC | #5
Dear François Perrad,

On Wed, 22 Oct 2014 19:15:36 +0200, François Perrad wrote:

> > Can you cook an updated version of this patch that takes into account
> > the comment you have received? It would help us fix a number of Perl
> > related autobuilder issues.
> 
> When I try to do that you suggest, I only obtain no working result.
> 
> I think that comments from Arnout, come from a pure review but no from
> testing or experiment.
> 
> This patch doesn't try to fix the package host-intltool, it fixes the
> packages which depend on host-intltool.
> Currently, this kind of package is broken in the configure step
> because they can not find the correct perl.
> So, the variable INTLTOOL_PERL=$(PERL) in *_CONFIGURE_OPTS is mandatory.
> 
> When PATH=$(BR_PATH), `which perl` find the system perl when host-perl
> is not yet installed, after it find the host-perl.
> So, it is important to save the result of `which perl` with the
> original PATH (ie. without $(HOST_DIR)/usr/bin).
> 
> The current patch stay the best that I can do (the commit message can
> always be improved).

Hum, right, ok. I'm not a big fan of how we handle intltool, but I
admit that the main reason for this mess is me asking you to not make
intltool and libxml-parser-perl depend on host-perl.

I've applied your patch (after slightly rewording the commit log), it
indeed seems to fix the issue. We'll see how things go, but I'm not
very happy with our intltool handling :/

Best regards,

Thomas
diff mbox

Patch

diff --git a/package/Makefile.in b/package/Makefile.in
index ab59b54..b5d407c 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -232,6 +232,9 @@  HOST_LDFLAGS  += -L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib -Wl,-rpath,$(HOST_DIR)/
 HOSTCC_VERSION := $(shell $(HOSTCC_NOCCACHE) --version | \
 	sed -n 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)[ ]*.*$$/\1\2\3/p')
 
+export PERL=$(shell which perl)
+export PERL5LIB=$(HOST_DIR)/usr/lib/perl
+
 TARGET_CONFIGURE_OPTS = PATH=$(BR_PATH) \
 		AR="$(TARGET_AR)" \
 		AS="$(TARGET_AS)" \
@@ -267,7 +270,8 @@  TARGET_CONFIGURE_OPTS = PATH=$(BR_PATH) \
 		LDFLAGS="$(TARGET_LDFLAGS)" \
 		FCFLAGS="$(TARGET_FCFLAGS)" \
 		PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
-		STAGING_DIR="$(STAGING_DIR)"
+		STAGING_DIR="$(STAGING_DIR)" \
+		INTLTOOL_PERL=$(PERL)
 
 TARGET_MAKE_ENV = PATH=$(BR_PATH)
 
@@ -292,7 +296,8 @@  HOST_CONFIGURE_OPTS = PATH=$(BR_PATH) \
 		PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
 		PKG_CONFIG_SYSROOT_DIR="/" \
 		PKG_CONFIG_LIBDIR="$(HOST_DIR)/usr/lib/pkgconfig:$(HOST_DIR)/usr/share/pkgconfig" \
-		LD_LIBRARY_PATH="$(HOST_DIR)/usr/lib:$(LD_LIBRARY_PATH)"
+		LD_LIBRARY_PATH="$(HOST_DIR)/usr/lib:$(LD_LIBRARY_PATH)" \
+		INTLTOOL_PERL=$(PERL)
 
 HOST_MAKE_ENV = PATH=$(BR_PATH) \
 		LD_LIBRARY_PATH="$(HOST_DIR)/usr/lib:$(LD_LIBRARY_PATH)" \
diff --git a/package/intltool/intltool.mk b/package/intltool/intltool.mk
index a7afe0d..549cb3b 100644
--- a/package/intltool/intltool.mk
+++ b/package/intltool/intltool.mk
@@ -10,9 +10,6 @@  INTLTOOL_LICENSE = GPLv2+
 INTLTOOL_LICENSE_FILES = COPYING
 
 HOST_INTLTOOL_DEPENDENCIES = host-gettext host-libxml-parser-perl
-HOST_INTLTOOL_CONF_OPTS = \
-	PERL=`which perl` \
-	PERL5LIB=$(HOST_DIR)/usr/lib/perl
 
 $(eval $(autotools-package))
 $(eval $(host-autotools-package))
diff --git a/package/pkg-perl.mk b/package/pkg-perl.mk
index f41a2f9..6577588 100644
--- a/package/pkg-perl.mk
+++ b/package/pkg-perl.mk
@@ -20,7 +20,7 @@ 
 ################################################################################
 
 PERL_ARCHNAME = $(ARCH)-linux
-PERL_RUN = $(HOST_DIR)/usr/bin/perl
+PERL_RUN = PERL5LIB= $(HOST_DIR)/usr/bin/perl
 
 ################################################################################
 # inner-perl-package -- defines how the configuration, compilation and