Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v8plus / man / man1 / perlmacosx.1
CommitLineData
920dae64
AT
1.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "PERLMACOSX 1"
132.TH PERLMACOSX 1 "2006-01-07" "perl v5.8.8" "Perl Programmers Reference Guide"
133.SH "NAME"
134README.macosx \- Perl under Mac OS X
135.SH "SYNOPSIS"
136.IX Header "SYNOPSIS"
137This document briefly describes perl under Mac \s-1OS\s0 X.
138.SH "DESCRIPTION"
139.IX Header "DESCRIPTION"
140The latest Perl release (5.8.8 as of this writing) builds without changes
141under Mac \s-1OS\s0 X. Under 10.3 \*(L"Panther\*(R" and newer \s-1OS\s0 versions, all self-tests
142pass, and all standard features are supported.
143.PP
144Earlier Mac \s-1OS\s0 X releases (10.2 \*(L"Jaguar\*(R" and older) did not include a
145completely thread-safe libc, so threading is not fully supported. Also,
146earlier releases included a buggy libdb, so some of the DB_File tests
147are known to fail on those releases.
148.Sh "Installation Prefix"
149.IX Subsection "Installation Prefix"
150The default installation location for this release uses the traditional
151\&\s-1UNIX\s0 directory layout under /usr/local. This is the recommended location
152for most users, and will leave the Apple-supplied Perl and its modules
153undisturbed.
154.PP
155Using an installation prefix of '/usr' will result in a directory layout
156that mirrors that of Apple's default Perl, with core modules stored in
157\&'/System/Library/Perl/${version}', \s-1CPAN\s0 modules stored in
158\&'/Library/Perl/${version}', and the addition of
159\&'/Network/Library/Perl/${version}' to \f(CW@INC\fR for modules that are stored
160on a file server and used by many Macs.
161.Sh "\s-1SDK\s0 support"
162.IX Subsection "SDK support"
163First, export the path to the \s-1SDK\s0 into the build environment:
164.PP
165.Vb 1
166\& export SDK=/Developer/SDKs/MacOSX10.3.9.sdk
167.Ve
168.PP
169Use an \s-1SDK\s0 by exporting some additions to Perl's 'ccflags' and '..flags'
170config variables:
171.PP
172.Vb 5
173\& ./Configure -Accflags="-nostdinc -B$SDK/usr/include/gcc \e
174\& -B$SDK/usr/lib/gcc -isystem$SDK/usr/include \e
175\& -F$SDK/System/Library/Frameworks" \e
176\& -Aldflags="-Wl,-syslibroot,$SDK" \e
177\& -de
178.Ve
179.Sh "Universal Binary support"
180.IX Subsection "Universal Binary support"
181To compile perl as a universal binary (built for both ppc and intel), export
182the \s-1SDK\s0 variable as above, selecting the 10.4u \s-1SDK:\s0
183.PP
184.Vb 1
185\& export SDK=/Developer/SDKs/MacOSX10.4u.sdk
186.Ve
187.PP
188In addition to the compiler flags used to select the \s-1SDK\s0, also add the flags
189for creating a universal binary:
190.PP
191.Vb 5
192\& ./Configure -Accflags="-arch i686 -arch ppc -nostdinc -B$SDK/usr/include/gcc \e
193\& -B$SDK/usr/lib/gcc -isystem$SDK/usr/include \e
194\& -F$SDK/System/Library/Frameworks" \e
195\& -Aldflags="-arch i686 -arch ppc -Wl,-syslibroot,$SDK" \e
196\& -de
197.Ve
198.PP
199Keep in mind that these compiler and linker settings will also be used when
200building \s-1CPAN\s0 modules. For \s-1XS\s0 modules to be compiled as a universal binary, any
201libraries it links to must also be universal binaries. The system libraries that
202Apple includes with the 10.4u \s-1SDK\s0 are all universal, but user-installed libraries
203may need to be re-installed as universal binaries.
204.Sh "libperl and Prebinding"
205.IX Subsection "libperl and Prebinding"
206Mac \s-1OS\s0 X ships with a dynamically-loaded libperl, but the default for
207this release is to compile a static libperl. The reason for this is
208pre\-binding. Dynamic libraries can be pre-bound to a specific address in
209memory in order to decrease load time. To do this, one needs to be aware
210of the location and size of all previously-loaded libraries. Apple
211collects this information as part of their overall \s-1OS\s0 build process, and
212thus has easy access to it when building Perl, but ordinary users would
213need to go to a great deal of effort to obtain the information needed
214for pre\-binding.
215.PP
216You can override the default and build a shared libperl if you wish
217(Configure\ ...\ \-Duseshrlib), but the load time on pre\-10.4 \s-1OS\s0
218releases will be greater than either the static library, or Apple's
219pre-bound dynamic library.
220.PP
221With 10.4 \*(L"Tiger\*(R" and newer, Apple has all but eliminated the performance
222penalty for non-prebound libraries.
223.Sh "Updating Apple's Perl"
224.IX Subsection "Updating Apple's Perl"
225In a word \- don't, at least without a *very* good reason. Your scripts
226can just as easily begin with \*(L"#!/usr/local/bin/perl\*(R" as with
227\&\*(L"#!/usr/bin/perl\*(R". Scripts supplied by Apple and other third parties as
228part of installation packages and such have generally only been tested
229with the /usr/bin/perl that's installed by Apple.
230.PP
231If you find that you do need to update the system Perl, one issue worth
232keeping in mind is the question of static vs. dynamic libraries. If you
233upgrade using the default static libperl, you will find that the dynamic
234libperl supplied by Apple will not be deleted. If both libraries are
235present when an application that links against libperl is built, ld will
236link against the dynamic library by default. So, if you need to replace
237Apple's dynamic libperl with a static libperl, you need to be sure to
238delete the older dynamic library after you've installed the update.
239.Sh "Known problems"
240.IX Subsection "Known problems"
241If you have installed extra libraries such as \s-1GDBM\s0 through Fink
242(in other words, you have libraries under \fI/sw/lib\fR), or libdlcompat
243to \fI/usr/local/lib\fR, you may need to be extra careful when running
244Configure to not to confuse Configure and Perl about which libraries
245to use. Being confused will show up for example as \*(L"dyld\*(R" errors about
246symbol problems, for example during \*(L"make test\*(R". The safest bet is to run
247Configure as
248.PP
249.Vb 1
250\& Configure ... -Uloclibpth -Dlibpth=/usr/lib
251.Ve
252.PP
253to make Configure look only into the system libraries. If you have some
254extra library directories that you really want to use (such as newer
255Berkeley \s-1DB\s0 libraries in pre-Panther systems), add those to the libpth:
256.PP
257.Vb 1
258\& Configure ... -Uloclibpth -Dlibpth='/usr/lib /opt/lib'
259.Ve
260.PP
261The default of building Perl statically may cause problems with complex
262applications like Tk: in that case consider building shared Perl
263.PP
264.Vb 1
265\& Configure ... -Duseshrplib
266.Ve
267.PP
268but remember that there's a startup cost to pay in that case (see above
269\&\*(L"libperl and Prebinding\*(R").
270.PP
271Starting with Tiger (Mac \s-1OS\s0 X 10.4), Apple shipped broken locale files for
272the eu_ES locale (Basque\-Spain). In previous releases of Perl, this resulted in
273failures in the \f(CW\*(C`lib/locale\*(C'\fR test. These failures have been supressed
274in the current release of Perl by making the test ignore the broken locale.
275If you need to use the eu_ES locale, you should contact Apple support.
276.Sh "MacPerl"
277.IX Subsection "MacPerl"
278Quite a bit has been written about MacPerl, the Perl distribution for
279\&\*(L"Classic MacOS\*(R" \- that is, versions 9 and earlier of MacOS. Because it
280runs in environment that's very different from that of \s-1UNIX\s0, many things
281are done differently in MacPerl. Modules are installed using a different
282procedure, Perl itself is built differently, path names are different,
283etc.
284.PP
285From the perspective of a Perl programmer, Mac \s-1OS\s0 X is more like a
286traditional \s-1UNIX\s0 than Classic MacOS. If you find documentation that
287refers to a special procedure that's needed for MacOS that's drastically
288different from the instructions provided for \s-1UNIX\s0, the MacOS
289instructions are quite often intended for MacPerl on Classic MacOS. In
290that case, the correct procedure on Mac \s-1OS\s0 X is usually to follow the
291\&\s-1UNIX\s0 instructions, rather than the MacPerl instructions.
292.Sh "Carbon"
293.IX Subsection "Carbon"
294MacPerl ships with a number of modules that are used to access the
295classic MacOS toolbox. Many of these modules have been updated to use
296Mac \s-1OS\s0 X's newer \*(L"Carbon\*(R" toolbox, and are available from \s-1CPAN\s0 in the
297\&\*(L"Mac::Carbon\*(R" module.
298.Sh "Cocoa"
299.IX Subsection "Cocoa"
300There are two ways to use Cocoa from Perl. Apple's PerlObjCBridge
301module, included with Mac \s-1OS\s0 X, can be used by standalone scripts to
302access Foundation (i.e. non\-GUI) classes and objects.
303.PP
304An alternative is CamelBones, a framework that allows access to both
305Foundation and AppKit classes and objects, so that full \s-1GUI\s0 applications
306can be built in Perl. CamelBones can be found on SourceForge, at
307<http://www.sourceforge.net/projects/camelbones/>.
308.SH "Starting From Scratch"
309.IX Header "Starting From Scratch"
310Unfortunately it is not that difficult somehow manage to break one's
311Mac \s-1OS\s0 X Perl rather severely. If all else fails and you want to
312really, \fB\s-1REALLY\s0\fR, start from scratch and remove even your Apple Perl
313installation (which has become corrupted somehow), the following
314instructions should do it. \fBPlease think twice before following
315these instructions: they are much like conducting brain surgery to
316yourself. Without anesthesia.\fR We will \fBnot\fR come to fix your system
317if you do this.
318.PP
319First, get rid of the libperl.dylib:
320.PP
321.Vb 2
322\& # cd /System/Library/Perl/darwin/CORE
323\& # rm libperl.dylib
324.Ve
325.PP
326Then delete every .bundle file found anywhere in the folders:
327.PP
328.Vb 2
329\& /System/Library/Perl
330\& /Library/Perl
331.Ve
332.PP
333You can find them for example by
334.PP
335.Vb 1
336\& # find /System/Library/Perl /Library/Perl -name '*.bundle' -print
337.Ve
338.PP
339After this you can either copy Perl from your operating system media
340(you will need at least the /System/Library/Perl and /usr/bin/perl),
341or rebuild Perl from the source code with \f(CW\*(C`Configure \-Dprefix=/usr
342\&\-Dusershrplib\*(C'\fR \s-1NOTE:\s0 the \f(CW\*(C`\-Dprefix=/usr\*(C'\fR to replace the system Perl
343works much better with Perl 5.8.1 and later, in Perl 5.8.0 the
344settings were not quite right.
345.PP
346\&\*(L"Pacifist\*(R" from CharlesSoft (<http://www.charlessoft.com/>) is a nice
347way to extract the Perl binaries from the \s-1OS\s0 media, without having to
348reinstall the entire \s-1OS\s0.
349.SH "AUTHOR"
350.IX Header "AUTHOR"
351This \s-1README\s0 was written by Sherm Pendley <sherm@dot\-app.org>,
352and subsequently updated by Dominic Dunlop <domo@computer.org>.
353The \*(L"Starting From Scratch\*(R" recipe was contributed by John Montbriand
354<montbriand@apple.com>.
355.SH "DATE"
356.IX Header "DATE"
357Last modified 2005\-11\-07.