void-packages/srcpkgs/postgresql/files/pg_config.sh.in

140 lines
4.3 KiB
Bash
Raw Normal View History

#!/bin/sh
# Released to Public Domain by Doan Tran Cong Danh
sysroot="$(cd "${0%/*}" && cd ../.. && pwd)"
BINDIR="$sysroot/usr/bin"
DOCDIR="$sysroot/usr/share/doc/postgresql"
HTMLDIR="$sysroot/usr/share/doc/postgresql"
INCLUDEDIR="$sysroot/usr/include"
PKGINCLUDEDIR="$sysroot/usr/include/postgresql"
INCLUDEDIR_SERVER="$sysroot/usr/include/postgresql/server"
LIBDIR="$sysroot/usr/lib"
PKGLIBDIR="$sysroot/usr/lib/postgresql"
LOCALEDIR="$sysroot/usr/share/locale"
MANDIR="$sysroot/usr/share/man"
SHAREDIR="$sysroot/usr/share/postgresql"
SYSCONFDIR="$sysroot/etc/postgresql"
PGXS="$sysroot/usr/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 @VERSION@"
if [ "$sysroot" != "/" ]; then
CPPFLAGS="$(echo "$CPPFLAGS" | sed "s,-I *\\(/usr/include\\),-I$sysroot\\1,g")"
CFLAGS="$(echo "$CFLAGS" | sed "s,-I *\\(/usr/include\\),-I$sysroot\\1,g")"
LDFLAGS="$(echo "$LDFLAGS" | sed "s,-L *\\(/usr/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) echo "$BINDIR" ;;
--docdir) echo "$DOCDIR" ;;
--htmldir) echo "$HTMLDIR" ;;
--includedir) echo "$INCLUDEDIR" ;;
--pkgincludedir) echo "$PKGINCLUDEDIR" ;;
--includedir-server) echo "$INCLUDEDIR_SERVER" ;;
--libdir) echo "$LIBDIR" ;;
--pkglibdir) echo "$PKGLIBDIR" ;;
--localedir) echo "$LOCALEDIR" ;;
--mandir) echo "$MANDIR" ;;
--sharedir) echo "$SHAREDIR" ;;
--sysconfdir) echo "$SYSCONFDIR" ;;
--pgxs) echo "$PGXS" ;;
--configure) echo "$CONFIGURE" ;;
--cc) echo "$CC" ;;
--cppflags) echo "$CPPFLAGS" ;;
--cflags) echo "$CFLAGS" ;;
--cflags_sl) echo "$CFLAGS_SL" ;;
--ldflags) echo "$LDFLAGS" ;;
--ldflags_ex) echo "$LDFLAGS_EX" ;;
--ldflags_sl) echo "$LDFLAGS_SL" ;;
--libs) echo "$LIBS" ;;
--version) echo "$VERSION" ;;
esac
done