source: trunk/essentials/dev-lang/perl/INSTALL@ 3188

Last change on this file since 3188 was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 104.0 KB
Line 
1If you read this file _as_is_, just ignore the funny characters you see.
2It is written in the POD format (see pod/perlpod.pod) which is specially
3designed to be readable as is.
4
5=head1 NAME
6
7Install - Build and Installation guide for perl5.
8
9=head1 Reporting Problems
10
11Wherever possible please use the perlbug tool supplied with this Perl
12to report problems, as it automatically includes summary configuration
13information about your perl, which may help us track down problems far
14more quickly. But first you should read the advice in this file,
15carefully re-read the error message and check the relevant manual pages
16on your system, as these may help you find an immediate solution. If
17you are not sure whether what you are seeing is a bug, you can send a
18message describing the problem to the comp.lang.perl.misc newsgroup to
19get advice.
20
21The perlbug tool is installed along with perl, so after you have
22completed C<make install> it should be possible to run it with plain
23C<perlbug>. If the install fails, or you want to report problems with
24C<make test> without installing perl, then you can use C<make nok> to
25run perlbug to report the problem, or run it by hand from this source
26directory with C<./perl -Ilib utils/perlbug>
27
28If the build fails too early to run perlbug uninstalled, then please
29B<run> the C<./myconfig> shell script, and mail its output along with
30an accurate description of your problem to [email protected]
31
32If Configure itself fails, and does not generate a config.sh file
33(needed to run C<./myconfig>), then please mail [email protected] the
34description of how Configure fails along with details of your system
35- for example the output from running C<uname -a>
36
37Please try to make your message brief but clear. Brief, clear bug
38reports tend to get answered more quickly. Please don't worry if your
39written English is not great - what matters is how well you describe
40the important technical details of the problem you have encountered,
41not whether your grammar and spelling is flawless.
42
43Trim out unnecessary information. Do not include large files (such as
44config.sh or a complete Configure or make log) unless absolutely
45necessary. Do not include a complete transcript of your build
46session. Just include the failing commands, the relevant error
47messages, and whatever preceding commands are necessary to give the
48appropriate context. Plain text should usually be sufficient--fancy
49attachments or encodings may actually reduce the number of people who
50read your message. Your message will get relayed to over 400
51subscribers around the world so please try to keep it brief but clear.
52
53If you are unsure what makes a good bug report please read "How to
54report Bugs Effectively" by Simon Tatham:
55http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
56
57=head1 SYNOPSIS
58
59First, make sure you have an up-to-date version of Perl. If you
60didn't get your Perl source from CPAN, check the latest version at
61http://www.cpan.org/src/. Perl uses a version scheme where even-numbered
62subreleases (like 5.6.x and 5.8.x) are stable maintenance releases and
63odd-numbered subreleases (like 5.7.x and 5.9.x) are unstable
64development releases. Development releases should not be used in
65production environments. Fixes and new features are first carefully
66tested in development releases and only if they prove themselves to be
67worthy will they be migrated to the maintenance releases.
68
69The basic steps to build and install perl5 on a Unix system with all
70the defaults are:
71
72 rm -f config.sh Policy.sh
73 sh Configure -de
74 make
75 make test
76 make install
77
78Each of these is explained in further detail below.
79
80The above commands will install Perl to /usr/local (or some other
81platform-specific directory -- see the appropriate file in hints/.)
82If that's not okay with you, can run Configure interactively and use
83
84 rm -f config.sh Policy.sh
85 sh Configure
86 make
87 make test
88 make install
89
90 # You may also wish to add these:
91 (cd /usr/include && h2ph *.h sys/*.h)
92 (installhtml --help)
93 (cd pod && make tex && <process the latex files>)
94
95or you can use some of the Configure options described below.
96
97If you have problems, corrections, or questions, please see
98L<"Reporting Problems"> above.
99
100For information on what's new in this release, see the
101pod/perldelta.pod file. For more detailed information about specific
102changes, see the Changes file.
103
104=head1 DESCRIPTION
105
106This document is written in pod format as an easy way to indicate its
107structure. The pod format is described in pod/perlpod.pod, but you can
108read it as is with any pager or editor. Headings and items are marked
109by lines beginning with '='. The other mark-up used is
110
111 B<text> embolden text, used for switches, programs or commands
112 C<code> literal code
113 L<name> A link (cross reference) to name
114 F<file> A filename
115
116Although most of the defaults are probably fine for most users,
117you should probably at least skim through this document before
118proceeding.
119
120In addition to this file, check if there is a README file specific to
121your operating system, since it may provide additional or different
122instructions for building Perl. If there is a hint file for your
123system (in the hints/ directory) you should also read that hint file
124for even more information. (Unixware users should use the svr4.sh or
125the svr5.sh hint file.)
126
127For additional information about porting Perl, see the section on
128L<"Porting information"> below, and look at the files in the Porting/
129directory.
130
131=head1 PRELIMINARIES
132
133=head2 Changes and Incompatibilities
134
135Please see pod/perldelta.pod for a description of the changes and
136potential incompatibilities introduced with this release. A few of
137the most important issues are listed below, but you should refer
138to pod/perldelta.pod for more detailed information.
139
140=head3 WARNING: This version is not binary compatible with releases of
141Perl prior to 5.8.0.
142
143If you have built extensions (i.e. modules that include C code)
144using an earlier version of Perl, you will need to rebuild and reinstall
145those extensions.
146
147Pure perl modules without XS or C code should continue to work fine
148without reinstallation. See the discussions below on
149L<"Coexistence with earlier versions of perl5"> and
150L<"Upgrading from 5.005 or 5.6 to 5.8.0"> for more details.
151
152The standard extensions supplied with Perl will be handled automatically.
153
154On a related issue, old modules may possibly be affected by the changes
155in the Perl language in the current release. Please see
156pod/perldelta.pod for a description of what's changed. See your
157installed copy of the perllocal.pod file for a (possibly incomplete)
158list of locally installed modules. Also see CPAN::autobundle for one
159way to make a "bundle" of your currently installed modules.
160
161=head2 Space Requirements
162
163The complete perl5 source tree takes up about 60 MB of disk space.
164After completing make, it takes up roughly 100 MB, though the actual
165total is likely to be quite system-dependent. The installation
166directories need something on the order of 45 MB, though again that
167value is system-dependent. A perl build with debug symbols and
168-DDEBUGGING will require something on the order of 10 MB extra.
169
170=head1 Start with a Fresh Distribution
171
172If you have built perl before, you should clean out the build directory
173with the command
174
175 make distclean
176
177or
178
179 make realclean
180
181The only difference between the two is that make distclean also removes
182your old config.sh and Policy.sh files.
183
184The results of a Configure run are stored in the config.sh and Policy.sh
185files. If you are upgrading from a previous version of perl, or if you
186change systems or compilers or make other significant changes, or if
187you are experiencing difficulties building perl, you should probably
188not re-use your old config.sh. Simply remove it
189
190 rm -f config.sh
191
192If you wish to use your old config.sh, be especially attentive to the
193version and architecture-specific questions and answers. For example,
194the default directory for architecture-dependent library modules
195includes the version name. By default, Configure will reuse your old
196name (e.g. /opt/perl/lib/i86pc-solaris/5.003) even if you're running
197Configure for a different version, e.g. 5.004. Yes, Configure should
198probably check and correct for this, but it doesn't. Similarly, if you
199used a shared libperl.so (see below) with version numbers, you will
200probably want to adjust them as well.
201
202Also, be careful to check your architecture name. For example, some
203Linux distributions use i386, while others may use i486. If you build
204it yourself, Configure uses the output of the arch command, which
205might be i586 or i686 instead. If you pick up a precompiled binary, or
206compile extensions on different systems, they might not all agree on
207the architecture name.
208
209In short, if you wish to use your old config.sh, I recommend running
210Configure interactively rather than blindly accepting the defaults.
211
212If your reason to reuse your old config.sh is to save your particular
213installation choices, then you can probably achieve the same effect by
214using the Policy.sh file. See the section on L<"Site-wide Policy
215settings"> below. If you wish to start with a fresh distribution, you
216also need to remove any old Policy.sh files you may have with
217
218 rm -f Policy.sh
219
220=head1 Run Configure
221
222Configure will figure out various things about your system. Some
223things Configure will figure out for itself, other things it will ask
224you about. To accept the default, just press RETURN. The default is
225almost always okay. It is normal for some things to be "NOT found",
226since Configure often searches for many different ways of performing
227the same function.
228
229At any Configure prompt, you can type &-d and Configure will use the
230defaults from then on.
231
232After it runs, Configure will perform variable substitution on all the
233*.SH files and offer to run make depend.
234
235=head2 Common Configure options
236
237Configure supports a number of useful options. Run
238
239 Configure -h
240
241to get a listing. See the Porting/Glossary file for a complete list of
242Configure variables you can set and their definitions.
243
244=over 4
245
246=item gcc
247
248To compile with gcc you should run
249
250 sh Configure -Dcc=gcc
251
252This is the preferred way to specify gcc (or another alternative
253compiler) so that the hints files can set appropriate defaults.
254
255=item Installation prefix
256
257By default, for most systems, perl will be installed in
258/usr/local/{bin, lib, man}. (See L<"Installation Directories">
259and L<"Coexistence with earlier versions of perl5"> below for
260further details.)
261
262You can specify a different 'prefix' for the default installation
263directory when Configure prompts you, or by using the Configure command
264line option -Dprefix='/some/directory', e.g.
265
266 sh Configure -Dprefix=/opt/perl
267
268If your prefix contains the string "perl", then the suggested
269directory structure is simplified. For example, if you use
270prefix=/opt/perl, then Configure will suggest /opt/perl/lib instead of
271/opt/perl/lib/perl5/. Again, see L<"Installation Directories"> below
272for more details. Do not include a trailing slash, (i.e. /opt/perl/)
273or you may experience odd test failures.
274
275NOTE: You must not specify an installation directory that is the same
276as or below your perl source directory. If you do, installperl will
277attempt infinite recursion.
278
279=item /usr/bin/perl
280
281It may seem obvious, but Perl is useful only when users can easily
282find it. It's often a good idea to have both /usr/bin/perl and
283/usr/local/bin/perl be symlinks to the actual binary. Be especially
284careful, however, not to overwrite a version of perl supplied by your
285vendor unless you are sure you know what you are doing. If you insist
286on replacing your vendor's perl, useful information on how it was
287configured may be found with
288
289 perl -V:config_args
290
291(Check the output carefully, however, since this doesn't preserve
292spaces in arguments to Configure. For that, you have to look carefully
293at config_arg1, config_arg2, etc.)
294
295By default, Configure will not try to link /usr/bin/perl to the current
296version of perl. You can turn on that behavior by running
297
298 Configure -Dinstallusrbinperl
299
300or by answering 'yes' to the appropriate Configure prompt.
301
302In any case, system administrators are strongly encouraged to put
303(symlinks to) perl and its accompanying utilities, such as perldoc,
304into a directory typically found along a user's PATH, or in another
305obvious and convenient place.
306
307=item Building a development release.
308
309For development releases (odd subreleases, like 5.9.x) if you want to
310use Configure -d, you will also need to supply -Dusedevel to Configure,
311because the default answer to the question "do you really want to
312Configure a development version?" is "no". The -Dusedevel skips that
313sanity check.
314
315=back
316
317If you are willing to accept all the defaults, and you want terse
318output, you can run
319
320 sh Configure -des
321
322For example for my Solaris/x86 system, I usually use
323
324 sh Configure -Dprefix=/opt/perl -Doptimize='-xpentium -xO4' -des
325
326=head2 Altering config.sh variables for C compiler switches etc.
327
328For most users, most of the Configure defaults are fine, or can easily
329be set on the Configure command line. However, if Configure doesn't
330have an option to do what you want, you can change Configure variables
331after the platform hints have been run by using Configure's -A switch.
332For example, here's how to add a couple of extra flags to C compiler
333invocations:
334
335 sh Configure -Accflags="-DPERL_Y2KWARN -DPERL_POLLUTE_MALLOC"
336
337For more help on Configure switches, run
338
339 sh Configure -h
340
341=head2 Major Configure-time Build Options
342
343There are several different ways to Configure and build perl for your
344system. For most users, the defaults are sensible and will work.
345Some users, however, may wish to further customize perl. Here are
346some of the main things you can change.
347
348=head3 Threads
349
350On some platforms, perl can be compiled with support for threads. To
351enable this, run
352
353 sh Configure -Dusethreads
354
355Currently, you need to specify -Dusethreads on the Configure command
356line so that the hint files can make appropriate adjustments.
357
358The default is to compile without thread support.
359
360Perl has two different internal threads implementations. The current
361model (available internally since 5.6, and as a user-level module since
3625.8) is called interpreter-based implementation (ithreads), with one
363interpreter per thread, and explicit sharing of data. The 5.005
364version (5005threads) is considered obsolete, buggy, and unmaintained.
365
366By default, Configure selects ithreads if -Dusethreads is specified.
367
368However, if you insist, you can select the unsupported old 5005threads behavior
369
370 sh Configure -Dusethreads -Duse5005threads
371
372The 'threads' module is for use with the ithreads implementation. The
373'Thread' module offers an interface to either 5005threads or ithreads
374(whichever has been configured).
375
376When using threads, perl uses a dynamically-sized buffer for some of
377the thread-safe library calls, such as those in the getpw*() family.
378This buffer starts small, but it will keep growing until the result
379fits. To get a fixed upper limit, you should compile Perl with
380PERL_REENTRANT_MAXSIZE defined to be the number of bytes you want. One
381way to do this is to run Configure with
382C<-Accflags=-DPERL_REENTRANT_MAXSIZE=65536>
383
384=head3 Large file support.
385
386Since Perl 5.6.0, Perl has supported large files (files larger than
3872 gigabytes), and in many common platforms like Linux or Solaris this
388support is on by default.
389
390This is both good and bad. It is good in that you can use large files,
391seek(), stat(), and -s them. It is bad in that if you are interfacing Perl
392using some extension, the components you are connecting to must also
393be large file aware: if Perl thinks files can be large but the other
394parts of the software puzzle do not understand the concept, bad things
395will happen. One popular extension suffering from this ailment is the
396Apache extension mod_perl.
397
398There's also one known limitation with the current large files
399implementation: unless you also have 64-bit integers (see the next
400section), you cannot use the printf/sprintf non-decimal integer formats
401like C<%x> to print filesizes. You can use C<%d>, though.
402
403=head3 64 bit support.
404
405If your platform does not have run natively at 64 bits, but can
406simulate them with compiler flags and/or C<long long> or C<int64_t>,
407you can build a perl that uses 64 bits.
408
409There are actually two modes of 64-bitness: the first one is achieved
410using Configure -Duse64bitint and the second one using Configure
411-Duse64bitall. The difference is that the first one is minimal and
412the second one maximal. The first works in more places than the second.
413
414The C<use64bitint> option does only as much as is required to get
41564-bit integers into Perl (this may mean, for example, using "long
416longs") while your memory may still be limited to 2 gigabytes (because
417your pointers could still be 32-bit). Note that the name C<64bitint>
418does not imply that your C compiler will be using 64-bit C<int>s (it
419might, but it doesn't have to). The C<use64bitint> simply means that
420you will be able to have 64 bit-wide scalar values.
421
422The C<use64bitall> option goes all the way by attempting to switch
423integers (if it can), longs (and pointers) to being 64-bit. This may
424create an even more binary incompatible Perl than -Duse64bitint: the
425resulting executable may not run at all in a 32-bit box, or you may
426have to reboot/reconfigure/rebuild your operating system to be 64-bit
427aware.
428
429Natively 64-bit systems like Alpha and Cray need neither -Duse64bitint
430nor -Duse64bitall.
431
432 NOTE: 64-bit support is still experimental on most platforms.
433 Existing support only covers the LP64 data model. In particular, the
434 LLP64 data model is not yet supported. 64-bit libraries and system
435 APIs on many platforms have not stabilized--your mileage may vary.
436
437=head3 Long doubles
438
439In some systems you may be able to use long doubles to enhance the
440range and precision of your double precision floating point numbers
441(that is, Perl's numbers). Use Configure -Duselongdouble to enable
442this support (if it is available).
443
444=head3 "more bits"
445
446You can "Configure -Dusemorebits" to turn on both the 64-bit support
447and the long double support.
448
449=head3 Selecting File IO mechanisms
450
451Executive summary: as of Perl 5.8, you should use the default "PerlIO"
452as the IO mechanism unless you have a good reason not to.
453
454In more detail: previous versions of perl used the standard IO
455mechanisms as defined in stdio.h. Versions 5.003_02 and later of perl
456introduced alternate IO mechanisms via a "PerlIO" abstraction, but up
457until and including Perl 5.6, the stdio mechanism was still the default
458and the only supported mechanism.
459
460Starting from Perl 5.8, the default mechanism is to use the PerlIO
461abstraction, because it allows better control of I/O mechanisms,
462instead of having to work with (often, work around) vendors' I/O
463implementations.
464
465This PerlIO abstraction can be (but again, unless you know what you
466are doing, should not be) disabled either on the Configure command
467line with
468
469 sh Configure -Uuseperlio
470
471or interactively at the appropriate Configure prompt.
472
473With the PerlIO abstraction layer, there is another possibility for
474the underlying IO calls, AT&T's "sfio". This has superior performance
475to stdio.h in many cases, and is extensible by the use of "discipline"
476modules ("Native" PerlIO has them too). Sfio currently only builds on
477a subset of the UNIX platforms perl supports. Because the data
478structures are completely different from stdio, perl extension modules
479or external libraries may not work. This configuration exists to
480allow these issues to be worked on.
481
482This option requires the 'sfio' package to have been built and installed.
483The latest sfio is available from http://www.research.att.com/sw/tools/sfio/
484
485You select this option by
486
487 sh Configure -Duseperlio -Dusesfio
488
489If you have already selected -Duseperlio, and if Configure detects
490that you have sfio, then sfio will be the default suggested by
491Configure.
492
493Note: On some systems, sfio's iffe configuration script fails to
494detect that you have an atexit function (or equivalent). Apparently,
495this is a problem at least for some versions of Linux and SunOS 4.
496Configure should detect this problem and warn you about problems with
497_exit vs. exit. If you have this problem, the fix is to go back to
498your sfio sources and correct iffe's guess about atexit.
499
500=head3 Algorithmic Complexity Attacks on Hashes
501
502In Perls 5.8.0 and earlier it was easy to create degenerate hashes.
503Processing such hashes would consume large amounts of CPU time,
504enabling a "Denial of Service" attack against Perl. Such hashes may be
505a problem for example for mod_perl sites, sites with Perl CGI scripts
506and web services, that process data originating from external sources.
507
508In Perl 5.8.1 a security feature was introduced to make it harder to
509create such degenerate hashes. A visible side effect of this was that
510the keys(), values(), and each() functions may return the hash elements
511in different order between different runs of Perl even with the same
512data. It also had unintended binary incompatibility issues with
513certain modules compiled against Perl 5.8.0.
514
515In Perl 5.8.2 an improved scheme was introduced. Hashes will return
516elements in the same order as Perl 5.8.0 by default. On a hash by hash
517basis, if pathological data is detected during a hash key insertion,
518then that hash will switch to an alternative random hash seed. As
519adding keys can always dramatically change returned hash element order,
520existing programs will not be affected by this, unless they
521specifically test for pre-recorded hash return order for contrived
522data. (eg the list of keys generated by C<map {"\0"x$_} 0..15> trigger
523randomisation) In effect the new implementation means that 5.8.1 scheme
524is only being used on hashes which are under attack.
525
526One can still revert to the old guaranteed repeatable order (and be
527vulnerable to attack by wily crackers) by setting the environment
528variable PERL_HASH_SEED, see L<perlrun/PERL_HASH_SEED>. Another option
529is to add -DUSE_HASH_SEED_EXPLICIT to the compilation flags (for
530example by using C<Configure -Accflags=-DUSE_HASH_SEED_EXPLICIT>), in
531which case one has to explicitly set the PERL_HASH_SEED environment
532variable to enable the security feature, or by adding -DNO_HASH_SEED to
533the compilation flags to completely disable the randomisation feature.
534
535B<Perl has never guaranteed any ordering of the hash keys>, and the
536ordering has already changed several times during the lifetime of Perl
5375. Also, the ordering of hash keys has always been, and continues to
538be, affected by the insertion order. It is likely that Perl 5.10 and
539Perl 6 will randomise all hashes. Note that because of this
540randomisation for example the Data::Dumper results will be different
541between different runs of Perl since Data::Dumper by default dumps
542hashes "unordered". The use of the Data::Dumper C<Sortkeys> option is
543recommended.
544
545=head3 SOCKS
546
547Perl can be configured to be 'socksified', that is, to use the SOCKS
548TCP/IP proxy protocol library. SOCKS is used to give applications
549access to transport layer network proxies. Perl supports only SOCKS
550Version 5. You can find more about SOCKS from http://www.socks.nec.com/
551
552=head3 Dynamic Loading
553
554By default, Configure will compile perl to use dynamic loading if
555your system supports it. If you want to force perl to be compiled
556statically, you can either choose this when Configure prompts you or
557you can use the Configure command line option -Uusedl.
558
559=head3 Building a shared Perl library
560
561Currently, for most systems, the main perl executable is built by
562linking the "perl library" libperl.a with perlmain.o, your static
563extensions (usually just DynaLoader.a) and various extra libraries,
564such as -lm.
565
566On some systems that support dynamic loading, it may be possible to
567replace libperl.a with a shared libperl.so. If you anticipate building
568several different perl binaries (e.g. by embedding libperl into
569different programs, or by using the optional compiler extension), then
570you might wish to build a shared libperl.so so that all your binaries
571can share the same library.
572
573The disadvantages are that there may be a significant performance
574penalty associated with the shared libperl.so, and that the overall
575mechanism is still rather fragile with respect to different versions
576and upgrades.
577
578In terms of performance, on my test system (Solaris 2.5_x86) the perl
579test suite took roughly 15% longer to run with the shared libperl.so.
580Your system and typical applications may well give quite different
581results.
582
583The default name for the shared library is typically something like
584libperl.so.6.2 (for Perl 5.6.2), or libperl.so.602, or simply
585libperl.so. Configure tries to guess a sensible naming convention
586based on your C library name. Since the library gets installed in a
587version-specific architecture-dependent directory, the exact name
588isn't very important anyway, as long as your linker is happy.
589
590For some systems (mostly SVR4), building a shared libperl is required
591for dynamic loading to work, and hence is already the default.
592
593You can elect to build a shared libperl by
594
595 sh Configure -Duseshrplib
596
597To build a shared libperl, the environment variable controlling shared
598library search (LD_LIBRARY_PATH in most systems, DYLD_LIBRARY_PATH for
599NeXTSTEP/OPENSTEP/Darwin, LIBRARY_PATH for BeOS, LD_LIBRARY_PATH/SHLIB_PATH
600for HP-UX, LIBPATH for AIX, PATH for Cygwin) must be set up to include
601the Perl build directory because that's where the shared libperl will
602be created. Configure arranges makefile to have the correct shared
603library search settings. You can find the name of the environment
604variable Perl thinks works in your your system by
605
606 grep ldlibpthname config.sh
607
608However, there are some special cases where manually setting the
609shared library path might be required. For example, if you want to run
610something like the following with the newly-built but not-yet-installed
611./perl:
612
613 cd t; ./perl misc/failing_test.t
614or
615 ./perl -Ilib ~/my_mission_critical_test
616
617then you need to set up the shared library path explicitly.
618You can do this with
619
620 LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
621
622for Bourne-style shells, or
623
624 setenv LD_LIBRARY_PATH `pwd`
625
626for Csh-style shells. (This procedure may also be needed if for some
627unexpected reason Configure fails to set up makefile correctly.) (And
628again, it may be something other than LD_LIBRARY_PATH for you, see above.)
629
630You can often recognize failures to build/use a shared libperl from error
631messages complaining about a missing libperl.so (or libperl.sl in HP-UX),
632for example:
63318126:./miniperl: /sbin/loader: Fatal Error: cannot map libperl.so
634
635There is also an potential problem with the shared perl library if you
636want to have more than one "flavor" of the same version of perl (e.g.
637with and without -DDEBUGGING). For example, suppose you build and
638install a standard Perl 5.8.0 with a shared library. Then, suppose you
639try to build Perl 5.8.0 with -DDEBUGGING enabled, but everything else
640the same, including all the installation directories. How can you
641ensure that your newly built perl will link with your newly built
642libperl.so.8 rather with the installed libperl.so.8? The answer is
643that you might not be able to. The installation directory is encoded
644in the perl binary with the LD_RUN_PATH environment variable (or
645equivalent ld command-line option). On Solaris, you can override that
646with LD_LIBRARY_PATH; on Linux, you can only override at runtime via
647LD_PRELOAD, specifying the exact filename you wish to be used; and on
648Digital Unix, you can override LD_LIBRARY_PATH by setting the
649_RLD_ROOT environment variable to point to the perl build directory.
650
651In other words, it is generally not a good idea to try to build a perl
652with a shared library if $archlib/CORE/$libperl already exists from a
653previous build.
654
655A good workaround is to specify a different directory for the
656architecture-dependent library for your -DDEBUGGING version of perl.
657You can do this by changing all the *archlib* variables in config.sh to
658point to your new architecture-dependent library.
659
660=head3 Environment access
661
662Perl often needs to write to the program's environment, such as when C<%ENV>
663is assigned to. Many implementations of the C library function C<putenv()>
664leak memory, so where possible perl will manipulate the environment directly
665to avoid these leaks. The default is now to perform direct manipulation
666whenever perl is running as a stand alone interpreter, and to call the safe
667but potentially leaky C<putenv()> function when the perl interpreter is
668embedded in another application. You can force perl to always use C<putenv()>
669by compiling with -DPERL_USE_SAFE_PUTENV. You can force an embedded perl to
670use direct manipulation by setting C<PL_use_safe_putenv = 0;> after the
671C<perl_construct()> call.
672
673=head2 Installation Directories
674
675The installation directories can all be changed by answering the
676appropriate questions in Configure. For convenience, all the
677installation questions are near the beginning of Configure.
678Do not include trailing slashes on directory names.
679
680I highly recommend running Configure interactively to be sure it puts
681everything where you want it. At any point during the Configure
682process, you can answer a question with &-d and Configure will use
683the defaults from then on. Alternatively, you can
684
685 grep '^install' config.sh
686
687after Configure has run to verify the installation paths.
688
689The defaults are intended to be reasonable and sensible for most
690people building from sources. Those who build and distribute binary
691distributions or who export perl to a range of systems will probably
692need to alter them. If you are content to just accept the defaults,
693you can safely skip the next section.
694
695The directories set up by Configure fall into three broad categories.
696
697=over 4
698
699=item Directories for the perl distribution
700
701By default, Configure will use the following directories for 5.8.x.
702$version is the full perl version number, including subversion, e.g.
7035.8.3 or 5.8.4, and $archname is a string like sun4-sunos,
704determined by Configure. The full definitions of all Configure
705variables are in the file Porting/Glossary.
706
707 Configure variable Default value
708 $prefixexp /usr/local
709 $binexp $prefixexp/bin
710 $scriptdirexp $prefixexp/bin
711 $privlibexp $prefixexp/lib/perl5/$version
712 $archlibexp $prefixexp/lib/perl5/$version/$archname
713 $man1direxp $prefixexp/man/man1
714 $man3direxp $prefixexp/man/man3
715 $html1direxp (none)
716 $html3direxp (none)
717
718$prefixexp is generated from $prefix, with ~ expansion done to convert home
719directories into absolute paths. Similarly for the other variables listed. As
720file system calls do not do this, you should always reference the ...exp
721variables, to support users who build perl in their home directory.
722
723Actually, Configure recognizes the SVR3-style
724/usr/local/man/l_man/man1 directories, if present, and uses those
725instead. Also, if $prefix contains the string "perl", the library
726directories are simplified as described below. For simplicity, only
727the common style is shown here.
728
729=item Directories for site-specific add-on files
730
731After perl is installed, you may later wish to add modules (e.g. from
732CPAN) or scripts. Configure will set up the following directories to
733be used for installing those add-on modules and scripts.
734
735 Configure variable Default value
736 $siteprefixexp $prefixexp
737 $sitebinexp $siteprefixexp/bin
738 $sitescriptexp $siteprefixexp/bin
739 $sitelibexp $siteprefixexp/lib/perl5/site_perl/$version
740 $sitearchexp $siteprefixexp/lib/perl5/site_perl/$version/$archname
741 $siteman1direxp $siteprefixexp/man/man1
742 $siteman3direxp $siteprefixexp/man/man3
743 $sitehtml1direxp (none)
744 $sitehtml3direxp (none)
745
746By default, ExtUtils::MakeMaker will install architecture-independent
747modules into $sitelib and architecture-dependent modules into $sitearch.
748
749=item Directories for vendor-supplied add-on files
750
751Lastly, if you are building a binary distribution of perl for
752distribution, Configure can optionally set up the following directories
753for you to use to distribute add-on modules.
754
755 Configure variable Default value
756 $vendorprefixexp (none)
757 (The next ones are set only if vendorprefix is set.)
758 $vendorbinexp $vendorprefixexp/bin
759 $vendorscriptexp $vendorprefixexp/bin
760 $vendorlibexp
761 $vendorprefixexp/lib/perl5/vendor_perl/$version
762 $vendorarchexp
763 $vendorprefixexp/lib/perl5/vendor_perl/$version/$archname
764 $vendorman1direxp $vendorprefixexp/man/man1
765 $vendorman3direxp $vendorprefixexp/man/man3
766 $vendorhtml1direxp (none)
767 $vendorhtml3direxp (none)
768
769These are normally empty, but may be set as needed. For example,
770a vendor might choose the following settings:
771
772 $prefix /usr
773 $siteprefix /usr/local
774 $vendorprefix /usr
775
776This would have the effect of setting the following:
777
778 $binexp /usr/bin
779 $scriptdirexp /usr/bin
780 $privlibexp /usr/lib/perl5/$version
781 $archlibexp /usr/lib/perl5/$version/$archname
782 $man1direxp /usr/man/man1
783 $man3direxp /usr/man/man3
784
785 $sitebinexp /usr/local/bin
786 $sitescriptexp /usr/local/bin
787 $sitelibexp /usr/local/lib/perl5/site_perl/$version
788 $sitearchexp /usr/local/lib/perl5/site_perl/$version/$archname
789 $siteman1direxp /usr/local/man/man1
790 $siteman3direxp /usr/local/man/man3
791
792 $vendorbinexp /usr/bin
793 $vendorscriptexp /usr/bin
794 $vendorlibexp /usr/lib/perl5/vendor_perl/$version
795 $vendorarchexp /usr/lib/perl5/vendor_perl/$version/$archname
796 $vendorman1direxp /usr/man/man1
797 $vendorman3direxp /usr/man/man3
798
799Note how in this example, the vendor-supplied directories are in the
800/usr hierarchy, while the directories reserved for the end-user are in
801the /usr/local hierarchy.
802
803The entire installed library hierarchy is installed in locations with
804version numbers, keeping the installations of different versions distinct.
805However, later installations of Perl can still be configured to search the
806installed libraries corresponding to compatible earlier versions.
807See L<"Coexistence with earlier versions of perl5"> below for more details
808on how Perl can be made to search older version directories.
809