#!/bin/bash

. config/functions

with_options="xosd evas"
feature_options="debug"

PACKAGE="macosd"
VERSION_MAJOR=0
VERSION_MINOR=3
VERSION_MICRO=1
DATE="March 31, 2006"

init

prefix="/usr/local"

parse_options $*

compile c++ available.c || status_error \
	"A C++ compiler is not installed or does not work correctly.
A C++ compiler is vital for macosd - so you need to install it first"

compile c++ stl.c template.c template-specialization.c \
        partial-template-specialization.c function-template.c \
        || status_error \
	"At least one of the advanced ANSI C++ tests failed.  Since these
features are vital for macosd you need to update to a more recent compiler first."

headercheck c++ iostream string iostream sstream fstream || \
	status_error "Not all tested STL headers are present - please install them."

pkgcheck pbb lib PBB cc "-lpbb" || status_error \
"Pbbuttonsd is not installed on your system."

pkgcheck xosd -config XOSD atleast 2.2.0
pkgcheck evas -config EVAS atleast 0.9.9.025

if [ "$WITHXOSD" = 0 -a "$WITHEVAS" = 0 ] ; then
	status_error \
"Neither xosd nor evas is installed on your system. You need at least
one of them as graphical backend. Evas can be obtaine from:
  www.enlightenment.org"
fi

pkgcheck x11 compile X11 atleast 11.0 || status_error \
"Currently X11 is required for MacOSD."

status "checking for gtkpbbuttons ... "
for x in /usr /usr/local ; do
  if [ -d $x/share/gtkpbbuttons ] ; then
	GTKPBBUTTONS_PREFIX=$x
	break
  fi
done
if [ "$GTKPBBUTTONS_PREFIX" = "" ] ; then
  GTKPBBUTTONS_PREFIX=/usr
  status "no, using default "
fi
var_append save_h " " "GTKPBBUTTONS_PREFIX"
status_result $GTKPBBUTTONS_PREFIX

save

