Commit | Line | Data |
1cab015a |
1 | This document is obsolete. Refer to README.cygwin32. |
2 | |
3 | This is an addendum to Steven Morlock's original post. |
4 | perl5.005_03-static-patch, contains the USEMYBINMODE correction described |
5 | below. |
8736538c |
6 | |
7 | ***************************** |
8 | Subject: Re: HOWTO: Builiding Perl under Win95/98 using Cygwin32 |
9 | Author: Steven Morlock <newspost@morlock.net> |
10 | Date: 1998/12/22 |
11 | Forum: comp.lang.perl.misc |
12 | |
13 | I realized that in my original post I left out a couple important |
14 | details. I'd like to correct that here. |
15 | |
16 | There is a need to address the issue of end of lines being CR/NL or |
17 | NL on the Windows platform. Cygwin32 by default converts NL to CR/NL |
18 | during file I/O by non Cygwin32-savvy applications. This means that |
1cab015a |
19 | Perl, since it does not support 'binmode' for the Cygwin32 platform, |
20 | will not be able to read & write untranslated/binary files. There are |
21 | two methods of over coming this. The first is to mount the Cygwin32 |
8736538c |
22 | partitions in binary mode. The second is to enable binmode support |
23 | in Perl. In the original post I had mounted the partition as binary |
24 | and neglected to include that fact in the post. |
25 | |
26 | * Using a binary partition: |
27 | |
28 | Mount the Perl source & installation destination partitions in binary |
29 | mode. Refer to the Cygnus documentation on 'mount' for details: |
30 | |
31 | http://sourceware.cygnus.com/cygwin/cygwin-ug-net/mount.html |
32 | |
33 | On my system since everything was in the root partition I issued the |
34 | following commands from the bash shell: |
35 | |
36 | umount / |
37 | mount -b c:\\ / |
38 | |
1cab015a |
39 | You must also get and install the gzip'd version of the Perl source |
40 | code archive. The zip'd version of the archive has all NL converted |
41 | to CR/NL pairs in all text files. So you should be downloading the |
42 | files ending in '.gz', not '.zip'. |
8736538c |
43 | |
44 | * Patching Perl to add Cygwin32 binmode support: |
45 | |
46 | For this method you can use either the gzip'd or zip'd version of the |
47 | Perl source archive. |
48 | |
49 | Apply the following patch to <PERL>/perl.h: |
50 | |
51 | *** perl.h.ORIG Tue Dec 22 09:22:42 1998 |
52 | --- perl.h Tue Dec 22 09:43:10 1998 |
53 | *************** |
54 | *** 1480,1483 **** |
55 | --- 1480,1495 ---- |
56 | #endif |
57 | |
58 | + #if defined(__CYGWIN32__) |
59 | + /* USEMYBINMODE |
60 | + * This symbol, if defined, indicates that the program should |
61 | + * use the routine my_binmode(FILE *fp, char iotype) to insure |
62 | + * that a file is in "binary" mode -- that is, that no translation |
63 | + * of bytes occurs on read or write operations. |
64 | + */ |
65 | + #define USEMYBINMODE / **/ |
66 | + #define my_binmode(fp, iotype) \ |
1cab015a |
67 | + (PerlLIO_setmode(PerlIO_fileno(fp), O_BINARY) != -1 ? |
68 | TRUE : NULL) |
8736538c |
69 | + #endif |
70 | + |
71 | #include "regexp.h" |
72 | #include "sv.h" |
73 | |
74 | Regards, |
75 | Steve |
76 | |
77 | -- |
78 | Steven Morlock |
79 | Foliage Software Systems |
80 | aka The Nerd Farm |
81 | http://www.foliage.com |