On Mar 13, 2006, at 4:38 AM, Dominic Dunlop wrote:
On 2006–03–13, at 12:53, Manfred Bergmann wrote:
I use some Perl Modules in some of my application, accessed
through Camelbones.
I have notices that some Perl Modules use compiled C-Code, e.g.
HTML-Parser.
Now how does it work to build these modules as Universal Binaries?
The README.macosx distributed with perl-5.8.8 tells you how to make
a universal binary perl. Once you have built and installed such a
perl, any modules that you build using that perl should end up as
universal binaries.
Although my application is build as Universal Binary and I have
been told that it works with Intel-Macs the only thing that is not
Intel native are some Perl Modules that I use. The reason that it
works even on Intel-Macs with a PPC compiled Perl Module is
Rosetta I guess.
Well, maybe. I can't see why Rosetta would make ppc-architecture XS
modules work on an Intel Mac, unless the properties of /usr/bin/
perl had been tweaked (I believe it's done via Get Info) to make it
always run under Rosetta.
Has someone experiences with that and can give me some hints?
In the modules I've tried:
% make 'PASTHRU_INC=-arch i386 -arch ppc' 'OTHERLDFLAGS=-arch i386 -
arch ppc'
was sufficient to build a 2-way universal (this is how Apple builds
the extra CPAN modules).
I understand there are some modules that don't uses these variables,
so hacking of the Makefile may be necessary.
Now that I think about it, we use universal systems, so I can't say
that I've actually tried it on a non-universal system. Seems to me
it should work, since the bundles don't need to resolve all their
symbols (including from libSystem). Let me know if it doesn't work,
as then Apple will need to figure out a solution.
I don't have experience -- you are on your own! While I have been
involved in hacking on the Darwin hints for Perl and updating the
README file, I don't have an Intel-based Mac to try things on, so
have not bothered to try a universal build. Reportedly, not even
Apple builds its universal perl in the way described in
README.macosx; instead, it does separate native build on each
platform, then stitches them together using the lipo utility -- see
<http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2006-01/
msg00731.html>. It may be that Apple also patches Config.pm and its
subordinates so that ExtUtils::MakeMaker (and its subordinates)
generate instructions to build universal modules, But I don't know.
Nope, we build perl universal, much like README.macosx (though
without the SDK stuff). Then we strip out the architecture we don't
need to save space on the final hardware. We also strip out the -
arch flags from Config.pm because most users only want the
architecture that matches what they have.
------------------------------------------------------------------------
--
Edward Moy
Apple Computer, Inc.
[EMAIL PROTECTED]