Plan 9 from Bell Labs’s /usr/web/sources/contrib/gabidiaz/root/sys/man/1perl/perldos

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings.  \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote.  | will give a
.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
.\" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W-|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
.    ds -- \(*W-
.    ds PI pi
.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
.    ds L" ""
.    ds R" ""
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds -- \|\(em\|
.    ds PI \(*p
.    ds L" ``
.    ds R" ''
'br\}
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.if \nF \{\
.    de IX
.    tm Index:\\$1\t\\n%\t"\\$2"
..
.    nr % 0
.    rr F
.\}
.\"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.hy 0
.if n .na
.\"
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
.    \" fudge factors for nroff and troff
.if n \{\
.    ds #H 0
.    ds #V .8m
.    ds #F .3m
.    ds #[ \f1
.    ds #] \fP
.\}
.if t \{\
.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
.    ds #V .6m
.    ds #F 0
.    ds #[ \&
.    ds #] \&
.\}
.    \" simple accents for nroff and troff
.if n \{\
.    ds ' \&
.    ds ` \&
.    ds ^ \&
.    ds , \&
.    ds ~ ~
.    ds /
.\}
.if t \{\
.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
.\}
.    \" troff and (daisy-wheel) nroff accents
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
.    \" corrections for vroff
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
.    \" for low resolution devices (crt and lpr)
.if \n(.H>23 .if \n(.V>19 \
\{\
.    ds : e
.    ds 8 ss
.    ds o a
.    ds d- d\h'-1'\(ga
.    ds D- D\h'-1'\(hy
.    ds th \o'bp'
.    ds Th \o'LP'
.    ds ae ae
.    ds Ae AE
.\}
.rm #[ #] #H #V #F C
.\" ========================================================================
.\"
.IX Title "PERLDOS 1"
.TH PERLDOS 1 "2002-11-24" "perl v5.8.0" "Perl Programmers Reference Guide"
.SH "NAME"
perldos \- Perl under DOS, W31, W95.
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
These are instructions for building Perl under \s-1DOS\s0 (or w??), using
\&\s-1DJGPP\s0 v2.03 or later.  Under w95 long filenames are supported.
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Before you start, you should glance through the \s-1README\s0 file
found in the top-level directory where the Perl distribution
was extracted.  Make sure you read and understand the terms under
which this software is being distributed.
.PP
This port currently supports MakeMaker (the set of modules that
is used to build extensions to perl).  Therefore, you should be
able to build and install most extensions found in the \s-1CPAN\s0 sites.
.PP
Detailed instructions on how to build and install perl extension
modules, including XS-type modules, is included.  See '\s-1BUILDING\s0 \s-1AND\s0
\&\s-1INSTALLING\s0 \s-1MODULES\s0'.
.Sh "Prerequisites for Compiling Perl on \s-1DOS\s0"
.IX Subsection "Prerequisites for Compiling Perl on DOS"
.IP "\s-1DJGPP\s0" 4
.IX Item "DJGPP"
\&\s-1DJGPP\s0 is a port of \s-1GNU\s0 C/\*(C+ compiler and development tools to 32\-bit,
protected-mode environment on Intel 32\-bit CPUs running MS-DOS and compatible
operating systems, by \s-1DJ\s0 Delorie <[email protected]> and friends.
.Sp
For more details (\s-1FAQ\s0), check out the home of \s-1DJGPP\s0 at:
.Sp
.Vb 1
\&        http://www.delorie.com/djgpp/
.Ve
.Sp
If you have questions about \s-1DJGPP\s0, try posting to the \s-1DJGPP\s0 newsgroup:
comp.os.msdos.djgpp, or use the email gateway [email protected].
.Sp
You can find the full \s-1DJGPP\s0 distribution on any SimTel.Net mirror all over
the world. Like:
.Sp
.Vb 1
\&        ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2*
.Ve
.Sp
You need the following files to build perl (or add new modules):
.Sp
.Vb 13
\&        v2/djdev203.zip
\&        v2gnu/bnu2112b.zip
\&        v2gnu/gcc2953b.zip
\&        v2gnu/bsh204b.zip
\&        v2gnu/mak3791b.zip
\&        v2gnu/fil40b.zip
\&        v2gnu/sed3028b.zip
\&        v2gnu/txt20b.zip
\&        v2gnu/dif272b.zip
\&        v2gnu/grep24b.zip
\&        v2gnu/shl20jb.zip
\&        v2gnu/gwk306b.zip
\&        v2misc/csdpmi5b.zip
.Ve
.Sp
or possibly any newer version.
.IP "Pthreads" 4
.IX Item "Pthreads"
Thread support is not tested in this version of the djgpp perl.
.Sh "Shortcomings of Perl under \s-1DOS\s0"
.IX Subsection "Shortcomings of Perl under DOS"
Perl under \s-1DOS\s0 lacks some features of perl under \s-1UNIX\s0 because of
deficiencies in the UNIX\-emulation, most notably:
.IP "\(bu" 4
\&\fIfork()\fR and \fIpipe()\fR
.IP "\(bu" 4
some features of the \s-1UNIX\s0 filesystem regarding link count and file dates
.IP "\(bu" 4
in-place operation is a little bit broken with short filenames
.IP "\(bu" 4
sockets
.Sh "Building Perl on \s-1DOS\s0"
.IX Subsection "Building Perl on DOS"
.IP "\(bu" 4
Unpack the source package \fIperl5.8*.tar.gz\fR with djtarx. If you want
to use long file names under w95 and also to get Perl to pass all its
tests, don't forget to use
.Sp
.Vb 2
\&        set LFN=y
\&        set FNCASE=y
.Ve
.Sp
before unpacking the archive.
.IP "\(bu" 4
Create a \*(L"symlink\*(R" or copy your bash.exe to sh.exe in your \f(CW\*(C`($DJDIR)/bin\*(C'\fR
directory.
.Sp
.Vb 1
\&        ln -s bash.exe sh.exe
.Ve
.Sp
[If you have the recommended version of bash for \s-1DJGPP\s0, this is already
done for you.]
.Sp
And make the \f(CW\*(C`SHELL\*(C'\fR environment variable point to this \fIsh.exe\fR:
.Sp
.Vb 1
\&        set SHELL=c:/djgpp/bin/sh.exe (use full path name!)
.Ve
.Sp
You can do this in \fIdjgpp.env\fR too. Add this line \s-1BEFORE\s0 any section
definition:
.Sp
.Vb 1
\&        +SHELL=%DJDIR%/bin/sh.exe
.Ve
.IP "\(bu" 4
If you have \fIsplit.exe\fR and \fIgsplit.exe\fR in your path, then rename 
\&\fIsplit.exe\fR to \fIdjsplit.exe\fR, and \fIgsplit.exe\fR to \fIsplit.exe\fR.
Copy or link \fIgecho.exe\fR to \fIecho.exe\fR if you don't have \fIecho.exe\fR.
Copy or link \fIgawk.exe\fR to \fIawk.exe\fR if you don't have \fIawk.exe\fR.
.Sp
[If you have the recommended versions of djdev, shell utilities and
gawk, all these are already done for you, and you will not need to do
anything.]
.IP "\(bu" 4
Chdir to the djgpp subdirectory of perl toplevel and type the following
commands:
.Sp
.Vb 2
\&        set FNCASE=y
\&        configure.bat
.Ve
.Sp
This will do some preprocessing then run the Configure script for you.
The Configure script is interactive, but in most cases you just need to
press \s-1ENTER\s0.  The \*(L"set\*(R" command ensures that \s-1DJGPP\s0 preserves the letter
case of file names when reading directories.  If you already issued this
set command when unpacking the archive, and you are in the same \s-1DOS\s0
session as when you unpacked the archive, you don't have to issue the
set command again.  This command is necessary *before* you start to 
(re)configure or (re)build perl in order to ensure both that perl builds 
correctly and that building XS-type modules can succeed.  See the \s-1DJGPP\s0 
info entry for \*(L"_preserve_fncase\*(R" for more information:
.Sp
.Vb 1
\&        info libc alphabetical _preserve_fncase
.Ve
.Sp
If the script says that your package is incomplete, and asks whether
to continue, just answer with Y (this can only happen if you don't use
long filenames or forget to issue \*(L"set FNCASE=y\*(R" first).
.Sp
When Configure asks about the extensions, I suggest \s-1IO\s0 and Fcntl,
and if you want database handling then SDBM_File or GDBM_File
(you need to install gdbm for this one). If you want to use the
\&\s-1POSIX\s0 extension (this is the default), make sure that the stack
size of your \fIcc1.exe\fR is at least 512kbyte (you can check this
with: \f(CW\*(C`stubedit cc1.exe\*(C'\fR).
.Sp
You can use the Configure script in non-interactive mode too.
When I built my \fIperl.exe\fR, I used something like this:
.Sp
.Vb 1
\&        configure.bat -des
.Ve
.Sp
You can find more info about Configure's command line switches in
the \fI\s-1INSTALL\s0\fR file.
.Sp
When the script ends, and you want to change some values in the
generated \fIconfig.sh\fR file, then run
.Sp
.Vb 1
\&        sh Configure -S
.Ve
.Sp
after you made your modifications.
.Sp
\&\s-1IMPORTANT:\s0 if you use this \f(CW\*(C`\-S\*(C'\fR switch, be sure to delete the \s-1CONFIG\s0
environment variable before running the script:
.Sp
.Vb 1
\&        set CONFIG=
.Ve
.IP "\(bu" 4
Now you can compile Perl. Type:
.Sp
.Vb 1
\&        make
.Ve
.Sh "Testing Perl on \s-1DOS\s0"
.IX Subsection "Testing Perl on DOS"
Type:
.PP
.Vb 1
\&        make test
.Ve
.PP
If you're lucky you should see \*(L"All tests successful\*(R". But there can be
a few failed subtests (less than 5 hopefully) depending on some external
conditions (e.g. some subtests fail under linux/dosemu or plain dos
with short filenames only).
.Sh "Installation of Perl on \s-1DOS\s0"
.IX Subsection "Installation of Perl on DOS"
Type:
.PP
.Vb 1
\&        make install
.Ve
.PP
This will copy the newly compiled perl and libraries into your \s-1DJGPP\s0
directory structure. Perl.exe and the utilities go into \f(CW\*(C`($DJDIR)/bin\*(C'\fR,
and the library goes under \f(CW\*(C`($DJDIR)/lib/perl5\*(C'\fR. The pod documentation
goes under \f(CW\*(C`($DJDIR)/lib/perl5/pod\*(C'\fR.
.SH "BUILDING AND INSTALLING MODULES ON DOS"
.IX Header "BUILDING AND INSTALLING MODULES ON DOS"
.Sh "Building Prerequisites for Perl on \s-1DOS\s0"
.IX Subsection "Building Prerequisites for Perl on DOS"
For building and installing non-XS modules, all you need is a working
perl under \s-1DJGPP\s0.  Non-XS modules do not require re-linking the perl
binary, and so are simpler to build and install.
.PP
XS-type modules do require re-linking the perl binary, because part of
an \s-1XS\s0 module is written in \*(L"C\*(R", and has to be linked together with the
perl binary to be executed.  This is required because perl under \s-1DJGPP\s0
is built with the \*(L"static link\*(R" option, due to the lack of \*(L"dynamic
linking\*(R" in the \s-1DJGPP\s0 environment.
.PP
Because \s-1XS\s0 modules require re-linking of the perl binary, you need both
the perl binary distribution and the perl source distribution to build
an \s-1XS\s0 extension module.  In addition, you will have to have built your
perl binary from the source distribution so that all of the components
of the perl binary are available for the required link step.
.Sh "Unpacking \s-1CPAN\s0 Modules on \s-1DOS\s0"
.IX Subsection "Unpacking CPAN Modules on DOS"
First, download the module package from \s-1CPAN\s0 (e.g., the \*(L"Comma Separated
Value\*(R" text package, Text\-CSV\-0.01.tar.gz).  Then expand the contents of
the package into some location on your disk.  Most \s-1CPAN\s0 modules are
built with an internal directory structure, so it is usually safe to
expand it in the root of your \s-1DJGPP\s0 installation.  Some people prefer to
locate source trees under /usr/src (i.e., \f(CW\*(C`($DJDIR)/usr/src\*(C'\fR), but you may
put it wherever seems most logical to you, *EXCEPT* under the same
directory as your perl source code.  There are special rules that apply
to modules which live in the perl source tree that do not apply to most
of the modules in \s-1CPAN\s0.
.PP
Unlike other \s-1DJGPP\s0 packages, which are normal \*(L"zip\*(R" files, most \s-1CPAN\s0
module packages are \*(L"gzipped tarballs\*(R".  Recent versions of WinZip will
safely unpack and expand them, *UNLESS* they have zero-length files.  It
is a known WinZip bug (as of v7.0) that it will not extract zero-length
files.
.PP
From the command line, you can use the djtar utility provided with \s-1DJGPP\s0
to unpack and expand these files.  For example:
.PP
.Vb 1
\&        C:\edjgpp>djtarx -v Text-CSV-0.01.tar.gz
.Ve
.PP
This will create the new directory \f(CW\*(C`($DJDIR)/Text\-CSV\-0.01\*(C'\fR, filling
it with the source for this module.
.Sh "Building Non-XS Modules on \s-1DOS\s0"
.IX Subsection "Building Non-XS Modules on DOS"
To build a non-XS module, you can use the standard module-building
instructions distributed with perl modules.
.PP
.Vb 4
\&    perl Makefile.PL
\&    make
\&    make test
\&    make install
.Ve
.PP
This is sufficient because non-XS modules install only \*(L".pm\*(R" files and
(sometimes) pod and/or man documentation.  No re-linking of the perl
binary is needed to build, install or use non-XS modules.
.Sh "Building \s-1XS\s0 Modules on \s-1DOS\s0"
.IX Subsection "Building XS Modules on DOS"
To build an \s-1XS\s0 module, you must use the standard module-building
instructions distributed with perl modules *PLUS* three extra
instructions specific to the \s-1DJGPP\s0 \*(L"static link\*(R" build environment.
.PP
.Vb 7
\&    set FNCASE=y
\&    perl Makefile.PL
\&    make
\&    make perl
\&    make test
\&    make -f Makefile.aperl inst_perl MAP_TARGET=perl.exe
\&    make install
.Ve
.PP
The first extra instruction sets \s-1DJGPP\s0's \s-1FNCASE\s0 environment variable so
that the new perl binary which you must build for an XS-type module will
build correctly.  The second extra instruction re-builds the perl binary
in your module directory before you run \*(L"make test\*(R", so that you are
testing with the new module code you built with \*(L"make\*(R".  The third extra
instruction installs the perl binary from your module directory into the
standard \s-1DJGPP\s0 binary directory, \f(CW\*(C`($DJDIR)/bin\*(C'\fR, replacing your
previous perl binary.
.PP
Note that the \s-1MAP_TARGET\s0 value *must* have the \*(L".exe\*(R" extension or you
will not create a \*(L"perl.exe\*(R" to replace the one in \f(CW\*(C`($DJDIR)/bin\*(C'\fR.
.PP
When you are done, the XS-module install process will have added information
to your \*(L"perllocal\*(R" information telling that the perl binary has been replaced,
and what module was installed.  you can view this information at any time
by using the command:
.PP
.Vb 1
\&        perl -S perldoc perllocal
.Ve
.SH "AUTHOR"
.IX Header "AUTHOR"
Laszlo Molnar, \[email protected]\fR [Installing/building perl]
.PP
Peter J. Farley \s-1III\s0 \[email protected]\fR [Building/installing modules]
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIperl\fR\|(1).

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].