Commit | Line | Data |
8e07c86e |
1 | =head1 NAME |
2 | |
3 | Install - Build and Installation guide for perl5. |
4 | |
5 | =head1 SYNOPSIS |
6 | |
7 | The basic steps to build and install perl5 are: |
8 | |
9 | rm -f config.sh |
10 | sh Configure |
11 | make |
12 | make test |
13 | make install |
14 | |
15 | Each of these is explained in further detail below. |
16 | |
edb1cbcb |
17 | You should probably at least skim through this entire document before |
18 | proceeding. Special notes specific to this release are identified |
19 | by B<NOTE>. |
20 | |
8e07c86e |
21 | =head1 BUILDING PERL5 |
22 | |
23 | =head1 Start with a Fresh Distribution. |
24 | |
edb1cbcb |
25 | If you have built perl before, you should clean out the build directory |
26 | with the command |
27 | |
28 | make realclean |
29 | |
8e07c86e |
30 | The results of a Configure run are stored in the config.sh file. If |
31 | you are upgrading from a previous version of perl, or if you change |
32 | systems or compilers or make other significant changes, or if you are |
33 | experiencing difficulties building perl, you should probably I<not> |
34 | re-use your old config.sh. Simply remove it or rename it, e.g. |
35 | |
36 | mv config.sh config.sh.old |
4633a7c4 |
37 | |
8e07c86e |
38 | Then run Configure. |
39 | |
40 | =head1 Run Configure. |
41 | |
42 | Configure will figure out various things about your system. Some |
43 | things Configure will figure out for itself, other things it will ask |
44 | you about. To accept the default, just press C<RETURN>. The default |
45 | is almost always ok. |
46 | |
47 | After it runs, Configure will perform variable substitution on all the |
48 | F<*.SH> files and offer to run B<make depend>. |
49 | |
50 | Configure supports a number of useful options. Run B<Configure -h> |
51 | to get a listing. To compile with gcc, for example, you can run |
52 | |
53 | sh Configure -Dcc=gcc |
54 | |
55 | This is the preferred way to specify gcc (or another alternative |
56 | compiler) so that the hints files can set appropriate defaults. |
57 | |
4633a7c4 |
58 | If you want to use your old config.sh but override some of the items |
59 | with command line options, you need to use B<Configure -O>. |
60 | |
8e07c86e |
61 | If you are willing to accept all the defaults, and you want terse |
62 | output, you can run |
63 | |
64 | sh Configure -des |
65 | |
66 | By default, for most systems, perl will be installed in |
67 | /usr/local/{bin, lib, man}. You can specify a different 'prefix' for |
68 | the default installation directory, when Configure prompts you or by |
69 | using the Configure command line option -Dprefix='/some/directory', |
70 | e.g. |
71 | |
25f94b33 |
72 | sh Configure -Dprefix=/opt/perl |
4633a7c4 |
73 | |
74 | If your prefix contains the string "perl", then the directories |
75 | are simplified. For example, if you use prefix=/opt/perl, |
76 | then Configure will suggest /opt/perl/lib instead of |
77 | /usr/local/lib/perl5/. |
8e07c86e |
78 | |
79 | By default, Configure will compile perl to use dynamic loading, if |
80 | your system supports it. If you want to force perl to be compiled |
81 | statically, you can either choose this when Configure prompts you or by |
82 | using the Configure command line option -Uusedl. |
83 | |
24b3df7f |
84 | =head2 Extensions |
85 | |
edb1cbcb |
86 | By default, Configure will offer to build every extension which appears |
87 | to be supported. For example, Configure will offer to build GDBM_File |
88 | only if it is able to find the gdbm library. (See examples below.) |
89 | DynaLoader, Fcntl and FileHandle are always built by default. |
90 | Configure does not contain code to test for POSIX compliance, so POSIX |
91 | is always built by default as well. If you wish to skip POSIX, you can |
92 | set the Configure variable useposix=false either in a hint file or from |
93 | the Configure command line. Similarly, the Safe extension is always |
94 | built by default, but you can skip it by setting the Configure variable |
24b3df7f |
95 | usesafe=false either in a hint file for from the command line. |
96 | |
97 | In summary, here are the Configure command-line variables you can set |
98 | to turn off each extension: |
99 | |
100 | DB_File i_db |
101 | DynaLoader (Must always be included) |
102 | Fcntl (Always included by default) |
edb1cbcb |
103 | FileHandle (Always included by default) |
24b3df7f |
104 | GDBM_File i_gdbm |
105 | NDBM_File i_ndbm |
106 | ODBM_File i_dbm |
107 | POSIX useposix |
108 | SDBM_File (Always included by default) |
109 | Safe usesafe |
110 | Socket d_socket |
111 | |
112 | Thus to skip the NDBM_File extension, you can use |
113 | |
114 | sh Configure -Ui_ndbm |
115 | |
116 | Again, this is taken care of automatically if you don't have the ndbm |
117 | library. |
118 | |
119 | Of course, you may always run Configure interactively and select only |
120 | the Extensions you want. |
121 | |
122 | Finally, if you have dynamic loading (most modern Unix systems do) |
123 | remember that these extensions do not increase the size of your perl |
124 | executable, nor do they impact start-up time, so you probably might as |
125 | well build all the ones that will work on your system. |
126 | |
8e07c86e |
127 | =head2 GNU-style configure |
128 | |
129 | If you prefer the GNU-style B<configure> command line interface, you can |
130 | use the supplied B<configure> command, e.g. |
131 | |
132 | CC=gcc ./configure |
133 | |
134 | The B<configure> script emulates several of the more common configure |
135 | options. Try |
136 | |
137 | ./configure --help |
138 | |
139 | for a listing. |
140 | |
141 | Cross compiling is currently not supported. |
142 | |
143 | =head2 Including locally-installed libraries |
144 | |
4633a7c4 |
145 | Perl5 comes with interfaces to number of database extensions, including |
146 | dbm, ndbm, gdbm, and Berkeley db. For each extension, if |
147 | Configure can find the appropriate header files and libraries, it will |
148 | automatically include that extension. The gdbm and db libraries |
149 | are B<not> included with perl. See the library documentation for |
150 | how to obtain the libraries. |
8e07c86e |
151 | |
152 | I<Note:> If your database header (.h) files are not in a |
153 | directory normally searched by your C compiler, then you will need to |
154 | include the appropriate B<-I/your/directory> option when prompted by |
155 | Configure. If your database library (.a) files are not in a directory |
156 | normally searched by your C compiler and linker, then you will need to |
157 | include the appropriate B<-L/your/directory> option when prompted by |
158 | Configure. See the examples below. |
159 | |
160 | =head2 Examples |
161 | |
162 | =over 4 |
163 | |
164 | =item gdbm in /usr/local. |
165 | |
166 | Suppose you have gdbm and want Configure to find it and build the |
167 | GDBM_File extension. This examples assumes you have F<gdbm.h> |
168 | installed in F</usr/local/include/gdbm.h> and F<libgdbm.a> installed in |
169 | F</usr/local/lib/libgdbm.a>. Configure should figure all the |
170 | necessary steps out automatically. |
171 | |
172 | Specifically, when Configure prompts you for flags for |
173 | your C compiler, you should include C<-I/usr/local/include>. |
174 | |
175 | When Configure prompts you for linker flags, you should include |
176 | C<-L/usr/local/lib>. |
177 | |
178 | If you are using dynamic loading, then when Configure prompts you for |
179 | linker flags for dynamic loading, you should again include |
180 | C<-L/usr/local/lib>. |
181 | |
182 | Again, this should all happen automatically. If you want to accept the |
183 | defaults for all the questions and have Configure print out only terse |
184 | messages, then you can just run |
185 | |
186 | sh Configure -des |
187 | |
188 | and Configure should include the GDBM_File extension automatically. |
189 | |
190 | This should actually work if you have gdbm installed in any of |
191 | (/usr/local, /opt/local, /usr/gnu, /opt/gnu, /usr/GNU, or /opt/GNU). |
192 | |
193 | =item gdbm in /usr/you |
194 | |
195 | Suppose you have gdbm installed in some place other than /usr/local/, |
196 | but you still want Configure to find it. To be specific, assume you |
197 | have F</usr/you/include/gdbm.h> and F</usr/you/lib/libgdbm.a>. You |
198 | still have to add B<-I/usr/you/include> to cc flags, but you have to take |
199 | an extra step to help Configure find F<libgdbm.a>. Specifically, when |
200 | Configure prompts you for library directories, you have to add |
201 | F</usr/you/lib> to the list. |
202 | |
203 | It is possible to specify this from the command line too (all on one |
204 | line): |
205 | |
206 | sh Configure -des \ |
207 | -Dlocincpth="/usr/you/include" \ |
208 | -Dloclibpth="/usr/you/lib" |
209 | |
210 | C<locincpth> is a space-separated list of include directories to search. |
211 | Configure will automatically add the appropriate B<-I> directives. |
212 | |
213 | C<loclibpth> is a space-separated list of library directories to search. |
214 | Configure will automatically add the appropriate B<-L> directives. If |
215 | you have some libraries under F</usr/local/> and others under |
216 | F</usr/you>, then you have to include both, namely |
217 | |
218 | sh Configure -des \ |
219 | -Dlocincpth="/usr/you/include /usr/local/include" \ |
220 | -Dloclibpth="/usr/you/lib /usr/local/lib" |
221 | |
222 | =back |
223 | |
4633a7c4 |
224 | =head2 Installation Directories. |
225 | |
226 | The installation directories can all be changed by answering the |
227 | appropriate questions in Configure. For convenience, all the |
228 | installation questions are near the beginning of Configure. |
229 | |
230 | By default, Configure uses the following directories for |
231 | library files (archname is a string like sun4-sunos, determined |
232 | by Configure) |
233 | |
234 | /usr/local/lib/perl5/archname/5.002 |
235 | /usr/local/lib/perl5/ |
24b3df7f |
236 | /usr/local/lib/perl5/site_perl/archname |
237 | /usr/local/lib/perl5/site_perl |
4633a7c4 |
238 | |
239 | and the following directories for manual pages: |
240 | |
241 | /usr/local/man/man1 |
242 | /usr/local/lib/perl5/man/man3 |
243 | |
244 | (Actually, Configure recognizes the SVR3-style |
245 | /usr/local/man/l_man/man1 directories, if present, and uses those |
246 | instead.) The module man pages are stuck in that strange spot so that |
247 | they don't collide with other man pages stored in /usr/local/man/man3, |
248 | and so that Perl's man pages don't hide system man pages. On some |
249 | systems, B<man less> would end up calling up Perl's less.pm module man |
250 | page, rather than the B<less> program. |
251 | |
252 | If you specify a prefix that contains the string "perl", then the |
253 | directory structure is simplified. For example, if you Configure |
254 | with -Dprefix=/opt/perl, then the defaults are |
255 | |
256 | /opt/perl/lib/archname/5.002 |
257 | /opt/perl/lib |
258 | /opt/perl/lib/site_perl/archname |
259 | /opt/perl/lib/site_perl |
260 | |
261 | /opt/perl/man/man1 |
262 | /opt/perl/man/man3 |
263 | |
264 | The perl executable will search the libraries in the order given |
265 | above. |
266 | |
267 | The directories site_perl and site_perl/archname are empty, but are |
268 | intended to be used for installing local or site-wide extensions. Perl |
269 | will automatically look in these directories. Previously, most sites |
270 | just put their local extensions in with the standard distribution. |
271 | |
272 | In order to support using things like #!/usr/local/bin/perl5.002 after |
273 | a later version is released, architecture-dependent libraries are |
274 | stored in a version-specific directory, such as |
275 | /usr/local/lib/perl5/archname/5.002/. In 5.000 and 5.001, these files |
276 | were just stored in /usr/local/lib/perl5/archname/. If you will not be |
277 | using 5.001 binaries, you can delete the standard extensions from the |
278 | /usr/local/lib/perl5/archname/ directory. Locally-added extensions can |
279 | be moved to the site_perl and site_perl/archname directories. |
280 | |
281 | Again, these are just the defaults, and can be changed as you run |
282 | Configure. |
283 | |
8e07c86e |
284 | =head2 Changing the installation directory |
285 | |
286 | Configure distinguishes between the directory in which perl (and its |
287 | associated files) should be installed and the directory in which it |
288 | will eventually reside. For most sites, these two are the same; for |
289 | sites that use AFS, this distinction is handled automatically. |
290 | However, sites that use software such as B<depot> to manage software |
291 | packages may also wish to install perl into a different directory and |
292 | use that management software to move perl to its final destination. |
293 | This section describes how to do this. Someday, Configure may support |
294 | an option C<-Dinstallprefix=/foo> to simplify this. |
295 | |
296 | Suppose you want to install perl under the F</tmp/perl5> directory. |
297 | You can edit F<config.sh> and change all the install* variables to |
298 | point to F</tmp/perl5> instead of F</usr/local/wherever>. You could |
299 | also set them all from the Configure command line. Or, you can |
300 | automate this process by placing the following lines in a file |
301 | F<config.over> B<before> you run Configure (replace /tmp/perl5 by a |
302 | directory of your choice): |
303 | |
304 | installprefix=/tmp/perl5 |
305 | test -d $installprefix || mkdir $installprefix |
306 | test -d $installprefix/bin || mkdir $installprefix/bin |
307 | installarchlib=`echo $installarchlib | sed "s!$prefix!$installprefix!"` |
308 | installbin=`echo $installbin | sed "s!$prefix!$installprefix!"` |
309 | installman1dir=`echo $installman1dir | sed "s!$prefix!$installprefix!"` |
310 | installman3dir=`echo $installman3dir | sed "s!$prefix!$installprefix!"` |
311 | installprivlib=`echo $installprivlib | sed "s!$prefix!$installprefix!"` |
312 | installscript=`echo $installscript | sed "s!$prefix!$installprefix!"` |
313 | installsitelib=`echo $installsitelib | sed "s!$prefix!$installprefix!"` |
4633a7c4 |
314 | installsitearch=`echo $installsitearch | sed "s!$prefix!$installprefix!"` |
8e07c86e |
315 | |
316 | Then, you can Configure and install in the usual way: |
317 | |
25f94b33 |
318 | sh Configure -des |
8e07c86e |
319 | make |
320 | make test |
321 | make install |
322 | |
323 | =head2 Creating an installable tar archive |
324 | |
325 | If you need to install perl on many identical systems, it is |
326 | convenient to compile it once and create an archive that can be |
327 | installed on multiple systems. Here's one way to do that: |
328 | |
329 | # Set up config.over to install perl into a different directory, |
330 | # e.g. /tmp/perl5 (see previous part). |
25f94b33 |
331 | sh Configure -des |
8e07c86e |
332 | make |
333 | make test |
334 | make install |
335 | cd /tmp/perl5 |
336 | tar cvf ../perl5-archive.tar . |
337 | # Then, on each machine where you want to install perl, |
338 | cd /usr/local # Or wherever you specified as $prefix |
339 | tar xvf perl5-archive.tar |
340 | |
341 | =head2 What if it doesn't work? |
342 | |
343 | =over 4 |
344 | |
25f94b33 |
345 | =item Running Configure Interactively |
346 | |
347 | If Configure runs into trouble, remember that you can always run |
348 | Configure interactively so that you can check (and correct) its |
349 | guesses. |
350 | |
351 | All the installation questions have been moved to the top, so you don't |
352 | have to wait for them. Once you've handled them (and your C compiler & |
353 | flags) you can type '&-d' at the next Configure prompt and Configure |
354 | will use the defaults from then on. |
355 | |
356 | If you find yourself trying obscure command line incantations and |
357 | config.over tricks, I recommend you run Configure interactively |
358 | instead. You'll probably save yourself time in the long run. |
359 | |
8e07c86e |
360 | =item Hint files. |
361 | |
362 | The perl distribution includes a number of system-specific hints files |
363 | in the hints/ directory. If one of them matches your system, Configure |
364 | will offer to use that hint file. |
365 | |
366 | Several of the hint files contain additional important information. |
367 | If you have any problems, it is a good idea to read the relevant hint |
368 | file for further information. See F<hints/solaris_2.sh> for an |
369 | extensive example. |
370 | |
edb1cbcb |
371 | =item *** WHOA THERE!!! *** |
372 | |
373 | Occasionally, Configure makes a wrong guess. For example, on SunOS |
374 | 4.1.3, Configure incorrectly concludes that tzname[] is in the |
375 | standard C library. The hint file is set up to correct for this. You |
376 | will see a message: |
377 | |
378 | *** WHOA THERE!!! *** |
379 | The recommended value for $d_tzname on this machine was "undef"! |
380 | Keep the recommended value? [y] |
381 | |
382 | You should always keep the recommended value unless, after reading the |
383 | relevant section of the hint file, you are sure you want to try |
384 | overriding it. |
385 | |
386 | If you are re-using an old config.sh, the word "previous" will be |
387 | used instead of "recommended". Again, you will almost always want |
388 | to keep the previous value, unless you have changed something on your |
389 | system. |
390 | |
391 | For example, suppose you have added libgdbm.a to your system |
392 | and you decide to reconfigure perl to use GDBM_File. When you run |
393 | Configure again, you will need to add -lgdbm to the list of libraries. |
394 | Now, Configure will find your gdbm library and will issue a message: |
395 | |
396 | *** WHOA THERE!!! *** |
397 | The previous value for $i_gdbm on this machine was "undef"! |
398 | Keep the previous value? [y] |
399 | |
400 | In this case, you do I<not> want to keep the previous value, so you |
401 | should answer 'n'. (You'll also have to manuually add GDBM_File to |
402 | the list of dynamic extensions to build.) |
403 | |
8e07c86e |
404 | =item Changing Compilers |
405 | |
406 | If you change compilers or make other significant changes, you should |
407 | probably I<not> re-use your old config.sh. Simply remove it or |
408 | rename it, e.g. mv config.sh config.sh.old. Then rerun Configure |
409 | with the options you want to use. |
410 | |
411 | This is a common source of problems. If you change from B<cc> to |
412 | B<gcc>, you should almost always remove your old config.sh. |
413 | |
414 | =item Propagating your changes |
415 | |
416 | If you later make any changes to F<config.sh>, you should propagate |
25f94b33 |
417 | them to all the .SH files by running B<sh Configure -S>. |
8e07c86e |
418 | |
419 | =item config.over |
420 | |
421 | You can also supply a shell script config.over to over-ride Configure's |
422 | guesses. It will get loaded up at the very end, just before config.sh |
423 | is created. You have to be careful with this, however, as Configure |
d52d4e46 |
424 | does no checking that your changes make sense. See the section on |
425 | changing the installation directory for an example. |
8e07c86e |
426 | |
427 | =item config.h |
428 | |
429 | Many of the system dependencies are contained in F<config.h>. |
430 | F<Configure> builds F<config.h> by running the F<config_h.SH> script. |
431 | The values for the variables are taken from F<config.sh>. |
432 | |
433 | If there are any problems, you can edit F<config.h> directly. Beware, |
434 | though, that the next time you run B<Configure>, your changes will be |
435 | lost. |
436 | |
437 | =item cflags |
438 | |
439 | If you have any additional changes to make to the C compiler command |
440 | line, they can be made in F<cflags.SH>. For instance, to turn off the |
441 | optimizer on F<toke.c>, find the line in the switch structure for |
442 | F<toke.c> and put the command C<optimize='-g'> before the C<;;>. You |
443 | can also edit F<cflags> directly, but beware that your changes will be |
444 | lost the next time you run B<Configure>. |
445 | |
446 | To change the C flags for all the files, edit F<config.sh> |
447 | and change either C<$ccflags> or C<$optimize>, |
25f94b33 |
448 | and then re-run B<sh Configure -S ; make depend>. |
8e07c86e |
449 | |
450 | =item No sh. |
451 | |
452 | If you don't have sh, you'll have to copy the sample file config_H to |
453 | config.h and edit the config.h to reflect your system's peculiarities. |
454 | You'll probably also have to extensively modify the extension building |
455 | mechanism. |
456 | |
457 | =back |
458 | |
459 | =head1 make depend |
460 | |
461 | This will look for all the includes. |
462 | The output is stored in F<makefile>. The only difference between |
463 | F<Makefile> and F<makefile> is the dependencies at the bottom of |
464 | F<makefile>. If you have to make any changes, you should edit |
465 | F<makefile>, not F<Makefile> since the Unix B<make> command reads |
4633a7c4 |
466 | F<makefile> first. |
8e07c86e |
467 | |
468 | Configure will offer to do this step for you, so it isn't listed |
469 | explicitly above. |
470 | |
471 | =head1 make |
472 | |
473 | This will attempt to make perl in the current directory. |
474 | |
475 | If you can't compile successfully, try some of the following ideas. |
476 | |
477 | =over 4 |
478 | |
479 | =item * |
480 | |
481 | If you used a hint file, try reading the comments in the hint file |
482 | for further tips and information. |
483 | |
484 | =item * |
485 | |
486 | If you can't compile successfully, try adding a C<-DCRIPPLED_CC> flag. |
487 | (Just because you get no errors doesn't mean it compiled right!) |
488 | This simplifies some complicated expressions for compilers that |
489 | get indigestion easily. If that has no effect, try turning off |
490 | optimization. If you have missing routines, you probably need to |
491 | add some library or other, or you need to undefine some feature that |
492 | Configure thought was there but is defective or incomplete. |
493 | |
494 | =item * |
495 | |
496 | Some compilers will not compile or optimize the larger files without |
497 | some extra switches to use larger jump offsets or allocate larger |
498 | internal tables. You can customize the switches for each file in |
499 | F<cflags>. It's okay to insert rules for specific files into |
500 | F<makefile> since a default rule only takes effect in the absence of a |
501 | specific rule. |
502 | |
503 | =item * |
504 | |
505 | If you can successfully build F<miniperl>, but the process crashes |
506 | during the building of extensions, you should run |
507 | |
508 | make minitest |
509 | |
510 | to test your version of miniperl. |
511 | |
512 | =item * |
513 | |
514 | Some additional things that have been reported for either perl4 or perl5: |
515 | |
516 | Genix may need to use libc rather than libc_s, or #undef VARARGS. |
517 | |
518 | NCR Tower 32 (OS 2.01.01) may need -W2,-Sl,2000 and #undef MKDIR. |
519 | |
520 | UTS may need one or more of B<-DCRIPPLED_CC>, B<-K> or B<-g>, and undef LSTAT. |
521 | |
522 | If you get syntax errors on '(', try -DCRIPPLED_CC. |
523 | |
524 | Machines with half-implemented dbm routines will need to #undef I_ODBM |
525 | |
526 | SCO prior to 3.2.4 may be missing dbmclose(). An upgrade to 3.2.4 |
527 | that includes libdbm.nfs (which includes dbmclose()) may be available. |
528 | |
529 | If you get duplicates upon linking for malloc et al, say -DHIDEMYMALLOC. |
530 | |
531 | If you get duplicate function definitions (a perl function has the |
532 | same name as another function on your system) try -DEMBED. |
533 | |
534 | If you get varags problems with gcc, be sure that gcc is installed |
535 | correctly. When using gcc, you should probably have i_stdarg='define' |
536 | and i_varags='undef' in config.sh. The problem is usually solved |
537 | by running fixincludes correctly. |
538 | |
539 | If you wish to use dynamic loading on SunOS or Solaris, and you |
540 | have GNU as and GNU ld installed, you may need to add B<-B/bin/> to |
541 | your $ccflags and $ldflags so that the system's versions of as |
542 | and ld are used. |
543 | |
544 | If you run into dynamic loading problems, check your setting of |
545 | the LD_LIBRARY_PATH environment variable. Perl should build |
546 | fine with LD_LIBRARY_PATH unset, though that may depend on details |
547 | of your local set-up. |
548 | |
24b3df7f |
549 | If Configure seems to be having trouble finding library functions, |
550 | try not using nm extraction. You can do this from the command line |
551 | with |
552 | |
553 | sh Configure -Uusenm |
554 | |
8e07c86e |
555 | =back |
556 | |
557 | =head1 make test |
558 | |
559 | This will run the regression tests on the perl you just made. If it |
560 | doesn't say "All tests successful" then something went wrong. See the |
561 | file F<t/README> in the F<t> subdirectory. Note that you can't run it |
562 | in background if this disables opening of /dev/tty. If B<make test> |
563 | bombs out, just B<cd> to the F<t> directory and run B<TEST> by hand |
564 | to see if it makes any difference. |
565 | If individual tests bomb, you can run them by hand, e.g., |
566 | |
567 | ./perl op/groups.t |
568 | |
edb1cbcb |
569 | B<Note>: one possible reason for errors is that some external programs |
c07a80fd |
570 | may be broken due to the combination of your environment and the way |
571 | C<make test> exercises them. This may happen for example if you have |
572 | one or more of these environment variables set: |
573 | C<LC_ALL LC_CTYPE LANG>. In certain UNIXes especially the non-English |
574 | locales are known to cause programs to exhibit mysterious errors. |
575 | If you have any of the above environment variables set, please try |
576 | C<setenv LC_ALL C> or <LC_ALL=C;export LC_ALL>, for C<csh>-style and |
577 | C<Bourne>-style shells, respectively, from the command line and then |
578 | retry C<make test>. If the tests then succeed, you may have a broken |
579 | program that is confusing the testing. Please run the troublesome test |
580 | by hand as shown above and see whether you can locate the program. |
581 | Look for things like: |
582 | C<exec, `backquoted command`, system, open("|...")> or C<open("...|")>. |
583 | All these mean that Perl is trying to run some external program. |
8e07c86e |
584 | =head1 INSTALLING PERL5 |
585 | |
586 | =head1 make install |
587 | |
588 | This will put perl into the public directory you specified to |
589 | B<Configure>; by default this is F</usr/local/bin>. It will also try |
590 | to put the man pages in a reasonable place. It will not nroff the man |
591 | page, however. You may need to be root to run B<make install>. If you |
592 | are not root, you must own the directories in question and you should |
593 | ignore any messages about chown not working. |
594 | |
edb1cbcb |
595 | B<NOTE:> In the 5.002 release, you will see some harmless error |
a5f75d66 |
596 | messages and warnings from pod2man. You may safely ignore them. (Yes, |
597 | they should be fixed, but they didn't seem important enough to warrant |
598 | holding up the entire 5.002 release.) |
599 | |
8e07c86e |
600 | If you want to see exactly what will happen without installing |
601 | anything, you can run |
4633a7c4 |
602 | |
8e07c86e |
603 | ./perl installperl -n |
604 | ./perl installman -n |
605 | |
606 | B<make install> will install the following: |
607 | |
608 | perl, |
609 | perl5.nnn where nnn is the current release number. This |
610 | will be a link to perl. |
611 | suidperl, |
612 | sperl5.nnn If you requested setuid emulation. |
613 | a2p awk-to-perl translator |
614 | cppstdin This is used by perl -P, if your cc -E can't |
615 | read from stdin. |
616 | c2ph, pstruct Scripts for handling C structures in header files. |
617 | s2p sed-to-perl translator |
618 | find2perl find-to-perl translator |
619 | h2xs Converts C .h header files to Perl extensions. |
24b3df7f |
620 | perlbug Tool to report bugs in Perl. |
8e07c86e |
621 | perldoc Tool to read perl's pod documentation. |
622 | pod2html, Converters from perl's pod documentation format |
623 | pod2latex, and to other useful formats. |
624 | pod2man |
625 | |
626 | library files in $privlib and $archlib specified to |
627 | Configure, usually under /usr/local/lib/perl5/. |
628 | man pages in the location specified to Configure, usually |
629 | something like /usr/local/man/man1. |
630 | module in the location specified to Configure, usually |
631 | man pages under /usr/local/lib/perl5/man/man3. |
632 | pod/*.pod in $privlib/pod/. |
633 | |
4633a7c4 |
634 | Installperl will also create the library directories $siteperl and |
635 | $sitearch listed in config.sh. Usually, these are something like |
24b3df7f |
636 | /usr/local/lib/perl5/site_perl/ |
637 | /usr/local/lib/perl5/site_perl/$archname |
4633a7c4 |
638 | where $archname is something like sun4-sunos. These directories |
639 | will be used for installing extensions. |
640 | |
8e07c86e |
641 | Perl's *.h header files and the libperl.a library are also |
642 | installed under $archlib so that any user may later build new |
643 | extensions even if the Perl source is no longer available. |
644 | |
645 | The libperl.a library is only needed for building new |
646 | extensions and linking them statically into a new perl executable. |
647 | If you will not be doing that, then you may safely delete |
648 | $archlib/libperl.a after perl is installed. |
649 | |
650 | make install may also offer to install perl in a "standard" location. |
651 | |
652 | Most of the documentation in the pod/ directory is also available |
653 | in HTML and LaTeX format. Type |
654 | |
655 | cd pod; make html; cd .. |
656 | |
657 | to generate the html versions, and |
658 | |
659 | cd pod; make tex; cd .. |
660 | |
661 | to generate the LaTeX versions. |
662 | |
4633a7c4 |
663 | =head1 Coexistence with earlier versions of perl5. |
664 | |
665 | You can safely install the current version of perl5 and still run |
666 | scripts under the old binaries. Instead of starting your script with |
667 | #!/usr/local/bin/perl, just start it with #!/usr/local/bin/perl5.001 |
668 | (or whatever version you want to run.) |
669 | |
670 | The architecture-dependent files are stored in a version-specific |
671 | directory (such as F</usr/local/lib/perl5/sun4-sunos/5.002>) so that |
672 | they are still accessible. I<Note:> perl5.000 and perl5.001 did not |
673 | put their architecture-dependent libraries in a version-specific |
674 | directory. They are simply in F</usr/local/lib/perl5/$archname>. If |
675 | you will not be using 5.000 or 5.001, you may safely remove those |
676 | files. |
677 | |
678 | The standard library files in F</usr/local/lib/perl5> |
679 | should be useable by all versions of perl5. |
680 | |
d52d4e46 |
681 | Most extensions will probably not need to be recompiled to use with a newer |
4633a7c4 |
682 | version of perl. If you do run into problems, and you want to continue |
683 | to use the old version of perl along with your extension, simply move |
684 | those extension files to the appropriate version directory, such as |
685 | F</usr/local/lib/perl/archname/5.002>. Then perl5.002 will find your |
686 | files in the 5.002 directory, and newer versions of perl will find your |
687 | newer extension in the site_perl directory. |
688 | |
d52d4e46 |
689 | Some users may prefer to keep all versions of perl in completely |
690 | separate directories. One convenient way to do this is by |
691 | using a separate prefix for each version, such as |
692 | |
693 | sh Configure -Dprefix=/opt/perl5.002 |
694 | |
695 | and adding /opt/perl5.002/bin to the shell PATH variable. Such users |
696 | may also wish to add a symbolic link /usr/local/bin/perl so that |
697 | scripts can still start with #!/usr/local/bin/perl. |
698 | |
edb1cbcb |
699 | B<NOTE>: Starting with 5.002_01, all functions in the perl C source |
700 | code are protected by default by the prefix Perl_ (or perl_) so that |
701 | you may link with third-party libraries without fear of namespace |
702 | collisons. This breaks compatability with the initially released |
703 | version of 5.002, so once you install 5.002_01 (or higher) you will |
704 | need to re-build and install all of your dynamically loadable |
705 | extensions. (The standard extensions supplied with Perl are handled |
706 | automatically). You can turn off this namespace protection by adding |
707 | -DNO_EMBED to your ccflags variable in config.sh. This is a one-time |
708 | change. In the future, we certainly hope that most extensions won't |
709 | need to be recompiled for use with a newer version of perl. |
710 | |
8e07c86e |
711 | =head1 Coexistence with perl4 |
712 | |
713 | You can safely install perl5 even if you want to keep perl4 around. |
714 | |
715 | By default, the perl5 libraries go into F</usr/local/lib/perl5/>, so |
716 | they don't override the perl4 libraries in F</usr/local/lib/perl/>. |
717 | |
718 | In your /usr/local/bin directory, you should have a binary named |
719 | F<perl4.036>. That will not be touched by the perl5 installation |
720 | process. Most perl4 scripts should run just fine under perl5. |
721 | However, if you have any scripts that require perl4, you can replace |
722 | the C<#!> line at the top of them by C<#!/usr/local/bin/perl4.036> |
edb1cbcb |
723 | (or whatever the appropriate pathname is). See pod/perltrap.pod |
724 | for possible problems running perl4 scripts under perl5. |
8e07c86e |
725 | |
726 | =head1 DOCUMENTATION |
727 | |
728 | Read the manual entries before running perl. The main documentation is |
729 | in the pod/ subdirectory and should have been installed during the |
730 | build process. Type B<man perl> to get started. Alternatively, you |
731 | can type B<perldoc perl> to use the supplied B<perldoc> script. This |
732 | is sometimes useful for finding things in the library modules. |
733 | |
734 | =head1 AUTHOR |
735 | |
736 | Andy Dougherty <doughera@lafcol.lafayette.edu>, borrowing I<very> heavily |
737 | from the original README by Larry Wall. |
738 | |
a5f75d66 |
739 | =head1 LAST MODIFIED |
24b3df7f |
740 | |
edb1cbcb |
741 | 19 March 1996 |