【发布时间】:2011-05-17 07:06:57
【问题描述】:
我正在尝试在 Windows 7 上安装 CPAN 模块。我没有 Active Perl,因此无法使用 PPM 包。
所有网站上给出的步骤都包括这三个步骤:make、make test 和 make install。我知道 make 是 unix 命令,不会在 Windows 上运行。
我应该在 Windows 上运行什么命令来完成安装?
我从 CPAN 的站点下载了 dmake,正如其中一个站点所提到的,但是当我运行它时,它会出现以下错误 -
D:\Parse-RecDescent-1.965001.tar\Parse-RecDescent-1.965001>D:\dmake\dmake\dmake dmake:错误:-- `D:\indigoampp\perl-5.12.1\libConfig.pm' 未找到,无法制作
请告诉我如何完成这些步骤。谢谢!
PS:同样,PPM 不是一个选项。
谢谢大家。
在 indigoampp\perl-5.12.1\lib 位置有一个名为 Config_heavy.pl 的文件。它有一行:make='nmake'。我在使用 dmake 命令时将其更改为 make='dmake'。
在此之后,我不需要在每个模块的 Makefile 中更改 DIRFILESEP。它现在正在生成 \\ 如上述链接中所述。
所以我现在可以运行 dmake、dmake test 和 dmake install。然而它什么也没做。它没有在各个位置复制 pm 文件/文件。为什么会这样??
无论如何,我手动复制了 pm 文件/文件,希望一切正常。但是,我以前也可以这样做。为什么我运行 makefile.pl 和 dmake 命令??
另外,我的目标是安装 Apache2::Request 模块。我发现它依赖于多个模块。我下载了这些模块并为它们运行了上面的命令 - 没有错误。最后,当我为 Apache2::Request 模块运行这些步骤时,在 dmake 命令中出现以下错误:
D:\libapreq2-2.12.tar\libapreq2-2.12>dmake
dmake: makefile: line 25: Warning: -- Duplicate target [Release]
dmake: makefile: line 25: Warning: -- Duplicate target [Release]
dmake: makefile: line 25: Warning: -- Duplicate target [!=]
dmake: makefile: line 25: Error: -- Expecting macro or rule defn, found neith
er
我在 libapreq2-2.12.tar\libapreq2-2.12 文件夹下的 Makefile 中没有发现任何可疑内容。 Makefile 的部分内容(错误行周围)是:
LIBAPREQ=libapreq2
APREQ2_TEST=apreq2_test
CGITEST=test_cgi
MOD=mod_apreq2
!IF "$(CFG)" != "Release" && "$(CFG)" != "Debug"
!MESSAGE Invalid configuration "$(CFG)" specified.
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE CFG="Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "Release" (based on "Win32 (x86) Console Application")
!MESSAGE "Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
!ERROR An invalid configuration is specified.
!ENDIF
!IF "$(APACHE)" == ""
!MESSAGE No Apache directory was specified.
!MESSAGE Please run Configure.bat to specify a valid Apache directory.
!ERROR
!ENDIF
任何人都可以帮助解决这个和上述问题(为什么它没有自动复制 pm 文件)?感谢您的宝贵时间!
【问题讨论】:
-
你的问题类似于cpanforum.com/posts/9514,也许这应该解决它:cpanforum.com/posts/9716。
-
查看 Strawberry Perl (strawberryperl.com),它是一个适用于 Windows 的优秀 Perl 发行版,附带
dmake和在 Windows 下构建 XS 模块所需的其他工具。 -
make是一个常见于 UNIX 系统的程序,但它可用于 Windows(Strawberry Perl 将捆绑一个副本)
标签: perl makefile cpan mod-perl mod-perl2