This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
additional cleanups for cygwin32 port
[perl5.git] / cygwin32 / build-instructions.steven-morlock2
CommitLineData
8736538c
AS
1This is an addendum to Steven Morlock's original post. The patch, perl5.005_02.patch, contains the USEMYBINMODE correction described below.
2
3*****************************
4Subject: Re: HOWTO: Builiding Perl under Win95/98 using Cygwin32
5Author: Steven Morlock <newspost@morlock.net>
6Date: 1998/12/22
7Forum: comp.lang.perl.misc
8
9I realized that in my original post I left out a couple important
10details. I'd like to correct that here.
11
12There is a need to address the issue of end of lines being CR/NL or
13NL on the Windows platform. Cygwin32 by default converts NL to CR/NL
14during file I/O by non Cygwin32-savvy applications. This means that
15Perl, since it does not support 'binmode' for the Cygwin32 platform, will
16not be able to read & write untranslated/binary files. There are two
17methods of over coming this. The first is to mount the Cygwin32
18partitions in binary mode. The second is to enable binmode support
19in Perl. In the original post I had mounted the partition as binary
20and neglected to include that fact in the post.
21
22* Using a binary partition:
23
24 Mount the Perl source & installation destination partitions in binary
25 mode. Refer to the Cygnus documentation on 'mount' for details:
26
27 http://sourceware.cygnus.com/cygwin/cygwin-ug-net/mount.html
28
29 On my system since everything was in the root partition I issued the
30 following commands from the bash shell:
31
32 umount /
33 mount -b c:\\ /
34
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
38 '.gz', not '.zip'.
39
40* Patching Perl to add Cygwin32 binmode support:
41
42 For this method you can use either the gzip'd or zip'd version of the
43 Perl source archive.
44
45 Apply the following patch to <PERL>/perl.h:
46
47*** perl.h.ORIG Tue Dec 22 09:22:42 1998
48--- perl.h Tue Dec 22 09:43:10 1998
49***************
50*** 1480,1483 ****
51--- 1480,1495 ----
52 #endif
53
54+ #if defined(__CYGWIN32__)
55+ /* USEMYBINMODE
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.
60+ */
61+ #define USEMYBINMODE / **/
62+ #define my_binmode(fp, iotype) \
63+ (PerlLIO_setmode(PerlIO_fileno(fp), O_BINARY) != -1 ? TRUE : NULL)
64+ #endif
65+
66 #include "regexp.h"
67 #include "sv.h"
68
69Regards,
70Steve
71
72--
73Steven Morlock
74Foliage Software Systems
75aka The Nerd Farm
76http://www.foliage.com