#!/bin/sh
#
# configure script for mythgallery 
# (copied from "pathetic" script for mythmusic)
#

# default parameters
opengl="no"

for opt do
  case "$opt" in
  --enable-opengl) opengl="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-opengl          enable OpenGL visualizers [default=no]
EOF
exit 1
fi

echo "Creating config.h, config.pro"

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

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

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

if test "$opengl" = "yes" ; then
  echo "        OpenGL support will be included"
  echo "#define OPENGL_SUPPORT 1" >> ./mythgallery/config.h
  echo "CONFIG += opengl" >> ./mythgallery/config.pro
  echo "HEADERS += glsingleview.h" >> ./mythgallery/config.pro
  echo "SOURCES += glsingleview.cpp" >> ./mythgallery/config.pro
fi

if test "$opengl" = "no" ; then
  echo "        OpenGL support will not be included"
fi


