Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] pkg-perl: add patch_subdir_makefile function
@ 2018-10-13 14:12 Francois Perrad
  2018-10-13 14:12 ` [Buildroot] [PATCH 2/2] perl-netaddr-ip: fix build of the XS version Francois Perrad
  2018-10-14  7:26 ` [Buildroot] [PATCH 1/2] pkg-perl: add patch_subdir_makefile function Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: Francois Perrad @ 2018-10-13 14:12 UTC (permalink / raw)
  To: buildroot

based on an initial work of Christopher McCrory <chrismcc@gmail.com>

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/pkg-perl.mk | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/package/pkg-perl.mk b/package/pkg-perl.mk
index 07348bd5d..a78c1cd95 100644
--- a/package/pkg-perl.mk
+++ b/package/pkg-perl.mk
@@ -22,6 +22,21 @@
 PERL_ARCHNAME = $(ARCH)-linux
 PERL_RUN = PERL5LIB= PERL_USE_UNSAFE_INC=1 $(HOST_DIR)/bin/perl
 
+# Some arguments to Makefile.PL do not get propagated to subdirectories
+# similar to:
+# https://rt.cpan.org/Public/Bug/Display.html?id=28632
+define patch_subdir_makefile
+	$(SED) "s:^AR = .*:AR = $(TARGET_AR):g" $(1)
+	$(SED) "s:^FULL_AR = .*:FULL_AR = $(TARGET_AR):g" $(1)
+	$(SED) "s:^CC = .*:CC = $(TARGET_CC):g" $(1)
+	$(SED) "s:^CCFLAGS = .*:CCFLAGS = $(TARGET_CFLAGS):g" $(1)
+	$(SED) "s:^LD = .*:LD = $(TARGET_CC):g" $(1)
+	$(SED) "s:^LDDLFLAGS = .*:LDDLFLAGS = -shared $(TARGET_LDFLAGS):g" $(1)
+	$(SED) "s:^LDLFLAGS = .*:LDLFLAGS = $(TARGET_LDFLAGS):g" $(1)
+	$(SED) "s:^DESTDIR = .*:DESTDIR = $(TARGET_DIR):g" $(1)
+	$(SED) "s:^PERL_INC = .*:PERL_INC = $(STAGING_DIR)/usr/lib/perl5/$(PERL_VERSION)/$(PERL_ARCHNAME)/CORE:g" $(1)
+endef
+
 ################################################################################
 # inner-perl-package -- defines how the configuration, compilation and
 # installation of a perl package should be done, implements a
-- 
2.17.1

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

* [Buildroot] [PATCH 2/2] perl-netaddr-ip: fix build of the XS version
  2018-10-13 14:12 [Buildroot] [PATCH 1/2] pkg-perl: add patch_subdir_makefile function Francois Perrad
@ 2018-10-13 14:12 ` Francois Perrad
  2018-10-14  7:26 ` [Buildroot] [PATCH 1/2] pkg-perl: add patch_subdir_makefile function Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Francois Perrad @ 2018-10-13 14:12 UTC (permalink / raw)
  To: buildroot

thank to the function patch_subdir_makefile

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 package/perl-netaddr-ip/perl-netaddr-ip.mk | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/package/perl-netaddr-ip/perl-netaddr-ip.mk b/package/perl-netaddr-ip/perl-netaddr-ip.mk
index a1f02c691..cd552d174 100644
--- a/package/perl-netaddr-ip/perl-netaddr-ip.mk
+++ b/package/perl-netaddr-ip/perl-netaddr-ip.mk
@@ -10,8 +10,16 @@ PERL_NETADDR_IP_SITE = $(BR2_CPAN_MIRROR)/authors/id/M/MI/MIKER
 PERL_NETADDR_IP_LICENSE = Artistic or GPL-1.0+
 PERL_NETADDR_IP_LICENSE_FILES = Artistic Copying
 
-# we always build the Pure Perl version.
-# the build of the native part of NetAddr::IP::Util is buggy.
+define PERL_NETADDR_IP_PATCH_GENERATED_MAKEFILE
+	$(call patch_subdir_makefile,$(@D)/Lite/Makefile)
+	$(call patch_subdir_makefile,$(@D)/Lite/Util/Makefile)
+endef
+
+PERL_NETADDR_IP_POST_CONFIGURE_HOOKS += PERL_NETADDR_IP_PATCH_GENERATED_MAKEFILE
+
+ifeq ($(BR2_STATIC_LIBS),y)
+# build only the Pure Perl version.
 PERL_NETADDR_IP_CONF_OPTS = -noxs
+endif
 
 $(eval $(perl-package))
-- 
2.17.1

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

* [Buildroot] [PATCH 1/2] pkg-perl: add patch_subdir_makefile function
  2018-10-13 14:12 [Buildroot] [PATCH 1/2] pkg-perl: add patch_subdir_makefile function Francois Perrad
  2018-10-13 14:12 ` [Buildroot] [PATCH 2/2] perl-netaddr-ip: fix build of the XS version Francois Perrad
@ 2018-10-14  7:26 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2018-10-14  7:26 UTC (permalink / raw)
  To: buildroot

Hello,

On Sat, 13 Oct 2018 16:12:00 +0200, Francois Perrad wrote:
> based on an initial work of Christopher McCrory <chrismcc@gmail.com>
> 
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>

Thanks for working on this. In the review of
https://patchwork.ozlabs.org/patch/959634/, I was asking:

"""
This problem was reported at
https://rt.cpan.org/Public/Bug/Display.html?id=28632, and apparently
fixed in 2013, at least for the "LD" variable. Why are we still seeing
this issue ?
"""

Any idea ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2018-10-14  7:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-13 14:12 [Buildroot] [PATCH 1/2] pkg-perl: add patch_subdir_makefile function Francois Perrad
2018-10-13 14:12 ` [Buildroot] [PATCH 2/2] perl-netaddr-ip: fix build of the XS version Francois Perrad
2018-10-14  7:26 ` [Buildroot] [PATCH 1/2] pkg-perl: add patch_subdir_makefile function Thomas Petazzoni

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