From patchwork Sat Oct 6 13:53:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Francois Perrad X-Patchwork-Id: 189702 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id A9FB62C032E for ; Sat, 6 Oct 2012 23:54:33 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 4E1E7A0584; Sat, 6 Oct 2012 13:54:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fnEePD7AAdbu; Sat, 6 Oct 2012 13:54:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id F102FA0345; Sat, 6 Oct 2012 13:54:11 +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 2CDBF8F74B for ; Sat, 6 Oct 2012 13:54:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B1D8B838A4 for ; Sat, 6 Oct 2012 13:54:10 +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 6ZX0pqrQfWYA for ; Sat, 6 Oct 2012 13:54:07 +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 37A278306E for ; Sat, 6 Oct 2012 13:54:07 +0000 (UTC) Received: by mail-we0-f171.google.com with SMTP id s43so2291837wey.16 for ; Sat, 06 Oct 2012 06:54:05 -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=9VFjmOb24p0fJVi+GwalWNHXCqglP/GDuFrljdEcr7A=; b=X4lWnoK/Sn3ryuNgQpO0lcSPBGhO1hj2htfV1FVNDn1EvbovzY0AGrqNnFE3fhkJAU Rp3QR6hMS/+S/dHLXDmIp1U1lXFUMXN0RxljSmMmba4ZDSfGTN7dMnCQSWNSixfxzdnW 7ir8Qe2dP1HGBceUjuQf28P3dWqaMgD5+1jhLh+dXXCInuK+8dK/uhfEk1FOIF7LBCjW fGYaHKy08lGCHu+qkwgrMQnX4fcxgjLuOS4gLMCay617sTpl70hMs/szLo9meAkgMVwT DmZOaoMHfKM7ckTOers14rPDlWtyjUb5f5e4Aqggmv+NQYoTmITx3i8fvZkJc34biIK0 yafw== Received: by 10.217.6.12 with SMTP id x12mr6347420wes.176.1349531645400; Sat, 06 Oct 2012 06:54:05 -0700 (PDT) Received: from xubuntu-12.04 (95.151.93.79.rev.sfr.net. [79.93.151.95]) by mx.google.com with ESMTPS id cu1sm8327350wib.6.2012.10.06.06.54.03 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 06 Oct 2012 06:54:04 -0700 (PDT) From: Francois Perrad To: buildroot@busybox.net Date: Sat, 6 Oct 2012 15:53:45 +0200 Message-Id: <1349531633-26717-2-git-send-email-francois.perrad@gadz.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349531633-26717-1-git-send-email-francois.perrad@gadz.org> References: <1349531633-26717-1-git-send-email-francois.perrad@gadz.org> Subject: [Buildroot] [PATCH v9 02/10] perl: new package 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 Signed-off-by: Francois Perrad --- package/Config.in | 1 + package/perl/Config.in | 19 +++++++ package/perl/perl-configure-qemu.patch | 53 ++++++++++++++++++ package/perl/perl-make-ext.patch | 24 +++++++++ package/perl/perl-mkppport.patch | 37 +++++++++++++ package/perl/perl.mk | 92 ++++++++++++++++++++++++++++++++ 6 files changed, 226 insertions(+) create mode 100644 package/perl/Config.in create mode 100644 package/perl/perl-configure-qemu.patch create mode 100644 package/perl/perl-make-ext.patch create mode 100644 package/perl/perl-mkppport.patch create mode 100644 package/perl/perl.mk diff --git a/package/Config.in b/package/Config.in index f308de7..00a79ab 100644 --- a/package/Config.in +++ b/package/Config.in @@ -262,6 +262,7 @@ source "package/wsapi/Config.in" source "package/xavante/Config.in" endmenu endif +source "package/perl/Config.in" source "package/microperl/Config.in" source "package/php/Config.in" source "package/python/Config.in" diff --git a/package/perl/Config.in b/package/perl/Config.in new file mode 100644 index 0000000..096159f --- /dev/null +++ b/package/perl/Config.in @@ -0,0 +1,19 @@ +config BR2_PACKAGE_PERL + bool "perl" + depends on !BR2_avr32 + depends on !BR2_bfin + depends on !BR2_sh2 + depends on !BR2_sh2a + depends on !BR2_sh3 + depends on !BR2_sh3eb + depends on !BR2_sh64 + select BR2_PACKAGE_HOST_QEMU + help + Larry Wall's Practical Extraction and Report Language + An interpreted scripting language, known among some as "Unix's Swiss + Army Chainsaw". + + http://www.perl.org/ + +comment "perl requires an architecture supported by qemu" + depends on BR2_avr32 || BR2_bfin || BR2_sh2 || BR2_sh2a || BR2_sh3 || BR2_sh3eb || BR2_sh64 diff --git a/package/perl/perl-configure-qemu.patch b/package/perl/perl-configure-qemu.patch new file mode 100644 index 0000000..c2d6b92 --- /dev/null +++ b/package/perl/perl-configure-qemu.patch @@ -0,0 +1,53 @@ +Add qemu support + +see https://rt.perl.org/rt3//Public/Bug/Display.html?id=114798 + +Signed-off-by: Francois Perrad + +Index: b/Configure +=================================================================== +--- a/Configure ++++ b/Configure +@@ -2837,6 +2837,9 @@ + ;; + *) echo "Using usrinc $usrinc." >&4 ;; + esac ++ case "$targetrun" in ++ *qemu*) targethost=dummy ;; ++ esac + case "$targethost" in + '') echo "Targethost not defined." >&4; croak=y ;; + *) echo "Using targethost $targethost." >&4 +@@ -2868,7 +2871,7 @@ + case "$targetfrom" in + '') targetfrom=scp ;; + esac +- run=$run-$targetrun ++ run=$run-`basename $targetrun` + to=$to-$targetto + from=$from-$targetfrom + case "$targetdir" in +@@ -2908,6 +2911,14 @@ + $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@" + EOF + ;; ++ *qemu*) ++ to=: ++ from=: ++ cat >$run <&4 + exit 1 + ;; +@@ -5048,7 +5059,7 @@ + echo " "; + echo "Checking if your compiler accepts $flag" 2>&1; + echo "int main(void) { return 0; }" > gcctest.c; +-if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then ++if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then + echo "Yes, it does." 2>&1; + if $test -s gcctest.out ; then + echo "But your platform does not like it:"; diff --git a/package/perl/perl-make-ext.patch b/package/perl/perl-make-ext.patch new file mode 100644 index 0000000..e0195e7 --- /dev/null +++ b/package/perl/perl-make-ext.patch @@ -0,0 +1,24 @@ +Don't use RUN with make (only for perl) + +Signed-off-by: Francois Perrad + +Index: b/make_ext.pl +=================================================================== +--- a/make_ext.pl ++++ b/make_ext.pl +@@ -458,11 +458,13 @@ + # Give makefile an opportunity to rewrite itself. + # reassure users that life goes on... + my @args = ('config', @$pass_through); +- system(@run, @make, @args) and print "@run @make @args failed, continuing anyway...\n"; ++# system(@run, @make, @args) and print "@run @make @args failed, continuing anyway...\n"; ++ system(@make, @args) and print "@make @args failed, continuing anyway...\n"; + } + my @targ = ($target, @$pass_through); + print "Making $target in $ext_dir\n@run @make @targ\n"; +- my $code = system(@run, @make, @targ); ++# my $code = system(@run, @make, @targ); ++ my $code = system(@make, @targ); + die "Unsuccessful make($ext_dir): code=$code" if $code != 0; + + chdir $return_dir || die "Cannot cd to $return_dir: $!"; diff --git a/package/perl/perl-mkppport.patch b/package/perl/perl-mkppport.patch new file mode 100644 index 0000000..97f27a2 --- /dev/null +++ b/package/perl/perl-mkppport.patch @@ -0,0 +1,37 @@ +Add RUN + +Signed-off-by: Francois Perrad + +Index: b/mkppport +=================================================================== +--- a/mkppport ++++ b/mkppport +@@ -1,6 +1,7 @@ + use strict; + use warnings; + ++use Config; + use Getopt::Long; + use File::Spec; + use File::Compare qw( compare ); +@@ -136,14 +137,18 @@ + #---------------------------------------------- + sub run + { ++ my @run = $Config{run}; ++ @run = () if not defined $run[0] or $run[0] eq ''; + my @args = ("-I" . File::Spec->catdir((File::Spec->updir) x 2, 'lib'), @_); + my $run = $perl =~ m/\s/ ? qq("$perl") : $perl; + for (@args) { + $_ = qq("$_") if $^O eq 'VMS' && /^[^"]/; + $run .= " $_"; + } +- print "running $run\n"; +- system $run and die "$run failed: $?\n"; ++# print "running $run\n"; ++# system $run and die "$run failed: $?\n"; ++ print "running ", join(' ', @run, $run), "\n"; ++ system join(' ', @run, $run) and die "@run $run failed: $?\n"; + } + + __END__ diff --git a/package/perl/perl.mk b/package/perl/perl.mk new file mode 100644 index 0000000..b29e99f --- /dev/null +++ b/package/perl/perl.mk @@ -0,0 +1,92 @@ +############################################################# +# +# perl +# +############################################################# + +PERL_VERSION_MAJOR = 16 +PERL_VERSION = 5.$(PERL_VERSION_MAJOR).1 +PERL_SITE = http://www.cpan.org/src/5.0 +PERL_SOURCE = perl-$(PERL_VERSION).tar.bz2 +PERL_LICENSE = Artistic +PERL_LICENSE_FILES = Artistic +PERL_INSTALL_STAGING = YES +PERL_DEPENDENCIES = host-qemu + +PERL_CONF_OPT = -des \ + -Dusecrosscompile \ + -Dtargetrun=$(QEMU_USER) \ + -Dqemulib=$(STAGING_DIR) \ + -Dar="$(TARGET_AR)" \ + -Dcc="$(TARGET_CC)" \ + -Dcpp="$(TARGET_CC)" \ + -Dld="$(TARGET_LD)" \ + -Dnm="$(TARGET_NM)" \ + -Dranlib="$(TARGET_RANLIB)" \ + -Dccflags="$(TARGET_CFLAGS)" \ + -Dldflags="$(TARGET_LDFLAGS) -lgcc_s -lm" \ + -Dlddlflags="-shared" \ + -Dlibc=$(STAGING_DIR)/lib/libc.so \ + -Duseshrplib \ + -Dprefix=/usr \ + -Uoptimize + +ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1) + PERL_CONF_OPT += -Dusedevel +endif + +ifneq ($(BR2_LARGEFILE),y) + PERL_CONF_OPT += -Uuselargefiles +endif + +define PERL_CONFIGURE_CMDS + rm -f $(@D)/config.sh + (cd $(@D); ./Configure $(PERL_CONF_OPT)) + echo "# patched values" >>$(@D)/config.sh + $(SED) '/^myarchname=/d' \ + -e '/^mydomain=/d' \ + -e '/^myhostname=/d' \ + -e '/^myuname=/d' \ + -e '/^osname=/d' \ + -e '/^osvers=/d' \ + -e '/^perladmin=/d' \ + $(@D)/config.sh + echo "myarchname='$(GNU_TARGET_NAME)'" >>$(@D)/config.sh + echo "mydomain=''" >>$(@D)/config.sh + echo "myhostname='$(BR2_TARGET_GENERIC_HOSTNAME)'" >>$(@D)/config.sh + echo "myuname='Buildroot $(BR2_VERSION_FULL)'" >>$(@D)/config.sh + echo "osname='linux'" >>$(@D)/config.sh + echo "osvers='$(BR2_LINUX_KERNEL_VERSION)'" >>$(@D)/config.sh + echo "perladmin='root'" >>$(@D)/config.sh + (cd $(@D); ./Configure -S) + cp $(@D)/config.h $(@D)/xconfig.h + $(SED) 's/UNKNOWN-/Buildroot $(BR2_VERSION_FULL) /' $(@D)/patchlevel.h +endef + +define PERL_BUILD_CMDS + echo "#!/bin/sh" > $(@D)/Cross/miniperl + echo "$(QEMU_USER) $(@D)/miniperl \"\$$@\"" >>$(@D)/Cross/miniperl + chmod +x $(@D)/Cross/miniperl + PERL_MM_OPT="PERL=$(@D)/Cross/miniperl" \ + $(MAKE) -C $(@D) all +endef + +define PERL_INSTALL_STAGING_CMDS + $(MAKE) INSTALL_DEPENDENCE= \ + INSTALLFLAGS= \ + DESTDIR="$(STAGING_DIR)" \ + -C $(@D) install.perl +endef + +define PERL_INSTALL_TARGET_CMDS + $(MAKE) INSTALL_DEPENDENCE= \ + INSTALLFLAGS=-p \ + DESTDIR="$(TARGET_DIR)" \ + -C $(@D) install.perl +endef + +define PERL_CLEAN_CMDS + -$(MAKE) -C $(@D) clean +endef + +$(eval $(generic-package))