]> granicus.if.org Git - postgresql/commitdiff
Add Rendezvous support to postmaster, from Chris Campbell
authorBruce Momjian <bruce@momjian.us>
Wed, 11 Jun 2003 06:56:07 +0000 (06:56 +0000)
committerBruce Momjian <bruce@momjian.us>
Wed, 11 Jun 2003 06:56:07 +0000 (06:56 +0000)
configure
configure.in
doc/src/sgml/installation.sgml
src/backend/postmaster/postmaster.c
src/include/pg_config.h.in

index b6c54338c1e19ef90480e1c1051bf1c400f035b2..906e9b33b32efe9f456a18ed5ce7ec4e12276b8e 100755 (executable)
--- a/configure
+++ b/configure
@@ -866,6 +866,7 @@ Optional Packages:
   --with-krb5[=DIR]       build with Kerberos 5 support [/usr/athena]
   --with-krb-srvnam=NAME  name of the service principal in Kerberos postgres
   --with-pam              build with PAM support
+  --with-rendezvous       build with Rendezvous support
   --with-openssl[=DIR]    build with OpenSSL support [/usr/local/ssl]
   --without-readline      do not use Readline
   --without-zlib          do not use Zlib
@@ -3360,6 +3361,46 @@ echo "${ECHO_T}$with_pam" >&6
 
 
 
+#
+# Rendezvous
+#
+echo "$as_me:$LINENO: checking whether to build with Rendezvous support" >&5
+echo $ECHO_N "checking whether to build with Rendezvous support... $ECHO_C" >&6
+
+
+
+# Check whether --with-rendezvous or --without-rendezvous was given.
+if test "${with_rendezvous+set}" = set; then
+  withval="$with_rendezvous"
+
+  case $withval in
+    yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_RENDEZVOUS 1
+_ACEOF
+
+      ;;
+    no)
+      :
+      ;;
+    *)
+      { { echo "$as_me:$LINENO: error: no argument expected for --with-rendezvous option" >&5
+echo "$as_me: error: no argument expected for --with-rendezvous option" >&2;}
+   { (exit 1); exit 1; }; }
+      ;;
+  esac
+
+else
+  with_rendezvous=no
+
+fi;
+
+echo "$as_me:$LINENO: result: $with_rendezvous" >&5
+echo "${ECHO_T}$with_rendezvous" >&6
+
+
+
 #
 # OpenSSL
 #
@@ -9038,6 +9079,119 @@ fi
 
 done
 
+fi
+
+if test "$with_rendezvous" = yes ; then
+  if test "${ac_cv_header_DNSServiceDiscovery_DNSServiceDiscovery_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for DNSServiceDiscovery/DNSServiceDiscovery.h" >&5
+echo $ECHO_N "checking for DNSServiceDiscovery/DNSServiceDiscovery.h... $ECHO_C" >&6
+if test "${ac_cv_header_DNSServiceDiscovery_DNSServiceDiscovery_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_DNSServiceDiscovery_DNSServiceDiscovery_h" >&5
+echo "${ECHO_T}$ac_cv_header_DNSServiceDiscovery_DNSServiceDiscovery_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking DNSServiceDiscovery/DNSServiceDiscovery.h usability" >&5
+echo $ECHO_N "checking DNSServiceDiscovery/DNSServiceDiscovery.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+$ac_includes_default
+#include <DNSServiceDiscovery/DNSServiceDiscovery.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking DNSServiceDiscovery/DNSServiceDiscovery.h presence" >&5
+echo $ECHO_N "checking DNSServiceDiscovery/DNSServiceDiscovery.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <DNSServiceDiscovery/DNSServiceDiscovery.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  egrep -v '^ *\+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+  yes:no )
+    { echo "$as_me:$LINENO: WARNING: DNSServiceDiscovery/DNSServiceDiscovery.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: DNSServiceDiscovery/DNSServiceDiscovery.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: DNSServiceDiscovery/DNSServiceDiscovery.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: DNSServiceDiscovery/DNSServiceDiscovery.h: proceeding with the preprocessor's result" >&2;};;
+  no:yes )
+    { echo "$as_me:$LINENO: WARNING: DNSServiceDiscovery/DNSServiceDiscovery.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: DNSServiceDiscovery/DNSServiceDiscovery.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: DNSServiceDiscovery/DNSServiceDiscovery.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: DNSServiceDiscovery/DNSServiceDiscovery.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: DNSServiceDiscovery/DNSServiceDiscovery.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: DNSServiceDiscovery/DNSServiceDiscovery.h: proceeding with the preprocessor's result" >&2;};;
+esac
+echo "$as_me:$LINENO: checking for DNSServiceDiscovery/DNSServiceDiscovery.h" >&5
+echo $ECHO_N "checking for DNSServiceDiscovery/DNSServiceDiscovery.h... $ECHO_C" >&6
+if test "${ac_cv_header_DNSServiceDiscovery_DNSServiceDiscovery_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_DNSServiceDiscovery_DNSServiceDiscovery_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_DNSServiceDiscovery_DNSServiceDiscovery_h" >&5
+echo "${ECHO_T}$ac_cv_header_DNSServiceDiscovery_DNSServiceDiscovery_h" >&6
+
+fi
+if test $ac_cv_header_DNSServiceDiscovery_DNSServiceDiscovery_h = yes; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: header file <DNSServiceDiscovery/DNSServiceDiscovery.h> is required for Rendezvous" >&5
+echo "$as_me: error: header file <DNSServiceDiscovery/DNSServiceDiscovery.h> is required for Rendezvous" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
 fi
 
 
@@ -17327,6 +17481,7 @@ s,@with_krb4@,$with_krb4,;t t
 s,@with_krb5@,$with_krb5,;t t
 s,@krb_srvtab@,$krb_srvtab,;t t
 s,@with_pam@,$with_pam,;t t
+s,@with_rendezvous@,$with_rendezvous,;t t
 s,@with_openssl@,$with_openssl,;t t
 s,@ELF_SYS@,$ELF_SYS,;t t
 s,@THREAD_LIBS@,$THREAD_LIBS,;t t
index f70d3d2f723367c4638602db01ad98cfc7cb8a00..5881542a4cf4868da45a792b960457ad6f39b86a 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-dnl $Header: /cvsroot/pgsql/configure.in,v 1.257 2003/06/09 03:41:46 tgl Exp $
+dnl $Header: /cvsroot/pgsql/configure.in,v 1.258 2003/06/11 06:56:06 momjian Exp $
 dnl
 dnl Developers, please strive to achieve this order:
 dnl
@@ -471,6 +471,17 @@ AC_MSG_RESULT([$with_pam])
 AC_SUBST(with_pam)
 
 
+#
+# Rendezvous
+#
+AC_MSG_CHECKING([whether to build with Rendezvous support])
+PGAC_ARG_BOOL(with, rendezvous, no,
+              [  --with-rendezvous       build with Rendezvous support],
+              [AC_DEFINE([USE_RENDEZVOUS], 1, [Define to 1 to build with Rendezvous support. (--with-rendezvous)])])
+AC_MSG_RESULT([$with_rendezvous])
+AC_SUBST(with_rendezvous)
+
+
 #
 # OpenSSL
 #
@@ -759,6 +770,10 @@ if test "$with_pam" = yes ; then
                                      [AC_MSG_ERROR([header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM.])])])
 fi
 
+if test "$with_rendezvous" = yes ; then
+  AC_CHECK_HEADER(DNSServiceDiscovery/DNSServiceDiscovery.h, [], [AC_MSG_ERROR([header file <DNSServiceDiscovery/DNSServiceDiscovery.h> is required for Rendezvous])])
+fi
+
 
 ##
 ## Types, structures, compiler characteristics
index 4a606bcdfb074eeb1855e112daf0c9cd88b837c0..16051998392bcb21dbec8bc7113ed4ff56f9b508 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.132 2003/03/25 16:15:36 petere Exp $ -->
+<!-- $Header: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v 1.133 2003/06/11 06:56:06 momjian Exp $ -->
 
 <chapter id="installation">
  <title><![%standalone-include[<productname>PostgreSQL</>]]>
@@ -270,8 +270,7 @@ JAVACMD=$JAVA_HOME/bin/java
     <listitem>
      <para>
       <application>Kerberos</>, <application>OpenSSL</>, or <application>PAM</>,
-      if you want to support
-      authentication using these services.
+      if you want to support authentication using these services.
      </para>
     </listitem>
    </itemizedlist>
@@ -906,6 +905,15 @@ JAVACMD=$JAVA_HOME/bin/java
        </listitem>
       </varlistentry>
 
+      <varlistentry>
+       <term><option>--with-rendezvous</option></term>
+       <listitem>
+        <para>
+        Build with Rendezvous support.
+        </para>
+       </listitem>
+      </varlistentry>
+
       <varlistentry>
        <term><option>--without-zlib</option></term>
        <listitem>
index ef4266be53c62ccbb293d8822e1f5b45ccf4078f..5b16d06a994bf2ea449bc0c478191cff170a23b2 100644 (file)
@@ -37,7 +37,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.331 2003/05/28 19:36:28 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.332 2003/06/11 06:56:06 momjian Exp $
  *
  * NOTES
  *
 #include <getopt.h>
 #endif
 
+#ifdef USE_RENDEZVOUS
+#include <DNSServiceDiscovery/DNSServiceDiscovery.h>
+#endif
+
 #include "catalog/pg_database.h"
 #include "commands/async.h"
 #include "lib/dllist.h"
@@ -366,6 +370,17 @@ checkDataDir(const char *checkdir)
 }
 
 
+#ifdef USE_RENDEZVOUS
+
+/* reg_reply -- empty callback function for DNSServiceRegistrationCreate() */
+static void
+reg_reply(DNSServiceRegistrationReplyErrorType errorCode, void *context)
+{
+
+}
+
+#endif
+
 int
 PostmasterMain(int argc, char *argv[])
 {
@@ -723,6 +738,18 @@ PostmasterMain(int argc, char *argv[])
                        else
                                elog(LOG, "IPv4 socket created");
                }
+#endif
+#ifdef USE_RENDEZVOUS                    
+                if (service_name != NULL)
+                {
+                        DNSServiceRegistrationCreate(NULL,     /* default to hostname */
+                                                     "_postgresql._tcp.",
+                                                     "",
+                                                     htonl(PostPortNumber),
+                                                     "",
+                                                     (DNSServiceRegistrationReply)reg_reply,
+                                                     NULL);
+                }
 #endif
        }
 
index bc6d89ada15a073dffa26c8edccb334010554012..b20cecf194876283ae890cae9043842321b05771 100644 (file)
 /* Define to 1 to build with PAM support. (--with-pam) */
 #undef USE_PAM
 
+/* Define to 1 to build with Rendezvous support. (--with-rendezvous) */
+#undef USE_RENDEZVOUS
+
 /* Define to build with (Open)SSL support. (--with-openssl) */
 #undef USE_SSL