📄 perlsolaris.pod
字号:
If you read this file _as_is_, just ignore the funny characters yousee. It is written in the POD format (see pod/perlpod.pod) which isspecifically designed to be readable as is.=head1 NAMEREADME.solaris - Perl version 5 on Solaris systems=head1 DESCRIPTIONThis document describes various features of Sun's Solaris operating systemthat will affect how Perl version 5 (hereafter just perl) iscompiled and/or runs. Some issues relating to the older SunOS 4.x arealso discussed, though they may be out of date.For the most part, everything should just work.Starting with Solaris 8, perl5.00503 (or higher) is supplied with theoperating system, so you might not even need to build a newer versionof perl at all. The Sun-supplied version is installed in /usr/perl5with /usr/bin/perl pointing to /usr/perl5/bin/perl. Do not disturbthat installation unless you really know what you are doing. If youremove the perl supplied with the OS, there is a good chance you willrender some bits of your system inoperable. If you wish to install anewer version of perl, install it under a different prefix from/usr/perl5. Common prefixes to use are /usr/local and /opt/perl.You may wish to put your version of perl in the PATH of all users bychanging the link /usr/bin/perl. This is OK, as all Perl scriptsshipped with Solaris use /usr/perl5/bin/perl.=head2 Solaris Version Numbers.For consistency with common usage, perl's Configure script performssome minor manipulations on the operating system name and versionnumber as reported by uname. Here's a partial translation table: Sun: perl's Configure: uname uname -r Name osname osvers SunOS 4.1.3 Solaris 1.1 sunos 4.1.3 SunOS 5.6 Solaris 2.6 solaris 2.6 SunOS 5.8 Solaris 8 solaris 2.8The complete table can be found in the Sun Managers' FAQL<ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/faq> under"9.1) Which Sun models run which versions of SunOS?".=head1 RESOURCESThere are many, many source for Solaris information. A few of theimportant ones for perl:=over 4=item Solaris FAQThe Solaris FAQ is available atL<http://www.science.uva.nl/pub/solaris/solaris2.html>.The Sun Managers' FAQ is available atL<ftp://ftp.cs.toronto.edu/pub/jdd/sun-managers/faq>=item Precompiled BinariesPrecompiled binaries, links to many sites, and much, much more isavailable at L<http://www.sunfreeware.com>.=item Solaris DocumentationAll Solaris documentation is available on-line at L<http://docs.sun.com>.=back=head1 SETTING UP=head2 File Extraction Problems.Be sure to use a tar program compiled under Solaris (not SunOS 4.x)to extract the perl-5.x.x.tar.gz file. Do not use GNU tar compiledfor SunOS4 on Solaris. (GNU tar compiled for Solaris should be fine.)When you run SunOS4 binaries on Solaris, the run-time system magicallyalters pathnames matching m#lib/locale# so that when tar tries to createlib/locale.pm, a file named lib/oldlocale.pm gets created instead.If you found this advice it too late and used a SunOS4-compiled taranyway, you must find the incorrectly renamed file and move it backto lib/locale.pm.=head2 Compiler and Related Tools.You must use an ANSI C compiler to build perl. Perl can be compiledwith either Sun's add-on C compiler or with gcc. The C compiler thatshipped with SunOS4 will not do.=head3 Include /usr/ccs/bin/ in your PATH.Several tools needed to build perl are located in /usr/ccs/bin/: ar,as, ld, and make. Make sure that /usr/ccs/bin/ is in your PATH.You need to make sure the following packages are installed(this info is extracted from the Solaris FAQ):for tools (sccs, lex, yacc, make, nm, truss, ld, as): SUNWbtool,SUNWsprot, SUNWtoofor libraries & headers: SUNWhea, SUNWarc, SUNWlibm, SUNWlibms, SUNWdfbh,SUNWcg6h, SUNWxwinc, SUNWolincfor 64 bit development: SUNWarcx, SUNWbtoox, SUNWdplx, SUNWscpux,SUNWsprox, SUNWtoox, SUNWlmsx, SUNWlmx, SUNWlibCxIf you are in doubt which package contains a file you are missing,try to find an installation that has that file. Then do a grep /my/missing/file /var/sadm/install/contentsThis will display a line like this:/usr/include/sys/errno.h f none 0644 root bin 7471 37605 956241356 SUNWheaThe last item listed (SUNWhea in this example) is the package you need.=head3 Avoid /usr/ucb/cc.You don't need to have /usr/ucb/ in your PATH to build perl. If youwant /usr/ucb/ in your PATH anyway, make sure that /usr/ucb/ is NOTin your PATH before the directory containing the right C compiler.=head3 Sun's C CompilerIf you use Sun's C compiler, make sure the correct directory(usually /opt/SUNWspro/bin/) is in your PATH (before /usr/ucb/).=head3 GCCIf you use gcc, make sure your installation is recent andcomplete. As a point of reference, perl-5.6.0 built fine withgcc-2.8.1 on both Solaris 2.6 and Solaris 8. You'll be able toConfigure perl with sh Configure -Dcc=gccIf you have updated your Solaris version, you may also have to updateyour GCC. For example, if you are running Solaris 2.6 and your gcc isinstalled under /usr/local, check in /usr/local/lib/gcc-lib and makesure you have the appropriate directory, sparc-sun-solaris2.6/ ori386-pc-solaris2.6/. If gcc's directory is for a different version ofSolaris than you are running, then you will need to rebuild gcc foryour new version of Solaris.You can get a precompiled version of gcc fromL<http://www.sunfreeware.com/>. Make sure you pick up the package foryour Solaris release.=head3 GNU as and GNU ldThe versions of as and ld supplied with Solaris work fine for buildingperl. There is normally no need to install the GNU versions.If you decide to ignore this advice and use the GNU versions anyway,then be sure that they are relatively recent. Versions newer than 2.7are apparently new enough. Older versions may have trouble withdynamic loading.If your gcc is configured to use GNU as and ld but you want to use theSolaris ones instead to build perl, then you'll need to add-B/usr/ccs/bin/ to the gcc command line. One convenient way to dothat is with sh Configure -Dcc='gcc -B/usr/ccs/bin/'Note that the trailing slash is required. This will result in someharmless warnings as Configure is run: gcc: file path prefix `/usr/ccs/bin/' never usedThese messages may safely be ignored.(Note that for a SunOS4 system, you must use -B/bin/ instead.)Alternatively, you can use the GCC_EXEC_PREFIX environment variable toensure that Sun's as and ld are used. Consult your gcc documentationfor further information on the -B option and the GCC_EXEC_PREFIX variable.=head3 GNU makeSun's make works fine for building perl.If you wish to use GNU make anyway, be sure that the set-group-id bit is notset. If it is, then arrange your PATH so that /usr/ccs/bin/make isbefore GNU make or else have the system administrator disable theset-group-id bit on GNU make.=head3 Avoid libucb.Solaris provides some BSD-compatibility functions in /usr/ucblib/libucb.a.Perl will not build and run correctly if linked against -lucb since itcontains routines that are incompatible with the standard Solaris libc.Normally this is not a problem since the solaris hints file preventsConfigure from even looking in /usr/ucblib for libraries, and alsoexplicitly omits -lucb.=head2 Environment=head3 PATHMake sure your PATH includes the compiler (/opt/SUNWspro/bin/ if you'reusing Sun's compiler) as well as /usr/ccs/bin/ to pick up the otherdevelopment tools (such as make, ar, as, and ld). Make sure your patheither doesn't include /usr/ucb or that it includes it after thecompiler and compiler tools and other standard Solaris directories.You definitely don't want /usr/ucb/cc.=head3 LD_LIBRARY_PATHIf you have the LD_LIBRARY_PATH environment variable set, be sure thatit does NOT include /lib or /usr/lib. If you will be buildingextensions that call third-party shared libraries (e.g. Berkeley DB)then make sure that your LD_LIBRARY_PATH environment variable includesthe directory with that library (e.g. /usr/local/lib).If you get an error message dlopen: stub interception failedit is probably because your LD_LIBRARY_PATH environment variableincludes a directory which is a symlink to /usr/lib (such as /lib).The reason this causes a problem is quite subtle. The filelibdl.so.1.0 actually *only* contains functions which generate 'stubinterception failed' errors! The runtime linker intercepts links to"/usr/lib/libdl.so.1.0" and links in internal implementations of thosefunctions instead. [Thanks to Tim Bunce for this explanation.]=head1 RUN CONFIGURE.See the INSTALL file for general information regarding Configure.Only Solaris-specific issues are discussed here. Usually, thedefaults should be fine.=head2 64-bit Issues.See the INSTALL file for general information regarding 64-bit compiles.In general, the defaults should be fine for most people.By default, perl-5.6.0 (or later) is compiled as a 32-bit applicationwith largefile and long-long support.=head3 General 32-bit vs. 64-bit issues.Solaris 7 and above will run in either 32 bit or 64 bit mode on SPARCCPUs, via a reboot. You can build 64 bit apps whilst running 32 bitmode and vice-versa. 32 bit apps will run under Solaris running ineither 32 or 64 bit mode. 64 bit apps require Solaris to be running64 bit mode.Existing 32 bit apps are properly known as LP32, i.e. Longs andPointers are 32 bit. 64-bit apps are more properly known as LP64.The discriminating feature of a LP64 bit app is its ability to utilise a64-bit address space. It is perfectly possible to have a LP32 bit appthat supports both 64-bit integers (long long) and largefiles (> 2GB),and this is the default for perl-5.6.0.For a more complete explanation of 64-bit issues, see the Solaris 64-bitDeveloper's Guide at http://docs.sun.com:80/ab2/coll.45.13/SOL64TRANS/You can detect the OS mode using "isainfo -v", e.g.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -