#!/bin/sh
#
# Pathetic configure script for mythphone
#

# default parameters
festival="no"

for opt do
  case "$opt" in
  --enable-festival) festival="yes"
  ;;
  esac
done

if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
cat << EOF

Usage: configure [options]
Options: [defaults in brackets after descriptions]

Standard options:
  --help                   print this message
  --enable-festival        enable festival TTS Engine [default=no]
EOF
exit 1
fi

echo "Creating config.h, config.pro"

echo ""
echo "Configuration settings: "
echo " "

echo "/*" >  ./mythphone/config.h
echo "    Automatically generated by configure - do not modify" >> ./mythphone/config.h
echo "*/" >> ./mythphone/config.h

echo "#" > ./mythphone/config.pro
echo "#    Automatically generated by configure - modify only under penalty of death" >> ./mythphone/config.pro
echo "#" >> ./mythphone/config.pro

if test "$festival" = "yes" ; then
  echo "        FESTIVAL support will be included"
  echo "#define FESTIVAL_SUPPORT 1" >> ./mythphone/config.h
  echo "FESTIVALDIR = /home/paul/Build/festival/festival/" >> ./mythphone/config.pro
  echo "SPEECHTOOLSDIR = /home/paul/Build/festival/speech_tools/" >> ./mythphone/config.pro
  echo "INCLUDEPATH += \$\${FESTIVALDIR}/src/include" >> ./mythphone/config.pro
  echo "INCLUDEPATH += \$\${SPEECHTOOLSDIR}/include" >> ./mythphone/config.pro
  echo "DEFINES += FESTIVAL_HOME=\\\"\$\${FESTIVALDIR}\\\"" >> ./mythphone/config.pro
  echo "LIBS += -L\$\${FESTIVALDIR}/src/lib" >> ./mythphone/config.pro
  echo "LIBS += -L\$\${SPEECHTOOLSDIR}/lib" >> ./mythphone/config.pro
  echo "LIBS += -lFestival -lestools -lestbase -leststring -ltermcap" >> ./mythphone/config.pro
fi

if test "$festival" = "no" ; then
  echo "        FESTIVAL support will NOT be included"
fi

echo ""

