#! /bin/sh

# This shell script saves various pieces of information about the
# installed version of PostgreSQL.  Packages that interface to
# PostgreSQL can use it to configure their build.
#
# Author:  Peter Eisentraut <peter_e@gmx.net> 
# Public domain

# $Header: /cvsroot/pgsql/src/bin/pg_config/Attic/pg_config.sh,v 1.8 2003/07/23 08:47:25 petere Exp $

me=`basename $0`

# stored configuration values
val_bindir='/usr/lib/postgresql/bin'
val_includedir='/usr/include/postgresql'
val_includedir_server='/usr/include/postgresql/server'
val_libdir='/usr/lib'
val_pkglibdir='/usr/lib/postgresql/lib'
val_configure="'--host=mipsel-linux' '--build=mipsel-linux' '--with-template=linux' '--prefix=/usr' '--mandir=/usr/share/man' '--docdir=/usr/share/doc' '--bindir=/usr/lib/postgresql/bin' '--libdir=/usr/lib' '--includedir=/usr/include/postgresql' '--enable-thread-safety' '--enable-nls' '--enable-integer-datetimes' '--enable-debug' '--disable-rpath' '--with-tcl' '--with-perl' '--with-python' '--with-pam' '--with-krb5' '--with-openssl' '--with-gnu-ld' '--with-tclconfig=/usr/lib/tcl8.4' '--with-tkconfig=/usr/lib/tk8.4' '--with-includes=/usr/include/tcl8.4:/usr/lib/R/include' '--with-libs=/usr/lib/R/bin' '--with-maxbackends=64' '--with-pgport=5432' 'CFLAGS=-g -O2 -DCHECK_RLIMIT_NOFILE' 'DOCBOOKSTYLE=/usr/share/sgml/docbook/stylesheet/dsssl/modular' 'build_alias=mipsel-linux' 'host_alias=mipsel-linux'"
val_version='7.4.7'

help="\
$me provides information about the installed version of PostgreSQL.

Usage:
  $me OPTION...

Options:
  --bindir              show location of user executables
  --includedir          show location of C header files of the client
                        interfaces
  --includedir-server   show location of C header files for the server
  --libdir              show location of object code libraries
  --pkglibdir           show location of dynamically loadable modules
  --configure           show options given to 'configure' script when
                        PostgreSQL was built
  --version             show the PostgreSQL version, then exit
  --help                show this help, then exit

Report bugs to <pgsql-bugs@postgresql.org>."

advice="\
Try \"$me --help\" for more information."

if test "$#" -eq 0 ; then
    echo "$me: argument required" 1>&2
    echo "$advice" 1>&2
    exit 1
fi

show=

for opt
do
    case "$opt" in
        --bindir)       show="$show \$val_bindir";;
        --includedir)   show="$show \$val_includedir";;
        --includedir-server)
                        show="$show \$val_includedir_server";;
        --libdir)       show="$show \$val_libdir";;
        --pkglibdir)    show="$show \$val_pkglibdir";;
        --configure)    show="$show \$val_configure";;

	--version)      echo "PostgreSQL $val_version"
                        exit 0;;
	--help|-\?)     echo "$help"
                        exit 0;;
        *)              echo "$me: invalid argument: $opt" 1>&2
                        echo "$advice" 1>&2
                        exit 1;;
    esac
done

for thing in $show
do
    eval "echo $thing"
done

# end of pg_config
