From patchwork Fri Oct 19 13:13:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francois Perrad X-Patchwork-Id: 192687 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (fraxinus.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id B10CA2C008E for ; Sat, 20 Oct 2012 00:15:55 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5D79F10B8C0; Fri, 19 Oct 2012 13:15:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gOEoFBYwANuV; Fri, 19 Oct 2012 13:15:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 623B510B8D9; Fri, 19 Oct 2012 13:15:28 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 7A10A8F74A for ; Fri, 19 Oct 2012 13:15:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 584148D0E4 for ; Fri, 19 Oct 2012 13:15:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ypaGv4s0NYFQ for ; Fri, 19 Oct 2012 13:15:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-we0-f171.google.com (mail-we0-f171.google.com [74.125.82.171]) by whitealder.osuosl.org (Postfix) with ESMTPS id 1137B8D177 for ; Fri, 19 Oct 2012 13:15:21 +0000 (UTC) Received: by mail-we0-f171.google.com with SMTP id s43so293551wey.16 for ; Fri, 19 Oct 2012 06:15:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=mYGDlWq9A1Al155JNbjXtFn/3mp/JyX4faaivzT5jyc=; b=GE6VDnWiuksDlb+C/nzW8vRGZcOGmNwiqdRZ6o0bI5CarQ5jZ/Bn2xK8VQylJL8n4+ WbXW5phw/zB9dE3sqpCLAomU86qj3BxkuTJJcBeH9uWjOjNoKpdCE2UVBCgmsKRJgVMd WpbwfiDvP8V1OZ8wdLYACJi2AhNgc1i0V2q/UywrvZ8aoNcAU4KIey8bGQbS2y4MSiDo ocQuEhzbqjuaXE3SIw+IfanMpc0DMdB6+PDk3TWve+e5jurJ+XnTqiXGciiE3LhHx1D5 ihjbKazst6e+ZyRhMmuJa6eQAaaLLdXqLz2avnl9r2LlH62EuPiqXY4LQelp3Q4EbK2V GZ0Q== Received: by 10.180.90.201 with SMTP id by9mr18994044wib.5.1350652520282; Fri, 19 Oct 2012 06:15:20 -0700 (PDT) Received: from xubuntu-12.04 (206.124.86.79.rev.sfr.net. [79.86.124.206]) by mx.google.com with ESMTPS id a10sm3390455wiz.4.2012.10.19.06.15.18 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 19 Oct 2012 06:15:19 -0700 (PDT) From: Francois Perrad To: buildroot@busybox.net Date: Fri, 19 Oct 2012 15:13:51 +0200 Message-Id: <1350652434-32020-6-git-send-email-francois.perrad@gadz.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1350652434-32020-1-git-send-email-francois.perrad@gadz.org> References: <1350652434-32020-1-git-send-email-francois.perrad@gadz.org> Subject: [Buildroot] [PATCH v11 6/9] perl: add option "custom install" X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net allows same behaviour (and footprint) as microperl Signed-off-by: Francois Perrad --- package/perl/Config.in | 16 ++++++++++++++++ package/perl/perl.mk | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/package/perl/Config.in b/package/perl/Config.in index 98b41da..0642deb 100644 --- a/package/perl/Config.in +++ b/package/perl/Config.in @@ -16,6 +16,22 @@ config BR2_PACKAGE_PERL if BR2_PACKAGE_PERL +config BR2_PACKAGE_PERL_CUSTOM_INSTALL + bool "custom install" + help + Don't use the full install target + Install only a selection of modules (like microperl). + +config BR2_PACKAGE_PERL_MODULES + string "additional modules" + depends on BR2_PACKAGE_PERL_CUSTOM_INSTALL + help + List of space-separated perl modules to copy to the rootfs. + + Examples: constant.pm Getopt/Std.pm Time/Local.pm + + Module dependencies are not automatic so check your needs. + config BR2_PACKAGE_PERL_DB_FILE bool "DB_File" select BR2_PACKAGE_BERKELEYDB diff --git a/package/perl/perl.mk b/package/perl/perl.mk index 56abbc1..81dff04 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