1 This is an addendum to Steven Morlock's original post. The patch, perl5.005_02.patch, contains the USEMYBINMODE correction described below.
3 *****************************
4 Subject: Re: HOWTO: Builiding Perl under Win95/98 using Cygwin32
5 Author: Steven Morlock <newspost@morlock.net>
7 Forum: comp.lang.perl.misc
9 I realized that in my original post I left out a couple important
10 details. I'd like to correct that here.
12 There is a need to address the issue of end of lines being CR/NL or
13 NL on the Windows platform. Cygwin32 by default converts NL to CR/NL
14 during file I/O by non Cygwin32-savvy applications. This means that
15 Perl, since it does not support 'binmode' for the Cygwin32 platform, will
16 not be able to read & write untranslated/binary files. There are two
17 methods of over coming this. The first is to mount the Cygwin32
18 partitions in binary mode. The second is to enable binmode support
19 in Perl. In the original post I had mounted the partition as binary
20 and neglected to include that fact in the post.
22 * Using a binary partition:
24 Mount the Perl source & installation destination partitions in binary
25 mode. Refer to the Cygnus documentation on 'mount' for details:
27 http://sourceware.cygnus.com/cygwin/cygwin-ug-net/mount.html
29 On my system since everything was in the root partition I issued the
30 following commands from the bash shell:
35 You must also get and install the gzip'd version of the Perl source code
36 archive. The zip'd version of the archive has all NL converted to CR/NL
37 pairs in all text files. So you should be downloading the files ending in
40 * Patching Perl to add Cygwin32 binmode support:
42 For this method you can use either the gzip'd or zip'd version of the
45 Apply the following patch to <PERL>/perl.h:
47 *** perl.h.ORIG Tue Dec 22 09:22:42 1998
48 --- perl.h Tue Dec 22 09:43:10 1998
54 + #if defined(__CYGWIN32__)
56 + * This symbol, if defined, indicates that the program should
57 + * use the routine my_binmode(FILE *fp, char iotype) to insure
58 + * that a file is in "binary" mode -- that is, that no translation
59 + * of bytes occurs on read or write operations.
61 + #define USEMYBINMODE / **/
62 + #define my_binmode(fp, iotype) \
63 + (PerlLIO_setmode(PerlIO_fileno(fp), O_BINARY) != -1 ? TRUE : NULL)
74 Foliage Software Systems
76 http://www.foliage.com