Thursday, August 4, 2011

How to compile Image::Scale 0.06 on Solaris

Useful when installing slimserver 7.6 ....

===
Download tarball from http://svn.slimdevices.com/repos/slim/7.6/trunk/vendor/CPAN/
Then compile;

cd Image-Scale-0.06
/opt/csw/bin/perl Makefile.PL

Edit the Makefile

$ diff Makefile Makefile.orig
34,35c34,35
< CC = gcc
< CCCDLFLAGS =
---
> CC = cc
> CCCDLFLAGS = -KPIC
41c41
< LD = gcc
---
> LD = cc
283,284c283,284
< CCFLAGS = -D_REENTRANT -I/opt/csw/bdb44/include -I/opt/csw/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
< OPTIMIZE =
---
> CCFLAGS = -D_REENTRANT -xO3 -xtarget=generic -xarch=generic -I/opt/csw/bdb44/include -I/opt/csw/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
> OPTIMIZE = -xO3 -xtarget=generic -xarch=generic

make

===

Ta-da!