41 |
|
|
42 |
|
Contents (This may be a little bit obsolete) |
43 |
|
|
44 |
< |
perlos2 - Perl under OS/2, DOS, Win0.3*, Win0.95 and WinNT. |
44 |
> |
perlos2 - Perl under OS/2, DOS, Win0.3*, Win0.95 and WinNT. |
45 |
|
|
46 |
|
NAME |
47 |
|
SYNOPSIS |
180 |
|
run (and build extensions, and - possibly - be built itself) under any |
181 |
|
environment which can run EMX. The current list is DOS, |
182 |
|
DOS-inside-OS/2, Win0.3*, Win0.95 and WinNT. Out of many perl flavors, |
183 |
< |
only one works, see L<"perl_.exe">. |
183 |
> |
only one works, see L</"F<perl_.exe>">. |
184 |
|
|
185 |
|
Note that not all features of Perl are available under these |
186 |
|
environments. This depends on the features the I<extender> - most |
224 |
|
|
225 |
|
To run Perl on DPMI platforms one needs RSX runtime. This is |
226 |
|
needed under DOS-inside-OS/2, Win0.3*, Win0.95 and WinNT (see |
227 |
< |
L<"Other OSes">). RSX would not work with VCPI |
227 |
> |
L</"Other OSes">). RSX would not work with VCPI |
228 |
|
only, as EMX would, it requires DMPI. |
229 |
|
|
230 |
|
Having RSX and the latest F<sh.exe> one gets a fully functional |
261 |
|
pipes in between, and/or quoting of arguments), Perl uses an external |
262 |
|
shell. With EMX port such shell should be named F<sh.exe>, and located |
263 |
|
either in the wired-in-during-compile locations (usually F<F:/bin>), |
264 |
< |
or in configurable location (see L<"PERL_SH_DIR">). |
264 |
> |
or in configurable location (see L</"C<PERL_SH_DIR>">). |
265 |
|
|
266 |
|
For best results use EMX pdksh. The standard binary (5.2.14 or later) runs |
267 |
|
under DOS (with L</RSX>) as well, see |
328 |
|
do). |
329 |
|
|
330 |
|
Note however that to use some of these operators you need to have a |
331 |
< |
sh-syntax shell installed (see L<"Pdksh">, |
332 |
< |
L<"Frequently asked questions">), and perl should be able to find it |
333 |
< |
(see L<"PERL_SH_DIR">). |
331 |
> |
sh-syntax shell installed (see L</"Pdksh">, |
332 |
> |
L</"Frequently asked questions">), and perl should be able to find it |
333 |
> |
(see L</"C<PERL_SH_DIR>">). |
334 |
|
|
335 |
|
The cases when the shell is used are: |
336 |
|
|
404 |
|
other words, C<PATH> is essentially searched twice: once by the OS for |
405 |
|
an executable, then by Perl for scripts. |
406 |
|
|
407 |
< |
Note also that executable files on OS/2 can have an arbitrary extension, |
408 |
< |
but F<.exe> will be automatically appended if no dot is present in the name. |
409 |
< |
The workaround is as simple as that: since F<blah.> and F<blah> denote the |
410 |
< |
same file (at list on FAT and HPFS file systems), to start an executable residing in file F<n:/bin/blah> (no |
411 |
< |
extension) give an argument C<n:/bin/blah.> (dot appended) to system(). |
407 |
> |
Note also that executable files on OS/2 can have an arbitrary extension, but |
408 |
> |
F<.exe> will be automatically appended if no dot is present in the name. The |
409 |
> |
workaround is as simple as that: since F<blah.> and F<blah> denote the same |
410 |
> |
file (at list on FAT and HPFS file systems), to start an executable residing in |
411 |
> |
file F<n:/bin/blah> (no extension) give an argument C<n:/bin/blah.> (dot |
412 |
> |
appended) to system(). |
413 |
|
|
414 |
|
Perl will start PM programs from VIO (=text-mode) Perl process in a |
415 |
|
separate PM session; |
475 |
|
|
476 |
|
=head2 C<``> and pipe-C<open> do not work under DOS. |
477 |
|
|
478 |
< |
This may a variant of just L<"I cannot run external programs">, or a |
478 |
> |
This may a variant of just L</"I cannot run external programs">, or a |
479 |
|
deeper problem. Basically: you I<need> RSX (see L</Prerequisites>) |
480 |
|
for these commands to work, and you may need a port of F<sh.exe> which |
481 |
|
understands command arguments. One of such ports is listed in |
482 |
|
L</Prerequisites> under RSX. Do not forget to set variable |
483 |
< |
C<L<"PERL_SH_DIR">> as well. |
483 |
> |
L</"C<PERL_SH_DIR>"> as well. |
484 |
|
|
485 |
|
DPMI is required for RSX. |
486 |
|
|
535 |
|
=item C<PERL_BADLANG> |
536 |
|
|
537 |
|
may be needed if you change your codepage I<after> perl installation, |
538 |
< |
and the new value is not supported by EMX. See L<"PERL_BADLANG">. |
538 |
> |
and the new value is not supported by EMX. See L</"C<PERL_BADLANG>">. |
539 |
|
|
540 |
|
=item C<PERL_BADFREE> |
541 |
|
|
542 |
< |
see L<"PERL_BADFREE">. |
542 |
> |
see L</"C<PERL_BADFREE>">. |
543 |
|
|
544 |
|
=item F<Config.pm> |
545 |
|
|
558 |
|
|
559 |
|
B<NOTE>. Because of a typo the binary installer of 5.00305 |
560 |
|
would install a variable C<PERL_SHPATH> into F<Config.sys>. Please |
561 |
< |
remove this variable and put C<L</PERL_SH_DIR>> instead. |
561 |
> |
remove this variable and put L</C<PERL_SH_DIR>> instead. |
562 |
|
|
563 |
|
=head2 Manual binary installation |
564 |
|
|
615 |
|
into F<perl.exe>, you do not need to change |
616 |
|
anything. However, for perl to find the library if you use a different |
617 |
|
path, you need to |
618 |
< |
C<set PERLLIB_PREFIX> in F<Config.sys>, see L<"PERLLIB_PREFIX">. |
618 |
> |
C<set PERLLIB_PREFIX> in F<Config.sys>, see L</"C<PERLLIB_PREFIX>">. |
619 |
|
|
620 |
|
=item Additional Perl modules |
621 |
|
|
622 |
< |
unzip perl_ste.zip -d f:/perllib/lib/site_perl/5.18.2/ |
622 |
> |
unzip perl_ste.zip -d f:/perllib/lib/site_perl/5.26.0/ |
623 |
|
|
624 |
|
Same remark as above applies. Additionally, if this directory is not |
625 |
|
one of directories on @INC (and @INC is influenced by C<PERLLIB_PREFIX>), you |
675 |
|
require shell, like the commands using I<redirection> and I<shell |
676 |
|
metacharacters>. It is also used instead of explicit F</bin/sh>. |
677 |
|
|
678 |
< |
Set C<PERL_SH_DIR> (see L<"PERL_SH_DIR">) if you move F<sh.exe> from |
678 |
> |
Set C<PERL_SH_DIR> (see L</"C<PERL_SH_DIR>">) if you move F<sh.exe> from |
679 |
|
the above location. |
680 |
|
|
681 |
|
B<Note.> It may be possible to use some other sh-compatible shell (untested). |
696 |
|
|
697 |
|
The automatic and manual perl installation leave precompiled paths |
698 |
|
inside perl executables. While these paths are overwriteable (see |
699 |
< |
L<"PERLLIB_PREFIX">, L<"PERL_SH_DIR">), some people may prefer |
699 |
> |
L</"C<PERLLIB_PREFIX>">, L</"C<PERL_SH_DIR>">), some people may prefer |
700 |
|
binary editing of paths inside the executables/DLLs. |
701 |
|
|
702 |
|
=head1 Accessing documentation |
714 |
|
view perl ExtUtils::MakeMaker |
715 |
|
|
716 |
|
(currently the last two may hit a wrong location, but this may improve |
717 |
< |
soon). Under Win* see L<"SYNOPSIS">. |
717 |
> |
soon). Under Win* see L</"SYNOPSIS">. |
718 |
|
|
719 |
|
If you want to build the docs yourself, and have I<OS/2 toolkit>, run |
720 |
|
|
870 |
|
of the build may fail since an older version of F<perl.dll> loaded into |
871 |
|
memory may be found. Running C<make test> becomes meaningless, since |
872 |
|
the test are checking a previous build of perl (this situation is detected |
873 |
< |
and reported by F<lib/os2_base.t> test). Do not forget to unset |
873 |
> |
and reported by F<os2/os2_base.t> test). Do not forget to unset |
874 |
|
C<PERL_EMXLOAD_SEC> in environment. |
875 |
|
|
876 |
|
Also make sure that you have F</tmp> directory on the current drive, |
948 |
|
|
949 |
|
C<prefix> means: where to install the resulting perl library. Giving |
950 |
|
correct prefix you may avoid the need to specify C<PERLLIB_PREFIX>, |
951 |
< |
see L<"PERLLIB_PREFIX">. |
951 |
> |
see L</"C<PERLLIB_PREFIX>">. |
952 |
|
|
953 |
|
I<Ignore the message about missing C<ln>, and about C<-c> option to |
954 |
|
tr>. The latter is most probably already fixed, if you see it and can trace |
982 |
|
=item A lot of C<bad free> |
983 |
|
|
984 |
|
in database tests related to Berkeley DB. I<This should be fixed already.> |
985 |
< |
If it persists, you may disable this warnings, see L<"PERL_BADFREE">. |
985 |
> |
If it persists, you may disable this warnings, see L</"C<PERL_BADFREE>">. |
986 |
|
|
987 |
|
=item Process terminated by SIGTERM/SIGINT |
988 |
|
|
1002 |
|
|
1003 |
|
The report with F<io/pipe.t> failing may look like this: |
1004 |
|
|
1005 |
< |
Failed Test Status Wstat Total Fail Failed List of failed |
1006 |
< |
------------------------------------------------------------ |
1007 |
< |
io/pipe.t 12 1 8.33% 9 |
1008 |
< |
7 tests skipped, plus 56 subtests skipped. |
1009 |
< |
Failed 1/195 test scripts, 99.49% okay. 1/6542 subtests failed, 99.98% okay. |
1005 |
> |
Failed Test Status Wstat Total Fail Failed List of failed |
1006 |
> |
------------------------------------------------------------ |
1007 |
> |
io/pipe.t 12 1 8.33% 9 |
1008 |
> |
7 tests skipped, plus 56 subtests skipped. |
1009 |
> |
Failed 1/195 test scripts, 99.49% okay. 1/6542 subtests failed, |
1010 |
> |
99.98% okay. |
1011 |
|
|
1012 |
|
The reasons for most important skipped tests are: |
1013 |
|
|
1017 |
|
|
1018 |
|
=over 4 |
1019 |
|
|
1020 |
< |
=item 18 |
1020 |
> |
=item Z<>18 |
1021 |
|
|
1022 |
|
Checks C<atime> and C<mtime> of C<stat()> - unfortunately, HPFS |
1023 |
|
provides only 2sec time granularity (for compatibility with FAT?). |
1024 |
|
|
1025 |
< |
=item 25 |
1025 |
> |
=item Z<>25 |
1026 |
|
|
1027 |
|
Checks C<truncate()> on a filehandle just opened for write - I do not |
1028 |
|
know why this should or should not work. |
1073 |
|
|
1074 |
|
=head2 C<a.out>-style build |
1075 |
|
|
1076 |
< |
Proceed as above, but make F<perl_.exe> (see L<"perl_.exe">) by |
1076 |
> |
Proceed as above, but make F<perl_.exe> (see L</"F<perl_.exe>">) by |
1077 |
|
|
1078 |
|
make perl_ |
1079 |
|
|
1133 |
|
|
1134 |
|
Install the bundle C<Bundle::OS2_default> |
1135 |
|
|
1136 |
< |
perl5.8.2 -MCPAN -e "install Bundle::OS2_default" < nul |& tee 00cpan_i_1 |
1136 |
> |
perl5.8.2 -MCPAN -e "install Bundle::OS2_default" < nul |& tee 00cpan_i_1 |
1137 |
|
|
1138 |
|
This may take a couple of hours on 1GHz processor (when run the first time). |
1139 |
|
And this should not be necessarily a smooth procedure. Some modules may not |
1140 |
|
specify required dependencies, so one may need to repeat this procedure several |
1141 |
|
times until the results stabilize. |
1142 |
|
|
1143 |
< |
perl5.8.2 -MCPAN -e "install Bundle::OS2_default" < nul |& tee 00cpan_i_2 |
1144 |
< |
perl5.8.2 -MCPAN -e "install Bundle::OS2_default" < nul |& tee 00cpan_i_3 |
1143 |
> |
perl5.8.2 -MCPAN -e "install Bundle::OS2_default" < nul |& tee 00cpan_i_2 |
1144 |
> |
perl5.8.2 -MCPAN -e "install Bundle::OS2_default" < nul |& tee 00cpan_i_3 |
1145 |
|
|
1146 |
|
Even after they stabilize, some tests may fail. |
1147 |
|
|
1195 |
|
a new executable per XS extension. |
1196 |
|
|
1197 |
|
Here is a possible workaround: create a toplevel F<Makefile.PL> in |
1198 |
< |
F<$CPANHOME/.cpan/build/> with contents being (compare with L<Making |
1198 |
> |
F<$CPANHOME/.cpan/build/> with contents being (compare with L</Making |
1199 |
|
executables with a custom collection of statically loaded extensions>) |
1200 |
|
|
1201 |
|
use ExtUtils::MakeMaker; |
1367 |
|
to ignore the environment when setting the Perl-library search patch, etc. |
1368 |
|
|
1369 |
|
If you fill comfortable with I<embedding> interface (see L<perlembed>), such |
1370 |
< |
things are easy to do repeating the steps outlined in L<Making |
1370 |
> |
things are easy to do repeating the steps outlined in L/<Making |
1371 |
|
executables with a custom collection of statically loaded extensions>, and |
1372 |
|
doing more comprehensive edits to main() of F<perlmain.c>. The people with |
1373 |
|
little desire to understand Perl can just rename main(), and do necessary |
1411 |
|
DLL. However, a lot of functionality will work even if the executable is not |
1412 |
|
an EMX applications, e.g., if compiled with |
1413 |
|
|
1414 |
< |
gcc -Wall -DDOSISH -DOS2=1 -O2 -s -Zomf -Zsys perl-starter.c -DPERL_DLL_BASENAME=\"perl312F\" -Zstack 8192 -Zlinker /PM:VIO |
1414 |
> |
gcc -Wall -DDOSISH -DOS2=1 -O2 -s -Zomf -Zsys perl-starter.c \ |
1415 |
> |
-DPERL_DLL_BASENAME=\"perl312F\" -Zstack 8192 -Zlinker /PM:VIO |
1416 |
|
|
1417 |
|
Here is the sample C file: |
1418 |
|
|
1419 |
< |
#define INCL_DOS |
1420 |
< |
#define INCL_NOPM |
1421 |
< |
/* These are needed for compile if os2.h includes os2tk.h, not os2emx.h */ |
1422 |
< |
#define INCL_DOSPROCESS |
1423 |
< |
#include <os2.h> |
1419 |
> |
#define INCL_DOS |
1420 |
> |
#define INCL_NOPM |
1421 |
> |
/* These are needed for compile if os2.h includes os2tk.h, not |
1422 |
> |
* os2emx.h */ |
1423 |
> |
#define INCL_DOSPROCESS |
1424 |
> |
#include <os2.h> |
1425 |
|
|
1426 |
< |
#include "EXTERN.h" |
1427 |
< |
#define PERL_IN_MINIPERLMAIN_C |
1428 |
< |
#include "perl.h" |
1426 |
> |
#include "EXTERN.h" |
1427 |
> |
#define PERL_IN_MINIPERLMAIN_C |
1428 |
> |
#include "perl.h" |
1429 |
|
|
1430 |
< |
static char *me; |
1431 |
< |
HMODULE handle; |
1430 |
> |
static char *me; |
1431 |
> |
HMODULE handle; |
1432 |
|
|
1433 |
< |
static void |
1434 |
< |
die_with(char *msg1, char *msg2, char *msg3, char *msg4) |
1435 |
< |
{ |
1436 |
< |
ULONG c; |
1437 |
< |
char *s = " error: "; |
1433 |
> |
static void |
1434 |
> |
die_with(char *msg1, char *msg2, char *msg3, char *msg4) |
1435 |
> |
{ |
1436 |
> |
ULONG c; |
1437 |
> |
char *s = " error: "; |
1438 |
|
|
1439 |
< |
DosWrite(2, me, strlen(me), &c); |
1440 |
< |
DosWrite(2, s, strlen(s), &c); |
1441 |
< |
DosWrite(2, msg1, strlen(msg1), &c); |
1442 |
< |
DosWrite(2, msg2, strlen(msg2), &c); |
1443 |
< |
DosWrite(2, msg3, strlen(msg3), &c); |
1444 |
< |
DosWrite(2, msg4, strlen(msg4), &c); |
1445 |
< |
DosWrite(2, "\r\n", 2, &c); |
1446 |
< |
exit(255); |
1447 |
< |
} |
1439 |
> |
DosWrite(2, me, strlen(me), &c); |
1440 |
> |
DosWrite(2, s, strlen(s), &c); |
1441 |
> |
DosWrite(2, msg1, strlen(msg1), &c); |
1442 |
> |
DosWrite(2, msg2, strlen(msg2), &c); |
1443 |
> |
DosWrite(2, msg3, strlen(msg3), &c); |
1444 |
> |
DosWrite(2, msg4, strlen(msg4), &c); |
1445 |
> |
DosWrite(2, "\r\n", 2, &c); |
1446 |
> |
exit(255); |
1447 |
> |
} |
1448 |
|
|
1449 |
< |
typedef ULONG (*fill_extLibpath_t)(int type, char *pre, char *post, int replace, char *msg); |
1450 |
< |
typedef int (*main_t)(int type, char *argv[], char *env[]); |
1451 |
< |
typedef int (*handler_t)(void* data, int which); |
1449 |
> |
typedef ULONG (*fill_extLibpath_t)(int type, |
1450 |
> |
char *pre, |
1451 |
> |
char *post, |
1452 |
> |
int replace, |
1453 |
> |
char *msg); |
1454 |
> |
typedef int (*main_t)(int type, char *argv[], char *env[]); |
1455 |
> |
typedef int (*handler_t)(void* data, int which); |
1456 |
|
|
1457 |
< |
#ifndef PERL_DLL_BASENAME |
1458 |
< |
# define PERL_DLL_BASENAME "perl" |
1459 |
< |
#endif |
1457 |
> |
#ifndef PERL_DLL_BASENAME |
1458 |
> |
# define PERL_DLL_BASENAME "perl" |
1459 |
> |
#endif |
1460 |
|
|
1461 |
< |
static HMODULE |
1462 |
< |
load_perl_dll(char *basename) |
1463 |
< |
{ |
1464 |
< |
char buf[300], fail[260]; |
1465 |
< |
STRLEN l, dirl; |
1466 |
< |
fill_extLibpath_t f; |
1467 |
< |
ULONG rc_fullname; |
1468 |
< |
HMODULE handle, handle1; |
1461 |
> |
static HMODULE |
1462 |
> |
load_perl_dll(char *basename) |
1463 |
> |
{ |
1464 |
> |
char buf[300], fail[260]; |
1465 |
> |
STRLEN l, dirl; |
1466 |
> |
fill_extLibpath_t f; |
1467 |
> |
ULONG rc_fullname; |
1468 |
> |
HMODULE handle, handle1; |
1469 |
|
|
1470 |
< |
if (_execname(buf, sizeof(buf) - 13) != 0) |
1471 |
< |
die_with("Can't find full path: ", strerror(errno), "", ""); |
1472 |
< |
/* XXXX Fill 'me' with new value */ |
1473 |
< |
l = strlen(buf); |
1474 |
< |
while (l && buf[l-1] != '/' && buf[l-1] != '\\') |
1475 |
< |
l--; |
1476 |
< |
dirl = l - 1; |
1477 |
< |
strcpy(buf + l, basename); |
1478 |
< |
l += strlen(basename); |
1479 |
< |
strcpy(buf + l, ".dll"); |
1480 |
< |
if ( (rc_fullname = DosLoadModule(fail, sizeof fail, buf, &handle)) != 0 |
1481 |
< |
&& DosLoadModule(fail, sizeof fail, basename, &handle) != 0 ) |
1482 |
< |
die_with("Can't load DLL ", buf, "", ""); |
1483 |
< |
if (rc_fullname) |
1484 |
< |
return handle; /* was loaded with short name; all is fine */ |
1485 |
< |
if (DosQueryProcAddr(handle, 0, "fill_extLibpath", (PFN*)&f)) |
1486 |
< |
die_with(buf, ": DLL exports no symbol ", "fill_extLibpath", ""); |
1487 |
< |
buf[dirl] = 0; |
1488 |
< |
if (f(0 /*BEGINLIBPATH*/, buf /* prepend */, NULL /* append */, |
1489 |
< |
0 /* keep old value */, me)) |
1490 |
< |
die_with(me, ": prepending BEGINLIBPATH", "", ""); |
1491 |
< |
if (DosLoadModule(fail, sizeof fail, basename, &handle1) != 0) |
1492 |
< |
die_with(me, ": finding perl DLL again via BEGINLIBPATH", "", ""); |
1493 |
< |
buf[dirl] = '\\'; |
1494 |
< |
if (handle1 != handle) { |
1495 |
< |
if (DosQueryModuleName(handle1, sizeof(fail), fail)) |
1496 |
< |
strcpy(fail, "???"); |
1497 |
< |
die_with(buf, ":\n\tperl DLL via BEGINLIBPATH is different: \n\t", |
1498 |
< |
fail, |
1499 |
< |
"\n\tYou may need to manipulate global BEGINLIBPATH and LIBPATHSTRICT" |
1500 |
< |
"\n\tso that the other copy is loaded via BEGINLIBPATH."); |
1501 |
< |
} |
1502 |
< |
return handle; |
1503 |
< |
} |
1470 |
> |
if (_execname(buf, sizeof(buf) - 13) != 0) |
1471 |
> |
die_with("Can't find full path: ", strerror(errno), "", ""); |
1472 |
> |
/* XXXX Fill 'me' with new value */ |
1473 |
> |
l = strlen(buf); |
1474 |
> |
while (l && buf[l-1] != '/' && buf[l-1] != '\\') |
1475 |
> |
l--; |
1476 |
> |
dirl = l - 1; |
1477 |
> |
strcpy(buf + l, basename); |
1478 |
> |
l += strlen(basename); |
1479 |
> |
strcpy(buf + l, ".dll"); |
1480 |
> |
if ( (rc_fullname = DosLoadModule(fail, sizeof fail, buf, &handle)) |
1481 |
> |
!= 0 |
1482 |
> |
&& DosLoadModule(fail, sizeof fail, basename, &handle) != 0 ) |
1483 |
> |
die_with("Can't load DLL ", buf, "", ""); |
1484 |
> |
if (rc_fullname) |
1485 |
> |
return handle; /* was loaded with short name; all is fine */ |
1486 |
> |
if (DosQueryProcAddr(handle, 0, "fill_extLibpath", (PFN*)&f)) |
1487 |
> |
die_with(buf, |
1488 |
> |
": DLL exports no symbol ", |
1489 |
> |
"fill_extLibpath", |
1490 |
> |
""); |
1491 |
> |
buf[dirl] = 0; |
1492 |
> |
if (f(0 /*BEGINLIBPATH*/, buf /* prepend */, NULL /* append */, |
1493 |
> |
0 /* keep old value */, me)) |
1494 |
> |
die_with(me, ": prepending BEGINLIBPATH", "", ""); |
1495 |
> |
if (DosLoadModule(fail, sizeof fail, basename, &handle1) != 0) |
1496 |
> |
die_with(me, |
1497 |
> |
": finding perl DLL again via BEGINLIBPATH", |
1498 |
> |
"", |
1499 |
> |
""); |
1500 |
> |
buf[dirl] = '\\'; |
1501 |
> |
if (handle1 != handle) { |
1502 |
> |
if (DosQueryModuleName(handle1, sizeof(fail), fail)) |
1503 |
> |
strcpy(fail, "???"); |
1504 |
> |
die_with(buf, |
1505 |
> |
":\n\tperl DLL via BEGINLIBPATH is different: \n\t", |
1506 |
> |
fail, |
1507 |
> |
"\n\tYou may need to manipulate global BEGINLIBPATH" |
1508 |
> |
" and LIBPATHSTRICT" |
1509 |
> |
"\n\tso that the other copy is loaded via" |
1510 |
> |
BEGINLIBPATH."); |
1511 |
> |
} |
1512 |
> |
return handle; |
1513 |
> |
} |
1514 |
|
|
1515 |
< |
int |
1516 |
< |
main(int argc, char **argv, char **env) |
1517 |
< |
{ |
1518 |
< |
main_t f; |
1519 |
< |
handler_t h; |
1515 |
> |
int |
1516 |
> |
main(int argc, char **argv, char **env) |
1517 |
> |
{ |
1518 |
> |
main_t f; |
1519 |
> |
handler_t h; |
1520 |
|
|
1521 |
< |
me = argv[0]; |
1522 |
< |
/**/ |
1523 |
< |
handle = load_perl_dll(PERL_DLL_BASENAME); |
1521 |
> |
me = argv[0]; |
1522 |
> |
/**/ |
1523 |
> |
handle = load_perl_dll(PERL_DLL_BASENAME); |
1524 |
|
|
1525 |
< |
if (DosQueryProcAddr(handle, 0, "Perl_OS2_handler_install", (PFN*)&h)) |
1526 |
< |
die_with(PERL_DLL_BASENAME, ": DLL exports no symbol ", "Perl_OS2_handler_install", ""); |
1527 |
< |
if ( !h((void *)"~installprefix", Perlos2_handler_perllib_from) |
1528 |
< |
|| !h((void *)"~dll", Perlos2_handler_perllib_to) |
1529 |
< |
|| !h((void *)"~dll/sh/ksh.exe", Perlos2_handler_perl_sh) ) |
1530 |
< |
die_with(PERL_DLL_BASENAME, ": Can't install @INC manglers", "", ""); |
1525 |
> |
if (DosQueryProcAddr(handle, |
1526 |
> |
0, |
1527 |
> |
"Perl_OS2_handler_install", |
1528 |
> |
(PFN*)&h)) |
1529 |
> |
die_with(PERL_DLL_BASENAME, |
1530 |
> |
": DLL exports no symbol ", |
1531 |
> |
"Perl_OS2_handler_install", |
1532 |
> |
""); |
1533 |
> |
if ( !h((void *)"~installprefix", Perlos2_handler_perllib_from) |
1534 |
> |
|| !h((void *)"~dll", Perlos2_handler_perllib_to) |
1535 |
> |
|| !h((void *)"~dll/sh/ksh.exe", Perlos2_handler_perl_sh) ) |
1536 |
> |
die_with(PERL_DLL_BASENAME, |
1537 |
> |
": Can't install @INC manglers", |
1538 |
> |
"", |
1539 |
> |
""); |
1540 |
> |
if (DosQueryProcAddr(handle, 0, "dll_perlmain", (PFN*)&f)) |
1541 |
> |
die_with(PERL_DLL_BASENAME, |
1542 |
> |
": DLL exports no symbol ", |
1543 |
> |
"dll_perlmain", |
1544 |
> |
""); |
1545 |
> |
return f(argc, argv, env); |
1546 |
> |
} |
1547 |
|
|
1514 |
– |
if (DosQueryProcAddr(handle, 0, "dll_perlmain", (PFN*)&f)) |
1515 |
– |
die_with(PERL_DLL_BASENAME, ": DLL exports no symbol ", "dll_perlmain", ""); |
1516 |
– |
return f(argc, argv, env); |
1517 |
– |
} |
1518 |
– |
|
1519 |
– |
|
1548 |
|
=head1 Build FAQ |
1549 |
|
|
1550 |
|
=head2 Some C</> became C<\> in pdksh. |
1619 |
|
system qw(C:/emx.add/bin/bash.exe -x -c C:/emx/bin/foo.cmd bar baz) |
1620 |
|
|
1621 |
|
One additional translation is performed: instead of F</bin/sh> Perl uses |
1622 |
< |
the hardwired-or-customized shell (see C<L<"PERL_SH_DIR">>). |
1622 |
> |
the hardwired-or-customized shell (see L</"C<PERL_SH_DIR>">). |
1623 |
|
|
1624 |
|
The above search for "interpreter" is recursive: if F<bash> executable is not |
1625 |
|
found, but F<bash.btm> is found, Perl will investigate its first line etc. |
1764 |
|
The argument true means that a real message loop is going to be served. |
1765 |
|
OS2::MorphPM() returns the PM message queue handle as an integer. |
1766 |
|
|
1767 |
< |
See L<"Centralized management of resources"> for additional details. |
1767 |
> |
See L</"Centralized management of resources"> for additional details. |
1768 |
|
|
1769 |
|
=item C<OS2::Serve_Messages(force)> |
1770 |
|
|
1801 |
|
handling exception mask: if no C<mask>, uses exception mask part of C<new> |
1802 |
|
only. If no C<new>, disables all the floating point exceptions. |
1803 |
|
|
1804 |
< |
See L<"Misfeatures"> for details. |
1804 |
> |
See L</"Misfeatures"> for details. |
1805 |
|
|
1806 |
|
=item C<OS2::DLLname([how [, \&xsub]])> |
1807 |
|
|
1899 |
|
|
1900 |
|
=item * |
1901 |
|
|
1902 |
< |
See L<"Text-mode filehandles">. |
1902 |
> |
See L</"Text-mode filehandles">. |
1903 |
|
|
1904 |
|
=item * |
1905 |
|
|
1958 |
|
|
1959 |
|
=item C<popen> |
1960 |
|
|
1961 |
< |
C<my_popen> uses F<sh.exe> if shell is required, cf. L<"PERL_SH_DIR">. |
1961 |
> |
C<my_popen> uses F<sh.exe> if shell is required, cf. L</"C<PERL_SH_DIR>">. |
1962 |
|
|
1963 |
|
=item C<tmpnam> |
1964 |
|
|
2150 |
|
- and also C<PMWIN_entries> - in F<os2ish.h>). These ordinals can be |
2151 |
|
accessed via the APIs: |
2152 |
|
|
2153 |
< |
CallORD(), DeclFuncByORD(), DeclVoidFuncByORD(), |
2154 |
< |
DeclOSFuncByORD(), DeclWinFuncByORD(), AssignFuncPByORD(), |
2155 |
< |
DeclWinFuncByORD_CACHE(), DeclWinFuncByORD_CACHE_survive(), |
2156 |
< |
DeclWinFuncByORD_CACHE_resetError_survive(), |
2157 |
< |
DeclWinFunc_CACHE(), DeclWinFunc_CACHE_resetError(), |
2158 |
< |
DeclWinFunc_CACHE_survive(), DeclWinFunc_CACHE_resetError_survive() |
2153 |
> |
CallORD(), DeclFuncByORD(), DeclVoidFuncByORD(), |
2154 |
> |
DeclOSFuncByORD(), DeclWinFuncByORD(), AssignFuncPByORD(), |
2155 |
> |
DeclWinFuncByORD_CACHE(), DeclWinFuncByORD_CACHE_survive(), |
2156 |
> |
DeclWinFuncByORD_CACHE_resetError_survive(), |
2157 |
> |
DeclWinFunc_CACHE(), DeclWinFunc_CACHE_resetError(), |
2158 |
> |
DeclWinFunc_CACHE_survive(), DeclWinFunc_CACHE_resetError_survive() |
2159 |
|
|
2160 |
|
See the header files and the C code in the supplied OS/2-related |
2161 |
|
modules for the details on usage of these functions. |
2194 |
|
I<This is the only executable with does not require OS/2.> The |
2195 |
|
friends locked into C<M$> world would appreciate the fact that this |
2196 |
|
executable runs under DOS, Win0.3*, Win0.95 and WinNT with an |
2197 |
< |
appropriate extender. See L<"Other OSes">. |
2197 |
> |
appropriate extender. See L</"Other OSes">. |
2198 |
|
|
2199 |
|
=head2 F<perl__.exe> |
2200 |
|
|
2593 |
|
|
2594 |
|
modifying the versions/names as needed. Run |
2595 |
|
|
2596 |
< |
perl -wnle "next if 0../EXPORTS/; print qq( \"$1\") if /\"(\w+)\"/" perl5.def >lst |
2596 |
> |
perl -wnle "next if 0../EXPORTS/; print qq( \"$1\") |
2597 |
> |
if /\"(\w+)\"/" perl5.def >lst |
2598 |
|
|
2599 |
|
in the Perl build directory (to make the DLL smaller replace perl5.def |
2600 |
|
with the definition file for the older version of Perl if present). |
2620 |
|
Due to a popular demand the perl external program calling has been |
2621 |
|
changed wrt Andreas Kaiser's port. I<If> perl needs to call an |
2622 |
|
external program I<via shell>, the F<f:/bin/sh.exe> will be called, or |
2623 |
< |
whatever is the override, see L<"PERL_SH_DIR">. |
2623 |
> |
whatever is the override, see L</"C<PERL_SH_DIR>">. |
2624 |
|
|
2625 |
|
Thus means that you need to get some copy of a F<sh.exe> as well (I |
2626 |
|
use one from pdksh). The path F<F:/bin> above is set up automatically during |
2743 |
|
|
2744 |
|
Note that OS2 perl defines 2 pseudo-extension functions |
2745 |
|
OS2::Copy::copy and DynaLoader::mod2fname (many more now, see |
2746 |
< |
L<Prebuilt methods>). |
2746 |
> |
L</Prebuilt methods>). |
2747 |
|
|
2748 |
|
The -R switch of older perl is deprecated. If you need to call a REXX code |
2749 |
|
which needs access to variables, include the call into a REXX compartment |