#!/bin/sh

prefix=/usr/pkg

PKGLIBDIR=/usr/pkg/lib/c_icap/
LIBDIR=/usr/pkg/lib/
CONFIGDIR=/usr/pkg/etc/
DATADIR=/usr/pkg/share/c_icap/
#LOGDIR=
SOCKDIR=/var/run/c-icap

INCDIR=/usr/pkg/include
INCDIR2=/usr/pkg/include/c_icap

VERSION=0.5.5
CICAPCFLAGS="-I/usr/pkg/include -D_REENTRANT -O2 -I/usr/pkg/include/db4 -I/usr/include -DLDAP_DEPRECATED -I/usr/pkg/include -Wall -D_FILE_OFFSET_BITS=64"
CICAPLDFLAGS=
CICAPLIBS=
CFLAGS="-fvisibility=hidden -DCI_BUILD_MODULE -I/usr/pkg/include -D_REENTRANT -O2 -I/usr/pkg/include/db4 -I/usr/include -DLDAP_DEPRECATED -I/usr/pkg/include -Wall -D_FILE_OFFSET_BITS=64"
LIBS=
LDFLAGS=""


usage()
{
   cat <<EOTXT
Usage: c-icap-config [OPTIONS]

Where OPTION one of the following:
   --prefix             print c-icap instalation base directory
   --cflags		print preprocessor and compiler flags
   --libs		print linker flags
   --datarootdir	print the c-icap data directory
   --configdir		print the c-icap configuration directory
   --modulesdir		print the c-icap modules/plugins directory
   --version		print the c-icap server version
   --config		print the c-icap server compile configuration
EOTXT
}


case $1 in
    '--prefix')
        echo $prefix;
        ;;
    '--cflags')
        echo $CFLAGS" -I"$INCDIR" -I"$INCDIR2;
        ;;
    '--libs')
       echo $LIBS;
       ;;
    '--datarootdir')
       echo $DATADIR;
       ;;
    '--configdir')
       echo $CONFIGDIR;
       ;;
    '--modulesdir')
       echo $PKGLIBDIR;
       ;;
    '--version')
       echo $VERSION;
       ;;
    '--config')
        echo "c-icap configuration";
	echo "c-icap version: "$VERSION;
        echo "c-icap installation prefix: "$prefix
	echo "c-icap configuration directory: "$CONFIGDIR;
	echo "c-icap modules/plugins directory: "$PKGLIBDIR;
	echo "c-icap shared data directory: "$DATADIR;
	echo ;
        echo "c-icap cflags for modules: "$CFLAGS;
        echo "c-icap libs for modules: "$LIBS;
       ;;
    *)
        usage
esac;
