Re: Building 32-Bit ONLY Perl on Mac OSX

[email protected] (Jonathan Leffler)
Newsgroups perl.dbi.users
Message-ID <[email protected]>
On Tue, Jun 15, 2010 at 1:48 PM, <[email protected]> wrote:

> my question isn't directly related to DBI, but i need to compile a 386/32
> Bit ONLY Perl Binary on Mac OSX 10.6 (SnowLeopard),
> not only but also because we only have a 32 Bit Oracle Instant Client...
>
> No Matter what Config-Params i tried, the only thing i get is the
> following:
>
> "...file was built for i386 which is not the architecture being linked
> (x86_64)"...
>
> Does anyone have an idea or a good link?
>


The way I've always built Perl with specific bittiness is by specifying that
the compiler is 'cc -m32' or 'cc -m64'.

Just to check that it still works, I've just built Perl 5.12.1 on MacOS X
10.6.4 (released earlier this week), direct from source.

It took me 3 or 4 goes to get the config right because I got return-happy
and missed the questions that need a non-standard answer.

/Users/jleffler/perl/v5.12.1-32bit/bin/perl: Mach-O executable i386
/Users/jleffler/perl/v5.12.1/bin/perl:       Mach-O 64-bit executable x86_64
/usr/bin/perl:                               Mach-O universal binary with 3
architectures
/usr/bin/perl (for architecture x86_64):    Mach-O 64-bit executable x86_64
/usr/bin/perl (for architecture i386):    Mach-O executable i386
/usr/bin/perl (for architecture ppc7400):    Mach-O executable ppc

The really tricky question was the one about building shared libraries - it
was:

What command should be used to create dynamic libraries?
[env MACOSX_DEPLOYMENT_TARGET=10.3 cc]

I had to add '-m32' to that by typing '$1 $2 $3 -m32'.

For the rest, I ensured that the software was installed where I wanted it
(/Users/jleffler/perl/v5.12.1-32bit) and almost everything else was left at
default - I decline to use vfork().

It took, oh, 20 minutes to build and test - probably less; I set it running
while I went swimming with the kids, and it was done long before I got back.

-- 
Jonathan Leffler <[email protected]>  #include <disclaimer.h>
Guardian of DBD::Informix - v2008.0513 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.