Building zlib 64-bit on Solaris i386 platform

Yesterday, I’ve build the zlib library from source on the Solaris i386 platform. I used the SunStudio compiler and the /usr/local as prefix. The directory /build/checkinstall/zlib acts as the install destination (DESTDIR) for package creation.

Don’t forget to set CFLAGS too, if you set CC!

Here is my build script:

#!/bin/sh

CC="cc"; export CC
prefix=/build/checkinstall/zlib/usr/local

echo "stage 1: building 64-bit libs"

CFLAGS="-m64 -fast"
LDSHARED="cc -m64 -G"
export CFLAGS LDSHARED

cmd="./configure --shared"
echo $cmd
echo "continue with config? \c"; read foo
eval $cmd 2>&1 | tee configure.log
echo "continue with make? \c"; read foo
make 2>&1 | tee build.log
echo "continue with install? \c"; read foo
make install prefix=$prefix 2>&1 | tee install.log

echo "moving 64-bit libs in lib/64 dir"
mkdir /var/tmp/lib64$$
mv ${prefix}/lib/* /var/tmp/lib64$$
mv /var/tmp/lib64$$ ${prefix}/lib/64

make clean

echo "stage 2: building 32-bit libs"

CFLAGS="-fast"
unset LDSHARED

cmd="./configure --shared"
echo $cmd
echo "continue with config? \c"; read foo
eval $cmd 2>&1 | tee configure.log
echo "continue with make? \c"; read foo
make 2>&1 | tee build.log
echo "continue with install? \c"; read foo
make install prefix=$prefix 2>&1 | tee install.log

Advertisements