#!/bin/sh

. config/options

if [ "$DEBUG" = yes ]; then
  DEBUG_CONFIG="--enable-debug"
else
  DEBUG_CONFIG="--disable-debug --disable-profiling --disable-gcov"
fi

if pkg_uses $1 xorg; then
  XORG_CONFIG="--with-x"
else
  XORG_CONFIG="--without-x"
fi

if pkg_uses $1 sdl; then
  SDL_CONFIG="--enable-sdl"
else
  SDL_CONFIG="--disable-sdl"
fi

if pkg_uses $1 vdpau; then
  VDPAU_CONFIG="--enable-vdpau"
else
  VDPAU_CONFIG="--disable-vdpau"
fi

export LIBS="-L$SYSROOT_PREFIX/usr/lib"

cd $BUILD/$1*
do_configure \
            --disable-nls \
            --enable-orc \
            --disable-rpath \
            --disable-gtk-doc \
            --disable-cdaudio \
            $DEBUG_CONFIG \
            $XORG_CONFIG \
            $SDL_CONFIG \
            $VDPAU_CONFIG \

make
make_install
