Subject: | Error in Makefile.PL that affects Windows |
Paul,
We recently corresponded about the issues with the bundled GCC compiler
in Strawberry Perl for Windows and the lack of IPv6 inet_ntop/pton()
functions in the header and library files. I had a pretty detailed hack
at the headers and libraries and then a modification to the Makefile to
address the issue.
Looking at your Makefile.PL, I see the line:
16. return if exists $Config{$args{confkey}};
which at least for me on Windows is always returning for all the
%defines called against it.
For example:
VinsWorldcom@C:\Users\VinsWorldcom\tmp\Socket-2.006> perl Makefile.PL
Checking HAS_IP_MREQ...
Checking HAS_IP_MREQ_SOURCE...
Writing Makefile for Socket
Writing MYMETA.yml and MYMETA.json
If I modify that line 16 to read:
return if exists $Config{$args{confkey}} and defined
$Config{$args{confkey}};
in other words, don't only check for existence, but make sure it has an
actual value (i.e., defined), then I get a whole different Makefile:
vincen_m@C:\Users\vincen_m\tmp\Socket-2.006> perl Makefile.PL
Checking HAS_GETADDRINFO...
Checking HAS_GETNAMEINFO...
Checking HAS_INETNTOP...
test-2.c: In function 'main':
test-2.c:15:16: error: 'inet_ntop' undeclared (first use in this
function)
test-2.c:15:16: note: each undeclared identifier is reported only once
for each
function it appears in
Checking HAS_INETPTON...
test-3.c: In function 'main':
test-3.c:15:16: error: 'inet_pton' undeclared (first use in this
function)
test-3.c:15:16: note: each undeclared identifier is reported only once
for each
function it appears in
Checking HAS_INET_ATON...
test-4.c: In function 'main':
test-4.c:15:16: error: 'inet_aton' undeclared (first use in this
function)
test-4.c:15:16: note: each undeclared identifier is reported only once
for each
function it appears in
Checking HAS_SOCKADDR_SA_LEN...
test-5.c: In function 'main':
test-5.c:15:27: error: 'struct sockaddr' has no member named 'sa_len'
Checking HAS_SOCKADDR_IN6...
Checking HAS_IP_MREQ...
Checking HAS_IP_MREQ_SOURCE...
Checking HAS_IPV6_MREQ...
Writing Makefile for Socket
Writing MYMETA.yml and MYMETA.json
That seems MUCH better!
It still doesn't address the fact that the GCC bundled with Strawberry
doesn't provide headers/libraries for inet_ntop/pton() and subsequent
calls to the new dmake Socket will still result in:
Socket::inet_ntop not implemented on this architecture at ...
However, it does fix what I think may be a minor bug in the Makefile.PL
and eliminates some of the hacking I recommend to fix the support on
Windows.
cheers.