感谢Chas. Owens的建议,我一直在玩Perlbrew,在我的主目录中拥有各种Perl版本。我的问题更普遍的是在OS X下构建一个新的Perl。
我在最新的MacBook Pro上运行OS X 10.6.4 Snow Leopard。在Snow Leopard下正确设置small diversion gcc之后,我使用默认选项在我的主目录中构建并运行Perl 5.12.1。它通过Perl测试工具。
Perlbrew允许使用操作系统和平台特定的标志构建Perl。这些是Perl配置脚本的-D -U -A
选项。 perlmacosx自述文件在4年内未更新,因此不再有用。
我很想在系统Perl v 5.10.0中使用Apple的交换机(在大多数情况下,您可以通过为系统键入[path_to_specific_perl]/perl -V
或/usr/bin/perl
来查看您的特定Perl。 ..)除了-Dprefix=/usr
以外,对于新的Perl构建,不同的根目录会有所不同,我应该使用什么?
(eyeballing)以下是Apple编辑选项与默认值之间的主要差异:
config_args:
Apple: -ds -e
Default: -de
-D: =======================
Apple: useithreads=define, usemultiplicity=define
Default: useithreads=undef, usemultiplicity=undef
Compiler: =================
Apple: optimize='-Os'
Default: optimize='-O3'
Apple: -arch x86_64 -arch i386 -arch ppc
Default: none specified
Apple: -g -pipe
Default these optimizations are not set
Apple not set
Default -no-cpp-precomp
Linker: ================
Apple: useshrplib=true, libperl=libperl.dylib
Default: useshrplib=false, libperl=libperl.a
Characteristics of libperl: =============
Apple MULTIPLICITY PERL_IMPLICIT_CONTEXT USE_ITHREADS USE_REENTRANT_API
Default PERL_MALLOC_WRAP USE_PERL_ATOF
另一个区别是Apple Perl libperl是一个dynaloader,默认构建是静态链接的。
所以,问题:
-D -U -A
开关在OS X 10.6+上构建Perl的本地副本?我不认为我需要像Apple版本那样的胖二进制文件,我不知道是否应该使用dynaloader版本。主要是我正在寻找建议的优化开关和建议的libperl特征。/usr/bin/perl
,我不想更改它。我是否更改了脚本中的sheebang以指向Perl的Perlbrew版本?这意味着我的sheebang将是`/ Users / andrew / perl5 / perl。'我是否将我的路径改为指向那里?其他人在这方面做了什么?什么被认为是“最佳实践”?v-string in use/require non-portable at ./perlbrew line 818.
Perlbrew中的第818行use 5.8.0;
该行不应该是use 5.008_000
吗? 修改
感谢Jonathan Leffler,我至少看过一些Perls。我没有深入研究它,而是在大多数情况下采用了默认值,添加了线程,它似乎工作正常。现在我已经安装了几个Perl的Perlbrew,我已经将系统Perl保留在5.10。我在sheebang上使用/usr/bin/env perl
来获得面向未来的代码。
答案 0 :(得分:2)
我能提供的最好的是每个自制的5.1x版本Perl的'perl -V'输出 - 一些32位,一些64位。我省略了PowerPC版本(从我拥有Intel Mac之前的几天开始)。
drwxr-xr-x 8 jleffler staff 272 Aug 1 2009 v5.10.0
drwxr-xr-x 8 jleffler staff 272 Nov 8 2009 v5.10.1
drwxr-xr-x 6 jleffler staff 204 Oct 26 2009 v5.10.1-64
drwxr-xr-x 6 jleffler staff 204 Jun 23 09:36 v5.12.1
drwxr-xr-x 5 jleffler staff 170 Jun 17 21:14 v5.12.1-32bit
drwxr-xr-x 5 jleffler staff 170 Aug 30 15:02 v5.13.4
我不使用线程或多重性构建。我用动态加载构建;我使用dlopen版本 - 它是默认的建议。机器根据连接到网络的位置获得不同的名称;这显示在构建机器名称中。
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
Platform:
osname=darwin, osvers=9.7.0, archname=darwin-64int-2level
uname='darwin osiris.sanjose.ibm.com 9.7.0 darwin kernel version 9.7.0: tue mar 31 22:52:17 pdt 2009; root:xnu-1228.12.14~1release_i386 i386 '
config_args='-Duse64bitint'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/gnu/include -I/usr/GNU/include',
optimize='-O3',
cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/gnu/include -I/usr/GNU/include'
ccversion='', gccversion='4.0.1 (Apple Inc. build 5493)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -L/usr/local/lib -L/usr/gnu/lib -L/usr/GNU/lib'
libpth=/usr/local/lib /usr/gnu/lib /usr/GNU/lib /usr/lib
libs=-ldbm -ldl -lm -lutil -lc
perllibs=-ldl -lm -lutil -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/gnu/lib -L/usr/GNU/lib'
Characteristics of this binary (from libperl):
Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_64_BIT_INT
USE_LARGE_FILES USE_PERLIO
Built under darwin
Compiled at Jul 14 2009 10:09:56
@INC:
/Users/jleffler/perl/v5.10.0/lib/5.10.0/darwin-64int-2level
/Users/jleffler/perl/v5.10.0/lib/5.10.0
/Users/jleffler/perl/v5.10.0/lib/site_perl/5.10.0/darwin-64int-2level
/Users/jleffler/perl/v5.10.0/lib/site_perl/5.10.0
.
Summary of my perl5 (revision 5 version 10 subversion 1) configuration:
Platform:
osname=darwin, osvers=9.8.0, archname=darwin-2level
uname='darwin osiris.local 9.8.0 darwin kernel version 9.8.0: wed jul 15 16:55:01 pdt 2009; root:xnu-1228.15.4~1release_i386 i386 '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc -m32', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/usr/gnu/include',
optimize='-O3',
cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/usr/gnu/include'
ccversion='', gccversion='4.0.1 (Apple Inc. build 5493)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc -m32', ldflags =' -fstack-protector -L/usr/local/lib -L/usr/gnu/lib'
libpth=/usr/local/lib /usr/gnu/lib /usr/lib
libs=-ldbm -ldl -lm -lutil -lc
perllibs=-ldl -lm -lutil -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/gnu/lib -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP
USE_LARGE_FILES USE_PERLIO
Built under darwin
Compiled at Sep 3 2009 07:26:44
@INC:
/Users/jleffler/perl/v5.10.1/lib/5.10.1/darwin-2level
/Users/jleffler/perl/v5.10.1/lib/5.10.1
/Users/jleffler/perl/v5.10.1/lib/site_perl/5.10.1/darwin-2level
/Users/jleffler/perl/v5.10.1/lib/site_perl/5.10.1
.
Summary of my perl5 (revision 5 version 10 subversion 1) configuration:
Platform:
osname=darwin, osvers=9.8.0, archname=darwin-2level
uname='darwin osiris.sanjose.ibm.com 9.8.0 darwin kernel version 9.8.0: wed jul 15 16:55:01 pdt 2009; root:xnu-1228.15.4~1release_i386 i386 '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc -m64', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/usr/gnu/include',
optimize='-O3',
cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/usr/gnu/include'
ccversion='', gccversion='4.0.1 (Apple Inc. build 5493)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc -m64', ldflags =' -fstack-protector -L/usr/local/lib -L/usr/gnu/lib'
libpth=/usr/local/lib /usr/gnu/lib /usr/lib
libs=-ldbm -ldl -lm -lutil -lc
perllibs=-ldl -lm -lutil -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/gnu/lib -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_64_BIT_ALL
USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO
Built under darwin
Compiled at Sep 3 2009 10:12:54
@INC:
/Users/jleffler/perl/v5.10.1-64/lib/5.10.1/darwin-2level
/Users/jleffler/perl/v5.10.1-64/lib/5.10.1
/Users/jleffler/perl/v5.10.1-64/lib/site_perl/5.10.1/darwin-2level
/Users/jleffler/perl/v5.10.1-64/lib/site_perl/5.10.1
.
Summary of my perl5 (revision 5 version 12 subversion 1) configuration:
Platform:
osname=darwin, osvers=10.3.0, archname=darwin-2level
uname='darwin dyn744040.sanjose.ibm.com 10.3.0 darwin kernel version 10.3.0: fri feb 26 11:58:09 pst 2010; root:xnu-1504.3.12~1release_i386 i386 '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/usr/gnu/include -I/usr/GNU/include',
optimize='-O3',
cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/usr/gnu/include -I/usr/GNU/include'
ccversion='', gccversion='4.2.1 (Apple Inc. build 5659)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib -L/usr/gnu/lib'
libpth=/usr/local/lib /usr/gnu/lib /usr/lib
libs=-ldbm -ldb -ldl -lm -lutil -lc
perllibs=-ldl -lm -lutil -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/gnu/lib -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_64_BIT_ALL
USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO
USE_PERL_ATOF
Built under darwin
Compiled at Jun 8 2010 15:36:47
@INC:
/Users/jleffler/Perl/v5.12.1/lib/perl5/site_perl/5.12.1/darwin-2level
/Users/jleffler/Perl/v5.12.1/lib/perl5/site_perl/5.12.1
/Users/jleffler/Perl/v5.12.1/lib/perl5/5.12.1/darwin-2level
/Users/jleffler/Perl/v5.12.1/lib/perl5/5.12.1
.
Summary of my perl5 (revision 5 version 12 subversion 1) configuration:
Platform:
osname=darwin, osvers=10.4.0, archname=darwin-2level
uname='darwin osiris-2.local 10.4.0 darwin kernel version 10.4.0: fri apr 23 18:28:53 pdt 2010; root:xnu-1504.7.4~1release_i386 i386 '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc -m32', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/usr/gnu/include -I/usr/GNU/include',
optimize='-O3',
cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/usr/gnu/include -I/usr/GNU/include'
ccversion='', gccversion='4.2.1 (Apple Inc. build 5659)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc -m32', ldflags =' -fstack-protector -L/usr/local/lib -L/usr/gnu/lib -L/usr/GNU/lib'
libpth=/usr/local/lib /usr/gnu/lib /usr/GNU/lib /usr/lib
libs=-ldbm -ldl -lm -lutil -lc
perllibs=-ldl -lm -lutil -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/gnu/lib -L/usr/GNU/lib -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP
USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF
Built under darwin
Compiled at Jun 17 2010 20:48:50
@INC:
/Users/jleffler/Perl/v5.12.1-32bit/lib/perl5/site_perl/5.12.1/darwin-2level
/Users/jleffler/Perl/v5.12.1-32bit/lib/perl5/site_perl/5.12.1
/Users/jleffler/Perl/v5.12.1-32bit/lib/perl5/5.12.1/darwin-2level
/Users/jleffler/Perl/v5.12.1-32bit/lib/perl5/5.12.1
.
Summary of my perl5 (revision 5 version 13 subversion 4) configuration:
Platform:
osname=darwin, osvers=10.4.0, archname=darwin-2level
uname='darwin dyn9043040112.sanjose.ibm.com 10.4.0 darwin kernel version 10.4.0: fri apr 23 18:28:53 pdt 2010; root:xnu-1504.7.4~1release_i386 i386 '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc -m64', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/gnu64/include -I/usr/local/include',
optimize='-O3',
cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector -I/usr/gnu64/include -I/usr/local/include'
ccversion='', gccversion='4.2.1 (Apple Inc. build 5664)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='-fstack-protector -L/usr/gnu64/lib -L/usr/local/lib'
libpth=/usr/gnu64/lib /usr/lib /usr/local/lib
libs=-ldbm -ldb -ldl -lm -lutil -lc
perllibs=-ldl -lm -lutil -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/gnu64/lib -L/usr/local/lib -fstack-protector'
Characteristics of this binary (from libperl):
Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_64_BIT_ALL
USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO
USE_PERL_ATOF
Built under darwin
Compiled at Aug 30 2010 14:36:39
@INC:
/Users/jleffler/perl/v5.13.4/lib/site_perl/5.13.4/darwin-2level
/Users/jleffler/perl/v5.13.4/lib/site_perl/5.13.4
/Users/jleffler/perl/v5.13.4/lib/5.13.4/darwin-2level
/Users/jleffler/perl/v5.13.4/lib/5.13.4
.