#!/bin/sh

# $Id: configure,v 1.4 2006/08/20 10:17:03 zeldan Exp $
# Copyright (C)  2006  Daniele Zelante

# This file is part of copyblock.
# 
# copyblock is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# copyblock is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with copyblock; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

#@LICENSE

OK=0

ARCH=`uname | sed 's/-.*$//'`

if [ $ARCH = "FreeBSD" ] ; then
	GPREFIX="g"
	OK=1
fi

if [ $ARCH = "NetBSD" ] ; then
	GPREFIX="g"
	OK=1
fi

if [ $ARCH = "Linux" ] ; then
	GPREFIX=""
	OK=1
fi

if [ $ARCH = "CYGWIN_NT" ] ; then
	GPREFIX=""
	OK=1
fi

if [ $OK = 0 ]
	then echo "ERROR: unsupported platform!" ; exit
fi

ERROR=0

which "${GPREFIX}make" > /dev/null
if [ $? != 0  ]
	then echo "ERROR: ${GPREFIX}make not found!" ; OK=0
fi
	
which "${GPREFIX}tar" > /dev/null
if [ $? != 0 ]
	then echo "ERROR: ${GPREFIX}tar not found!" ; OK=0
fi
	
which "${GPREFIX}find" > /dev/null
if [ $? != 0  ]
	then echo "ERROR: ${GPREFIX}find not found!" ; OK=0
fi

if [ $OK != 0 ]
	then echo "OK at $ARCH, type 'make' now."
fi

