#! /bin/bash
#*******************************************************************************
#
# "@(#) $Id: configure_script,v 1.2 2010/05/19 15:51:56 javarias Exp $"
#
# who       when      what
# --------  --------  ----------------------------------------------
# javarias 2010-05-05 created
#

echo Configuring log4cpp
#
# Check parameters
#
LOG4CPP_TAR=$1
LOG4CPP_VER=$2

echo  "   log4cpp tar file is: $LOG4CPP_TAR"
echo  "   log4cpp version  is: $LOG4CPP_VER"

#
# Check for installation directories
#
if [ "$INTROOT" != "" ] 
then 
   INSTALL_DIR=$INTROOT
elif [ "$INTLIST" != "" ] 
then 
   INSTALL_DIR=`echo $INTLIST | awk 'BEGIN {FS=":"} {print $1}'`
elif [ "$ACSROOT" != "" ] 
then 
   INSTALL_DIR=$ACSROOT
elif [ "$VLTROOT" != "" ] 
then 
   INSTALL_DIR=$VLTROOT
else 
   echo "no installation directories (INTROOT, INTLIST, ACSROOT, VLTROOT) have been found"
   echo "please define one and start again" 
   exit 1
fi

#
# For some unknown reason, configure failes on SunOS
# by replacing RANLIB with @/bin/true instead of 
# the proper application
#

PLATFORM=`uname`
if [ "$PLATFORM" != "SunOS" ] 
then 
   CONFIGPARMS=""
else
   RANLIB=`which ranlib`
   CONFIGPARMS=""
fi

cd log4cpp-$LOG4CPP_VER
./configure --enable-shared --prefix=$INSTALL_DIR

echo "configuration file created"

#
# ___oOo___
