Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5298eb4

Browse files
committed
Fix the readline test to find dependent libraries on NetBSD and OpenBSD.
Not pretty, but it doesn't look like the OS will get fixed sometime soon.
1 parent f5944af commit 5298eb4

File tree

2 files changed

+348
-322
lines changed

2 files changed

+348
-322
lines changed

config/programs.m4

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Header: /cvsroot/pgsql/config/programs.m4,v 1.6 2001/08/06 15:46:44 petere Exp $
1+
# $Header: /cvsroot/pgsql/config/programs.m4,v 1.7 2001/08/28 14:59:11 petere Exp $
22

33

44
# PGAC_PATH_FLEX
@@ -77,15 +77,28 @@ AC_SUBST(FLEXFLAGS)
7777
# Add the required flags to LIBS, define HAVE_LIBREADLINE.
7878

7979
AC_DEFUN([PGAC_CHECK_READLINE],
80-
[AC_MSG_CHECKING([for readline])
80+
[AC_REQUIRE([AC_CANONICAL_HOST])
81+
AC_MSG_CHECKING([for readline])
8182
8283
AC_CACHE_VAL([pgac_cv_check_readline],
8384
[pgac_cv_check_readline=no
8485
for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
8586
for pgac_rllib in -lreadline -ledit ; do
8687
pgac_save_LIBS=$LIBS
8788
LIBS="${pgac_rllib}${pgac_lib} $LIBS"
88-
AC_TRY_LINK_FUNC([readline], [pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"; break 2])
89+
AC_TRY_LINK_FUNC([readline], [[
90+
# NetBSD and OpenBSD have a broken linker that does not
91+
# recognize dependent libraries
92+
case $host_os in netbsd* | openbsd* )
93+
case $pgac_lib in
94+
*curses*) ;;
95+
*) pgac_lib=" -lcurses" ;;
96+
esac
97+
esac
98+
99+
pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
100+
break 2
101+
]])
89102
LIBS=$pgac_save_LIBS
90103
done
91104
done

0 commit comments

Comments
 (0)