Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Add --with-curses configure option
@ 2009-03-13  2:21 Joel Brobecker
  2009-03-24  1:33 ` Joel Brobecker
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2009-03-13  2:21 UTC (permalink / raw)
  To: gdb-patches; +Cc: Jerome Guitton

[-- Attachment #1: Type: text/plain, Size: 1516 bytes --]

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  <guitton@adacore.com>

        * 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

[-- Attachment #2: 10-with-curses.diff --]
[-- Type: text/x-diff, Size: 2355 bytes --]

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)"

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] Add --with-curses configure option
  2009-03-13  2:21 [RFA] Add --with-curses configure option Joel Brobecker
@ 2009-03-24  1:33 ` Joel Brobecker
  2009-03-24 15:40   ` Jan Kratochvil
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2009-03-24  1:33 UTC (permalink / raw)
  To: gdb-patches; +Cc: Jerome Guitton

> 2009-02-13  Jerome Guitton  <guitton@adacore.com>
> 
>         * configure.ac: Add --with-curses.
>         * configure: Regenerated.

There were no objections, so I checked this patch in after reverifying it
by buiding GDB on x86-linux before the patch (linked to libtermcap.so),
after the patch but without --with-curses (linked to libtermcap.so) and
after the patch using --with-curses (linked to libtermcap.so).

I've also run the regression testsuite, but this time on x86_64-linux
(faster).

I'm trying to decide whether this is worth a NEWS entry or not, and
I am currently leaning towards not. The NEWS file for the upcoming
7.0 release is quite substantial at this point, and I don't want to
dilute it with something that's relatively minor. I checked the
manual too on the section about configuring GDB, and it only describes
the most important command line switches.

So I think it makes sense to not document this feature further.
``configure --help'' shows:

|  --with-curses           use the curses library instead of the termcap
|                          library

-- 
Joel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] Add --with-curses configure option
  2009-03-24  1:33 ` Joel Brobecker
@ 2009-03-24 15:40   ` Jan Kratochvil
  2009-03-24 16:13     ` Joel Brobecker
  2009-03-24 16:41     ` Jan Kratochvil
  0 siblings, 2 replies; 7+ messages in thread
From: Jan Kratochvil @ 2009-03-24 15:40 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches, Jerome Guitton

On Tue, 24 Mar 2009 02:27:42 +0100, Joel Brobecker wrote:
> > 2009-02-13  Jerome Guitton  <guitton@adacore.com>
> > 
> >         * configure.ac: Add --with-curses.
> >         * configure: Regenerated.
> 
> There were no objections, so I checked this patch in after reverifying it
> by buiding GDB on x86-linux before the patch (linked to libtermcap.so),

All the tests now fail on Fedora 10 x86_64 due to an unexpected output there:

GNU gdb (GDB) 6.8.50.20090324-cvs
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
^[[?1034h(gdb) ERROR: GDB never initialized.

ldd output changed this way:
 	linux-vdso.so.1 =>
-	libncurses.so.5 => /lib64/libncurses.so.5
+	libtinfo.so.5 => /lib64/libtinfo.so.5
 	libz.so.1 => /lib64/libz.so.1
 	libm.so.6 => /lib64/libm.so.6
 	libpython2.5.so.1.0 => /usr/lib64/libpython2.5.so.1.0
 	libexpat.so.1 => /lib64/libexpat.so.1
 	libdl.so.2 => /lib64/libdl.so.2
 	libc.so.6 => /lib64/libc.so.6
-	libtinfo.so.5 => /lib64/libtinfo.so.5
 	libpthread.so.0 => /lib64/libpthread.so.0
 	libutil.so.1 => /lib64/libutil.so.1
 	/lib64/ld-linux-x86-64.so.2

Sure it may be also an ncurses bug.


Regards,
Jan


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] Add --with-curses configure option
  2009-03-24 15:40   ` Jan Kratochvil
@ 2009-03-24 16:13     ` Joel Brobecker
  2009-03-24 16:41     ` Jan Kratochvil
  1 sibling, 0 replies; 7+ messages in thread
From: Joel Brobecker @ 2009-03-24 16:13 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches, Jerome Guitton

> All the tests now fail on Fedora 10 x86_64 due to an unexpected output there:

Jan and I are looking into this. If it takes too long to fix (say by
tonight), I'll revert the change.

-- 
Joel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] Add --with-curses configure option
  2009-03-24 15:40   ` Jan Kratochvil
  2009-03-24 16:13     ` Joel Brobecker
@ 2009-03-24 16:41     ` Jan Kratochvil
  2009-03-24 16:57       ` Joel Brobecker
  1 sibling, 1 reply; 7+ messages in thread
From: Jan Kratochvil @ 2009-03-24 16:41 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches, Jerome Guitton

On Tue, 24 Mar 2009 11:32:20 +0100, Jan Kratochvil wrote:
> On Tue, 24 Mar 2009 02:27:42 +0100, Joel Brobecker wrote:
> > > 2009-02-13  Jerome Guitton  <guitton@adacore.com>
> > > 
> > >         * configure.ac: Add --with-curses.
> > >         * configure: Regenerated.
> > 
> > There were no objections, so I checked this patch in after reverifying it
> > by buiding GDB on x86-linux before the patch (linked to libtermcap.so),
> 
> All the tests now fail on Fedora 10 x86_64 due to an unexpected output there:

OK to check in?  IMO more a typo-like fix, the condition should match
a similiar $enable_tui below it.


Thanks,
Jan


2009-03-24  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* configure.ac: Enable $PREFER_CURSES even with default $ENABLE_TUI.
	* configure: Regenerated.

--- gdb/configure.ac	24 Mar 2009 01:19:26 -0000	1.88
+++ gdb/configure.ac	24 Mar 2009 16:09:12 -0000
@@ -467,7 +467,7 @@ case $host_os in
 esac
 
 # For the TUI, we need enhanced curses functionality.
-if test x"$enable_tui" = xyes; then
+if test x"$enable_tui" != xno; then
   prefer_curses=yes
 fi
 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] Add --with-curses configure option
  2009-03-24 16:41     ` Jan Kratochvil
@ 2009-03-24 16:57       ` Joel Brobecker
  2009-03-24 17:04         ` Jan Kratochvil
  0 siblings, 1 reply; 7+ messages in thread
From: Joel Brobecker @ 2009-03-24 16:57 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches, Jerome Guitton

> 2009-03-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	* configure.ac: Enable $PREFER_CURSES even with default $ENABLE_TUI.
> 	* configure: Regenerated.

Ah, yes, of course! Thanks for fixing this.

-- 
Joel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFA] Add --with-curses configure option
  2009-03-24 16:57       ` Joel Brobecker
@ 2009-03-24 17:04         ` Jan Kratochvil
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Kratochvil @ 2009-03-24 17:04 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches, Jerome Guitton

On Tue, 24 Mar 2009 17:41:27 +0100, Joel Brobecker wrote:
> > 2009-03-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
> > 
> > 	* configure.ac: Enable $PREFER_CURSES even with default $ENABLE_TUI.
> > 	* configure: Regenerated.
> 
> Ah, yes, of course! Thanks for fixing this.

Checked-in in its original form posted here.
http://sourceware.org/ml/gdb-cvs/2009-03/msg00180.html


Thanks,
Jan


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-03-24 16:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-13  2:21 [RFA] Add --with-curses configure option Joel Brobecker
2009-03-24  1:33 ` Joel Brobecker
2009-03-24 15:40   ` Jan Kratochvil
2009-03-24 16:13     ` Joel Brobecker
2009-03-24 16:41     ` Jan Kratochvil
2009-03-24 16:57       ` Joel Brobecker
2009-03-24 17:04         ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox