#!/bin/sh

. config/options $1

export CC_FOR_BUILD="$HOST_CC"
export CPPFLAGS_FOR_BUILD="$HOST_CPPFLAGS"
export CFLAGS_FOR_BUILD="$HOST_CFLAGS -I$SYSROOT_PREFIX/usr/include"
export LDFLAGS_FOR_BUILD="$HOST_LDFLAGS"

export PKG_CONFIG="$PKG_CONFIG --define-variable=prefix=$SYSROOT_PREFIX/usr"

cd $PKG_BUILD

./configure --host=$TARGET_NAME \
            --build=$HOST_NAME \
            --prefix=/usr \
            --sysconfdir=/etc \
            --localstatedir=/var \
            --disable-static \
            --enable-shared \
            --disable-secure-rpc \
            --disable-loadable-i18n \
            --enable-xthreads \
            --disable-xcms \
            --enable-xlocale \
            --enable-xkb \
            --disable-xlocaledir \
            --disable-xf86bigfont \
            --enable-malloc0returnsnull \
            --disable-specs \
            --without-xmlto \
            --without-fop \
            --enable-composecache \
            --disable-lint-library \
            --disable-ipv6 \
            --without-launchd \
            --without-lint

make

$MAKEINSTALL
