#!/bin/sh
debug=no
log=no
while [ $# -gt 0 ]
do
  case x"$1" in
    x-h) echo "usage: configure [-h][-g][-l]"; exit 0;;
    x-g) debug=yes;;
    x-l) log=yes;;
    *) echo "*** configure: unknown command line option '$1' (try '-h')"
       exit 1
       ;;
  esac
  shift
done

CFLAGS="-Wall"
[ $log = no ] && CFLAGS="$CFLAGS -DNLOG"
if [ $debug = yes ]
then
  CFLAGS="$CFLAGS -g"
else
  CFLAGS="$CFLAGS -DNDEBUG -O3"
fi
echo "gcc $CFLAGS"
rm -f makefile
sed -e "s,@CFLAGS@,$CFLAGS," makefile.in > makefile
