From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18336 invoked by alias); 13 Mar 2009 02:06:51 -0000 Received: (qmail 18099 invoked by uid 22791); 13 Mar 2009 02:06:50 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_102 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Mar 2009 02:06:45 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A16462C6827; Thu, 12 Mar 2009 22:06:43 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZOVQ8KzR++tN; Thu, 12 Mar 2009 22:06:43 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 4474C2C6825; Thu, 12 Mar 2009 22:06:43 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 0AAAFF5C8D; Thu, 12 Mar 2009 19:06:40 -0700 (PDT) Date: Fri, 13 Mar 2009 02:21:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Cc: Jerome Guitton Subject: [RFA] Add --with-curses configure option Message-ID: <20090313020640.GE11284@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="so9zsI5B81VjUb/o" Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-03/txt/msg00190.txt.bz2 --so9zsI5B81VjUb/o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1516 Hello, Last October, I checked in a patch that made sure that GDB would use the "minimal" termcap/curses library that it could find. This was necessary in order to align GDB with readline, thus make sure that readline and GDB use the same terminal library. This fixed a nasty issue on Tru64 were readline wanted to use libtermcap whereas gdb wanted to use ncurses. See: http://www.sourceware.org/ml/gdb-patches/2008-10/msg00071.html. One of the consequences, is that we started building GDB with libtermcap.so on some of our GNU/Linux machines, if libtermcap was found. As it turns out, it appears that most distributions are no longer providing the symbolic link between libtermcap and libcurses. This is a problem for binary distribution because customer tried to install our binary on their machine, and found that there was a missing dependency. The attached patch introduced a new --with-curses configure switch, which follows what readline already does. That way, if one configures with --with-curses, both readline and gdb will remain consistent and use a curses library. 2009-02-13 Jerome Guitton * configure.ac: Add --with-curses. * configure: Regenerated. Tested on all our supported platforms (AdaCore builds GDB with --with-curses on all GNU/Linux hosts we support, and without it on all the other ones). Any objection to checking this change in? Daniel, might be useful to CS as well, if you guys ship debuggers hosted on GNU/Linux like we do. -- Joel --so9zsI5B81VjUb/o Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="10-with-curses.diff" Content-length: 2355 diff --git a/gdb/configure.ac b/gdb/configure.ac index 3f81ff2..9b15a42 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -331,6 +331,13 @@ if test x"$enable_libunwind" = xyes; then CONFIG_SRCS="$CONFIG_SRCS libunwind-frame.c" fi +opt_curses=no +AC_ARG_WITH(curses, AC_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval) + +if test "$opt_curses" = "yes"; then + prefer_curses=yes +fi + # Profiling support. AC_ARG_ENABLE(profiling, [ --enable-profiling enable profiling of GDB], @@ -457,22 +464,32 @@ case $host_os in ;; esac +# For the TUI, we need enhanced curses functionality. +if test x"$enable_tui" = xyes; then + prefer_curses=yes +fi + +curses_found=no +if test x"$prefer_curses" = xyes; then + # FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied + # curses library because the latter might not provide all the + # functionality we need. However, this leads to problems on systems + # where the linker searches /usr/local/lib, but the compiler doesn't + # search /usr/local/include, if ncurses is installed in /usr/local. A + # default installation of ncurses on alpha*-dec-osf* will lead to such + # a situation. + AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses]) + + if test "$ac_cv_search_waddstr" != no; then + curses_found=yes + fi +fi + # Check whether we should enable the TUI, but only do so if we really # can. if test x"$enable_tui" != xno; then if test -d $srcdir/tui; then - # For the TUI, we need enhanced curses functionality. - # - # FIXME: kettenis/20040905: We prefer ncurses over the vendor-supplied - # curses library because the latter might not provide all the - # functionality we need. However, this leads to problems on systems - # where the linker searches /usr/local/lib, but the compiler doesn't - # search /usr/local/include, if ncurses is installed in /usr/local. A - # default installation of ncurses on alpha*-dec-osf* will lead to such - # a situation. - AC_SEARCH_LIBS(waddstr, [ncurses cursesX curses]) - - if test "$ac_cv_search_waddstr" != no; then + if test "$curses_found" != no; then CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)" CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)" CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)" --so9zsI5B81VjUb/o--