#!/bin/sh

set -e

autoreconf -vif
autoreconf -vif lib/cpluff
# we must autoreconf libass as we don't know till later if it's used.
autoreconf -vif lib/libass
autoreconf -vif xbmc/cores/dvdplayer/Codecs/libbdnav
# order matters with libbdnav and friends
[ -d xbmc/cores/dvdplayer/Codecs/libdvd/libdvdcss ] && \
  autoreconf -vif xbmc/cores/dvdplayer/Codecs/libdvd/libdvdcss
autoreconf -vif xbmc/cores/dvdplayer/Codecs/libdvd/libdvdread
autoreconf -vif xbmc/cores/dvdplayer/Codecs/libdvd/libdvdnav

# Clean the generated files
find . -depth -type d -name "autom4te.cache" -exec rm -rf {} \;

echo "Please (re)run configure..."