技术头条 - 一个快速在微博传播文章的方式     搜索本站
您现在的位置首页 --> 其他 --> 如何在AIX中编译Perl

如何在AIX中编译Perl

浏览:2248次  出处信息

AIX默认是不带编译器的,所以如果要自己编译Perl,需要先安装编译器。开源的gcc自然可以算是最佳选择。

在64位平台的AIX中,如果选择使用gcc来编译perl源代码,默认情况下是编译成32位的版本。这样在编译DBD::Oracle的时候也需要选择正确的32位库,否则无法编译成功。也可以选择将Perl编译成64位的,这样在64位平台上应该更方便些,很多依赖库的路径使用默认即可。

编译成32位Perl

以下是代码片段:
$./Configure -des -Dprefix=/opt/perl  -Dcc=gcc
$make && make install

编译成64位Perl

以下是代码片段:
$./Configure -des -Dprefix=/opt/perl  -Dcc=’gcc -maix64’
$make && make install

为了确认编译后的版本,可以使用-V选项运行perl:

以下是代码片段:
$./perl -V
Summary of my perl5 (revision 5 version 10 subversion 1) configuration:

  Platform:
    osname=aix, osvers=5.3.0.0, archname=aix-64all
    uname=’aix dbtest 3 5 00cad8cf4c00 ’
    config_args=’-des -Dprefix=/opt/perl -Dcc=gcc -maix64’
    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 -maix64 -maix64’, ccflags =’-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-DUSE_NATIVE_DLOPEN -fno-strict-aliasing -pipe -maix64 -DUSE_64_BIT_ALL’,
    optimize=’-O’,
    cppflags=’-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-DUSE_NATIVE_DLOPEN -fno-strict-aliasing -pipe’
    ccversion=’’, gccversion=’4.2.0’, gccosandvers=’’
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=87654321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype=’long’, ivsize=8, nvtype=’double’, nvsize=8, Off_t=’off_t’, lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld=’gcc -maix64 -maix64’, ldflags =’ -Wl,-brtl -Wl,-bdynamic -Wl,-b64’
    libpth=/lib /usr/lib /usr/ccs/lib
    libs=-lbind -lnsl -ldbm -ldl -lld -lm -lcrypt -lc
    perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lc
    libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a
    gnulibc_version=’’
  Dynamic Linking:
    dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef,
ccdlflags=’-Xlinker -bE:/opt/perl/lib/5.10.1/aix-64all/CORE/perl.exp’
    cccdlflags=’ ’, lddlflags=’  -Wl,-b64 -Wl,-bhalt:4 -Wl,-G -Wl,-bI:$(PERL_INC)/perl.exp -Wl,
-bE:$(BASEEXT).exp -Wl,-bnoentry -lc -lm’

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 aix
  Compiled at Dec  1 2009 19:48:22
  @INC:
    /opt/perl/lib/5.10.1/aix-64all
    /opt/perl/lib/5.10.1
    /opt/perl/lib/site_perl/5.10.1/aix-64all
    /opt/perl/lib/site_perl/5.10.1

 

建议继续学习:

  1. perl更新/修改/删除文本文件内容    (阅读:9322)
  2. perl大牛flw传说    (阅读:6452)
  3. 从C语言的Hello World说起    (阅读:6122)
  4. perl模块Getopt::Std用法及实例-从命令行读取参数模块    (阅读:5757)
  5. 关于PHP的编译和执行分离    (阅读:5595)
  6. [Perl] Template::Toolkit 模板技术.    (阅读:5317)
  7. 在perl中连接和使用sqlite做数据存储    (阅读:4919)
  8. Perl命令行常见用法及技巧    (阅读:4667)
  9. perl的expect使用方法,实现非交互式登录。    (阅读:4357)
  10. perl模块之MIME::Lite发送有附件的邮件    (阅读:4351)
QQ技术交流群:445447336,欢迎加入!
扫一扫订阅我的微信号:IT技术博客大学习
© 2009 - 2024 by blogread.cn 微博:@IT技术博客大学习

京ICP备15002552号-1