#!/bin/sh

. config/options

if [ "$DEBUG" = yes ]; then
  DEBUG_CONFIG="--enable-debug"
else
  DEBUG_CONFIG="--disable-debug"
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

cd $BUILD/$1*

do_autoconf

do_configure \
  $DEBUG_CONFIG \
  $XORG_CONFIG \
  $SDL_CONFIG \

make
make_install
