On 4/28/2011 4:32 AM, Reini Urban wrote:
> 2011/4/27 Charles Wilson <cwilso11@...>:
>> I'm pleased to announce that msys-perl has been updated from the
>> 10-year-old 5.6.1 (April 9, 2001), to the young and spry 5.8.8 (Feb 2,
>> To install or upgrade:
>> mingw-get update
> Which netinet/in.h did you use?
/usr/include/netinet/in.h. It's part of msys-core-dev.
> /* I_NETINET_TCP:
> * This symbol, if defined, indicates to the C program that it should
> * include <netinet/tcp.h>.
> #define I_NETINET_TCP /**/
$ ls /usr/include/netinet/
in.h in_systm.h ip.h ip_icmp.h tcp.h
> But I have no netinet subdir in my search path, all my msys packages
> are upgraded,,
> and the cygwin version includes #include <cygwin/in.h> which perl
> should not use, rather winsock2.
No, this is an *msys* perl. Not a native perl. That "cygwin/in.h" is
what msys uses. MSYS, as a cygwin fork, still uses "cygwin" in a lot of
places where it probably should use "msys".
1) You probably haven't installed msys-core-dev. It is not installed by
2) You appear to be attempting to build your extension from within an
regular MINGW32 shell -- e.g. uname returns MINGW32_NT-6.0 or similar.
You MUST build extensions from an MSYSDVLPR shell.
> mingw also has no arpa/inet.h and sys/times.h, ... but config.h
> defines all these.
Right: mingw doesn't have those. msys does:
$ ls /usr/include/arpa/
ftp.h inet.h nameser.h nameser_compat.h telnet.h tftp.h
$ ls /usr/include/sys/t*
> I undef'd those in config.h
> But furthermore the package misses all
> /usr/lib/perl5/5.8/msys/CORE/win32*.h headers
Ermm...why should it? Cygwin doesn't have those in
> #if defined(HAS_SOCKET) && !defined(VMS) && !defined(WIN32) /*
> VMS/WIN32 handle sockets via vmsish.h/win32.h */
> # include <sys/socket.h>
> but WIN32 is not defined in msys and we have no sys/socket.h
$ ls /usr/include/sys/socket.h
> So we should check for some MSYS define.
> $ echo|gcc -E -dM -|grep MSYS
> $ echo|gcc -E -dM -|grep MING
> #define __MINGW32__ 1
Wrong gcc -- that's /mingw/bin/gcc. In an MSYSDVLPR shell, /usr/bin
will precede in PATH, and /usr/bin/gcc reports:
$ echo|gcc -E -dM - | grep MSYS
#define __MSYS__ 1
$ echo|gcc -E -dM - | grep MING
> /* undef WIN32 when building on Cygwin (for libwin32) - gph */
> #if defined(__CYGWIN__) || defined(__MSYS__)
> # undef WIN32
> # undef _WIN32
> 1. __MSYS__ is not defined in gcc
Yes, it is -- when you use the correct one.
> 2. MSYS should not undef WIN32
Yes, it should undef WIN32. We *want* to use the msys facilities, just
like the cygwin build uses the cygwin ones. We're not trying to build a
native win32 perl here.
> For 5.6 I added arpa/inet.h, sys/socket.h and all win32.h headers to
> the CORE dir.
It sounds like you've been "doing it wrong" for a long time. That seems
to be a very odd way of building native win32 extensions with an MSYS
perl...I'm surprised that ever worked.
> Furthermore gcc/mingw32/4.5.2 does not look like to have sigjmp_buf,
> only typedef int jmp_buf;
> So I undef'd /*#define HAS_SIGSETJMP / **/ also
> Then it compiles, but I got two missing syms:
> C.o:C.c:(.text+0x55): undefined reference to `_imp__PL_sys_intern'
> C.o:C.c:(.text+0x7c): undefined reference to `_imp__win32_async_check'
Try again, but enter CPAN from an MSYSDVLPR shell instead. (And make
sure that you have:
installed -- you'll get them via
mingw-get install msys-system-builder