[Box Backup-dev] [PATCH] Win32 merge [01] bbackupd.conf

Martin Ebourne boxbackup-dev@fluffy.co.uk
Mon, 07 Aug 2006 23:48:06 +0100


On Mon, 2006-08-07 at 22:28 +0100, Chris Wilson wrote:
> OK, sorry, I misunderstood.

No problem.

> Yes. bbackupd is a native process, and it needs to find a native Perl 
> using a native path when calling the notify script. But in all other 
> places, we are running under Cygwin, so we need a Unix path to a Cygwin 
> Perl.

Ok, I get it, I hadn't realised cygwin was involved.

I've had another look at the mingw perl patch and I understand what
you're doing now. What you're trying to achieve really is a cross
compilation that just happens to be on the same machine.

The standard nomenclature for a cross compilation scenario is as
follows:

BUILD  - What you are building the package on
HOST   - What the package you are building will run on
TARGET - If the package you are building generates code (ie. compiler),
         what the generated code should run on

So for a normal program being cross compiled (like Box), BUILD is what
you are compiling on (eg. i386-pc-cygwin) and HOST is where it will be
run (eg. i386-pc-windows).

I would find it easier to understand if all the build and test time uses
of PERL were renamed BUILD_PERL and the few runtime ones were named
HOST_PERL. I think that goes for the PERL_EXECUTABLE define in
BoxConfig.h as well. I don't really see why that needs a different name
to the one that is subst in the other files, and I could imagine one day
that the C++ may even have use for both BUILD_PERL and HOST_PERL.

I'd be interested in thoughts from others on this though, because some
may find it confusing (especially anyone who's not cross compiled before
I guess). Maybe BUILD_PERL and RUNTIME_PERL would be more widely
understood?

Also I'm curious as to whether the cross compilation features in
autoconf could be employed to make the mingw build easier (ie. less
special cases), though I don't think we should worry about that for now.

As to the patch itself, the only thing I didn't really like was that you
AC_DEFINE PERL_EXECUTABLE separately for each platform type. I'd prefer
you just do that once, and the only conditional code is that which sets
the values to something platform specific.

Cheers,

Martin.