Install Perl 5.8.8
[msysgit.git] / mingw / html / pod / perlcygwin.html
blob6e343cb93f25b6451cd4dd8ae3b161a193801667
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>README.cygwin - Perl for Cygwin</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:" />
8 </head>
10 <body style="background-color: white">
11 <table border="0" width="100%" cellspacing="0" cellpadding="3">
12 <tr><td class="block" style="background-color: #cccccc" valign="middle">
13 <big><strong><span class="block">&nbsp;README.cygwin - Perl for Cygwin</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
22 <li><a href="#name">NAME</a></li>
23 <li><a href="#synopsis">SYNOPSIS</a></li>
24 <li><a href="#prerequisites_for_compiling_perl_on_cygwin">PREREQUISITES FOR COMPILING PERL ON CYGWIN</a></li>
25 <ul>
27 <li><a href="#cygwin___gnu_cygnus_windows__don_t_leave_unix_without_it_">Cygwin = GNU+Cygnus+Windows (Don't leave UNIX without it)</a></li>
28 <li><a href="#cygwin_configuration">Cygwin Configuration</a></li>
29 </ul>
31 <li><a href="#configure_perl_on_cygwin">CONFIGURE PERL ON CYGWIN</a></li>
32 <ul>
34 <li><a href="#stripping_perl_binaries_on_cygwin">Stripping Perl Binaries on Cygwin</a></li>
35 <li><a href="#optional_libraries_for_perl_on_cygwin">Optional Libraries for Perl on Cygwin</a></li>
36 <li><a href="#configuretime_options_for_perl_on_cygwin">Configure-time Options for Perl on Cygwin</a></li>
37 <li><a href="#suspicious_warnings_on_cygwin">Suspicious Warnings on Cygwin</a></li>
38 </ul>
40 <li><a href="#make_on_cygwin">MAKE ON CYGWIN</a></li>
41 <ul>
43 <li><a href="#errors_on_cygwin">Errors on Cygwin</a></li>
44 <li><a href="#ld2_on_cygwin">ld2 on Cygwin</a></li>
45 </ul>
47 <li><a href="#test_on_cygwin">TEST ON CYGWIN</a></li>
48 <ul>
50 <li><a href="#file_permissions_on_cygwin">File Permissions on Cygwin</a></li>
51 <li><a href="#ndbm_file_and_odbm_file_do_not_work_on_fat_filesystems">NDBM_File and ODBM_File do not work on FAT filesystems</a></li>
52 <li><a href="#fork___failures_in_io___tests"><code>fork()</code> failures in io_* tests</a></li>
53 </ul>
55 <li><a href="#specific_features_of_the_cygwin_port">Specific features of the Cygwin port</a></li>
56 <ul>
58 <li><a href="#script_portability_on_cygwin">Script Portability on Cygwin</a></li>
59 <li><a href="#prebuilt_methods_">Prebuilt methods:</a></li>
60 </ul>
62 <li><a href="#install_perl_on_cygwin">INSTALL PERL ON CYGWIN</a></li>
63 <li><a href="#manifest_on_cygwin">MANIFEST ON CYGWIN</a></li>
64 <li><a href="#bugs_on_cygwin">BUGS ON CYGWIN</a></li>
65 <li><a href="#authors">AUTHORS</a></li>
66 <li><a href="#history">HISTORY</a></li>
67 </ul>
68 <!-- INDEX END -->
70 <hr />
71 <p>
72 </p>
73 <h1><a name="name">NAME</a></h1>
74 <p>README.cygwin - Perl for Cygwin</p>
75 <p>
76 </p>
77 <hr />
78 <h1><a name="synopsis">SYNOPSIS</a></h1>
79 <p>This document will help you configure, make, test and install Perl
80 on Cygwin. This document also describes features of Cygwin that will
81 affect how Perl behaves at runtime.</p>
82 <p><strong>NOTE:</strong> There are pre-built Perl packages available for Cygwin and a
83 version of Perl is provided in the normal Cygwin install. If you do
84 not need to customize the configuration, consider using one of those
85 packages.</p>
86 <p>
87 </p>
88 <hr />
89 <h1><a name="prerequisites_for_compiling_perl_on_cygwin">PREREQUISITES FOR COMPILING PERL ON CYGWIN</a></h1>
90 <p>
91 </p>
92 <h2><a name="cygwin___gnu_cygnus_windows__don_t_leave_unix_without_it_">Cygwin = GNU+Cygnus+Windows (Don't leave UNIX without it)</a></h2>
93 <p>The Cygwin tools are ports of the popular GNU development tools for Win32
94 platforms. They run thanks to the Cygwin library which provides the UNIX
95 system calls and environment these programs expect. More information
96 about this project can be found at:</p>
97 <pre>
98 <a href="http://www.cygwin.com/">http://www.cygwin.com/</a></pre>
99 <p>A recent net or commercial release of Cygwin is required.</p>
100 <p>At the time this document was last updated, Cygwin 1.5.2 was current.</p>
102 </p>
103 <h2><a name="cygwin_configuration">Cygwin Configuration</a></h2>
104 <p>While building Perl some changes may be necessary to your Cygwin setup so
105 that Perl builds cleanly. These changes are <strong>not</strong> required for normal
106 Perl usage.</p>
107 <p><strong>NOTE:</strong> The binaries that are built will run on all Win32 versions.
108 They do not depend on your host system (Win9x/WinME, WinNT/Win2K)
109 or your Cygwin configuration (<em>ntea</em>, <em>ntsec</em>, binary/text mounts).
110 The only dependencies come from hard-coded pathnames like <code>/usr/local</code>.
111 However, your host system and Cygwin configuration will affect Perl's
112 runtime behavior (see <a href="#test">TEST</a>).</p>
113 <ul>
114 <li><strong><a name="item_path"><code>PATH</code></a></strong>
116 <p>Set the <a href="#item_path"><code>PATH</code></a> environment variable so that Configure finds the Cygwin
117 versions of programs. Any Windows directories should be removed or
118 moved to the end of your <a href="#item_path"><code>PATH</code></a>.</p>
119 </li>
120 <li><strong><a name="item_nroff"><em>nroff</em></a></strong>
122 <p>If you do not have <em>nroff</em> (which is part of the <em>groff</em> package),
123 Configure will <strong>not</strong> prompt you to install <em>man</em> pages.</p>
124 </li>
125 <li><strong><a name="item_permissions">Permissions</a></strong>
127 <p>On WinNT with either the <em>ntea</em> or <em>ntsec</em> <code>CYGWIN</code> settings, directory
128 and file permissions may not be set correctly. Since the build process
129 creates directories and files, to be safe you may want to run a
130 <code>chmod -R +w *</code> on the entire Perl source tree.</p>
131 <p>Also, it is a well known WinNT ``feature'' that files created by a login
132 that is a member of the <em>Administrators</em> group will be owned by the
133 <em>Administrators</em> group. Depending on your umask, you may find that you
134 can not write to files that you just created (because you are no longer
135 the owner). When using the <em>ntsec</em> <code>CYGWIN</code> setting, this is not an
136 issue because it ``corrects'' the ownership to what you would expect on
137 a UNIX system.</p>
138 </li>
139 </ul>
141 </p>
142 <hr />
143 <h1><a name="configure_perl_on_cygwin">CONFIGURE PERL ON CYGWIN</a></h1>
144 <p>The default options gathered by Configure with the assistance of
145 <em>hints/cygwin.sh</em> will build a Perl that supports dynamic loading
146 (which requires a shared <em>libperl.dll</em>).</p>
147 <p>This will run Configure and keep a record:</p>
148 <pre>
149 ./Configure 2&gt;&amp;1 | tee log.configure</pre>
150 <p>If you are willing to accept all the defaults run Configure with <strong>-de</strong>.
151 However, several useful customizations are available.</p>
153 </p>
154 <h2><a name="stripping_perl_binaries_on_cygwin">Stripping Perl Binaries on Cygwin</a></h2>
155 <p>It is possible to strip the EXEs and DLLs created by the build process.
156 The resulting binaries will be significantly smaller. If you want the
157 binaries to be stripped, you can either add a <strong>-s</strong> option when Configure
158 prompts you,</p>
159 <pre>
160 Any additional ld flags (NOT including libraries)? [none] -s
161 Any special flags to pass to gcc to use dynamic linking? [none] -s
162 Any special flags to pass to ld2 to create a dynamically loaded library?
163 [none] -s</pre>
164 <p>or you can edit <em>hints/cygwin.sh</em> and uncomment the relevant variables
165 near the end of the file.</p>
167 </p>
168 <h2><a name="optional_libraries_for_perl_on_cygwin">Optional Libraries for Perl on Cygwin</a></h2>
169 <p>Several Perl functions and modules depend on the existence of
170 some optional libraries. Configure will find them if they are
171 installed in one of the directories listed as being used for library
172 searches. Pre-built packages for most of these are available from
173 the Cygwin installer.</p>
174 <ul>
175 <li><strong><a name="item__2dlcrypt"><code>-lcrypt</code></a></strong>
177 <p>The crypt package distributed with Cygwin is a Linux compatible 56-bit
178 DES crypt port by Corinna Vinschen.</p>
179 <p>Alternatively, the crypt libraries in GNU libc have been ported to Cygwin.</p>
180 <p>The DES based Ultra Fast Crypt port was done by Alexey Truhan:</p>
181 <pre>
182 <a href="ftp://ftp.uni-erlangen.de/pub/pc/gnuwin32/cygwin/porters/Okhapkin_Sergey/cw32crypt-dist-0.tgz">ftp://ftp.uni-erlangen.de/pub/pc/gnuwin32/cygwin/porters/Okhapkin_Sergey/cw32crypt-dist-0.tgz</a></pre>
183 <p>NOTE: There are various export restrictions on DES implementations,
184 see the glibc README for more details.</p>
185 <p>The MD5 port was done by Andy Piper:</p>
186 <pre>
187 <a href="ftp://ftp.uni-erlangen.de/pub/pc/gnuwin32/cygwin/porters/Okhapkin_Sergey/libcrypt.tgz">ftp://ftp.uni-erlangen.de/pub/pc/gnuwin32/cygwin/porters/Okhapkin_Sergey/libcrypt.tgz</a></pre>
188 </li>
189 <li><strong><a name="item_lgdbm"><code>-lgdbm</code> (<code>use GDBM_File</code>)</a></strong>
191 <p>GDBM is available for Cygwin.</p>
192 <p>NOTE: The GDBM library only works on NTFS partitions.</p>
193 </li>
194 <li><strong><a name="item_ldb"><code>-ldb</code> (<code>use DB_File</code>)</a></strong>
196 <p>BerkeleyDB is available for Cygwin.</p>
197 <p>NOTE: The BerkeleyDB library only completely works on NTFS partitions.</p>
198 </li>
199 <li><strong><a name="item_lcygipc"><code>-lcygipc</code> (<code>use IPC::SysV</code>)</a></strong>
201 <p>A port of SysV IPC is available for Cygwin.</p>
202 <p>NOTE: This has <strong>not</strong> been extensively tested. In particular,
203 <code>d_semctl_semun</code> is undefined because it fails a Configure test
204 and on Win9x the <em>shm*()</em> functions seem to hang. It also creates
205 a compile time dependency because <em>perl.h</em> includes <em>&lt;sys/ipc.h</em>&gt;
206 and <em>&lt;sys/sem.h</em>&gt; (which will be required in the future when compiling
207 CPAN modules). CURRENTLY NOT SUPPORTED!</p>
208 </li>
209 <li><strong><a name="item__2dlutil"><code>-lutil</code></a></strong>
211 <p>Included with the standard Cygwin netrelease is the inetutils package
212 which includes libutil.a.</p>
213 </li>
214 </ul>
216 </p>
217 <h2><a name="configuretime_options_for_perl_on_cygwin">Configure-time Options for Perl on Cygwin</a></h2>
218 <p>The <em>INSTALL</em> document describes several Configure-time options. Some of
219 these will work with Cygwin, others are not yet possible. Also, some of
220 these are experimental. You can either select an option when Configure
221 prompts you or you can define (undefine) symbols on the command line.</p>
222 <ul>
223 <li><strong><a name="item__2duusedl"><code>-Uusedl</code></a></strong>
225 <p>Undefining this symbol forces Perl to be compiled statically.</p>
226 </li>
227 <li><strong><a name="item__2duusemymalloc"><code>-Uusemymalloc</code></a></strong>
229 <p>By default Perl uses the <code>malloc()</code> included with the Perl source. If you
230 want to force Perl to build with the system <code>malloc()</code> undefine this symbol.</p>
231 </li>
232 <li><strong><a name="item__2duuseperlio"><code>-Uuseperlio</code></a></strong>
234 <p>Undefining this symbol disables the PerlIO abstraction. PerlIO is now the
235 default; it is not recommended to disable PerlIO.</p>
236 </li>
237 <li><strong><a name="item__2ddusemultiplicity"><code>-Dusemultiplicity</code></a></strong>
239 <p>Multiplicity is required when embedding Perl in a C program and using
240 more than one interpreter instance. This works with the Cygwin port.</p>
241 </li>
242 <li><strong><a name="item__2dduse64bitint"><code>-Duse64bitint</code></a></strong>
244 <p>By default Perl uses 32 bit integers. If you want to use larger 64
245 bit integers, define this symbol.</p>
246 </li>
247 <li><strong><a name="item__2dduselongdouble"><code>-Duselongdouble</code></a></strong>
249 <p><em>gcc</em> supports long doubles (12 bytes). However, several additional
250 long double math functions are necessary to use them within Perl
251 (<em>{atan2, cos, exp, floor, fmod, frexp, isnan, log, modf, pow, sin, sqrt}l,
252 strtold</em>).
253 These are <strong>not</strong> yet available with Cygwin.</p>
254 </li>
255 <li><strong><a name="item__2ddusethreads"><code>-Dusethreads</code></a></strong>
257 <p>POSIX threads are implemented in Cygwin, define this symbol if you want
258 a threaded perl.</p>
259 </li>
260 <li><strong><a name="item__2dduselargefiles"><code>-Duselargefiles</code></a></strong>
262 <p>Cygwin uses 64-bit integers for internal size and position calculations,
263 this will be correctly detected and defined by Configure.</p>
264 </li>
265 <li><strong><a name="item__2ddmksymlinks"><code>-Dmksymlinks</code></a></strong>
267 <p>Use this to build perl outside of the source tree. This works with Cygwin.
268 Details can be found in the <em>INSTALL</em> document. This is the recommended
269 way to build perl from sources.</p>
270 </li>
271 </ul>
273 </p>
274 <h2><a name="suspicious_warnings_on_cygwin">Suspicious Warnings on Cygwin</a></h2>
275 <p>You may see some messages during Configure that seem suspicious.</p>
276 <ul>
277 <li><strong><a name="item_dlsym"><em>dlsym()</em></a></strong>
279 <p><em>ld2</em> is needed to build dynamic libraries, but it does not exist
280 when <a href="#item_dlsym"><code>dlsym()</code></a> checking occurs (it is not created until <code>make</code> runs).
281 You will see the following message:</p>
282 <pre>
283 Checking whether your C&lt;dlsym()&gt; needs a leading underscore ...
284 ld2: not found
285 I can't compile and run the test program.
286 I'm guessing that dlsym doesn't need a leading underscore.</pre>
287 <p>Since the guess is correct, this is not a problem.</p>
288 </li>
289 <li><strong><a name="item_win9x_and_d_eofnblk">Win9x and <code>d_eofnblk</code></a></strong>
291 <p>Win9x does not correctly report <code>EOF</code> with a non-blocking read on a
292 closed pipe. You will see the following messages:</p>
293 <pre>
294 But it also returns -1 to signal EOF, so be careful!
295 WARNING: you can't distinguish between EOF and no data!</pre>
296 <pre>
297 *** WHOA THERE!!! ***
298 The recommended value for $d_eofnblk on this machine was &quot;define&quot;!
299 Keep the recommended value? [y]</pre>
300 <p>At least for consistency with WinNT, you should keep the recommended
301 value.</p>
302 </li>
303 <li><strong><a name="item_compiler_2fpreprocessor_defines">Compiler/Preprocessor defines</a></strong>
305 <p>The following error occurs because of the Cygwin <code>#define</code> of
306 <code>_LONG_DOUBLE</code>:</p>
307 <pre>
308 Guessing which symbols your C compiler and preprocessor define...
309 try.c:&lt;line#&gt;: missing binary operator</pre>
310 <p>This failure does not seem to cause any problems. With older gcc
311 versions, ``parse error'' is reported instead of ``missing binary
312 operator''.</p>
313 </li>
314 </ul>
316 </p>
317 <hr />
318 <h1><a name="make_on_cygwin">MAKE ON CYGWIN</a></h1>
319 <p>Simply run <em>make</em> and wait:</p>
320 <pre>
321 make 2&gt;&amp;1 | tee log.make</pre>
323 </p>
324 <h2><a name="errors_on_cygwin">Errors on Cygwin</a></h2>
325 <p>Errors like these are normal:</p>
326 <pre>
328 make: [extra.pods] Error 1 (ignored)
330 make: [extras.make] Error 1 (ignored)</pre>
332 </p>
333 <h2><a name="ld2_on_cygwin">ld2 on Cygwin</a></h2>
334 <p>During <code>make</code>, <em>ld2</em> will be created and installed in your $installbin
335 directory (where you said to put public executables). It does not
336 wait until the <code>make install</code> process to install the <em>ld2</em> script,
337 this is because the remainder of the <code>make</code> refers to <em>ld2</em> without
338 fully specifying its path and does this from multiple subdirectories.
339 The assumption is that $installbin is in your current <a href="#item_path"><code>PATH</code></a>. If this
340 is not the case <code>make</code> will fail at some point. If this happens,
341 just manually copy <em>ld2</em> from the source directory to somewhere in
342 your <a href="#item_path"><code>PATH</code></a>.</p>
344 </p>
345 <hr />
346 <h1><a name="test_on_cygwin">TEST ON CYGWIN</a></h1>
347 <p>There are two steps to running the test suite:</p>
348 <pre>
349 make test 2&gt;&amp;1 | tee log.make-test</pre>
350 <pre>
351 cd t;./perl harness 2&gt;&amp;1 | tee ../log.harness</pre>
352 <p>The same tests are run both times, but more information is provided when
353 running as <code>./perl harness</code>.</p>
354 <p>Test results vary depending on your host system and your Cygwin
355 configuration. If a test can pass in some Cygwin setup, it is always
356 attempted and explainable test failures are documented. It is possible
357 for Perl to pass all the tests, but it is more likely that some tests
358 will fail for one of the reasons listed below.</p>
360 </p>
361 <h2><a name="file_permissions_on_cygwin">File Permissions on Cygwin</a></h2>
362 <p>UNIX file permissions are based on sets of mode bits for
363 {read,write,execute} for each {user,group,other}. By default Cygwin
364 only tracks the Win32 read-only attribute represented as the UNIX file
365 user write bit (files are always readable, files are executable if they
366 have a <em>.{com,bat,exe}</em> extension or begin with <code>#!</code>, directories are
367 always readable and executable). On WinNT with the <em>ntea</em> <code>CYGWIN</code>
368 setting, the additional mode bits are stored as extended file attributes.
369 On WinNT with the <em>ntsec</em> <code>CYGWIN</code> setting, permissions use the standard
370 WinNT security descriptors and access control lists. Without one of
371 these options, these tests will fail (listing not updated yet):</p>
372 <pre>
373 Failed Test List of failed
374 ------------------------------------
375 io/fs.t 5, 7, 9-10
376 lib/anydbm.t 2
377 lib/db-btree.t 20
378 lib/db-hash.t 16
379 lib/db-recno.t 18
380 lib/gdbm.t 2
381 lib/ndbm.t 2
382 lib/odbm.t 2
383 lib/sdbm.t 2
384 op/stat.t 9, 20 (.tmp not an executable extension)</pre>
386 </p>
387 <h2><a name="ndbm_file_and_odbm_file_do_not_work_on_fat_filesystems">NDBM_File and ODBM_File do not work on FAT filesystems</a></h2>
388 <p>Do not use NDBM_File or ODBM_File on FAT filesystem. They can be
389 built on a FAT filesystem, but many tests will fail:</p>
390 <pre>
391 ../ext/NDBM_File/ndbm.t 13 3328 71 59 83.10% 1-2 4 16-71
392 ../ext/ODBM_File/odbm.t 255 65280 ?? ?? % ??
393 ../lib/AnyDBM_File.t 2 512 12 2 16.67% 1 4
394 ../lib/Memoize/t/errors.t 0 139 11 5 45.45% 7-11
395 ../lib/Memoize/t/tie_ndbm.t 13 3328 4 4 100.00% 1-4
396 run/fresh_perl.t 97 1 1.03% 91</pre>
397 <p>If you intend to run only on FAT (or if using AnyDBM_File on FAT),
398 run Configure with the -Ui_ndbm and -Ui_dbm options to prevent
399 NDBM_File and ODBM_File being built.</p>
400 <p>With NTFS (and CYGWIN=ntsec), there should be no problems even if
401 perl was built on FAT.</p>
403 </p>
404 <h2><a name="fork___failures_in_io___tests"><code>fork()</code> failures in io_* tests</a></h2>
405 <p>A <code>fork()</code> failure may result in the following tests failing:</p>
406 <pre>
407 ext/IO/lib/IO/t/io_multihomed.t
408 ext/IO/lib/IO/t/io_sock.t
409 ext/IO/lib/IO/t/io_unix.t</pre>
410 <p>See comment on fork in <a href="#item_miscellaneous">Miscellaneous</a> below.</p>
412 </p>
413 <hr />
414 <h1><a name="specific_features_of_the_cygwin_port">Specific features of the Cygwin port</a></h1>
416 </p>
417 <h2><a name="script_portability_on_cygwin">Script Portability on Cygwin</a></h2>
418 <p>Cygwin does an outstanding job of providing UNIX-like semantics on top of
419 Win32 systems. However, in addition to the items noted above, there are
420 some differences that you should know about. This is a very brief guide
421 to portability, more information can be found in the Cygwin documentation.</p>
422 <ul>
423 <li><strong><a name="item_pathnames">Pathnames</a></strong>
425 <p>Cygwin pathnames can be separated by forward (<em>/</em>) or backward (<em>\\</em>)
426 slashes. They may also begin with drive letters (<em>C:</em>) or Universal
427 Naming Codes (<em>//UNC</em>). DOS device names (<em>aux</em>, <em>con</em>, <em>prn</em>,
428 <em>com*</em>, <em>lpt?</em>, <em>nul</em>) are invalid as base filenames. However, they
429 can be used in extensions (e.g., <em>hello.aux</em>). Names may contain all
430 printable characters except these:</p>
431 <pre>
432 : * ? &quot; &lt; &gt; |</pre>
433 <p>File names are case insensitive, but case preserving. A pathname that
434 contains a backslash or drive letter is a Win32 pathname (and not subject
435 to the translations applied to POSIX style pathnames).</p>
436 </li>
437 <li><strong><a name="item_text_2fbinary">Text/Binary</a></strong>
439 <p>When a file is opened it is in either text or binary mode. In text mode
440 a file is subject to CR/LF/Ctrl-Z translations. With Cygwin, the default
441 mode for an <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_open"><code>open()</code></a> is determined by the mode of the mount that underlies
442 the file. Perl provides a <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_binmode"><code>binmode()</code></a> function to set binary mode on files
443 that otherwise would be treated as text. <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_sysopen"><code>sysopen()</code></a> with the <code>O_TEXT</code>
444 flag sets text mode on files that otherwise would be treated as binary:</p>
445 <pre>
446 sysopen(FOO, &quot;bar&quot;, O_WRONLY|O_CREAT|O_TEXT)</pre>
447 <p><code>lseek()</code>, <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_tell"><code>tell()</code></a> and <code>sysseek()</code> only work with files opened in binary
448 mode.</p>
449 <p>The text/binary issue is covered at length in the Cygwin documentation.</p>
450 </li>
451 <li><strong><a name="item_perlio">PerlIO</a></strong>
453 <p>PerlIO overrides the default Cygwin Text/Binary behaviour. A file will
454 always treated as binary, regardless which mode of the mount it lives on,
455 just like it is in UNIX. So CR/LF translation needs to be requested in
456 either the <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_open"><code>open()</code></a> call like this:</p>
457 <pre>
458 open(FH, &quot;&gt;:crlf&quot;, &quot;out.txt&quot;);</pre>
459 <p>which will do conversion from LF to CR/LF on the output, or in the
460 environment settings (add this to your .bashrc):</p>
461 <pre>
462 export PERLIO=crlf</pre>
463 <p>which will pull in the crlf PerlIO layer which does LF -&gt; CRLF conversion
464 on every output generated by perl.</p>
465 </li>
466 <li><strong><a name="item__2eexe"><em>.exe</em></a></strong>
468 <p>The Cygwin <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_stat"><code>stat()</code></a>, <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_lstat"><code>lstat()</code></a> and <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_readlink"><code>readlink()</code></a> functions make the <em>.exe</em>
469 extension transparent by looking for <em>foo.exe</em> when you ask for <em>foo</em>
470 (unless a <em>foo</em> also exists). Cygwin does not require a <em>.exe</em>
471 extension, but <em>gcc</em> adds it automatically when building a program.
472 However, when accessing an executable as a normal file (e.g., <em>cp</em>
473 in a makefile) the <em>.exe</em> is not transparent. The <em>install</em> included
474 with Cygwin automatically appends a <em>.exe</em> when necessary.</p>
475 </li>
476 <li><strong><a name="item_cygwin_vs_2e_windows_process_ids">cygwin vs. windows process ids</a></strong>
478 <p>Cygwin processes have their own pid, which is different from the
479 underlying windows pid. Most posix compliant Proc functions expect
480 the cygwin pid, but several Win32::Process functions expect the
481 winpid. E.g. <a href="file://C|\msysgit\mingw\html/pod/perlvar.html#item___"><code>$$</code></a> is the cygwin pid of <em>/usr/bin/perl</em>, which is not
482 the winpid. Use <code>Cygwin::winpid_to_pid()</code> and <code>Cygwin::winpid_to_pid()</code>
483 to translate between them.</p>
484 </li>
485 <li><strong><a name="item_chown"><code>chown()</code></a></strong>
487 <p>On WinNT <a href="#item_chown"><code>chown()</code></a> can change a file's user and group IDs. On Win9x <a href="#item_chown"><code>chown()</code></a>
488 is a no-op, although this is appropriate since there is no security model.</p>
489 </li>
490 <li><strong><a name="item_miscellaneous">Miscellaneous</a></strong>
492 <p>File locking using the <code>F_GETLK</code> command to <code>fcntl()</code> is a stub that
493 returns <code>ENOSYS</code>.</p>
494 <p>Win9x can not <code>rename()</code> an open file (although WinNT can).</p>
495 <p>The Cygwin <a href="file://C|\msysgit\mingw\html/pod/perlfunc.html#item_chroot"><code>chroot()</code></a> implementation has holes (it can not restrict file
496 access by native Win32 programs).</p>
497 <p>Inplace editing <code>perl -i</code> of files doesn't work without doing a backup
498 of the file being edited <code>perl -i.bak</code> because of windowish restrictions,
499 therefore Perl adds the suffix <code>.bak</code> automatically if you use <code>perl -i</code>
500 without specifying a backup extension.</p>
501 <p>Using <code>fork()</code> after loading multiple dlls may fail with an internal cygwin
502 error like the following:</p>
503 <pre>
504 C:\CYGWIN\BIN\PERL.EXE: *** couldn't allocate memory 0x10000(4128768) for 'C:\CYGWIN\LIB\PERL5\5.6.1\CYGWIN-MULTI\AUTO\SOCKET\SOCKET.DLL' alignment, Win32 error 8</pre>
505 <pre>
506 200 [main] perl 377147 sync_with_child: child -395691(0xB8) died before initialization with status code 0x1
507 1370 [main] perl 377147 sync_with_child: *** child state child loading dlls</pre>
508 <p>Use the rebase utility to resolve the conflicting dll addresses. The
509 rebase package is included in the Cygwin netrelease. Use setup.exe from
510 <em><a href="http://www.cygwin.com/setup.exe">http://www.cygwin.com/setup.exe</a></em> to install it and run rebaseall.</p>
511 </li>
512 </ul>
514 </p>
515 <h2><a name="prebuilt_methods_">Prebuilt methods:</a></h2>
516 <dl>
517 <dt><strong><a name="item_cwd_3a_3acwd"><code>Cwd::cwd</code></a></strong>
519 <dd>
520 <p>Returns current working directory.</p>
521 </dd>
522 </li>
523 <dt><strong><a name="item_cygwin_3a_3apid_to_winpid"><code>Cygwin::pid_to_winpid</code></a></strong>
525 <dd>
526 <p>Translates a cygwin pid to the corresponding Windows pid (which may or
527 may not be the same).</p>
528 </dd>
529 </li>
530 <dt><strong><a name="item_cygwin_3a_3awinpid_to_pid"><code>Cygwin::winpid_to_pid</code></a></strong>
532 <dd>
533 <p>Translates a Windows pid to the corresponding cygwin pid (if any).</p>
534 </dd>
535 </li>
536 </dl>
538 </p>
539 <hr />
540 <h1><a name="install_perl_on_cygwin">INSTALL PERL ON CYGWIN</a></h1>
541 <p>This will install Perl, including <em>man</em> pages.</p>
542 <pre>
543 make install 2&gt;&amp;1 | tee log.make-install</pre>
544 <p>NOTE: If <code>STDERR</code> is redirected <code>make install</code> will <strong>not</strong> prompt
545 you to install <em>perl</em> into <em>/usr/bin</em>.</p>
546 <p>You may need to be <em>Administrator</em> to run <code>make install</code>. If you
547 are not, you must have write access to the directories in question.</p>
548 <p>Information on installing the Perl documentation in HTML format can be
549 found in the <em>INSTALL</em> document.</p>
551 </p>
552 <hr />
553 <h1><a name="manifest_on_cygwin">MANIFEST ON CYGWIN</a></h1>
554 <p>These are the files in the Perl release that contain references to Cygwin.
555 These very brief notes attempt to explain the reason for all conditional
556 code. Hopefully, keeping this up to date will allow the Cygwin port to
557 be kept as clean as possible (listing not updated yet).</p>
558 <dl>
559 <dt><strong><a name="item_documentation">Documentation</a></strong>
561 <dd>
562 <pre>
563 INSTALL README.cygwin README.win32 MANIFEST
564 Changes Changes5.005 Changes5.004 Changes5.6
565 pod/perl.pod pod/<a href="//C|\msysgit\mingw\html/pod/perlport.html">perlport</a>.pod pod/<a href="//C|\msysgit\mingw\html/pod/perlfaq3.html">perlfaq3</a>.pod
566 pod/<a href="//C|\msysgit\mingw\html/pod/perldelta.html">perldelta</a>.pod pod/<a href="//C|\msysgit\mingw\html/pod/perl5004delta.html">perl5004delta</a>.pod pod/<a href="//C|\msysgit\mingw\html/pod/perl56delta.html">perl56delta</a>.pod
567 pod/<a href="//C|\msysgit\mingw\html/pod/perlhist.html">perlhist</a>.pod pod/<a href="//C|\msysgit\mingw\html/pod/perlmodlib.html">perlmodlib</a>.pod perl/buildtoc pod/<a href="//C|\msysgit\mingw\html/pod/perltoc.html">perltoc</a>.pod</pre>
568 </dd>
569 <dt><strong><a name="item_build_2c_configure_2c_make_2c_install">Build, Configure, Make, Install</a></strong>
571 <dd>
572 <pre>
573 cygwin/Makefile.SHs
574 cygwin/ld2.in
575 cygwin/perlld.in
576 ext/IPC/SysV/hints/cygwin.pl
577 ext/NDBM_File/hints/cygwin.pl
578 ext/ODBM_File/hints/cygwin.pl
579 hints/cygwin.sh
580 Configure - help finding hints from uname,
581 shared libperl required for dynamic loading
582 Makefile.SH - linklibperl
583 Porting/patchls - cygwin in port list
584 installman - man pages with :: translated to .
585 installperl - install dll/ld2/perlld, install to pods
586 makedepend.SH - uwinfix</pre>
587 </dd>
588 <dt><strong><a name="item_tests">Tests</a></strong>
590 <dd>
591 <pre>
592 t/io/tell.t - binmode
593 t/lib/b.t - ignore Cwd from os_extras
594 t/lib/glob-basic.t - Win32 directory list access differs from read mode
595 t/op/magic.t - $^X/symlink WORKAROUND, s/.exe//
596 t/op/stat.t - no /dev, skip Win32 ftCreationTime quirk
597 (cache manager sometimes preserves ctime of file
598 previously created and deleted), no -u (setuid)
599 t/lib/cygwin.t - builtin cygwin function tests</pre>
600 </dd>
601 <dt><strong><a name="item_compiled_perl_source">Compiled Perl Source</a></strong>
603 <dd>
604 <pre>
605 EXTERN.h - __declspec(dllimport)
606 XSUB.h - __declspec(dllexport)
607 cygwin/cygwin.c - os_extras (getcwd, spawn, Cygwin::winpid_to_pid,
608 Cygwin::pid_to_winpid)
609 perl.c - os_extras
610 perl.h - binmode
611 doio.c - win9x can not rename a file when it is open
612 pp_sys.c - do not define h_errno, pp_system with spawn
613 util.c - use setenv</pre>
614 </dd>
615 <dt><strong><a name="item_compiled_module_source">Compiled Module Source</a></strong>
617 <dd>
618 <pre>
619 ext/POSIX/POSIX.xs - tzname defined externally
620 ext/SDBM_File/sdbm/pair.c
621 - EXTCONST needs to be redefined from EXTERN.h
622 ext/SDBM_File/sdbm/sdbm.c
623 - binary open</pre>
624 </dd>
625 <dt><strong><a name="item_perl_modules_2fscripts">Perl Modules/Scripts</a></strong>
627 <dd>
628 <pre>
629 lib/Cwd.pm - hook to internal Cwd::cwd
630 lib/ExtUtils/MakeMaker.pm
631 - require MM_Cygwin.pm
632 lib/ExtUtils/MM_Cygwin.pm
633 - canonpath, cflags, manifypods, perl_archive
634 lib/File/Find.pm - on remote drives stat() always sets st_nlink to 1
635 lib/File/Spec/Unix.pm - preserve //unc
636 lib/File/Temp.pm - no directory sticky bit
637 lib/perl5db.pl - use stdin not /dev/tty
638 utils/<a href="//C|\msysgit\mingw\html/pod/perldoc.html">perldoc</a>.PL - version comment</pre>
639 </dd>
640 </dl>
642 </p>
643 <hr />
644 <h1><a name="bugs_on_cygwin">BUGS ON CYGWIN</a></h1>
645 <p>Support for swapping real and effective user and group IDs is incomplete.
646 On WinNT Cygwin provides <code>setuid()</code>, <code>seteuid()</code>, <code>setgid()</code> and <code>setegid()</code>.
647 However, additional Cygwin calls for manipulating WinNT access tokens
648 and security contexts are required.</p>
650 </p>
651 <hr />
652 <h1><a name="authors">AUTHORS</a></h1>
653 <p>Charles Wilson &lt;<a href="mailto:cwilson@ece.gatech.edu">cwilson@ece.gatech.edu</a>&gt;,
654 Eric Fifer &lt;<a href="mailto:egf7@columbia.edu">egf7@columbia.edu</a>&gt;,
655 alexander smishlajev &lt;<a href="mailto:als@turnhere.com">als@turnhere.com</a>&gt;,
656 Steven Morlock &lt;<a href="mailto:newspost@morlock.net">newspost@morlock.net</a>&gt;,
657 Sebastien Barre &lt;<a href="mailto:Sebastien.Barre@utc.fr">Sebastien.Barre@utc.fr</a>&gt;,
658 Teun Burgers &lt;<a href="mailto:burgers@ecn.nl">burgers@ecn.nl</a>&gt;,
659 Gerrit P. Haase &lt;<a href="mailto:gp@familiehaase.de">gp@familiehaase.de</a>&gt;.</p>
661 </p>
662 <hr />
663 <h1><a name="history">HISTORY</a></h1>
664 <p>Last updated: 2005-02-11</p>
665 <table border="0" width="100%" cellspacing="0" cellpadding="3">
666 <tr><td class="block" style="background-color: #cccccc" valign="middle">
667 <big><strong><span class="block">&nbsp;README.cygwin - Perl for Cygwin</span></strong></big>
668 </td></tr>
669 </table>
671 </body>
673 </html>