From patchwork Wed Oct 10 15:06:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francois Perrad X-Patchwork-Id: 190678 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 B757E2C008B for ; Thu, 11 Oct 2012 02:07:47 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0AA6D10B93E; Wed, 10 Oct 2012 15:07:43 +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 BVh1B9Y62416; Wed, 10 Oct 2012 15:07:35 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 45D7510B937; Wed, 10 Oct 2012 15:07:05 +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 7CADB8F74A for ; Wed, 10 Oct 2012 15:07:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id CBB4F818B0 for ; Wed, 10 Oct 2012 15:07:05 +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 dQCgWswNfdEL for ; Wed, 10 Oct 2012 15:07:02 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by whitealder.osuosl.org (Postfix) with ESMTPS id 2214E8081E for ; Wed, 10 Oct 2012 15:07:01 +0000 (UTC) Received: by mail-wi0-f175.google.com with SMTP id hq4so5382574wib.10 for ; Wed, 10 Oct 2012 08:07:00 -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=0fW6UVgdDEz3rT8HA99Q7twSbdLwIJxI1PyKyQYBuCo0/IPZWroFh2LwCadXv5VgSW cCFerRmvRMaxJSo4HrozrBl4sejmqcxssp1AV7xqkdd8BGqv5p3qsr51Psb9gR0i1M4N s82OzX//qT6qE6eISZasd7PTVNHejVV1LulBFB+tQJs7gjKt3eaiyU5uL13S95H9lX1r jdmcgQkELb9FvisUwydbLTsl13EW75GZO5QtdNwXdoYt1NOCQWlGujLw7m/adkorDskM Xh2sSVplXu2cvYr5m0DtL7g/1avWCxjEBMSamYMch59MljsaRf13GFA20fBdsaLPi/y5 8l1w== Received: by 10.180.86.202 with SMTP id r10mr13628156wiz.12.1349881620368; Wed, 10 Oct 2012 08:07:00 -0700 (PDT) Received: from xubuntu-12.04 (123.179.87.79.rev.sfr.net. [79.87.179.123]) by mx.google.com with ESMTPS id q7sm3227246wiy.11.2012.10.10.08.06.58 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Oct 2012 08:06:59 -0700 (PDT) From: Francois Perrad To: buildroot@busybox.net Date: Wed, 10 Oct 2012 17:06:27 +0200 Message-Id: <1349881591-7062-6-git-send-email-francois.perrad@gadz.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349881591-7062-1-git-send-email-francois.perrad@gadz.org> References: <1349881591-7062-1-git-send-email-francois.perrad@gadz.org> Subject: [Buildroot] [PATCH v10 06/10] 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