#!/bin/sh

CFLAGS="-ggdb -Wall -Werror-implicit-function-declaration" 
./configure  --with-gdal=/usr/bin \
  --with-postgres \
  --with-postgres-includes=/usr/include/postgresql/ \
  --with-postgres-libs=/usr/lib/ \
  --with-fftw --with-cxx --with-proj-share=/usr/share/proj \
  --with-python --enable-largefile \
  --with-tcltk-includes=/usr/include/tcl8.4 \
  --with-readline \
  --enable-64bit \
  --with-python=/usr/bin/python-config \
  --with-wxwidgets=/usr/bin/wx-config \
  --with-sqlite --with-sqlite-includes=/usr/include \
  --with-sqlite-libs=/usr/lib \
  --with-freetype \
  --with-freetype-includes=/usr/include/freetype2 \
  --with-blas --with-lapack \
  --with-cairo --with-cairo-libs=/usr/lib 
#  --with-cairo-includes=/usr/include 
#  --with-ffmpeg --with-ffmpeg-includes=/usr/include/ffmpeg
#  --with-freetype-libs=/usr/lib \
#  --with-png-includes=/usr/include
#  --with-includes=/usr/include/gdal \



if [ $? -eq 1 ]
	then
	 echo "an error occured"
	 exit
fi


### now compile:
echo "Run for compilation: make"

ARCH=`grep ARCH config.status | cut -d'%' -f3`
echo "After that"
echo " GRASS 7 start script will be in: ./$BINDIR/bin.$ARCH"
echo " GRASS 7 binaries will be in:     ./$PREFIX/dist.$ARCH"
echo "Or run 'make install'"
echo ""
echo "Enjoy."
