#!/usr/local/bin/bash

prefix=/usr/local

function printhelp
{
	echo "usage $0 [OPTIONS]"
  echo " --cflags 	- print compiler flags"
	echo " --libs			- print linker flags"
  echo " --prefix   - print the installation prefix"
  echo " --datadir  - print the datadir of verlihub"
	echo " --version	- print verlihub's version"
}

case "x$1" in
"x--cflags") echo -I$prefix/include -I$prefix/include/verlihub -I/usr/local/include/mysql  -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/local/include
;;

"x--libs") echo -L/usr/local/lib -Wl,-R/usr/local/lib -lpcre -L/usr/local/lib/mysql -lmysqlclient -lz -lcrypt -lm -lc -lcrypt -L/usr/local/lib -lGeoIP  -D_THREAD_SAFE -pthread -L$prefix/lib -lverlihub
;;
"x--prefix") echo $prefix ;;
"x--datadir") echo ${prefix}/share/verlihub ;;
"x--version") 
	echo -n "verlihub version: 0.9.8d-RC2"
	cat $prefix/include/verlihub/curr_date_time.h |sed -e "s/^.*\\\"\\(.*\\)\\\"/ \\1/" 
;;
"x--help") printhelp ;;
esac
