syphilis has asked for the wisdom of the Perl Monks concerning the following question:

Hi,
MinGW comes with inttypes.h, and certainly knows all about intmax_t and uintmax_t types - so it occurred to me that it ought to be not-too-difficult to build a perl on Win32 (using MinGW) with -Duse64bitint. (Cygwin can do it on Win32, so why not MinGW ?)

Surely, it's just a matter of hacking the makefile.mk in the perl source in an appropriate fashion.

Well ... I've tried a few hacks but, despite my best intentions, they don't seem to have been appropriate. Has anyone here tried to build perl on Win32 with -Duse64bitint using MinGW ? Has anyone here succeeded ?

In the meantime, I'll keep hacking at that makefile.mk ....

Cheers,
Rob

Replies are listed 'Best First'.
Re: Win32, MinGW and -Duse64bitint
by ysth (Canon) on Feb 20, 2007 at 10:05 UTC
    -Duse64bitint is a Configure flag, and the MSWin32 builds don't use Configure. You'll need to hack win32/config.w32 instead.
      You'll need to hack win32/config.w32 instead

      I can't find that file in the source. Do you mean win32/config.gc ?

      I haven't yet found a way of modifying config.gc. There's no problem in modifying makefile.mk, but config.gc is readonly, and whilst I can remove the readonly attribute (running as either Owner or User), I get "Access Denied" whenever I try to save a change to that file ... irrespective of whether I'm running as User or Owner ... irrespective of whether the source was unpacked by User or Owner ... irrespective of the directory into which the source was unpacked.

      I've spent over 40 minutes switching between "User" and "Owner" trying to edit the damned thing :-)

      Any idea wtf is going on ?? (I'm fairly new to Windows XP ... never had a problem like this with Windows 2000). I'm using Cygwin's tar utility to unpack the source. The command I'm running is

      tar zxvf downloads/perl-5.8.8.tar.gz

      Blardee hell ...

      Cheers,
      Rob
        Sorry, you're right: it's config.gc, not config.w32.

        The perl source is distributed with read-only permissions set; try chmod a+w config.gc or attrib -r config.gc.

Re: Win32, MinGW and -Duse64bitint
by xdg (Monsignor) on Feb 20, 2007 at 12:59 UTC

    If you get this working, please post a mini-synopsis of your approach on win32.perl.org.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

      Shall do ... though it's not looking all that promising. I'm currently stuck on the following error that occurs (fairly early) when running dmake:
      del /f config.h copy config_H.gc config.h 1 file(s) copied. cd .. && miniperl configpm Invalid type 'Q' in pack at lib/Config_heavy.pl line 1088. Compilation failed in require at configpm line 777. dmake: Error code 255, while making '..\lib\Config.pm' dmake: '..\lib\Config.pm' removed.
      I've so far made the following amendments to config.gc:
      d_casti32 to 'undef' d_longlong to 'define' d_quad to 'define' i_inttypes to 'define' ivsize to '8' ivtype to 'long long' nv_preserves_uv_bits to '53' quadkind to '3' use64bitint to 'define'
      Looks like there's a bit more to do, yet :-)
      Did anyone associated with the Vanilla/Strawberry Perl project ever investigate this ?

      Cheers,
      Rob
        Did anyone associated with the Vanilla/Strawberry Perl project ever investigate this ?

        Not that I'm aware of. At the time, I considered myself lucky to figure out what I needed to patch in the makefile.mk to get Vanilla to build at all. The win32 directory in the Perl source brings to mind an echo of an old phrase: "you're in a twisty maze of configuration files..."

        -xdg

        Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.