diff options
author | Michael P | 2011-07-05 03:16:11 +0000 |
---|---|---|
committer | Michael P | 2011-07-06 03:40:35 +0000 |
commit | 0bbfc1e6338b5d98d6cb83fa75f2c38f527d4d4b (patch) | |
tree | 46fa412a31d08ea6e53d488ae7bc231df0b273da | |
parent | 091b0e828cf0fd5bbd1f9ae58ab96fc983e55d77 (diff) | |
parent | a4bebdd92624e018108c2610fc3f2c1584b6c687 (diff) |
Merge commit 'a4bebdd92624e018108c2610fc3f2c1584b6c687' into master
This is the commit merge of Postgres-XC with the intersection of
PostgreSQL REL9_1_STABLE and master branches.
Conflicts:
COPYRIGHT
contrib/pgbench/pgbench.c
src/Makefile
src/backend/access/transam/recovery.conf.sample
src/backend/access/transam/varsup.c
src/backend/access/transam/xlog.c
src/backend/catalog/Makefile
src/backend/catalog/dependency.c
src/backend/catalog/system_views.sql
src/backend/commands/copy.c
src/backend/commands/explain.c
src/backend/commands/sequence.c
src/backend/commands/tablecmds.c
src/backend/commands/vacuum.c
src/backend/executor/nodeAgg.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/outfuncs.c
src/backend/nodes/readfuncs.c
src/backend/optimizer/path/allpaths.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/setrefs.c
src/backend/parser/gram.y
src/backend/parser/parse_utilcmd.c
src/backend/postmaster/postmaster.c
src/backend/rewrite/rewriteHandler.c
src/backend/storage/lmgr/proc.c
src/backend/tcop/postgres.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/init/postinit.c
src/backend/utils/misc/guc.c
src/backend/utils/misc/postgresql.conf.sample
src/backend/utils/sort/tuplesort.c
src/bin/initdb/initdb.c
src/bin/pg_ctl/pg_ctl.c
src/bin/pg_dump/pg_dump.c
src/include/access/xlog.h
src/include/catalog/catversion.h
src/include/catalog/indexing.h
src/include/catalog/pg_aggregate.h
src/include/catalog/pg_proc.h
src/include/commands/copy.h
src/include/nodes/parsenodes.h
src/include/nodes/primnodes.h
src/include/optimizer/pathnode.h
src/include/parser/kwlist.h
src/include/storage/procarray.h
src/test/regress/expected/.gitignore
src/test/regress/expected/aggregates.out
src/test/regress/expected/alter_table.out
src/test/regress/expected/bit.out
src/test/regress/expected/box.out
src/test/regress/expected/delete.out
src/test/regress/expected/float4.out
src/test/regress/expected/float8.out
src/test/regress/expected/int2.out
src/test/regress/expected/int8.out
src/test/regress/expected/interval.out
src/test/regress/expected/numeric.out
src/test/regress/expected/point.out
src/test/regress/expected/polygon.out
src/test/regress/expected/sequence.out
src/test/regress/expected/timestamp.out
src/test/regress/expected/timestamptz.out
src/test/regress/expected/transactions.out
src/test/regress/expected/window.out
src/test/regress/input/misc.source
src/test/regress/output/create_misc_1.source
src/test/regress/output/misc.source
src/test/regress/sql/aggregates.sql
src/test/regress/sql/alter_table.sql
src/test/regress/sql/bit.sql
src/test/regress/sql/box.sql
src/test/regress/sql/delete.sql
src/test/regress/sql/domain.sql
src/test/regress/sql/float4.sql
src/test/regress/sql/float8.sql
src/test/regress/sql/int2.sql
src/test/regress/sql/int8.sql
src/test/regress/sql/interval.sql
src/test/regress/sql/lseg.sql
src/test/regress/sql/numeric.sql
src/test/regress/sql/path.sql
src/test/regress/sql/point.sql
src/test/regress/sql/polygon.sql
src/test/regress/sql/portals.sql
src/test/regress/sql/sequence.sql
src/test/regress/sql/timestamp.sql
src/test/regress/sql/timestamptz.sql
src/test/regress/sql/transactions.sql
src/test/regress/sql/window.sql
src/test/regress/sql/with.sql
3202 files changed, 312423 insertions, 128793 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..1e15ce5fc1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +# Global excludes across all subdirectories +*.o +*.so +*.so.[0-9] +*.so.[0-9].[0-9] +*.sl +*.sl.[0-9] +*.sl.[0-9].[0-9] +*.dylib +*.dll +*.a +*.mo +objfiles.txt +.deps/ +*.gcno +*.gcda +*.gcov +*.gcov.out +lcov.info +*.vcproj +win32ver.rc +*.exe +lib*dll.def + +# Local excludes in root directory +/GNUmakefile +/config.log +/config.status +/pgsql.sln +/pgsql.sln.cache +/Debug/ +/Release/ @@ -1,7 +1,7 @@ Postgres-XC Cluster Database Management System Portions Copyright (c) 2010-2011, Nippon Telegraph and Telephone Corporation -Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group +Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group Portions Copyright (c) 1994, The Regents of the University of California diff --git a/GNUmakefile.in b/GNUmakefile.in index 86623a3854..79b0da42a8 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -1,64 +1,46 @@ # # PostgreSQL top level makefile # -# $PostgreSQL: pgsql/GNUmakefile.in,v 1.58 2010/03/30 00:10:46 petere Exp $ +# GNUmakefile.in # subdir = top_builddir = . include $(top_builddir)/src/Makefile.global +$(call recurse,all install,src config) + all: - $(MAKE) -C src all - $(MAKE) -C config all - @echo "All of PostgreSQL successfully made. Ready to install." + +@echo "All of PostgreSQL successfully made. Ready to install." docs: $(MAKE) -C doc all +$(call recurse,world,doc src config contrib,all) world: - $(MAKE) -C doc all - $(MAKE) -C src all - $(MAKE) -C config all - $(MAKE) -C contrib all - @echo "PostgreSQL, contrib, and documentation successfully made. Ready to install." + +@echo "PostgreSQL, contrib, and documentation successfully made. Ready to install." html man: $(MAKE) -C doc $@ install: - $(MAKE) -C src $@ - $(MAKE) -C config $@ - @echo "PostgreSQL installation complete." + +@echo "PostgreSQL installation complete." install-docs: $(MAKE) -C doc install +$(call recurse,install-world,doc src config contrib,install) install-world: - $(MAKE) -C doc install - $(MAKE) -C src install - $(MAKE) -C config install - $(MAKE) -C contrib install - @echo "PostgreSQL, contrib, and documentation installation complete." + +@echo "PostgreSQL, contrib, and documentation installation complete." -installdirs uninstall coverage: - $(MAKE) -C doc $@ - $(MAKE) -C src $@ - $(MAKE) -C config $@ +$(call recurse,installdirs uninstall coverage,doc src config) -distprep: - $(MAKE) -C doc $@ - $(MAKE) -C src $@ - $(MAKE) -C config $@ - $(MAKE) -C contrib $@ +$(call recurse,distprep,doc src config contrib) # clean, distclean, etc should apply to contrib too, even though # it's not built by default +$(call recurse,clean,doc contrib src config) clean: - $(MAKE) -C doc $@ - $(MAKE) -C contrib $@ - $(MAKE) -C src $@ - $(MAKE) -C config $@ # Garbage from autoconf: @rm -rf autom4te.cache/ @@ -78,11 +60,11 @@ check: all check installcheck installcheck-parallel: $(MAKE) -C src/test $@ -installcheck-world: - $(MAKE) -C src/test installcheck - $(MAKE) -C src/pl installcheck - $(MAKE) -C src/interfaces/ecpg installcheck - $(MAKE) -C contrib installcheck +$(call recurse,check-world,src/test src/pl src/interfaces/ecpg contrib,check) + +$(call recurse,installcheck-world,src/test src/pl src/interfaces/ecpg contrib,installcheck) + +$(call recurse,maintainer-check,doc src config contrib) GNUmakefile: GNUmakefile.in $(top_builddir)/config.status ./config.status $@ @@ -122,7 +104,7 @@ distdir: cp $(distdir)/doc/src/sgml/INSTALL $(distdir)/ cp $(distdir)/doc/src/sgml/regress_README $(distdir)/src/test/regress/README $(MAKE) -C $(distdir) distclean - rm -f $(distdir)/README.CVS + rm -f $(distdir)/README.git distcheck: dist rm -rf $(dummy) @@ -143,4 +125,4 @@ distcheck: dist rm -rf $(distdir) $(dummy) @echo "Distribution integrity checks out." -.PHONY: dist distdir distcheck docs install-docs +.PHONY: dist distdir distcheck docs install-docs world check-world install-world installcheck-world @@ -11,7 +11,7 @@ # GNUmakefile won't exist yet, so we catch that case as well. -all check install installdirs installcheck installcheck-parallel uninstall clean distclean maintainer-clean dist distcheck world install-world installcheck-world: +all check install installdirs installcheck installcheck-parallel uninstall clean distclean maintainer-clean dist distcheck world check-world install-world installcheck-world: @if [ ! -f GNUmakefile ] ; then \ echo "You need to run the 'configure' program first. See the file"; \ echo "'INSTALL' for installation instructions." ; \ @@ -1,6 +1,6 @@ PostgreSQL Database Management System ===================================== - + This directory contains the source code distribution of the PostgreSQL database management system. @@ -26,4 +26,3 @@ instructions. The latest version of this software may be obtained at http://www.postgresql.org/download/. For more information look at our web site located at http://www.postgresql.org/. - diff --git a/README.CVS b/README.git index 4eb8377a50..83b9a8c581 100644 --- a/README.CVS +++ b/README.git @@ -2,13 +2,13 @@ In a release or snapshot tarball of PostgreSQL, documentation files named INSTALL and HISTORY will appear in this directory. However, these files are -not stored in CVS and so will not be present if you are using a CVS checkout. -If you are using CVS, you can view the most recent install instructions at: +not stored in git and so will not be present if you are using a git checkout. +If you are using git, you can view the most recent install instructions at: http://developer.postgresql.org/docs/postgres/installation.html and the current release notes at: http://developer.postgresql.org/docs/postgres/release.html -Users compiling from CVS will also need compatible versions of Bison, Flex, +Users compiling from git will also need compatible versions of Bison, Flex, and Perl, as discussed in the install documentation. These programs are not needed when using a tarball, since the files they are needed to build are already present in the tarball. (On Windows, however, you need Perl anyway.) diff --git a/aclocal.m4 b/aclocal.m4 index b007cd0a48..eaf98007e5 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -dnl $PostgreSQL: pgsql/aclocal.m4,v 1.18 2004/04/23 18:15:47 momjian Exp $ +dnl aclocal.m4 m4_include([config/ac_func_accept_argtypes.m4]) m4_include([config/acx_pthread.m4]) m4_include([config/c-compiler.m4]) diff --git a/config/Makefile b/config/Makefile index 2e881b7704..da1283868e 100644 --- a/config/Makefile +++ b/config/Makefile @@ -1,4 +1,4 @@ -# $PostgreSQL: pgsql/config/Makefile,v 1.3 2009/08/26 22:24:42 petere Exp $ +# config/Makefile subdir = config top_builddir = .. diff --git a/config/ac_func_accept_argtypes.m4 b/config/ac_func_accept_argtypes.m4 index 917d59ab86..1e7717922d 100644 --- a/config/ac_func_accept_argtypes.m4 +++ b/config/ac_func_accept_argtypes.m4 @@ -1,13 +1,12 @@ -# $PostgreSQL: pgsql/config/ac_func_accept_argtypes.m4,v 1.6 2003/11/29 19:51:17 pgsql Exp $ +# config/ac_func_accept_argtypes.m4 # This comes from the official Autoconf macro archive at # <http://research.cys.de/autoconf-archive/> -# (I removed the $ before the Id CVS keyword below.) dnl @synopsis AC_FUNC_ACCEPT_ARGTYPES dnl dnl Checks the data types of the three arguments to accept(). Results are -dnl placed into the symbols ACCEPT_TYPE_RETURN and ACCEPT_TYPE_ARG[123], +dnl placed into the symbols ACCEPT_TYPE_RETURN and ACCEPT_TYPE_ARG[123], dnl consistent with the following example: dnl dnl #define ACCEPT_TYPE_RETURN int @@ -21,7 +20,7 @@ dnl dnl NOTE: This is just a modified version of the AC_FUNC_SELECT_ARGTYPES dnl macro. Credit for that one goes to David MacKenzie et. al. dnl -dnl @version Id: ac_func_accept_argtypes.m4,v 1.1 1999/12/03 11:29:29 simons Exp $ +dnl @version $Id: ac_func_accept_argtypes.m4,v 1.1 1999/12/03 11:29:29 simons Exp $ dnl @author Daniel Richard G. <[email protected]> dnl @@ -38,7 +37,8 @@ dnl # which is *not* 'socklen_t *'). If we detect that, then we assume # 'int' as the result, because that ought to work best. # -# On Win32, accept() returns 'unsigned int PASCAL' +# On Win32, accept() returns 'unsigned int PASCAL' +# Win64 uses SOCKET for return and arg1 AC_DEFUN([AC_FUNC_ACCEPT_ARGTYPES], [AC_MSG_CHECKING([types of arguments for accept()]) @@ -46,8 +46,8 @@ AC_DEFUN([AC_FUNC_ACCEPT_ARGTYPES], [AC_CACHE_VAL(ac_cv_func_accept_arg1,dnl [AC_CACHE_VAL(ac_cv_func_accept_arg2,dnl [AC_CACHE_VAL(ac_cv_func_accept_arg3,dnl - [for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL'; do - for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do + [for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET'; do + for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do AC_TRY_COMPILE( diff --git a/config/acx_pthread.m4 b/config/acx_pthread.m4 index ceb161a556..6ff241eba1 100644 --- a/config/acx_pthread.m4 +++ b/config/acx_pthread.m4 @@ -142,7 +142,8 @@ main (int argc, char **argv) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext - if test "`(eval $ac_link 2>&1 1>&5)`" = ""; then + # Check both linking and compiling, because they might tolerate different options. + if test "`(eval $ac_link 2>&1 1>&5)`" = "" && test "`(eval $ac_compile 2>&1 1>&5)`" = ""; then # we continue with more flags because Linux needs -lpthread # for libpq builds on PostgreSQL. The test above only # tests for building binaries, not shared libraries. diff --git a/config/c-compiler.m4 b/config/c-compiler.m4 index a8df61b649..9398ca6c47 100644 --- a/config/c-compiler.m4 +++ b/config/c-compiler.m4 @@ -1,5 +1,5 @@ # Macros to detect C compiler features -# $PostgreSQL: pgsql/config/c-compiler.m4,v 1.22 2010/05/25 17:28:20 meskes Exp $ +# config/c-compiler.m4 # PGAC_C_SIGNED @@ -126,13 +126,21 @@ fi])# PGAC_C_FUNCNAME_SUPPORT # Given a string, check if the compiler supports the string as a # command-line option. If it does, add the string to CFLAGS. AC_DEFUN([PGAC_PROG_CC_CFLAGS_OPT], -[AC_MSG_CHECKING([if $CC supports $1]) -pgac_save_CFLAGS=$CFLAGS +[define([Ac_cachevar], [AS_TR_SH([pgac_cv_prog_cc_cflags_$1])])dnl +AC_CACHE_CHECK([whether $CC supports $1], [Ac_cachevar], +[pgac_save_CFLAGS=$CFLAGS CFLAGS="$pgac_save_CFLAGS $1" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], - AC_MSG_RESULT(yes), - [CFLAGS="$pgac_save_CFLAGS" - AC_MSG_RESULT(no)]) + [Ac_cachevar=yes], + [Ac_cachevar=no]) +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS"]) +if test x"$Ac_cachevar" = x"yes"; then + CFLAGS="$CFLAGS $1" +fi +undefine([Ac_cachevar])dnl ])# PGAC_PROG_CC_CFLAGS_OPT @@ -145,14 +153,17 @@ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], # you can link to a particular function, not just whether you can link. # In fact, we must actually check that the resulting program runs :-( AC_DEFUN([PGAC_PROG_CC_LDFLAGS_OPT], -[AC_MSG_CHECKING([if $CC supports $1]) -pgac_save_LDFLAGS=$LDFLAGS +[define([Ac_cachevar], [AS_TR_SH([pgac_cv_prog_cc_ldflags_$1])])dnl +AC_CACHE_CHECK([whether $CC supports $1], [Ac_cachevar], +[pgac_save_LDFLAGS=$LDFLAGS LDFLAGS="$pgac_save_LDFLAGS $1" AC_RUN_IFELSE([AC_LANG_PROGRAM([extern void $2 (); void (*fptr) () = $2;],[])], - AC_MSG_RESULT(yes), - [LDFLAGS="$pgac_save_LDFLAGS" - AC_MSG_RESULT(no)], - [LDFLAGS="$pgac_save_LDFLAGS" - AC_MSG_RESULT(assuming no)]) + [Ac_cachevar=yes], + [Ac_cachevar=no], + [Ac_cachevar="assuming no"]) +LDFLAGS="$pgac_save_LDFLAGS"]) +if test x"$Ac_cachevar" = x"yes"; then + LDFLAGS="$LDFLAGS $1" +fi +undefine([Ac_cachevar])dnl ])# PGAC_PROG_CC_LDFLAGS_OPT - diff --git a/config/c-library.m4 b/config/c-library.m4 index 5d44685ec0..cddeafaec2 100644 --- a/config/c-library.m4 +++ b/config/c-library.m4 @@ -1,5 +1,5 @@ # Macros that test various C library quirks -# $PostgreSQL: pgsql/config/c-library.m4,v 1.34 2009/07/02 18:55:40 petere Exp $ +# config/c-library.m4 # PGAC_VAR_INT_TIMEZONE @@ -297,3 +297,32 @@ int main() ])dnl AC_CACHE_VAL AC_MSG_RESULT([$pgac_cv_printf_arg_control]) ])# PGAC_FUNC_PRINTF_ARG_CONTROL + + +# PGAC_TYPE_LOCALE_T +# ------------------ +# Check for the locale_t type and find the right header file. Mac OS +# X needs xlocale.h; standard is locale.h, but glibc also has an +# xlocale.h file that we should not use. +# +AC_DEFUN([PGAC_TYPE_LOCALE_T], +[AC_CACHE_CHECK([for locale_t], pgac_cv_type_locale_t, +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[#include <locale.h> +locale_t x;], +[])], +[pgac_cv_type_locale_t=yes], +[AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[#include <xlocale.h> +locale_t x;], +[])], +[pgac_cv_type_locale_t='yes (in xlocale.h)'], +[pgac_cv_type_locale_t=no])])]) +if test "$pgac_cv_type_locale_t" != no; then + AC_DEFINE(HAVE_LOCALE_T, 1, + [Define to 1 if the system has the type `locale_t'.]) +fi +if test "$pgac_cv_type_locale_t" = 'yes (in xlocale.h)'; then + AC_DEFINE(LOCALE_T_IN_XLOCALE, 1, + [Define to 1 if `locale_t' requires <xlocale.h>.]) +fi])])# PGAC_HEADER_XLOCALE diff --git a/config/config.guess b/config/config.guess index 115f944a61..40eaed4821 100755 --- a/config/config.guess +++ b/config/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. -timestamp='2010-04-03' +timestamp='2011-05-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -57,7 +57,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -92,7 +92,7 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' HUP INT TERM +trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -106,7 +106,7 @@ trap 'exit 1' HUP INT TERM set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || @@ -181,7 +181,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -224,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -270,7 +270,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit ;; + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -296,7 +299,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -395,23 +398,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -481,8 +484,8 @@ EOF echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -495,7 +498,7 @@ EOF else echo i586-dg-dgux${UNAME_RELEASE} fi - exit ;; + exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; @@ -552,7 +555,7 @@ EOF echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[456]) + *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -595,52 +598,52 @@ EOF 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac + esac ;; + esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + sed 's/^ //' << EOF >$dummy.c - #define _HPUX_SOURCE - #include <stdlib.h> - #include <unistd.h> + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa @@ -731,22 +734,22 @@ EOF exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -770,14 +773,14 @@ EOF exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -805,14 +808,14 @@ EOF echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; @@ -867,7 +870,7 @@ EOF EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; - esac + esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} @@ -879,7 +882,13 @@ EOF then echo ${UNAME_MACHINE}-unknown-linux-gnu else - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + fi fi exit ;; avr32*:Linux:*:*) @@ -892,7 +901,7 @@ EOF echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo frv-unknown-linux-gnu exit ;; i*86:Linux:*:*) LIBC=gnu @@ -960,7 +969,7 @@ EOF echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -968,6 +977,9 @@ EOF sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-tilera-linux-gnu + exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; @@ -975,7 +987,7 @@ EOF echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -984,11 +996,11 @@ EOF echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1020,7 +1032,7 @@ EOF fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1048,13 +1060,13 @@ EOF exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp - exit ;; + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1089,8 +1101,8 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ @@ -1133,10 +1145,10 @@ EOF echo ns32k-sni-sysv fi exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says <[email protected]> - echo i586-unisys-sysv4 - exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <[email protected]> + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <[email protected]>. # How about differentiating between stratus architectures? -djm @@ -1162,11 +1174,11 @@ EOF exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv${UNAME_RELEASE} else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1231,6 +1243,9 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; @@ -1276,13 +1291,13 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1322,11 +1337,11 @@ main () #include <sys/param.h> printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 - "4" + "4" #else - "" + "" #endif - ); exit (0); + ); exit (0); #endif #endif diff --git a/config/config.sub b/config/config.sub index ae35431611..30fdca8121 100755 --- a/config/config.sub +++ b/config/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -# Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, +# 2011 Free Software Foundation, Inc. -timestamp='2010-03-22' +timestamp='2011-03-23' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -76,7 +76,7 @@ version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO @@ -124,8 +124,9 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os @@ -157,8 +158,8 @@ case $os in os= basic_machine=$1 ;; - -bluegene*) - os=-cnk + -bluegene*) + os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= @@ -174,10 +175,10 @@ case $os in os=-chorusos basic_machine=$1 ;; - -chorusrdb) - os=-chorusrdb + -chorusrdb) + os=-chorusrdb basic_machine=$1 - ;; + ;; -hiux*) os=-hiuxwe2 ;; @@ -282,11 +283,13 @@ case $basic_machine in | moxie \ | mt \ | msp430 \ + | nds32 | nds32le | nds32be \ | nios | nios2 \ | ns16k | ns32k \ + | open8 \ | or32 \ | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rx \ | score \ @@ -294,12 +297,12 @@ case $basic_machine in | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | spu \ + | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e \ | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; @@ -323,6 +326,18 @@ case $basic_machine in basic_machine=mt-unknown ;; + strongarm | thumb | xscale) + basic_machine=arm-unknown + ;; + + xscaleeb) + basic_machine=armeb-unknown + ;; + + xscaleel) + basic_machine=armel-unknown + ;; + # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. @@ -377,26 +392,28 @@ case $basic_machine in | mmix-* \ | mt-* \ | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ + | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ + | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile-* | tilegx-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) @@ -421,7 +438,7 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -504,7 +521,7 @@ case $basic_machine in basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -536,7 +553,7 @@ case $basic_machine in basic_machine=craynv-cray os=-unicosmp ;; - cr16) + cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; @@ -752,7 +769,7 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze) basic_machine=microblaze-xilinx ;; mingw32) @@ -859,6 +876,12 @@ case $basic_machine in np1) basic_machine=np1-gould ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -941,9 +964,10 @@ case $basic_machine in ;; power) basic_machine=power-ibm ;; - ppc) basic_machine=powerpc-unknown + ppc | ppcbe) basic_machine=powerpc-unknown ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc-* | ppcbe-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown @@ -1037,6 +1061,9 @@ case $basic_machine in basic_machine=i860-stratus os=-sysv4 ;; + strongarm-* | thumb-*) + basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; sun2) basic_machine=m68000-sun ;; @@ -1093,8 +1120,8 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - # This must be matched before tile*. - tilegx*) + # This must be matched before tile*. + tilegx*) basic_machine=tilegx-unknown os=-linux-gnu ;; @@ -1169,6 +1196,9 @@ case $basic_machine in xps | xps100) basic_machine=xps100-honeywell ;; + xscale-* | xscalee[bl]-*) + basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ;; ymp) basic_machine=ymp-cray os=-unicos @@ -1266,11 +1296,11 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + -auroraux) + os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` @@ -1307,7 +1337,8 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1354,7 +1385,7 @@ case $os in -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1403,7 +1434,7 @@ case $os in -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1448,8 +1479,8 @@ case $os in -dicos*) os=-dicos ;; - -nacl*) - ;; + -nacl*) + ;; -none) ;; *) @@ -1472,10 +1503,10 @@ else # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1487,8 +1518,8 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff ;; tic54x-*) os=-coff @@ -1524,7 +1555,7 @@ case $basic_machine in m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1551,7 +1582,7 @@ case $basic_machine in *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) diff --git a/config/docbook.m4 b/config/docbook.m4 index 0d8c1fad7e..636aefed4c 100644 --- a/config/docbook.m4 +++ b/config/docbook.m4 @@ -1,4 +1,4 @@ -# $PostgreSQL: pgsql/config/docbook.m4,v 1.11 2009/08/04 22:04:37 petere Exp $ +# config/docbook.m4 # PGAC_PROG_JADE # -------------- diff --git a/config/general.m4 b/config/general.m4 index 52f850ea25..95d65ceb09 100644 --- a/config/general.m4 +++ b/config/general.m4 @@ -1,4 +1,4 @@ -# $PostgreSQL: pgsql/config/general.m4,v 1.11 2009/07/02 18:55:40 petere Exp $ +# config/general.m4 # This file defines new macros to process configure command line # arguments, to replace the brain-dead AC_ARG_WITH and AC_ARG_ENABLE. @@ -90,7 +90,7 @@ dnl values. But we only want it to appear once in the help. We achieve dnl that by making the help string look the same, which is why we need to dnl save the default that was passed in previously. m4_define([_pgac_helpdefault], m4_ifdef([pgac_defined_$1_$2_bool], [m4_defn([pgac_defined_$1_$2_bool])], [$3]))dnl -PGAC_ARG([$1], [$2], [m4_if(_pgac_helpdefault, yes, -)], [$4], [$5], [$6], +PGAC_ARG([$1], [$2], [m4_if(_pgac_helpdefault, yes, -)], [$4], [$5], [$6], [AC_MSG_ERROR([no argument expected for --$1-$2 option])], [m4_case([$3], yes, [pgac_arg_to_variable([$1], [$2])=yes diff --git a/config/install-sh b/config/install-sh index bdcfd39c63..fdca6338c2 100755 --- a/config/install-sh +++ b/config/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -# $PostgreSQL: pgsql/config/install-sh,v 1.8 2009/08/26 22:24:42 petere Exp $ +# config/install-sh scriptversion=2009-08-26.20 diff --git a/config/missing b/config/missing index 5426c6d2ec..6df77e9473 100755 --- a/config/missing +++ b/config/missing @@ -1,6 +1,6 @@ #! /bin/sh -# $PostgreSQL: pgsql/config/missing,v 1.7 2010/02/22 21:16:50 momjian Exp $ +# config/missing # This is *not* the GNU `missing' script, although it is similar in # concept. You can call it from the makefiles to get consistent diff --git a/config/perl.m4 b/config/perl.m4 index 165034b0fd..d602a5bb1b 100644 --- a/config/perl.m4 +++ b/config/perl.m4 @@ -1,4 +1,4 @@ -# $PostgreSQL: pgsql/config/perl.m4,v 1.9 2010/02/23 18:35:06 tgl Exp $ +# config/perl.m4 # PGAC_PATH_PERL @@ -24,7 +24,7 @@ fi if test -z "$PERL"; then AC_MSG_WARN([ -*** Without Perl you will not be able to build PostgreSQL from CVS. +*** Without Perl you will not be able to build PostgreSQL from Git. *** You can obtain Perl from any CPAN mirror site. *** (If you are using the official distribution of PostgreSQL then you do not *** need to worry about this, because the Perl output is pre-generated.)]) diff --git a/config/prep_buildtree b/config/prep_buildtree index 57d7719673..5b72c392f6 100644 --- a/config/prep_buildtree +++ b/config/prep_buildtree @@ -22,7 +22,11 @@ sourcetree=`cd $1 && pwd` buildtree=`cd ${2:-'.'} && pwd` -for item in `find "$sourcetree" -type d \( -name CVS -prune -o -print \)`; do +# We must not auto-create the subdirectories holding built documentation. +# If we did, it would interfere with installation of prebuilt docs from +# the source tree, if a VPATH build is done from a distribution tarball. +# See bug #5595. +for item in `find "$sourcetree" -type d \( \( -name CVS -prune \) -o \( -name .git -prune \) -o -print \) | grep -v "$sourcetree/doc/src/sgml/\+"`; do subdir=`expr "$item" : "$sourcetree\(.*\)"` if test ! -d "$buildtree/$subdir"; then mkdir -p "$buildtree/$subdir" || exit 1 diff --git a/config/programs.m4 b/config/programs.m4 index 594729cbb1..565195d06d 100644 --- a/config/programs.m4 +++ b/config/programs.m4 @@ -1,4 +1,4 @@ -# $PostgreSQL: pgsql/config/programs.m4,v 1.28 2010/02/22 21:16:50 momjian Exp $ +# config/programs.m4 # PGAC_PATH_BISON @@ -27,7 +27,7 @@ fi if test -z "$BISON"; then AC_MSG_WARN([ -*** Without Bison you will not be able to build PostgreSQL from CVS nor +*** Without Bison you will not be able to build PostgreSQL from Git nor *** change any of the parser definition files. You can obtain Bison from *** a GNU mirror site. (If you are using the official distribution of *** PostgreSQL then you do not need to worry about this, because the Bison @@ -89,7 +89,7 @@ fi if test x"$pgac_cv_path_flex" = x"no"; then AC_MSG_WARN([ -*** Without Flex you will not be able to build PostgreSQL from CVS nor +*** Without Flex you will not be able to build PostgreSQL from Git nor *** change any of the scanner definition files. You can obtain Flex from *** a GNU mirror site. (If you are using the official distribution of *** PostgreSQL then you do not need to worry about this because the Flex @@ -117,7 +117,7 @@ AC_SUBST(FLEXFLAGS) AC_DEFUN([PGAC_CHECK_READLINE], [AC_REQUIRE([AC_CANONICAL_HOST]) -AC_CACHE_VAL([pgac_cv_check_readline], +AC_CACHE_CHECK([for library containing readline], [pgac_cv_check_readline], [pgac_cv_check_readline=no pgac_save_LIBS=$LIBS if test x"$with_libedit_preferred" != x"yes" @@ -125,7 +125,6 @@ then READLINE_ORDER="-lreadline -ledit" else READLINE_ORDER="-ledit -lreadline" fi for pgac_rllib in $READLINE_ORDER ; do - AC_MSG_CHECKING([for ${pgac_rllib}]) for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS" AC_TRY_LINK_FUNC([readline], [[ @@ -144,14 +143,11 @@ for pgac_rllib in $READLINE_ORDER ; do ]]) done if test "$pgac_cv_check_readline" != no ; then - AC_MSG_RESULT([yes ($pgac_cv_check_readline)]) break - else - AC_MSG_RESULT(no) fi done LIBS=$pgac_save_LIBS -])[]dnl AC_CACHE_VAL +])[]dnl AC_CACHE_CHECK if test "$pgac_cv_check_readline" != no ; then LIBS="$pgac_cv_check_readline $LIBS" @@ -167,8 +163,8 @@ fi # Readline versions < 2.1 don't have rl_completion_append_character AC_DEFUN([PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER], -[AC_MSG_CHECKING([for rl_completion_append_character]) -AC_TRY_LINK([#include <stdio.h> +[AC_CACHE_CHECK([for rl_completion_append_character], pgac_cv_var_rl_completion_append_character, +[AC_TRY_LINK([#include <stdio.h> #ifdef HAVE_READLINE_READLINE_H # include <readline/readline.h> #elif defined(HAVE_READLINE_H) @@ -176,10 +172,12 @@ AC_TRY_LINK([#include <stdio.h> #endif ], [rl_completion_append_character = 'x';], -[AC_MSG_RESULT(yes) +[pgac_cv_var_rl_completion_append_character=yes], +[pgac_cv_var_rl_completion_append_character=no])]) +if test x"$pgac_cv_var_rl_completion_append_character" = x"yes"; then AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER, 1, - [Define to 1 if you have the global variable 'rl_completion_append_character'.])], -[AC_MSG_RESULT(no)])])# PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER + [Define to 1 if you have the global variable 'rl_completion_append_character'.]) +fi])# PGAC_VAR_RL_COMPLETION_APPEND_CHARACTER diff --git a/config/python.m4 b/config/python.m4 index 7b6a14ed21..ec357c2e48 100644 --- a/config/python.m4 +++ b/config/python.m4 @@ -1,7 +1,7 @@ # # Autoconf macros for configuring the build of Python extension modules # -# $PostgreSQL: pgsql/config/python.m4,v 1.18 2010/03/17 22:02:44 petere Exp $ +# config/python.m4 # # PGAC_PATH_PYTHON diff --git a/config/tcl.m4 b/config/tcl.m4 index ae0d3b78be..e8860573a6 100644 --- a/config/tcl.m4 +++ b/config/tcl.m4 @@ -1,4 +1,4 @@ -# $PostgreSQL: pgsql/config/tcl.m4,v 1.8 2009/02/03 01:24:57 adunstan Exp $ +# config/tcl.m4 # Autoconf macros to check for Tcl related things @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for PostgreSQL 9.0beta3. +# Generated by GNU Autoconf 2.63 for PostgreSQL 9.1beta2. # # Report bugs to <[email protected]>. # @@ -9,7 +9,7 @@ # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # -# Copyright (c) 1996-2010, PostgreSQL Global Development Group +# Copyright (c) 1996-2011, PostgreSQL Global Development Group ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -599,8 +599,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='PostgreSQL' PACKAGE_TARNAME='postgresql' -PACKAGE_VERSION='9.0beta3' -PACKAGE_STRING='PostgreSQL 9.0beta3' +PACKAGE_VERSION='9.1beta2' +PACKAGE_STRING='PostgreSQL 9.1beta2' PACKAGE_BUGREPORT='[email protected]' ac_unique_file="src/backend/access/common/heaptuple.c" @@ -668,6 +668,7 @@ PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC acx_pthread_config +have_win32_dbghelp HAVE_IPV6 LIBOBJS OSSP_UUID_LIBS @@ -715,6 +716,7 @@ with_libxslt with_libxml XML2_CONFIG with_ossp_uuid +with_selinux with_openssl with_bonjour with_ldap @@ -837,6 +839,7 @@ with_pam with_ldap with_bonjour with_openssl +with_selinux with_readline with_libedit_preferred with_ossp_uuid @@ -1413,7 +1416,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures PostgreSQL 9.0beta3 to adapt to many kinds of systems. +\`configure' configures PostgreSQL 9.1beta2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1478,7 +1481,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of PostgreSQL 9.0beta3:";; + short | recursive ) echo "Configuration of PostgreSQL 9.1beta2:";; esac cat <<\_ACEOF @@ -1533,11 +1536,11 @@ Optional Packages: --with-ldap build with LDAP support --with-bonjour build with Bonjour support --with-openssl build with OpenSSL support + --with-selinux build with SELinux support --without-readline do not use GNU Readline nor BSD Libedit for editing --with-libedit-preferred prefer BSD Libedit over GNU Readline - --with-ossp-uuid use OSSP UUID library when building - contrib/uuid-ossp + --with-ossp-uuid build contrib/uuid-ossp, requires OSSP UUID library --with-libxml build with XML support --with-libxslt use XSLT support when building contrib/xml2 --with-system-tzdata=DIR @@ -1625,7 +1628,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -PostgreSQL configure 9.0beta3 +PostgreSQL configure 9.1beta2 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1633,7 +1636,7 @@ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -Copyright (c) 1996-2010, PostgreSQL Global Development Group +Copyright (c) 1996-2011, PostgreSQL Global Development Group _ACEOF exit fi @@ -1641,7 +1644,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by PostgreSQL $as_me 9.0beta3, which was +It was created by PostgreSQL $as_me 9.1beta2, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -2191,6 +2194,7 @@ case $host_os in bsdi*) template=bsdi ;; cygwin*) template=cygwin ;; darwin*) template=darwin ;; +dragonfly*) template=netbsd ;; dgux*) template=dgux ;; freebsd*) template=freebsd ;; hpux*) template=hpux ;; @@ -4000,10 +4004,15 @@ fi if test "$GCC" = yes -a "$ICC" = no; then CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith" # These work in some but not all gcc versions - { $as_echo "$as_me:$LINENO: checking if $CC supports -Wdeclaration-after-statement" >&5 -$as_echo_n "checking if $CC supports -Wdeclaration-after-statement... " >&6; } -pgac_save_CFLAGS=$CFLAGS + { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wdeclaration-after-statement" >&5 +$as_echo_n "checking whether $CC supports -Wdeclaration-after-statement... " >&6; } +if test "${pgac_cv_prog_cc_cflags__Wdeclaration_after_statement+set}" = set; then + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS CFLAGS="$pgac_save_CFLAGS -Wdeclaration-after-statement" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4037,23 +4046,33 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + pgac_cv_prog_cc_cflags__Wdeclaration_after_statement=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - CFLAGS="$pgac_save_CFLAGS" - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + pgac_cv_prog_cc_cflags__Wdeclaration_after_statement=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" >&5 +$as_echo "$pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" >&6; } +if test x"$pgac_cv_prog_cc_cflags__Wdeclaration_after_statement" = x"yes"; then + CFLAGS="$CFLAGS -Wdeclaration-after-statement" +fi - { $as_echo "$as_me:$LINENO: checking if $CC supports -Wendif-labels" >&5 -$as_echo_n "checking if $CC supports -Wendif-labels... " >&6; } -pgac_save_CFLAGS=$CFLAGS + { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wendif-labels" >&5 +$as_echo_n "checking whether $CC supports -Wendif-labels... " >&6; } +if test "${pgac_cv_prog_cc_cflags__Wendif_labels+set}" = set; then + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS CFLAGS="$pgac_save_CFLAGS -Wendif-labels" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4087,24 +4106,95 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + pgac_cv_prog_cc_cflags__Wendif_labels=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - CFLAGS="$pgac_save_CFLAGS" - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + pgac_cv_prog_cc_cflags__Wendif_labels=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__Wendif_labels" >&5 +$as_echo "$pgac_cv_prog_cc_cflags__Wendif_labels" >&6; } +if test x"$pgac_cv_prog_cc_cflags__Wendif_labels" = x"yes"; then + CFLAGS="$CFLAGS -Wendif-labels" +fi + + # This was included in -Wall/-Wformat in older GCC versions + { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wformat-security" >&5 +$as_echo_n "checking whether $CC supports -Wformat-security... " >&6; } +if test "${pgac_cv_prog_cc_cflags__Wformat_security+set}" = set; then + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +CFLAGS="$pgac_save_CFLAGS -Wformat-security" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + pgac_cv_prog_cc_cflags__Wformat_security=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + pgac_cv_prog_cc_cflags__Wformat_security=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__Wformat_security" >&5 +$as_echo "$pgac_cv_prog_cc_cflags__Wformat_security" >&6; } +if test x"$pgac_cv_prog_cc_cflags__Wformat_security" = x"yes"; then + CFLAGS="$CFLAGS -Wformat-security" +fi # Disable strict-aliasing rules; needed for gcc 3.3+ - { $as_echo "$as_me:$LINENO: checking if $CC supports -fno-strict-aliasing" >&5 -$as_echo_n "checking if $CC supports -fno-strict-aliasing... " >&6; } -pgac_save_CFLAGS=$CFLAGS + { $as_echo "$as_me:$LINENO: checking whether $CC supports -fno-strict-aliasing" >&5 +$as_echo_n "checking whether $CC supports -fno-strict-aliasing... " >&6; } +if test "${pgac_cv_prog_cc_cflags__fno_strict_aliasing+set}" = set; then + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS CFLAGS="$pgac_save_CFLAGS -fno-strict-aliasing" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4138,24 +4228,34 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + pgac_cv_prog_cc_cflags__fno_strict_aliasing=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - CFLAGS="$pgac_save_CFLAGS" - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + pgac_cv_prog_cc_cflags__fno_strict_aliasing=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&5 +$as_echo "$pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&6; } +if test x"$pgac_cv_prog_cc_cflags__fno_strict_aliasing" = x"yes"; then + CFLAGS="$CFLAGS -fno-strict-aliasing" +fi # Disable optimizations that assume no overflow; needed for gcc 4.3+ - { $as_echo "$as_me:$LINENO: checking if $CC supports -fwrapv" >&5 -$as_echo_n "checking if $CC supports -fwrapv... " >&6; } -pgac_save_CFLAGS=$CFLAGS + { $as_echo "$as_me:$LINENO: checking whether $CC supports -fwrapv" >&5 +$as_echo_n "checking whether $CC supports -fwrapv... " >&6; } +if test "${pgac_cv_prog_cc_cflags__fwrapv+set}" = set; then + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS CFLAGS="$pgac_save_CFLAGS -fwrapv" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4189,26 +4289,36 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + pgac_cv_prog_cc_cflags__fwrapv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - CFLAGS="$pgac_save_CFLAGS" - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + pgac_cv_prog_cc_cflags__fwrapv=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__fwrapv" >&5 +$as_echo "$pgac_cv_prog_cc_cflags__fwrapv" >&6; } +if test x"$pgac_cv_prog_cc_cflags__fwrapv" = x"yes"; then + CFLAGS="$CFLAGS -fwrapv" +fi elif test "$ICC" = yes; then # Intel's compiler has a bug/misoptimization in checking for # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS. - { $as_echo "$as_me:$LINENO: checking if $CC supports -mp1" >&5 -$as_echo_n "checking if $CC supports -mp1... " >&6; } -pgac_save_CFLAGS=$CFLAGS + { $as_echo "$as_me:$LINENO: checking whether $CC supports -mp1" >&5 +$as_echo_n "checking whether $CC supports -mp1... " >&6; } +if test "${pgac_cv_prog_cc_cflags__mp1+set}" = set; then + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS CFLAGS="$pgac_save_CFLAGS -mp1" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4242,24 +4352,34 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + pgac_cv_prog_cc_cflags__mp1=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - CFLAGS="$pgac_save_CFLAGS" - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + pgac_cv_prog_cc_cflags__mp1=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__mp1" >&5 +$as_echo "$pgac_cv_prog_cc_cflags__mp1" >&6; } +if test x"$pgac_cv_prog_cc_cflags__mp1" = x"yes"; then + CFLAGS="$CFLAGS -mp1" +fi # Make sure strict aliasing is off (though this is said to be the default) - { $as_echo "$as_me:$LINENO: checking if $CC supports -fno-strict-aliasing" >&5 -$as_echo_n "checking if $CC supports -fno-strict-aliasing... " >&6; } -pgac_save_CFLAGS=$CFLAGS + { $as_echo "$as_me:$LINENO: checking whether $CC supports -fno-strict-aliasing" >&5 +$as_echo_n "checking whether $CC supports -fno-strict-aliasing... " >&6; } +if test "${pgac_cv_prog_cc_cflags__fno_strict_aliasing+set}" = set; then + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS CFLAGS="$pgac_save_CFLAGS -fno-strict-aliasing" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4293,25 +4413,35 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + pgac_cv_prog_cc_cflags__fno_strict_aliasing=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - CFLAGS="$pgac_save_CFLAGS" - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + pgac_cv_prog_cc_cflags__fno_strict_aliasing=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&5 +$as_echo "$pgac_cv_prog_cc_cflags__fno_strict_aliasing" >&6; } +if test x"$pgac_cv_prog_cc_cflags__fno_strict_aliasing" = x"yes"; then + CFLAGS="$CFLAGS -fno-strict-aliasing" +fi elif test "$PORTNAME" = "aix"; then # AIX's xlc has to have strict aliasing turned off too - { $as_echo "$as_me:$LINENO: checking if $CC supports -qnoansialias" >&5 -$as_echo_n "checking if $CC supports -qnoansialias... " >&6; } -pgac_save_CFLAGS=$CFLAGS + { $as_echo "$as_me:$LINENO: checking whether $CC supports -qnoansialias" >&5 +$as_echo_n "checking whether $CC supports -qnoansialias... " >&6; } +if test "${pgac_cv_prog_cc_cflags__qnoansialias+set}" = set; then + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS CFLAGS="$pgac_save_CFLAGS -qnoansialias" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -4345,18 +4475,86 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + pgac_cv_prog_cc_cflags__qnoansialias=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - CFLAGS="$pgac_save_CFLAGS" - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + pgac_cv_prog_cc_cflags__qnoansialias=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags__qnoansialias" >&5 +$as_echo "$pgac_cv_prog_cc_cflags__qnoansialias" >&6; } +if test x"$pgac_cv_prog_cc_cflags__qnoansialias" = x"yes"; then + CFLAGS="$CFLAGS -qnoansialias" +fi + +elif test "$PORTNAME" = "hpux"; then + # On some versions of HP-UX, libm functions do not set errno by default. + # Fix that by using +Olibmerrno if the compiler recognizes it. + { $as_echo "$as_me:$LINENO: checking whether $CC supports +Olibmerrno" >&5 +$as_echo_n "checking whether $CC supports +Olibmerrno... " >&6; } +if test "${pgac_cv_prog_cc_cflags_pOlibmerrno+set}" = set; then + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +CFLAGS="$pgac_save_CFLAGS +Olibmerrno" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + pgac_cv_prog_cc_cflags_pOlibmerrno=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + pgac_cv_prog_cc_cflags_pOlibmerrno=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_cflags_pOlibmerrno" >&5 +$as_echo "$pgac_cv_prog_cc_cflags_pOlibmerrno" >&6; } +if test x"$pgac_cv_prog_cc_cflags_pOlibmerrno" = x"yes"; then + CFLAGS="$CFLAGS +Olibmerrno" +fi fi @@ -5315,6 +5513,40 @@ fi $as_echo "$with_openssl" >&6; } +# +# SELinux +# +{ $as_echo "$as_me:$LINENO: checking whether to build with SELinux support" >&5 +$as_echo_n "checking whether to build with SELinux support... " >&6; } + + + +# Check whether --with-selinux was given. +if test "${with_selinux+set}" = set; then + withval=$with_selinux; + case $withval in + yes) + : + ;; + no) + : + ;; + *) + { { $as_echo "$as_me:$LINENO: error: no argument expected for --with-selinux option" >&5 +$as_echo "$as_me: error: no argument expected for --with-selinux option" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + +else + with_selinux=no + +fi + + + +{ $as_echo "$as_me:$LINENO: result: $with_selinux" >&5 +$as_echo "$with_selinux" >&6; } # # Readline @@ -6739,13 +6971,13 @@ fi if test -z "$BISON"; then { $as_echo "$as_me:$LINENO: WARNING: -*** Without Bison you will not be able to build PostgreSQL from CVS nor +*** Without Bison you will not be able to build PostgreSQL from Git nor *** change any of the parser definition files. You can obtain Bison from *** a GNU mirror site. (If you are using the official distribution of *** PostgreSQL then you do not need to worry about this, because the Bison *** output is pre-generated.)" >&5 $as_echo "$as_me: WARNING: -*** Without Bison you will not be able to build PostgreSQL from CVS nor +*** Without Bison you will not be able to build PostgreSQL from Git nor *** change any of the parser definition files. You can obtain Bison from *** a GNU mirror site. (If you are using the official distribution of *** PostgreSQL then you do not need to worry about this, because the Bison @@ -6803,13 +7035,13 @@ fi $as_echo "$pgac_cv_path_flex" >&6; } if test x"$pgac_cv_path_flex" = x"no"; then { $as_echo "$as_me:$LINENO: WARNING: -*** Without Flex you will not be able to build PostgreSQL from CVS nor +*** Without Flex you will not be able to build PostgreSQL from Git nor *** change any of the scanner definition files. You can obtain Flex from *** a GNU mirror site. (If you are using the official distribution of *** PostgreSQL then you do not need to worry about this because the Flex *** output is pre-generated.)" >&5 $as_echo "$as_me: WARNING: -*** Without Flex you will not be able to build PostgreSQL from CVS nor +*** Without Flex you will not be able to build PostgreSQL from Git nor *** change any of the scanner definition files. You can obtain Flex from *** a GNU mirror site. (If you are using the official distribution of *** PostgreSQL then you do not need to worry about this because the Flex @@ -6890,12 +7122,12 @@ fi if test -z "$PERL"; then { $as_echo "$as_me:$LINENO: WARNING: -*** Without Perl you will not be able to build PostgreSQL from CVS. +*** Without Perl you will not be able to build PostgreSQL from Git. *** You can obtain Perl from any CPAN mirror site. *** (If you are using the official distribution of PostgreSQL then you do not *** need to worry about this, because the Perl output is pre-generated.)" >&5 $as_echo "$as_me: WARNING: -*** Without Perl you will not be able to build PostgreSQL from CVS. +*** Without Perl you will not be able to build PostgreSQL from Git. *** You can obtain Perl from any CPAN mirror site. *** (If you are using the official distribution of PostgreSQL then you do not *** need to worry about this, because the Perl output is pre-generated.)" >&2;} @@ -8082,6 +8314,8 @@ fi if test "$with_readline" = yes; then +{ $as_echo "$as_me:$LINENO: checking for library containing readline" >&5 +$as_echo_n "checking for library containing readline... " >&6; } if test "${pgac_cv_check_readline+set}" = set; then $as_echo_n "(cached) " >&6 else @@ -8092,8 +8326,6 @@ then READLINE_ORDER="-lreadline -ledit" else READLINE_ORDER="-ledit -lreadline" fi for pgac_rllib in $READLINE_ORDER ; do - { $as_echo "$as_me:$LINENO: checking for ${pgac_rllib}" >&5 -$as_echo_n "checking for ${pgac_rllib}... " >&6; } for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS" cat >conftest.$ac_ext <<_ACEOF @@ -8165,18 +8397,14 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext done if test "$pgac_cv_check_readline" != no ; then - { $as_echo "$as_me:$LINENO: result: yes ($pgac_cv_check_readline)" >&5 -$as_echo "yes ($pgac_cv_check_readline)" >&6; } break - else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } fi done LIBS=$pgac_save_LIBS fi - +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_check_readline" >&5 +$as_echo "$pgac_cv_check_readline" >&6; } if test "$pgac_cv_check_readline" != no ; then LIBS="$pgac_cv_check_readline $LIBS" @@ -9246,6 +9474,89 @@ fi fi +# for contrib/sepgsql +if test "$with_selinux" = yes; then + +{ $as_echo "$as_me:$LINENO: checking for selinux_sepgsql_context_path in -lselinux" >&5 +$as_echo_n "checking for selinux_sepgsql_context_path in -lselinux... " >&6; } +if test "${ac_cv_lib_selinux_selinux_sepgsql_context_path+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lselinux $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char selinux_sepgsql_context_path (); +int +main () +{ +return selinux_sepgsql_context_path (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_selinux_selinux_sepgsql_context_path=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_selinux_selinux_sepgsql_context_path=no +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_selinux_selinux_sepgsql_context_path" >&5 +$as_echo "$ac_cv_lib_selinux_selinux_sepgsql_context_path" >&6; } +if test "x$ac_cv_lib_selinux_selinux_sepgsql_context_path" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSELINUX 1 +_ACEOF + + LIBS="-lselinux $LIBS" + +else + { { $as_echo "$as_me:$LINENO: error: library 'libselinux', version 2.0.93 or newer, is required for SELinux support" >&5 +$as_echo "$as_me: error: library 'libselinux', version 2.0.93 or newer, is required for SELinux support" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + # for contrib/uuid-ossp if test "$with_ossp_uuid" = yes ; then { $as_echo "$as_me:$LINENO: checking for uuid_export in -lossp-uuid" >&5 @@ -9680,7 +9991,8 @@ done -for ac_header in crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h poll.h pwd.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h kernel/OS.h kernel/image.h SupportDefs.h + +for ac_header in crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h poll.h pwd.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.h sys/ucred.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h kernel/OS.h kernel/image.h SupportDefs.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then @@ -16607,66 +16919,23 @@ _ACEOF fi -{ $as_echo "$as_me:$LINENO: checking for struct cmsgcred" >&5 -$as_echo_n "checking for struct cmsgcred... " >&6; } -if test "${ac_cv_type_struct_cmsgcred+set}" = set; then +{ $as_echo "$as_me:$LINENO: checking for locale_t" >&5 +$as_echo_n "checking for locale_t... " >&6; } +if test "${pgac_cv_type_locale_t+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_struct_cmsgcred=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/ucred.h> - -int -main () -{ -if (sizeof (struct cmsgcred)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/ucred.h> - +#include <locale.h> +locale_t x; int main () { -if (sizeof ((struct cmsgcred))) - return 0; + ; return 0; } @@ -16689,94 +16958,23 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : + pgac_cv_type_locale_t=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_struct_cmsgcred=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_cmsgcred" >&5 -$as_echo "$ac_cv_type_struct_cmsgcred" >&6; } -if test "x$ac_cv_type_struct_cmsgcred" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_CMSGCRED 1 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking for struct fcred" >&5 -$as_echo_n "checking for struct fcred... " >&6; } -if test "${ac_cv_type_struct_fcred+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_struct_fcred=no -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/ucred.h> - +#include <xlocale.h> +locale_t x; int main () { -if (sizeof (struct fcred)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/ucred.h> -int -main () -{ -if (sizeof ((struct fcred))) - return 0; ; return 0; } @@ -16799,55 +16997,57 @@ $as_echo "$ac_try_echo") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : + pgac_cv_type_locale_t='yes (in xlocale.h)' else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_struct_fcred=yes + pgac_cv_type_locale_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_fcred" >&5 -$as_echo "$ac_cv_type_struct_fcred" >&6; } -if test "x$ac_cv_type_struct_fcred" = x""yes; then +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_type_locale_t" >&5 +$as_echo "$pgac_cv_type_locale_t" >&6; } +if test "$pgac_cv_type_locale_t" != no; then -cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_FCRED 1 +cat >>confdefs.h <<\_ACEOF +#define HAVE_LOCALE_T 1 _ACEOF +fi +if test "$pgac_cv_type_locale_t" = 'yes (in xlocale.h)'; then + +cat >>confdefs.h <<\_ACEOF +#define LOCALE_T_IN_XLOCALE 1 +_ACEOF fi -{ $as_echo "$as_me:$LINENO: checking for struct sockcred" >&5 -$as_echo_n "checking for struct sockcred... " >&6; } -if test "${ac_cv_type_struct_sockcred+set}" = set; then + +{ $as_echo "$as_me:$LINENO: checking for struct cmsgcred" >&5 +$as_echo_n "checking for struct cmsgcred... " >&6; } +if test "${ac_cv_type_struct_cmsgcred+set}" = set; then $as_echo_n "(cached) " >&6 else - ac_cv_type_struct_sockcred=no + ac_cv_type_struct_cmsgcred=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <sys/param.h> -#include <sys/types.h> #include <sys/socket.h> +#ifdef HAVE_SYS_UCRED_H #include <sys/ucred.h> +#endif int main () { -if (sizeof (struct sockcred)) +if (sizeof (struct cmsgcred)) return 0; ; return 0; @@ -16877,15 +17077,15 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <sys/param.h> -#include <sys/types.h> #include <sys/socket.h> +#ifdef HAVE_SYS_UCRED_H #include <sys/ucred.h> +#endif int main () { -if (sizeof ((struct sockcred))) +if (sizeof ((struct cmsgcred))) return 0; ; return 0; @@ -16914,7 +17114,7 @@ else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_struct_sockcred=yes + ac_cv_type_struct_cmsgcred=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext @@ -16927,12 +17127,12 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockcred" >&5 -$as_echo "$ac_cv_type_struct_sockcred" >&6; } -if test "x$ac_cv_type_struct_sockcred" = x""yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_struct_cmsgcred" >&5 +$as_echo "$ac_cv_type_struct_cmsgcred" >&6; } +if test "x$ac_cv_type_struct_cmsgcred" = x""yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_SOCKCRED 1 +#define HAVE_STRUCT_CMSGCRED 1 _ACEOF @@ -18473,8 +18673,8 @@ else if test "${ac_cv_func_accept_arg3+set}" = set; then $as_echo_n "(cached) " >&6 else - for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL'; do - for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do + for ac_cv_func_accept_return in 'int' 'unsigned int PASCAL' 'SOCKET'; do + for ac_cv_func_accept_arg1 in 'int' 'unsigned int' 'SOCKET'; do for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void'; do cat >conftest.$ac_ext <<_ACEOF @@ -18653,7 +18853,7 @@ fi -for ac_func in cbrt dlopen fcvt fdatasync getifaddrs getpeereid getpeerucred getrlimit memmove poll pstat readlink scandir setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs +for ac_func in cbrt dlopen fcvt fdatasync getifaddrs getpeerucred getrlimit memmove poll pstat readlink scandir setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs wcstombs_l do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -20224,7 +20424,8 @@ LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'` -for ac_func in crypt erand48 getopt getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul + +for ac_func in crypt erand48 getopt getpeereid getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -20714,6 +20915,23 @@ esac fi +# mingw has adopted a GNU-centric interpretation of optind/optreset, +# so always use our version on Windows. +if test "$PORTNAME" = "win32"; then + case " $LIBOBJS " in + *" getopt.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getopt.$ac_objext" + ;; +esac + + case " $LIBOBJS " in + *" getopt_long.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getopt_long.$ac_objext" + ;; +esac + +fi + # Cygwin's erand48() is broken (always returns zero) in some releases, # so force use of ours. if test "$PORTNAME" = "cygwin"; then @@ -20836,25 +21054,25 @@ fi done -case " $LIBOBJS " in + case " $LIBOBJS " in *" kill.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS kill.$ac_objext" ;; esac -case " $LIBOBJS " in + case " $LIBOBJS " in *" open.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS open.$ac_objext" ;; esac -case " $LIBOBJS " in + case " $LIBOBJS " in *" win32env.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS win32env.$ac_objext" ;; esac -case " $LIBOBJS " in + case " $LIBOBJS " in *" win32error.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS win32error.$ac_objext" ;; @@ -20865,12 +21083,137 @@ cat >>confdefs.h <<\_ACEOF #define HAVE_SYMLINK 1 _ACEOF + { $as_echo "$as_me:$LINENO: checking for MINIDUMP_TYPE" >&5 +$as_echo_n "checking for MINIDUMP_TYPE... " >&6; } +if test "${ac_cv_type_MINIDUMP_TYPE+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_type_MINIDUMP_TYPE=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <string.h> +#include <dbghelp.h> + +int +main () +{ +if (sizeof (MINIDUMP_TYPE)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <string.h> +#include <dbghelp.h> + +int +main () +{ +if (sizeof ((MINIDUMP_TYPE))) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_MINIDUMP_TYPE=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_MINIDUMP_TYPE" >&5 +$as_echo "$ac_cv_type_MINIDUMP_TYPE" >&6; } +if test "x$ac_cv_type_MINIDUMP_TYPE" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_MINIDUMP_TYPE 1 +_ACEOF + +pgac_minidump_type=yes +else + pgac_minidump_type=no +fi + +fi +if test x"$pgac_minidump_type" = x"yes" ; then + have_win32_dbghelp=yes + +else + have_win32_dbghelp=no + fi if test "$with_readline" = yes; then { $as_echo "$as_me:$LINENO: checking for rl_completion_append_character" >&5 $as_echo_n "checking for rl_completion_append_character... " >&6; } -cat >conftest.$ac_ext <<_ACEOF +if test "${pgac_cv_var_rl_completion_append_character+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -20912,24 +21255,27 @@ $as_echo "$ac_try_echo") >&5 test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } - -cat >>confdefs.h <<\_ACEOF -#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1 -_ACEOF - + pgac_cv_var_rl_completion_append_character=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + pgac_cv_var_rl_completion_append_character=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_var_rl_completion_append_character" >&5 +$as_echo "$pgac_cv_var_rl_completion_append_character" >&6; } +if test x"$pgac_cv_var_rl_completion_append_character" = x"yes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1 +_ACEOF + +fi for ac_func in rl_completion_matches rl_filename_completion_function @@ -21139,7 +21485,10 @@ fi { $as_echo "$as_me:$LINENO: checking for sigsetjmp" >&5 $as_echo_n "checking for sigsetjmp... " >&6; } -cat >conftest.$ac_ext <<_ACEOF +if test "${pgac_cv_func_sigsetjmp+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -21175,24 +21524,27 @@ $as_echo "$ac_try_echo") >&5 test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SIGSETJMP 1 -_ACEOF - -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + pgac_cv_func_sigsetjmp=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + pgac_cv_func_sigsetjmp=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_func_sigsetjmp" >&5 +$as_echo "$pgac_cv_func_sigsetjmp" >&6; } +if test x"$pgac_cv_func_sigsetjmp" = x"yes"; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SIGSETJMP 1 +_ACEOF + +fi { $as_echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5 $as_echo_n "checking whether sys_siglist is declared... " >&6; } @@ -22332,7 +22684,8 @@ main (int argc, char **argv) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext - if test "`(eval $ac_link 2>&1 1>&5)`" = ""; then + # Check both linking and compiling, because they might tolerate different options. + if test "`(eval $ac_link 2>&1 1>&5)`" = "" && test "`(eval $ac_compile 2>&1 1>&5)`" = ""; then # we continue with more flags because Linux needs -lpthread # for libpq builds on PostgreSQL. The test above only # tests for building binaries, not shared libraries. @@ -27774,6 +28127,13 @@ _ACEOF SHMEM_IMPLEMENTATION="src/backend/port/win32_shmem.c" fi +# Select latch implementation type. +if test "$PORTNAME" != "win32"; then + LATCH_IMPLEMENTATION="src/backend/port/unix_latch.c" +else + LATCH_IMPLEMENTATION="src/backend/port/win32_latch.c" +fi + # If not set in template file, set bytes to use libc memset() if test x"$MEMSET_LOOP_LIMIT" = x"" ; then MEMSET_LOOP_LIMIT=1024 @@ -28395,6 +28755,154 @@ fi CPPFLAGS=$ac_save_CPPFLAGS fi +# check for <Python.h> +if test "$with_python" = yes; then + ac_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$python_includespec $CPPFLAGS" + if test "${ac_cv_header_Python_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for Python.h" >&5 +$as_echo_n "checking for Python.h... " >&6; } +if test "${ac_cv_header_Python_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_Python_h" >&5 +$as_echo "$ac_cv_header_Python_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking Python.h usability" >&5 +$as_echo_n "checking Python.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <Python.h> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking Python.h presence" >&5 +$as_echo_n "checking Python.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <Python.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: Python.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: Python.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Python.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: Python.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: Python.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: Python.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Python.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: Python.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Python.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: Python.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Python.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: Python.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Python.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: Python.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Python.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: Python.h: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ---------------------------------------- ## +## Report this to [email protected] ## +## ---------------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for Python.h" >&5 +$as_echo_n "checking for Python.h... " >&6; } +if test "${ac_cv_header_Python_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_Python_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_Python_h" >&5 +$as_echo "$ac_cv_header_Python_h" >&6; } + +fi +if test "x$ac_cv_header_Python_h" = x""yes; then + : +else + { { $as_echo "$as_me:$LINENO: error: header file <Python.h> is required for Python" >&5 +$as_echo "$as_me: error: header file <Python.h> is required for Python" >&2;} + { (exit 1); exit 1; }; } +fi + + + CPPFLAGS=$ac_save_CPPFLAGS +fi + # # Check for DocBook and tools # @@ -28841,14 +29349,15 @@ else fi if test "$PORTNAME" = "darwin"; then - { $as_echo "$as_me:$LINENO: checking if $CC supports -Wl,-dead_strip_dylibs" >&5 -$as_echo_n "checking if $CC supports -Wl,-dead_strip_dylibs... " >&6; } -pgac_save_LDFLAGS=$LDFLAGS + { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wl,-dead_strip_dylibs" >&5 +$as_echo_n "checking whether $CC supports -Wl,-dead_strip_dylibs... " >&6; } +if test "${pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs+set}" = set; then + $as_echo_n "(cached) " >&6 +else + pgac_save_LDFLAGS=$LDFLAGS LDFLAGS="$pgac_save_LDFLAGS -Wl,-dead_strip_dylibs" if test "$cross_compiling" = yes; then - LDFLAGS="$pgac_save_LDFLAGS" - { $as_echo "$as_me:$LINENO: result: assuming no" >&5 -$as_echo "assuming no" >&6; } + pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs="assuming no" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -28887,33 +29396,38 @@ $as_echo "$ac_try_echo") >&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -LDFLAGS="$pgac_save_LDFLAGS" - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } +pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +LDFLAGS="$pgac_save_LDFLAGS" +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&5 +$as_echo "$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" >&6; } +if test x"$pgac_cv_prog_cc_ldflags__Wl__dead_strip_dylibs" = x"yes"; then + LDFLAGS="$LDFLAGS -Wl,-dead_strip_dylibs" +fi elif test "$PORTNAME" = "openbsd"; then - { $as_echo "$as_me:$LINENO: checking if $CC supports -Wl,-Bdynamic" >&5 -$as_echo_n "checking if $CC supports -Wl,-Bdynamic... " >&6; } -pgac_save_LDFLAGS=$LDFLAGS + { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wl,-Bdynamic" >&5 +$as_echo_n "checking whether $CC supports -Wl,-Bdynamic... " >&6; } +if test "${pgac_cv_prog_cc_ldflags__Wl__Bdynamic+set}" = set; then + $as_echo_n "(cached) " >&6 +else + pgac_save_LDFLAGS=$LDFLAGS LDFLAGS="$pgac_save_LDFLAGS -Wl,-Bdynamic" if test "$cross_compiling" = yes; then - LDFLAGS="$pgac_save_LDFLAGS" - { $as_echo "$as_me:$LINENO: result: assuming no" >&5 -$as_echo "assuming no" >&6; } + pgac_cv_prog_cc_ldflags__Wl__Bdynamic="assuming no" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -28952,33 +29466,38 @@ $as_echo "$ac_try_echo") >&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + pgac_cv_prog_cc_ldflags__Wl__Bdynamic=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -LDFLAGS="$pgac_save_LDFLAGS" - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } +pgac_cv_prog_cc_ldflags__Wl__Bdynamic=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +LDFLAGS="$pgac_save_LDFLAGS" +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&5 +$as_echo "$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" >&6; } +if test x"$pgac_cv_prog_cc_ldflags__Wl__Bdynamic" = x"yes"; then + LDFLAGS="$LDFLAGS -Wl,-Bdynamic" +fi else - { $as_echo "$as_me:$LINENO: checking if $CC supports -Wl,--as-needed" >&5 -$as_echo_n "checking if $CC supports -Wl,--as-needed... " >&6; } -pgac_save_LDFLAGS=$LDFLAGS + { $as_echo "$as_me:$LINENO: checking whether $CC supports -Wl,--as-needed" >&5 +$as_echo_n "checking whether $CC supports -Wl,--as-needed... " >&6; } +if test "${pgac_cv_prog_cc_ldflags__Wl___as_needed+set}" = set; then + $as_echo_n "(cached) " >&6 +else + pgac_save_LDFLAGS=$LDFLAGS LDFLAGS="$pgac_save_LDFLAGS -Wl,--as-needed" if test "$cross_compiling" = yes; then - LDFLAGS="$pgac_save_LDFLAGS" - { $as_echo "$as_me:$LINENO: result: assuming no" >&5 -$as_echo "assuming no" >&6; } + pgac_cv_prog_cc_ldflags__Wl___as_needed="assuming no" else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -29017,23 +29536,27 @@ $as_echo "$ac_try_echo") >&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + pgac_cv_prog_cc_ldflags__Wl___as_needed=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -LDFLAGS="$pgac_save_LDFLAGS" - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } +pgac_cv_prog_cc_ldflags__Wl___as_needed=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi +LDFLAGS="$pgac_save_LDFLAGS" +fi +{ $as_echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_ldflags__Wl___as_needed" >&5 +$as_echo "$pgac_cv_prog_cc_ldflags__Wl___as_needed" >&6; } +if test x"$pgac_cv_prog_cc_ldflags__Wl___as_needed" = x"yes"; then + LDFLAGS="$LDFLAGS -Wl,--as-needed" +fi fi @@ -29049,7 +29572,8 @@ $as_echo "$as_me: using LDFLAGS=$LDFLAGS" >&6;} # Create compiler version string if test x"$GCC" = x"yes" ; then - cc_string="GCC `${CC} --version | sed q`" + cc_string=`${CC} --version | sed q` + case $cc_string in [A-Za-z]*) ;; *) cc_string="GCC $cc_string";; esac elif test x"$SUN_STUDIO_CC" = x"yes" ; then cc_string=`${CC} -V 2>&1 | sed q` else @@ -29099,7 +29623,7 @@ fi ac_config_files="$ac_config_files GNUmakefile src/Makefile.global" -ac_config_links="$ac_config_links src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} src/include/dynloader.h:src/backend/port/dynloader/${template}.h src/include/pg_config_os.h:src/include/port/${template}.h src/Makefile.port:src/makefiles/Makefile.${template}" +ac_config_links="$ac_config_links src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} src/backend/port/pg_latch.c:${LATCH_IMPLEMENTATION} src/include/dynloader.h:src/backend/port/dynloader/${template}.h src/include/pg_config_os.h:src/include/port/${template}.h src/Makefile.port:src/makefiles/Makefile.${template}" if test "$PORTNAME" = "win32"; then @@ -29533,7 +30057,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by PostgreSQL $as_me 9.0beta3, which was +This file was extended by PostgreSQL $as_me 9.1beta2, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -29600,7 +30124,7 @@ Report bugs to <[email protected]>." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ -PostgreSQL config.status 9.0beta3 +PostgreSQL config.status 9.1beta2 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -29723,6 +30247,7 @@ do "src/backend/port/dynloader.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c" ;; "src/backend/port/pg_sema.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION}" ;; "src/backend/port/pg_shmem.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION}" ;; + "src/backend/port/pg_latch.c") CONFIG_LINKS="$CONFIG_LINKS src/backend/port/pg_latch.c:${LATCH_IMPLEMENTATION}" ;; "src/include/dynloader.h") CONFIG_LINKS="$CONFIG_LINKS src/include/dynloader.h:src/backend/port/dynloader/${template}.h" ;; "src/include/pg_config_os.h") CONFIG_LINKS="$CONFIG_LINKS src/include/pg_config_os.h:src/include/port/${template}.h" ;; "src/Makefile.port") CONFIG_LINKS="$CONFIG_LINKS src/Makefile.port:src/makefiles/Makefile.${template}" ;; diff --git a/configure.in b/configure.in index f5270c26b1..e6232afeaa 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $PostgreSQL: pgsql/configure.in,v 1.632 2010/07/09 02:43:12 scrappy Exp $ +dnl configure.in dnl dnl Developers, please strive to achieve this order: dnl @@ -17,13 +17,13 @@ dnl Read the Autoconf manual for details. dnl m4_pattern_forbid(^PGAC_)dnl to catch undefined macros -AC_INIT([PostgreSQL], [9.0beta3], [[email protected]]) +AC_INIT([PostgreSQL], [9.1beta2], [[email protected]]) m4_if(m4_defn([m4_PACKAGE_VERSION]), [2.63], [], [m4_fatal([Autoconf version 2.63 is required. Untested combinations of 'autoconf' and PostgreSQL versions are not recommended. You can remove the check from 'configure.in' but it is then your responsibility whether the result works or not.])]) -AC_COPYRIGHT([Copyright (c) 1996-2010, PostgreSQL Global Development Group]) +AC_COPYRIGHT([Copyright (c) 1996-2011, PostgreSQL Global Development Group]) AC_CONFIG_SRCDIR([src/backend/access/common/heaptuple.c]) AC_CONFIG_AUX_DIR(config) AC_PREFIX_DEFAULT(/usr/local/pgsql) @@ -58,6 +58,7 @@ case $host_os in bsdi*) template=bsdi ;; cygwin*) template=cygwin ;; darwin*) template=darwin ;; +dragonfly*) template=netbsd ;; dgux*) template=dgux ;; freebsd*) template=freebsd ;; hpux*) template=hpux ;; @@ -230,7 +231,7 @@ AC_SUBST(enable_coverage) # PGAC_ARG_BOOL(enable, dtrace, no, [build with DTrace support], -[AC_DEFINE([ENABLE_DTRACE], 1, +[AC_DEFINE([ENABLE_DTRACE], 1, [Define to 1 to enable DTrace support. (--enable-dtrace)]) AC_CHECK_PROGS(DTRACE, dtrace) if test -z "$DTRACE"; then @@ -262,14 +263,14 @@ AC_DEFINE_UNQUOTED([BLCKSZ], ${BLCKSZ}, [ can set it bigger if you need bigger tuples (although TOAST should reduce the need to have large tuples, since fields can be spread across multiple tuples). - + BLCKSZ must be a power of 2. The maximum possible value of BLCKSZ is currently 2^15 (32768). This is determined by the 15-bit widths of the lp_off and lp_len fields in ItemIdData (see include/storage/itemid.h). - + Changing BLCKSZ requires an initdb. -]) +]) # # Relation segment size @@ -288,7 +289,7 @@ AC_DEFINE_UNQUOTED([RELSEG_SIZE], ${RELSEG_SIZE}, [ RELSEG_SIZE is the maximum number of blocks allowed in one disk file. Thus, the maximum size of a single file is RELSEG_SIZE * BLCKSZ; relations bigger than that are divided into multiple files. - + RELSEG_SIZE * BLCKSZ must be less than your OS' limit on file size. This is often 2 GB or 4GB in a 32-bit operating system, unless you have large file support enabled. By default, we make the limit 1 GB @@ -329,7 +330,7 @@ AC_DEFINE_UNQUOTED([XLOG_BLCKSZ], ${XLOG_BLCKSZ}, [ buffers, else direct I/O may fail. Changing XLOG_BLCKSZ requires an initdb. -]) +]) # # WAL segment size @@ -429,6 +430,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels]) + # This was included in -Wall/-Wformat in older GCC versions + PGAC_PROG_CC_CFLAGS_OPT([-Wformat-security]) # Disable strict-aliasing rules; needed for gcc 3.3+ PGAC_PROG_CC_CFLAGS_OPT([-fno-strict-aliasing]) # Disable optimizations that assume no overflow; needed for gcc 4.3+ @@ -442,6 +445,10 @@ elif test "$ICC" = yes; then elif test "$PORTNAME" = "aix"; then # AIX's xlc has to have strict aliasing turned off too PGAC_PROG_CC_CFLAGS_OPT([-qnoansialias]) +elif test "$PORTNAME" = "hpux"; then + # On some versions of HP-UX, libm functions do not set errno by default. + # Fix that by using +Olibmerrno if the compiler recognizes it. + PGAC_PROG_CC_CFLAGS_OPT([+Olibmerrno]) fi # supply -g if --enable-debug @@ -461,7 +468,7 @@ fi # enable profiling if --enable-profiling if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then if test "$GCC" = yes; then - AC_DEFINE([PROFILE_PID_DIR], 1, + AC_DEFINE([PROFILE_PID_DIR], 1, [Define to 1 to allow profiling output to be saved separately for each process.]) CFLAGS="$CFLAGS -pg $PLATFORM_PROFILE_FLAGS" else @@ -676,6 +683,13 @@ PGAC_ARG_BOOL(with, openssl, no, [build with OpenSSL support], AC_MSG_RESULT([$with_openssl]) AC_SUBST(with_openssl) +# +# SELinux +# +AC_MSG_CHECKING([whether to build with SELinux support]) +PGAC_ARG_BOOL(with, selinux, no, [build with SELinux support]) +AC_SUBST(with_selinux) +AC_MSG_RESULT([$with_selinux]) # # Readline @@ -703,7 +717,7 @@ PGAC_ARG_BOOL(with, libedit-preferred, no, # # OSSP UUID library # -PGAC_ARG_BOOL(with, ossp-uuid, no, [use OSSP UUID library when building contrib/uuid-ossp]) +PGAC_ARG_BOOL(with, ossp-uuid, no, [build contrib/uuid-ossp, requires OSSP UUID library]) AC_SUBST(with_ossp_uuid) @@ -948,6 +962,12 @@ if test "$with_libxslt" = yes ; then AC_CHECK_LIB(xslt, xsltCleanupGlobals, [], [AC_MSG_ERROR([library 'xslt' is required for XSLT support])]) fi +# for contrib/sepgsql +if test "$with_selinux" = yes; then + AC_CHECK_LIB(selinux, selinux_sepgsql_context_path, [], + [AC_MSG_ERROR([library 'libselinux', version 2.0.93 or newer, is required for SELinux support])]) +fi + # for contrib/uuid-ossp if test "$with_ossp_uuid" = yes ; then AC_CHECK_LIB(ossp-uuid, uuid_export, @@ -964,7 +984,7 @@ AC_SUBST(OSSP_UUID_LIBS) ## dnl sys/socket.h is required by AC_FUNC_ACCEPT_ARGTYPES -AC_CHECK_HEADERS([crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h poll.h pwd.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h kernel/OS.h kernel/image.h SupportDefs.h]) +AC_CHECK_HEADERS([crypt.h dld.h fp_class.h getopt.h ieeefp.h ifaddrs.h langinfo.h poll.h pwd.h sys/ioctl.h sys/ipc.h sys/poll.h sys/pstat.h sys/resource.h sys/select.h sys/sem.h sys/shm.h sys/socket.h sys/sockio.h sys/tas.h sys/time.h sys/ucred.h sys/un.h termios.h ucred.h utime.h wchar.h wctype.h kernel/OS.h kernel/image.h SupportDefs.h]) # On BSD, cpp test for net/if.h will fail unless sys/socket.h # is included first. @@ -1103,11 +1123,13 @@ AC_TYPE_INTPTR_T AC_TYPE_UINTPTR_T AC_TYPE_LONG_LONG_INT -AC_CHECK_TYPES([struct cmsgcred, struct fcred, struct sockcred], [], [], -[#include <sys/param.h> -#include <sys/types.h> -#include <sys/socket.h> -#include <sys/ucred.h>]) +PGAC_TYPE_LOCALE_T + +AC_CHECK_TYPES([struct cmsgcred], [], [], +[#include <sys/socket.h> +#ifdef HAVE_SYS_UCRED_H +#include <sys/ucred.h> +#endif]) AC_CHECK_TYPES([struct option], [], [], [#ifdef HAVE_GETOPT_H @@ -1141,7 +1163,7 @@ if test "$with_krb5" = yes; then AC_MSG_CHECKING(for krb5_free_unparsed_name) AC_TRY_LINK([#include <krb5.h>], [krb5_free_unparsed_name(NULL,NULL);], - [AC_DEFINE(HAVE_KRB5_FREE_UNPARSED_NAME, 1, [Define to 1 if you have krb5_free_unparsed_name]) + [AC_DEFINE(HAVE_KRB5_FREE_UNPARSED_NAME, 1, [Define to 1 if you have krb5_free_unparsed_name]) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) fi @@ -1156,8 +1178,8 @@ AC_SYS_LARGEFILE AC_CHECK_SIZEOF([off_t]) # If we don't have largefile support, can't handle segsize >= 2GB. -if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then - AC_MSG_ERROR([Large file support is not enabled. Segment size cannot be larger than 1GB.]) +if test "$ac_cv_sizeof_off_t" -lt 8 -a "$segsize" != "1"; then + AC_MSG_ERROR([Large file support is not enabled. Segment size cannot be larger than 1GB.]) fi @@ -1169,7 +1191,7 @@ PGAC_VAR_INT_TIMEZONE AC_FUNC_ACCEPT_ARGTYPES PGAC_FUNC_GETTIMEOFDAY_1ARG -AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasync getifaddrs getpeereid getpeerucred getrlimit memmove poll pstat readlink scandir setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs]) +AC_CHECK_FUNCS([cbrt dlopen fcvt fdatasync getifaddrs getpeerucred getrlimit memmove poll pstat readlink scandir setproctitle setsid sigprocmask symlink sysconf towlower utime utimes waitpid wcstombs wcstombs_l]) AC_REPLACE_FUNCS(fseeko) case $host_os in @@ -1228,8 +1250,8 @@ if test "$PORTNAME" = "win32"; then # # To properly translate all NLS languages strings, we must support the # *printf() %$ format, which allows *printf() arguments to be selected - # by position in the translated string. - # + # by position in the translated string. + # # libintl versions < 0.13 use the native *printf() functions, and Win32 # *printf() doesn't understand %$, so we must use our /port versions, # which do understand %$. libintl versions >= 0.13 include their own @@ -1288,7 +1310,7 @@ fi pgac_save_LIBS="$LIBS" LIBS=`echo "$LIBS" | sed -e 's/-ledit//g' -e 's/-lreadline//g'` -AC_REPLACE_FUNCS([crypt erand48 getopt getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul]) +AC_REPLACE_FUNCS([crypt erand48 getopt getpeereid getrusage inet_aton random rint srandom strdup strerror strlcat strlcpy strtol strtoul]) case $host_os in @@ -1328,6 +1350,13 @@ if test "$PORTNAME" = "solaris"; then AC_LIBOBJ(getopt) fi +# mingw has adopted a GNU-centric interpretation of optind/optreset, +# so always use our version on Windows. +if test "$PORTNAME" = "win32"; then + AC_LIBOBJ(getopt) + AC_LIBOBJ(getopt_long) +fi + # Cygwin's erand48() is broken (always returns zero) in some releases, # so force use of ours. if test "$PORTNAME" = "cygwin"; then @@ -1336,13 +1365,23 @@ fi # Win32 support if test "$PORTNAME" = "win32"; then -AC_REPLACE_FUNCS(gettimeofday) -AC_LIBOBJ(kill) -AC_LIBOBJ(open) -AC_LIBOBJ(win32env) -AC_LIBOBJ(win32error) -AC_DEFINE([HAVE_SYMLINK], 1, - [Define to 1 if you have the `symlink' function.]) + AC_REPLACE_FUNCS(gettimeofday) + AC_LIBOBJ(kill) + AC_LIBOBJ(open) + AC_LIBOBJ(win32env) + AC_LIBOBJ(win32error) + AC_DEFINE([HAVE_SYMLINK], 1, + [Define to 1 if you have the `symlink' function.]) + AC_CHECK_TYPES(MINIDUMP_TYPE, [pgac_minidump_type=yes], [pgac_minidump_type=no], [ +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#include <string.h> +#include <dbghelp.h>]) +fi +if test x"$pgac_minidump_type" = x"yes" ; then + AC_SUBST(have_win32_dbghelp,yes) +else + AC_SUBST(have_win32_dbghelp,no) fi if test "$with_readline" = yes; then @@ -1355,12 +1394,14 @@ fi dnl Cannot use AC_CHECK_FUNC because sigsetjmp may be a macro dnl (especially on GNU libc) dnl See also comments in c.h. -AC_MSG_CHECKING(for sigsetjmp) -AC_TRY_LINK([#include <setjmp.h>], +AC_CACHE_CHECK([for sigsetjmp], pgac_cv_func_sigsetjmp, +[AC_TRY_LINK([#include <setjmp.h>], [sigjmp_buf x; sigsetjmp(x, 1);], - [AC_DEFINE(HAVE_SIGSETJMP, 1, [Define to 1 if you have sigsetjmp().]) -AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no)]) + [pgac_cv_func_sigsetjmp=yes], + [pgac_cv_func_sigsetjmp=no])]) +if test x"$pgac_cv_func_sigsetjmp" = x"yes"; then + AC_DEFINE(HAVE_SIGSETJMP, 1, [Define to 1 if you have sigsetjmp().]) +fi AC_DECL_SYS_SIGLIST @@ -1588,7 +1629,7 @@ AC_CHECK_SIZEOF([size_t]) AC_CHECK_SIZEOF([long]) # Decide whether float4 is passed by value: user-selectable, enabled by default -AC_MSG_CHECKING([whether to build with float4 passed by value]) +AC_MSG_CHECKING([whether to build with float4 passed by value]) PGAC_ARG_BOOL(enable, float4-byval, yes, [disable float4 passed by value], [AC_DEFINE([USE_FLOAT4_BYVAL], 1, [Define to 1 if you want float4 values to be passed by value. (--enable-float4-byval)]) @@ -1700,6 +1741,13 @@ else SHMEM_IMPLEMENTATION="src/backend/port/win32_shmem.c" fi +# Select latch implementation type. +if test "$PORTNAME" != "win32"; then + LATCH_IMPLEMENTATION="src/backend/port/unix_latch.c" +else + LATCH_IMPLEMENTATION="src/backend/port/win32_latch.c" +fi + # If not set in template file, set bytes to use libc memset() if test x"$MEMSET_LOOP_LIMIT" = x"" ; then MEMSET_LOOP_LIMIT=1024 @@ -1724,6 +1772,14 @@ if test "$with_tcl" = yes; then CPPFLAGS=$ac_save_CPPFLAGS fi +# check for <Python.h> +if test "$with_python" = yes; then + ac_save_CPPFLAGS=$CPPFLAGS + CPPFLAGS="$python_includespec $CPPFLAGS" + AC_CHECK_HEADER(Python.h, [], [AC_MSG_ERROR([header file <Python.h> is required for Python])]) + CPPFLAGS=$ac_save_CPPFLAGS +fi + # # Check for DocBook and tools # @@ -1797,7 +1853,8 @@ AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS]) # Create compiler version string if test x"$GCC" = x"yes" ; then - cc_string="GCC `${CC} --version | sed q`" + cc_string=`${CC} --version | sed q` + case $cc_string in [[A-Za-z]]*) ;; *) cc_string="GCC $cc_string";; esac elif test x"$SUN_STUDIO_CC" = x"yes" ; then cc_string=`${CC} -V 2>&1 | sed q` else @@ -1841,6 +1898,7 @@ AC_CONFIG_LINKS([ src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} + src/backend/port/pg_latch.c:${LATCH_IMPLEMENTATION} src/include/dynloader.h:src/backend/port/dynloader/${template}.h src/include/pg_config_os.h:src/include/port/${template}.h src/Makefile.port:src/makefiles/Makefile.${template} @@ -1848,7 +1906,7 @@ AC_CONFIG_LINKS([ if test "$PORTNAME" = "win32"; then AC_CONFIG_COMMANDS([check_win32_symlinks],[ -# Links sometimes fail undetected on Mingw - +# Links sometimes fail undetected on Mingw - # so here we detect it and warn the user for FILE in $CONFIG_LINKS do diff --git a/contrib/Makefile b/contrib/Makefile index a1b7d913f5..696776795e 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -1,4 +1,4 @@ -# $PostgreSQL: pgsql/contrib/Makefile,v 1.93 2010/06/14 16:17:56 sriggs Exp $ +# contrib/Makefile subdir = contrib top_builddir = .. @@ -6,6 +6,7 @@ include $(top_builddir)/src/Makefile.global SUBDIRS = \ adminpack \ + auth_delay \ auto_explain \ btree_gin \ btree_gist \ @@ -15,7 +16,9 @@ SUBDIRS = \ dblink \ dict_int \ dict_xsyn \ + dummy_seclabel \ earthdistance \ + file_fdw \ fuzzystrmatch \ hstore \ intagg \ @@ -31,6 +34,7 @@ SUBDIRS = \ pg_freespacemap \ pg_standby \ pg_stat_statements \ + pg_test_fsync \ pg_trgm \ pg_upgrade \ pg_upgrade_support \ @@ -58,18 +62,12 @@ ifeq ($(with_libxml),yes) SUBDIRS += xml2 endif +ifeq ($(with_selinux),yes) +SUBDIRS += sepgsql +endif + # Missing: # start-scripts \ (does not have a makefile) -all install installdirs uninstall distprep clean distclean maintainer-clean: - @for dir in $(SUBDIRS); do \ - $(MAKE) -C $$dir $@ || exit; \ - done - -# We'd like check operations to run all the subtests before failing. -check installcheck: - @CHECKERR=0; for dir in $(SUBDIRS); do \ - $(MAKE) -C $$dir $@ || CHECKERR=$$?; \ - done; \ - exit $$CHECKERR +$(recurse) diff --git a/contrib/README b/contrib/README index a04c04346e..a1d42a11cb 100644 --- a/contrib/README +++ b/contrib/README @@ -28,6 +28,11 @@ adminpack - File and log manipulation routines, used by pgAdmin by Dave Page <[email protected]> +auth_delay + Add a short delay after a failed authentication attempt, to make + brute-force attacks on database passwords a bit harder. + by KaiGai Kohei <[email protected]> + auto_explain - Log EXPLAIN output for long-running queries by Takahiro Itagaki <[email protected]> @@ -66,7 +71,11 @@ dict_xsyn - earthdistance - Functions for computing distances between two points on Earth - by Bruno Wolff III <[email protected]> and Hal Snyder <[email protected]> + by Bruno Wolff III <[email protected]> and Hal Snyder <[email protected]> + +file_fdw + Foreign-data wrapper for server-side CSV/TEXT files + by Shigeru Hanada <[email protected]> fuzzystrmatch - Levenshtein, metaphone, and soundex fuzzy string matching @@ -86,17 +95,17 @@ intarray - isn - PostgreSQL type extensions for ISBN, ISSN, ISMN, EAN13 product numbers - by Germ�n M�ndez Bravo (Kronuz) <[email protected]> + by Germán Méndez Bravo (Kronuz) <[email protected]> lo - Large Object maintenance - by Peter Mount <[email protected]> + by Peter Mount <[email protected]> ltree - Tree-like data structures by Teodor Sigaev <[email protected]> and Oleg Bartunov <[email protected]> -oid2name - +oid2name - Maps numeric files to table names by B Palmer <[email protected]> @@ -124,6 +133,10 @@ pg_stat_statements - Track statement execution times across a whole database cluster by Takahiro Itagaki <[email protected]> +pg_test_fsync - + Test different wal_sync_method settings + by Bruce Momjian <[email protected]> + pg_trgm - Functions for determining the similarity of text based on trigram matching. @@ -154,6 +167,10 @@ seg - Confidence-interval datatype (GiST indexing example) by Gene Selkov, Jr. <[email protected]> +sepgsql - + External security provider using SELinux + by KaiGai Kohei <[email protected]> + spi - Various trigger functions, examples for using SPI. @@ -161,7 +178,7 @@ sslinfo - Functions to get information about SSL certificates by Victor Wagner <[email protected]> -start-scripts - +start-scripts - Scripts for starting the server at boot time on various platforms. tablefunc - diff --git a/contrib/adminpack/Makefile b/contrib/adminpack/Makefile index e1262fb2e9..5cbc8f0c71 100644 --- a/contrib/adminpack/Makefile +++ b/contrib/adminpack/Makefile @@ -1,10 +1,11 @@ -# $PostgreSQL: pgsql/contrib/adminpack/Makefile,v 1.6 2007/11/10 23:59:50 momjian Exp $ +# contrib/adminpack/Makefile MODULE_big = adminpack -PG_CPPFLAGS = -I$(libpq_srcdir) -DATA_built = adminpack.sql -DATA = uninstall_adminpack.sql OBJS = adminpack.o +PG_CPPFLAGS = -I$(libpq_srcdir) + +EXTENSION = adminpack +DATA = adminpack--1.0.sql ifdef USE_PGXS PG_CONFIG = pg_config diff --git a/contrib/adminpack/adminpack.sql.in b/contrib/adminpack/adminpack--1.0.sql index de29bacd51..090702231c 100644 --- a/contrib/adminpack/adminpack.sql.in +++ b/contrib/adminpack/adminpack--1.0.sql @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/contrib/adminpack/adminpack.sql.in,v 1.6 2007/11/13 04:24:27 momjian Exp $ */ +/* contrib/adminpack/adminpack--1.0.sql */ /* *********************************************** * Administrative functions for PostgreSQL @@ -6,27 +6,27 @@ /* generic file access functions */ -CREATE OR REPLACE FUNCTION pg_catalog.pg_file_write(text, text, bool) +CREATE FUNCTION pg_catalog.pg_file_write(text, text, bool) RETURNS bigint AS 'MODULE_PATHNAME', 'pg_file_write' LANGUAGE C VOLATILE STRICT; -CREATE OR REPLACE FUNCTION pg_catalog.pg_file_rename(text, text, text) +CREATE FUNCTION pg_catalog.pg_file_rename(text, text, text) RETURNS bool AS 'MODULE_PATHNAME', 'pg_file_rename' LANGUAGE C VOLATILE; -CREATE OR REPLACE FUNCTION pg_catalog.pg_file_rename(text, text) +CREATE FUNCTION pg_catalog.pg_file_rename(text, text) RETURNS bool AS 'SELECT pg_catalog.pg_file_rename($1, $2, NULL::pg_catalog.text);' LANGUAGE SQL VOLATILE STRICT; -CREATE OR REPLACE FUNCTION pg_catalog.pg_file_unlink(text) +CREATE FUNCTION pg_catalog.pg_file_unlink(text) RETURNS bool AS 'MODULE_PATHNAME', 'pg_file_unlink' LANGUAGE C VOLATILE STRICT; -CREATE OR REPLACE FUNCTION pg_catalog.pg_logdir_ls() +CREATE FUNCTION pg_catalog.pg_logdir_ls() RETURNS setof record AS 'MODULE_PATHNAME', 'pg_logdir_ls' LANGUAGE C VOLATILE STRICT; @@ -34,17 +34,17 @@ LANGUAGE C VOLATILE STRICT; /* Renaming of existing backend functions for pgAdmin compatibility */ -CREATE OR REPLACE FUNCTION pg_catalog.pg_file_read(text, bigint, bigint) +CREATE FUNCTION pg_catalog.pg_file_read(text, bigint, bigint) RETURNS text AS 'pg_read_file' LANGUAGE INTERNAL VOLATILE STRICT; -CREATE OR REPLACE FUNCTION pg_catalog.pg_file_length(text) +CREATE FUNCTION pg_catalog.pg_file_length(text) RETURNS bigint AS 'SELECT size FROM pg_catalog.pg_stat_file($1)' LANGUAGE SQL VOLATILE STRICT; -CREATE OR REPLACE FUNCTION pg_catalog.pg_logfile_rotate() +CREATE FUNCTION pg_catalog.pg_logfile_rotate() RETURNS int4 AS 'pg_rotate_logfile' LANGUAGE INTERNAL VOLATILE STRICT; diff --git a/contrib/adminpack/adminpack.c b/contrib/adminpack/adminpack.c index 5271ef6ea2..99fa02e813 100644 --- a/contrib/adminpack/adminpack.c +++ b/contrib/adminpack/adminpack.c @@ -3,12 +3,12 @@ * adminpack.c * * - * Copyright (c) 2002-2010, PostgreSQL Global Development Group + * Copyright (c) 2002-2011, PostgreSQL Global Development Group * * Author: Andreas Pflug <[email protected]> * * IDENTIFICATION - * $PostgreSQL: pgsql/contrib/adminpack/adminpack.c,v 1.13 2010/01/02 16:57:32 momjian Exp $ + * contrib/adminpack/adminpack.c * *------------------------------------------------------------------------- */ @@ -73,32 +73,31 @@ convert_and_check_filename(text *arg, bool logAllowed) canonicalize_path(filename); /* filename can change length here */ - /* Disallow ".." in the path */ - if (path_contains_parent_reference(filename)) - ereport(ERROR, - (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("reference to parent directory (\"..\") not allowed")))); - if (is_absolute_path(filename)) { - /* Allow absolute references within DataDir */ - if (path_is_prefix_of_path(DataDir, filename)) - return filename; - /* The log directory might be outside our datadir, but allow it */ - if (logAllowed && - is_absolute_path(Log_directory) && - path_is_prefix_of_path(Log_directory, filename)) - return filename; + /* Disallow '/a/b/data/..' */ + if (path_contains_parent_reference(filename)) + ereport(ERROR, + (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), + (errmsg("reference to parent directory (\"..\") not allowed")))); + /* + * Allow absolute paths if within DataDir or Log_directory, even + * though Log_directory might be outside DataDir. + */ + if (!path_is_prefix_of_path(DataDir, filename) && + (!logAllowed || !is_absolute_path(Log_directory) || + !path_is_prefix_of_path(Log_directory, filename))) + ereport(ERROR, + (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), + (errmsg("absolute path not allowed")))); + } + else if (!path_is_relative_and_below_cwd(filename)) ereport(ERROR, (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE), - (errmsg("absolute path not allowed")))); - return NULL; /* keep compiler quiet */ - } - else - { - return filename; - } + (errmsg("path must be in or below the current directory")))); + + return filename; } diff --git a/contrib/adminpack/adminpack.control b/contrib/adminpack/adminpack.control new file mode 100644 index 0000000000..c79413f378 --- /dev/null +++ b/contrib/adminpack/adminpack.control @@ -0,0 +1,6 @@ +# adminpack extension +comment = 'administrative functions for PostgreSQL' +default_version = '1.0' +module_pathname = '$libdir/adminpack' +relocatable = false +schema = pg_catalog diff --git a/contrib/adminpack/uninstall_adminpack.sql b/contrib/adminpack/uninstall_adminpack.sql deleted file mode 100644 index 893f081461..0000000000 --- a/contrib/adminpack/uninstall_adminpack.sql +++ /dev/null @@ -1,10 +0,0 @@ -/* $PostgreSQL: pgsql/contrib/adminpack/uninstall_adminpack.sql,v 1.4 2007/11/13 04:24:27 momjian Exp $ */ - -DROP FUNCTION pg_catalog.pg_file_write(text, text, bool) ; -DROP FUNCTION pg_catalog.pg_file_rename(text, text, text) ; -DROP FUNCTION pg_catalog.pg_file_rename(text, text) ; -DROP FUNCTION pg_catalog.pg_file_unlink(text) ; -DROP FUNCTION pg_catalog.pg_logdir_ls() ; -DROP FUNCTION pg_catalog.pg_file_read(text, bigint, bigint) ; -DROP FUNCTION pg_catalog.pg_file_length(text) ; -DROP FUNCTION pg_catalog.pg_logfile_rotate() ; diff --git a/contrib/auth_delay/Makefile b/contrib/auth_delay/Makefile new file mode 100644 index 0000000000..09d2d5418c --- /dev/null +++ b/contrib/auth_delay/Makefile @@ -0,0 +1,14 @@ +# contrib/auth_delay/Makefile + +MODULES = auth_delay + +ifdef USE_PGXS +PG_CONFIG = pg_config +PGXS := $(shell $(PG_CONFIG) --pgxs) +include $(PGXS) +else +subdir = contrib/auth_delay +top_builddir = ../.. +include $(top_builddir)/src/Makefile.global +include $(top_srcdir)/contrib/contrib-global.mk +endif diff --git a/contrib/auth_delay/auth_delay.c b/contrib/auth_delay/auth_delay.c new file mode 100644 index 0000000000..4e0d5959d1 --- /dev/null +++ b/contrib/auth_delay/auth_delay.c @@ -0,0 +1,71 @@ +/* ------------------------------------------------------------------------- + * + * auth_delay.c + * + * Copyright (C) 2010-2011, PostgreSQL Global Development Group + * + * IDENTIFICATION + * contrib/auth_delay/auth_delay.c + * + * ------------------------------------------------------------------------- + */ +#include "postgres.h" + +#include "libpq/auth.h" +#include "port.h" +#include "utils/guc.h" +#include "utils/timestamp.h" + +PG_MODULE_MAGIC; + +void _PG_init(void); + +/* GUC Variables */ +static int auth_delay_milliseconds; + +/* Original Hook */ +static ClientAuthentication_hook_type original_client_auth_hook = NULL; + +/* + * Check authentication + */ +static void +auth_delay_checks(Port *port, int status) +{ + /* + * Any other plugins which use ClientAuthentication_hook. + */ + if (original_client_auth_hook) + original_client_auth_hook(port, status); + + /* + * Inject a short delay if authentication failed. + */ + if (status != STATUS_OK) + { + pg_usleep(1000L * auth_delay_milliseconds); + } +} + +/* + * Module Load Callback + */ +void +_PG_init(void) +{ + /* Define custom GUC variables */ + DefineCustomIntVariable("auth_delay.milliseconds", + "Milliseconds to delay before reporting authentication failure", + NULL, + &auth_delay_milliseconds, + 0, + 0, INT_MAX, + PGC_SIGHUP, + GUC_UNIT_MS, + NULL, + NULL, + NULL); + /* Install Hooks */ + original_client_auth_hook = ClientAuthentication_hook; + ClientAuthentication_hook = auth_delay_checks; +} diff --git a/contrib/auto_explain/Makefile b/contrib/auto_explain/Makefile index e9eaae0ece..2d1443fe48 100644 --- a/contrib/auto_explain/Makefile +++ b/contrib/auto_explain/Makefile @@ -1,4 +1,4 @@ -# $PostgreSQL: pgsql/contrib/auto_explain/Makefile,v 1.1 2008/11/19 02:59:28 tgl Exp $ +# contrib/auto_explain/Makefile MODULE_big = auto_explain OBJS = auto_explain.o diff --git a/contrib/auto_explain/auto_explain.c b/contrib/auto_explain/auto_explain.c index ffc1a4a106..b320698748 100644 --- a/contrib/auto_explain/auto_explain.c +++ b/contrib/auto_explain/auto_explain.c @@ -3,10 +3,10 @@ * auto_explain.c * * - * Copyright (c) 2008-2010, PostgreSQL Global Development Group + * Copyright (c) 2008-2011, PostgreSQL Global Development Group * * IDENTIFICATION - * $PostgreSQL: pgsql/contrib/auto_explain/auto_explain.c,v 1.14 2010/02/26 02:00:31 momjian Exp $ + * contrib/auto_explain/auto_explain.c * *------------------------------------------------------------------------- */ @@ -40,6 +40,7 @@ static int nesting_level = 0; /* Saved hook values in case of unload */ static ExecutorStart_hook_type prev_ExecutorStart = NULL; static ExecutorRun_hook_type prev_ExecutorRun = NULL; +static ExecutorFinish_hook_type prev_ExecutorFinish = NULL; static ExecutorEnd_hook_type prev_ExecutorEnd = NULL; #define auto_explain_enabled() \ @@ -53,6 +54,7 @@ static void explain_ExecutorStart(QueryDesc *queryDesc, int eflags); static void explain_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, long count); +static void explain_ExecutorFinish(QueryDesc *queryDesc); static void explain_ExecutorEnd(QueryDesc *queryDesc); @@ -72,6 +74,7 @@ _PG_init(void) PGC_SUSET, GUC_UNIT_MS, NULL, + NULL, NULL); DefineCustomBoolVariable("auto_explain.log_analyze", @@ -82,6 +85,7 @@ _PG_init(void) PGC_SUSET, 0, NULL, + NULL, NULL); DefineCustomBoolVariable("auto_explain.log_verbose", @@ -92,6 +96,7 @@ _PG_init(void) PGC_SUSET, 0, NULL, + NULL, NULL); DefineCustomBoolVariable("auto_explain.log_buffers", @@ -102,6 +107,7 @@ _PG_init(void) PGC_SUSET, 0, NULL, + NULL, NULL); DefineCustomEnumVariable("auto_explain.log_format", @@ -113,6 +119,7 @@ _PG_init(void) PGC_SUSET, 0, NULL, + NULL, NULL); DefineCustomBoolVariable("auto_explain.log_nested_statements", @@ -123,6 +130,7 @@ _PG_init(void) PGC_SUSET, 0, NULL, + NULL, NULL); EmitWarningsOnPlaceholders("auto_explain"); @@ -132,6 +140,8 @@ _PG_init(void) ExecutorStart_hook = explain_ExecutorStart; prev_ExecutorRun = ExecutorRun_hook; ExecutorRun_hook = explain_ExecutorRun; + prev_ExecutorFinish = ExecutorFinish_hook; + ExecutorFinish_hook = explain_ExecutorFinish; prev_ExecutorEnd = ExecutorEnd_hook; ExecutorEnd_hook = explain_ExecutorEnd; } @@ -145,6 +155,7 @@ _PG_fini(void) /* Uninstall hooks. */ ExecutorStart_hook = prev_ExecutorStart; ExecutorRun_hook = prev_ExecutorRun; + ExecutorFinish_hook = prev_ExecutorFinish; ExecutorEnd_hook = prev_ExecutorEnd; } @@ -212,6 +223,29 @@ explain_ExecutorRun(QueryDesc *queryDesc, ScanDirection direction, long count) } /* + * ExecutorFinish hook: all we need do is track nesting depth + */ +static void +explain_ExecutorFinish(QueryDesc *queryDesc) +{ + nesting_level++; + PG_TRY(); + { + if (prev_ExecutorFinish) + prev_ExecutorFinish(queryDesc); + else + standard_ExecutorFinish(queryDesc); + nesting_level--; + } + PG_CATCH(); + { + nesting_level--; + PG_RE_THROW(); + } + PG_END_TRY(); +} + +/* * ExecutorEnd hook: log results if needed */ static void diff --git a/contrib/btree_gin/.gitignore b/contrib/btree_gin/.gitignore new file mode 100644 index 0000000000..5dcb3ff972 --- /dev/null +++ b/contrib/btree_gin/.gitignore @@ -0,0 +1,4 @@ +# Generated subdirectories +/log/ +/results/ +/tmp_check/ diff --git a/contrib/btree_gin/Makefile b/contrib/btree_gin/Makefile index e6b6394c23..09fd3e6e11 100644 --- a/contrib/btree_gin/Makefile +++ b/contrib/btree_gin/Makefile @@ -1,10 +1,11 @@ -# $PostgreSQL: pgsql/contrib/btree_gin/Makefile,v 1.1 2009/03/25 23:20:01 tgl Exp $ +# contrib/btree_gin/Makefile MODULE_big = btree_gin -OBJS = btree_gin.o +OBJS = btree_gin.o + +EXTENSION = btree_gin +DATA = btree_gin--1.0.sql btree_gin--unpackaged--1.0.sql -DATA_built = btree_gin.sql -DATA = uninstall_btree_gin.sql REGRESS = install_btree_gin int2 int4 int8 float4 float8 money oid \ timestamp timestamptz time timetz date interval \ macaddr inet cidr text varchar char bytea bit varbit \ diff --git a/contrib/btree_gin/btree_gin.sql.in b/contrib/btree_gin/btree_gin--1.0.sql index bc7ec3bbcb..07f93640f3 100644 --- a/contrib/btree_gin/btree_gin.sql.in +++ b/contrib/btree_gin/btree_gin--1.0.sql @@ -1,24 +1,21 @@ -/* $PostgreSQL: pgsql/contrib/btree_gin/btree_gin.sql.in,v 1.1 2009/03/25 23:20:01 tgl Exp $ */ +/* contrib/btree_gin/btree_gin--1.0.sql */ --- Adjust this setting to control where the objects get created. -SET search_path = public; - -CREATE OR REPLACE FUNCTION gin_btree_consistent(internal, int2, anyelement, int4, internal, internal) +CREATE FUNCTION gin_btree_consistent(internal, int2, anyelement, int4, internal, internal) RETURNS bool AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_extract_value_int2(int2, internal) +CREATE FUNCTION gin_extract_value_int2(int2, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_compare_prefix_int2(int2, int2, int2, internal) +CREATE FUNCTION gin_compare_prefix_int2(int2, int2, int2, internal) RETURNS int4 AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_extract_query_int2(int2, internal, int2, internal, internal) +CREATE FUNCTION gin_extract_query_int2(int2, internal, int2, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; @@ -38,17 +35,17 @@ AS FUNCTION 5 gin_compare_prefix_int2(int2,int2,int2, internal), STORAGE int2; -CREATE OR REPLACE FUNCTION gin_extract_value_int4(int4, internal) +CREATE FUNCTION gin_extract_value_int4(int4, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_compare_prefix_int4(int4, int4, int2, internal) +CREATE FUNCTION gin_compare_prefix_int4(int4, int4, int2, internal) RETURNS int4 AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_extract_query_int4(int4, internal, int2, internal, internal) +CREATE FUNCTION gin_extract_query_int4(int4, internal, int2, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; @@ -68,17 +65,17 @@ AS FUNCTION 5 gin_compare_prefix_int4(int4,int4,int2, internal), STORAGE int4; -CREATE OR REPLACE FUNCTION gin_extract_value_int8(int8, internal) +CREATE FUNCTION gin_extract_value_int8(int8, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_compare_prefix_int8(int8, int8, int2, internal) +CREATE FUNCTION gin_compare_prefix_int8(int8, int8, int2, internal) RETURNS int4 AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_extract_query_int8(int8, internal, int2, internal, internal) +CREATE FUNCTION gin_extract_query_int8(int8, internal, int2, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; @@ -98,17 +95,17 @@ AS FUNCTION 5 gin_compare_prefix_int8(int8,int8,int2, internal), STORAGE int8; -CREATE OR REPLACE FUNCTION gin_extract_value_float4(float4, internal) +CREATE FUNCTION gin_extract_value_float4(float4, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_compare_prefix_float4(float4, float4, int2, internal) +CREATE FUNCTION gin_compare_prefix_float4(float4, float4, int2, internal) RETURNS int4 AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_extract_query_float4(float4, internal, int2, internal, internal) +CREATE FUNCTION gin_extract_query_float4(float4, internal, int2, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; @@ -128,17 +125,17 @@ AS FUNCTION 5 gin_compare_prefix_float4(float4,float4,int2, internal), STORAGE float4; -CREATE OR REPLACE FUNCTION gin_extract_value_float8(float8, internal) +CREATE FUNCTION gin_extract_value_float8(float8, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_compare_prefix_float8(float8, float8, int2, internal) +CREATE FUNCTION gin_compare_prefix_float8(float8, float8, int2, internal) RETURNS int4 AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_extract_query_float8(float8, internal, int2, internal, internal) +CREATE FUNCTION gin_extract_query_float8(float8, internal, int2, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; @@ -158,17 +155,17 @@ AS FUNCTION 5 gin_compare_prefix_float8(float8,float8,int2, internal), STORAGE float8; -CREATE OR REPLACE FUNCTION gin_extract_value_money(money, internal) +CREATE FUNCTION gin_extract_value_money(money, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_compare_prefix_money(money, money, int2, internal) +CREATE FUNCTION gin_compare_prefix_money(money, money, int2, internal) RETURNS int4 AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_extract_query_money(money, internal, int2, internal, internal) +CREATE FUNCTION gin_extract_query_money(money, internal, int2, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; @@ -188,17 +185,17 @@ AS FUNCTION 5 gin_compare_prefix_money(money,money,int2, internal), STORAGE money; -CREATE OR REPLACE FUNCTION gin_extract_value_oid(oid, internal) +CREATE FUNCTION gin_extract_value_oid(oid, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_compare_prefix_oid(oid, oid, int2, internal) +CREATE FUNCTION gin_compare_prefix_oid(oid, oid, int2, internal) RETURNS int4 AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_extract_query_oid(oid, internal, int2, internal, internal) +CREATE FUNCTION gin_extract_query_oid(oid, internal, int2, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; @@ -218,17 +215,17 @@ AS FUNCTION 5 gin_compare_prefix_oid(oid,oid,int2, internal), STORAGE oid; -CREATE OR REPLACE FUNCTION gin_extract_value_timestamp(timestamp, internal) +CREATE FUNCTION gin_extract_value_timestamp(timestamp, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_compare_prefix_timestamp(timestamp, timestamp, int2, internal) +CREATE FUNCTION gin_compare_prefix_timestamp(timestamp, timestamp, int2, internal) RETURNS int4 AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_extract_query_timestamp(timestamp, internal, int2, internal, internal) +CREATE FUNCTION gin_extract_query_timestamp(timestamp, internal, int2, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; @@ -248,17 +245,17 @@ AS FUNCTION 5 gin_compare_prefix_timestamp(timestamp,timestamp,int2, internal), STORAGE timestamp; -CREATE OR REPLACE FUNCTION gin_extract_value_timestamptz(timestamptz, internal) +CREATE FUNCTION gin_extract_value_timestamptz(timestamptz, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_compare_prefix_timestamptz(timestamptz, timestamptz, int2, internal) +CREATE FUNCTION gin_compare_prefix_timestamptz(timestamptz, timestamptz, int2, internal) RETURNS int4 AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_extract_query_timestamptz(timestamptz, internal, int2, internal, internal) +CREATE FUNCTION gin_extract_query_timestamptz(timestamptz, internal, int2, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; @@ -278,17 +275,17 @@ AS FUNCTION 5 gin_compare_prefix_timestamptz(timestamptz,timestamptz,int2, internal), STORAGE timestamptz; -CREATE OR REPLACE FUNCTION gin_extract_value_time(time, internal) +CREATE FUNCTION gin_extract_value_time(time, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_compare_prefix_time(time, time, int2, internal) +CREATE FUNCTION gin_compare_prefix_time(time, time, int2, internal) RETURNS int4 AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_extract_query_time(time, internal, int2, internal, internal) +CREATE FUNCTION gin_extract_query_time(time, internal, int2, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; @@ -308,17 +305,17 @@ AS FUNCTION 5 gin_compare_prefix_time(time,time,int2, internal), STORAGE time; -CREATE OR REPLACE FUNCTION gin_extract_value_timetz(timetz, internal) +CREATE FUNCTION gin_extract_value_timetz(timetz, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_compare_prefix_timetz(timetz, timetz, int2, internal) +CREATE FUNCTION gin_compare_prefix_timetz(timetz, timetz, int2, internal) RETURNS int4 AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_extract_query_timetz(timetz, internal, int2, internal, internal) +CREATE FUNCTION gin_extract_query_timetz(timetz, internal, int2, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; @@ -338,17 +335,17 @@ AS FUNCTION 5 gin_compare_prefix_timetz(timetz,timetz,int2, internal), STORAGE timetz; -CREATE OR REPLACE FUNCTION gin_extract_value_date(date, internal) +CREATE FUNCTION gin_extract_value_date(date, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_compare_prefix_date(date, date, int2, internal) +CREATE FUNCTION gin_compare_prefix_date(date, date, int2, internal) RETURNS int4 AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_extract_query_date(date, internal, int2, internal, internal) +CREATE FUNCTION gin_extract_query_date(date, internal, int2, internal, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; @@ -368,17 +365,17 @@ AS FUNCTION 5 gin_compare_prefix_date(date,date,int2, internal), STORAGE date; -CREATE OR REPLACE FUNCTION gin_extract_value_interval(interval, internal) +CREATE FUNCTION gin_extract_value_interval(interval, internal) RETURNS internal AS 'MODULE_PATHNAME' LANGUAGE C STRICT IMMUTABLE; -CREATE OR REPLACE FUNCTION gin_compare_prefix_interval(interval, interval, int2, internal) +CREATE FUNCTION gin_compare_prefix_interval(interval, interva |