#!/bin/sh

################################################################################
#      This file is part of OpenELEC - http://www.openelec.tv
#      Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
#  This Program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2, or (at your option)
#  any later version.
#
#  This Program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with OpenELEC.tv; see the file COPYING.  If not, write to
#  the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
#  http://www.gnu.org/copyleft/gpl.html
################################################################################

. config/options $1

$SCRIPTS/unpack SDL

SDL_DIR=`ls -d $BUILD/SDL-[0-9]*`

setup_toolchain host

cd $SDL_DIR

mkdir -p .build-host && cd .build-host
../configure --host=$HOST_NAME \
             --build=$HOST_NAME \
             --prefix=$ROOT/$TOOLCHAIN \
             --sysconfdir=$ROOT/$TOOLCHAIN/etc \
             --localstatedir=/var \
             --enable-shared \
             --disable-static \
             --enable-rpath \
             --enable-libc \
             --disable-audio \
             --disable-events \
             --disable-joystick \
             --disable-cdrom \
             --enable-threads \
             --enable-timers \
             --enable-file \
             --enable-loadso \
             --enable-cpuinfo \
             --enable-assembly \
             --disable-oss \
             --disable-alsa \
             --disable-alsatest \
             --disable-alsa-shared \
             --disable-esd \
             --disable-esdtest \
             --disable-esd-shared \
             --disable-pulseaudio \
             --disable-pulseaudio-shared \
             --disable-arts \
             --disable-arts-shared \
             --disable-nas \
             --disable-diskaudio \
             --disable-dummyaudio \
             --disable-mintaudio \
             --enable-nasm \
             --disable-altivec \
             --disable-ipod \
             --disable-video \
             --disable-x11-shared \
             --disable-video-x11-dgamouse \
             --disable-video-x11-xinerama \
             --disable-video-x11-xme \
             --disable-video-x11-xrandr \
             --disable-video-x11 \
             --disable-video-x11-vm \
             --disable-video-x11-xv \
             --without-x \
             --disable-video-opengl \
             --disable-video-nanox \
             --disable-nanox-debug \
             --disable-nanox-share-memory \
             --disable-nanox-direct-fb \
             --disable-dga \
             --disable-video-dga \
             --disable-video-photon \
             --disable-video-carbon \
             --disable-video-cocoa \
             --disable-video-fbcon \
             --disable-video-directfb \
             --disable-video-ps2gs \
             --disable-video-ggi \
             --disable-video-svga \
             --disable-video-vgl \
             --disable-video-wscons \
             --disable-video-aalib \
             --disable-video-qtopia \
             --disable-video-picogui \
             --disable-video-dummy \
             --disable-osmesa-shared \
             --disable-input-events \
             --disable-input-tslib \
             --disable-pth \
             --enable-pthreads \
             --enable-pthread-sem \
             --disable-stdio-redirect \
             --disable-directx \
             --enable-sdl-dlopen \
             --disable-atari-ldg \
             --disable-clock_gettime \

make
make install
