xref: /openbsd/gnu/usr.bin/perl/INSTALL (revision cecf84d4)
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 perl 5.
8
9=head1 SYNOPSIS
10
11First, make sure you have an up-to-date version of Perl.  If you
12didn't get your Perl source from CPAN, check the latest version at
13http://www.cpan.org/src/.  Perl uses a version scheme where even-numbered
14subreleases (like 5.8.x and 5.10.x) are stable maintenance releases and
15odd-numbered subreleases (like 5.7.x and 5.9.x) are unstable
16development releases.  Development releases should not be used in
17production environments.  Fixes and new features are first carefully
18tested in development releases and only if they prove themselves to be
19worthy will they be migrated to the maintenance releases.
20
21The basic steps to build and install perl 5 on a Unix system with all
22the defaults are to run, from a freshly unpacked source tree:
23
24	sh Configure -de
25	make
26	make test
27	make install
28
29Each of these is explained in further detail below.
30
31The above commands will install Perl to /usr/local (or some other
32platform-specific directory -- see the appropriate file in hints/.)
33If that's not okay with you, you can run Configure interactively, by
34just typing "sh Configure" (without the -de args). You can also specify
35any prefix location by adding "-Dprefix='/some/dir'" to Configure's args.
36To explicitly name the perl binary, use the command
37"make install PERLNAME=myperl".
38
39Building perl from source requires an ANSI compliant C compiler.
40A minimum of C89 is required. Some features available in C99 will
41be probed for and used when found. The perl build process does not
42rely on anything more than C89.
43
44These options, and many more, are explained in further detail below.
45
46If you're building perl from a git repository, you should also consult
47the documentation in pod/perlgit.pod for information on that special
48circumstance.
49
50If you have problems, corrections, or questions, please see
51L<"Reporting Problems"> below.
52
53For information on what's new in this release, see the
54pod/perldelta.pod file.  For more information about how to find more
55specific detail about changes, see the Changes file.
56
57=head1 DESCRIPTION
58
59This document is written in pod format as an easy way to indicate its
60structure.  The pod format is described in pod/perlpod.pod, but you can
61read it as is with any pager or editor.  Headings and items are marked
62by lines beginning with '='.  The other mark-up used is
63
64    B<text>     embolden text, used for switches, programs or commands
65    C<code>	literal code
66    L<name>     A link (cross reference) to name
67    F<file>     A filename
68
69Although most of the defaults are probably fine for most users,
70you should probably at least skim through this document before
71proceeding.
72
73In addition to this file, check if there is a README file specific to
74your operating system, since it may provide additional or different
75instructions for building Perl.  If there is a hint file for your
76system (in the hints/ directory) you might also want to read it
77for even more information.
78
79For additional information about porting Perl, see the section on
80L<"Porting information"> below, and look at the files in the Porting/
81directory.
82
83=head1 PRELIMINARIES
84
85=head2 Changes and Incompatibilities
86
87Please see pod/perldelta.pod for a description of the changes and
88potential incompatibilities introduced with this release.  A few of
89the most important issues are listed below, but you should refer
90to pod/perldelta.pod for more detailed information.
91
92B<WARNING:> This version is not binary compatible with versions of Perl
93earlier than 5.20.0.
94If you have built extensions (i.e. modules that include C code)
95using an earlier version of Perl, you will need to rebuild and reinstall
96those extensions.
97
98Pure perl modules without XS or C code should continue to work fine
99without reinstallation.  See the discussion below on
100L<"Coexistence with earlier versions of perl 5"> for more details.
101
102The standard extensions supplied with Perl will be handled automatically.
103
104On a related issue, old modules may possibly be affected by the changes
105in the Perl language in the current release.  Please see
106pod/perldelta.pod for a description of what's changed.  See your
107installed copy of the perllocal.pod file for a (possibly incomplete)
108list of locally installed modules.  Also see the L<CPAN> module's
109C<autobundle> function for one way to make a "bundle" of your currently
110installed modules.
111
112=head1 Run Configure
113
114Configure will figure out various things about your system.  Some
115things Configure will figure out for itself, other things it will ask
116you about.  To accept the default, just press RETURN.   The default is
117almost always okay.  It is normal for some things to be "NOT found",
118since Configure often searches for many different ways of performing
119the same function.
120
121At any Configure prompt, you can type  &-d  and Configure will use the
122defaults from then on.
123
124After it runs, Configure will perform variable substitution on all the
125*.SH files and offer to run make depend.
126
127The results of a Configure run are stored in the config.sh and Policy.sh
128files.
129
130=head2 Common Configure options
131
132Configure supports a number of useful options.  Run
133
134	Configure -h
135
136to get a listing.  See the Porting/Glossary file for a complete list of
137Configure variables you can set and their definitions.
138
139=over 4
140
141=item C compiler
142
143To compile with gcc, if it's not the default compiler on your
144system, you should run
145
146	sh Configure -Dcc=gcc
147
148This is the preferred way to specify gcc (or any another alternative
149compiler) so that the hints files can set appropriate defaults.
150
151=item Installation prefix
152
153By default, for most systems, perl will be installed in
154/usr/local/{bin, lib, man}.  (See L<"Installation Directories">
155and L<"Coexistence with earlier versions of perl 5"> below for
156further details.)
157
158You can specify a different 'prefix' for the default installation
159directory when Configure prompts you, or by using the Configure command
160line option -Dprefix='/some/directory', e.g.
161
162	sh Configure -Dprefix=/opt/perl
163
164If your prefix contains the string "perl", then the suggested
165directory structure is simplified.  For example, if you use
166prefix=/opt/perl, then Configure will suggest /opt/perl/lib instead of
167/opt/perl/lib/perl5/.  Again, see L<"Installation Directories"> below
168for more details.  Do not include a trailing slash, (i.e. /opt/perl/)
169or you may experience odd test failures.
170
171NOTE:  You must not specify an installation directory that is the same
172as or below your perl source directory.  If you do, installperl will
173attempt infinite recursion.
174
175=item /usr/bin/perl
176
177It may seem obvious, but Perl is useful only when users can easily
178find it.  It's often a good idea to have both /usr/bin/perl and
179/usr/local/bin/perl be symlinks to the actual binary.  Be especially
180careful, however, not to overwrite a version of perl supplied by your
181vendor unless you are sure you know what you are doing.  If you insist
182on replacing your vendor's perl, useful information on how it was
183configured may be found with
184
185	perl -V:config_args
186
187(Check the output carefully, however, since this doesn't preserve
188spaces in arguments to Configure.  For that, you have to look carefully
189at config_arg1, config_arg2, etc.)
190
191By default, Configure will not try to link /usr/bin/perl to the current
192version of perl.  You can turn on that behavior by running
193
194	Configure -Dinstallusrbinperl
195
196or by answering 'yes' to the appropriate Configure prompt.
197
198In any case, system administrators are strongly encouraged to put
199(symlinks to) perl and its accompanying utilities, such as perldoc,
200into a directory typically found along a user's PATH, or in another
201obvious and convenient place.
202
203=item Building a development release
204
205For development releases (odd subreleases, like 5.9.x) if you want to
206use Configure -d, you will also need to supply -Dusedevel to Configure,
207because the default answer to the question "do you really want to
208Configure a development version?" is "no".  The -Dusedevel skips that
209sanity check.
210
211=back
212
213If you are willing to accept all the defaults, and you want terse
214output, you can run
215
216	sh Configure -des
217
218=head2 Altering Configure variables for C compiler switches etc.
219
220For most users, most of the Configure defaults are fine, or can easily
221be set on the Configure command line.  However, if Configure doesn't
222have an option to do what you want, you can change Configure variables
223after the platform hints have been run by using Configure's -A switch.
224For example, here's how to add a couple of extra flags to C compiler
225invocations:
226
227	sh Configure -Accflags="-DPERL_EXTERNAL_GLOB -DNO_HASH_SEED"
228
229To clarify, those ccflags values are not Configure options; if passed to
230Configure directly, they won't do anything useful (they will define a
231variable in config.sh, but without taking any action based upon it).
232But when passed to the compiler, those flags will activate #ifdefd code.
233
234For more help on Configure switches, run
235
236	sh Configure -h
237
238=head2 Major Configure-time Build Options
239
240There are several different ways to Configure and build perl for your
241system.  For most users, the defaults are sensible and will work.
242Some users, however, may wish to further customize perl.  Here are
243some of the main things you can change.
244
245=head3 Threads
246
247On some platforms, perl can be compiled with support for threads.  To
248enable this, run
249
250	sh Configure -Dusethreads
251
252The default is to compile without thread support.
253
254Perl used to have two different internal threads implementations.  The current
255model (available internally since 5.6, and as a user-level module since 5.8) is
256called interpreter-based implementation (ithreads), with one interpreter per
257thread, and explicit sharing of data.  The (deprecated) 5.005 version
258(5005threads) was removed for release 5.10.
259
260The 'threads' module is for use with the ithreads implementation.  The
261'Thread' module emulates the old 5005threads interface on top of the current
262ithreads model.
263
264When using threads, perl uses a dynamically-sized buffer for some of
265the thread-safe library calls, such as those in the getpw*() family.
266This buffer starts small, but it will keep growing until the result
267fits.  To get a fixed upper limit, you should compile Perl with
268PERL_REENTRANT_MAXSIZE defined to be the number of bytes you want.  One
269way to do this is to run Configure with
270C<-Accflags=-DPERL_REENTRANT_MAXSIZE=65536>.
271
272=head3 Large file support
273
274Since Perl 5.6.0, Perl has supported large files (files larger than
2752 gigabytes), and in many common platforms like Linux or Solaris this
276support is on by default.
277
278This is both good and bad. It is good in that you can use large files,
279seek(), stat(), and -s them.  It is bad in that if you are interfacing Perl
280using some extension, the components you are connecting to must also
281be large file aware: if Perl thinks files can be large but the other
282parts of the software puzzle do not understand the concept, bad things
283will happen.
284
285There's also one known limitation with the current large files
286implementation: unless you also have 64-bit integers (see the next
287section), you cannot use the printf/sprintf non-decimal integer formats
288like C<%x> to print filesizes.  You can use C<%d>, though.
289
290If you want to compile perl without large file support, use
291
292    sh Configure -Uuselargefiles
293
294=head3 64 bit support
295
296If your platform does not run natively at 64 bits, but can simulate
297them with compiler flags and/or C<long long> or C<int64_t>,
298you can build a perl that uses 64 bits.
299
300There are actually two modes of 64-bitness: the first one is achieved
301using Configure -Duse64bitint and the second one using Configure
302-Duse64bitall.  The difference is that the first one is minimal and
303the second one maximal.  The first works in more places than the second.
304
305The C<use64bitint> option does only as much as is required to get
30664-bit integers into Perl (this may mean, for example, using "long
307longs") while your memory may still be limited to 2 gigabytes (because
308your pointers could still be 32-bit).  Note that the name C<64bitint>
309does not imply that your C compiler will be using 64-bit C<int>s (it
310might, but it doesn't have to).  The C<use64bitint> simply means that
311you will be able to have 64 bit-wide scalar values.
312
313The C<use64bitall> option goes all the way by attempting to switch
314integers (if it can), longs (and pointers) to being 64-bit.  This may
315create an even more binary incompatible Perl than -Duse64bitint: the
316resulting executable may not run at all in a 32-bit box, or you may
317have to reboot/reconfigure/rebuild your operating system to be 64-bit
318aware.
319
320Natively 64-bit systems need neither -Duse64bitint nor -Duse64bitall.
321On these systems, it might be the default compilation mode, and there
322is currently no guarantee that passing no use64bitall option to the
323Configure process will build a 32bit perl. Implementing -Duse32bit*
324options is planned for a future release of perl.
325
326=head3 Long doubles
327
328In some systems you may be able to use long doubles to enhance the
329range and precision of your double precision floating point numbers
330(that is, Perl's numbers).  Use Configure -Duselongdouble to enable
331this support (if it is available).
332
333=head3 "more bits"
334
335You can "Configure -Dusemorebits" to turn on both the 64-bit support
336and the long double support.
337
338=head3 Algorithmic Complexity Attacks on Hashes
339
340Perl 5.18 reworked the measures used to secure its hash function
341from algorithmic complexity attacks.  By default it will build with
342all of these measures enabled along with support for controlling and
343disabling them via environment variables.
344
345You can override various aspects of this feature by defining various
346symbols during configure. An example might be:
347
348    Configure -Accflags=-DPERL_HASH_FUNC_SIPHASH
349
350B<Unless stated otherwise these options are considered experimental or
351insecure and are not recommended for production use.>
352
353Perl 5.18 includes support for multiple hash functions, and changed
354the default (to ONE_AT_A_TIME_HARD), you can choose a different
355algorithm by defining one of the following symbols. Note that as of
356Perl 5.18 we can only recommend use of the default or SIPHASH. All
357the others are known to have security issues and are for research
358purposes only.
359
360    PERL_HASH_FUNC_SIPHASH
361    PERL_HASH_FUNC_SDBM
362    PERL_HASH_FUNC_DJB2
363    PERL_HASH_FUNC_SUPERFAST
364    PERL_HASH_FUNC_MURMUR3
365    PERL_HASH_FUNC_ONE_AT_A_TIME
366    PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
367    PERL_HASH_FUNC_ONE_AT_A_TIME_OLD
368
369Perl 5.18 randomizes the order returned by keys(), values(), and each(),
370and allows controlling this behavior by using of the PERL_PERTURB_KEYS
371option. You can disable this option entirely with the define:
372
373    PERL_PERTURB_KEYS_DISABLED
374
375You can disable the environment variable checks and specify the type of
376key traversal randomization to be used by defining one of these:
377
378    PERL_PERTURB_KEYS_RANDOM
379    PERL_PERTURB_KEYS_DETERMINISTIC
380
381In Perl 5.18 the seed used for the hash function is randomly selected
382at process start which can be overridden by specifying a seed by setting
383the PERL_HASH_SEED environment variable.
384
385You can change this behavior by building perl with the
386
387   USE_HASH_SEED_EXPLICIT
388
389define, in which case one has to explicitly set the PERL_HASH_SEED
390environment variable to enable the security feature or by adding
391
392    NO_HASH_SEED
393
394to the compilation flags to completely disable the randomisation feature.
395Note these modes are poorly tested, insecure and not recommended.
396
397B<Perl has never guaranteed any ordering of the hash keys>, and the
398ordering has already changed several times during the lifetime of Perl
3995.  Also, the ordering of hash keys has always been, and continues to
400be, affected by the insertion order.  Note that because of this
401randomisation for example the Data::Dumper results will be different
402between different runs of Perl, since Data::Dumper by default dumps
403hashes "unordered".  The use of the Data::Dumper C<Sortkeys> option is
404recommended.
405
406See L<perlrun/PERL_HASH_SEED> and L<perlrun/PERL_PERTURB_KEYS> for details on
407the environment variables, and L<perlsec/Algorithmic Complexity Attacks> for
408further security details.
409
410=head3 SOCKS
411
412Perl can be configured to be 'socksified', that is, to use the SOCKS
413TCP/IP proxy protocol library.  SOCKS is used to give applications
414access to transport layer network proxies.  Perl supports only SOCKS
415Version 5.  The corresponding Configure option is -Dusesocks.
416You can find more about SOCKS from wikipedia at
417L<http://en.wikipedia.org/wiki/SOCKS>.
418
419=head3 Dynamic Loading
420
421By default, Configure will compile perl to use dynamic loading.
422If you want to force perl to be compiled completely
423statically, you can either choose this when Configure prompts you or
424you can use the Configure command line option -Uusedl.
425With this option, you won't be able to use any new extension
426(XS) module without recompiling perl itself.
427
428=head3 Building a shared Perl library
429
430Currently, for most systems, the main perl executable is built by
431linking the "perl library" libperl.a with perlmain.o, your static
432extensions, and various extra libraries, such as -lm.
433
434On systems that support dynamic loading, it may be possible to
435replace libperl.a with a shared libperl.so.  If you anticipate building
436several different perl binaries (e.g. by embedding libperl into
437different programs, or by using the optional compiler extension), then
438you might wish to build a shared libperl.so so that all your binaries
439can share the same library.
440
441The disadvantages are that there may be a significant performance
442penalty associated with the shared libperl.so, and that the overall
443mechanism is still rather fragile with respect to different versions
444and upgrades.
445
446In terms of performance, on my test system (Solaris 2.5_x86) the perl
447test suite took roughly 15% longer to run with the shared libperl.so.
448Your system and typical applications may well give quite different
449results.
450
451The default name for the shared library is typically something like
452libperl.so.5.8.8 (for Perl 5.8.8), or libperl.so.588, or simply
453libperl.so.  Configure tries to guess a sensible naming convention
454based on your C library name.  Since the library gets installed in a
455version-specific architecture-dependent directory, the exact name
456isn't very important anyway, as long as your linker is happy.
457
458You can elect to build a shared libperl by
459
460	sh Configure -Duseshrplib
461
462To build a shared libperl, the environment variable controlling shared
463library search (LD_LIBRARY_PATH in most systems, DYLD_LIBRARY_PATH for
464NeXTSTEP/OPENSTEP/Darwin, LD_LIBRARY_PATH/SHLIB_PATH
465for HP-UX, LIBPATH for AIX, PATH for Cygwin) must be set up to include
466the Perl build directory because that's where the shared libperl will
467be created.  Configure arranges makefile to have the correct shared
468library search settings.  You can find the name of the environment
469variable Perl thinks works in your your system by
470
471	grep ldlibpthname config.sh
472
473However, there are some special cases where manually setting the
474shared library path might be required.  For example, if you want to run
475something like the following with the newly-built but not-yet-installed
476./perl:
477
478        ./perl -MTestInit t/misc/failing_test.t
479
480or
481
482        ./perl -Ilib ~/my_mission_critical_test
483
484then you need to set up the shared library path explicitly.
485You can do this with
486
487   LD_LIBRARY_PATH=`pwd`:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
488
489for Bourne-style shells, or
490
491   setenv LD_LIBRARY_PATH `pwd`
492
493for Csh-style shells.  (This procedure may also be needed if for some
494unexpected reason Configure fails to set up makefile correctly.) (And
495again, it may be something other than LD_LIBRARY_PATH for you, see above.)
496
497You can often recognize failures to build/use a shared libperl from error
498messages complaining about a missing libperl.so (or libperl.sl in HP-UX),
499for example:
500
501    18126:./miniperl: /sbin/loader: Fatal Error: cannot map libperl.so
502
503There is also an potential problem with the shared perl library if you
504want to have more than one "flavor" of the same version of perl (e.g.
505with and without -DDEBUGGING).  For example, suppose you build and
506install a standard Perl 5.10.0 with a shared library.  Then, suppose you
507try to build Perl 5.10.0 with -DDEBUGGING enabled, but everything else
508the same, including all the installation directories.  How can you
509ensure that your newly built perl will link with your newly built
510libperl.so.8 rather with the installed libperl.so.8?  The answer is
511that you might not be able to.  The installation directory is encoded
512in the perl binary with the LD_RUN_PATH environment variable (or
513equivalent ld command-line option).  On Solaris, you can override that
514with LD_LIBRARY_PATH; on Linux, you can only override at runtime via
515LD_PRELOAD, specifying the exact filename you wish to be used; and on
516Digital Unix, you can override LD_LIBRARY_PATH by setting the
517_RLD_ROOT environment variable to point to the perl build directory.
518
519In other words, it is generally not a good idea to try to build a perl
520with a shared library if $archlib/CORE/$libperl already exists from a
521previous build.
522
523A good workaround is to specify a different directory for the
524architecture-dependent library for your -DDEBUGGING version of perl.
525You can do this by changing all the *archlib* variables in config.sh to
526point to your new architecture-dependent library.
527
528=head3 Environment access
529
530Perl often needs to write to the program's environment, such as when C<%ENV>
531is assigned to. Many implementations of the C library function C<putenv()>
532leak memory, so where possible perl will manipulate the environment directly
533to avoid these leaks. The default is now to perform direct manipulation
534whenever perl is running as a stand alone interpreter, and to call the safe
535but potentially leaky C<putenv()> function when the perl interpreter is
536embedded in another application. You can force perl to always use C<putenv()>
537by compiling with C<-Accflags="-DPERL_USE_SAFE_PUTENV">, see section
538L</"Altering Configure variables for C compiler switches etc.">.
539You can force an embedded perl to use direct manipulation by setting
540C<PL_use_safe_putenv = 0;> after the C<perl_construct()> call.
541
542=head2 Installation Directories
543
544The installation directories can all be changed by answering the
545appropriate questions in Configure.  For convenience, all the installation
546questions are near the beginning of Configure.  Do not include trailing
547slashes on directory names.  At any point during the Configure process,
548you can answer a question with  &-d  and Configure will use the defaults
549from then on.  Alternatively, you can
550
551	grep '^install' config.sh
552
553after Configure has run to verify the installation paths.
554
555The defaults are intended to be reasonable and sensible for most
556people building from sources.  Those who build and distribute binary
557distributions or who export perl to a range of systems will probably
558need to alter them.  If you are content to just accept the defaults,
559you can safely skip the next section.
560
561The directories set up by Configure fall into three broad categories.
562
563=over 4
564
565=item Directories for the perl distribution
566
567By default, Configure will use the following directories for 5.20.2.
568$version is the full perl version number, including subversion, e.g.
5695.12.3, and $archname is a string like sun4-sunos,
570determined by Configure.  The full definitions of all Configure
571variables are in the file Porting/Glossary.
572
573    Configure variable	Default value
574    $prefixexp		/usr/local
575    $binexp		$prefixexp/bin
576    $scriptdirexp	$prefixexp/bin
577    $privlibexp		$prefixexp/lib/perl5/$version
578    $archlibexp		$prefixexp/lib/perl5/$version/$archname
579    $man1direxp		$prefixexp/man/man1
580    $man3direxp		$prefixexp/man/man3
581    $html1direxp	(none)
582    $html3direxp	(none)
583
584$prefixexp is generated from $prefix, with ~ expansion done to convert home
585directories into absolute paths. Similarly for the other variables listed. As
586file system calls do not do this, you should always reference the ...exp
587variables, to support users who build perl in their home directory.
588
589Actually, Configure recognizes the SVR3-style
590/usr/local/man/l_man/man1 directories, if present, and uses those
591instead.  Also, if $prefix contains the string "perl", the library
592directories are simplified as described below.  For simplicity, only
593the common style is shown here.
594
595=item Directories for site-specific add-on files
596
597After perl is installed, you may later wish to add modules (e.g. from
598CPAN) or scripts.  Configure will set up the following directories to
599be used for installing those add-on modules and scripts.
600
601   Configure        Default
602   variable          value
603 $siteprefixexp    $prefixexp
604 $sitebinexp       $siteprefixexp/bin
605 $sitescriptexp    $siteprefixexp/bin
606 $sitelibexp       $siteprefixexp/lib/perl5/site_perl/$version
607 $sitearchexp
608               $siteprefixexp/lib/perl5/site_perl/$version/$archname
609 $siteman1direxp   $siteprefixexp/man/man1
610 $siteman3direxp   $siteprefixexp/man/man3
611 $sitehtml1direxp  (none)
612 $sitehtml3direxp  (none)
613
614By default, ExtUtils::MakeMaker will install architecture-independent
615modules into $sitelib and architecture-dependent modules into $sitearch.
616
617=item Directories for vendor-supplied add-on files
618
619Lastly, if you are building a binary distribution of perl for
620distribution, Configure can optionally set up the following directories
621for you to use to distribute add-on modules.
622
623   Configure          Default
624   variable            value
625 $vendorprefixexp    (none)
626
627 (The next ones are set only if vendorprefix is set.)
628
629 $vendorbinexp       $vendorprefixexp/bin
630 $vendorscriptexp    $vendorprefixexp/bin
631 $vendorlibexp       $vendorprefixexp/lib/perl5/vendor_perl/$version
632 $vendorarchexp
633           $vendorprefixexp/lib/perl5/vendor_perl/$version/$archname
634 $vendorman1direxp   $vendorprefixexp/man/man1
635 $vendorman3direxp   $vendorprefixexp/man/man3
636 $vendorhtml1direxp  (none)
637 $vendorhtml3direxp  (none)
638
639These are normally empty, but may be set as needed.  For example,
640a vendor might choose the following settings:
641
642 $prefix           /usr
643 $siteprefix       /usr/local
644 $vendorprefix     /usr
645
646This would have the effect of setting the following:
647
648 $binexp           /usr/bin
649 $scriptdirexp     /usr/bin
650 $privlibexp       /usr/lib/perl5/$version
651 $archlibexp       /usr/lib/perl5/$version/$archname
652 $man1direxp       /usr/man/man1
653 $man3direxp       /usr/man/man3
654
655 $sitebinexp       /usr/local/bin
656 $sitescriptexp    /usr/local/bin
657 $sitelibexp       /usr/local/lib/perl5/site_perl/$version
658 $sitearchexp      /usr/local/lib/perl5/site_perl/$version/$archname
659 $siteman1direxp   /usr/local/man/man1
660 $siteman3direxp   /usr/local/man/man3
661
662 $vendorbinexp     /usr/bin
663 $vendorscriptexp  /usr/bin
664 $vendorlibexp     /usr/lib/perl5/vendor_perl/$version
665 $vendorarchexp    /usr/lib/perl5/vendor_perl/$version/$archname
666 $vendorman1direxp /usr/man/man1
667 $vendorman3direxp /usr/man/man3
668
669Note how in this example, the vendor-supplied directories are in the
670/usr hierarchy, while the directories reserved for the end user are in
671the /usr/local hierarchy.
672
673The entire installed library hierarchy is installed in locations with
674version numbers, keeping the installations of different versions distinct.
675However, later installations of Perl can still be configured to search the
676installed libraries corresponding to compatible earlier versions.
677See L<"Coexistence with earlier versions of perl 5"> below for more details
678on how Perl can be made to search older version directories.
679
680Of course you may use these directories however you see fit.  For
681example, you may wish to use $siteprefix for site-specific files that
682are stored locally on your own disk and use $vendorprefix for
683site-specific files that are stored elsewhere on your organization's
684network.  One way to do that would be something like
685
686 sh Configure -Dsiteprefix=/usr/local -Dvendorprefix=/usr/share/perl
687
688=item otherlibdirs
689
690As a final catch-all, Configure also offers an $otherlibdirs
691variable.  This variable contains a colon-separated list of additional
692directories to add to @INC.  By default, it will be empty.
693Perl will search these directories (including architecture and
694version-specific subdirectories) for add-on modules and extensions.
695
696For example, if you have a bundle of perl libraries from a previous
697installation, perhaps in a strange place:
698
699	Configure -Dotherlibdirs=/usr/lib/perl5/site_perl/5.8.1
700
701=item APPLLIB_EXP
702
703There is one other way of adding paths to @INC at perl build time, and
704that is by setting the APPLLIB_EXP C pre-processor token to a colon-
705separated list of directories, like this
706
707       sh Configure -Accflags='-DAPPLLIB_EXP=\"/usr/libperl\"'
708
709The directories defined by APPLLIB_EXP get added to @INC I<first>,
710ahead of any others, and so provide a way to override the standard perl
711modules should you, for example, want to distribute fixes without
712touching the perl distribution proper.  And, like otherlib dirs,
713version and architecture specific subdirectories are also searched, if
714present, at run time.  Of course, you can still search other @INC
715directories ahead of those in APPLLIB_EXP by using any of the standard
716run-time methods: $PERLLIB, $PERL5LIB, -I, use lib, etc.
717
718=item usesitecustomize
719
720Run-time customization of @INC can be enabled with:
721
722	sh Configure -Dusesitecustomize
723
724which will define USE_SITECUSTOMIZE and $Config{usesitecustomize}.
725When enabled, this makes perl run F<$sitelibexp/sitecustomize.pl> before
726anything else.  This script can then be set up to add additional
727entries to @INC.
728
729=item Man Pages
730
731By default, man pages will be installed in $man1dir and $man3dir, which
732are normally /usr/local/man/man1 and /usr/local/man/man3.  If you
733want to use a .3pm suffix for perl man pages, you can do that with
734
735	sh Configure -Dman3ext=3pm
736
737=item HTML pages
738
739Currently, the standard perl installation does not do anything with
740HTML documentation, but that may change in the future.  Further, some
741add-on modules may wish to install HTML documents.  The html Configure
742variables listed above are provided if you wish to specify where such
743documents should be placed.  The default is "none", but will likely
744eventually change to something useful based on user feedback.
745
746=back
747
748Some users prefer to append a "/share" to $privlib and $sitelib
749to emphasize that those directories can be shared among different
750architectures.
751
752Note that these are just the defaults.  You can actually structure the
753directories any way you like.  They don't even have to be on the same
754filesystem.
755
756Further details about the installation directories, maintenance and
757development subversions, and about supporting multiple versions are
758discussed in L<"Coexistence with earlier versions of perl 5"> below.
759
760If you specify a prefix that contains the string "perl", then the
761library directory structure is slightly simplified.  Instead of
762suggesting $prefix/lib/perl5/, Configure will suggest $prefix/lib.
763
764Thus, for example, if you Configure with
765-Dprefix=/opt/perl, then the default library directories for 5.9.0 are
766
767    Configure variable	Default value
768	$privlib	/opt/perl/lib/5.9.0
769	$archlib	/opt/perl/lib/5.9.0/$archname
770	$sitelib	/opt/perl/lib/site_perl/5.9.0
771	$sitearch	/opt/perl/lib/site_perl/5.9.0/$archname
772
773=head2 Changing the installation directory
774
775Configure distinguishes between the directory in which perl (and its
776associated files) should be installed, and the directory in which it
777will eventually reside.  For most sites, these two are the same; for
778sites that use AFS, this distinction is handled automatically.
779However, sites that use package management software such as rpm or
780dpkg, or users building binary packages for distribution may also
781wish to install perl into a different directory before moving perl
782to its final destination.  There are two ways to do that:
783
784=over 4
785
786=item installprefix
787
788To install perl under the /tmp/perl5 directory, use the following
789command line:
790
791    sh Configure -Dinstallprefix=/tmp/perl5
792
793(replace /tmp/perl5 by a directory of your choice).
794
795Beware, though, that if you go to try to install new add-on
796modules, they too will get installed in under '/tmp/perl5' if you
797follow this example.  That's why it's usually better to use DESTDIR,
798as shown in the next section.
799
800=item DESTDIR
801
802If you need to install perl on many identical systems, it is convenient
803to compile it once and create an archive that can be installed on
804multiple systems.  Suppose, for example, that you want to create an
805archive that can be installed in /opt/perl.  One way to do that is by
806using the DESTDIR variable during C<make install>.  The DESTDIR is
807automatically prepended to all the installation paths.  Thus you
808simply do:
809
810    sh Configure -Dprefix=/opt/perl -des
811    make
812    make test
813    make install DESTDIR=/tmp/perl5
814    cd /tmp/perl5/opt/perl
815    tar cvf /tmp/perl5-archive.tar .
816
817=back
818
819=head2 Relocatable @INC
820
821To create a relocatable perl tree, use the following command line:
822
823    sh Configure -Duserelocatableinc
824
825Then the paths in @INC (and everything else in %Config) can be
826optionally located via the path of the perl executable.
827
828That means that, if the string ".../" is found at the start of any
829path, it's substituted with the directory of $^X. So, the relocation
830can be configured on a per-directory basis, although the default with
831"-Duserelocatableinc" is that everything is relocated. The initial
832install is done to the original configured prefix.
833
834This option is not compatible with the building of a shared libperl
835("-Duseshrplib"), because in that case perl is linked with an hard-coded
836rpath that points at the libperl.so, that cannot be relocated.
837
838=head2 Site-wide Policy settings
839
840After Configure runs, it stores a number of common site-wide "policy"
841answers (such as installation directories) in the Policy.sh file.
842If you want to build perl on another system using the same policy
843defaults, simply copy the Policy.sh file to the new system's perl build
844directory, and Configure will use it. This will work even if Policy.sh was
845generated for another version of Perl, or on a system with a
846different architecture and/or operating system. However, in such cases,
847you should review the contents of the file before using it: for
848example, your new target may not keep its man pages in the same place
849as the system on which the file was generated.
850
851Alternatively, if you wish to change some or all of those policy
852answers, you should
853
854	rm -f Policy.sh
855
856to ensure that Configure doesn't re-use them.
857
858Further information is in the Policy_sh.SH file itself.
859
860If the generated Policy.sh file is unsuitable, you may freely edit it
861to contain any valid shell commands.  It will be run just after the
862platform-specific hints files.
863
864=head2 Disabling older versions of Perl
865
866Configure will search for binary compatible versions of previously
867installed perl binaries in the tree that is specified as target tree,
868and these will be used as locations to search for modules by the perl
869being built. The list of perl versions found will be put in the Configure
870variable inc_version_list.
871
872To disable this use of older perl modules, even completely valid pure perl
873modules, you can specify to not include the paths found:
874
875       sh Configure -Dinc_version_list=none ...
876
877If you do want to use modules from some previous perl versions, the variable
878must contain a space separated list of directories under the site_perl
879directory, and has to include architecture-dependent directories separately,
880eg.
881
882       sh Configure -Dinc_version_list="5.16.0/x86_64-linux 5.16.0" ...
883
884When using the newer perl, you can add these paths again in the
885PERL5LIB environment variable or with perl's -I runtime option.
886
887=head2 Building Perl outside of the source directory
888
889Sometimes it is desirable to build Perl in a directory different from
890where the sources are, for example if you want to keep your sources
891read-only, or if you want to share the sources between different binary
892architectures.  You can do this (if your file system supports symbolic
893links) by
894
895	mkdir /tmp/perl/build/directory
896	cd /tmp/perl/build/directory
897	sh /path/to/perl/source/Configure -Dmksymlinks ...
898
899This will create in /tmp/perl/build/directory a tree of symbolic links
900pointing to files in /path/to/perl/source.  The original files are left
901unaffected.  After Configure has finished you can just say
902
903	make
904	make test
905	make install
906
907as usual, and Perl will be built in /tmp/perl/build/directory.
908
909=head2 Building a debugging perl
910
911You can run perl scripts under the perl debugger at any time with
912B<perl -d your_script>.  If, however, you want to debug perl itself,
913you probably want to have support for perl internal debugging code
914(activated by adding -DDEBUGGING to ccflags), and/or support for the
915system debugger by adding -g to the optimisation flags. For that,
916use the parameter:
917
918	sh Configure -DDEBUGGING
919
920or
921
922	sh Configure -DDEBUGGING=<mode>
923
924For a more eye appealing call, -DEBUGGING is defined to be an alias
925for -DDEBUGGING. For both, the -U calls are also supported, in order
926to be able to overrule the hints or Policy.sh settings.
927
928Here are the DEBUGGING modes:
929
930=over 4
931
932=item -DDEBUGGING
933
934=item -DEBUGGING
935
936=item -DEBUGGING=both
937
938Sets both -DDEBUGGING in the ccflags, and adds -g to optimize.
939
940You can actually specify -g and -DDEBUGGING independently (see below),
941but usually it's convenient to have both.
942
943=item -DEBUGGING=-g
944
945=item -Doptimize=-g
946
947Adds -g to optimize, but does not set -DDEBUGGING.
948
949(Note:  Your system may actually require something like cc -g2.
950Check your man pages for cc(1) and also any hint file for your system.)
951
952=item -DEBUGGING=none
953
954=item -UDEBUGGING
955
956Removes -g from optimize, and -DDEBUGGING from ccflags.
957
958=back
959
960If you are using a shared libperl, see the warnings about multiple
961versions of perl under L<Building a shared Perl library>.
962
963Note that a perl built with -DDEBUGGING will be much bigger and will run
964much, much more slowly than a standard perl.
965
966=head2 DTrace support
967
968On platforms where DTrace is available, it may be enabled by
969using the -Dusedtrace option to Configure. DTrace probes are available for
970subroutine entry (sub-entry) and subroutine exit (sub-exit). Here's a
971simple D script that uses them:
972
973  perl$target:::sub-entry, perl$target:::sub-return {
974    printf("%s %s (%s:%d)\n", probename == "sub-entry" ? "->" : "<-",
975              copyinstr(arg0), copyinstr(arg1), arg2);
976  }
977
978
979=head2 Extensions
980
981Perl ships with a number of standard extensions.  These are contained
982in the ext/ subdirectory.
983
984By default, Configure will offer to build every extension which appears
985to be supported.  For example, Configure will offer to build GDBM_File
986only if it is able to find the gdbm library.
987
988To disable certain extensions so that they are not built, use the
989-Dnoextensions=... and -Donlyextensions=... options.  They both accept
990a space-separated list of extensions, such as C<IPC/SysV>. The extensions
991listed in
992C<noextensions> are removed from the list of extensions to build, while
993the C<onlyextensions> is rather more severe and builds only the listed
994extensions.  The latter should be used with extreme caution since
995certain extensions are used by many other extensions and modules:
996examples of such modules include Fcntl and IO.  The order of processing
997these options is first C<only> (if present), then C<no> (if present).
998
999Of course, you may always run Configure interactively and select only
1000the extensions you want.
1001
1002If you unpack any additional extensions in the ext/ directory before
1003running Configure, then Configure will offer to build those additional
1004extensions as well.  Most users probably shouldn't have to do this --
1005it is usually easier to build additional extensions later after perl
1006has been installed.  However, if you wish to have those additional
1007extensions statically linked into the perl binary, then this offers a
1008convenient way to do that in one step.  (It is not necessary, however;
1009you can build and install extensions just fine even if you don't have
1010dynamic loading.  See lib/ExtUtils/MakeMaker.pm for more details.)
1011Another way of specifying extra modules is described in
1012L<"Adding extra modules to the build"> below.
1013
1014If you re-use an old config.sh but change your system (e.g. by
1015adding libgdbm) Configure will still offer your old choices of extensions
1016for the default answer, but it will also point out the discrepancy to
1017you.
1018
1019=head2 Including locally-installed libraries
1020
1021Perl comes with interfaces to number of libraries, including threads,
1022dbm, ndbm, gdbm, and Berkeley db.  For the *db* extension, if
1023Configure can find the appropriate header files and libraries, it will
1024automatically include that extension.  The threading extension needs
1025to be specified explicitly (see L</Threads>).
1026
1027Those libraries are not distributed with perl. If your header (.h) files
1028for those libraries are not in a directory normally searched by your C
1029compiler, then you will need to include the appropriate -I/your/directory
1030option when prompted by Configure.  If your libraries are not in a
1031directory normally searched by your C compiler and linker, then you will
1032need to include the appropriate -L/your/directory option when prompted
1033by Configure. See the examples below.
1034
1035=head3 Examples
1036
1037=over 4
1038
1039=item gdbm in /usr/local
1040
1041Suppose you have gdbm and want Configure to find it and build the
1042GDBM_File extension.  This example assumes you have gdbm.h
1043installed in /usr/local/include/gdbm.h and libgdbm.a installed in
1044/usr/local/lib/libgdbm.a.  Configure should figure all the
1045necessary steps out automatically.
1046
1047Specifically, when Configure prompts you for flags for
1048your C compiler, you should include -I/usr/local/include, if it's
1049not here yet. Similarly, when Configure prompts you for linker flags,
1050you should include -L/usr/local/lib.
1051
1052If you are using dynamic loading, then when Configure prompts you for
1053linker flags for dynamic loading, you should again include
1054-L/usr/local/lib.
1055
1056Again, this should all happen automatically.  This should also work if
1057you have gdbm installed in any of (/usr/local, /opt/local, /usr/gnu,
1058/opt/gnu, /usr/GNU, or /opt/GNU).
1059
1060=item BerkeleyDB in /usr/local/BerkeleyDB
1061
1062The version of BerkeleyDB distributed by Oracle installs in a
1063version-specific directory by default, typically something like
1064/usr/local/BerkeleyDB.4.7.  To have Configure find that, you need to add
1065-I/usr/local/BerkeleyDB.4.7/include to cc flags, as in the previous example,
1066and you will also have to take extra steps to help Configure find -ldb.
1067Specifically, when Configure prompts you for library directories,
1068add /usr/local/BerkeleyDB.4.7/lib to the list.  Also, you will need to
1069add appropriate linker flags to tell the runtime linker where to find the
1070BerkeleyDB shared libraries.
1071
1072It is possible to specify this from the command line (all on one
1073line):
1074
1075 sh Configure -de \
1076    -Dlocincpth='/usr/local/BerkeleyDB.4.7/include             \
1077                                           /usr/local/include' \
1078    -Dloclibpth='/usr/local/BerkeleyDB.4.7/lib /usr/local/lib' \
1079    -Aldflags='-R/usr/local/BerkeleyDB.4.7/lib'
1080
1081locincpth is a space-separated list of include directories to search.
1082Configure will automatically add the appropriate -I directives.
1083
1084loclibpth is a space-separated list of library directories to search.
1085Configure will automatically add the appropriate -L directives.
1086
1087The addition to ldflags is so that the dynamic linker knows where to find
1088the BerkeleyDB libraries.  For Linux and Solaris, the -R option does that.
1089Other systems may use different flags.  Use the appropriate flag for your
1090system.
1091
1092=back
1093
1094=head2 Specifying a logical root directory
1095
1096If you are cross-compiling, or are using a compiler which has it's own
1097headers and libraries in a nonstandard location, and your compiler
1098understands the C<--sysroot> option, you can use the C<-Dsysroot> option to
1099specify the logical root directory under which all libraries and headers
1100are searched for. This patch adjusts Configure to search under $sysroot, instead of /.
1101
1102--sysroot is added to ccflags and friends so that make in
1103ExtUtils::MakeMaker, and other extensions, will use it.
1104
1105=head2 Overriding an old config.sh
1106
1107If you want to use an old config.sh produced by a previous run of
1108Configure, but override some of the items with command line options, you
1109need to use B<Configure -O>.
1110
1111=head2 GNU-style configure
1112
1113If you prefer the GNU-style configure command line interface, you can
1114use the supplied configure.gnu command, e.g.
1115
1116	CC=gcc ./configure.gnu
1117
1118The configure.gnu script emulates a few of the more common configure
1119options.  Try
1120
1121	./configure.gnu --help
1122
1123for a listing.
1124
1125(The file is called configure.gnu to avoid problems on systems
1126that would not distinguish the files "Configure" and "configure".)
1127
1128=head2 Malloc Issues
1129
1130Perl relies heavily on malloc(3) to grow data structures as needed,
1131so perl's performance can be noticeably affected by the performance of
1132the malloc function on your system.  The perl source is shipped with a
1133version of malloc that has been optimized for the typical requests from
1134perl, so there's a chance that it may be both faster and use less memory
1135than your system malloc.
1136
1137However, if your system already has an excellent malloc, or if you are
1138experiencing difficulties with extensions that use third-party libraries
1139that call malloc, then you should probably use your system's malloc.
1140(Or, you might wish to explore the malloc flags discussed below.)
1141
1142=over 4
1143
1144=item Using the system malloc
1145
1146To build without perl's malloc, you can use the Configure command
1147
1148	sh Configure -Uusemymalloc
1149
1150or you can answer 'n' at the appropriate interactive Configure prompt.
1151
1152Note that Perl's malloc isn't always used by default; that actually
1153depends on your system. For example, on Linux and FreeBSD (and many more
1154systems), Configure chooses to use the system's malloc by default.
1155See the appropriate file in the F<hints/> directory to see how the
1156default is set.
1157
1158=item -DPERL_POLLUTE_MALLOC
1159
1160NOTE: This flag is enabled automatically on some platforms if you just
1161run Configure to accept all the defaults.
1162
1163Perl's malloc family of functions are normally called Perl_malloc(),
1164Perl_realloc(), Perl_calloc() and Perl_mfree().
1165These names do not clash with the system versions of these functions.
1166
1167If this flag is enabled, however, Perl's malloc family of functions
1168will have the same names as the system versions.  This may be required
1169sometimes if you have libraries that like to free() data that may have
1170been allocated by Perl_malloc() and vice versa.
1171
1172Note that enabling this option may sometimes lead to duplicate symbols
1173from the linker for malloc et al.  In such cases, the system probably
1174does not allow its malloc functions to be fully replaced with custom
1175versions.
1176
1177=item -DPERL_DEBUGGING_MSTATS
1178
1179This flag enables debugging mstats, which is required to use the
1180Devel::Peek::mstat() function. You cannot enable this unless you are
1181using Perl's malloc, so a typical Configure command would be
1182
1183       sh Configure -Accflags=-DPERL_DEBUGGING_MSTATS -Dusemymalloc
1184
1185to enable this option.
1186
1187=back
1188
1189=head2 What if it doesn't work?
1190
1191If you run into problems, try some of the following ideas.
1192If none of them help, then see L<"Reporting Problems"> below.
1193
1194=over 4
1195
1196=item Running Configure Interactively
1197
1198If Configure runs into trouble, remember that you can always run
1199Configure interactively so that you can check (and correct) its
1200guesses.
1201
1202All the installation questions have been moved to the top, so you don't
1203have to wait for them.  Once you've handled them (and your C compiler and
1204flags) you can type  &-d  at the next Configure prompt and Configure
1205will use the defaults from then on.
1206
1207If you find yourself trying obscure command line incantations and
1208config.over tricks, I recommend you run Configure interactively
1209instead.  You'll probably save yourself time in the long run.
1210
1211=item Hint files
1212
1213Hint files tell Configure about a number of things:
1214
1215=over 4
1216
1217=item o
1218
1219The peculiarities or conventions of particular platforms -- non-standard
1220library locations and names, default installation locations for binaries,
1221and so on.
1222
1223=item o
1224
1225The deficiencies of the platform -- for example, library functions that,
1226although present, are too badly broken to be usable; or limits on
1227resources that are generously available on most platforms.
1228
1229=item o
1230
1231How best to optimize for the platform, both in terms of binary size and/or
1232speed, and for Perl feature support. Because of wide variations in the
1233implementation of shared libraries and of threading, for example, Configure
1234often needs hints in order to be able to use these features.
1235
1236=back
1237
1238The perl distribution includes many system-specific hints files
1239in the hints/ directory. If one of them matches your system, Configure
1240will offer to use that hint file. Unless you have a very good reason
1241not to, you should accept its offer.
1242
1243Several of the hint files contain additional important information.
1244If you have any problems, it is a good idea to read the relevant hint file
1245for further information.  See hints/solaris_2.sh for an extensive example.
1246More information about writing good hints is in the hints/README.hints
1247file, which also explains hint files known as callback-units.
1248
1249Note that any hint file is read before any Policy file, meaning that
1250Policy overrides hints -- see L</Site-wide Policy settings>.
1251
1252=item WHOA THERE!!!
1253
1254If you are re-using an old config.sh, it's possible that Configure detects
1255different values from the ones specified in this file.  You will almost
1256always want to keep the previous value, unless you have changed something
1257on your system.
1258
1259For example, suppose you have added libgdbm.a to your system
1260and you decide to reconfigure perl to use GDBM_File.  When you run
1261Configure again, you will need to add -lgdbm to the list of libraries.
1262Now, Configure will find your gdbm include file and library and will
1263issue a message:
1264
1265    *** WHOA THERE!!! ***
1266	The previous value for $i_gdbm on this machine was "undef"!
1267	Keep the previous value? [y]
1268
1269In this case, you do not want to keep the previous value, so you
1270should answer 'n'.  (You'll also have to manually add GDBM_File to
1271the list of dynamic extensions to build.)
1272
1273=item Changing Compilers
1274
1275If you change compilers or make other significant changes, you should
1276probably not re-use your old config.sh.  Simply remove it or
1277rename it, then rerun Configure with the options you want to use.
1278
1279=item Propagating your changes to config.sh
1280
1281If you make any changes to config.sh, you should propagate
1282them to all the .SH files by running
1283
1284	sh Configure -S
1285
1286You will then have to rebuild by running
1287
1288	make depend
1289	make
1290
1291=item config.over and config.arch
1292
1293You can also supply a shell script config.over to override
1294Configure's guesses.  It will get loaded up at the very end, just
1295before config.sh is created.  You have to be careful with this,
1296however, as Configure does no checking that your changes make sense.
1297This file is usually good for site-specific customizations.
1298
1299There is also another file that, if it exists, is loaded before the
1300config.over, called config.arch.  This file is intended to be per
1301architecture, not per site, and usually it's the architecture-specific
1302hints file that creates the config.arch.
1303
1304=item config.h
1305
1306Many of the system dependencies are contained in config.h.
1307Configure builds config.h by running the config_h.SH script.
1308The values for the variables are taken from config.sh.
1309
1310If there are any problems, you can edit config.h directly.  Beware,
1311though, that the next time you run Configure, your changes will be
1312lost.
1313
1314=item cflags
1315
1316If you have any additional changes to make to the C compiler command
1317line, they can be made in cflags.SH.  For instance, to turn off the
1318optimizer on toke.c, find the switch structure marked 'or customize here',
1319and add a line for toke.c ahead of the catch-all *) so that it now reads:
1320
1321    : or customize here
1322
1323    case "$file" in
1324    toke) optimize='-g' ;;
1325    *) ;;
1326
1327You should not edit the generated file cflags directly, as your changes will
1328be lost the next time you run Configure, or if you edit config.sh.
1329
1330To explore various ways of changing ccflags from within a hint file,
1331see the file hints/README.hints.
1332
1333To change the C flags for all the files, edit config.sh and change either
1334$ccflags or $optimize, and then re-run
1335
1336	sh Configure -S
1337	make depend
1338
1339=item No sh
1340
1341If you don't have sh, you'll have to copy the sample file
1342Porting/config.sh to config.sh and edit your config.sh to reflect your
1343system's peculiarities.  See Porting/pumpkin.pod for more information.
1344You'll probably also have to extensively modify the extension building
1345mechanism.
1346
1347=item Porting information
1348
1349Specific information for the OS/2, Plan 9, VMS and Win32 ports is in the
1350corresponding README files and subdirectories.  Additional information,
1351including a glossary of all those config.sh variables, is in the Porting
1352subdirectory.  Porting/Glossary should especially come in handy.
1353
1354Ports for other systems may also be available.  You should check out
1355http://www.cpan.org/ports for current information on ports to
1356various other operating systems.
1357
1358If you plan to port Perl to a new architecture, study carefully the
1359section titled "Philosophical Issues in Patching and Porting Perl"
1360in the file Porting/pumpkin.pod and the file pod/perlgit.pod.
1361Study also how other non-UNIX ports have solved problems.
1362
1363=back
1364
1365=head2 Adding extra modules to the build
1366
1367You can specify extra modules or module bundles to be fetched from the
1368CPAN and installed as part of the Perl build.  Either use the -Dextras=...
1369command line parameter to Configure, for example like this:
1370
1371	Configure -Dextras="Bundle::LWP DBI"
1372
1373or answer first 'y' to the question 'Install any extra modules?' and
1374then answer "Bundle::LWP DBI" to the 'Extras?' question.
1375The module or the bundle names are as for the CPAN module 'install' command.
1376This will only work if those modules are to be built as dynamic
1377extensions.  If you wish to include those extra modules as static
1378extensions, see L<"Extensions"> above.
1379
1380Notice that because the CPAN module will be used to fetch the extra
1381modules, you will need access to the CPAN, either via the Internet,
1382or via a local copy such as a CD-ROM or a local CPAN mirror.  If you
1383do not, using the extra modules option will die horribly.
1384
1385Also notice that you yourself are responsible for satisfying any extra
1386dependencies such as external headers or libraries BEFORE trying the build.
1387For example: you will need to have the Foo database specific
1388headers and libraries installed for the DBD::Foo module.  The Configure
1389process or the Perl build process will not help you with these.
1390
1391=head2 suidperl
1392
1393suidperl was an optional component of earlier releases of perl. It is no
1394longer available.  Instead, use a tool specifically designed to handle
1395changes in privileges, such as B<sudo>.
1396
1397=head1 make depend
1398
1399This will look for all the includes.  The output is stored in makefile.
1400The only difference between Makefile and makefile is the dependencies at
1401the bottom of makefile.  If you have to make any changes, you should edit
1402makefile, not Makefile, since the Unix make command reads makefile first.
1403(On non-Unix systems, the output may be stored in a different file.
1404Check the value of $firstmakefile in your config.sh if in doubt.)
1405
1406Configure will offer to do this step for you, so it isn't listed
1407explicitly above.
1408
1409=head1 make
1410
1411This will attempt to make perl in the current directory.
1412
1413=head2 Expected errors
1414
1415These error reports are normal, and can be ignored:
1416
1417  ...
1418  make: [extra.pods] Error 1 (ignored)
1419  ...
1420  make: [extras.make] Error 1 (ignored)
1421
1422=head2 What if it doesn't work?
1423
1424If you can't compile successfully, try some of the following ideas.
1425If none of them help, and careful reading of the error message and
1426the relevant manual pages on your system doesn't help,
1427then see L<"Reporting Problems"> below.
1428
1429=over 4
1430
1431=item hints
1432
1433If you used a hint file, try reading the comments in the hint file
1434for further tips and information.
1435
1436=item extensions
1437
1438If you can successfully build miniperl, but the process crashes
1439during the building of extensions, run
1440
1441	make minitest
1442
1443to test your version of miniperl.
1444
1445=item locale
1446
1447If you have any locale-related environment variables set, try unsetting
1448them.  I have some reports that some versions of IRIX hang while
1449running B<./miniperl configpm> with locales other than the C locale.
1450See the discussion under L<"make test"> below about locales and the
1451whole L<perllocale/"LOCALE PROBLEMS"> section in the file pod/perllocale.pod.
1452The latter is especially useful if you see something like this
1453
1454	perl: warning: Setting locale failed.
1455	perl: warning: Please check that your locale settings:
1456	        LC_ALL = "En_US",
1457	        LANG = (unset)
1458	    are supported and installed on your system.
1459	perl: warning: Falling back to the standard locale ("C").
1460
1461at Perl startup.
1462
1463=item other environment variables
1464
1465Configure does not check for environment variables that can sometimes
1466have a major influence on how perl is built or tested. For example,
1467OBJECT_MODE on AIX determines the way the compiler and linker deal with
1468their objects, but this is a variable that only influences build-time
1469behaviour, and should not affect the perl scripts that are eventually
1470executed by the perl binary. Other variables, like PERL_UNICODE,
1471PERL5LIB, and PERL5OPT will influence the behaviour of the test suite.
1472So if you are getting strange test failures, you may want to try
1473retesting with the various PERL variables unset.
1474
1475=item varargs
1476
1477If you get varargs problems with gcc, be sure that gcc is installed
1478correctly and that you are not passing -I/usr/include to gcc.  When using
1479gcc, you should probably have i_stdarg='define' and i_varargs='undef'
1480in config.sh.  The problem is usually solved by installing gcc
1481correctly.  If you do change config.sh, don't forget to propagate
1482your changes (see L<"Propagating your changes to config.sh"> below).
1483See also the L<"vsprintf"> item below.
1484
1485=item util.c
1486
1487If you get error messages such as the following (the exact line
1488numbers and function name may vary in different versions of perl):
1489
1490    util.c: In function 'Perl_form':
1491    util.c:1107: number of arguments doesn't match prototype
1492    proto.h:125: prototype declaration
1493
1494it might well be a symptom of the gcc "varargs problem".  See the
1495previous L<"varargs"> item.
1496
1497=item LD_LIBRARY_PATH
1498
1499If you run into dynamic loading problems, check your setting of
1500the LD_LIBRARY_PATH environment variable.  If you're creating a static
1501Perl library (libperl.a rather than libperl.so) it should build
1502fine with LD_LIBRARY_PATH unset, though that may depend on details
1503of your local setup.
1504
1505=item nm extraction
1506
1507If Configure seems to be having trouble finding library functions,
1508try not using nm extraction.  You can do this from the command line
1509with
1510
1511	sh Configure -Uusenm
1512
1513or by answering the nm extraction question interactively.
1514If you have previously run Configure, you should not reuse your old
1515config.sh.
1516
1517=item umask not found
1518
1519If the build processes encounters errors relating to umask(), the problem
1520is probably that Configure couldn't find your umask() system call.
1521Check your config.sh.  You should have d_umask='define'.  If you don't,
1522this is probably the L<"nm extraction"> problem discussed above.  Also,
1523try reading the hints file for your system for further information.
1524
1525=item vsprintf
1526
1527If you run into problems with vsprintf in compiling util.c, the
1528problem is probably that Configure failed to detect your system's
1529version of vsprintf().  Check whether your system has vprintf().
1530(Virtually all modern Unix systems do.)  Then, check the variable
1531d_vprintf in config.sh.  If your system has vprintf, it should be:
1532
1533	d_vprintf='define'
1534
1535If Configure guessed wrong, it is likely that Configure guessed wrong
1536on a number of other common functions too.  This is probably
1537the L<"nm extraction"> problem discussed above.
1538
1539=item do_aspawn
1540
1541If you run into problems relating to do_aspawn or do_spawn, the
1542problem is probably that Configure failed to detect your system's
1543fork() function.  Follow the procedure in the previous item
1544on L<"nm extraction">.
1545
1546=item __inet_* errors
1547
1548If you receive unresolved symbol errors during Perl build and/or test
1549referring to __inet_* symbols, check to see whether BIND 8.1 is
1550installed.  It installs a /usr/local/include/arpa/inet.h that refers to
1551these symbols.  Versions of BIND later than 8.1 do not install inet.h
1552in that location and avoid the errors.  You should probably update to a
1553newer version of BIND (and remove the files the old one left behind).
1554If you can't, you can either link with the updated resolver library provided
1555with BIND 8.1 or rename /usr/local/bin/arpa/inet.h during the Perl build and
1556test process to avoid the problem.
1557
1558=item .*_r() prototype NOT found
1559
1560On a related note, if you see a bunch of complaints like the above about
1561reentrant functions -- specifically networking-related ones -- being present
1562but without prototypes available, check to see if BIND 8.1 (or possibly
1563other BIND 8 versions) is (or has been) installed. They install
1564header files such as netdb.h into places such as /usr/local/include (or into
1565another directory as specified at build/install time), at least optionally.
1566Remove them or put them in someplace that isn't in the C preprocessor's
1567header file include search path (determined by -I options plus defaults,
1568normally /usr/include).
1569
1570=item #error "No DATAMODEL_NATIVE specified"
1571
1572This is a common error when trying to build perl on Solaris 2.6 with a
1573gcc installation from Solaris 2.5 or 2.5.1.  The Solaris header files
1574changed, so you need to update your gcc installation.  You can either
1575rerun the fixincludes script from gcc or take the opportunity to
1576update your gcc installation.
1577
1578=item Optimizer
1579
1580If you can't compile successfully, try turning off your compiler's
1581optimizer.  Edit config.sh and change the line
1582
1583	optimize='-O'
1584
1585to
1586
1587	optimize=' '
1588
1589then propagate your changes with B<sh Configure -S> and rebuild
1590with B<make depend; make>.
1591
1592=item Missing functions and Undefined symbols
1593
1594If the build of miniperl fails with a long list of missing functions or
1595undefined symbols, check the libs variable in the config.sh file.  It
1596should look something like
1597
1598	libs='-lsocket -lnsl -ldl -lm -lc'
1599
1600The exact libraries will vary from system to system, but you typically
1601need to include at least the math library -lm.  Normally, Configure
1602will suggest the correct defaults.  If the libs variable is empty, you
1603need to start all over again.  Run
1604
1605	make distclean
1606
1607and start from the very beginning.  This time, unless you are sure of
1608what you are doing, accept the default list of libraries suggested by
1609Configure.
1610
1611If the libs variable is missing -lm, there is a chance that libm.so.1
1612is available, but the required (symbolic) link to libm.so is missing.
1613(same could be the case for other libraries like libcrypt.so).  You
1614should check your installation for packages that create that link, and
1615if no package is installed that supplies that link or you cannot install
1616them, make the symbolic link yourself e.g.:
1617
1618 $ rpm -qf /usr/lib64/libm.so
1619 glibc-devel-2.15-22.17.1.x86_64
1620 $ ls -lgo /usr/lib64/libm.so
1621 lrwxrwxrwx 1 16 Jan  7  2013 /usr/lib64/libm.so -> /lib64/libm.so.6
1622
1623 or
1624
1625 $ sudo ln -s /lib64/libm.so.6 /lib64/libm.so
1626
1627If the libs variable looks correct, you might have the
1628L<"nm extraction"> problem discussed above.
1629
1630If you still have missing routines or undefined symbols, you probably
1631need to add some library or other, make a symbolic link like described
1632above, or you need to undefine some feature that Configure thought was
1633there but is defective or incomplete.  If you used a hint file, see if
1634it has any relevant advice.  You can also look through through config.h
1635for likely suspects.
1636
1637=item toke.c
1638
1639Some compilers will not compile or optimize the larger files (such as
1640toke.c) without some extra switches to use larger jump offsets or
1641allocate larger internal tables.  You can customize the switches for
1642each file in cflags.SH.  It's okay to insert rules for specific files into
1643makefile since a default rule only takes effect in the absence of a
1644specific rule.
1645
1646=item Missing dbmclose
1647
1648SCO prior to 3.2.4 may be missing dbmclose().  An upgrade to 3.2.4
1649that includes libdbm.nfs (which includes dbmclose()) may be available.
1650
1651=item error: too few arguments to function 'dbmclose'
1652
1653Building ODBM_File on some (Open)SUSE distributions might run into this
1654error, as the header file is broken. There are two ways to deal with this
1655
1656 1. Disable the use of ODBM_FILE
1657
1658    Configure ... -Dnoextensions=ODBM_File
1659
1660 2. Fix the header file, somewhat like this:
1661
1662    --- a/usr/include/dbm.h  2010-03-24 08:54:59.000000000 +0100
1663    +++ b/usr/include/dbm.h  2010-03-24 08:55:15.000000000 +0100
1664    @@ -59,4 +59,4 @@ extern datum  firstkey __P((void));
1665
1666     extern datum   nextkey __P((datum key));
1667
1668    -extern int     dbmclose __P((DBM *));
1669    +extern int     dbmclose __P((void));
1670
1671=item Note (probably harmless): No library found for -lsomething
1672
1673If you see such a message during the building of an extension, but
1674the extension passes its tests anyway (see L<"make test"> below),
1675then don't worry about the warning message.  The extension
1676Makefile.PL goes looking for various libraries needed on various
1677systems; few systems will need all the possible libraries listed.
1678Most users will see warnings for the ones they don't have.  The
1679phrase 'probably harmless' is intended to reassure you that nothing
1680unusual is happening, and the build process is continuing.
1681
1682On the other hand, if you are building GDBM_File and you get the
1683message
1684
1685    Note (probably harmless): No library found for -lgdbm
1686
1687then it's likely you're going to run into trouble somewhere along
1688the line, since it's hard to see how you can use the GDBM_File
1689extension without the -lgdbm library.
1690
1691It is true that, in principle, Configure could have figured all of
1692this out, but Configure and the extension building process are not
1693quite that tightly coordinated.
1694
1695=item sh: ar: not found
1696
1697This is a message from your shell telling you that the command 'ar'
1698was not found.  You need to check your PATH environment variable to
1699make sure that it includes the directory with the 'ar' command.  This
1700is a common problem on Solaris, where 'ar' is in the /usr/ccs/bin
1701directory.
1702
1703=item db-recno failure on tests 51, 53 and 55
1704
1705Old versions of the DB library (including the DB library which comes
1706with FreeBSD 2.1) had broken handling of recno databases with modified
1707bval settings.  Upgrade your DB library or OS.
1708
1709=item Bad arg length for semctl, is XX, should be ZZZ
1710
1711If you get this error message from the ext/IPC/SysV/t/sem test, your System
1712V IPC may be broken.  The XX typically is 20, and that is what ZZZ
1713also should be.  Consider upgrading your OS, or reconfiguring your OS
1714to include the System V semaphores.
1715
1716=item ext/IPC/SysV/t/sem........semget: No space left on device
1717
1718Either your account or the whole system has run out of semaphores.  Or
1719both.  Either list the semaphores with "ipcs" and remove the unneeded
1720ones (which ones these are depends on your system and applications)
1721with "ipcrm -s SEMAPHORE_ID_HERE" or configure more semaphores to your
1722system.
1723
1724=item GNU binutils
1725
1726If you mix GNU binutils (nm, ld, ar) with equivalent vendor-supplied
1727tools you may be in for some trouble.  For example creating archives
1728with an old GNU 'ar' and then using a new current vendor-supplied 'ld'
1729may lead into linking problems.  Either recompile your GNU binutils
1730under your current operating system release, or modify your PATH not
1731to include the GNU utils before running Configure, or specify the
1732vendor-supplied utilities explicitly to Configure, for example by
1733Configure -Dar=/bin/ar.
1734
1735=item THIS PACKAGE SEEMS TO BE INCOMPLETE
1736
1737The F<Configure> program has not been able to find all the files which
1738make up the complete Perl distribution.  You may have a damaged source
1739archive file (in which case you may also have seen messages such as
1740C<gzip: stdin: unexpected end of file> and C<tar: Unexpected EOF on
1741archive file>), or you may have obtained a structurally-sound but
1742incomplete archive.  In either case, try downloading again from the
1743official site named at the start of this document.  If you do find
1744that any site is carrying a corrupted or incomplete source code
1745archive, please report it to the site's maintainer.
1746
1747=item invalid token: ##
1748
1749You are using a non-ANSI-compliant C compiler.  To compile Perl, you
1750need to use a compiler that supports ANSI C.  If there is a README
1751file for your system, it may have further details on your compiler
1752options.
1753
1754=item Miscellaneous
1755
1756Some additional things that have been reported:
1757
1758Genix may need to use libc rather than libc_s, or #undef VARARGS.
1759
1760NCR Tower 32 (OS 2.01.01) may need -W2,-Sl,2000 and #undef MKDIR.
1761
1762UTS may need one or more of -K or -g, and #undef LSTAT.
1763
1764FreeBSD can fail the ext/IPC/SysV/t/sem.t test if SysV IPC has not been
1765configured in the kernel.  Perl tries to detect this, though, and
1766you will get a message telling you what to do.
1767
1768Building Perl on a system that has also BIND (headers and libraries)
1769installed may run into troubles because BIND installs its own netdb.h
1770and socket.h, which may not agree with the operating system's ideas of
1771the same files.  Similarly, including -lbind may conflict with libc's
1772view of the world.  You may have to tweak -Dlocincpth and -Dloclibpth
1773to avoid the BIND.
1774
1775=back
1776
1777=head2 Cross-compilation
1778
1779Perl can be cross-compiled.  It is just not trivial, cross-compilation
1780rarely is.  Perl is routinely cross-compiled for several platforms: as of
1781January 2014, these include Android, Blackberry 10, PocketPC aka
1782WinCE, ARM Linux, and Solaris.  Previous versions of
1783Perl also provided support for Open Zaurus, Symbian, and
1784the IBM OS/400, but it's unknown if those ports are still functional.
1785These platforms are known as the B<target> platforms, while the systems where the compilation takes place are the B<host> platforms.
1786
1787What makes the situation difficult is that first of all,
1788cross-compilation environments vary significantly in how they are set
1789up and used, and secondly because the primary way of configuring Perl
1790(using the rather large Unix-tool-dependent Configure script) is not
1791awfully well suited for cross-compilation.  However, starting from
1792version 5.18.0, the Configure script also knows two ways of supporting
1793cross-compilation, so please keep reading.
1794
1795See the following files for more information about compiling Perl for
1796the particular platforms:
1797
1798=over 4
1799
1800=item WinCE/PocketPC
1801
1802L<README.ce or perlce|perlce>
1803
1804=item Android
1805
1806L<"Cross-compilation" in README.android or perlandroid|perlandroid/Cross-compilation>
1807
1808=item Blackberry
1809
1810L<"Cross-compilation" in README.qnx or perlqnx|perlqnx/Cross-compilation>
1811
1812=item Solaris
1813
1814L<"CROSS-COMPILATION" in README.solaris or perlsolaris|perlsolaris/CROSS-COMPILATION>
1815
1816=item Linux
1817
1818This document; See below.
1819
1820=back
1821
1822Packaging and transferring either the core Perl modules or CPAN
1823modules to the target platform is also left up to the each
1824cross-compilation environment.  Often the cross-compilation target
1825platforms are somewhat limited in diskspace: see the section
1826L<Minimizing the Perl installation> to learn more of the minimal set
1827of files required for a functional Perl installation.
1828
1829For some cross-compilation environments the Configure option
1830C<-Dinstallprefix=...> might be handy, see L<Changing the installation
1831directory>.
1832
1833About the cross-compilation support of Configure: There's two forms.
1834The more common one requires some way of transferring and running executables
1835in the target system, such as an ssh connection; this is the
1836C<./Configure -Dusecrosscompile -Dtargethost=...> route.  The second method
1837doesn't need access to the target system, but requires you to provide
1838a config.sh, and and a canned Makefile; the rest of this section describes
1839the former.
1840
1841This cross-compilation setup of Configure has successfully been used in
1842a wide variety of setups, such as a 64-bit OS X host for an Android ARM target, or
1843an amd64 Linux host targeting x86 Solaris, or even Windows.
1844
1845To run Configure in cross-compilation mode the basic switch that
1846has to be used is C<-Dusecrosscompile>:
1847
1848   sh ./Configure -des -Dusecrosscompile -D...
1849
1850This will make the cpp symbol USE_CROSS_COMPILE and the %Config
1851symbol C<usecrosscompile> available.
1852
1853During the Configure and build, certain helper scripts will be created
1854into the Cross/ subdirectory.  The scripts are used to execute a
1855cross-compiled executable, and to transfer files to and from the
1856target host.  The execution scripts are named F<run-*> and the
1857transfer scripts F<to-*> and F<from-*>.  The part after the dash is
1858the method to use for remote execution and transfer: by default the
1859methods are B<ssh> and B<scp>, thus making the scripts F<run-ssh>,
1860F<to-scp>, and F<from-scp>.
1861
1862To configure the scripts for a target host and a directory (in which
1863the execution will happen and which is to and from where the transfer
1864happens), supply Configure with
1865
1866    -Dtargethost=so.me.ho.st -Dtargetdir=/tar/get/dir
1867
1868The targethost is what e.g. ssh will use as the hostname, the targetdir
1869must exist (the scripts won't create it), the targetdir defaults to /tmp.
1870You can also specify a username to use for ssh/rsh logins
1871
1872    -Dtargetuser=luser
1873
1874but in case you don't, "root" will be used.  Similarly, you can specify
1875a non-standard (i.e. not 22) port for the connection, if applicable, through
1876
1877    -Dtargetport=2222
1878
1879If the name of C<cc> has the usual GNU C semantics for cross
1880compilers, that is, CPU-OS-gcc, the target architecture (C<targetarch>),
1881plus names of the C<ar>, C<nm>, and C<ranlib> will also be automatically
1882chosen to be CPU-OS-ar and so on.
1883(The C<ld> requires more thought and will be chosen later by Configure
1884as appropriate).  This will also aid in guessing the proper
1885operating system name for the target, which has other repercussions, like
1886better defaults and possibly critical fixes for the platform.  If Configure
1887isn't guessing the OS name properly, you may need to either add a hint file
1888redirecting Configure's guess, or modify Configure to make the correct choice.
1889
1890If your compiler doesn't follow that convention, you will also need to
1891specify which target environment to use, as well as C<ar> and friends:
1892
1893    -Dtargetarch=arm-linux
1894    -Dcc=mycrossgcc
1895    -Dar=...
1896
1897Additionally, a cross-compilation toolchain will usually install it's own
1898logical system root somewhere -- that is, it'll create a directory somewhere
1899which includes subdirectories like 'include' or 'lib'.  For example, you
1900may end up with C</skiff/local/arm-linux>, where
1901C</skiff/local/arm-linux/bin> holds the binaries for cross-compilation,
1902C</skiff/local/arm-linux/include> has the headers, and
1903C</skiff/local/arm-linux/lib> has the library files.
1904If this is the case, and you are using a compiler that understands
1905C<--sysroot>, like gcc or clang, you'll want to specify the
1906C<-Dsysroot> option for Configure:
1907
1908    -Dsysroot=/skiff/local/arm-linux
1909
1910However, if your don't have a suitable directory to pass to C<-Dsysroot>,
1911you will also need to specify which target environment to use:
1912
1913    -Dusrinc=/skiff/local/arm-linux/include
1914    -Dincpth=/skiff/local/arm-linux/include
1915    -Dlibpth=/skiff/local/arm-linux/lib
1916
1917In addition to the default execution/transfer methods you can also
1918choose B<rsh> for execution, and B<rcp> or B<cp> for transfer,
1919for example:
1920
1921    -Dtargetrun=rsh -Dtargetto=rcp -Dtargetfrom=cp
1922
1923Putting it all together:
1924
1925    sh ./Configure -des -Dusecrosscompile \
1926        -Dtargethost=so.me.ho.st \
1927        -Dtargetdir=/tar/get/dir \
1928        -Dtargetuser=root \
1929        -Dtargetarch=arm-linux \
1930        -Dcc=arm-linux-gcc \
1931        -Dsysroot=/skiff/local/arm-linux \
1932        -D...
1933
1934or if you are happy with the defaults:
1935
1936    sh ./Configure -des -Dusecrosscompile \
1937        -Dtargethost=so.me.ho.st \
1938        -Dcc=arm-linux-gcc \
1939        -D...
1940
1941Another example where the cross-compiler has been installed under
1942F</usr/local/arm/2.95.5>:
1943
1944    sh ./Configure -des -Dusecrosscompile \
1945        -Dtargethost=so.me.ho.st \
1946        -Dcc=/usr/local/arm/2.95.5/bin/arm-linux-gcc \
1947        -Dsysroot=/usr/local/arm/2.95.5
1948
1949There is also a C<targetenv> option for Configure which can be used
1950to modify the environment of the target just before testing begins
1951during 'make test'.  For example, if the target system has a nonstandard
1952/tmp location, you could do this:
1953
1954    -Dtargetenv="export TMPDIR=/other/tmp;"
1955
1956If you are planning on cross-compiling to several platforms, or some other
1957thing that would involve running Configure several times, there are two
1958options that can be used to speed things up considerably.
1959As a bit of background, when you
1960call Configure with C<-Dusecrosscompile>, it begins by actually partially
1961building a miniperl on the host machine, as well as the generate_uudmap
1962binary, and we end up using that during the build.
1963So instead of building that new perl every single time, you can build it just
1964once in a separate directory, and then pass the resulting binaries to
1965Configure like this:
1966
1967    -Dhostperl=/path/to/second/build/dir/miniperl
1968    -Dhostgenerate=/path/to/second/build/dir/generate_uudmap
1969
1970Much less commonly, if you are cross-compiling from an ASCII host to an
1971EBCDIC target, or vise versa, you'll have to pass C<-Uhostgenerate> to
1972Configure, to signify that you want to build a generate_uudmap binary
1973that, during make, will be run on the target system.
1974
1975=head1 make test
1976
1977This will run the regression tests on the perl you just made.  If
1978'make test' doesn't say "All tests successful" then something went
1979wrong.
1980
1981Note that you can't run the tests in background if this disables
1982opening of /dev/tty. You can use 'make test-notty' in that case but
1983a few tty tests will be skipped.
1984
1985=head2 What if make test doesn't work?
1986
1987If make test bombs out, just cd to the t directory and run ./TEST
1988by hand to see if it makes any difference.
1989
1990One way to get more detailed information about failed tests and
1991individual subtests is to run the harness from the t directory:
1992
1993	cd t ; ./perl harness <list of tests>
1994
1995(this assumes that most basic tests succeed, since harness uses
1996complicated constructs). If no list of tests is provided, harness
1997will run all tests.
1998
1999If individual tests fail, you can often run them by hand (from the main
2000perl directory), e.g.,
2001
2002	./perl -MTestInit t/op/groups.t
2003
2004You should also read the individual tests to see if there are any helpful
2005comments that apply to your system.  You may also need to setup your
2006shared library path if you get errors like:
2007
2008	/sbin/loader: Fatal Error: cannot map libperl.so
2009
2010The file t/README in the t subdirectory contains more information about
2011running and modifying tests.
2012
2013See L</"Building a shared Perl library"> earlier in this document.
2014
2015=over 4
2016
2017=item locale
2018
2019Note:  One possible reason for errors is that some external programs
2020may be broken due to the combination of your environment and the way
2021'make test' exercises them.  For example, this may happen if you have
2022one or more of these environment variables set:  LC_ALL LC_CTYPE
2023LC_COLLATE LANG.  In some versions of UNIX, the non-English locales
2024are known to cause programs to exhibit mysterious errors.
2025
2026If you have any of the above environment variables set, please try
2027
2028	setenv LC_ALL C
2029
2030(for C shell) or
2031
2032	LC_ALL=C;export LC_ALL
2033
2034for Bourne or Korn shell) from the command line and then retry
2035make test.  If the tests then succeed, you may have a broken program that
2036is confusing the testing.  Please run the troublesome test by hand as
2037shown above and see whether you can locate the program.  Look for
2038things like:  exec, `backquoted command`, system, open("|...") or
2039open("...|").  All these mean that Perl is trying to run some
2040external program.
2041
2042=item Timing problems
2043
2044Several tests in the test suite check timing functions, such as
2045sleep(), and see if they return in a reasonable amount of time.
2046If your system is quite busy and doesn't respond quickly enough,
2047these tests might fail.  If possible, try running the tests again
2048with the system under a lighter load.  These timing-sensitive
2049and load-sensitive tests include F<t/op/alarm.t>,
2050F<ext/Time-HiRes/t/HiRes.t>, F<ext/threads-shared/t/waithires.t>,
2051F<ext/threads-shared/t/stress.t>, F<lib/Benchmark.t>,
2052F<lib/Memoize/t/expmod_t.t>, and F<lib/Memoize/t/speed.t>.
2053
2054You might also experience some failures in F<t/op/stat.t> if you build
2055perl on an NFS filesystem, if the remote clock and the system clock are
2056different.
2057
2058=item Out of memory
2059
2060On some systems, particularly those with smaller amounts of RAM, some
2061of the tests in t/op/pat.t may fail with an "Out of memory" message.
2062For example, on my SparcStation IPC with 12 MB of RAM, in perl5.5.670,
2063test 85 will fail if run under either t/TEST or t/harness.
2064
2065Try stopping other jobs on the system and then running the test by itself:
2066
2067	./perl -MTestInit t/op/pat.t
2068
2069to see if you have any better luck.  If your perl still fails this
2070test, it does not necessarily mean you have a broken perl.  This test
2071tries to exercise the regular expression subsystem quite thoroughly,
2072and may well be far more demanding than your normal usage.
2073
2074=item libgcc_s.so.1: cannot open shared object file
2075
2076This message has been reported on gcc-3.2.3 and earlier installed with
2077a non-standard prefix.  Setting the LD_LIBRARY_PATH environment variable
2078(or equivalent) to include gcc's lib/ directory with the libgcc_s.so.1
2079shared library should fix the problem.
2080
2081=item Failures from lib/File/Temp/t/security saying "system possibly insecure"
2082
2083First, such warnings are not necessarily serious or indicative of a
2084real security threat.  That being said, they bear investigating.
2085
2086Note that each of the tests is run twice.  The first time is in the
2087directory returned by File::Spec->tmpdir() (often /tmp on Unix
2088systems), and the second time in the directory from which the test was
2089run (usually the 't' directory, if the test was run as part of 'make
2090test').
2091
2092The tests may fail for the following reasons:
2093
2094(1) If the directory the tests are being run in is owned by somebody
2095other than the user running the tests, or by root (uid 0).
2096
2097This failure can happen if the Perl source code distribution is
2098unpacked in such a way that the user IDs in the distribution package
2099are used as-is.  Some tar programs do this.
2100
2101(2) If the directory the tests are being run in is writable by group or
2102by others, and there is no sticky bit set for the directory.  (With
2103UNIX/POSIX semantics, write access to a directory means the right to
2104add or remove files in that directory.  The 'sticky bit' is a feature
2105used in some UNIXes to give extra protection to files: if the bit is
2106set for a directory, no one but the owner (or root) can remove that
2107file even if the permissions would otherwise allow file removal by
2108others.)
2109
2110This failure may or may not be a real problem: it depends on the
2111permissions policy used on this particular system.  This failure can
2112also happen if the system either doesn't support the sticky bit (this
2113is the case with many non-UNIX platforms: in principle File::Temp
2114should know about these platforms and skip the tests), or if the system
2115supports the sticky bit but for some reason or reasons it is not being
2116used.  This is, for example, the case with HP-UX: as of HP-UX release
211711.00, the sticky bit is very much supported, but HP-UX doesn't use it
2118on its /tmp directory as shipped.  Also, as with the permissions, some
2119local policy might dictate that the stickiness is not used.
2120
2121(3) If the system supports the POSIX 'chown giveaway' feature and if
2122any of the parent directories of the temporary file back to the root
2123directory are 'unsafe', using the definitions given above in (1) and
2124(2).  For Unix systems, this is usually not an issue if you are
2125building on a local disk.  See the documentation for the File::Temp
2126module for more information about 'chown giveaway'.
2127
2128See the documentation for the File::Temp module for more information
2129about the various security aspects of temporary files.
2130
2131=back
2132
2133The core distribution can now run its regression tests in parallel on
2134Unix-like platforms. Instead of running C<make test>, set C<TEST_JOBS> in
2135your environment to the number of tests to run in parallel, and run
2136C<make test_harness>. On a Bourne-like shell, this can be done as
2137
2138    TEST_JOBS=3 make test_harness  # Run 3 tests in parallel
2139
2140An environment variable is used, rather than parallel make itself, because
2141L<TAP::Harness> needs to be able to schedule individual non-conflicting test
2142scripts itself, and there is no standard interface to C<make> utilities to
2143interact with their job schedulers.
2144
2145=head1 make install
2146
2147This will put perl into the public directory you specified to
2148Configure; by default this is /usr/local/bin.  It will also try
2149to put the man pages in a reasonable place.  It will not nroff the man
2150pages, however.  You may need to be root to run B<make install>.  If you
2151are not root, you must still have permission to install into the directories
2152in question and you should ignore any messages about chown not working.
2153
2154If "make install" just says "'install' is up to date" or something
2155similar, you may be on a case-insensitive filesystems such as Mac's HFS+,
2156and you should say "make install-all".  (This confusion is brought to you
2157by the Perl distribution having a file called INSTALL.)
2158
2159=head2 Installing perl under different names
2160
2161If you want to install perl under a name other than "perl" (for example,
2162when installing perl with special features enabled, such as debugging),
2163indicate the alternate name on the "make install" line, such as:
2164
2165    make install PERLNAME=myperl
2166
2167You can separately change the base used for versioned names (like
2168"perl5.8.9") by setting PERLNAME_VERBASE, like
2169
2170    make install PERLNAME=perl5 PERLNAME_VERBASE=perl
2171
2172This can be useful if you have to install perl as "perl5" (e.g. to
2173avoid conflicts with an ancient version in /usr/bin supplied by your vendor).
2174Without this the versioned binary would be called "perl55.8.8".
2175
2176=head2 Installing perl under a different directory
2177
2178You can install perl under a different destination directory by using
2179the DESTDIR variable during C<make install>, with a command like
2180
2181	make install DESTDIR=/tmp/perl5
2182
2183DESTDIR is automatically prepended to all the installation paths.  See
2184the example in L<"DESTDIR"> above.
2185
2186=head2 Installed files
2187
2188If you want to see exactly what will happen without installing
2189anything, you can run
2190
2191	./perl installperl -n
2192	./perl installman -n
2193
2194make install will install the following:
2195
2196    binaries
2197
2198	perl,
2199	    perl5.n.n	where 5.n.n is the current release number.  This
2200			will be a link to perl.
2201	a2p          	awk-to-perl translator.
2202
2203    scripts
2204
2205	cppstdin	This is used by the deprecated switch perl -P,
2206			if your cc -E can't read from stdin.
2207	c2ph, pstruct	Scripts for handling C structures in header
2208                        files.
2209	config_data	Manage Module::Build-like module configuration.
2210	corelist	Shows versions of modules that come with
2211                        different
2212			versions of perl.
2213	cpan		The CPAN shell.
2214	enc2xs		Encoding module generator.
2215	find2perl	find-to-perl translator.
2216	h2ph		Extract constants and simple macros from C
2217                        headers.
2218	h2xs		Converts C .h header files to Perl extensions.
2219	instmodsh	A shell to examine installed modules.
2220	libnetcfg	Configure libnet.
2221	perlbug		Tool to report bugs in Perl.
2222	perldoc		Tool to read perl's pod documentation.
2223	perlivp		Perl Installation Verification Procedure.
2224	piconv		A Perl implementation of the encoding conversion
2225			utility iconv.
2226	pl2pm		Convert Perl 4 .pl files to Perl 5 .pm modules.
2227	pod2html,	Converters from perl's pod documentation format
2228	pod2man,
2229	pod2text,
2230	pod2usage
2231	podchecker	POD syntax checker.
2232	podselect	Prints sections of POD documentation.
2233	prove		A command-line tool for running tests.
2234	psed		A Perl implementation of sed.
2235	ptar		A Perl implementation of tar.
2236	ptardiff	A diff for tar archives.
2237	ptargrep	A grep for tar archives.
2238	s2p		sed-to-perl translator.
2239	shasum		A tool to print or check SHA checksums.
2240	splain		Describe Perl warnings and errors.
2241	xsubpp		Compiler to convert Perl XS code into C code.
2242	zipdetails	display the internal structure of zip files
2243
2244    library files
2245
2246			in $privlib and $archlib specified to
2247			Configure, usually under /usr/local/lib/perl5/.
2248
2249    documentation
2250
2251	man pages	in $man1dir, usually /usr/local/man/man1.
2252	module man
2253	pages		in $man3dir, usually /usr/local/man/man3.
2254	pod/*.pod	in $privlib/pod/.
2255
2256installperl will also create the directories listed above
2257in L<"Installation Directories">.
2258
2259Perl's *.h header files and the libperl library are also installed
2260under $archlib so that any user may later build new modules, run the
2261optional Perl compiler, or embed the perl interpreter into another
2262program even if the Perl source is no longer available.
2263
2264=head2 Installing only version-specific parts
2265
2266Sometimes you only want to install the version-specific parts of the perl
2267installation.  For example, you may wish to install a newer version of
2268perl alongside an already installed production version without
2269disabling installation of new modules for the production version.
2270To only install the version-specific parts of the perl installation, run
2271
2272	Configure -Dversiononly
2273
2274or answer 'y' to the appropriate Configure prompt.  Alternatively,
2275you can just manually run
2276
2277	./perl installperl -v
2278
2279and skip installman altogether.
2280
2281See also L<"Maintaining completely separate versions"> for another
2282approach.
2283
2284=head1 cd /usr/include; h2ph *.h sys/*.h
2285
2286Some perl scripts need to be able to obtain information from the
2287system header files.  This command will convert the most commonly used
2288header files in /usr/include into files that can be easily interpreted
2289by perl.  These files will be placed in the architecture-dependent
2290library ($archlib) directory you specified to Configure.
2291
2292Note: Due to differences in the C and perl languages, the conversion
2293of the header files is not perfect.  You will probably have to
2294hand-edit some of the converted files to get them to parse correctly.
2295For example, h2ph breaks spectacularly on type casting and certain
2296structures.
2297
2298=head1 installhtml --help
2299
2300Some sites may wish to make perl documentation available in HTML
2301format.  The installhtml utility can be used to convert pod
2302documentation into linked HTML files and install them.
2303
2304Currently, the supplied ./installhtml script does not make use of the
2305html Configure variables.  This should be fixed in a future release.
2306
2307The following command-line is an example of one used to convert
2308perl documentation:
2309
2310  ./installhtml                   \
2311      --podroot=.                 \
2312      --podpath=lib:ext:pod:vms   \
2313      --recurse                   \
2314      --htmldir=/perl/nmanual     \
2315      --htmlroot=/perl/nmanual    \
2316      --splithead=pod/perlipc     \
2317      --splititem=pod/perlfunc    \
2318      --verbose
2319
2320See the documentation in installhtml for more details.  It can take
2321many minutes to execute a large installation and you should expect to
2322see warnings like "no title", "unexpected directive" and "cannot
2323resolve" as the files are processed. We are aware of these problems
2324(and would welcome patches for them).
2325
2326You may find it helpful to run installhtml twice. That should reduce
2327the number of "cannot resolve" warnings.
2328
2329=head1 cd pod && make tex && (process the latex files)
2330
2331Some sites may also wish to make the documentation in the pod/ directory
2332available in TeX format.  Type
2333
2334	(cd pod && make tex && <process the latex files>)
2335
2336=head1 Starting all over again
2337
2338If you wish to rebuild perl from the same build directory, you should
2339clean it out with the command
2340
2341	make distclean
2342
2343or
2344
2345	make realclean
2346
2347The only difference between the two is that make distclean also removes
2348your old config.sh and Policy.sh files.  (A plain 'make clean' will not
2349delete the makefiles used for rebuilding perl, and will also not delete
2350a number of library and utility files extracted during the build process.)
2351
2352If you are upgrading from a previous version of perl, or if you
2353change systems or compilers or make other significant changes, or if
2354you are experiencing difficulties building perl, you should not reuse
2355your old config.sh.
2356
2357If your reason to reuse your old config.sh is to save your particular
2358installation choices, then you can probably achieve the same effect by
2359using the Policy.sh file.  See the section on L<"Site-wide Policy
2360settings"> above.
2361
2362=head1 Reporting Problems
2363
2364Wherever possible please use the perlbug tool supplied with this Perl
2365to report problems, as it automatically includes summary configuration
2366information about your perl, which may help us track down problems far
2367more quickly. But first you should read the advice in this file,
2368carefully re-read the error message and check the relevant manual pages
2369on your system, as these may help you find an immediate solution.  If
2370you are not sure whether what you are seeing is a bug, you can send a
2371message describing the problem to the comp.lang.perl.misc newsgroup to
2372get advice.
2373
2374The perlbug tool is installed along with perl, so after you have
2375completed C<make install> it should be possible to run it with plain
2376C<perlbug>.  If the install fails, or you want to report problems with
2377C<make test> without installing perl, then you can use C<make nok> to
2378run perlbug to report the problem, or run it by hand from this source
2379directory with C<./perl -Ilib utils/perlbug>
2380
2381If the build fails too early to run perlbug uninstalled, then please
2382B<run> the C<./myconfig> shell script, and mail its output along with
2383an accurate description of your problem to perlbug@perl.org
2384
2385If Configure itself fails, and does not generate a config.sh file
2386(needed to run C<./myconfig>), then please mail perlbug@perl.org the
2387description of how Configure fails along with details of your system
2388-- for example the output from running C<uname -a>
2389
2390Please try to make your message brief but clear.  Brief, clear bug
2391reports tend to get answered more quickly.  Please don't worry if your
2392written English is not great -- what matters is how well you describe
2393the important technical details of the problem you have encountered,
2394not whether your grammar and spelling is flawless.
2395
2396Trim out unnecessary information.  Do not include large files (such as
2397config.sh or a complete Configure or make log) unless absolutely
2398necessary.  Do not include a complete transcript of your build
2399session.  Just include the failing commands, the relevant error
2400messages, and whatever preceding commands are necessary to give the
2401appropriate context.  Plain text should usually be sufficient -- fancy
2402attachments or encodings may actually reduce the number of people who
2403read your message.  Your message will get relayed to over 400
2404subscribers around the world so please try to keep it brief but clear.
2405
2406If the bug you are reporting has security implications, which make it
2407inappropriate to send to a publicly archived mailing list, then please send
2408it to perl5-security-report@perl.org. This points to a closed subscription
2409unarchived mailing list, which includes all the core committers, who be able
2410to help assess the impact of issues, figure out a resolution, and help
2411co-ordinate the release of patches to mitigate or fix the problem across all
2412platforms on which Perl is supported. Please only use this address for security
2413issues in the Perl core, not for modules independently distributed on CPAN.
2414
2415If you are unsure what makes a good bug report please read "How to
2416report Bugs Effectively" by Simon Tatham:
2417http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
2418
2419=head1 Coexistence with earlier versions of perl 5
2420
2421Perl 5.20.2 is not binary compatible with versions of Perl earlier than 5.20.0.
2422In other words, you will have to recompile your XS modules.
2423
2424In general, you can usually safely upgrade from one version of Perl (e.g.
24255.X.Y) to another similar minor version (e.g. 5.X.(Y+1))) without
2426re-compiling all of your extensions.  You can also safely leave the old
2427version around in case the new version causes you problems for some reason.
2428
2429Usually, most extensions will probably not need to be recompiled to be
2430used with a newer version of Perl.  Here is how it is supposed to work.
2431(These examples assume you accept all the Configure defaults.)
2432
2433Suppose you already have version 5.8.7 installed.  The directories
2434searched by 5.8.7 are typically like:
2435
2436	/usr/local/lib/perl5/5.8.7/$archname
2437	/usr/local/lib/perl5/5.8.7
2438	/usr/local/lib/perl5/site_perl/5.8.7/$archname
2439	/usr/local/lib/perl5/site_perl/5.8.7
2440
2441Now, suppose you install version 5.8.8.  The directories
2442searched by version 5.8.8 will be:
2443
2444	/usr/local/lib/perl5/5.8.8/$archname
2445	/usr/local/lib/perl5/5.8.8
2446	/usr/local/lib/perl5/site_perl/5.8.8/$archname
2447	/usr/local/lib/perl5/site_perl/5.8.8
2448
2449	/usr/local/lib/perl5/site_perl/5.8.7/$archname
2450	/usr/local/lib/perl5/site_perl/5.8.7
2451	/usr/local/lib/perl5/site_perl/
2452
2453Notice the last three entries -- Perl understands the default structure
2454of the $sitelib directories and will look back in older, compatible
2455directories.  This way, modules installed under 5.8.7 will continue
2456to be usable by 5.8.7 but will also accessible to 5.8.8.  Further,
2457suppose that you upgrade a module to one which requires features
2458present only in 5.8.8.  That new module will get installed into
2459/usr/local/lib/perl5/site_perl/5.8.8 and will be available to 5.8.8,
2460but will not interfere with the 5.8.7 version.
2461
2462The last entry, /usr/local/lib/perl5/site_perl/, is there so that
24635.6.0 and above will look for 5.004-era pure perl modules.
2464
2465Lastly, suppose you now install 5.10.0, which is not binary compatible
2466with 5.8.x.  The directories searched by 5.10.0 (if you don't change the
2467Configure defaults) will be:
2468
2469	/usr/local/lib/perl5/5.10.0/$archname
2470	/usr/local/lib/perl5/5.10.0
2471	/usr/local/lib/perl5/site_perl/5.10.0/$archname
2472	/usr/local/lib/perl5/site_perl/5.10.0
2473
2474	/usr/local/lib/perl5/site_perl/5.8.8
2475
2476	/usr/local/lib/perl5/site_perl/5.8.7
2477
2478	/usr/local/lib/perl5/site_perl/
2479
2480Note that the earlier $archname entries are now gone, but pure perl
2481modules from earlier versions will still be found.
2482
2483This way, you can choose to share compatible extensions, but also upgrade
2484to a newer version of an extension that may be incompatible with earlier
2485versions, without breaking the earlier versions' installations.
2486
2487=head2 Maintaining completely separate versions
2488
2489Many users prefer to keep all versions of perl in completely
2490separate directories.  This guarantees that an update to one version
2491won't interfere with another version.  (The defaults guarantee this for
2492libraries after 5.6.0, but not for executables. TODO?)  One convenient
2493way to do this is by using a separate prefix for each version, such as
2494
2495	sh Configure -Dprefix=/opt/perl5.20.2
2496
2497and adding /opt/perl5.20.2/bin to the shell PATH variable.  Such users
2498may also wish to add a symbolic link /usr/local/bin/perl so that
2499scripts can still start with #!/usr/local/bin/perl.
2500
2501Others might share a common directory for maintenance sub-versions
2502(e.g. 5.10 for all 5.10.x versions), but change directory with
2503each major version.
2504
2505If you are installing a development subversion, you probably ought to
2506seriously consider using a separate directory, since development
2507subversions may not have all the compatibility wrinkles ironed out
2508yet.
2509
2510=head2 Upgrading from 5.19.11 or earlier
2511
2512B<Perl 5.20.2 may not be binary compatible with Perl 5.19.11 or
2513earlier Perl releases.>  Perl modules having binary parts
2514(meaning that a C compiler is used) will have to be recompiled to be
2515used with 5.20.2.  If you find you do need to rebuild an extension with
25165.20.2, you may safely do so without disturbing the older
2517installations.  (See L<"Coexistence with earlier versions of perl 5">
2518above.)
2519
2520See your installed copy of the perllocal.pod file for a (possibly
2521incomplete) list of locally installed modules.  Note that you want
2522perllocal.pod, not perllocale.pod, for installed module information.
2523
2524=head1 Minimizing the Perl installation
2525
2526The following section is meant for people worrying about squeezing the
2527Perl installation into minimal systems (for example when installing
2528operating systems, or in really small filesystems).
2529
2530Leaving out as many extensions as possible is an obvious way:
2531Encode, with its big conversion tables, consumes a lot of
2532space.  On the other hand, you cannot throw away everything.  The
2533Fcntl module is pretty essential.  If you need to do network
2534programming, you'll appreciate the Socket module, and so forth: it all
2535depends on what do you need to do.
2536
2537In the following we offer two different slimmed down installation
2538recipes.  They are informative, not normative: the choice of files
2539depends on what you need.
2540
2541Firstly, the bare minimum to run this script
2542
2543  use strict;
2544  use warnings;
2545  foreach my $f (</*>) {
2546     print("$f\n");
2547  }
2548
2549in Linux with perl-5.20.2 is as follows (under $Config{prefix}):
2550
2551  ./bin/perl
2552  ./lib/perl5/5.20.2/strict.pm
2553  ./lib/perl5/5.20.2/warnings.pm
2554  ./lib/perl5/5.20.2/i686-linux/File/Glob.pm
2555  ./lib/perl5/5.20.2/feature.pm
2556  ./lib/perl5/5.20.2/XSLoader.pm
2557  ./lib/perl5/5.20.2/i686-linux/auto/File/Glob/Glob.so
2558
2559Secondly, for perl-5.10.1, the Debian perl-base package contains 591 files,
2560(of which 510 are for lib/unicore) totaling about 3.5MB in its i386 version.
2561Omitting the lib/unicore/* files for brevity, the remaining files are:
2562
2563  /usr/bin/perl
2564  /usr/bin/perl5.10.1
2565  /usr/lib/perl/5.10.1/Config.pm
2566  /usr/lib/perl/5.10.1/Config_git.pl
2567  /usr/lib/perl/5.10.1/Config_heavy.pl
2568  /usr/lib/perl/5.10.1/Cwd.pm
2569  /usr/lib/perl/5.10.1/DynaLoader.pm
2570  /usr/lib/perl/5.10.1/Errno.pm
2571  /usr/lib/perl/5.10.1/Fcntl.pm
2572  /usr/lib/perl/5.10.1/File/Glob.pm
2573  /usr/lib/perl/5.10.1/Hash/Util.pm
2574  /usr/lib/perl/5.10.1/IO.pm
2575  /usr/lib/perl/5.10.1/IO/File.pm
2576  /usr/lib/perl/5.10.1/IO/Handle.pm
2577  /usr/lib/perl/5.10.1/IO/Pipe.pm
2578  /usr/lib/perl/5.10.1/IO/Seekable.pm
2579  /usr/lib/perl/5.10.1/IO/Select.pm
2580  /usr/lib/perl/5.10.1/IO/Socket.pm
2581  /usr/lib/perl/5.10.1/IO/Socket/INET.pm
2582  /usr/lib/perl/5.10.1/IO/Socket/UNIX.pm
2583  /usr/lib/perl/5.10.1/List/Util.pm
2584  /usr/lib/perl/5.10.1/POSIX.pm
2585  /usr/lib/perl/5.10.1/Scalar/Util.pm
2586  /usr/lib/perl/5.10.1/Socket.pm
2587  /usr/lib/perl/5.10.1/XSLoader.pm
2588  /usr/lib/perl/5.10.1/auto/Cwd/Cwd.so
2589  /usr/lib/perl/5.10.1/auto/DynaLoader/autosplit.ix
2590  /usr/lib/perl/5.10.1/auto/DynaLoader/dl_expandspec.al
2591  /usr/lib/perl/5.10.1/auto/DynaLoader/dl_find_symbol_anywhere.al
2592  /usr/lib/perl/5.10.1/auto/DynaLoader/dl_findfile.al
2593  /usr/lib/perl/5.10.1/auto/Fcntl/Fcntl.so
2594  /usr/lib/perl/5.10.1/auto/File/Glob/Glob.so
2595  /usr/lib/perl/5.10.1/auto/Hash/Util/Util.so
2596  /usr/lib/perl/5.10.1/auto/IO/IO.so
2597  /usr/lib/perl/5.10.1/auto/List/Util/Util.so
2598  /usr/lib/perl/5.10.1/auto/POSIX/POSIX.so
2599  /usr/lib/perl/5.10.1/auto/POSIX/autosplit.ix
2600  /usr/lib/perl/5.10.1/auto/POSIX/load_imports.al
2601  /usr/lib/perl/5.10.1/auto/Socket/Socket.so
2602  /usr/lib/perl/5.10.1/lib.pm
2603  /usr/lib/perl/5.10.1/re.pm
2604  /usr/share/doc/perl/AUTHORS.gz
2605  /usr/share/doc/perl/Documentation
2606  /usr/share/doc/perl/README.Debian
2607  /usr/share/doc/perl/changelog.Debian.gz
2608  /usr/share/doc/perl/copyright
2609  /usr/share/lintian/overrides/perl-base
2610  /usr/share/man/man1/perl.1.gz
2611  /usr/share/man/man1/perl5.10.1.1.gz
2612  /usr/share/perl/5.10.1/AutoLoader.pm
2613  /usr/share/perl/5.10.1/Carp.pm
2614  /usr/share/perl/5.10.1/Carp/Heavy.pm
2615  /usr/share/perl/5.10.1/Exporter.pm
2616  /usr/share/perl/5.10.1/Exporter/Heavy.pm
2617  /usr/share/perl/5.10.1/File/Spec.pm
2618  /usr/share/perl/5.10.1/File/Spec/Unix.pm
2619  /usr/share/perl/5.10.1/FileHandle.pm
2620  /usr/share/perl/5.10.1/Getopt/Long.pm
2621  /usr/share/perl/5.10.1/IPC/Open2.pm
2622  /usr/share/perl/5.10.1/IPC/Open3.pm
2623  /usr/share/perl/5.10.1/SelectSaver.pm
2624  /usr/share/perl/5.10.1/Symbol.pm
2625  /usr/share/perl/5.10.1/Text/ParseWords.pm
2626  /usr/share/perl/5.10.1/Text/Tabs.pm
2627  /usr/share/perl/5.10.1/Text/Wrap.pm
2628  /usr/share/perl/5.10.1/Tie/Hash.pm
2629  /usr/share/perl/5.10.1/attributes.pm
2630  /usr/share/perl/5.10.1/base.pm
2631  /usr/share/perl/5.10.1/bytes.pm
2632  /usr/share/perl/5.10.1/bytes_heavy.pl
2633  /usr/share/perl/5.10.1/constant.pm
2634  /usr/share/perl/5.10.1/fields.pm
2635  /usr/share/perl/5.10.1/integer.pm
2636  /usr/share/perl/5.10.1/locale.pm
2637  /usr/share/perl/5.10.1/overload.pm
2638  /usr/share/perl/5.10.1/strict.pm
2639  /usr/share/perl/5.10.1/unicore/*
2640  /usr/share/perl/5.10.1/utf8.pm
2641  /usr/share/perl/5.10.1/utf8_heavy.pl
2642  /usr/share/perl/5.10.1/vars.pm
2643  /usr/share/perl/5.10.1/warnings.pm
2644  /usr/share/perl/5.10.1/warnings/register.pm
2645
2646A nice trick to find out the minimal set of Perl library files you will
2647need to run a Perl program is
2648
2649   perl -e 'do "prog.pl"; END { print "$_\n" for sort keys %INC }'
2650
2651(this will not find libraries required in runtime, unfortunately, but
2652it's a minimal set) and if you want to find out all the files you can
2653use something like the below
2654
2655 strace perl -le 'do "x.pl"' 2>&1 \
2656                             | perl -nle '/^open\(\"(.+?)"/ && print $1'
2657
2658(The 'strace' is Linux-specific, other similar utilities include 'truss'
2659and 'ktrace'.)
2660
2661=head2 C<-DNO_MATHOMS>
2662
2663If you configure perl with C<-Accflags=-DNO_MATHOMS>, the functions from
2664F<mathoms.c> will not be compiled in. Those functions are no longer used
2665by perl itself; for source compatibility reasons, though, they weren't
2666completely removed.
2667
2668=head1 DOCUMENTATION
2669
2670Read the manual entries before running perl.  The main documentation
2671is in the pod/ subdirectory and should have been installed during the
2672build process.  Type B<man perl> to get started.  Alternatively, you
2673can type B<perldoc perl> to use the supplied perldoc script.  This is
2674sometimes useful for finding things in the library modules.
2675
2676=head1 AUTHOR
2677
2678Original author:  Andy Dougherty doughera@lafayette.edu , borrowing very
2679heavily from the original README by Larry Wall, with lots of helpful
2680feedback and additions from the perl5-porters@perl.org folks.
2681
2682If you have problems, corrections, or questions, please see
2683L<"Reporting Problems"> above.
2684
2685=head1 REDISTRIBUTION
2686
2687This document is part of the Perl package and may be distributed under
2688the same terms as perl itself, with the following additional request:
2689If you are distributing a modified version of perl (perhaps as part of
2690a larger package) please B<do> modify these installation instructions
2691and the contact information to match your distribution.
2692