Remove configure probe for gethostbyname_r.
authorThomas Munro <[email protected]>
Sat, 13 Aug 2022 21:57:48 +0000 (09:57 +1200)
committerThomas Munro <[email protected]>
Sat, 13 Aug 2022 21:57:48 +0000 (09:57 +1200)
It was only used by src/port/getaddrinfo.c, removed by the previous
commit.

Discussion: https://postgr.es/m/CA%2BhUKGJFLPCtAC58EAimF6a6GPw30TU_59FUY%3DGWB_kC%3DJEmVQ%40mail.gmail.com

configure
configure.ac
src/include/pg_config.h.in
src/interfaces/libpq/fe-connect.c
src/tools/msvc/Solution.pm

index 244495f05210da94795412689f46030b4c960d18..176e0f9b008338af4320e5a0ed4d14d86e4f9fbc 100755 (executable)
--- a/configure
+++ b/configure
 
 
 
-for ac_func in strerror_r gethostbyname_r
+for ac_func in strerror_r
 do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+  ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
+if test "x$ac_cv_func_strerror_r" = xyes; then :
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_STRERROR_R 1
 _ACEOF
 
 fi
 
 
 if test "$enable_thread_safety" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname_r" >&5
-$as_echo_n "checking for library containing gethostbyname_r... " >&6; }
-if ${ac_cv_search_gethostbyname_r+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* 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 gethostbyname_r ();
-int
-main ()
-{
-return gethostbyname_r ();
-  ;
-  return 0;
-}
-_ACEOF
-for ac_lib in '' nsl; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_gethostbyname_r=$ac_res
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_gethostbyname_r+:} false; then :
-  break
-fi
-done
-if ${ac_cv_search_gethostbyname_r+:} false; then :
-
-else
-  ac_cv_search_gethostbyname_r=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname_r" >&5
-$as_echo "$ac_cv_search_gethostbyname_r" >&6; }
-ac_res=$ac_cv_search_gethostbyname_r
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-
-fi
-
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_barrier_wait" >&5
 $as_echo_n "checking for library containing pthread_barrier_wait... " >&6; }
 if ${ac_cv_search_pthread_barrier_wait+:} false; then :
index e4156a78be74f7593bbac1319ebbd0f034d37047..eed7019c4a27bb895a71831d1f0fa784d42324eb 100644 (file)
@@ -1214,7 +1214,7 @@ LIBS="$LIBS $PTHREAD_LIBS"
 AC_CHECK_HEADER(pthread.h, [], [AC_MSG_ERROR([
 pthread.h not found;  use --disable-thread-safety to disable thread safety])])
 
-AC_CHECK_FUNCS([strerror_r gethostbyname_r])
+AC_CHECK_FUNCS([strerror_r])
 
 # Do test here with the proper thread flags
 PGAC_FUNC_STRERROR_R_INT
@@ -1260,7 +1260,6 @@ AC_SEARCH_LIBS(shmget, cygipc)
 AC_SEARCH_LIBS(backtrace_symbols, execinfo)
 
 if test "$enable_thread_safety" = yes; then
-  AC_SEARCH_LIBS(gethostbyname_r, nsl)
   AC_SEARCH_LIBS(pthread_barrier_wait, pthread)
 fi
 
index 17c1dbd16520a1e1ad282a1ca1c2f714dd62ff11..3087883401e3156a3995cbff283cdcf70a13a016 100644 (file)
    */
 #undef HAVE_GCC__SYNC_INT64_CAS
 
-/* Define to 1 if you have the `gethostbyname_r' function. */
-#undef HAVE_GETHOSTBYNAME_R
-
 /* Define to 1 if you have the `getifaddrs' function. */
 #undef HAVE_GETIFADDRS
 
index 0b8fabc7e815b789161ddb3f4023bc4c494c9fcc..1e057db336a6cdbd4632e0a231a94fbd186d307d 100644 (file)
@@ -2229,7 +2229,7 @@ connectDBComplete(PGconn *conn)
  *             will not block.
  *      o      If you do not supply an IP address for the remote host (i.e. you
  *             supply a host name instead) then PQconnectStart will block on
- *             gethostbyname.  You will be fine if using Unix sockets (i.e. by
+ *             getaddrinfo.  You will be fine if using Unix sockets (i.e. by
  *             supplying neither a host name nor a host address).
  *      o      If your backend wants to use Kerberos authentication then you must
  *             supply both a host name and a host address, otherwise this function
index 17999d0698b0e353514caa139d8acb1b8dd29574..92722a1271139551782db32fdec5bbbd9e139187 100644 (file)
@@ -256,7 +256,6 @@ sub GenerateFiles
                HAVE_GCC__SYNC_INT32_CAS                    => undef,
                HAVE_GCC__SYNC_INT32_TAS                    => undef,
                HAVE_GCC__SYNC_INT64_CAS                    => undef,
-               HAVE_GETHOSTBYNAME_R                        => undef,
                HAVE_GETIFADDRS                             => undef,
                HAVE_GETOPT                                 => undef,
                HAVE_GETOPT_H                               => undef,