#!/bin/sh
#
# Return information about the local PDFlib installation
#
# $Id: pdflib-config.in,v 1.10 2001/04/12 13:33:05 tm Exp $

# installation directories
prefix=${DESTDIR}/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
bindir=${exec_prefix}/bin

usage()
{
	cat <<EOF
Print information on PDFlib's version, configuration, and use.
Usage: pdflib-config [options]
Options:
	--bindings        # available PDFlib language bindings
	--libdir          # directory where PDFlib library is installed
	--includedir      # directory where PDFlib header is installed
	--version         # complete PDFlib version string
	--majorversion    # PDFlib major version number
	--minorversion    # PDFlib minor version number
	--revision        # PDFlib revision version number
	--libversion      # PDFlib's libtool interface number (not
                          # necessarily the shared library file name suffix!)
	--pdi             # whether or not PDF import library (PDI) is available
	--ldflags         # options required for linking against PDFlib
	--libs            # same as --ldflags
	--cflags          # options required for compiling PDFlib applications
	--includes        # same as --cflags
	--all             # print a summary of all PDFlib configure options
EOF
	exit $1
}

if test $# -eq 0; then
	usage 1 1>&2
fi

while test $# -gt 0; do
    case "$1" in
    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
    *) optarg= ;;
    esac

    case $1 in
    --bindings)
	echo c
	;;
    --libdir)
	echo $libdir
	;;
    --includedir)
	echo $includedir
	;;
    --version)
	echo 4.0.3
	;;
    --majorversion)
	echo 4
	;;
    --minorversion)
	echo 0
	;;
    --pdi)
	echo no
	;;
    --revision)
	echo 3
	;;
    --libversion)
	echo 2:3:1
	;;
    --libs|--ldflags)
	echo -L${exec_prefix}/lib -lpdf -L/usr/local/lib -ltiff -ljpeg -lpng  -lz -lm
	;;
    --cflags|--includes)
	echo -I${prefix}/include
	;;
    --all)
	echo "PDFlib      4.0.3"
	echo "bindings:   c"
	echo "includedir: $includedir"
	echo "libdir:     $libdir"
	echo "libversion: 2:3:1"
	echo "pdi:        no"
	echo "ldflags:    -L${exec_prefix}/lib -lpdf -L/usr/local/lib -ltiff -ljpeg -lpng  -lz -lm"
	echo "cflags:     -I${prefix}/include"
	;;
    *)
	usage 1 1>&2
	;;
    esac
    shift
done
