Post

Building Perl DBD::mysql on Solaris 10 Sparc

Building Perl DBD::mysql on Solaris 10 Sparc

Having problems building the Perl DBD::mysql modules on Solaris 10 Sparc 64-bit? The Perl 5.8.4 binary that ships with Solaris 10 is a 32-bit application.

The core issue is a platform architecture mismatch. When attempting to compile DBD::mysql against a 64-bit MySQL installation while using Solaris 10’s native 32-bit Perl, the build fails due to incompatible binaries.

Solution

Download the 32-bit version of MySQL and link against it instead. In this example, 64-bit MySQL runs in /opt/mysql/mysql and the 32-bit version is unpacked to /opt/mysql/mysql32.

Build Commands

1
2
3
4
/usr/perl5/5.8.4/bin/perlgcc Makefile.PL --libs '-R/usr/sfw/lib \
-R/opt/mysql/mysql32/lib -L/usr/sfw/lib -L/opt/mysql/mysql32/lib \
-lmysqlclient -lz -lposix4 -lcrypt -lgen -lsocket -lnsl -lm' \
--cflags '-I/usr/sfw/include -I/usr/include -I/opt/mysql/mysql32/include'

Then execute:

1
gmake install UNINST=1
This post is licensed under CC BY 4.0 by the author.