LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1091|回复: 6

求助,关于PERL的编译!

[复制链接]
发表于 2004-3-31 10:23:57 | 显示全部楼层 |阅读模式
已经知道了PERL源代码,怎么把它编译成为可以执行的文件?在LINXU系统上
发表于 2004-3-31 10:37:22 | 显示全部楼层
发表于 2004-3-31 12:15:19 | 显示全部楼层
chmod
发表于 2004-3-31 19:09:31 | 显示全部楼层
和编译C程序的方法相似

  1. SYNOPSIS
  2.            $ perlcc hello              # Compiles into executable 'a.out'
  3.            $ perlcc -o hello hello.pl  # Compiles into executable 'hello'
  4.                                                                                                 
  5.            $ perlcc -O file            # Compiles using the optimised C backend
  6.            $ perlcc -B file            # Compiles using the bytecode backend
  7.                                                                                                 
  8.            $ perlcc -c file            # Creates a C file, 'file.c'
  9.            $ perlcc -S -o hello file   # Creates a C file, 'file.c',
  10.                                        # then compiles it to executable 'hello'
  11.            $ perlcc -c out.c file      # Creates a C file, 'out.c' from 'file'
  12.                                                                                                 
  13.            $ perlcc -e 'print q//'     # Compiles a one-liner into 'a.out'
  14.            $ perlcc -c -e 'print q//'  # Creates a C file 'a.out.c'
  15.                                                                                                 
  16.            $ perlcc -I /foo hello      # extra headers (notice the space after -I)
  17.            $ perlcc -L /foo hello      # extra libraries (notice the space after -L)
  18.                                                                                                 
  19.            $ perlcc -r hello           # compiles 'hello' into 'a.out', runs 'a.out'.
  20.            $ perlcc -r hello a b c     # compiles 'hello' into 'a.out', runs 'a.out'.
  21.                                        # with arguments 'a b c'
  22.                                                                                                 
  23.            $ perlcc hello -log c       # compiles 'hello' into 'a.out' logs compile
  24.                                        # log into 'c'.
复制代码

具体请在终端输入:
man perlcc
 楼主| 发表于 2004-4-1 09:31:42 | 显示全部楼层
非常感谢大家的热心!
发表于 2005-1-24 10:17:11 | 显示全部楼层
$cat test.pl
#!/usr/local/perl/bin/perl
print "haha\n";
#over
$perlcc -B test.pl
/usr/local/perl/bin/perlcc:test.pl did not compil,which can't happen:
1:no such instruction ""
2:no such instruction ""
...(此处我省略了138行一样的内容)
140:no such instruction ""
There were 140 assembly errors
CHECK failed--call queque aborted.

希望大家帮忙看看,是什么问题呢,谢谢!
回复 支持 反对

使用道具 举报

发表于 2005-1-25 21:46:02 | 显示全部楼层
一般情况下还是不要编译的好,一段很小的代码编译后体积暴大,我编译过,执行速度也没见的提高多少。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表