From bba11cdd97cffc72207265f21eed30fad2813d5d Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Wed, 15 Feb 2006 17:23:10 +0000
Subject: [PATCH] Since we only use libld on AIX, don't include it in LIBS on
 any other platforms (it does exist on HPUX, for one).  We could probably even
 make this a test for specific AIX versions, but I don't know which ones need
 it.

---
 configure    | 7 ++++++-
 configure.in | 9 +++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 30132dbbf1f..1ec47c47d8d 100755
--- a/configure
+++ b/configure
@@ -5377,7 +5377,10 @@ if test "$ac_cv_search_shl_load" != no; then
 
 fi
 
-echo "$as_me:$LINENO: checking for library containing ldopen" >&5
+# We only use libld in port/dynloader/aix.c
+case $host_os in
+     aix*)
+	echo "$as_me:$LINENO: checking for library containing ldopen" >&5
 echo $ECHO_N "checking for library containing ldopen... $ECHO_C" >&6
 if test "${ac_cv_search_ldopen+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5503,6 +5506,8 @@ if test "$ac_cv_search_ldopen" != no; then
 
 fi
 
+	;;
+esac
 echo "$as_me:$LINENO: checking for library containing getopt_long" >&5
 echo $ECHO_N "checking for library containing getopt_long... $ECHO_C" >&6
 if test "${ac_cv_search_getopt_long+set}" = set; then
diff --git a/configure.in b/configure.in
index b867b95efef..9322de8cddc 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.448 2006/02/10 11:35:47 petere Exp $
+dnl $PostgreSQL: pgsql/configure.in,v 1.449 2006/02/15 17:23:10 tgl Exp $
 dnl
 dnl Developers, please strive to achieve this order:
 dnl
@@ -595,7 +595,12 @@ AC_SEARCH_LIBS(pow, m)
 AC_SEARCH_LIBS(dlopen, dl)
 AC_SEARCH_LIBS(socket, [socket wsock32])
 AC_SEARCH_LIBS(shl_load, dld)
-AC_SEARCH_LIBS(ldopen, ld)
+# We only use libld in port/dynloader/aix.c
+case $host_os in
+     aix*)
+	AC_SEARCH_LIBS(ldopen, ld)
+	;;
+esac
 AC_SEARCH_LIBS(getopt_long, [getopt gnugetopt])
 AC_SEARCH_LIBS(crypt, crypt)
 # Solaris:
-- 
GitLab