Hi all,

I'm looking for people to help with an experiment.  I'm in pretty far 
over my head, so insights would be greatly appreciated.

  1. Cross-compiling C/C++ to a Win32 target on Linux with autoconf
     and gcc is old hat [1].
  2. Perl is cross-platform.

So, why can't I compile perl code for qdos from the comfort of Linux?

Oh wait, I can.

  http://scratchcomputing.com/tmp/Makefile.cross.patch

This is just a hand-hacked makefile for Scalar-List-Utils (because that 
seems like a good simple starting point.)  The goal today was basically 
just to illuminate the differences between a Linux Makefile and a Win32 
Makefile.

I've been looking at wxPerl as well, but Alien::wxWidgets has all of the 
same single-platform assumptions, so that's yet another thing to 
tackle.

As for the "why?" -- Ultimately, I would love to have a wine-based 
testing system for win32 perl on Linux as well.  Essentially, a 
completely open and scalable solution to all (well mostly all) of your 
win32 build/test needs.  (Sure, one person can buy and install windows 
and vmware, but I shouldn't need to explain the benefits of 
unencumbered redistribution here.)  Even if that doesn't work, doesn't 
the ability to host a par/ppm repository without maintaining a windows 
box sound like a good thing?

Note that I'm not talking about compiling the perl interpreter.  That's 
an entirely different bag of worms.  What I'm trying to tackle here is 
simply the MakeMaker/CBuilder side of things in building modules.  
Something along the lines of:

  perl -MCrossTools Makefile.PL # (or Build.PL)
  ./Build
  ./Build pardist
  ./Build winetest

Also note, I'm not particularly targetting cpan(plus).pm-enabled usage 
for this toolset (at least, there's no particular need for backwards 
compatibility and cross-platform support (except possibly OSX/BSD and 
other gcc-enabled *nixes.))

If you're unfamiliar with MakeMaker/CBuilder/etc, the typical scheme is 
to have a subclass for each platform.

But if you look at autoconf, they've got the "host" and "build" 
concepts.  That is, how we copy and name a file is linux-like, but the 
compiler options are windows-like (they're exactly the same as the 
mingw options on windows -- except of course the -Ldirnames and 
-Ipaths.)

So, what's the best path to get from Makefile.PL to either a workable 
Makefile (nothing wrong with assuming make on linux) or an 
ExtUtils::CBuilder - based solution?

I'm thinking there will be a few places where we have to hack Config.pm, 
and some baldfaced lies via $^O="MSWin32".  Is it a new MakeMaker 
subclass that spits out a cross-enabled CBuilder file plus an 
option/env var for CBuilder to enable the cross-compiling?

Has anybody looked at doing a general-purpose Makefile.PL to 
Module::Build adaptor?  I see Module::Build::Convert, but that wouldn't 
get the Module::Install case.  Of course, the cross-compiling need 
doesn't demand a general-purpose unmaker, but there is overlap.

(Finally, sorry about the cc, just looking for as much insight as I can 
get here.)

Thanks,
Eric

[1] http://www.wxwidgets.org/wiki/index.php/Cross-Compiling_Under_Linux
-- 
"It is a mistake to allow any mechanical object to realize that you are 
in a hurry."
--Ralph's Observation
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to