#!/bin/sh

. config/options

$SCRIPTS/install ccache

setup_toolchain host

# CFLAGS: workaround gcc 4.3.2 bug on x86_64 hosts
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524472
 export CFLAGS="$CFLAGS -fno-strict-aliasing -fPIC"
 export CPPFLAGS="$CPPFLAGS -fexceptions"

cd $PKG_BUILD

mkdir -p objdir
cd objdir

../configure --host=$HOST_NAME \
             --build=$HOST_NAME \
             --target=$TARGET_NAME \
             --prefix=$ROOT/$TOOLCHAIN \
             --enable-shared \
             --disable-static \
             --enable-mpbsd \
             --enable-cxx \

make
make check
make install
