| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Python
Revision: 66283
Author: gregory.p.smith
Date: 07 Sep 2008 01:15:18
Changes:- 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).
| ... | ...@@ -251,14 +251,12 @@ | |
| 251 | 251 | # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined, |
| 252 | 252 | # even though select is a POSIX function. Reported by J. Ribbens. |
| 253 | 253 | # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish. |
| 254 | OpenBSD*) | |
| 254 | OpenBSD/2.* | OpenBSD/3.@<:@0123456789@:>@ | OpenBSD/4.@<:@0123@:>@) | |
| 255 | 255 | define_xopen_source=no |
| 256 | 256 | # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is |
| 257 | 257 | # also defined. This can be overridden by defining _BSD_SOURCE |
| 258 | 258 | # As this has a different meaning on Linux, only define it on OpenBSD |
| 259 | 259 | AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features]) |
| 260 | # OpenBSD's readline library needs the libcurses | |
| 261 | READLINE_LIBS="-lcurses" | |
| 262 | 260 | ;; |
| 263 | 261 | # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of |
| 264 | 262 | # _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by |
| ... | ...@@ -3326,10 +3324,34 @@ | |
| 3326 | 3324 | # check where readline lives |
| 3327 | 3325 | # save the value of LIBS so we don't actually link Python with readline |
| 3328 | 3326 | LIBS_no_readline=$LIBS |
| 3329 | AC_CHECK_LIB(readline, readline, , ,$READLINE_LIBS) | |
| 3330 | if test "$ac_cv_have_readline_readline" = no | |
| 3331 | then | |
| 3332 | AC_CHECK_LIB(termcap, readline) | |
| 3327 | ||
| 3328 | # On some systems we need to link readline to a termcap compatible | |
| 3329 | # library. NOTE: Keep the precedence of listed libraries synchronised | |
| 3330 | # with setup.py. | |
| 3331 | py_cv_lib_readline=no | |
| 3332 | AC_MSG_CHECKING([how to link readline libs]) | |
| 3333 | for py_libtermcap in "" ncursesw ncurses curses termcap; do | |
| 3334 | if test -z "$py_libtermcap"; then | |
| 3335 | READLINE_LIBS="-lreadline" | |
| 3336 | else | |
| 3337 | READLINE_LIBS="-lreadline -l$py_libtermcap" | |
| 3338 | fi | |
| 3339 | LIBS="$READLINE_LIBS $LIBS_no_readline" | |
| 3340 | AC_LINK_IFELSE( | |
| 3341 | [AC_LANG_CALL([],[readline])], | |
| 3342 | [py_cv_lib_readline=yes]) | |
| 3343 | if test $py_cv_lib_readline = yes; then | |
| 3344 | break | |
| 3345 | fi | |
| 3346 | done | |
| 3347 | # Uncomment this line if you want to use READINE_LIBS in Makefile or scripts | |
| 3348 | #AC_SUBST([READLINE_LIBS]) | |
| 3349 | if test $py_cv_lib_readline = !yes; then | |
| 3350 | AC_MSG_RESULT([none]) | |
| 3351 | else | |
| 3352 | AC_MSG_RESULT([$READLINE_LIBS]) | |
| 3353 | AC_DEFINE(HAVE_LIBREADLINE, 1, | |
| 3354 | [Define if you have the readline library (-lreadline).]) | |
| 3333 | 3355 | fi |
| 3334 | 3356 | |
| 3335 | 3357 | # check for readline 2.1 |
| ... | ...@@ -48,6 +48,10 @@ | |
| 48 | 48 | - Issue #3678: Correctly pass LDFLAGS and LDLAST to the linker on shared |
| 49 | 49 | library targets in the Makefile. |
| 50 | 50 | |
| 51 | - Issue #1204: The configure script now tests for additional libraries | |
| 52 | that may be required when linking against readline. This fixes issues | |
| 53 | with x86_64 builds on some platforms (a few Linux flavors and OpenBSD). | |
| 54 | ||
| 51 | 55 | C-API |
| 52 | 56 | ----- |
| 53 | 57 |
| ... | ...@@ -366,9 +366,6 @@ | |
| 366 | 366 | /* Define to 1 if you have the `resolv' library (-lresolv). */ |
| 367 | 367 | #undef HAVE_LIBRESOLV |
| 368 | 368 | |
| 369 | /* Define to 1 if you have the `termcap' library (-ltermcap). */ | |
| 370 | #undef HAVE_LIBTERMCAP | |
| 371 | ||
| 372 | 369 | /* Define to 1 if you have the <libutil.h> header file. */ |
| 373 | 370 | #undef HAVE_LIBUTIL_H |
| 374 | 371 |