Perl单步调试--在公司代理proxy下,安装WIN32版Padwalker

PadWalker安装起来比较费劲,又因为官方网站上写的是ActivePerl 的PPM 5.10 是对Padwalker支持都是FAILLED
所以需要安装一个自己编译的版本,步骤比较多

1.首先安装Win32 的 Activeperl, 下载地址是: http://www.activestate.com/Products/activeperl/index.mhtml
   因为有代理,所以设定PPM的代理也不方便,可以通过CPAN 直接安装和设定,配置过程如下:


C:/>perl -MCPAN -eshell
CPAN: File::HomeDir loaded ok (v0.69)

cpan shell -- CPAN exploration and modules installation (v1.9205)
ReadLine support enabled

cpan> o conf http_proxy
    http_proxy         [http:://153.88.253.16:80]
Type 'o conf' to view all configuration items


cpan> o conf http_proxy 153.88.253.16:80
    http_proxy         [153.88.253.16:80]
Please use 'o conf commit' to make the config permanent!


cpan> o conf commit
commit: wrote 'C:/Perl/lib/CPAN/Config.pm'

cpan> update




但是很可能你是安装不上,主要是因为WINDOWS的目录分隔符是使用的"/"; 当是我就是,使用现成的PPM包,也是报错,
所以就开始使用源码安装,源码的下载地址是:http://search.cpan.org/src/ROBIN/


安装的过程要求你额外的安装工具,如下

MinGW,下载地址是:http://sourceforge.net/projects/mingw/

msys,  下载地址是:http://downloads.sourceforge.net/mingw/MSYS-1.0.10.exe

安装方法初步很简单,我会在另外的文章里面总结

注意安装完成msys后,进行如下的配置:
/etc/fstab 文件如下:

# /etc/fstab
#C:MinGW /mingw
C:/MinGW /mingw
C:/Perl  /perl
C:/Tcl   /tcl

这样就可以直接在msys的终端下使用 perl tclsh85 gcc make 等等开源工具了

因为一般的perl代码包的安装步骤如下

  1. perl Makefile.pl
  2. make
  3. make test
  4. make install


所以我们需要使用make, 我也不知道为什么windows里面使用msys的make不太好用,决定使用MS在Visual Studio里面的nmake工具,

nmake下载地址: http://download.microsoft.com/download/vc15/patch/1.52/w95/en-us/nmake15.exe

下载后,把nmake15.exe复制到目录
"C:/WINNT"-->(2000)或者" C:/WINDOWS"-->(XP)下面,并且重命名为:nmake.exe
就可以直接在CMD里面使用了,如果看到如下,那么就说明nmake正常:

C:/>nmake

PKSFX (R)   FAST!   Self Extract Utility   Version 2.04g  02-01-93
Copr. 1989-1993 PKWARE Inc. All Rights Reserved. Shareware version
PKSFX Reg. U.S. Pat. and Tm. Off.

Searching EXE: C:/WINNT/NMAKE.EXE
  Inflating: NMAKE.ERR
  Inflating: NMAKE.EXE
  Inflating: README.TXT

C:/>


还需要安装一个math的lib库--"Math-BigInt-FastCalc-0.19"
下载地址是:
http://search.cpan.org/~tels/Math-BigInt-FastCalc-0.19/lib/Math/BigInt/FastCalc.pm

准备工作已经完成,现在正式进行Padwalker的安装,在msys的终端下面,运行步骤如下,请读者自己观看,这里就不赘述了:

efegliu@E001EEC1E945C /c/perl/module $ tar xvf Math-BigInt-FastCalc-0.19.tar
Math-BigInt-FastCalc-0.19/
.............................
Math-BigInt-FastCalc-0.19/CREDITS
Math-BigInt-FastCalc-0.19/MANIFEST

efegliu@E001EEC1E945C /c/perl/module $ ls
Math-BigInt-FastCalc-0.19  Math-BigInt-FastCalc-0.19.tar  PadWalker-1.7  PadWalker-1.7-PPM510.tar.gz  PadWalker-1.7.tar  blib

efegliu@E001EEC1E945C /c/perl/module $ cd Math-BigInt-FastCalc-0.19

efegliu@E001EEC1E945C /c/perl/module/Math-BigInt-FastCalc-0.19 $ ls
CHANGES  CREDITS  FastCalc.xs  MANIFEST  MANIFEST.SKIP  META.yml  Makefile.PL  README  SIGNATURE  TODO  inc  lib  t

efegliu@E001EEC1E945C /c/perl/module/Math-BigInt-FastCalc-0.1 $ perl Makefile.PL
Set up gcc environment - 3.4.5 (mingw-vista special r3)
Checking if your kit is complete...
Looks good
Writing Makefile for Math::BigInt::FastCalc

efegliu@E001EEC1E945C /c/perl/module/Math-BigInt-FastCalc-0.19 $ nmake test

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

Math::BigInt: couldn't load specified math lib(s), fallback to Math::BigInt::FastCalc at C:/Perl/lib/Win32API/File.pm line 20
cp lib/Math/BigInt/FastCalc.pm blib/lib/Math/BigInt/FastCalc.pm
.....................................
Files=9, Tests=6892,  4 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00 CPU)

efegliu@E001EEC1E945C /c/perl/module/Math-BigInt-FastCalc-0.19 $ make install
make: *** No rule to make target `C:/Perl/libConfig.pm', needed by `Makefile'.  Stop.

efegliu@E001EEC1E945C /c/perl/module/Math-BigInt-FastCalc-0.19 $ nmake install

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.
...........................
Appending installation info to C:/Perl/lib/perllocal.pod

efegliu@E001EEC1E945C /c/perl/module/Math-BigInt-FastCalc-0.19 $ cd ..

efegliu@E001EEC1E945C /c/perl/module $ cd PadWalker-1.7

efegliu@E001EEC1E945C /c/perl/module/PadWalker-1.7 $ ls
Changes  MANIFEST  META.yml  Makefile.PL  NMAKE.ERR  NMAKE.EXE  PadWalker.pm  PadWalker.xs  README  README.TXT  t

efegliu@E001EEC1E945C /c/perl/module/PadWalker-1.7 $ perl Makefile.PL
Set up gcc environment - 3.4.5 (mingw-vista special r3)
Checking if your kit is complete...
Looks good
Writing Makefile for PadWalker

efegliu@E001EEC1E945C /c/perl/module/PadWalker-1.7 $ nmake test

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

...............................
t/test........ok
t/tt..........ok
t/var_name....ok
All tests successful.
Files=9, Tests=65,  1 wallclock secs ( 0.00 cusr +  0.00 csys =  0.00 CPU)

efegliu@E001EEC1E945C /c/perl/module/PadWalker-1.7 $ nmake install

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.
.........................
Appending installation info to C:/Perl/lib/perllocal.pod


然后在建立文件C://test.pl,来测试一下安装的模块是否成功,文件如下:

# perl  padwalker.pl
#!/usr/bin/perl

use strict;
use PadWalker qw(peek_my peek_our peek_sub closed_over);

sub increment_my_x {
    my $h = peek_my (1);
    ${$h->{'$x'}}++;
}

my $x=5;

increment_my_x;

print $x;  # prints 6


然后运行,如果看到结果如下,那么恭喜你,你安装成功了!

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

H:/>c:

C:/>perl test.pl
6
C:/>

你可能感兴趣的:(Math,c,windows,Microsoft,perl,makefile)