Perl 코드를 컴파일하고 싶습니다.

dotri의 이미지

컴파일하고 싶은 코드는 다음과 같습니다.

[root@test perlcc_test]# ls
hello.pl
[root@test perlcc_test]# cat hello.pl
#!/usr/bin/perl
 
print( "hello?\n" );
[root@test perlcc_test]# perl hello.pl
hello?

perlcc 컴파일러를 사용해서 컴파일했는데, 컴파일은 잘 되지만 다음과 같은 경고가 납니다.

[root@test perlcc_test]# perlcc -o hello hello.pl
pccRKB8l.c: In function ‘perl_init_aaaa’:
pccRKB8l.c:476: warning: this decimal constant is unsigned only in ISO C90
[root@test perlcc_test]# ls
hello*  hello.pl
[root@test perlcc_test]# ./hello
hello?

질문1: 이 경고를 없애려면(경고메세지를 없애는게 아니라, 경고 자체를 없애려면) 어떻게 해야합니까? 뭔가 깔끔하지 못하고 깨름직한 기분이 듭니다.
질문2: C 코드를 얻으려면 어떻게 해야합니까? 다음과 같이 시도해보았는데 이상한 에러를 냅니다.

[root@test perlcc_test]# perl -MO=CC,-ohello.c hello.pl
Can't locate object method "_save_common_middle" via package "B::FAKEOP" at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/B/C.pm line 389.
CHECK failed--call queue aborted.
[root@test perlcc_test]#

질문3: 외부 라이브러리를 사용한 Perl 코드, 예를 들어서 서버로 동작하는 프로그램은 Socket 컴포넌트를 사용해야 할텐데 그런건 어떻게 컴파일해야 하나요?

[root@test ASSP]# perlcc assp.pl
/usr/bin/perlcc: assp.pl did not compile, which can't happen:
Starting compile
 Walking tree
 Exporter saved (it is in IO::Seekable's @ISA)
 IO::Socket saved (it is in IO::Socket::INET's @ISA)
 IO::Handle saved (it is in IO::Socket's @ISA)
 Prescan
 Saving methods
 No definition for sub Socket::SO_CHAMELEON
 No definition for sub Socket::SO_CHAMELEON (unable to autoload)
 No definition for sub Socket::AF_ISO
 No definition for sub Socket::AF_ISO (unable to autoload)
 No definition for sub Socket::SO_SNDLOWAT
 No definition for sub Socket::SO_SNDLOWAT (unable to autoload)
 No definition for sub Socket::AF_MAX
 No definition for sub Socket::AF_MAX (unable to autoload)
 No definition for sub Socket::MSG_BTAG
 No definition for sub Socket::MSG_BTAG (unable to autoload)
 No definition for sub Socket::SO_LINGER
 No definition for sub Socket::SO_LINGER (unable to autoload)
 No definition for sub Socket::SO_ERROR
 No definition for sub Socket::SO_ERROR (unable to autoload)
 No definition for sub Socket::PF_OSI
 No definition for sub Socket::PF_OSI (unable to autoload)
 No definition for sub Socket::AF_DATAKIT
 No definition for sub Socket::AF_DATAKIT (unable to autoload)
 No definition for sub Socket::AF_USER
 No definition for sub Socket::AF_USER (unable to autoload)
 No definition for sub Socket::AF_LINK
 No definition for sub Socket::AF_LINK (unable to autoload)
 Can't locate object method "IVX" via package "B::NV" at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/B/C.pm line 650.
 CHECK failed--call queue aborted.
 
[root@test ASSP]#

감사합니다.

이한길의 이미지

질문하신 것들에 대한 대답은 안되겠지만
컴파일하는 목적이 베포에만 있다면 par를 사용해보시는것도 괜찮을것 같습니다.

----
먼저 알게 된 것을 알려주는 것은 즐거운 일이다!
http://hangulee.xo.st
http://hangulee.egloos.com/

----
먼저 알게 된 것을 알려주는 것은 즐거운 일이다!
http://hangulee.springnote.com
http://hangulee.egloos.com

pung96의 이미지

#!/usr/bin/perl
 
print( "hello?\n" );

경고없이 잘 컴파일 되는군요.

perl -MO=CC,-ohello.c hello.pl

같은 에러가 납니다.