From a8b9cbfa0e154323a2e3c3dd756c4513a81cf4fe Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Wed, 7 Feb 2001 20:13:27 +0000
Subject: [PATCH] Make DEF_PGPORT available to Makefiles, so it can be
 substituted into scripts like pgaccess.

---
 configure              | 5 +++--
 configure.in           | 6 +++---
 src/Makefile.global.in | 6 +++++-
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index 8955ff3a718..3cb00541359 100755
--- a/configure
+++ b/configure
@@ -976,7 +976,8 @@ if test x"${with_pgport+set}" = xset; then
 else
   default_port=5432
 fi
-# Need both of these because backend wants an integer and frontend a string
+echo "$ac_t""$default_port" 1>&6
+# Need both of these because some places want an integer and some a string
 cat >> confdefs.h <<EOF
 #define DEF_PGPORT ${default_port}
 EOF
@@ -985,7 +986,6 @@ cat >> confdefs.h <<EOF
 #define DEF_PGPORT_STR "${default_port}"
 EOF
 
-echo "$ac_t""$default_port" 1>&6
 
 
 #
@@ -7903,6 +7903,7 @@ s%@host_os@%$host_os%g
 s%@PORTNAME@%$PORTNAME%g
 s%@TAS@%$TAS%g
 s%@MULTIBYTE@%$MULTIBYTE%g
+s%@default_port@%$default_port%g
 s%@enable_shared@%$enable_shared%g
 s%@enable_rpath@%$enable_rpath%g
 s%@CC@%$CC%g
diff --git a/configure.in b/configure.in
index 1b3019f4656..4e979e0950c 100644
--- a/configure.in
+++ b/configure.in
@@ -223,11 +223,11 @@ AC_MSG_CHECKING([for default port number])
 PGAC_ARG_REQ(with, pgport, [  --with-pgport=PORTNUM   change default port number [5432]],
              [default_port=$withval],
              [default_port=5432])
-# Need both of these because backend wants an integer and frontend a string
+AC_MSG_RESULT([$default_port])
+# Need both of these because some places want an integer and some a string
 AC_DEFINE_UNQUOTED(DEF_PGPORT, ${default_port})
 AC_DEFINE_UNQUOTED(DEF_PGPORT_STR, "${default_port}")
-AC_MSG_RESULT([$default_port])
-
+AC_SUBST(default_port)
 
 #
 # Maximum number of allowed connections (--with-maxbackends), default 32
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index d17405e3ca2..f158b7a311e 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -1,5 +1,5 @@
 # -*-makefile-*-
-# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.117 2001/01/20 22:56:33 tgl Exp $
+# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.118 2001/02/07 20:13:27 tgl Exp $
 
 #------------------------------------------------------------------------------
 # All PostgreSQL makefiles include this file and use the variables it sets,
@@ -200,6 +200,10 @@ JADE	= @JADE@
 NSGMLS	= @NSGMLS@
 SGMLSPL	= @SGMLSPL@
 
+# Feature settings
+
+DEF_PGPORT = @default_port@
+
 
 ##########################################################################
 #
-- 
GitLab