summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Waugh <alex@alexwaugh.com>2006-04-17 01:14:26 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-04-18 12:48:31 +0000
commit7ee146b12403586cf7249a676b2be9b7658f67fd (patch)
tree1b79a89c55197bf11d0879b5cceab0caa61a53a5
parent4154741246a440c7ccc4e633e6d115949af4ee56 (diff)
downloadperl-7ee146b12403586cf7249a676b2be9b7658f67fd.tar.gz
Support compiling for RISC OS
Message-ID: <2498b2184e.ajw498@caramel.cp15.org> p4raw-id: //depot/perl@27884
-rw-r--r--MANIFEST2
-rw-r--r--README.riscos63
-rw-r--r--ext/Errno/Errno_pm.PL6
-rw-r--r--hints/riscos.sh20
-rw-r--r--hv.c2
-rw-r--r--util.c12
6 files changed, 98 insertions, 7 deletions
diff --git a/MANIFEST b/MANIFEST
index e45ccadecb..a09802c6c2 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1291,6 +1291,7 @@ hints/powerux.sh Hints for named architecture
hints/qnx.sh Hints for named architecture
hints/README.hints Notes about hints
hints/rhapsody.sh Hints for named architecture
+hints/riscos.sh Hints for named architecture
hints/sco_2_3_0.sh Hints for named architecture
hints/sco_2_3_1.sh Hints for named architecture
hints/sco_2_3_2.sh Hints for named architecture
@@ -3021,6 +3022,7 @@ README.os390 Perl notes for OS/390
README.os400 Perl notes for OS/400
README.plan9 Perl notes for Plan 9
README.qnx Perl notes for QNX
+README.riscos Perl notes for RISC OS
README.solaris Perl notes for Solaris
README.symbian Perl notes for Symbian
README.tru64 Perl notes for Tru64
diff --git a/README.riscos b/README.riscos
new file mode 100644
index 0000000000..61202fe5a2
--- /dev/null
+++ b/README.riscos
@@ -0,0 +1,63 @@
+If you read this file _as_is_, just ignore the funny characters you
+see. It is written in the POD format (see pod/perlpod.pod) which is
+specifically designed to be readable as is.
+
+=head1 NAME
+
+README.riscos - Perl version 5 for RISC OS
+
+=head1 DESCRIPTION
+
+This document give instructions for building Perl for RISC OS. It is
+complicated by the need to cross compile. There is a binary version of
+perl available from L<http://www.cp15.org/perl/> which you may wish to
+use instead of trying to compile it yourself.
+
+=head1 BUILD
+
+You need an installed and working gccsdk cross compiler
+L<http://gccsdk.riscos.info/> and REXEN
+L<http://www.cp15.org/programming/>
+
+Firstly, copy the source and build a native copy of perl for your host
+system.
+Then, in the source to be cross compiled:
+
+=over 4
+
+=item
+
+ $ ./Configure
+
+=item
+
+Select the riscos hint file. The default answers for the rest of the
+questions are usually sufficient.
+
+=item
+
+ $ make miniperl
+
+=item
+
+This should build miniperl and then fail when it tries to run it.
+
+=item
+
+Copy the miniperl executable from the native build done earlier to
+replace the cross compiled miniperl.
+
+=item
+
+ $ make
+
+=item
+
+This will use miniperl to complete the rest of the build.
+
+=back
+
+=head1 AUTHOR
+
+Alex Waugh <alex@alexwaugh.com>
+
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
index a09f9f68ad..ac38f39af1 100644
--- a/ext/Errno/Errno_pm.PL
+++ b/ext/Errno/Errno_pm.PL
@@ -134,6 +134,12 @@ sub get_files {
} elsif ($Config{archname} eq 'epoc') {
# Watch out for cross compiling for EPOC (usually done on linux)
$file{'/usr/local/epocemx/epocsdk/include/libc/sys/errno.h'} = 1;
+ } elsif ($Config{archname} eq 'arm-riscos') {
+ # Watch out for cross compiling for RISC OS
+ my $dep = `echo "#include <errno.h>" | gcc -E -M -`;
+ if ($dep =~ /(\S+errno\.h)/) {
+ $file{$1} = 1;
+ }
} elsif ($^O eq 'linux' &&
$Config{gccversion} ne '' # might be using, say, Intel's icc
) {
diff --git a/hints/riscos.sh b/hints/riscos.sh
new file mode 100644
index 0000000000..e87e99ce14
--- /dev/null
+++ b/hints/riscos.sh
@@ -0,0 +1,20 @@
+#! /bin/sh
+# riscos.sh - hints for building perl using the gccsdk cross compiler for RISC OS
+#
+
+
+cc='gcc'
+locincpth=""
+ccflags="-mpoke-function-name -DDYNAMIC_ENV_FETCH -DPERL_USE_SAFE_PUTENV"
+prefix='/<Perl$Dir>'
+osname='riscos'
+libpth=' '
+optimize='-O2'
+myarchname=''
+archname='arm-riscos'
+installprefix='~/PerlInst'
+mkdir -p $installprefix
+startperl="#!/usr/bin/perl"
+i_shadow='undef'
+ebcdic='undef'
+
diff --git a/hv.c b/hv.c
index d912ccd6bc..09b1b3fa0a 100644
--- a/hv.c
+++ b/hv.c
@@ -2118,7 +2118,7 @@ Perl_hv_iternext_flags(pTHX_ HV *hv, I32 flags)
iter->xhv_eiter = NULL; /* HvEITER(hv) = NULL */
return NULL;
}
-#ifdef DYNAMIC_ENV_FETCH /* set up %ENV for iteration */
+#if defined(DYNAMIC_ENV_FETCH) && !defined(__riscos__) /* set up %ENV for iteration */
if (!entry && SvRMAGICAL((SV*)hv) && mg_find((SV*)hv, PERL_MAGIC_env)) {
prime_env_iter();
#ifdef VMS
diff --git a/util.c b/util.c
index e27d02ec16..18a5cd5d6e 100644
--- a/util.c
+++ b/util.c
@@ -1601,15 +1601,15 @@ Perl_my_setenv(pTHX_ const char *nam, const char *val)
}
else
safesysfree(environ[i]);
- nlen = strlen(nam);
- vlen = strlen(val);
+ nlen = strlen(nam);
+ vlen = strlen(val);
- environ[i] = (char*)safesysmalloc((nlen+vlen+2) * sizeof(char));
- /* all that work just for this */
- my_setenv_format(environ[i], nam, nlen, val, vlen);
+ environ[i] = (char*)safesysmalloc((nlen+vlen+2) * sizeof(char));
+ /* all that work just for this */
+ my_setenv_format(environ[i], nam, nlen, val, vlen);
} else {
# endif
-# if defined(__CYGWIN__) || defined(EPOC) || defined(__SYMBIAN32__)
+# if defined(__CYGWIN__) || defined(EPOC) || defined(__SYMBIAN32__) || defined(__riscos__)
# if defined(HAS_UNSETENV)
if (val == NULL) {
(void)unsetenv(nam);