Hack to work around broken linker on older NetBSD/OpenBSD/Irix assumed
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 2 Dec 2004 20:04:20 +0000 (20:04 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 2 Dec 2004 20:04:20 +0000 (20:04 +0000)
that readline must depend on libcurses, but it seems more recent ones
use libtermcap instead.  Allow that case.

config/programs.m4
configure

index 9182a0972beac6ef7594b698855637e54adfdfc0..ad3e4a43b2fd318be49dbcd2fbdcb4560334bd9f 100644 (file)
@@ -87,13 +87,14 @@ for pgac_rllib in -lreadline -ledit ; do
   for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
     LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
     AC_TRY_LINK_FUNC([readline], [[
-      # NetBSD, OpenBSD, and Irix have a broken linker that does not
-      # recognize dependent libraries
-      case $host_os in netbsd* | openbsd* | irix*)
-        case $pgac_lib in
-          *curses*) ;;
-          *) pgac_lib=" -lcurses" ;;
-        esac
+      # Older NetBSD, OpenBSD, and Irix have a broken linker that does not
+      # recognize dependent libraries; assume curses is needed if we didn't
+      # find any dependency.
+      case $host_os in
+        netbsd* | openbsd* | irix*)
+          if test x"$pgac_lib" = x"" ; then
+            pgac_lib=" -lcurses"
+          fi ;;
       esac
 
       pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
index 378cd6129105a2335cfafe2fadd8fcef281734e0..3adda4f71e2fe71d1ef52b4defc7f6dfd06d73c2 100755 (executable)
--- a/configure
+++ b/configure
@@ -5996,13 +5996,14 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
 
-      # NetBSD, OpenBSD, and Irix have a broken linker that does not
-      # recognize dependent libraries
-      case $host_os in netbsd* | openbsd* | irix*)
-        case $pgac_lib in
-          *curses*) ;;
-          *) pgac_lib=" -lcurses" ;;
-        esac
+      # Older NetBSD, OpenBSD, and Irix have a broken linker that does not
+      # recognize dependent libraries; assume curses is needed if we didn't
+      # find any dependency.
+      case $host_os in
+        netbsd* | openbsd* | irix*)
+          if test x"$pgac_lib" = x"" ; then
+            pgac_lib=" -lcurses"
+          fi ;;
       esac
 
       pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"