From: Perl 5 Porters Date: Wed, 29 Jan 1997 06:11:00 +0000 (+1200) Subject: [inseparable changes from patch from perl5.003_23 to perl5.003_24] X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0a753a764065f2260004b6e6975085378b850346;p=p5sagit%2Fp5-mst-13.2.git [inseparable changes from patch from perl5.003_23 to perl5.003_24] CORE LANGUAGE CHANGES Subject: glob defaults to $_ Date: Mon, 27 Jan 1997 03:09:13 -0500 From: Gurusamy Sarathy Files: op.c opcode.pl pod/perlfunc.pod t/op/glob.t private-msgid: <199701270809.DAA00934@aatma.engin.umich.edu> Subject: Re: an overloading bug Date: Sun, 26 Jan 1997 19:07:45 -0500 From: Gurusamy Sarathy Files: pod/perldiag.pod pod/perlfunc.pod pp_ctl.c private-msgid: <199701270007.TAA26525@aatma.engin.umich.edu> CORE PORTABILITY Subject: Win32 port From: Gary Ng <71564.1743@compuserve.com> Files: MANIFEST win32/* Subject: Amiga files Date: Sun, 26 Jan 1997 17:42:15 +0100 From: Norbert Pueschel Files: MANIFEST README.amiga hints/amigaos.sh private-msgid: <77724712@Armageddon.meb.uni-bonn.de> DOCUMENTATION Subject: perldelta Fcntl enhancement Date: Sat, 25 Jan 1997 17:05:34 +0200 (EET) From: Jarkko Hietaniemi Files: pod/perldelta.pod private-msgid: <199701251505.RAA22159@alpha.hut.fi> Subject: Updates to perldelta re: Fcntl, DB_File, Net::Ping From: Paul Marquess Files: pod/perldelta.pod Subject: Document restrictions on gv_fetchmethod() and perl_call_sv() From: Chip Salzenberg Files: pod/perldelta.pod pod/perlguts.pod Subject: perldiag.pod: No comma allowed after %s Date: Sat, 25 Jan 1997 17:41:53 +0200 (EET) From: Jarkko Hietaniemi Files: pod/perldiag.pod private-msgid: <199701251541.RAA04120@alpha.hut.fi> Subject: perlfunc.pod: localtime Date: Sat, 25 Jan 1997 18:29:37 +0200 (EET) From: Jarkko Hietaniemi Files: pod/perlfunc.pod private-msgid: <199701251629.SAA08114@alpha.hut.fi> Subject: perlfunc diff: gmtime Date: Tue, 28 Jan 1997 14:52:08 +0000 From: Peter Haworth Files: pod/perlfunc.pod private-msgid: <32EE1298.7B90@edison.ioppublishing.com> Subject: Updates to guts Date: Sun, 26 Jan 1997 19:34:18 -0500 (EST) From: Ilya Zakharevich Files: pod/perlguts.pod private-msgid: <199701270034.TAA13177@monk.mps.ohio-state.edu> TESTS Subject: New test op/closure.t From: Tom Phoenix Files: MANIFEST t/op/closure.t --- diff --git a/Changes b/Changes index 685a559..acfef8d 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,192 @@ releases.) ---------------- +Version 5.003_24 +---------------- + +This release is the second candidate for a public beta test. +It's, well, bunches better than _23. + + CORE LANGUAGE CHANGES + + Title: "glob defaults to $_" + From: Gurusamy Sarathy + Msg-ID: <199701270809.DAA00934@aatma.engin.umich.edu> + Date: Mon, 27 Jan 1997 03:09:13 -0500 + Files: op.c opcode.pl pod/perlfunc.pod t/op/glob.t + + Title: "Re: an overloading bug " + From: Gurusamy Sarathy + Msg-ID: <199701270007.TAA26525@aatma.engin.umich.edu> + Date: Sun, 26 Jan 1997 19:07:45 -0500 + Files: pod/perldiag.pod pod/perlfunc.pod pp_ctl.c + + Title: "Don't warn on C<$\ = undef>" + From: Chip Salzenberg + Files: mg.c + + CORE PORTABILITY + + Title: "Win32 port" + From: Gary Ng <71564.1743@compuserve.com> + Files: MANIFEST win32/* + + Title: "Amiga files" + From: Norbert Pueschel + Msg-ID: <77724712@Armageddon.meb.uni-bonn.de> + Date: Sun, 26 Jan 1997 17:42:15 +0100 + Files: MANIFEST README.amiga hints/amigaos.sh + + Title: "New dec_osf hints" + From: Jarkko.Hietaniemi@cc.hut.fi + Msg-ID: <199701271233.OAA21548@alpha.hut.fi> + Date: Mon, 27 Jan 1997 14:33:01 +0200 (EET) + Files: hints/dec_osf.sh + + OTHER CORE CHANGES + + Title: "Prevent premature death of @_ during leavesub" + From: Chip Salzenberg + Files: pp_hot.c t/op/misc.t + + Title: "Deref old stash when re-blessing" + From: Chip Salzenberg + Files: sv.c + + Title: "Don't abort when RCHECK and DEBUGGING" + From: Tim Bunce + Msg-ID: <9701272339.AA16537@toad.ig.co.uk> + Date: Mon, 27 Jan 1997 23:39:48 +0000 + Files: malloc.c + + Title: "Fix overloading macro conflict with Digital 'cc -fast'" + From: Jarkko Hietaniemi + Msg-ID: <199701272216.AAA04557@alpha.hut.fi> + Date: Tue, 28 Jan 1997 00:16:49 +0200 (EET) + Files: perl.h + + Title: "global.sym: typo?" + From: Jarkko Hietaniemi + Msg-ID: <199701261937.VAA07556@alpha.hut.fi> + Date: Sun, 26 Jan 1997 21:37:59 +0200 (EET) + Files: global.sym + + BUILD PROCESS + + Title: "Put all extensions' modules in $archlib" + From: Chip Salzenberg + Files: installperl + + Title: "Configure fixes: set $archlib, omit _NO_PROTO" + From: Chip Salzenberg + Files: Configure + + Title: "Make configure{,.gnu} ignore --cache-file option" + From: Norbert Pueschel + Files: configure configure.gnu + + LIBRARY AND EXTENSIONS + + Title: "Version checking in XS bootstrap is optional" + From: Chip Salzenberg + Files: XSUB.h + + Title: "Update $VERSION of DynaLoader and POSIX" + From: Chip Salzenberg + Files: ext/DynaLoader/DynaLoader.pm ext/POSIX/POSIX.pm + + Title: "Refresh Text::Wrap to 97.011701" + From: Chip Salzenberg + Files: lib/Text/Wrap.pm + + Title: "Fcntl.xs: F_[GS]ETOWN were in wrong case branch" + From: Jarkko Hietaniemi + Msg-ID: <199701251510.RAA05142@alpha.hut.fi> + Date: Sat, 25 Jan 1997 17:10:20 +0200 (EET) + Files: ext/Fcntl/Fcntl.pm ext/Fcntl/Fcntl.xs + + Title: "Fix $Is_VMS typo in Test::Harness" + From: Chip Salzenberg + Files: lib/Test/Harness.pm + + Title: "Allow for really big keys in Tie::SubstrHash" + From: data-drift@so.uio.no + Msg-ID: <199701282014.VAA12645@selters.uio.no> + Date: Tue, 28 Jan 1997 21:14:34 +0100 (MET) + Files: lib/Tie/SubstrHash.pm + + Title: "Avoid newRV_noinc() in IO, for compiling with old Perls" + From: Chip Salzenberg + Files: ext/IO/IO.xs + + TESTS + + Title: "New test op/closure.t" + From: Tom Phoenix , Ulrich Pfeifer + Files: MANIFEST t/op/closure.t + + UTILITIES + + Title: "xsubpp handing of void funcs breaks extensions using XST_m*()" + From: Tim Bunce + Msg-ID: <9701271659.AA15137@toad.ig.co.uk> + Date: Mon, 27 Jan 1997 16:59:06 +0000 + Files: lib/ExtUtils/xsubpp + + DOCUMENTATION + + Title: "perldelta Fcntl enhancement" + From: Jarkko Hietaniemi + Msg-ID: <199701251505.RAA22159@alpha.hut.fi> + Date: Sat, 25 Jan 1997 17:05:34 +0200 (EET) + Files: pod/perldelta.pod + + Title: "Updates to perldelta re: Fcntl, DB_File, Net::Ping" + From: pmarquess@bfsec.bt.co.uk (Paul Marquess) + Files: pod/perldelta.pod + + Title: "Document restrictions on gv_fetchmethod() and perl_call_sv()" + From: Chip Salzenberg + Files: pod/perldelta.pod pod/perlguts.pod + + Title: "perldiag.pod: No comma allowed after %s" + From: Jarkko.Hietaniemi@cc.hut.fi + Msg-ID: <199701251541.RAA04120@alpha.hut.fi> + Date: Sat, 25 Jan 1997 17:41:53 +0200 (EET) + Files: pod/perldiag.pod + + Title: "perlfunc.pod: localtime" + From: Jarkko Hietaniemi + Msg-ID: <199701251629.SAA08114@alpha.hut.fi> + Date: Sat, 25 Jan 1997 18:29:37 +0200 (EET) + Files: pod/perlfunc.pod + + Title: "perlfunc diff: gmtime" + From: Peter Haworth + Msg-ID: <32EE1298.7B90@edison.ioppublishing.com> + Date: Tue, 28 Jan 1997 14:52:08 +0000 + Files: pod/perlfunc.pod + + Title: "Updates to guts" + From: Ilya Zakharevich + Msg-ID: <199701270034.TAA13177@monk.mps.ohio-state.edu> + Date: Sun, 26 Jan 1997 19:34:18 -0500 (EST) + Files: pod/perlguts.pod + + Title: "perltoot fixes" + From: Tom Christiansen + Msg-ID: <6807.854214205@jinete> + Date: Sat, 25 Jan 1997 09:43:25 -0800 + Files: pod/perltoot.pod + + Title: "5.003_23: small typo in perlsyn.pod" + From: Gurusamy Sarathy + Msg-ID: <199701270824.DAA01169@aatma.engin.umich.edu> + Date: Mon, 27 Jan 1997 03:24:25 -0500 + Files: pod/perlsyn.pod + + +---------------- Version 5.003_23 ---------------- diff --git a/MANIFEST b/MANIFEST index c48ec40..4693eed 100644 --- a/MANIFEST +++ b/MANIFEST @@ -15,6 +15,7 @@ MANIFEST This list of files Makefile.SH A script that generates Makefile Porting/Glossary Glossary of config.sh variables README The Instructions +README.amiga Notes about AmigaOS port README.os2 Notes about OS/2 port README.plan9 Notes about Plan9 port README.qnx Notes about QNX port @@ -528,7 +529,7 @@ pod/perlxstut.pod XS tutorial pod/pod2html.PL Precursor for translator to turn pod into HTML pod/pod2latex.PL Precursor for translator to turn pod into LaTeX pod/pod2man.PL Precursor for translator to turn pod into manpage -pod/pod2text.PL Precursor for translator to turn pod into text +pod/pod2text.PL Precursor for translator to turn pod into text pod/roffitall troff the whole man page set pod/rofftoc Generate a table of contents in troff format pod/splitman Splits perlfunc into multiple man pages @@ -641,6 +642,7 @@ t/op/assignwarn.t See if OP= operators warn correctly for undef targets t/op/auto.t See if autoincrement et all work t/op/bop.t See if bitops work t/op/chop.t See if chop works +t/op/closure.t See if closures work t/op/cmp.t See if the various string and numeric compare work t/op/cond.t See if conditional expressions work t/op/delete.t See if delete works @@ -752,6 +754,53 @@ vms/vms.c VMS-specific C code for Perl core vms/vms_yfix.pl convert Unix perly.[ch] to VMS perly_[ch].vms vms/vmsish.h VMS-specific C header for Perl core vms/writemain.pl Generate perlmain.c from miniperlmain.c+extensions +win32/EXTERN.h Win32 port +win32/Fcntl.mak Win32 port +win32/IO.mak Win32 port +win32/Makefile Win32 port +win32/Opcode.mak Win32 port +win32/README Win32 port +win32/SDBM_File.mak Win32 port +win32/Socket.mak Win32 port +win32/TEST Win32 port +win32/autosplit.pl Win32 port +win32/bin/PL2BAT.BAT Win32 port +win32/bin/network.pl Win32 port +win32/bin/search.bat Win32 port +win32/bin/test.bat Win32 port +win32/bin/webget.bat Win32 port +win32/bin/www.pl Win32 port +win32/config.h Win32 port +win32/config.w32 Win32 port +win32/dl_win32.xs Win32 port +win32/dosish.diff Win32 port +win32/dosish.h Win32 port +win32/genxsdef.pl Win32 port +win32/include/arpa/inet.h Win32 port +win32/include/dirent.h Win32 port +win32/include/netdb.h Win32 port +win32/include/sys/socket.h Win32 port +win32/libperl.mak Win32 port +win32/makedef.pl Win32 port +win32/makemain.pl Win32 port +win32/makeperldef.pl Win32 port +win32/miniperl.mak Win32 port +win32/modules.mak Win32 port +win32/perl.mak Win32 port +win32/perldll.mak Win32 port +win32/perlglob.c Win32 port +win32/perlglob.mak Win32 port +win32/perllib.c Win32 port +win32/perlmain.c Win32 port +win32/runperl.c Win32 port +win32/splittree.pl Win32 port +win32/win32.c Win32 port +win32/win32.h Win32 port +win32/win32aux.cpp Win32 port +win32/win32io.cpp Win32 port +win32/win32io.h Win32 port +win32/win32iop.h Win32 port +win32/win32sck.c Win32 port writemain.SH Generate perlmain.c from miniperlmain.c+extensions x2p/EXTERN.h Same as above x2p/INTERN.h Same as above diff --git a/README.amiga b/README.amiga new file mode 100644 index 0000000..b20c023 --- /dev/null +++ b/README.amiga @@ -0,0 +1,233 @@ +If you read this file _as_is_, just ignore the funny characters you +see. It is written in the POD format (see perlpod manpage) which is +specially designed to be readable as is. + +=head1 NAME + +perlamiga - Perl under Amiga OS + +=head1 SYNOPSIS + +One can read this document in the following formats: + + man perlamiga + multiview perlamiga.guide + +to list some (not all may be available simultaneously), or it may +be read I: either as F, or F. + +=cut + +Contents + + perlamiga - Perl under Amiga OS + + NAME + SYNOPSIS + DESCRIPTION + - Prerequisites + - Starting Perl programs under AmigaOS + INSTALLATION + Accessing documentation + - Manpages + - HTML + - GNU info files + - LaTeX docs + BUILD + - Prerequisites + - Getting the perl source + - Application of the patches + - Making + - Testing + - Installing the built perl + AUTHOR + SEE ALSO + +=head1 DESCRIPTION + +=head2 Prerequisites + +=over 6 + +=item B + +You need the Unix emulation for AmigaOS, whose most important part is +B. For a minimum setup, get the following archives from +ftp://ftp.ninemoons.com/pub/ade/current or a mirror: + +ixemul-45.1-bin.lha +ixemul-45.1-env-bin.lha +pdksh-4.9-bin.lha +ADE-misc-bin.lha + +Note that there might be newer versions available by the time you read +this. + +Note also that this is a minimum setup; you might want to add other +packages of B (the I). + +=item B + +You need at the very least AmigaOS version 2.0. Recommended is version 3.1. + +=back + +=head2 Starting Perl programs under AmigaOS + +Start your Perl program F with arguments C the +same way as on any other platform, by + + perl foo arg1 arg2 arg3 + +If you want to specify perl options C<-my_opts> to the perl itself (as +opposed to to your program), use + + perl -my_opts foo arg1 arg2 arg3 + +Alternately, you can try to get a replacement for the system's B +command that honors the #!/usr/bin/perl syntax in scripts and set the s-Bit +of your scripts. Then you can invoke your scripts like under UNIX with + + foo arg1 arg2 arg3 + +(Note that having *nixish full path to perl F is not +necessary, F would be enough, but having full path would make it +easier to use your script under *nix.) + +=head1 INSTALLATION + +Change to the installation directory (most probably ADE:), and +extract the binary distribution: + +lha -mraxe x perl-5.003-bin.lha + +or + +tar xvzpf perl-5.003-bin.tgz + +(Of course you need lha or tar and gunzip for this.) + +For installation of the Unix emulation, read the appropriate docs. + +=head1 Accessing documentation + +=head2 Manpages + +If you have C installed on your system, and you installed perl +manpages, use something like this: + + man perlfunc + man less + man ExtUtils.MakeMaker + +to access documentation for different components of Perl. Start with + + man perl + +Note: You have to modify your man.conf file to search for manpages +in the /ade/lib/perl5/man/man3 directory, or the man pages for the +perl library will not be found. + +Note that dot (F<.>) is used as a package separator for documentation +for packages, and as usual, sometimes you need to give the section - C<3> +above - to avoid shadowing by the I. + + +=head2 B + +If you have some WWW browser available, you can build B docs. +Cd to directory with F<.pod> files, and do like this + + cd /ade/lib/perl5/pod + pod2html + +After this you can direct your browser the file F in this +directory, and go ahead with reading docs. + +Alternatively you may be able to get these docs prebuilt from C. + +=head2 B C files + +Users of C would appreciate it very much, especially with +C mode loaded. You need to get latest C from C, +or, alternately, prebuilt info pages. + +=head2 C docs + +can be constructed using C. + +=head1 BUILD + +Here we discuss how to build Perl under AmigaOS. + +=head2 Prerequisites + +You need to have the latest B (Amiga Developers Environment) +from ftp://ftp.ninemoons.com/pub/ade/current. +Also, you need a lot of free memory, probably at least 8MB. + +=head2 Getting the perl source + +You can either get the latest perl-for-amiga source from Ninemoons +and extract it with: + + tar xvzpf perl-5.004-src.tgz + +or get the official source from CPAN: + + http://www.perl.com/CPAN/src/5.0 + +Extract it like this + + tar xvzpf perl5.004.tar.gz + +You will see a message about errors while extracting F. This +is normal and expected. (There is a conflict with a similarly-named file +F, but it causes no harm.) + +=head2 Making + + sh configure.gnu --prefix=/ade + +Now + + make + +=head2 Testing + +Now run + + make test + +Some tests will fail. Here is which, and why: + +=over 8 + +=item F, F, F, F + +Check I operations. Failures result from the inability to +emulate some Unixisms with the standard Amiga filesystem. + +=item F, F, F, F, + F, F, F + +These tests will be skipped because they use the fork() function, which is not +supported under AmigaOS. + +=back + +=head2 Installing the built perl + +Run + + make install + +=head1 AUTHOR + +Norbert Pueschel, pueschel@imsdd.meb.uni-bonn.de + +=head1 SEE ALSO + +perl(1). + +=cut diff --git a/embed.h b/embed.h index b4bce4b..365af2a 100644 --- a/embed.h +++ b/embed.h @@ -850,7 +850,6 @@ #define push_return Perl_push_return #define push_scope Perl_push_scope #define q Perl_q -#define qrt_amg Perl_qrt_amg #define rcsid Perl_rcsid #define reall_srchlen Perl_reall_srchlen #define ref Perl_ref @@ -970,6 +969,7 @@ #define sle_amg Perl_sle_amg #define slt_amg Perl_slt_amg #define sne_amg Perl_sne_amg +#define sqrt_amg Perl_sqrt_amg #define stack_base Perl_stack_base #define stack_grow Perl_stack_grow #define stack_max Perl_stack_max diff --git a/hints/amigaos.sh b/hints/amigaos.sh index 6c00d76..29d3880 100644 --- a/hints/amigaos.sh +++ b/hints/amigaos.sh @@ -6,10 +6,7 @@ archname='m68k-amigaos' cc='gcc' firstmakefile='GNUmakefile' -ccflags='-DAMIGAOS -mstackextend' -optimize='-O2 -fomit-frame-pointer' - -usenm='y' +usenm='true' usemymalloc='n' usevfork='true' useperlio='true' @@ -18,21 +15,37 @@ d_fork='undef' d_vfork='define' groupstype='int' +# compiler & linker flags + +ccflags='-DAMIGAOS -mstackextend' +ldflags='' +optimize='-O2 -fomit-frame-pointer' + +# uncomment the following settings if you are compiling for an 68020+ system + +# ccflags='-DAMIGAOS -mstackextend -m68020 -resident32' +# ldflags='-m68020 -resident32' + # libs -libpth="/local/lib $prefix/lib" +libpth="$prefix/lib /local/lib" glibpth="$libpth" xlibpth="$libpth" -libswanted='dld m c gdbm' +libswanted='gdbm m' so=' ' # dynamic loading -dlext='o' -cccdlflags='none' -ccdlflags='none' -lddlflags='-oformat a.out-amiga -r' +usedl='n' + +# uncomment the following line if a working version of dld is available + +# usedl='y' +# dlext='o' +# cccdlflags='none' +# ccdlflags='none' +# lddlflags='-oformat a.out-amiga -r' # Avoid telldir prototype conflict in pp_sys.c (AmigaOS uses const DIR *) # Configure should test for this. Volunteers? diff --git a/op.c b/op.c index 2776dda..2d25fb3 100644 --- a/op.c +++ b/op.c @@ -3880,6 +3880,8 @@ OP *op; newGVOP(OP_GV, 0, gv))))); return ck_subr(op); } + if ((op->op_flags & OPf_KIDS) && !cLISTOP->op_first->op_sibling) + append_elem(OP_GLOB, op, newSVREF(newGVOP(OP_GV, 0, defgv))); gv = newGVgen("main"); gv_IOadd(gv); append_elem(OP_GLOB, op, newGVOP(OP_GV, 0, gv)); diff --git a/opcode.h b/opcode.h index 518c1e4..43586ba 100644 --- a/opcode.h +++ b/opcode.h @@ -2158,7 +2158,7 @@ EXT U32 opargs[] = { 0x0000098c, /* ref */ 0x00009104, /* bless */ 0x00000008, /* backtick */ - 0x00001108, /* glob */ + 0x00009908, /* glob */ 0x00000008, /* readline */ 0x00000008, /* rcatline */ 0x00000104, /* regcmaybe */ diff --git a/opcode.pl b/opcode.pl index b231933..d63ecc5 100755 --- a/opcode.pl +++ b/opcode.pl @@ -224,7 +224,8 @@ bless bless ck_fun s S S? # Pushy I/O. backtick backticks ck_null t -glob glob ck_glob t S S +# glob defaults its first arg to $_ +glob glob ck_glob t S? S? readline ck_null t rcatline append I/O operator ck_null t diff --git a/patchlevel.h b/patchlevel.h index 2603bc1..603aaa3 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -1,5 +1,5 @@ #define PATCHLEVEL 3 -#define SUBVERSION 23 +#define SUBVERSION 24 /* local_patches -- list of locally applied less-than-subversion patches. diff --git a/pod/perldelta.pod b/pod/perldelta.pod index b33f1ff..04e9a45 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -34,21 +34,6 @@ application of opcode masks. The revised Safe module has a new API and is implemented using the new Opcode module. Please read the new Opcode and Safe documentation. -=head2 Extended Fcntl Module - -The Fcntl module now supports these new constants - - F_GETOWN F_SETOWN - O_ASYNC O_DEFER O_DSYNC O_RSYNC O_SYNC - O_EXLOCK O_SHLOCK - -provided that your operating system supports these constants. The -constants are for use with the Perl sysopen() and fcntl(). These -constants are also visible for the basic database modules like the -SDBM_File. For the exact meaning of these contants and other Fcntl -constants please refer to the fcntl() documentation of your operating -system. Unsupported constants will cause run-time errors. - =head2 Internal Change: FileHandle Deprecated Filehandles are now stored internally as type IO::Handle. @@ -243,7 +228,7 @@ before, and is fine now: The C package automatically contains the following methods that are inherited by all other classes: -=over 4 +=over =item isa(CLASS) @@ -429,6 +414,21 @@ provided that your operating system happens to support them: O_ASYNC O_DEFER O_DSYNC O_FSYNC O_SYNC O_EXLOCK O_SHLOCK +These constants are intended for use with the Perl operators sysopen() +and fcntl() and the basic database modules like SDBM_File. For the +exact meaning of these and other Fcntl constants please refer to your +operating system's documentation for fcntl() and open(). + +In addition, the Fcntl module now provides these constants for use +with the Perl operator flock(): + + LOCK_SH LOCK_EX LOCK_NB LOCK_UN + +These constants are defined in all environments (because where there is +no flock() system call, Perl emulates it). However, for historical +reasons, these constants are not exported unless they are explicitly +requested with the ":flock" tag (e.g. C). + =head2 Module Information Summary Brand new modules, arranged by topic rather than strictly @@ -499,6 +499,52 @@ And these functions are now exported: sinh cosh tanh cotanh asinh acosh atanh acotanh cplx cplxe +=head2 DB_File + +There have been quite a few changes made to DB_File. Here are a few of +the highlights: + +=over + +=item * + +Fixed a handful of bugs. + +=item * + +By public demand, added support for the standard hash function exists(). + +=item * + +Made it compatible with Berkeley DB 1.86. + +=item * + +Made negative subscripts work with RECNO interface. + +=item * + +Changed the default flags from O_RDWR to O_CREAT|O_RDWR and the default +mode from 0640 to 0666. + +=item * + +Made DB_File automatically import the open() constants (O_RDWR, +O_CREAT etc.) from Fcntl, if available. + +=item * + +Updated documentation. + +=back + +Refer to the HISTORY section in DB_File.pm for a complete list of +changes. Everything after DB_File 1.01 has been added since 5.003. + +=head2 Net::Ping + +Major rewrite - support added for both udp echo and real icmp pings. + =head2 Overridden Built-ins Many of the Perl built-ins returning lists now have @@ -524,6 +570,8 @@ For example, you can now say =head2 xsubpp +=over + =item C XSUBs now default to returning nothing Due to a documentation/implementation bug in previous versions of @@ -543,12 +591,34 @@ It does so by examining the text of the XSUB: if I finds what looks like an assignment to C, it assumes that the XSUB's return type is really C. +=back + +=head1 C Language API Changes + +=over + +=item C and C + +The C function finds a method for an object, just like +in Perl 5.003. The GV it returns may be a method cache entry. +However, in Perl 5.004, method cache entries are not visible to users; +therefore, they can no longer be passed directly to C. +Instead, you should use the C macro on the GV to extract its CV, +and pass the CV to C. + +The most likely symptom of passing the result of C to +C is Perl's producing an "Undefined subroutine called" +error on the I call to a given method (since there is no cache +on the first call). + +=back + =head1 Documentation Changes Many of the base and library pods were updated. These new pods are included in section 1: -=over 4 +=over =item L @@ -592,7 +662,7 @@ increasing order of desperation): (X) A very fatal error (non-trappable). (A) An alien error message (not generated by Perl). -=over 4 +=over =item "my" variable %s masks earlier declaration in same scope diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 0f204a8..018ebb7 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -342,30 +342,37 @@ the return value of your socket() call? See L. (F) A subroutine invoked from an external package via perl_call_sv() exited by calling exit. +=item Can't "goto" outside a block + +(F) A "goto" statement was executed to jump out of what might look +like a block, except that it isn't a proper block. This usually +occurs if you tried to jump out of a sort() block or subroutine, which +is a no-no. See L. + =item Can't "last" outside a block (F) A "last" statement was executed to break out of the current block, except that there's this itty bitty problem called there isn't a current block. Note that an "if" or "else" block doesn't count as a -"loopish" block. You can usually double the curlies to get the same -effect though, because the inner curlies will be considered a block -that loops once. See L. +"loopish" block, as doesn't a block given to sort(). You can usually double +the curlies to get the same effect though, because the inner curlies +will be considered a block that loops once. See L. =item Can't "next" outside a block (F) A "next" statement was executed to reiterate the current block, but there isn't a current block. Note that an "if" or "else" block doesn't -count as a "loopish" block. You can usually double the curlies to get -the same effect though, because the inner curlies will be considered a block -that loops once. See L. +count as a "loopish" block, as doesn't a block given to sort(). You can +usually double the curlies to get the same effect though, because the inner +curlies will be considered a block that loops once. See L. =item Can't "redo" outside a block (F) A "redo" statement was executed to restart the current block, but there isn't a current block. Note that an "if" or "else" block doesn't -count as a "loopish" block. You can usually double the curlies to get -the same effect though, because the inner curlies will be considered a block -that loops once. See L. +count as a "loopish" block, as doesn't a block given to sort(). You can +usually double the curlies to get the same effect though, because the inner +curlies will be considered a block that loops once. See L. =item Can't bless non-reference value @@ -922,6 +929,12 @@ case the conversion routines don't handle. Drat. (W) You are exiting an eval by unconventional means, such as a goto, or a loop control statement. +=item Exiting pseudo-block via %s + +(W) You are exiting a rather special block construct (like a sort block or +subroutine) by unconventional means, such as a goto, or a loop control +statement. See L. + =item Exiting subroutine via %s (W) You are exiting a subroutine by unconventional means, such as @@ -1304,6 +1317,18 @@ See L. allowed to have a comma between that and the following arguments. Otherwise it'd be just another one of the arguments. +One possible cause for this is that you expected to have imported a +constant to your name space with B or B while no such +importing took place, it may for example be that your operating system +does not support that particular constant. Hopefully you did use an +explicit import list for the constants you expect to see, please see +L and L. While an explicit import list +would probably have caught this error earlier it naturally does not +remedy the fact that your operating system still does not support that +constant. Maybe you have a typo in the constants of the symbol import +list of B or B or in the constant name at the line where +this error was triggered? + =item No command into which to pipe on command line (F) An error peculiar to VMS. Perl handles its own command line redirection, diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 99231b9..e532ed2 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -1408,9 +1408,12 @@ Returns the socket option requested, or undefined if there is an error. =item glob EXPR +=item glob + Returns the value of EXPR with filename expansions such as a shell would do. This is the internal function implementing the E*.*E operator, except it's easier to use. +If EXPR is omitted, $_ is used. =item gmtime EXPR @@ -1426,6 +1429,13 @@ All array elements are numeric, and come straight out of a struct tm. In particular this means that $mon has the range 0..11 and $wday has the range 0..6. If EXPR is omitted, does C. +In a scalar context, prints out the ctime(3) value: + + $now_string = gmtime; # e.g., "Thu Oct 13 04:54:34 1994" + +Also see the F library, and the strftime(3) function available +via the POSIX module. + =item goto LABEL =item goto EXPR @@ -1435,8 +1445,9 @@ the range 0..6. If EXPR is omitted, does C. The goto-LABEL form finds the statement labeled with LABEL and resumes execution there. It may not be used to go into any construct that requires initialization, such as a subroutine or a foreach loop. It -also can't be used to go into a construct that is optimized away. It -can be used to go almost anywhere else within the dynamic scope, +also can't be used to go into a construct that is optimized away, +or to get out of a block or subroutine given to sort(). +It can be used to go almost anywhere else within the dynamic scope, including out of subroutines, but it's usually better to use some other construct such as last or die. The author of Perl has never felt the need to use this form of goto (in Perl, that is--C is another matter). @@ -1692,13 +1703,14 @@ follows: All array elements are numeric, and come straight out of a struct tm. In particular this means that $mon has the range 0..11 and $wday has -the range 0..6. If EXPR is omitted, does localtime(time). +the range 0..6 and $year is year-1900, that is, $year is 123 in year +2023. If EXPR is omitted, uses the current time ("localtime(time)"). -In a scalar context, prints out the ctime(3) value: +In a scalar context, returns the ctime(3) value: $now_string = localtime; # e.g., "Thu Oct 13 04:54:34 1994" -Also see the F library, and the strftime(3) function available +Also see the Time::Local module, and the strftime(3) function available via the POSIX module. =item log EXPR @@ -2787,6 +2799,9 @@ the subroutine not via @_ but as the package global variables $a and $b (see example below). They are passed by reference, so don't modify $a and $b. And don't try to declare them as lexicals either. +You also cannot exit out of the sort block or subroutine using any of the +loop control operators described in L or with goto(). + When C is in effect, C sorts LIST according to the current collation locale. See L. diff --git a/pod/perlguts.pod b/pod/perlguts.pod index a7b11c6..3d16f94 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -8,6 +8,8 @@ This document attempts to describe some of the internal functions of the Perl executable. It is far from complete and probably contains many errors. Please refer any questions or comments to the author below. +=head1 Variables + =head2 Datatypes Perl has three typedefs that handle Perl's three main data types: @@ -557,7 +559,47 @@ as any other SV. For more information on references and blessings, consult L. -=head2 Magic +=head2 Double-Typed SV's + +Scalar variables normally contain only one type of value, an integer, +double, pointer, or reference. Perl will automatically convert the +actual scalar data from the stored type into the requested type. + +Some scalar variables contain more than one type of scalar data. For +example, the variable C<$!> contains either the numeric value of C +or its string equivalent from either C or C. + +To force multiple data values into an SV, you must do two things: use the +C routines to add the additional scalar type, then set a flag +so that Perl will believe it contains more than one type of data. The +four macros to set the flags are: + + SvIOK_on + SvNOK_on + SvPOK_on + SvROK_on + +The particular macro you must use depends on which C routine +you called first. This is because every C routine turns on +only the bit for the particular type of data being set, and turns off +all the rest. + +For example, to create a new Perl variable called "dberror" that contains +both the numeric and descriptive string error values, you could use the +following code: + + extern int dberror; + extern char *dberror_list; + + SV* sv = perl_get_sv("dberror", TRUE); + sv_setiv(sv, (IV) dberror); + sv_setpv(sv, dberror_list[dberror]); + SvIOK_on(sv); + +If the order of C and C had been reversed, then the +macro C would need to be called instead of C. + +=head2 Magic Variables [This section still under construction. Ignore everything here. Post no bills. Everything not permitted is forbidden.] @@ -724,45 +766,7 @@ This routine checks to see what types of magic C has. If the mg_type field is an upper-case letter, then the mg_obj is copied to C, but the mg_type field is changed to be the lower-case letter. -=head2 Double-Typed SV's - -Scalar variables normally contain only one type of value, an integer, -double, pointer, or reference. Perl will automatically convert the -actual scalar data from the stored type into the requested type. - -Some scalar variables contain more than one type of scalar data. For -example, the variable C<$!> contains either the numeric value of C -or its string equivalent from either C or C. - -To force multiple data values into an SV, you must do two things: use the -C routines to add the additional scalar type, then set a flag -so that Perl will believe it contains more than one type of data. The -four macros to set the flags are: - - SvIOK_on - SvNOK_on - SvPOK_on - SvROK_on - -The particular macro you must use depends on which C routine -you called first. This is because every C routine turns on -only the bit for the particular type of data being set, and turns off -all the rest. - -For example, to create a new Perl variable called "dberror" that contains -both the numeric and descriptive string error values, you could use the -following code: - - extern int dberror; - extern char *dberror_list; - - SV* sv = perl_get_sv("dberror", TRUE); - sv_setiv(sv, (IV) dberror); - sv_setpv(sv, dberror_list[dberror]); - SvIOK_on(sv); - -If the order of C and C had been reversed, then the -macro C would need to be called instead of C. +=head1 Subroutines =head2 XSUB's and the Argument Stack @@ -914,8 +918,6 @@ is being used. For a complete description of the PerlIO abstraction, consult L. -=head2 Scratchpads - =head2 Putting a C value on Perl stack A lot of opcodes (this is an elementary operation in the internal perl @@ -924,7 +926,7 @@ the corresponding SV is (usually) not recreated each time. The opcodes reuse specially assigned SVs (Is) which are (as a corollary) not constantly freed/created. -Each of the targets is created only once (but see +Each of the targets is created only once (but see L below), and when an opcode needs to put an integer, a double, or a string on stack, it just sets the corresponding parts of its I and puts the I on stack. @@ -973,7 +975,144 @@ if it is, new scratchpad is created and pushed into the array. The Is on this scratchpad are Cs, but they are already marked with correct flags. -=head2 API LISTING +=head1 Compiled code + +=head2 Code tree + +Here we describe the internal form your code is converted to by +Perl. Start with a simple example: + + $a = $b + $c; + +This is converted to a tree similar to this one: + + assign-to + / \ + + $a + / \ + $b $c + +(but slightly more complicated). This tree reflect the way Perl +parsed your code, but has nothing to do with the execution order. +There is an additional "thread" going through the nodes of the tree +which shows the order of execution of the nodes. In our simplified +example above it looks like: + + $b ---> $c ---> + ---> $a ---> assign-to + +But with the actual compile tree for C<$a = $b + $c> it is different: +some nodes I. As a corollary, though the actual tree +contains more nodes than our simplified example, the execution order +is the same as in our example. + +=head2 Examining the tree + +If you have your perl compiled for debugging (usually done with C<-D +optimize=-g> on C command line), you may examine the +compiled tree by specifying C<-Dx> on the Perl command line. The +output takes several lines per node, and for C<$b+$c> it looks like +this: + + 5 TYPE = add ===> 6 + TARG = 1 + FLAGS = (SCALAR,KIDS) + { + TYPE = null ===> (4) + (was rv2sv) + FLAGS = (SCALAR,KIDS) + { + 3 TYPE = gvsv ===> 4 + FLAGS = (SCALAR) + GV = main::b + } + } + { + TYPE = null ===> (5) + (was rv2sv) + FLAGS = (SCALAR,KIDS) + { + 4 TYPE = gvsv ===> 5 + FLAGS = (SCALAR) + GV = main::c + } + } + +This tree has 5 nodes (one per C specifier), only 3 of them are +not optimized away (one per number in the left column). The immediate +children of the given node correspond to C<{}> pairs on the same level +of indentation, thus this listing corresponds to the tree: + + add + / \ + null null + | | + gvsv gvsv + +The execution order is indicated by C<===E> marks, thus it is C<3 +4 5 6> (node C<6> is not included into above listing), i.e., +C. + +=head2 Compile pass 1: check routines + +The tree is created by the I while yacc code feeds it +the constructions it recognizes. Since yacc works bottom-up, so does +the first pass of perl compilation. + +What makes this pass interesting for perl developers is that some +optimization may be performed on this pass. This is optimization by +so-called I. The correspondence between node names +and corresponding check routines is described in F (do not +forget to run C if you modify this file). + +A check routine is called when the node is fully constructed except +for the execution-order thread. Since at this time there is no +back-links to the currently constructed node, one can do most any +operation to the top-level node, including freeing it and/or creating +new nodes above/below it. + +The check routine returns the node which should be inserted into the +tree (if the top-level node was not modified, check routine returns +its argument). + +By convention, check routines have names C. They are usually +called from C subroutines (or C) (which in turn are +called from F). + +=head2 Compile pass 1a: constant folding + +Immediately after the check routine is called the returned node is +checked for being compile-time executable. If it is (the value is +judged to be constant) it is immediately executed, and a I +node with the "return value" of the corresponding subtree is +substituted instead. The subtree is deleted. + +If constant folding was not performed, the execution-order thread is +created. + +=head2 Compile pass 2: context propagation + +When a context for a part of compile tree is known, it is propagated +down through the tree. Aat this time the context can have 5 values +(instead of 2 for runtime context): void, boolean, scalar, list, and +lvalue. In contrast with the pass 1 this pass is processed from top +to bottom: a node's context determines the context for its children. + +Additional context-dependent optimizations are performed at this time. +Since at this moment the compile tree contains back-references (via +"thread" pointers), nodes cannot be free()d now. To allow +optimized-away nodes at this stage, such nodes are null()ified instead +of free()ing (i.e. their type is changed to OP_NULL). + +=head2 Compile pass 3: peephole optimization + +After the compile tree for a subroutine (or for an C or a file) +is created, an additional pass over the code is performed. This pass +is neither top-down or bottom-up, but in the execution order (with +additional compilications for conditionals). These optimizations are +done in the subroutine peep(). Optimizations performed at this stage +are subject to the same restrictions as in the pass 2. + +=head1 API LISTING This is a listing of functions, macros, flags, and variables that may be useful to extension writers or that may be found while reading other @@ -1192,10 +1331,16 @@ Returns the glob with the given C and a defined subroutine or C. The glob lives in the given C, or in the stashes accessable via @ISA and @. -As a side-effect creates a glob with the given C in the given C -which in the case of success contains an alias for the subroutine, and -sets up caching info for this glob. Similarly for all the searched -stashes. +The argument C should be either 0 or -1. If C, as a +side-effect creates a glob with the given C in the given +C which in the case of success contains an alias for the +subroutine, and sets up caching info for this glob. Similarly for all +the searched stashes. + +The GV returned from C may be a method cache entry, +which is not visible to Perl code. So when calling C, +you should not use the GV directly; instead, you should use the +method's CV, which can be obtained from the GV with the C macro. GV* gv_fetchmeth _((HV* stash, char* name, STRLEN len, I32 level)); @@ -1214,8 +1359,10 @@ Use the glob created via a side effect to do this. This function grants C<"SUPER"> token as prefix of name or postfix of the stash name. -Has the same side-effects and as C. C should be -writable if contains C<':'> or C<'\''>. +Has the same side-effects and as C with C. +C should be writable if contains C<':'> or C<'\''>. +The warning against passing the GV returned by C to +C apply equally to C. GV* gv_fetchmethod _((HV* stash, char* name)); @@ -2601,4 +2748,4 @@ API Listing by Dean Roehrich . =head1 DATE -Version 30: 1997/1/17 +Version 31: 1997/1/27 diff --git a/pod/perltoc.pod b/pod/perltoc.pod index f451606..8c97163 100644 --- a/pod/perltoc.pod +++ b/pod/perltoc.pod @@ -54,8 +54,6 @@ HOME, LOGDIR, PATH, PERL5LIB, PERL5DB, PERL_DESTRUCT_LEVEL, PERLLIB =item New Opcode Module and Revised Safe Module -=item Extended Fcntl Module - =item Internal Change: FileHandle Deprecated =item Internal Change: PerlIO internal IO abstraction interface @@ -99,6 +97,10 @@ use blib, use blib 'dir', use locale, use ops =item Math::Complex +=item DB_File + +=item Net::Ping + =item Overridden Built-ins =back @@ -113,6 +115,10 @@ C XSUBs now default to returning nothing =back +=item C Language API Changes + +C and C + =item Documentation Changes L, L, L, L, L, @@ -353,8 +359,8 @@ getgrent, gethostent, getnetent, getprotoent, getservent, setpwent, setgrent, sethostent STAYOPEN, setnetent STAYOPEN, setprotoent STAYOPEN, setservent STAYOPEN, endpwent, endgrent, endhostent, endnetent, endprotoent, endservent, getsockname SOCKET, getsockopt -SOCKET,LEVEL,OPTNAME, glob EXPR, gmtime EXPR, goto LABEL, goto EXPR, goto -&NAME, grep BLOCK LIST, grep EXPR,LIST, hex EXPR, hex, import, index +SOCKET,LEVEL,OPTNAME, glob EXPR, glob, gmtime EXPR, goto LABEL, goto EXPR, +goto &NAME, grep BLOCK LIST, grep EXPR,LIST, hex EXPR, hex, import, index STR,SUBSTR,POSITION, index STR,SUBSTR, int EXPR, int, ioctl FILEHANDLE,FUNCTION,SCALAR, join EXPR,LIST, keys ASSOC_ARRAY, kill LIST, last LABEL, last, lc EXPR, lc, lcfirst EXPR, lcfirst, length EXPR, length, @@ -1395,6 +1401,8 @@ B, B =item DESCRIPTION +=item Variables + =over =item Datatypes @@ -1419,7 +1427,9 @@ B, B =item Stashes and Globs -=item Magic +=item Double-Typed SV's + +=item Magic Variables =item Assigning Magic @@ -1427,7 +1437,11 @@ B, B =item Finding Magic -=item Double-Typed SV's +=back + +=item Subroutines + +=over =item XSUB's and the Argument Stack @@ -1437,14 +1451,32 @@ B, B =item PerlIO -=item Scratchpads - =item Putting a C value on Perl stack =item Scratchpads =item Scratchpads and recursions +=back + +=item Compiled code + +=over + +=item Code tree + +=item Examining the tree + +=item Compile pass 1: check routines + +=item Compile pass 1a: constant folding + +=item Compile pass 2: context propagation + +=item Compile pass 3: peephole optimization + +=back + =item API LISTING AvFILL, av_clear, av_extend, av_fetch, av_len, av_make, av_pop, av_push, @@ -1482,8 +1514,6 @@ XSRETURN, XSRETURN_EMPTY, XSRETURN_IV, XSRETURN_NO, XSRETURN_NV, XSRETURN_PV, XSRETURN_UNDEF, XSRETURN_YES, XST_mIV, XST_mNV, XST_mNO, XST_mPV, XST_mUNDEF, XST_mYES, XS_VERSION, XS_VERSION_BOOTCHECK, Zero -=back - =item EDITOR =item DATE @@ -3410,6 +3440,8 @@ unexpand(1) =item EXAMPLE +=item BUGS + =item AUTHOR =head2 Tie::Hash, Tie::StdHash - base class definitions for tied hashes diff --git a/pp_ctl.c b/pp_ctl.c index 58ab34c..8eb32e2 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -643,7 +643,7 @@ PP(pp_sort) SAVESPTR(GvSV(firstgv)); SAVESPTR(GvSV(secondgv)); - PUSHBLOCK(cx, CXt_LOOP, stack_base); + PUSHBLOCK(cx, CXt_NULL, stack_base); sortcxix = cxstack_ix; qsort((char*)(myorigmark+1), max, sizeof(SV*), sortcv); @@ -784,6 +784,10 @@ char *label; if (dowarn) warn("Exiting eval via %s", op_name[op->op_type]); break; + case CXt_NULL: + if (dowarn) + warn("Exiting pseudo-block via %s", op_name[op->op_type]); + return -1; case CXt_LOOP: if (!cx->blk_loop.label || strNE(label, cx->blk_loop.label) ) { @@ -873,6 +877,10 @@ I32 startingblock; if (dowarn) warn("Exiting eval via %s", op_name[op->op_type]); break; + case CXt_NULL: + if (dowarn) + warn("Exiting pseudo-block via %s", op_name[op->op_type]); + return -1; case CXt_LOOP: DEBUG_l( deb("(Found loop #%d)\n", i)); return i; @@ -904,6 +912,7 @@ I32 cxix; case CXt_LOOP: POPLOOP(cx); break; + case CXt_NULL: case CXt_SUBST: break; } @@ -1752,6 +1761,9 @@ PP(pp_goto) else gotoprobe = main_root; break; + case CXt_NULL: + DIE("Can't \"goto\" outside a block"); + break; default: if (ix) DIE("panic: goto"); diff --git a/t/op/closure.t b/t/op/closure.t index e69de29..752f30c 100755 --- a/t/op/closure.t +++ b/t/op/closure.t @@ -0,0 +1,417 @@ +#!./perl +# -*- Mode: Perl -*- +# closure.t: +# Original written by Ulrich Pfeifer on 2 Jan 1997. +# Greatly extended by Tom Phoenix on 28 Jan 1997. +# + +print "1..167\n"; + +my $test = 1; +sub test (&) { + print ((&{$_[0]})?"ok $test\n":"not ok $test\n"); + $test++; +} + +my $i = 1; +sub foo { $i = shift if @_; $i } + +# no closure +test { foo == 1 }; +foo(2); +test { foo == 2 }; + +# closure: lexical outside sub +my $foo = sub {$i = shift if @_; $i }; +my $bar = sub {$i = shift if @_; $i }; +test {&$foo() == 2 }; +&$foo(3); +test {&$foo() == 3 }; +# did the lexical change? +test { foo == 3 and $i == 3}; +# did the second closure notice? +test {&$bar() == 3 }; + +# closure: lexical inside sub +sub bar { + my $i = shift; + sub { $i = shift if @_; $i } +} + +$foo = bar(4); +$bar = bar(5); +test {&$foo() == 4 }; +&$foo(6); +test {&$foo() == 6 }; +test {&$bar() == 5 }; + +# nested closures +sub bizz { + my $i = 7; + if (@_) { + my $i = shift; + sub {$i = shift if @_; $i }; + } else { + my $i = $i; + sub {$i = shift if @_; $i }; + } +} +$foo = bizz(); +$bar = bizz(); +test {&$foo() == 7 }; +&$foo(8); +test {&$foo() == 8 }; +test {&$bar() == 7 }; + +$foo = bizz(9); +$bar = bizz(10); +test {&$foo(11)-1 == &$bar()}; + +my @foo; +for (qw(0 1 2 3 4)) { + my $i = $_; + $foo[$_] = sub {$i = shift if @_; $i }; +} + +test { + &{$foo[0]}() == 0 and + &{$foo[1]}() == 1 and + &{$foo[2]}() == 2 and + &{$foo[3]}() == 3 and + &{$foo[4]}() == 4 + }; + +for (0 .. 4) { + &{$foo[$_]}(4-$_); +} + +test { + &{$foo[0]}() == 4 and + &{$foo[1]}() == 3 and + &{$foo[2]}() == 2 and + &{$foo[3]}() == 1 and + &{$foo[4]}() == 0 + }; + +sub barf { + my @foo; + for (qw(0 1 2 3 4)) { + my $i = $_; + $foo[$_] = sub {$i = shift if @_; $i }; + } + @foo; +} + +@foo = barf(); +test { + &{$foo[0]}() == 0 and + &{$foo[1]}() == 1 and + &{$foo[2]}() == 2 and + &{$foo[3]}() == 3 and + &{$foo[4]}() == 4 + }; + +for (0 .. 4) { + &{$foo[$_]}(4-$_); +} + +test { + &{$foo[0]}() == 4 and + &{$foo[1]}() == 3 and + &{$foo[2]}() == 2 and + &{$foo[3]}() == 1 and + &{$foo[4]}() == 0 + }; + +# Additional tests by Tom Phoenix . + +{ + BEGIN { + if (-d 't') { + unshift @INC, "lib" + } else { + unshift @INC, '../lib' + } + } + use strict; + + use vars qw!$test!; + my($debugging, %expected, $inner_type, $where_declared, $within); + my($nc_attempt, $call_outer, $call_inner, $undef_outer); + my($code, $inner_sub_test, $expected, $line, $errors, $output); + my(@inners, $sub_test, $pid); + $debugging = 1 if defined($ARGV[0]) and $ARGV[0] eq '-debug'; + + # The expected values for these tests + %expected = ( + 'global_scalar' => 1001, + 'global_array' => 2101, + 'global_hash' => 3004, + 'fs_scalar' => 4001, + 'fs_array' => 5101, + 'fs_hash' => 6004, + 'sub_scalar' => 7001, + 'sub_array' => 8101, + 'sub_hash' => 9004, + 'foreach' => 10011, + ); + + # Our innermost sub is either named or anonymous + for $inner_type (qw!named anon!) { + # And it may be declared at filescope, within a named + # sub, or within an anon sub + for $where_declared (qw!filescope in_named in_anon!) { + # And that, in turn, may be within a foreach loop, + # a naked block, or another named sub + for $within (qw!foreach naked other_sub!) { + + # Here are a number of variables which show what's + # going on, in a way. + $nc_attempt = 0+ # Named closure attempted + ( ($inner_type eq 'named') || + ($within eq 'other_sub') ) ; + $call_inner = 0+ # Need to call &inner + ( ($inner_type eq 'anon') && + ($within eq 'other_sub') ) ; + $call_outer = 0+ # Need to call &outer or &$outer + ( ($inner_type eq 'anon') && + ($within ne 'other_sub') ) ; + $undef_outer = 0+ # $outer is created but unused + ( ($where_declared eq 'in_anon') && + (not $call_outer) ) ; + + $code = "# This is a test script built by t/op/closure.t\n\n"; + + $code .= <<"DEBUG_INFO" if $debugging; +# inner_type: $inner_type +# where_declared: $where_declared +# within: $within +# nc_attempt: $nc_attempt +# call_inner: $call_inner +# call_outer: $call_outer +# undef_outer: $undef_outer +DEBUG_INFO + + $code .= <<"END_MARK_ONE"; + +BEGIN { \$SIG{__WARN__} = sub { + my \$msg = \$_[0]; +END_MARK_ONE + + $code .= <<"END_MARK_TWO" if $nc_attempt; + return if index(\$msg, 'will not stay shared') != -1; + return if index(\$msg, 'may be unavailable') != -1; +END_MARK_TWO + + $code .= <<"END_MARK_THREE"; # Backwhack a lot! + print "not ok: got unexpected warning \$msg\\n"; +} } + +{ + my \$test = $test; + sub test (&) { + my \$result = &{\$_[0]}; + print "not " unless \$result; + print "ok \$test\\n"; + \$test++; + } +} + +# some of the variables which the closure will access +\$global_scalar = 1000; +\@global_array = (2000, 2100, 2200, 2300); +%global_hash = 3000..3009; + +my \$fs_scalar = 4000; +my \@fs_array = (5000, 5100, 5200, 5300); +my %fs_hash = 6000..6009; + +END_MARK_THREE + + if ($where_declared eq 'filescope') { + # Nothing here + } elsif ($where_declared eq 'in_named') { + $code .= <<'END'; +sub outer { + my $sub_scalar = 7000; + my @sub_array = (8000, 8100, 8200, 8300); + my %sub_hash = 9000..9009; +END + # } + } elsif ($where_declared eq 'in_anon') { + $code .= <<'END'; +$outer = sub { + my $sub_scalar = 7000; + my @sub_array = (8000, 8100, 8200, 8300); + my %sub_hash = 9000..9009; +END + # } + } else { + die "What was $where_declared?" + } + + if ($within eq 'foreach') { + $code .= " + my \$foreach = 12000; + my \@list = (10000, 10010); + foreach \$foreach (\@list) { + " # } + } elsif ($within eq 'naked') { + $code .= " { # naked block\n" # } + } elsif ($within eq 'other_sub') { + $code .= " sub inner_sub {\n" # } + } else { + die "What was $within?" + } + + $sub_test = $test; + @inners = ( qw!global_scalar global_array global_hash! , + qw!fs_scalar fs_array fs_hash! ); + push @inners, 'foreach' if $within eq 'foreach'; + if ($where_declared ne 'filescope') { + push @inners, qw!sub_scalar sub_array sub_hash!; + } + for $inner_sub_test (@inners) { + + if ($inner_type eq 'named') { + $code .= " sub named_$sub_test " + } elsif ($inner_type eq 'anon') { + $code .= " \$anon_$sub_test = sub " + } else { + die "What was $inner_type?" + } + + # Now to write the body of the test sub + if ($inner_sub_test eq 'global_scalar') { + $code .= '{ ++$global_scalar }' + } elsif ($inner_sub_test eq 'fs_scalar') { + $code .= '{ ++$fs_scalar }' + } elsif ($inner_sub_test eq 'sub_scalar') { + $code .= '{ ++$sub_scalar }' + } elsif ($inner_sub_test eq 'global_array') { + $code .= '{ ++$global_array[1] }' + } elsif ($inner_sub_test eq 'fs_array') { + $code .= '{ ++$fs_array[1] }' + } elsif ($inner_sub_test eq 'sub_array') { + $code .= '{ ++$sub_array[1] }' + } elsif ($inner_sub_test eq 'global_hash') { + $code .= '{ ++$global_hash{3002} }' + } elsif ($inner_sub_test eq 'fs_hash') { + $code .= '{ ++$fs_hash{6002} }' + } elsif ($inner_sub_test eq 'sub_hash') { + $code .= '{ ++$sub_hash{9002} }' + } elsif ($inner_sub_test eq 'foreach') { + $code .= '{ ++$foreach }' + } else { + die "What was $inner_sub_test?" + } + + # Close up + if ($inner_type eq 'anon') { + $code .= ';' + } + $code .= "\n"; + $sub_test++; # sub name sequence number + + } # End of foreach $inner_sub_test + + # Close up $within block # { + $code .= " }\n\n"; + + # Close up $where_declared block + if ($where_declared eq 'in_named') { # { + $code .= "}\n\n"; + } elsif ($where_declared eq 'in_anon') { # { + $code .= "};\n\n"; + } + + # We may need to do something with the sub we just made... + $code .= "undef \$outer;\n" if $undef_outer; + $code .= "&inner_sub;\n" if $call_inner; + if ($call_outer) { + if ($where_declared eq 'in_named') { + $code .= "&outer;\n\n"; + } elsif ($where_declared eq 'in_anon') { + $code .= "&\$outer;\n\n" + } + } + + # Now, we can actually prep to run the tests. + for $inner_sub_test (@inners) { + $expected = $expected{$inner_sub_test} or + die "expected $inner_sub_test missing"; + + # Named closures won't access the expected vars + if ( $nc_attempt and + substr($inner_sub_test, 0, 4) eq "sub_" ) { + $expected = 1; + } + + # If you make a sub within a foreach loop, + # what happens if it tries to access the + # foreach index variable? If it's a named + # sub, it gets the var from "outside" the loop, + # but if it's anon, it gets the value to which + # the index variable is aliased. + # + # Of course, if the value was set only + # within another sub which was never called, + # the value has not been set yet. + # + if ($inner_sub_test eq 'foreach') { + if ($inner_type eq 'named') { + if ($call_outer || ($where_declared eq 'filescope')) { + $expected = 12001 + } else { + $expected = 1 + } + } + } + + # Here's the test: + if ($inner_type eq 'anon') { + $code .= "test { &\$anon_$test == $expected };\n" + } else { + $code .= "test { &named_$test == $expected };\n" + } + $test++; + } + + # Fork off a new perl to run the tests. + # (This is so we can catch spurious warnings.) + $| = 1; print ""; $| = 0; # flush output before forking + pipe READ, WRITE or die "Can't make pipe: $!"; + pipe READ2, WRITE2 or die "Can't make second pipe: $!"; + die "Can't fork: $!" unless defined($pid = open PERL, "|-"); + unless ($pid) { + # Child process here. We're going to send errors back + # through the extra pipe. + close READ; + close READ2; + open STDOUT, ">&WRITE" or die "Can't redirect STDOUT: $!"; + open STDERR, ">&WRITE2" or die "Can't redirect STDERR: $!"; + exec './perl', '-w', '-' + or die "Can't exec ./perl: $!"; + } + # Parent process here. + close WRITE; + close WRITE2; + print PERL $code; + close PERL; + $output = join '', ; + $errors = join '', ; + print $output, $errors; + if ($debugging && ($errors || $? || ($output =~ /not ok/))) { + my $lnum = 0; + for $line (split '\n', $code) { + printf "%3d: %s\n", ++$lnum, $line; + } + } + printf "not ok: exited with error code %04lX\n",$? if $?; + print "-" x 30, $/ if $debugging; + + } # End of foreach $within + } # End of foreach $where_declared + } # End of foreach $inner_type + +} diff --git a/t/op/glob.t b/t/op/glob.t index fce2952..cc60a17 100755 --- a/t/op/glob.t +++ b/t/op/glob.t @@ -2,9 +2,9 @@ # $RCSfile: glob.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:55 $ -print "1..4\n"; +print "1..6\n"; -@ops = ; +@oops = @ops = ; map { $files{$_}++ } ; map { delete $files{$_} } split /[\s\n]/, `echo op/*`; @@ -21,3 +21,11 @@ while () { print "${not}ok 3\n"; print $/ eq "\n" ? "ok 4\n" : "not ok 4\n"; + +# test the "glob" operator +$_ = "op/*"; +@glops = glob $_; +print "@glops" eq "@oops" ? "ok 5\n" : "not ok 5\n"; + +@glops = glob; +print "@glops" eq "@oops" ? "ok 6\n" : "not ok 6\n"; diff --git a/vms/Makefile b/vms/Makefile index f84139e..e0b293f 100644 --- a/vms/Makefile +++ b/vms/Makefile @@ -32,7 +32,7 @@ ARCH = VMS_VAX OBJVAL = $@ # Updated by fndvers.com -- do not edit by hand -PERL_VERSION = 5_00323# +PERL_VERSION = 5_00324# ARCHDIR = [.lib.$(ARCH).$(PERL_VERSION)] diff --git a/vms/config.vms b/vms/config.vms index 75bf302..95aefec 100644 --- a/vms/config.vms +++ b/vms/config.vms @@ -76,7 +76,7 @@ * when Perl is built. Please do not change it by hand; make * any changes to FndVers.Com instead. */ -#define ARCHLIB_EXP "/perl_root/lib/VMS_VAX/5_00323" /**/ +#define ARCHLIB_EXP "/perl_root/lib/VMS_VAX/5_00324" /**/ #define ARCHLIB ARCHLIB_EXP /*config-skip*/ /* ARCHNAME: diff --git a/vms/descrip.mms b/vms/descrip.mms index c66736f..cfa4b66 100644 --- a/vms/descrip.mms +++ b/vms/descrip.mms @@ -65,7 +65,7 @@ OBJVAL = $(MMS$TARGET_NAME)$(O) .endif # Updated by fndvers.com -- do not edit by hand -PERL_VERSION = 5_00323# +PERL_VERSION = 5_00324# ARCHDIR = [.lib.$(ARCH).$(PERL_VERSION)] diff --git a/win32/EXTERN.h b/win32/EXTERN.h new file mode 100644 index 0000000..f9dc77c --- /dev/null +++ b/win32/EXTERN.h @@ -0,0 +1,47 @@ +/* EXTERN.h + * + * Copyright (c) 1991-1994, Larry Wall + * + * You may distribute under the terms of either the GNU General Public + * License or the Artistic License, as specified in the README file. + * + */ + +/* + * EXT designates a global var which is defined in perl.h + * dEXT designates a global var which is defined in another + * file, so we can't count on finding it in perl.h + * (this practice should be avoided). + */ +#undef EXT +#undef dEXT +#undef EXTCONST +#undef dEXTCONST +#if defined(VMS) && !defined(__GNUC__) +# define EXT globalref +# define dEXT globaldef {"$GLOBAL_RW_VARS"} noshare +# define EXTCONST globalref +# define dEXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly +#elif defined(_MSC_VER) && defined(_WIN32) +# ifdef PERLDLL +# define EXT __declspec(dllexport) +# define dEXT +# define EXTCONST __declspec(dllexport) const +# define dEXTCONST const +# else +# define EXT __declspec(dllimport) +# define dEXT +# define EXTCONST __declspec(dllimport) const +# define dEXTCONST const +# endif +#else +# define EXT extern +# define dEXT +# define EXTCONST extern const +# define dEXTCONST const +#endif + +#undef INIT +#define INIT(x) + +#undef DOINIT diff --git a/win32/Fcntl.mak b/win32/Fcntl.mak new file mode 100644 index 0000000..4e07efb --- /dev/null +++ b/win32/Fcntl.mak @@ -0,0 +1,247 @@ +# Microsoft Developer Studio Generated NMAKE File, Format Version 4.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +!IF "$(CFG)" == "" +CFG=Fcntl - Win32 Debug +!MESSAGE No configuration specified. Defaulting to Fcntl - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "Fcntl - Win32 Release" && "$(CFG)" != "Fcntl - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE on this makefile +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Fcntl.mak" CFG="Fcntl - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Fcntl - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "Fcntl - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF +################################################################################ +# Begin Project +CPP=cl.exe +RSC=rc.exe +MTL=mktyplib.exe + +!IF "$(CFG)" == "Fcntl - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Fcntl___" +# PROP BASE Intermediate_Dir "Fcntl___" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +OUTDIR=.\Release +INTDIR=.\Release + +ALL : "$(OUTDIR)\Fcntl.dll" + +CLEAN : + -@erase "..\lib\auto\Fcntl\Fcntl.dll" + -@erase ".\Release\Fcntl.obj" + -@erase ".\Release\Fcntl.lib" + -@erase ".\Release\Fcntl.exp" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I ".\include" /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +CPP_PROJ=/nologo /MT /W3 /GX /O2 /I ".\include" /I "." /I ".." /D "WIN32" /D\ + "NDEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/Fcntl.pch" /YX /Fo"$(INTDIR)/" /c +CPP_OBJS=.\Release/ +CPP_SBRS= +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /win32 +MTL_PROJ=/nologo /D "NDEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/Fcntl.bsc" +BSC32_SBRS= +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /pdb:none /machine:I386 /out:"../lib/auto/Fcntl/Fcntl.dll" +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ + advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\ + /subsystem:windows /dll /pdb:none /machine:I386 /def:".\Fcntl.def"\ + /out:"../lib/auto/Fcntl/Fcntl.dll" /implib:"$(OUTDIR)/Fcntl.lib" +DEF_FILE= \ + ".\Fcntl.def" +LINK32_OBJS= \ + ".\Release\Fcntl.obj" \ + "..\perl.lib" + +"$(OUTDIR)\Fcntl.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "Fcntl - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Fcntl__0" +# PROP BASE Intermediate_Dir "Fcntl__0" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +OUTDIR=.\Debug +INTDIR=.\Debug + +ALL : "$(OUTDIR)\Fcntl.dll" + +CLEAN : + -@erase "..\lib\auto\Fcntl\Fcntl.dll" + -@erase ".\Debug\Fcntl.obj" + -@erase ".\Debug\vc40.pdb" + -@erase ".\Debug\vc40.idb" + -@erase ".\Debug\Fcntl.lib" + -@erase ".\Debug\Fcntl.exp" + -@erase ".\Debug\Fcntl.pdb" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\include" /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c +CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\include" /I "." /I ".." /D\ + "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/Fcntl.pch" /YX /Fo"$(INTDIR)/"\ + /Fd"$(INTDIR)/" /c +CPP_OBJS=.\Debug/ +CPP_SBRS= +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /win32 +MTL_PROJ=/nologo /D "_DEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/Fcntl.bsc" +BSC32_SBRS= +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /incremental:no /debug /machine:I386 /out:"../lib/auto/Fcntl/Fcntl.dll" +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ + advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\ + /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)/Fcntl.pdb" /debug\ + /machine:I386 /def:".\Fcntl.def" /out:"../lib/auto/Fcntl/Fcntl.dll"\ + /implib:"$(OUTDIR)/Fcntl.lib" +DEF_FILE= \ + ".\Fcntl.def" +LINK32_OBJS= \ + ".\Debug\Fcntl.obj" \ + "..\perl.lib" + +"$(OUTDIR)\Fcntl.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + +.c{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.c{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +################################################################################ +# Begin Target + +# Name "Fcntl - Win32 Release" +# Name "Fcntl - Win32 Debug" + +!IF "$(CFG)" == "Fcntl - Win32 Release" + +!ELSEIF "$(CFG)" == "Fcntl - Win32 Debug" + +!ENDIF + +################################################################################ +# Begin Source File + +SOURCE=..\ext\Fcntl\Fcntl.c +NODEP_CPP_FCNTL=\ + "..\ext\Fcntl\EXTERN.h"\ + "..\ext\Fcntl\perl.h"\ + "..\ext\Fcntl\XSUB.h"\ + + +!IF "$(CFG)" == "Fcntl - Win32 Release" + + +"$(INTDIR)\Fcntl.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "Fcntl - Win32 Debug" + + +"$(INTDIR)\Fcntl.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\Fcntl.def + +!IF "$(CFG)" == "Fcntl - Win32 Release" + +!ELSEIF "$(CFG)" == "Fcntl - Win32 Debug" + +!ENDIF + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=..\perl.lib + +!IF "$(CFG)" == "Fcntl - Win32 Release" + +!ELSEIF "$(CFG)" == "Fcntl - Win32 Debug" + +!ENDIF + +# End Source File +# End Target +# End Project +################################################################################ diff --git a/win32/IO.mak b/win32/IO.mak new file mode 100644 index 0000000..7cd744e --- /dev/null +++ b/win32/IO.mak @@ -0,0 +1,245 @@ +# Microsoft Developer Studio Generated NMAKE File, Format Version 4.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +!IF "$(CFG)" == "" +CFG=IO - Win32 Debug +!MESSAGE No configuration specified. Defaulting to IO - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "IO - Win32 Release" && "$(CFG)" != "IO - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE on this makefile +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "IO.mak" CFG="IO - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "IO - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "IO - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF +################################################################################ +# Begin Project +CPP=cl.exe +RSC=rc.exe +MTL=mktyplib.exe + +!IF "$(CFG)" == "IO - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "IO___Win" +# PROP BASE Intermediate_Dir "IO___Win" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +OUTDIR=.\Release +INTDIR=.\Release + +ALL : "$(OUTDIR)\IO.dll" + +CLEAN : + -@erase "..\lib\auto\IO\IO.dll" + -@erase ".\Release\IO.obj" + -@erase ".\Release\IO.lib" + -@erase ".\Release\IO.exp" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I ".\include" /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +CPP_PROJ=/nologo /MT /W3 /GX /O2 /I ".\include" /I "." /I ".." /D "WIN32" /D\ + "NDEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/IO.pch" /YX /Fo"$(INTDIR)/" /c +CPP_OBJS=.\Release/ +CPP_SBRS= +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /win32 +MTL_PROJ=/nologo /D "NDEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/IO.bsc" +BSC32_SBRS= +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /pdb:none /machine:I386 /out:"..\lib\auto\IO\IO.dll" +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ + advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\ + /subsystem:windows /dll /pdb:none /machine:I386 /def:".\IO.def"\ + /out:"..\lib\auto\IO\IO.dll" /implib:"$(OUTDIR)/IO.lib" +DEF_FILE= \ + ".\IO.def" +LINK32_OBJS= \ + ".\Release\IO.obj" \ + "..\perl.lib" + +"$(OUTDIR)\IO.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "IO - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +OUTDIR=.\Debug +INTDIR=.\Debug + +ALL : "$(OUTDIR)\IO.dll" + +CLEAN : + -@erase ".\Debug\IO.lib" + -@erase ".\Debug\IO.obj" + -@erase ".\Debug\IO.exp" + -@erase ".\Debug\vc40.pdb" + -@erase ".\Debug\vc40.idb" + -@erase "..\lib\auto\IO\IO.dll" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\include" /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c +CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\include" /I "." /I ".." /D\ + "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/IO.pch" /YX /Fo"$(INTDIR)/"\ + /Fd"$(INTDIR)/" /c +CPP_OBJS=.\Debug/ +CPP_SBRS= +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /win32 +MTL_PROJ=/nologo /D "_DEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/IO.bsc" +BSC32_SBRS= +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"..\lib\auto\IO\IO.dll" +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ + advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\ + /subsystem:windows /dll /pdb:none /debug /machine:I386 /def:".\IO.def"\ + /out:"..\lib\auto\IO\IO.dll" /implib:"$(OUTDIR)/IO.lib" +DEF_FILE= \ + ".\IO.def" +LINK32_OBJS= \ + ".\Debug\IO.obj" \ + "..\perl.lib" + +"$(OUTDIR)\IO.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + +.c{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.c{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +################################################################################ +# Begin Target + +# Name "IO - Win32 Release" +# Name "IO - Win32 Debug" + +!IF "$(CFG)" == "IO - Win32 Release" + +!ELSEIF "$(CFG)" == "IO - Win32 Debug" + +!ENDIF + +################################################################################ +# Begin Source File + +SOURCE=..\ext\Io\IO.c +NODEP_CPP_IO_C0=\ + "..\ext\Io\EXTERN.h"\ + "..\ext\Io\perl.h"\ + "..\ext\Io\XSUB.h"\ + + +!IF "$(CFG)" == "IO - Win32 Release" + + +"$(INTDIR)\IO.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "IO - Win32 Debug" + + +"$(INTDIR)\IO.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\IO.def + +!IF "$(CFG)" == "IO - Win32 Release" + +!ELSEIF "$(CFG)" == "IO - Win32 Debug" + +!ENDIF + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=..\perl.lib + +!IF "$(CFG)" == "IO - Win32 Release" + +!ELSEIF "$(CFG)" == "IO - Win32 Debug" + +!ENDIF + +# End Source File +# End Target +# End Project +################################################################################ diff --git a/win32/Makefile b/win32/Makefile new file mode 100644 index 0000000..07e781e --- /dev/null +++ b/win32/Makefile @@ -0,0 +1,126 @@ + +LIBDIR=..\..\lib +EXTDIR=..\ext +EXTUTILSDIR=$(LIBDIR)\extutils +XSUBPP=..\..\miniperl $(EXTUTILSDIR)\xsubpp -C++ -prototypes +AUTOSPLIT=..\..\miniperl ..\..\win32\autosplit.pl +DEST=..\ + +EXTENSIONS=DynaLoader Socket IO Fcntl Opcode SDBM_File +#STATICLINKMODUES=DynaLoader Socket Fcntl Opcode SDBM_File +STATICLINKMODUES= +#DYNALOADMODULES=IO.dll +DYNALOADMODULES=Socket.dll Fcntl.dll Opcode.dll SDBM_File.dll IO.dll + +ALL: perl + +!IF "$(CFG)" =="" +CFG=Release +!ENDIF + +modules : $(EXTENSIONS) + nmake -A -f modules.mak CFG="modules - Win32 $(CFG)" + +perlglob.exe: + nmake -f perlglob.mak CFG="perlglob - Win32 Release" + +libperl.lib: + attrib -r ..\*.h + copy dosish.h .. + copy EXTERN.h .. + nmake -f libperl.mak CFG="libperl - Win32 $(CFG)" + +miniperl.exe: libperl.lib + nmake -A -f miniperl.mak CFG="miniperl - Win32 $(CFG)" + copy config.w32 ..\config.sh + cd .. + miniperl configpm + cd win32 + if exist lib\* xcopy lib\*.* ..\lib\ /s/e + copy bin\test.bat ..\t + +perldll: miniperl.exe libperl.lib + ..\miniperl -w makedef.pl > perldll.def + nmake -A -f perldll.mak CFG="perldll - Win32 $(CFG)" + +dynamodules: $(DYNALOADMODULES) + +perl: miniperl.exe modules perldll perlglob.exe dynamodules + ..\miniperl makemain.pl $(STATICLINKMODUES) > perlmain.c + ..\miniperl makeperldef.pl $(STATICLINKMODUES) > perl.def + copy runperl.c perlmain.c + nmake -A -f perl.mak CFG="perl - Win32 $(CFG)" + copy ..\_perl.exe ..\perl.exe + del ..\_perl.exe + del ..\*.exp + copy splittree.pl .. + ..\miniperl ..\splittree.pl "../LIB" "../LIB/auto" + attrib -r ..\t\*.* + copy test ..\t + xcopy ..\perl.h ..\lib\CORE\*.* + +DynaLoader: + md ..\lib\auto + cd $(EXTDIR)\$* + copy ..\..\win32\dl_win32.xs . + copy $*.pm $(LIBDIR) + $(XSUBPP) dl_win32.xs > $*.c + cd ..\..\win32 + +Socket: + md ..\lib\auto\$* + ..\miniperl genxsdef.pl $* > $*.def + cd $(EXTDIR)\$* + copy $*.pm $(LIBDIR) + $(XSUBPP) $*.xs > $*.c + cd ..\..\win32 + +Socket.dll: + nmake -f $*.mak CFG="$* - Win32 $(CFG)" + +IO: + md ..\lib\auto\$* + ..\miniperl genxsdef.pl $* > $*.def + cd $(EXTDIR)\$* + copy $*.pm $(LIBDIR) + xcopy lib\*.* $(LIBDIR) /s + $(XSUBPP) $*.xs > $*.c + cd ..\..\win32 + +IO.dll: + nmake -f $*.mak CFG="$* - Win32 $(CFG)" + +SDBM_File: + md ..\lib\auto\$* + ..\miniperl genxsdef.pl $* > $*.def + cd $(EXTDIR)\$* + copy $*.pm $(LIBDIR) + $(XSUBPP) -typemap ./typemap $*.xs > $*.c + cd ..\..\win32 + +SDBM_File.dll: + nmake -f $*.mak CFG="$* - Win32 $(CFG)" + +Fcntl: + md ..\lib\auto\$* + ..\miniperl genxsdef.pl $* > $*.def + cd $(EXTDIR)\$* + copy $*.pm $(LIBDIR) + $(XSUBPP) $*.xs > $*.c + cd ..\..\win32 + +Fcntl.dll: + nmake -f $*.mak CFG="$* - Win32 $(CFG)" + +Opcode: + md ..\lib\auto\$* + ..\miniperl genxsdef.pl $* > $*.def + cd $(EXTDIR)\$* + xcopy *.pm $(LIBDIR) + $(XSUBPP) $*.xs > $*.c + cd ..\..\win32 + +Opcode.dll: + nmake -f $*.mak CFG="$* - Win32 $(CFG)" + + diff --git a/win32/Opcode.mak b/win32/Opcode.mak new file mode 100644 index 0000000..6e40b32 --- /dev/null +++ b/win32/Opcode.mak @@ -0,0 +1,247 @@ +# Microsoft Developer Studio Generated NMAKE File, Format Version 4.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +!IF "$(CFG)" == "" +CFG=Opcode - Win32 Debug +!MESSAGE No configuration specified. Defaulting to Opcode - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "Opcode - Win32 Release" && "$(CFG)" != "Opcode - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE on this makefile +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Opcode.mak" CFG="Opcode - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Opcode - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "Opcode - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF +################################################################################ +# Begin Project +CPP=cl.exe +RSC=rc.exe +MTL=mktyplib.exe + +!IF "$(CFG)" == "Opcode - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Opcode__" +# PROP BASE Intermediate_Dir "Opcode__" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +OUTDIR=.\Release +INTDIR=.\Release + +ALL : "$(OUTDIR)\Opcode.dll" + +CLEAN : + -@erase "..\lib\auto\Opcode\Opcode.dll" + -@erase ".\Release\Opcode.obj" + -@erase ".\Release\Opcode.lib" + -@erase ".\Release\Opcode.exp" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I ".\include" /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +CPP_PROJ=/nologo /MT /W3 /GX /O2 /I ".\include" /I "." /I ".." /D "WIN32" /D\ + "NDEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/Opcode.pch" /YX /Fo"$(INTDIR)/" /c +CPP_OBJS=.\Release/ +CPP_SBRS= +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /win32 +MTL_PROJ=/nologo /D "NDEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/Opcode.bsc" +BSC32_SBRS= +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /pdb:none /machine:I386 /out:"../lib/auto/Opcode/Opcode.dll" +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ + advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\ + /subsystem:windows /dll /pdb:none /machine:I386 /def:".\Opcode.def"\ + /out:"../lib/auto/Opcode/Opcode.dll" /implib:"$(OUTDIR)/Opcode.lib" +DEF_FILE= \ + ".\Opcode.def" +LINK32_OBJS= \ + ".\Release\Opcode.obj" \ + "..\perl.lib" + +"$(OUTDIR)\Opcode.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "Opcode - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Opcode_0" +# PROP BASE Intermediate_Dir "Opcode_0" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +OUTDIR=.\Debug +INTDIR=.\Debug + +ALL : "$(OUTDIR)\Opcode.dll" + +CLEAN : + -@erase "..\lib\auto\Opcode\Opcode.dll" + -@erase ".\Debug\Opcode.obj" + -@erase ".\Debug\vc40.pdb" + -@erase ".\Debug\vc40.idb" + -@erase ".\Debug\Opcode.lib" + -@erase ".\Debug\Opcode.exp" + -@erase ".\Debug\Opcode.pdb" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\include" /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c +CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\include" /I "." /I ".." /D\ + "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/Opcode.pch" /YX /Fo"$(INTDIR)/"\ + /Fd"$(INTDIR)/" /c +CPP_OBJS=.\Debug/ +CPP_SBRS= +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /win32 +MTL_PROJ=/nologo /D "_DEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/Opcode.bsc" +BSC32_SBRS= +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /incremental:no /debug /machine:I386 /out:"../lib/auto/Opcode/Opcode.dll" +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ + advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\ + /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)/Opcode.pdb" /debug\ + /machine:I386 /def:".\Opcode.def" /out:"../lib/auto/Opcode/Opcode.dll"\ + /implib:"$(OUTDIR)/Opcode.lib" +DEF_FILE= \ + ".\Opcode.def" +LINK32_OBJS= \ + ".\Debug\Opcode.obj" \ + "..\perl.lib" + +"$(OUTDIR)\Opcode.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + +.c{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.c{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +################################################################################ +# Begin Target + +# Name "Opcode - Win32 Release" +# Name "Opcode - Win32 Debug" + +!IF "$(CFG)" == "Opcode - Win32 Release" + +!ELSEIF "$(CFG)" == "Opcode - Win32 Debug" + +!ENDIF + +################################################################################ +# Begin Source File + +SOURCE=.\Opcode.def + +!IF "$(CFG)" == "Opcode - Win32 Release" + +!ELSEIF "$(CFG)" == "Opcode - Win32 Debug" + +!ENDIF + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=..\ext\Opcode\Opcode.c +NODEP_CPP_OPCOD=\ + "..\ext\Opcode\EXTERN.h"\ + "..\ext\Opcode\perl.h"\ + "..\ext\Opcode\XSUB.h"\ + + +!IF "$(CFG)" == "Opcode - Win32 Release" + + +"$(INTDIR)\Opcode.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "Opcode - Win32 Debug" + + +"$(INTDIR)\Opcode.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=..\perl.lib + +!IF "$(CFG)" == "Opcode - Win32 Release" + +!ELSEIF "$(CFG)" == "Opcode - Win32 Debug" + +!ENDIF + +# End Source File +# End Target +# End Project +################################################################################ diff --git a/win32/README b/win32/README new file mode 100644 index 0000000..aec049a --- /dev/null +++ b/win32/README @@ -0,0 +1,25 @@ +How to build + +1. setup VC environment (VCVARS32) +2. make sure you are in the win32 subdirectory +3. NMAKE + +The resulting perl.exe , perl.dll, perlglob.exe would be put +under the main directory. + +the LIB subdirectory is also properly handled which can be +copy to the final location. If you make the directory structure as +the following : + +perl.exe +perl.dll +perlglob.exe +LIB\..... here goes all the module stuff + + +you can save the PERLLIB= line in the environment. this port would +search the LIB sub-directory where the perl.dll is located. + + +That's it + diff --git a/win32/SDBM_File.mak b/win32/SDBM_File.mak new file mode 100644 index 0000000..0bf5d1a --- /dev/null +++ b/win32/SDBM_File.mak @@ -0,0 +1,361 @@ +# Microsoft Developer Studio Generated NMAKE File, Format Version 4.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +!IF "$(CFG)" == "" +CFG=SDBM_File - Win32 Debug +!MESSAGE No configuration specified. Defaulting to SDBM_File - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "SDBM_File - Win32 Release" && "$(CFG)" !=\ + "SDBM_File - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE on this makefile +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "SDBM_File.mak" CFG="SDBM_File - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "SDBM_File - Win32 Release" (based on\ + "Win32 (x86) Dynamic-Link Library") +!MESSAGE "SDBM_File - Win32 Debug" (based on\ + "Win32 (x86) Dynamic-Link Library") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF +################################################################################ +# Begin Project +# PROP Target_Last_Scanned "SDBM_File - Win32 Debug" +CPP=cl.exe +RSC=rc.exe +MTL=mktyplib.exe + +!IF "$(CFG)" == "SDBM_File - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "SDBM_Fil" +# PROP BASE Intermediate_Dir "SDBM_Fil" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +OUTDIR=.\Release +INTDIR=.\Release + +ALL : "$(OUTDIR)\SDBM_File.dll" + +CLEAN : + -@erase "..\lib\auto\SDBM_File\SDBM_File.dll" + -@erase ".\Release\sdbm.obj" + -@erase ".\Release\pair.obj" + -@erase ".\Release\hash.obj" + -@erase ".\Release\SDBM_File.obj" + -@erase ".\Release\SDBM_File.lib" + -@erase ".\Release\SDBM_File.exp" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I ".\include" /I "." /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "MSDOS" /YX /c +CPP_PROJ=/nologo /MT /W3 /GX /O2 /I ".\include" /I "." /I ".." /D "NDEBUG" /D\ + "WIN32" /D "_WINDOWS" /D "MSDOS" /Fp"$(INTDIR)/SDBM_File.pch" /YX\ + /Fo"$(INTDIR)/" /c +CPP_OBJS=.\Release/ +CPP_SBRS= +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /win32 +MTL_PROJ=/nologo /D "NDEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/SDBM_File.bsc" +BSC32_SBRS= +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /pdb:none /machine:I386 /out:"../lib/auto/SDBM_File/SDBM_File.dll" +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ + advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\ + /subsystem:windows /dll /pdb:none /machine:I386 /def:".\SDBM_File.def"\ + /out:"../lib/auto/SDBM_File/SDBM_File.dll" /implib:"$(OUTDIR)/SDBM_File.lib" +DEF_FILE= \ + ".\SDBM_File.def" +LINK32_OBJS= \ + "$(INTDIR)/sdbm.obj" \ + "$(INTDIR)/pair.obj" \ + "$(INTDIR)/hash.obj" \ + "$(INTDIR)/SDBM_File.obj" \ + "..\perl.lib" + +"$(OUTDIR)\SDBM_File.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "SDBM_File - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Target_Dir "" +OUTDIR=.\Debug +INTDIR=.\Debug + +ALL : "$(OUTDIR)\SDBM_File.dll" + +CLEAN : + -@erase ".\Debug\vc40.pdb" + -@erase ".\Debug\vc40.idb" + -@erase "..\lib\auto\SDBM_File\SDBM_File.dll" + -@erase ".\Debug\hash.obj" + -@erase ".\Debug\pair.obj" + -@erase ".\Debug\SDBM_File.obj" + -@erase ".\Debug\sdbm.obj" + -@erase ".\Debug\SDBM_File.lib" + -@erase ".\Debug\SDBM_File.exp" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\include" /I "." /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "MSDOS" /YX /c +CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\include" /I "." /I ".." /D\ + "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "MSDOS" /Fp"$(INTDIR)/SDBM_File.pch" /YX\ + /Fo"$(INTDIR)/" /Fd"$(INTDIR)/" /c +CPP_OBJS=.\Debug/ +CPP_SBRS= +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /win32 +MTL_PROJ=/nologo /D "_DEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/SDBM_File.bsc" +BSC32_SBRS= +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /pdb:none /debug /machine:I386 /out:"../lib/auto/SDBM_File/SDBM_File.dll" +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ + advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\ + /subsystem:windows /dll /pdb:none /debug /machine:I386 /def:".\SDBM_File.def"\ + /out:"../lib/auto/SDBM_File/SDBM_File.dll" /implib:"$(OUTDIR)/SDBM_File.lib" +DEF_FILE= \ + ".\SDBM_File.def" +LINK32_OBJS= \ + "$(INTDIR)/hash.obj" \ + "$(INTDIR)/pair.obj" \ + "$(INTDIR)/SDBM_File.obj" \ + "$(INTDIR)/sdbm.obj" \ + "..\perl.lib" + +"$(OUTDIR)\SDBM_File.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + +.c{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.c{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +################################################################################ +# Begin Target + +# Name "SDBM_File - Win32 Release" +# Name "SDBM_File - Win32 Debug" + +!IF "$(CFG)" == "SDBM_File - Win32 Release" + +!ELSEIF "$(CFG)" == "SDBM_File - Win32 Debug" + +!ENDIF + +################################################################################ +# Begin Source File + +SOURCE=..\ext\SDBM_File\SDBM_File.c +DEP_CPP_SDBM_=\ + ".\EXTERN.h"\ + ".\..\perl.h"\ + ".\..\XSUB.h"\ + ".\..\ext\SDBM_File\sdbm\sdbm.h"\ + ".\..\embed.h"\ + ".\config.h"\ + {$(INCLUDE)}"\sys\Types.h"\ + ".\..\perlio.h"\ + {$(INCLUDE)}"\sys\Stat.h"\ + ".\include\dirent.h"\ + ".\..\handy.h"\ + ".\..\dosish.h"\ + ".\..\plan9\plan9ish.h"\ + ".\..\unixish.h"\ + ".\..\regexp.h"\ + ".\..\sv.h"\ + ".\..\util.h"\ + ".\..\form.h"\ + ".\..\gv.h"\ + ".\..\cv.h"\ + ".\..\opcode.h"\ + ".\..\op.h"\ + ".\..\cop.h"\ + ".\..\av.h"\ + ".\..\hv.h"\ + ".\..\mg.h"\ + ".\..\scope.h"\ + ".\..\perly.h"\ + ".\..\pp.h"\ + ".\..\proto.h"\ + ".\win32.h"\ + ".\include\sys/socket.h"\ + ".\include\netdb.h"\ + ".\..\perlsdio.h"\ + ".\..\perlsfio.h"\ + ".\..\nostdio.h"\ + +NODEP_CPP_SDBM_=\ + ".\..\os2ish.h"\ + ".\..\vmsish.h"\ + + +!IF "$(CFG)" == "SDBM_File - Win32 Release" + + +"$(INTDIR)\SDBM_File.obj" : $(SOURCE) $(DEP_CPP_SDBM_) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "SDBM_File - Win32 Debug" + + +"$(INTDIR)\SDBM_File.obj" : $(SOURCE) $(DEP_CPP_SDBM_) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=..\ext\SDBM_File\sdbm\sdbm.c +DEP_CPP_SDBM_C=\ + ".\config.h"\ + ".\..\ext\SDBM_File\sdbm\sdbm.h"\ + ".\..\ext\SDBM_File\sdbm\tune.h"\ + ".\win32.h"\ + ".\include\dirent.h"\ + ".\include\sys/socket.h"\ + ".\include\netdb.h"\ + {$(INCLUDE)}"\sys\Types.h"\ + {$(INCLUDE)}"\sys\Stat.h"\ + + +"$(INTDIR)\sdbm.obj" : $(SOURCE) $(DEP_CPP_SDBM_C) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=..\ext\SDBM_File\sdbm\pair.c +DEP_CPP_PAIR_=\ + ".\config.h"\ + ".\..\ext\SDBM_File\sdbm\sdbm.h"\ + ".\..\ext\SDBM_File\sdbm\tune.h"\ + ".\win32.h"\ + ".\include\dirent.h"\ + ".\include\sys/socket.h"\ + ".\include\netdb.h"\ + {$(INCLUDE)}"\sys\Types.h"\ + {$(INCLUDE)}"\sys\Stat.h"\ + + +"$(INTDIR)\pair.obj" : $(SOURCE) $(DEP_CPP_PAIR_) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=..\ext\SDBM_File\sdbm\hash.c +DEP_CPP_HASH_=\ + ".\config.h"\ + ".\..\ext\SDBM_File\sdbm\sdbm.h"\ + ".\win32.h"\ + ".\include\dirent.h"\ + ".\include\sys/socket.h"\ + ".\include\netdb.h"\ + {$(INCLUDE)}"\sys\Types.h"\ + {$(INCLUDE)}"\sys\Stat.h"\ + + +"$(INTDIR)\hash.obj" : $(SOURCE) $(DEP_CPP_HASH_) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\SDBM_File.def + +!IF "$(CFG)" == "SDBM_File - Win32 Release" + +!ELSEIF "$(CFG)" == "SDBM_File - Win32 Debug" + +!ENDIF + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=..\perl.lib + +!IF "$(CFG)" == "SDBM_File - Win32 Release" + +!ELSEIF "$(CFG)" == "SDBM_File - Win32 Debug" + +!ENDIF + +# End Source File +# End Target +# End Project +################################################################################ diff --git a/win32/Socket.mak b/win32/Socket.mak new file mode 100644 index 0000000..f2a09dc --- /dev/null +++ b/win32/Socket.mak @@ -0,0 +1,276 @@ +# Microsoft Developer Studio Generated NMAKE File, Format Version 4.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +!IF "$(CFG)" == "" +CFG=Socket - Win32 Debug +!MESSAGE No configuration specified. Defaulting to Socket - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "Socket - Win32 Release" && "$(CFG)" != "Socket - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE on this makefile +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Socket.mak" CFG="Socket - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Socket - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "Socket - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF +################################################################################ +# Begin Project +# PROP Target_Last_Scanned "Socket - Win32 Debug" +CPP=cl.exe +RSC=rc.exe +MTL=mktyplib.exe + +!IF "$(CFG)" == "Socket - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Socket__" +# PROP BASE Intermediate_Dir "Socket__" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "release" +# PROP Intermediate_Dir "release" +# PROP Target_Dir "" +OUTDIR=.\release +INTDIR=.\release + +ALL : "$(OUTDIR)\Socket.dll" + +CLEAN : + -@erase "..\lib\auto\Socket\Socket.dll" + -@erase ".\release\Socket.obj" + -@erase ".\release\Socket.lib" + -@erase ".\release\Socket.exp" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /MT /W3 /GX /O2 /I ".\include" /I "." /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +CPP_PROJ=/nologo /MT /W3 /GX /O2 /I ".\include" /I "." /I ".." /D "WIN32" /D\ + "NDEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/Socket.pch" /YX /Fo"$(INTDIR)/" /c +CPP_OBJS=.\release/ +CPP_SBRS= +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /win32 +MTL_PROJ=/nologo /D "NDEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/Socket.bsc" +BSC32_SBRS= +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386 /out:"..\lib\auto\Socket\Socket.dll" +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ + advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\ + /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)/Socket.pdb"\ + /machine:I386 /def:".\Socket.def" /out:"..\lib\auto\Socket\Socket.dll"\ + /implib:"$(OUTDIR)/Socket.lib" +DEF_FILE= \ + ".\Socket.def" +LINK32_OBJS= \ + "$(INTDIR)/Socket.obj" \ + "..\perl.lib" + +"$(OUTDIR)\Socket.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "Socket - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Socket_0" +# PROP BASE Intermediate_Dir "Socket_0" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "debug" +# PROP Intermediate_Dir "debug" +# PROP Target_Dir "" +OUTDIR=.\debug +INTDIR=.\debug + +ALL : "$(OUTDIR)\Socket.dll" + +CLEAN : + -@erase ".\debug\vc40.pdb" + -@erase ".\debug\vc40.idb" + -@erase ".\debug\Socket.dll" + -@erase ".\debug\Socket.obj" + -@erase ".\debug\Socket.ilk" + -@erase ".\debug\Socket.lib" + -@erase ".\debug\Socket.exp" + -@erase ".\debug\Socket.pdb" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\include" /I "." /I ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c +CPP_PROJ=/nologo /MTd /W3 /Gm /GX /Zi /Od /I ".\include" /I "." /I ".." /D\ + "WIN32" /D "_DEBUG" /D "_WINDOWS" /Fp"$(INTDIR)/Socket.pch" /YX /Fo"$(INTDIR)/"\ + /Fd"$(INTDIR)/" /c +CPP_OBJS=.\debug/ +CPP_SBRS= +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /win32 +MTL_PROJ=/nologo /D "_DEBUG" /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +BSC32_FLAGS=/nologo /o"$(OUTDIR)/Socket.bsc" +BSC32_SBRS= +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\ + advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo\ + /subsystem:windows /dll /incremental:yes /pdb:"$(OUTDIR)/Socket.pdb" /debug\ + /machine:I386 /def:".\Socket.def" /out:"$(OUTDIR)/Socket.dll"\ + /implib:"$(OUTDIR)/Socket.lib" +DEF_FILE= \ + ".\Socket.def" +LINK32_OBJS= \ + "$(INTDIR)/Socket.obj" \ + "..\perl.lib" + +"$(OUTDIR)\Socket.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + +.c{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_OBJS)}.obj: + $(CPP) $(CPP_PROJ) $< + +.c{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cpp{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +.cxx{$(CPP_SBRS)}.sbr: + $(CPP) $(CPP_PROJ) $< + +################################################################################ +# Begin Target + +# Name "Socket - Win32 Release" +# Name "Socket - Win32 Debug" + +!IF "$(CFG)" == "Socket - Win32 Release" + +!ELSEIF "$(CFG)" == "Socket - Win32 Debug" + +!ENDIF + +################################################################################ +# Begin Source File + +SOURCE=..\ext\Socket\Socket.c +DEP_CPP_SOCKE=\ + ".\EXTERN.h"\ + ".\..\perl.h"\ + ".\..\XSUB.h"\ + {$(INCLUDE)}"\sys\Types.h"\ + ".\include\sys/socket.h"\ + ".\include\netdb.h"\ + ".\include\arpa/inet.h"\ + ".\..\embed.h"\ + ".\config.h"\ + ".\..\perlio.h"\ + {$(INCLUDE)}"\sys\Stat.h"\ + ".\include\dirent.h"\ + ".\..\handy.h"\ + ".\..\dosish.h"\ + ".\..\plan9\plan9ish.h"\ + ".\..\unixish.h"\ + ".\..\regexp.h"\ + ".\..\sv.h"\ + ".\..\util.h"\ + ".\..\form.h"\ + ".\..\gv.h"\ + ".\..\cv.h"\ + ".\..\opcode.h"\ + ".\..\op.h"\ + ".\..\cop.h"\ + ".\..\av.h"\ + ".\..\hv.h"\ + ".\..\mg.h"\ + ".\..\scope.h"\ + ".\..\perly.h"\ + ".\..\pp.h"\ + ".\..\proto.h"\ + ".\win32.h"\ + ".\..\perlsdio.h"\ + ".\..\perlsfio.h"\ + ".\..\nostdio.h"\ + +NODEP_CPP_SOCKE=\ + ".\..\ext\Socket\sockadapt.h"\ + ".\..\os2ish.h"\ + ".\..\vmsish.h"\ + + +"$(INTDIR)\Socket.obj" : $(SOURCE) $(DEP_CPP_SOCKE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=..\perl.lib + +!IF "$(CFG)" == "Socket - Win32 Release" + +!ELSEIF "$(CFG)" == "Socket - Win32 Debug" + +!ENDIF + +# End Source File +################################################################################ +# Begin Source File + +SOURCE=.\Socket.def + +!IF "$(CFG)" == "Socket - Win32 Release" + +!ELSEIF "$(CFG)" == "Socket - Win32 Debug" + +!ENDIF + +# End Source File +# End Target +# End Project +################################################################################ diff --git a/win32/TEST b/win32/TEST new file mode 100644 index 0000000..bd9f7b7 --- /dev/null +++ b/win32/TEST @@ -0,0 +1,145 @@ +#!./perl + +# Last change: Fri Jan 10 09:57:03 WET 1997 + +# This is written in a peculiar style, since we're trying to avoid +# most of the constructs we'll be testing for. + +$| = 1; + +if ($ARGV[0] eq '-v') { + $verbose = 1; + shift; +} + +chdir 't' if -f 't/TEST'; + +die "You need to run \"make test\" first to set things up.\n" + unless -e 'perl' or -e 'perl.exe'; + +$ENV{EMXSHELL} = 'sh'; # For OS/2 + +if ($ARGV[0] eq '') { + push( @ARGV, `dir/s/b base` ); + push( @ARGV, `dir/s/b comp` ); + push( @ARGV, `dir/s/b cmd` ); + push( @ARGV, `dir/s/b io` ); + push( @ARGV, `dir/s/b op` ); + push( @ARGV, `dir/s/b lib` ); + push( @ARGV, `dir/s/b nt` ); + + grep( chomp, @ARGV ); + @ARGV = grep( /\.t$/, @ARGV ); + grep( s/.*t\\//, @ARGV ); +# @ARGV = split(/[ \n]/, +# `echo base/*.t comp/*.t cmd/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t`); +} + +if ($^O eq 'os2' || $^O eq 'qnx' || 1) { + $sharpbang = 0; +} +else { + open(CONFIG, "../config.sh"); + while () { + if (/sharpbang='(.*)'/) { + $sharpbang = ($1 eq '#!'); + last; + } + } + close(CONFIG); +} + +$bad = 0; +$good = 0; +$total = @ARGV; +while ($test = shift) { + if ($test =~ /^$/) { + next; + } + $te = $test; + chop($te); + print "$te" . '.' x (18 - length($te)); + if ($sharpbang) { + open(results,"./$test |") || (print "can't run.\n"); + } else { + open(script,"$test") || die "Can't run $test.\n"; + $_ =