#!/bin/sh

. config/options

$SCRIPTS/build toolchain

cd $PKG_BUILD
./configure --host=$TARGET_NAME \
            --build=$HOST_NAME \
            --prefix=/usr \
            --disable-static \
            --enable-shared

make

$MAKEINSTALL

mkdir -p $SYSROOT_PREFIX/usr/lib/pkgconfig
cat > $SYSROOT_PREFIX/usr/lib/pkgconfig/mad.pc << "EOF"
prefix=$SYSROOT_PREFIX
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: mad
Description: MPEG audio decoder
Requires:
Version: 0.15.1b
Libs: -L${libdir} -lmad
Cflags: -I${includedir}
EOF
