Compiling WWW::Curl on ActivePerl

2019-08-28 11:54发布

I'm trying (desperately) to build / install the newest version of WWW::Curl onto my activeperl box (I'll explain in a moment why I don't use the PPM)

I had to make some modifications as per the instructions found here: http://cpansearch.perl.org/src/SZBALINT/WWW-Curl-4.15/README.Win32

I also had to change the following line:

From:

open(H_IN, "-|" "gcc", "$curl_h") and $has_cpp++;

To:

open(H_IN, "gcc $curl_h") and $has_cpp++;

I finally got perl Makefile.PL to work but now, when I run nmake, I get the following:

Missing right curly or square bracket at -e line 1, at end of line
Execution of -e aborted due to compilation errors.
NMAKE:  fatal error U1077:  'C;|windows\system32\cmd.exe' : return code '0xff'
Stop.

Now, the reason I'm trying to compile this rather than using the PPM supplied by u.winnipeg is because the that PPM doesn't seem to support SSL transaction (I get "libcurl: ssl disabled") Now, if anyone can show me how to get ssl to run on this PPM, I'm more than happy to use it.

Thank you very much in advance

3条回答
我欲成王,谁敢阻挡
2楼-- · 2019-08-28 12:10

I presume the original was

open(H_IN, "-|", "gcc", "$curl_h")

The reason you have to change that in because noone got around to implementing feature in Windows. Change it to

open(H_IN, qq{gcc "$curl_h" |})

Use the right name and syntax for your compiler.

查看更多
别忘想泡老子
3楼-- · 2019-08-28 12:22

First, many people don't know that you can use ppm to install MinGW to use cpan to install modules.

Second, if the libcurl provided by your module doesn't do SSL, you can try and replace it with a suitable SSL version from the download page. This might well fail, but you might also be lucky.

查看更多
萌系小妹纸
4楼-- · 2019-08-28 12:28

Well, I finally figured it out, thanks to everyone who responded. There were a bunch of things I had to change.

Using http://cpansearch.perl.org/src/SZBALINT/WWW-Curl-4.15/README.Win32 as a guide:

The open cmd as I did above worked fine. However, I did use the advice returned by ikegami, reinierpost, and mob.

Using nmake /n (as advised by socket puppet), it printed out all of the perl statements which were being executed. I took this output and placed it into a .bat file and corrected the perl syntax.

I changed all instances of

pm_to_blib({{@ARGV}

to

pm_to_blib({@ARGV}

(it is disturbing these were returned)

Then, I had to link the libcurl libraries to each line instantiating g++, which were not linked correctly. After I added these references, everything else went smoothly.

These were added:

C:\lc\curl\lib\libcurl.a C:\lc\curl\lib\libcurldll.a

Now, WWW::Curl is happily running on my system.

As for using the PPM version, it is exactly because of SSL I had to upgrade. The newest version of WWW::Curl is 4.15 the ppm version is (I believe) 3.02.

查看更多
登录 后发表回答