#!/bin/sh

cd src

CFLAGS="-fPIC"
export CFLAGS

./configure --prefix="$SAGE_LOCAL"

if [ $? -ne 0 ]; then
    exit 1
fi

make

if [ $? -ne 0 ]; then
    exit 1
fi

make install

if [ $? -ne 0 ]; then
    exit 1
fi

mkdir "$SAGE_LOCAL"/include/jpeg/

cp *.h "$SAGE_LOCAL"/include/jpeg/

cp *.a "$SAGE_LOCAL"/lib/
