summaryrefslogtreecommitdiffstats
path: root/package/perl/perl.mk
diff options
context:
space:
mode:
authorFrancois Perrad <fperrad@gmail.com>2012-10-19 03:13:51 +0000
committerPeter Korsgaard <jacmet@sunsite.dk>2012-11-03 12:00:38 +0100
commitfa3afe2d81874b315759c1fb3b705ed54b15ce2c (patch)
tree4a271bc522497504ddda56043a7c1b45c62720ea /package/perl/perl.mk
parent1ff20d33e3f213ea1efc2e6939516b1ea43393c4 (diff)
downloadbuildroot-novena-fa3afe2d81874b315759c1fb3b705ed54b15ce2c.tar.gz
buildroot-novena-fa3afe2d81874b315759c1fb3b705ed54b15ce2c.zip
perl: add option "custom install"
allows same behaviour (and footprint) as microperl Signed-off-by: Francois Perrad <francois.perrad@gadz.org> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/perl/perl.mk')
-rw-r--r--package/perl/perl.mk32
1 files changed, 32 insertions, 0 deletions
diff --git a/package/perl/perl.mk b/package/perl/perl.mk
index 56abbc1f1..81dff049e 100644
--- a/package/perl/perl.mk
+++ b/package/perl/perl.mk
@@ -89,7 +89,38 @@ PERL_RUN_PERL = $(QEMU_USER) $(@D)/perl -Ilib
PERL_ARCHNAME = $(shell $(PERL_RUN_PERL) -MConfig -e "print Config->{archname}")
PERL_LIB = $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION)
PERL_ARCHLIB = $(PERL_LIB)/$(PERL_ARCHNAME)
+PERL_MODS = $(call qstrip,$(BR2_PACKAGE_PERL_MODULES))
+# Minimal set of modules required for 'perl -V' to work
+PERL_ARCH_MODS = Config.pm Config_git.pl Config_heavy.pl
+PERL_BASE_MODS = strict.pm vars.pm warnings.pm warnings/register.pm
+define PERL_INSTALL_MODULES
+ for i in $(PERL_ARCH_MODS); do \
+ $(INSTALL) -m 0644 -D $(@D)/lib/$$i $(PERL_ARCHLIB)/$$i; \
+ done
+ for i in $(PERL_BASE_MODS); do \
+ $(INSTALL) -m 0644 -D $(@D)/lib/$$i $(PERL_LIB)/$$i; \
+ done
+ for i in $(PERL_MODS); do \
+ j=`echo $$i|cut -d : -f 1` ; \
+ if [ -d $(@D)/lib/$$j ] ; then \
+ cp -af $(@D)/lib/$$j $(PERL_LIB) ; \
+ fi ; \
+ if [ -f $(@D)/lib/$$i ] ; then \
+ $(INSTALL) -m 0644 -D $(@D)/lib/$$i $(PERL_LIB)/$$i; \
+ fi ; \
+ done
+ # Remove test files
+ find $(PERL_LIB) -type f -name *.t -exec rm -f {} \;
+endef
+
+ifeq ($(BR2_PACKAGE_PERL_CUSTOM_INSTALL),y)
+define PERL_INSTALL_TARGET_CMDS
+ $(INSTALL) -m 0755 -D $(@D)/perl $(TARGET_DIR)/usr/bin/perl
+ $(INSTALL) -m 0755 -D $(@D)/libperl.so $(PERL_ARCHLIB)/CORE/libperl.so
+ $(PERL_INSTALL_MODULES)
+endef
+else
define PERL_INSTALL_TARGET_CMDS
$(MAKE) INSTALL_DEPENDENCE= \
INSTALLFLAGS=-p \
@@ -98,6 +129,7 @@ define PERL_INSTALL_TARGET_CMDS
rm -f $(PERL_ARCHLIB)/CORE/*.h
find $(PERL_ARCHLIB) -type f -name *.bs -exec rm -f {} \;
endef
+endif
define PERL_CLEAN_CMDS
-$(MAKE) -C $(@D) clean