pg_config.sh 2.23 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.8 2003/07/23 08:47:25 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 27
Usage:
  $me OPTION...
28

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

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

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

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

show=

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

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

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

80
# end of pg_config