Commit 4bb3d3bd authored by Francois Perrad's avatar Francois Perrad Committed by Peter Korsgaard
Browse files

perl: new package

parent 63c287bd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -279,6 +279,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"

package/perl/Config.in

0 → 100644
+18 −0
Original line number Diff line number Diff line
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
	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
+53 −0
Original line number Diff line number Diff line
Add qemu support

see https://rt.perl.org/rt3//Public/Bug/Display.html?id=114798

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>

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 <<EOF
+#!/bin/sh
+$targetrun -L $qemulib "\$@"
+EOF
+	    ;;
 	*)  echo "Unknown targetrun '$targetrun'" >&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:";
+24 −0
Original line number Diff line number Diff line
Don't use RUN with make (only for perl)

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>

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: $!";
+37 −0
Original line number Diff line number Diff line
Add RUN

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>

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__
Loading