pg_config.sh 2.27 KB
Newer Older
1 2 3 4 5 6 7 8 9
#! /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

10
# $Header: /cvsroot/pgsql/src/bin/pg_config/Attic/pg_config.sh,v 1.5 2001/09/16 16:11:11 petere Exp $
11 12 13 14 15 16

me=`basename $0`

# stored configuration values
val_bindir='@bindir@'
val_includedir='@includedir@'
17
val_includedir_server='@includedir_server@'
18
val_libdir='@libdir@'
19
val_pkglibdir='@pkglibdir@'
20
val_configure="@configure@"
21 22 23 24 25
val_version='@version@'

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

26
Usage: $me --bindir | --includedir | --includedir-server | --libdir | --pkglibdir | --configure | --version
27 28

Operation modes:
29 30 31 32 33
  --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
34
  --pkglibdir           show location of dynamically loadable modules
35 36 37
  --configure           show options given to 'configure' script when
                        PostgreSQL was built
  --version             show the PostgreSQL version and exit
38 39 40 41

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

advice="\
42
Try '$me --help' for more information."
43 44

if test $# -eq 0 ; then
45 46
    echo "$me: argument required" 1>&2
    echo "$advice" 1>&2
47 48 49 50 51 52 53 54 55 56
    exit 1
fi

show=

for opt
do
    case $opt in
        --bindir)       show="$show \$val_bindir";;
        --includedir)   show="$show \$val_includedir";;
57 58
        --includedir-server)
                        show="$show \$val_includedir_server";;
59
        --libdir)       show="$show \$val_libdir";;
60
        --pkglibdir)    show="$show \$val_pkglibdir";;
61 62 63 64 65 66
        --configure)    show="$show \$val_configure";;

	--version)      echo "PostgreSQL $val_version"
                        exit 0;;
	--help|-\?)     echo "$help"
                        exit 0;;
67 68
        *)              echo "$me: invalid argument: $opt" 1>&2
                        echo "$advice" 1>&2
69 70 71 72 73 74 75 76 77
                        exit 1;;
    esac
done

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

78
# end of pg_config