#!/bin/bash

#	Compiles in OGG and MP3 support if the libraries are already
#	available within libs/

OPT='-DT_LINUX -Wall -g -lm -lpthread'
LIBS=''

[ -f libs/linux-libmad.a ] && {
    OPT="-DMP3_DECODE $OPT"
    LIBS="$LIBS libs/linux-libmad.a"
}
[ -f libs/linux-libvorbisidec.a ] && {
    OPT="-DOGG_DECODE $OPT"
    LIBS="$LIBS libs/linux-libvorbisidec.a"
}

cc $OPT sbagen.c $LIBS -o sbagen || exit 1

