Kaydet (Commit) 980b99b5 authored tarafından Gregory P. Smith's avatar Gregory P. Smith

- Issue #1204: The configure script now tests for additional libraries

  that may be required when linking against readline.  This fixes issues
  with x86_64 builds on some platforms (at least a few Linux flavors as
  well as OpenBSD/amd64).
üst b7a841ca
...@@ -48,6 +48,10 @@ Core and Builtins ...@@ -48,6 +48,10 @@ Core and Builtins
- Issue #3678: Correctly pass LDFLAGS and LDLAST to the linker on shared - Issue #3678: Correctly pass LDFLAGS and LDLAST to the linker on shared
library targets in the Makefile. library targets in the Makefile.
- Issue #1204: The configure script now tests for additional libraries
that may be required when linking against readline. This fixes issues
with x86_64 builds on some platforms (a few Linux flavors and OpenBSD).
C-API C-API
----- -----
......
...@@ -251,14 +251,12 @@ case $ac_sys_system/$ac_sys_release in ...@@ -251,14 +251,12 @@ case $ac_sys_system/$ac_sys_release in
# On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined, # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
# even though select is a POSIX function. Reported by J. Ribbens. # even though select is a POSIX function. Reported by J. Ribbens.
# Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish. # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
OpenBSD*) OpenBSD/2.* | OpenBSD/3.@<:@0123456789@:>@ | OpenBSD/4.@<:@0123@:>@)
define_xopen_source=no define_xopen_source=no
# OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
# also defined. This can be overridden by defining _BSD_SOURCE # also defined. This can be overridden by defining _BSD_SOURCE
# As this has a different meaning on Linux, only define it on OpenBSD # As this has a different meaning on Linux, only define it on OpenBSD
AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features]) AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features])
# OpenBSD's readline library needs the libcurses
READLINE_LIBS="-lcurses"
;; ;;
# Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of
# _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by # _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by
...@@ -3326,10 +3324,34 @@ fi ...@@ -3326,10 +3324,34 @@ fi
# check where readline lives # check where readline lives
# save the value of LIBS so we don't actually link Python with readline # save the value of LIBS so we don't actually link Python with readline
LIBS_no_readline=$LIBS LIBS_no_readline=$LIBS
AC_CHECK_LIB(readline, readline, , ,$READLINE_LIBS)
if test "$ac_cv_have_readline_readline" = no # On some systems we need to link readline to a termcap compatible
then # library. NOTE: Keep the precedence of listed libraries synchronised
AC_CHECK_LIB(termcap, readline) # with setup.py.
py_cv_lib_readline=no
AC_MSG_CHECKING([how to link readline libs])
for py_libtermcap in "" ncursesw ncurses curses termcap; do
if test -z "$py_libtermcap"; then
READLINE_LIBS="-lreadline"
else
READLINE_LIBS="-lreadline -l$py_libtermcap"
fi
LIBS="$READLINE_LIBS $LIBS_no_readline"
AC_LINK_IFELSE(
[AC_LANG_CALL([],[readline])],
[py_cv_lib_readline=yes])
if test $py_cv_lib_readline = yes; then
break
fi
done
# Uncomment this line if you want to use READINE_LIBS in Makefile or scripts
#AC_SUBST([READLINE_LIBS])
if test $py_cv_lib_readline = !yes; then
AC_MSG_RESULT([none])
else
AC_MSG_RESULT([$READLINE_LIBS])
AC_DEFINE(HAVE_LIBREADLINE, 1,
[Define if you have the readline library (-lreadline).])
fi fi
# check for readline 2.1 # check for readline 2.1
......
...@@ -366,9 +366,6 @@ ...@@ -366,9 +366,6 @@
/* Define to 1 if you have the `resolv' library (-lresolv). */ /* Define to 1 if you have the `resolv' library (-lresolv). */
#undef HAVE_LIBRESOLV #undef HAVE_LIBRESOLV
/* Define to 1 if you have the `termcap' library (-ltermcap). */
#undef HAVE_LIBTERMCAP
/* Define to 1 if you have the <libutil.h> header file. */ /* Define to 1 if you have the <libutil.h> header file. */
#undef HAVE_LIBUTIL_H #undef HAVE_LIBUTIL_H
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment