Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

pudge (1)

pudge
  (email not shown publicly)
http://pudge.net/
AOL IM: Crimethnk (Add Buddy, Send Message)

I run this joint, see?

Journal of pudge (1)

Thursday September 17, 2009
01:01 PM

Mac-Carbon Makefile.PL 64-bit Check

[ #39641 ]

I should add a check for 64-bit mode to the Mac-Carbon Makefile.PL. This will save a lot of hassle if I can give a nice error message, with a link to more information, up front.

I can't test this easily, though, since I don't yet have a 10.6 64-bit box (it's only on an original MacBook Pro, which is 32 bits). I will upgrade to Snow Leopard soon. I could try to make my own perl before then, but I don't know it would work the same way. So. If you want to help, now's your chance!

First thought is Config, but we all know Config can be flaky. For example, on my 32-bit box:

$ perl -V:use64bitall
use64bitall='define';

Doesn't really help. I don't know if $Config{intsize} would be 8 on a 64-bit perl. It's 4 on this 10.6 32-bit perl. I do know you should be able to call perl with VERSIONER_PERL_PREFER_32_BIT=yes to give you 32-bit perl, instead of the default 64-bit perl.

So anyway ... if you can figure out a way to know, under 10.6 stock perl, if I am running under 32-bit perl or 64-bit perl, let me know.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Scarily enough perl in Snow Leopard is compiled as both 32 and 64 bit, and when you build extensions it builds them as both too (and ppc too).

    This can be confusing when you have 32-bit libraries installed.

    neptune:Imager tony$ export VERSIONER_PERL_PREFER_32_BIT=no
    neptune:Imager tony$ perl -V
    Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
      Platform:
        osname=darwin, osvers=10.0, archname=darwin-thread-multi-2level
        uname='darwin neige.apple.com 10.0 darwin
    • Thanks Tony, yeah, it looks like I am going to have to fudge $Config{ccflags} etc. before the Makefile is written, to strip out -arch x86_64. I think this will work.

      Maybe I'll put up a test Makefile.PL for people to try out.

    • Tony, would you mind trying these files out? Drop them in the root Mac-Carbon-0.80 dir, then run `perl Makefile.PL` and `make` and `make test`. They try to remove the -arch x86_64 flags, and give a warning to any user trying to compile with a 64-bit perl.

      http://pudge.net/tmp/Makefile.PL [pudge.net]

      http://pudge.net/tmp/common.pl [pudge.net]

      • Both URLs return a 403 error.
        • Ugh. OK, I had to rename them, or reconfigure the server, or put them in an archive. So rename them I did!

          http://pudge.net/tmp/Makefile.txt [pudge.net]

          http://pudge.net/tmp/common.txt [pudge.net]

          Thanks.

          • build log [develop-help.com]
            • Awesome, thanks. That dumb creator/type test is failing, I'll look at that again. But other than that, it seems to work for 32-bit.

              Could you try one more thing? Do the first part again, running as 64-bit. But before you run make test, export VERSIONER_PERL_PREFER_32_BIT=yes, so you will have built it using the 64-bit perl, but are running the tests as 32-bit perl.

              Thanks again.

            • Oh and, heh, I notice I got the logic backward on the 64-bit test. I reversed it when I was testing it and forgot to put it back before uploading it. Hope that wasn't too confusing.

              • build log [develop-help.com]

                I used script to capture the output, so there's a few control characters in there, but the Makefile.PL and make were with VERSIONER_PERL_PREFER_32_BIT=yes and the make test with VERSIONER_PERL_PREFER_32_BIT=no

                • I used script to capture the output, so there's a few control characters in there, but the Makefile.PL and make were with VERSIONER_PERL_PREFER_32_BIT=yes and the make test with VERSIONER_PERL_PREFER_32_BIT=no

                  You mean the other way around, right? I don't see make test working under 64-bit. :-)

                  So it looks like just what I hoped for. It seems buildable no matter if perl is running as 64-bit or 32-bit. Just need to fix that one broken test, and maybe try to find a way to run make test with VERSIONER_PERL_PREFER_32_BIT=yes.

                  Thanks!