set HAVE_IPV6. Per recent discussions.
+HAVE_IPV6=no
echo "$as_me:$LINENO: checking for struct sockaddr_in6" >&5
echo $ECHO_N "checking for struct sockaddr_in6... $ECHO_C" >&6
if test "${ac_cv_type_struct_sockaddr_in6+set}" = set; then
#define HAVE_IPV6 1
_ACEOF
+ HAVE_IPV6=yes
fi
fi
+
echo "$as_me:$LINENO: checking for PS_STRINGS" >&5
echo $ECHO_N "checking for PS_STRINGS... $ECHO_C" >&6
if test "${pgac_cv_var_PS_STRINGS+set}" = set; then
s,@python_includespec@,$python_includespec,;t t
s,@python_libspec@,$python_libspec,;t t
s,@LIBOBJS@,$LIBOBJS,;t t
+s,@HAVE_IPV6@,$HAVE_IPV6,;t t
s,@THREAD_CFLAGS@,$THREAD_CFLAGS,;t t
s,@THREAD_LIBS@,$THREAD_LIBS,;t t
s,@HAVE_POSIX_SIGNALS@,$HAVE_POSIX_SIGNALS,;t t
dnl Process this file with autoconf to produce a configure script.
-dnl $Header: /cvsroot/pgsql/configure.in,v 1.283 2003/09/01 23:01:49 petere Exp $
+dnl $Header: /cvsroot/pgsql/configure.in,v 1.284 2003/09/07 03:36:02 tgl Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
AC_CHECK_DECLS(fdatasync, [], [], [#include <unistd.h>])
+HAVE_IPV6=no
AC_CHECK_TYPE([struct sockaddr_in6],
[AC_CHECK_FUNC(inet_ntop,
- [AC_DEFINE(HAVE_IPV6, 1, [Define to 1 if you have support for IPv6.])])],
+ [AC_DEFINE(HAVE_IPV6, 1, [Define to 1 if you have support for IPv6.])
+ HAVE_IPV6=yes])],
[],
[$ac_includes_default
#include <netinet/in.h>])
+AC_SUBST(HAVE_IPV6)
AC_CACHE_CHECK([for PS_STRINGS], [pgac_cv_var_PS_STRINGS],
[AC_TRY_LINK(
# -*-makefile-*-
-# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.167 2003/09/01 23:01:49 petere Exp $
+# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.168 2003/09/07 03:36:02 tgl Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
host_os = @host_os@
host_cpu = @host_cpu@
+# Make HAVE_IPV6 available for initdb script creation
+HAVE_IPV6= @HAVE_IPV6@
+
# The HP-UX port makefile, for one, needs access to this symbol
HAVE_POSIX_SIGNALS= @HAVE_POSIX_SIGNALS@
# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
local all all trust
+# IPv4-style local connections:
host all all 127.0.0.1 255.255.255.255 trust
-
-# uncomment this to support IPv6 loopback connections
-# host all all ::1 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff trust
+# IPv6-style local connections:
+host all all ::1 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff trust
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.28 2002/09/03 21:45:43 petere Exp $
+# $Header: /cvsroot/pgsql/src/bin/initdb/Makefile,v 1.29 2003/09/07 03:36:03 tgl Exp $
#
#-------------------------------------------------------------------------
initdb: initdb.sh $(top_builddir)/src/Makefile.global
sed -e 's/@VERSION@/$(VERSION)/g' \
-e 's,@SHELL@,$(SHELL),g' \
+ -e 's,@HAVE_IPV6@,$(HAVE_IPV6),g' \
-e 's,@bindir@,$(bindir),g' \
-e 's,@datadir@,$(datadir),g' \
$< >$@
# Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
-# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.200 2003/08/26 15:38:25 tgl Exp $
+# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.201 2003/09/07 03:36:03 tgl Exp $
#
#-------------------------------------------------------------------------
# Placed here during build
VERSION='@VERSION@'
+HAVE_IPV6='@HAVE_IPV6@'
bindir='@bindir@'
# Note that "datadir" is not the directory we're initializing, it's
# merely how Autoconf names PREFIX/share.
$ECHO_N "creating configuration files... "$ECHO_C
-cp "$PG_HBA_SAMPLE" "$PGDATA"/pg_hba.conf || exit_nicely
-cp "$PG_IDENT_SAMPLE" "$PGDATA"/pg_ident.conf || exit_nicely
sed -e "s/^#shared_buffers = 1000/shared_buffers = $nbuffers/" \
-e "s/^#max_connections = 100/max_connections = $nconns/" \
-e "s/^#lc_messages = 'C'/lc_messages = '`pg_getlocale MESSAGES`'/" \
-e "s/^#lc_numeric = 'C'/lc_numeric = '`pg_getlocale NUMERIC`'/" \
-e "s/^#lc_time = 'C'/lc_time = '`pg_getlocale TIME`'/" \
"$POSTGRESQL_CONF_SAMPLE" > "$PGDATA"/postgresql.conf || exit_nicely
+if [ "x$HAVE_IPV6" = xyes ]
+then
+ cp "$PG_HBA_SAMPLE" "$PGDATA"/pg_hba.conf || exit_nicely
+else
+ sed -e "/ ::1 / s/^host/#host/" \
+ "$PG_HBA_SAMPLE" > "$PGDATA"/pg_hba.conf || exit_nicely
+fi
+cp "$PG_IDENT_SAMPLE" "$PGDATA"/pg_ident.conf || exit_nicely
chmod 0600 "$PGDATA"/pg_hba.conf "$PGDATA"/pg_ident.conf \
"$PGDATA"/postgresql.conf