143 lines
4.5 KiB
Bash
143 lines
4.5 KiB
Bash
#!/bin/sh
|
|
# Released to Public Domain by Doan Tran Cong Danh
|
|
|
|
print() {
|
|
printf '%s\n' "$@"
|
|
}
|
|
|
|
sysroot="$(cd "${0%/*}" && cd ../.. && pwd)"
|
|
|
|
BINDIR="$sysroot/@PREFIX@/bin"
|
|
DOCDIR="$sysroot/@PREFIX@/share/doc/postgresql"
|
|
HTMLDIR="$sysroot/@PREFIX@/share/doc/postgresql"
|
|
INCLUDEDIR="$sysroot/usr/include"
|
|
PKGINCLUDEDIR="$sysroot/usr/include/postgresql"
|
|
INCLUDEDIR_SERVER="$sysroot/usr/include/postgresql/server"
|
|
LIBDIR="$sysroot/@PREFIX@/lib"
|
|
PKGLIBDIR="$sysroot/@PREFIX@/lib/postgresql"
|
|
LOCALEDIR="$sysroot/@PREFIX@/share/locale"
|
|
MANDIR="$sysroot/@PREFIX@/share/man"
|
|
SHAREDIR="$sysroot/@PREFIX@/share/postgresql"
|
|
SYSCONFDIR="$sysroot/etc/psql@VERSION@/postgresql"
|
|
PGXS="$sysroot/@PREFIX@/lib/postgresql/pgxs/src/makefiles/pgxs.mk"
|
|
|
|
CONFIGURE="@configure_args@"
|
|
CC="@CC@"
|
|
CPPFLAGS="@CPPFLAGS@"
|
|
CFLAGS="@CFLAGS@"
|
|
CFLAGS_SL="@CFLAGS_SL@"
|
|
LDFLAGS="@LDFLAGS@"
|
|
LDFLAGS_EX="@LDFLAGS_EX@"
|
|
LDFLAGS_SL="@LDFLAGS_SL@"
|
|
LIBS="@LIBS@"
|
|
VERSION="PostgreSQL @FULL_VERSION@"
|
|
|
|
if [ "$sysroot" != "/" ]; then
|
|
CPPFLAGS="$(print "$CPPFLAGS" | sed "s,-I *\\(/@PREFIX@/include\\),-I$sysroot\\1,g")"
|
|
CFLAGS="$(print "$CFLAGS" | sed "s,-I *\\(/@PREFIX@/include\\),-I$sysroot\\1,g")"
|
|
LDFLAGS="$(print "$LDFLAGS" | sed "s,-L *\\(/@PREFIX@/lib\\),-L$sysroot\\1,g")"
|
|
fi
|
|
|
|
usage() {
|
|
cat <<-EOF
|
|
$0 provides information about the installed version of PostgreSQL.
|
|
|
|
Usage:
|
|
$0 [OPTION]...
|
|
|
|
Options:
|
|
--bindir show location of user executables
|
|
--docdir show location of documentation files
|
|
--htmldir show location of HTML documentation files
|
|
--includedir show location of C header files of the client interfaces
|
|
--pkgincludedir show location of other C header files
|
|
--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
|
|
--localedir show location of locale support files
|
|
--mandir show location of manual pages
|
|
--sharedir show location of architecture-independent support files
|
|
--sysconfdir show location of system-wide configuration files
|
|
--pgxs show location of extension makefile
|
|
--configure show options given to PostgreSQL was built
|
|
--cc show CC value used when PostgreSQL was built
|
|
--cppflags show CPPFLAGS value used when PostgreSQL was built
|
|
--cflags show CFLAGS value used when PostgreSQL was built
|
|
--cflags_sl show CFLAGS_SL value used when PostgreSQL was built
|
|
--ldflags show LDFLAGS value used when PostgreSQL was built
|
|
--ldflags_ex show LDFLAGS_EX value used when PostgreSQL was built
|
|
--ldflags_sl show LDFLAGS_SL value used when PostgreSQL was built
|
|
--libs show LIBS value used when PostgreSQL was built
|
|
--version show the PostgreSQL version
|
|
-?, --help show this help, then exit
|
|
|
|
With no arguments, all known items are shown.
|
|
|
|
Report bugs to <pgsql-bugs@postgresql.org>.
|
|
EOF
|
|
}
|
|
|
|
if test $# -eq 0; then
|
|
cat <<-EOF
|
|
BINDIR = $BINDIR
|
|
DOCDIR = $DOCDIR
|
|
HTMLDIR = $HTMLDIR
|
|
INCLUDEDIR = $INCLUDEDIR
|
|
PKGINCLUDEDIR = $PKGINCLUDEDIR
|
|
INCLUDEDIR-SERVER = $INCLUDEDIR_SERVER
|
|
LIBDIR = $LIBDIR
|
|
PKGLIBDIR = $PKGLIBDIR
|
|
LOCALEDIR = $LOCALEDIR
|
|
MANDIR = $MANDIR
|
|
SHAREDIR = $SHAREDIR
|
|
SYSCONFDIR = $SYSCONFDIR
|
|
PGXS = $PGXS
|
|
CONFIGURE = $CONFIGURE
|
|
CC = $CC
|
|
CPPFLAGS = $CPPFLAGS
|
|
CFLAGS = $CFLAGS
|
|
CFLAGS_SL = $CFLAGS_SL
|
|
LDFLAGS = $LDFLAGS
|
|
LDFLAGS_EX = $LDFLAGS_EX
|
|
LDFLAGS_SL = $LDFLAGS_SL
|
|
LIBS = $LIBS
|
|
VERSION = $VERSION
|
|
EOF
|
|
fi
|
|
|
|
for arg
|
|
do
|
|
if test "x$arg" = "x--help" || test "x$arg" = "x-?"; then
|
|
usage
|
|
exit 0
|
|
fi
|
|
done
|
|
|
|
for arg
|
|
do
|
|
case "$arg" in
|
|
--bindir) print "$BINDIR" ;;
|
|
--docdir) print "$DOCDIR" ;;
|
|
--htmldir) print "$HTMLDIR" ;;
|
|
--includedir) print "$INCLUDEDIR" ;;
|
|
--pkgincludedir) print "$PKGINCLUDEDIR" ;;
|
|
--includedir-server) print "$INCLUDEDIR_SERVER" ;;
|
|
--libdir) print "$LIBDIR" ;;
|
|
--pkglibdir) print "$PKGLIBDIR" ;;
|
|
--localedir) print "$LOCALEDIR" ;;
|
|
--mandir) print "$MANDIR" ;;
|
|
--sharedir) print "$SHAREDIR" ;;
|
|
--sysconfdir) print "$SYSCONFDIR" ;;
|
|
--pgxs) print "$PGXS" ;;
|
|
--configure) print "$CONFIGURE" ;;
|
|
--cc) print "$CC" ;;
|
|
--cppflags) print "$CPPFLAGS" ;;
|
|
--cflags) print "$CFLAGS" ;;
|
|
--cflags_sl) print "$CFLAGS_SL" ;;
|
|
--ldflags) print "$LDFLAGS" ;;
|
|
--ldflags_ex) print "$LDFLAGS_EX" ;;
|
|
--ldflags_sl) print "$LDFLAGS_SL" ;;
|
|
--libs) print "$LIBS" ;;
|
|
--version) print "$VERSION" ;;
|
|
esac
|
|
done
|