Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

202 lines
6.3 KiB

  1. This document is written in pod format hence there are punctuation
  2. characters in in odd places. Do not worry, you've apparently got the
  3. ASCII->EBCDIC translation worked out correctly. You can read more
  4. about pod in pod/perlpod.pod or the short summary in the INSTALL file.
  5. =head1 NAME
  6. README.BS2000 - building and installing Perl for BS2000.
  7. =head1 SYNOPSIS
  8. This document will help you Configure, build, test and install Perl
  9. on BS2000 in the POSIX subsystem.
  10. =head1 DESCRIPTION
  11. This is a ported perl for the POSIX subsystem in BS2000 VERSION OSD
  12. V3.1A or later. It may work on other versions, but we started porting
  13. and testing it with 3.1A and are currently using Version V4.0A.
  14. You may need the following GNU programs in order to install perl:
  15. =head2 gzip
  16. We used version 1.2.4, which could be installed out of the box with
  17. one failure during 'make check'.
  18. =head2 bison
  19. The yacc coming with BS2000 POSIX didn't work for us. So we had to
  20. use bison. We had to make a few changes to perl in order to use the
  21. pure (reentrant) parser of bison. We used version 1.25, but we had to
  22. add a few changes due to EBCDIC. See below for more details
  23. concerning yacc.
  24. =head2 Unpacking
  25. To extract an ASCII tar archive on BS2000 POSIX you need an ASCII
  26. filesystem (we used the mountpoint /usr/local/ascii for this). Now
  27. you extract the archive in the ASCII filesystem without
  28. I/O-conversion:
  29. cd /usr/local/ascii
  30. export IO_CONVERSION=NO
  31. gunzip < /usr/local/src/perl.tar.gz | pax -r
  32. You may ignore the error message for the first element of the archive
  33. (this doesn't look like a tar archive / skipping to next file...),
  34. it's only the directory which will be created automatically anyway.
  35. After extracting the archive you copy the whole directory tree to your
  36. EBCDIC filesystem. B<This time you use I/O-conversion>:
  37. cd /usr/local/src
  38. IO_CONVERSION=YES
  39. cp -r /usr/local/ascii/perl5.005_02 ./
  40. =head2 Compiling
  41. There is a "hints" file for BS2000 called hints.posix-bc (because
  42. posix-bc is the OS name given by `uname`) that specifies the correct
  43. values for most things. The major problem is (of course) the EBCDIC
  44. character set. We have german EBCDIC version.
  45. Because of our problems with the native yacc we used GNU bison to
  46. generate a pure (=reentrant) parser for perly.y. So our yacc is
  47. really the following script:
  48. -----8<-----/usr/local/bin/yacc-----8<-----
  49. #! /usr/bin/sh
  50. # Bison as a reentrant yacc:
  51. # save parameters:
  52. params=""
  53. while [[ $# -gt 1 ]]; do
  54. params="$params $1"
  55. shift
  56. done
  57. # add flag %pure_parser:
  58. tmpfile=/tmp/bison.$$.y
  59. echo %pure_parser > $tmpfile
  60. cat $1 >> $tmpfile
  61. # call bison:
  62. echo "/usr/local/bin/bison --yacc $params $1\t\t\t(Pure Parser)"
  63. /usr/local/bin/bison --yacc $params $tmpfile
  64. # cleanup:
  65. rm -f $tmpfile
  66. -----8<----------8<-----
  67. We still use the normal yacc for a2p.y though!!! We made a softlink
  68. called byacc to distinguish between the two versions:
  69. ln -s /usr/bin/yacc /usr/local/bin/byacc
  70. We build perl using GNU make. We tried the native make once and it
  71. worked too.
  72. =head2 Testing
  73. We still got a few errors during C<make test>. Some of them are the
  74. result of using bison. Bison prints I<parser error> instead of I<syntax
  75. error>, so we may ignore them. The following list shows
  76. our errors, your results may differ:
  77. op/numconvert.......FAILED tests 1409-1440
  78. op/regexp...........FAILED tests 483, 496
  79. op/regexp_noamp.....FAILED tests 483, 496
  80. pragma/overload.....FAILED tests 152-153, 170-171
  81. pragma/warnings.....FAILED tests 14, 82, 129, 155, 192, 205, 207
  82. lib/bigfloat........FAILED tests 351-352, 355
  83. lib/bigfltpm........FAILED tests 354-355, 358
  84. lib/complex.........FAILED tests 267, 487
  85. lib/dumper..........FAILED tests 43, 45
  86. Failed 11/231 test scripts, 95.24% okay. 57/10595 subtests failed, 99.46% okay.
  87. =head2 Install
  88. We have no nroff on BS2000 POSIX (yet), so we ignored any errors while
  89. installing the documentation.
  90. =head2 Using Perl in the Posix-Shell
  91. BS2000 POSIX doesn't support the shebang notation
  92. (C<#!/usr/local/bin/perl>), so you have to use the following lines
  93. instead:
  94. : # use perl
  95. eval 'exec /usr/local/bin/perl -S $0 ${1+"$@"}'
  96. if $running_under_some_shell;
  97. =head2 Using Perl in "native" BS2000
  98. We don't have much experience with this yet, but try the following:
  99. Copy your Perl executable to a BS2000 LLM using bs2cp:
  100. C<bs2cp /usr/local/bin/perl 'bs2:perl(perl,l)'>
  101. Now you can start it with the following (SDF) command:
  102. C</START-PROG FROM-FILE=*MODULE(PERL,PERL),PROG-MODE=*ANY,RUN-MODE=*ADV>
  103. First you get the BS2000 commandline prompt ('*'). Here you may enter
  104. your parameters, e.g. C<-e 'print "Hello World!\\n";'> (note the
  105. double backslash!) or C<-w> and the name of your Perl script.
  106. Filenames starting with C</> are searched in in the Posix filesystem,
  107. others are searched in the BS2000 filesystem. You may even use
  108. wildcards if you put a C<%> in front of your filename (e.g. C<-w
  109. checkfiles.pl %*.c>). Read your C/C++ manual for additional
  110. possibilities of the commandline prompt (look for
  111. PARAMETER-PROMPTING).
  112. =head2 Floating point anomalies
  113. There appears to be a bug in the floating point implementation on BS2000 POSIX
  114. systems such that calling int() on the product of a number and a small
  115. magnitude number is not the same as calling int() on the quotient of
  116. that number and a large magnitude number. For example, in the following
  117. Perl code:
  118. my $x = 100000.0;
  119. my $y = int($x * 1e-5) * 1e5; # '0'
  120. my $z = int($x / 1e+5) * 1e5; # '100000'
  121. print "\$y is $y and \$z is $z\n"; # $y is 0 and $z is 100000
  122. Although one would expect the quantities $y and $z to be the same and equal
  123. to 100000 they will differ and instead will be 0 and 100000 respectively.
  124. =head1 AUTHORS
  125. Thomas Dorner
  126. =head1 SEE ALSO
  127. L<INSTALL>, L<perlport>.
  128. =head2 Mailing list
  129. The Perl Institute (http://www.perl.org/) maintains a perl-mvs mailing
  130. list of interest to all folks building and/or using perl on EBCDIC
  131. platforms. To subscribe, send a message of:
  132. subscribe perl-mvs
  133. to [email protected].
  134. =head1 HISTORY
  135. This document was originally written by Thomas Dorner for the 5.005
  136. release of Perl.
  137. This document was podified for the 5.6 release of perl 11 July 2000.
  138. =cut