DESCRIPTION
- Prerequisites
- Starting Perl programs under AmigaOS
+ - Shortcomings of Perl under AmigaOS
INSTALLATION
Accessing documentation
- Manpages
necessary, F<perl> would be enough, but having full path would make it
easier to use your script under *nix.)
+=head2 Shortcomings of Perl under AmigaOS
+
+Perl under AmigaOS lacks some features of perl under UNIX because of
+deficiencies in the UNIX-emulation, most notably:
+
+=over 6
+
+=item fork()
+
+=item some features of the UNIX filesystem regarding link count and file dates
+
+=item inplace operation (the -i switch) without backup file
+
+=item umask() works, but the correct permissions are only set when the file is
+ finally close()d
+
+=back
+
=head1 INSTALLATION
Change to the installation directory (most probably ADE:), and
make test
-Some tests will fail. Here is which, and why:
-
-=over 8
-
-=item F<io/fs.t>, F<op/stat.t>, F<lib/*dbm.t>, F<lib/db-*.t>
-
-Check I<file system> operations. Failures result from the inability to
-emulate some Unixisms with the standard Amiga filesystem.
-
-=item F<io/pipe.t>, F<op/fork.t>, F<lib/filehand.t>, F<lib/open2.t>,
- F<lib/open3.t>, F<lib/io_pipe.t>, F<lib/io_sock.t>
+Some tests will be skipped because they need the fork() function:
-These tests will be skipped because they use the fork() function, which is not
-supported under AmigaOS.
-
-=item F<op/magic.t>
-
-The ixemul.library doesn't set the expected values for $0 and $^X.
-
-=back
+F<io/pipe.t>, F<op/fork.t>, F<lib/filehand.t>, F<lib/open2.t>, F<lib/open3.t>,
+F<lib/io_pipe.t>, F<lib/io_sock.t>
=head2 Installing the built perl
# Avoid telldir prototype conflict in pp_sys.c (AmigaOS uses const DIR *)
# Configure should test for this. Volunteers?
pp_sys_cflags='ccflags="$ccflags -DHAS_TELLDIR_PROTOTYPE"'
+
+# AmigaOS always reports only two links to directories, even if they
+# contain subdirectories. Consequently, we use this variable to stop
+# File::Find using the link count to determine whether there are
+# subdirectories to be searched. This will generate a harmless message:
+# Hmm...You had some extra variables I don't know about...I'll try to keep 'em.
+# Propagating recommended variable dont_use_nlink
+dont_use_nlink='define'
if ($Config{dont_use_nlink} || $nlink == 3)
{print "ok 4\n";} else {print "not ok 4\n";}
-if (($mode & 0777) == 0666) {print "ok 5\n";} else {print "not ok 5\n";}
+if (($mode & 0777) == 0666 || $^O eq 'amigaos') {print "ok 5\n";} else {print "not ok 5\n";}
if ((chmod 0777,'a') == 1) {print "ok 6\n";} else {print "not ok 6\n";}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat('b');
if ($ino) {print "ok 17\n";} else {print "not ok 17\n";}
-if (($atime == 500000000 && $mtime == 500000001) || $wd =~ m#/afs/#)
+if (($atime == 500000000 && $mtime == 500000001) || $wd =~ m#/afs/# || $^O eq 'amigaos')
{print "ok 18\n";}
else
{print "not ok 18 $atime $mtime\n";}
}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat($Dfile);
-print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) ? "ok 2\n" : "not ok 2\n");
+print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos'
+ ? "ok 2\n" : "not ok 2\n");
while (($key,$value) = each(%h)) {
$i++;
}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat($Dfile);
-ok(20, ($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) );
+ok(20, ($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos');
while (($key,$value) = each(%h)) {
$i++;
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat($Dfile);
-ok(16, ($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) );
+ok(16, ($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos');
while (($key,$value) = each(%h)) {
$i++;
my @h ;
ok(17, $X = tie @h, 'DB_File', $Dfile, O_RDWR|O_CREAT, 0640, $DB_RECNO ) ;
-ok(18, ( (stat($Dfile))[2] & 0777) == ($^O eq 'os2' ? 0666 : 0640)) ;
+ok(18, ( (stat($Dfile))[2] & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos') ;
#my $l = @h ;
my $l = $X->length ;
}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat($Dfile);
-print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) ? "ok 2\n" : "not ok 2\n");
+print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos'
+ ? "ok 2\n" : "not ok 2\n");
while (($key,$value) = each(%h)) {
$i++;
}
}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat($Dfile);
-print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) ? "ok 2\n" : "not ok 2\n");
+print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos'
+ ? "ok 2\n" : "not ok 2\n");
while (($key,$value) = each(%h)) {
$i++;
}
}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat($Dfile);
-print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) ? "ok 2\n" : "not ok 2\n");
+print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos'
+ ? "ok 2\n" : "not ok 2\n");
while (($key,$value) = each(%h)) {
$i++;
}
}
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
$blksize,$blocks) = stat($Dfile);
-print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) ? "ok 2\n" : "not ok 2\n");
+print (($mode & 0777) == ($^O eq 'os2' ? 0666 : 0640) || $^O eq 'amigaos'
+ ? "ok 2\n" : "not ok 2\n");
while (($key,$value) = each(%h)) {
$i++;
}
# Started by ksh, which adds suffixes '.exe' and '.' to perl and script
$s2 = "\$^X is $wd/perl.exe, \$0 is $script.\n";
}
+if ($^O eq 'amigaos') {
+ chomp($s2 = `pwd`);
+ $s2 = "\$^X is $script, \$0 is $s2/show-shebang\n";
+}
ok 19, open(SCRIPT, ">$script"), $!;
ok 20, print(SCRIPT <<EOB . <<'EOF'), $!;
#!$wd/perl
if ($Config{dont_use_nlink} || $nlink == 2)
{print "ok 3\n";} else {print "not ok 3\n";}
-if (($mtime && $mtime != $ctime) || $cwd =~ m#/afs/#) {
+if (($mtime && $mtime != $ctime) || $cwd =~ m#/afs/# || $^O eq 'amigaos') {
print "ok 4\n";
}
else {
{print "not ok 33\n";}
if (! -b '.') {print "ok 34\n";} else {print "not ok 34\n";}
+if ($^O eq 'amigaos') {print "ok 35\n"; goto tty_test;}
+
$cnt = $uid = 0;
die "Can't run op/stat.t test 35 without pwd working" unless $cwd;