#!/bin/sh
BINDIR='/usr/i686-w64-mingw32/sys-root/mingw/share/doc/postgresql'
DOCDIR='/usr/i686-w64-mingw32/sys-root/mingw/share/doc/postgresql'
HTMLDIR='/usr/i686-w64-mingw32/sys-root/mingw/share/doc/postgresql'
INCLUDEDIR='/usr/i686-w64-mingw32/sys-root/mingw/include/pgsql'
PKGINCLUDEDIR='/usr/i686-w64-mingw32/sys-root/mingw/include/pgsql'
INCLUDEDIRSERVER='/usr/i686-w64-mingw32/sys-root/mingw/include/pgsql/server'
LIBDIR='/usr/i686-w64-mingw32/sys-root/mingw/lib'
PKGLIBDIR='/usr/i686-w64-mingw32/sys-root/mingw/lib/postgresql'
LOCALEDIR='/usr/i686-w64-mingw32/sys-root/mingw/share/locale'
MANDIR='/usr/i686-w64-mingw32/sys-root/mingw/share/man'
SHAREDIR='/usr/i686-w64-mingw32/sys-root/mingw/share/postgresql'
SYSCONFDIR='/usr/i686-w64-mingw32/sys-root/mingw/etc/postgresql'
PGXS='/usr/i686-w64-mingw32/sys-root/mingw/lib/postgresql/pgxs/src/makefiles/pgxs.mk'
CONFIGURE="'--cache-file=mingw32-config.cache' '--host=i686-w64-mingw32' '--build=x86_64-suse-linux-gnu' '--target=i686-w64-mingw32' '--prefix=/usr/i686-w64-mingw32/sys-root/mingw' '--exec-prefix=/usr/i686-w64-mingw32/sys-root/mingw' '--bindir=/usr/i686-w64-mingw32/sys-root/mingw/bin' '--sbindir=/usr/i686-w64-mingw32/sys-root/mingw/sbin' '--sysconfdir=/usr/i686-w64-mingw32/sys-root/mingw/etc' '--datadir=/usr/i686-w64-mingw32/sys-root/mingw/share' '--includedir=/usr/i686-w64-mingw32/sys-root/mingw/include' '--libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib' '--libexecdir=/usr/i686-w64-mingw32/sys-root/mingw/libexec' '--localstatedir=/usr/i686-w64-mingw32/sys-root/mingw/var' '--sharedstatedir=/usr/i686-w64-mingw32/sys-root/mingw/com' '--mandir=/usr/i686-w64-mingw32/sys-root/mingw/share/man' '--infodir=/usr/i686-w64-mingw32/sys-root/mingw/share/info' '--includedir=/usr/i686-w64-mingw32/sys-root/mingw/include/pgsql' '--disable-rpath' '--enable-nls' '--enable-thread-safety' '--enable-integer-datetimes' '--without-readline' '--with-openssl' '--without-ldap' '--without-gssapi' '--without-zlib' '--with-system-tzdata=/usr/share/zoneinfo' 'build_alias=x86_64-suse-linux-gnu' 'host_alias=i686-w64-mingw32' 'target_alias=i686-w64-mingw32' 'CC=i686-w64-mingw32-gcc' 'CFLAGS=-O2 -g -pipe -Wall -fexceptions --param=ssp-buffer-size=4 -mms-bitfields' 'LDFLAGS=-Wl,--exclude-libs=libintl.a -Wl,--exclude-libs=libiconv.a -Wl,--no-keep-memory -fstack-protector' 'CXX=i686-w64-mingw32-g++' 'CXXFLAGS=-O2 -g -pipe -Wall -fexceptions --param=ssp-buffer-size=4 -mms-bitfields' 'CPP=/usr/bin/i686-w64-mingw32-cpp' 'PKG_CONFIG=/usr/bin/i686-w64-mingw32-pkg-config' 'PKG_CONFIG_PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig:/usr/i686-w64-mingw32/sys-root/mingw/share/pkgconfig'"
CC='i686-w64-mingw32-gcc'
CPPFLAGS='-I./src/include/port/win32 -DEXEC_BACKEND -I../../src/include/port/win32 -DBUILDING_DLL'
CFLAGS='-Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -g -pipe -Wall -fexceptions --param=ssp-buffer-size=4 -mms-bitfields'
CFLAGS_SL=''
LDFLAGS='-Wl,--exclude-libs=libintl.a -Wl,--exclude-libs=libiconv.a -Wl,--no-keep-memory -fstack-protector -Wl,--allow-multiple-definition -Wl,--disable-auto-import'
LDFLAGS_EX=''
LDFLAGS_SL=''
LIBS='-lintl -lssl -lcrypto -lm  -lws2_32'
VERSION='PostgreSQL 11.1'

_show_all=1
while [ "$1" != "" ]; do
	case "$1" in
		--bindir)
			echo $BINDIR
			_show_all=0
			;;
		--docdir)
			echo $DOCDIR
			_show_all=0
			;;
		--htmldir)
			echo $HTMLDIR
			_show_all=0
			;;
		--includedir)
			echo $INCLUDEDIR
			_show_all=0
			;;
		--pkgincludedir)
			echo $PKGINCLUDEDIR
			_show_all=0
			;;
		--includedir-server)
			echo $INCLUDEDIRSERVER
			_show_all=0
			;;
		--libdir)
			echo $LIBDIR
			_show_all=0
			;;
		--pkglibdir)
			echo $PKGLIBDIR
			_show_all=0
			;;
		--localedir)
			echo $LOCALEDIR
			_show_all=0
			;;
		--mandir)
			echo $MANDIR
			_show_all=0
			;;
		--sharedir)
			echo $MANDIR
			_show_all=0
			;;
		--sysconfdir)
			echo $SYSCONFDIR
			_show_all=0
			;;
		--pgxs)
			echo $PGXS
			_show_all=0
			;;
		--configure)
			echo $CONFIGURE
			_show_all=0
			;;
		--cc)
			echo $CC
			_show_all=0
			;;
		--cppflags)
			echo $CPPFLAGS
			_show_all=0
			;;
		--cflags)
			echo $CFLAGS
			_show_all=0
			;;
		--cflags_sl)
			echo $CFLAGS_SL
			_show_all=0
			;;
		--ldflags)
			echo $LDFLAGS
			_show_all=0
			;;
		--ldflags_ex)
			echo $LDFLAGS_EX
			_show_all=0
			;;
		--ldflags_sl)
			echo $LDFLAGS_SL
			_show_all=0
			;;
		--libs)
			echo $LIBS
			_show_all=0
			;;
		--version)
			echo $VERSION
			_show_all=0
			;;
		-?|--help)
			cat <<EOF
pg_config provides information about the installed version of PostgreSQL.

Usage:
  pg_config [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 "configure" script when
			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
			;;
		*)
			>&2 echo "Unknown option '$1'"
			exit 1
			;;
	esac
	shift
done

if [ $_show_all -eq 1 ]; then
	cat <<EOF
BINDIR = ${BINDIR}
DOCDIR = ${DOCDIR}
HTMLDIR = ${HTMLDIR}
INCLUDEDIR = ${INCLUDEDIR}
PKGINCLUDEDIR = ${PKGINCLUDEDIR}
INCLUDEDIRSERVER = ${INCLUDEDIRSERVER}
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
