| 1 | If you read this file _as_is_, just ignore the funny characters you
|
|---|
| 2 | see. It is written in the POD format (see pod/perlpod.pod) which is
|
|---|
| 3 | specifically designed to be readable as is.
|
|---|
| 4 |
|
|---|
| 5 | =head1 NAME
|
|---|
| 6 |
|
|---|
| 7 | README.solaris - Perl version 5 on Solaris systems
|
|---|
| 8 |
|
|---|
| 9 | =head1 DESCRIPTION
|
|---|
| 10 |
|
|---|
| 11 | This document describes various features of Sun's Solaris operating system
|
|---|
| 12 | that will affect how Perl version 5 (hereafter just perl) is
|
|---|
| 13 | compiled and/or runs. Some issues relating to the older SunOS 4.x are
|
|---|
| 14 | also discussed, though they may be out of date.
|
|---|
| 15 |
|
|---|
| 16 | For the most part, everything should just work.
|
|---|
| 17 |
|
|---|
| 18 | Starting with Solaris 8, perl5.00503 (or higher) is supplied with the
|
|---|
| 19 | operating system, so you might not even need to build a newer version
|
|---|
| 20 | of perl at all. The Sun-supplied version is installed in /usr/perl5
|
|---|
| 21 | with /usr/bin/perl pointing to /usr/perl5/bin/perl. Do not disturb
|
|---|
| 22 | that installation unless you really know what you are doing. If you
|
|---|
| 23 | remove the perl supplied with the OS, you will render some bits of
|
|---|
| 24 | your system inoperable. If you wish to install a newer version of perl,
|
|---|
| 25 | install it under a different prefix from /usr/perl5. Common prefixes
|
|---|
| 26 | to use are /usr/local and /opt/perl.
|
|---|
| 27 |
|
|---|
| 28 | You may wish to put your version of perl in the PATH of all users by
|
|---|
| 29 | changing the link /usr/bin/perl. This is probably OK, as most perl
|
|---|
| 30 | scripts shipped with Solaris use an explicit path. (There are a few
|
|---|
| 31 | exceptions, such as /usr/bin/rpm2cpio and /etc/rcm/scripts/README, but
|
|---|
| 32 | these are also sufficiently generic that the actual version of perl
|
|---|
| 33 | probably doesn't matter too much.)
|
|---|
| 34 |
|
|---|
| 35 | Solaris ships with a range of Solaris-specific modules. If you choose
|
|---|
| 36 | to install your own version of perl you will find the source of many of
|
|---|
| 37 | these modules is available on CPAN under the Sun::Solaris:: namespace.
|
|---|
| 38 |
|
|---|
| 39 | Solaris may include two versions of perl, e.g. Solaris 9 includes
|
|---|
| 40 | both 5.005_03 and 5.6.1. This is to provide stability across Solaris
|
|---|
| 41 | releases, in cases where a later perl version has incompatibilities
|
|---|
| 42 | with the version included in the preceeding Solaris release. The
|
|---|
| 43 | default perl version will always be the most recent, and in general
|
|---|
| 44 | the old version will only be retained for one Solaris release. Note
|
|---|
| 45 | also that the default perl will NOT be configured to search for modules
|
|---|
| 46 | in the older version, again due to compatibility/stability concerns.
|
|---|
| 47 | As a consequence if you upgrade Solaris, you will have to
|
|---|
| 48 | rebuild/reinstall any additional CPAN modules that you installed for
|
|---|
| 49 | the previous Solaris version. See the CPAN manpage under 'autobundle'
|
|---|
| 50 | for a quick way of doing this.
|
|---|
| 51 |
|
|---|
| 52 | As an interim measure, you may either change the #! line of your
|
|---|
| 53 | scripts to specifically refer to the old perl version, e.g. on
|
|---|
| 54 | Solaris 9 use #!/usr/perl5/5.00503/bin/perl to use the perl version
|
|---|
| 55 | that was the default for Solaris 8, or if you have a large number of
|
|---|
| 56 | scripts it may be more convenient to make the old version of perl the
|
|---|
| 57 | default on your system. You can do this by changing the appropriate
|
|---|
| 58 | symlinks under /usr/perl5 as follows (example for Solaris 9):
|
|---|
| 59 |
|
|---|
| 60 | # cd /usr/perl5
|
|---|
| 61 | # rm bin man pod
|
|---|
| 62 | # ln -s ./5.00503/bin
|
|---|
| 63 | # ln -s ./5.00503/man
|
|---|
| 64 | # ln -s ./5.00503/lib/pod
|
|---|
| 65 | # rm /usr/bin/perl
|
|---|
| 66 | # ln -s ../perl5/5.00503/bin/perl /usr/bin/perl
|
|---|
| 67 |
|
|---|
| 68 | In both cases this should only be considered to be a temporary
|
|---|
| 69 | measure - you should upgrade to the later version of perl as soon as
|
|---|
| 70 | is practicable.
|
|---|
| 71 |
|
|---|
| 72 | Note also that the perl command-line utilities (e.g. perldoc) and any
|
|---|
| 73 | that are added by modules that you install will be under
|
|---|
| 74 | /usr/perl5/bin, so that directory should be added to your PATH.
|
|---|
| 75 |
|
|---|
| 76 | =head2 Solaris Version Numbers.
|
|---|
| 77 |
|
|---|
| 78 | For consistency with common usage, perl's Configure script performs
|
|---|
| 79 | some minor manipulations on the operating system name and version
|
|---|
| 80 | number as reported by uname. Here's a partial translation table:
|
|---|
| 81 |
|
|---|
| 82 | Sun: perl's Configure:
|
|---|
| 83 | uname uname -r Name osname osvers
|
|---|
| 84 | SunOS 4.1.3 Solaris 1.1 sunos 4.1.3
|
|---|
| 85 | SunOS 5.6 Solaris 2.6 solaris 2.6
|
|---|
| 86 | SunOS 5.8 Solaris 8 solaris 2.8
|
|---|
| 87 | SunOS 5.9 Solaris 9 solaris 2.9
|
|---|
| 88 | SunOS 5.10 Solaris 10 solaris 2.10
|
|---|
| 89 |
|
|---|
| 90 | The complete table can be found in the Sun Managers' FAQ
|
|---|
| 91 | L<ftp://ftp.cs.toronto.edu/pub/jdd/sunmanagers/faq> under
|
|---|
| 92 | "9.1) Which Sun models run which versions of SunOS?".
|
|---|
| 93 |
|
|---|
| 94 | =head1 RESOURCES
|
|---|
| 95 |
|
|---|
| 96 | There are many, many sources for Solaris information. A few of the
|
|---|
| 97 | important ones for perl:
|
|---|
| 98 |
|
|---|
| 99 | =over 4
|
|---|
| 100 |
|
|---|
| 101 | =item Solaris FAQ
|
|---|
| 102 |
|
|---|
| 103 | The Solaris FAQ is available at
|
|---|
| 104 | L<http://www.science.uva.nl/pub/solaris/solaris2.html>.
|
|---|
| 105 |
|
|---|
| 106 | The Sun Managers' FAQ is available at
|
|---|
| 107 | L<ftp://ftp.cs.toronto.edu/pub/jdd/sunmanagers/faq>
|
|---|
| 108 |
|
|---|
| 109 | =item Precompiled Binaries
|
|---|
| 110 |
|
|---|
| 111 | Precompiled binaries, links to many sites, and much, much more are
|
|---|
| 112 | available at L<http://www.sunfreeware.com/> and
|
|---|
| 113 | L<http://www.blastwave.org/>.
|
|---|
| 114 |
|
|---|
| 115 | =item Solaris Documentation
|
|---|
| 116 |
|
|---|
| 117 | All Solaris documentation is available on-line at L<http://docs.sun.com/>.
|
|---|
| 118 |
|
|---|
| 119 | =back
|
|---|
| 120 |
|
|---|
| 121 | =head1 SETTING UP
|
|---|
| 122 |
|
|---|
| 123 | =head2 File Extraction Problems on Solaris.
|
|---|
| 124 |
|
|---|
| 125 | Be sure to use a tar program compiled under Solaris (not SunOS 4.x)
|
|---|
| 126 | to extract the perl-5.x.x.tar.gz file. Do not use GNU tar compiled
|
|---|
| 127 | for SunOS4 on Solaris. (GNU tar compiled for Solaris should be fine.)
|
|---|
| 128 | When you run SunOS4 binaries on Solaris, the run-time system magically
|
|---|
| 129 | alters pathnames matching m#lib/locale# so that when tar tries to create
|
|---|
| 130 | lib/locale.pm, a file named lib/oldlocale.pm gets created instead.
|
|---|
| 131 | If you found this advice too late and used a SunOS4-compiled tar
|
|---|
| 132 | anyway, you must find the incorrectly renamed file and move it back
|
|---|
| 133 | to lib/locale.pm.
|
|---|
| 134 |
|
|---|
| 135 | =head2 Compiler and Related Tools on Solaris.
|
|---|
| 136 |
|
|---|
| 137 | You must use an ANSI C compiler to build perl. Perl can be compiled
|
|---|
| 138 | with either Sun's add-on C compiler or with gcc. The C compiler that
|
|---|
| 139 | shipped with SunOS4 will not do.
|
|---|
| 140 |
|
|---|
| 141 | =head3 Include /usr/ccs/bin/ in your PATH.
|
|---|
| 142 |
|
|---|
| 143 | Several tools needed to build perl are located in /usr/ccs/bin/: ar,
|
|---|
| 144 | as, ld, and make. Make sure that /usr/ccs/bin/ is in your PATH.
|
|---|
| 145 |
|
|---|
| 146 | You need to make sure the following packages are installed
|
|---|
| 147 | (this info is extracted from the Solaris FAQ):
|
|---|
| 148 |
|
|---|
| 149 | for tools (sccs, lex, yacc, make, nm, truss, ld, as): SUNWbtool,
|
|---|
| 150 | SUNWsprot, SUNWtoo
|
|---|
| 151 |
|
|---|
| 152 | for libraries & headers: SUNWhea, SUNWarc, SUNWlibm, SUNWlibms, SUNWdfbh,
|
|---|
| 153 | SUNWcg6h, SUNWxwinc, SUNWolinc
|
|---|
| 154 |
|
|---|
| 155 | for 64 bit development: SUNWarcx, SUNWbtoox, SUNWdplx, SUNWscpux,
|
|---|
| 156 | SUNWsprox, SUNWtoox, SUNWlmsx, SUNWlmx, SUNWlibCx
|
|---|
| 157 |
|
|---|
| 158 | If you are in doubt which package contains a file you are missing,
|
|---|
| 159 | try to find an installation that has that file. Then do a
|
|---|
| 160 |
|
|---|
| 161 | $ grep /my/missing/file /var/sadm/install/contents
|
|---|
| 162 |
|
|---|
| 163 | This will display a line like this:
|
|---|
| 164 |
|
|---|
| 165 | /usr/include/sys/errno.h f none 0644 root bin 7471 37605 956241356 SUNWhea
|
|---|
| 166 |
|
|---|
| 167 | The last item listed (SUNWhea in this example) is the package you need.
|
|---|
| 168 |
|
|---|
| 169 | =head3 Avoid /usr/ucb/cc.
|
|---|
| 170 |
|
|---|
| 171 | You don't need to have /usr/ucb/ in your PATH to build perl. If you
|
|---|
| 172 | want /usr/ucb/ in your PATH anyway, make sure that /usr/ucb/ is NOT
|
|---|
| 173 | in your PATH before the directory containing the right C compiler.
|
|---|
| 174 |
|
|---|
| 175 | =head3 Sun's C Compiler
|
|---|
| 176 |
|
|---|
| 177 | If you use Sun's C compiler, make sure the correct directory
|
|---|
| 178 | (usually /opt/SUNWspro/bin/) is in your PATH (before /usr/ucb/).
|
|---|
| 179 |
|
|---|
| 180 | =head3 GCC
|
|---|
| 181 |
|
|---|
| 182 | If you use gcc, make sure your installation is recent and complete.
|
|---|
| 183 | perl versions since 5.6.0 build fine with gcc > 2.8.1 on Solaris >=
|
|---|
| 184 | 2.6.
|
|---|
| 185 |
|
|---|
| 186 | You must Configure perl with
|
|---|
| 187 |
|
|---|
| 188 | $ sh Configure -Dcc=gcc
|
|---|
| 189 |
|
|---|
| 190 | If you don't, you may experience strange build errors.
|
|---|
| 191 |
|
|---|
| 192 | If you have updated your Solaris version, you may also have to update
|
|---|
| 193 | your gcc. For example, if you are running Solaris 2.6 and your gcc is
|
|---|
| 194 | installed under /usr/local, check in /usr/local/lib/gcc-lib and make
|
|---|
| 195 | sure you have the appropriate directory, sparc-sun-solaris2.6/ or
|
|---|
| 196 | i386-pc-solaris2.6/. If gcc's directory is for a different version of
|
|---|
| 197 | Solaris than you are running, then you will need to rebuild gcc for
|
|---|
| 198 | your new version of Solaris.
|
|---|
| 199 |
|
|---|
| 200 | You can get a precompiled version of gcc from
|
|---|
| 201 | L<http://www.sunfreeware.com/> or L<http://www.blastwave.org/>. Make
|
|---|
| 202 | sure you pick up the package for your Solaris release.
|
|---|
| 203 |
|
|---|
| 204 | If you wish to use gcc to build add-on modules for use with the perl
|
|---|
| 205 | shipped with Solaris, you should use the Solaris::PerlGcc module
|
|---|
| 206 | which is available from CPAN. The perl shipped with Solaris
|
|---|
| 207 | is configured and built with the Sun compilers, and the compiler
|
|---|
| 208 | configuration information stored in Config.pm is therefore only
|
|---|
| 209 | relevant to the Sun compilers. The Solaris:PerlGcc module contains a
|
|---|
| 210 | replacement Config.pm that is correct for gcc - see the module for
|
|---|
| 211 | details.
|
|---|
| 212 |
|
|---|
| 213 | =head3 GNU as and GNU ld
|
|---|
| 214 |
|
|---|
| 215 | The following information applies to gcc version 2. Volunteers to
|
|---|
| 216 | update it as appropropriate for gcc version 3 would be appreciated.
|
|---|
| 217 |
|
|---|
|
|---|