This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [perl #36061] Not OK: perl v5.8.7 on darwin-2level 8.1.0 (UNINSTALLED)
[perl5.git] / README.macosx
CommitLineData
9ff7b177
JH
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
ffb8d87a
DD
16The latest Perl (5.8.8 as of this writing) builds without changes
17under Mac OS X. Under the 10.4 "Tiger" release, all self-tests pass,
9ff7b177
JH
18and all standard features are supported.
19
ffb8d87a
DD
20Mac OS X releases prior to 10.3 "Panther" did not include a completely
21thread-safe libc, so threading is not fully supported when Perl is built
22for these releases. Also, earlier releases included a
9ff7b177
JH
23somewhat buggy libdb, so some of the DB_File tests are known to fail on
24those releases.
25
26
f7451e23 27=head2 Installation Prefix
9ff7b177
JH
28
29The default installation location for this release uses the traditional
30UNIX directory layout under /usr/local. This is the recommended location
31for most users, and will leave the Apple-supplied Perl and its modules
32undisturbed.
33
34Using an installation prefix of '/usr' will result in a directory layout
35that mirrors that of Apple's default Perl, with core modules stored in
36'/System/Library/Perl/${version}', CPAN modules stored in
37'/Library/Perl/${version}', and the addition of
38'/Network/Library/Perl/${version}' to @INC for modules that are stored
39on a file server and used by many Macs.
40
41
f7451e23 42=head2 libperl and Prebinding
9ff7b177
JH
43
44Mac OS X ships with a dynamically-loaded libperl, but the default for
45this release is to compile a static libperl. The reason for this is
46pre-binding. Dynamic libraries can be pre-bound to a specific address in
47memory in order to decrease load time. To do this, one needs to be aware
48of the location and size of all previously-loaded libraries. Apple
49collects this information as part of their overall OS build process, and
50thus has easy access to it when building Perl, but ordinary users would
51need to go to a great deal of effort to obtain the information needed
52for pre-binding.
53
f7451e23
JH
54You can override the default and build a shared libperl if you wish
55(S<Configure ... -Duseshrlib>), but the load time will be
56significantly greater than either the static library, or Apple's
57pre-bound dynamic library.
9ff7b177
JH
58
59
ffb8d87a 60=head2 Updating Apple-supplied Perl
9ff7b177 61
ffb8d87a
DD
62Apple ships a threaded build of perl 5.8.6 with Mac OS 10.4.x, "Tiger".
63In most cases, if you need a newer Perl, it is preferable to install it in some
9ff7b177 64other location, such as /usr/local or /opt, rather than overwriting the
f7451e23
JH
65system Perl. The default location (no -Dprefix=... specified when running
66Configure) is /usr/local.
9ff7b177
JH
67
68If you find that you do need to update the system Perl, there is one
69potential issue. If you upgrade using the default static libperl, you
70will find that the dynamic libperl supplied by Apple will not be
71deleted. If both libraries are present when an application that links
72against libperl is built, ld will link against the dynamic library by
73default. So, if you need to replace Apple's dynamic libperl with a
74static libperl, you need to be sure to delete the older dynamic library
75after you've installed the update.
76
77Note that this is only an issue when updating from an older build of the
ffb8d87a 78same Perl version. If you're updating from (for example) 5.8.6 to 5.8.8,
9ff7b177
JH
79this issue won't affect you.
80
ffb8d87a
DD
81=head2 64-bit Perl
82
83By default, perl is built to use 32-bit integers and pointers. The hints file,
84F<hints/darwin.sh>, provides experimental support for 64-bit integers
85and pointers (on G5 processors only) when Configure is run with the
86C<-Duse64bitall> option. Expect many compiler warnings and a number
87of test failures.
88
89=head2 Intel processor support
90
91At the time of writing, the Perl developers have no knowledge of the
92behaviour (or misbehaviour) of the Perl build process when hosted by
93an Intel-based Macintosh. As far as we know, Apple ships Perl 5.8.6
94with Intel developer builds of Mac OS X, so we presume that there
95are few or no problems in building that version of Perl. (The source
96package used by Apple may be found at L<http://opendarwin.org/>.)
97If you encounter problems in building a later version of Perl for an
98Intel-based Macintosh, please file a bug report, if possible by using
99the following command in the build directory:
100
101 ./perl -Ilib utils/perlbug
102
103=head2 Universal binaries
104
105Apple's Xcode development tools, version 2.1 and later, provide
106support for the creation of I<universal binaries>, which contain
107code for both PowerPC and Intel architectures. (In the past, and on
108other platforms, such executable files have been known as I<fat
109binaries>.) Perl's build process currently provides no support for
110the production of universal binaries.
9ff7b177 111
f7451e23
JH
112=head2 Known problems
113
114If you have installed extra libraries such as GDBM through Fink
115(in other words, you have libraries under F</sw/lib>), or libdlcompat
116to F</usr/local/lib>, you may need to be extra careful when running
117Configure to not to confuse Configure and Perl about which libraries
118to use. Being confused will show up for example as "dyld" errors about
119symbol problems, for example during "make test". The safest bet is to run
120Configure as
121
122 Configure ... -Uloclibpth -Dlibpth=/usr/lib
123
124to make Configure look only into the system libraries. If you have some
125extra library directories that you really want to use (such as newer
126Berkeley DB libraries in pre-Panther systems), add those to the libpth:
127
128 Configure ... -Uloclibpth -Dlibpth='/usr/lib /opt/lib'
129
130The default of building Perl statically may cause problems with complex
131applications like Tk: in that case consider building shared Perl
132
133 Configure ... -Duseshrplib
134
135but remember that there's a startup cost to pay in that case (see above
136"libperl and Prebinding").
137
80626d0c 138Starting with Tiger (Mac OS X 10.4), Apple shipped broken locale files for
ffb8d87a
DD
139the eu_ES locale (Basque-Spain). In previous releases of Perl, this resulted in
140failures in the C<lib/locale> test. These failures have been supressed
141in the current release of Perl by making the test ignore the broken locale.
142If you need to use the eu_ES locale, you should contact Apple support.
f7451e23
JH
143
144=head2 MacPerl
9ff7b177
JH
145
146Quite a bit has been written about MacPerl, the Perl distribution for
147"Classic MacOS" - that is, versions 9 and earlier of MacOS. Because it
148runs in environment that's very different from that of UNIX, many things
149are done differently in MacPerl. Modules are installed using a different
150procedure, Perl itself is built differently, path names are different,
151etc.
152
153From the perspective of a Perl programmer, Mac OS X is more like a
154traditional UNIX than Classic MacOS. If you find documentation that
155refers to a special procedure that's needed for MacOS that's drastically
156different from the instructions provided for UNIX, the MacOS
157instructions are quite often intended for MacPerl on Classic MacOS. In
158that case, the correct procedure on Mac OS X is usually to follow the
159UNIX instructions, rather than the MacPerl instructions.
160
161
f7451e23 162=head2 Carbon
9ff7b177
JH
163
164MacPerl ships with a number of modules that are used to access the
165classic MacOS toolbox. Many of these modules have been updated to use
166Mac OS X's newer "Carbon" toolbox, and are available from CPAN in the
167"Mac::Carbon" module.
168
169
f7451e23 170=head2 Cocoa
9ff7b177
JH
171
172There are two ways to use Cocoa from Perl. Apple's PerlObjCBridge
173module, included with Mac OS X, can be used by standalone scripts to
174access Foundation (i.e. non-GUI) classes and objects.
175
176An alternative is CamelBones, a framework that allows access to both
177Foundation and AppKit classes and objects, so that full GUI applications
178can be built in Perl. CamelBones can be found on SourceForge, at
179L<http://www.sourceforge.net/projects/camelbones/>.
180
181
6c8f3f7c
JH
182=head1 Starting From Scratch
183
184Unfortunately it is not that difficult somehow manage to break one's
185Mac OS X Perl rather severely. If all else fails and you want to
186really, B<REALLY>, start from scratch and remove even your Apple Perl
187installation (which has become corrupted somehow), the following
188instructions should do it. B<Please think twice before following
189these instructions: they are much like conducting brain surgery to
190yourself. Without anesthesia.> We will B<not> come to fix your system
191if you do this.
192
193First, get rid of the libperl.dylib:
194
195 # cd /System/Library/Perl/darwin/CORE
196 # rm libperl.dylib
197
198Then delete every .bundle file found anywhere in the folders:
199
200 /System/Library/Perl
201 /Library/Perl
202
203You can find them for example by
204
205 # find /System/Library/Perl /Library/Perl -name '*.bundle' -print
206
207After this you can either copy Perl from your operating system CDs
208(you will need at least the /System/Library/Perl and /usr/bin/perl),
209or rebuild Perl from the source code with C<Configure -Dprefix=/usr
210-Dusershrplib> NOTE: the C<-Dprefix=/usr> to replace the system Perl
211works much better with Perl 5.8.1 and later, in Perl 5.8.0 the
212settings were not quite right.
213
214
9ff7b177
JH
215=head1 AUTHOR
216
ffb8d87a
DD
217This README was written by Sherm Pendley E<lt>sherm@dot-app.orgE<gt>,
218and subsequently updated by Dominic Dunlop E<lt>domo@computer.orgE<gt>.
6c8f3f7c
JH
219The "Starting From Scratch" recipe was contributed by John Montbriand
220E<lt>montbriand@apple.comE<gt>.
9ff7b177
JH
221
222=head1 DATE
223
ffb8d87a 224Last modified 2005-11-07.