source: trunk/essentials/dev-lang/perl/README.macosx@ 3397

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

perl 5.8.8

File size: 9.2 KB
Line 
1If you read this file _as_is_, just ignore the funny characters you see.
2It is written in the POD format (see pod/perlpod.pod) which is specially
3designed to be readable as is.
4
5=head1 NAME
6
7README.macosx - Perl under Mac OS X
8
9=head1 SYNOPSIS
10
11This document briefly describes perl under Mac OS X.
12
13
14=head1 DESCRIPTION
15
16The latest Perl release (5.8.8 as of this writing) builds without changes
17under Mac OS X. Under 10.3 "Panther" and newer OS versions, all self-tests
18pass, and all standard features are supported.
19
20Earlier Mac OS X releases (10.2 "Jaguar" and older) did not include a
21completely thread-safe libc, so threading is not fully supported. Also,
22earlier releases included a buggy libdb, so some of the DB_File tests
23are known to fail on those releases.
24
25
26=head2 Installation Prefix
27
28The default installation location for this release uses the traditional
29UNIX directory layout under /usr/local. This is the recommended location
30for most users, and will leave the Apple-supplied Perl and its modules
31undisturbed.
32
33Using an installation prefix of '/usr' will result in a directory layout
34that mirrors that of Apple's default Perl, with core modules stored in
35'/System/Library/Perl/${version}', CPAN modules stored in
36'/Library/Perl/${version}', and the addition of
37'/Network/Library/Perl/${version}' to @INC for modules that are stored
38on a file server and used by many Macs.
39
40
41=head2 SDK support
42
43First, export the path to the SDK into the build environment:
44
45 export SDK=/Developer/SDKs/MacOSX10.3.9.sdk
46
47Use an SDK by exporting some additions to Perl's 'ccflags' and '..flags'
48config variables:
49
50 ./Configure -Accflags="-nostdinc -B$SDK/usr/include/gcc \
51 -B$SDK/usr/lib/gcc -isystem$SDK/usr/include \
52 -F$SDK/System/Library/Frameworks" \
53 -Aldflags="-Wl,-syslibroot,$SDK" \
54 -de
55
56=head2 Universal Binary support
57
58To compile perl as a universal binary (built for both ppc and intel), export
59the SDK variable as above, selecting the 10.4u SDK:
60
61 export SDK=/Developer/SDKs/MacOSX10.4u.sdk
62
63In addition to the compiler flags used to select the SDK, also add the flags
64for creating a universal binary:
65
66 ./Configure -Accflags="-arch i686 -arch ppc -nostdinc -B$SDK/usr/include/gcc \
67 -B$SDK/usr/lib/gcc -isystem$SDK/usr/include \
68 -F$SDK/System/Library/Frameworks" \
69 -Aldflags="-arch i686 -arch ppc -Wl,-syslibroot,$SDK" \
70 -de
71
72Keep in mind that these compiler and linker settings will also be used when
73building CPAN modules. For XS modules to be compiled as a universal binary, any
74libraries it links to must also be universal binaries. The system libraries that
75Apple includes with the 10.4u SDK are all universal, but user-installed libraries
76may need to be re-installed as universal binaries.
77
78=head2 libperl and Prebinding
79
80Mac OS X ships with a dynamically-loaded libperl, but the default for
81this release is to compile a static libperl. The reason for this is
82pre-binding. Dynamic libraries can be pre-bound to a specific address in
83memory in order to decrease load time. To do this, one needs to be aware
84of the location and size of all previously-loaded libraries. Apple
85collects this information as part of their overall OS build process, and
86thus has easy access to it when building Perl, but ordinary users would
87need to go to a great deal of effort to obtain the information needed
88for pre-binding.
89
90You can override the default and build a shared libperl if you wish
91(S<Configure ... -Duseshrlib>), but the load time on pre-10.4 OS
92releases will be greater than either the static library, or Apple's
93pre-bound dynamic library.
94
95With 10.4 "Tiger" and newer, Apple has all but eliminated the performance
96penalty for non-prebound libraries.
97
98
99=head2 Updating Apple's Perl
100
101In a word - don't, at least without a *very* good reason. Your scripts
102can just as easily begin with "#!/usr/local/bin/perl" as with
103"#!/usr/bin/perl". Scripts supplied by Apple and other third parties as
104part of installation packages and such have generally only been tested
105with the /usr/bin/perl that's installed by Apple.
106