Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch/rfc] Build TUI when curses
@ 2004-02-10 20:10 Andrew Cagney
  2004-02-11  6:38 ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Cagney @ 2004-02-10 20:10 UTC (permalink / raw)
  To: gdb-patches

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

Hello,

This patch modifies GDB's build process so that the TUI code is built 
when curses is available.  Previously --enable-tui was also required.

With this patch:
	./gdb -i=tui
will start up the TUI interface.  That other post creates a program 
called "tui" program that starts the TUI by default.

Comments?  I'll look to also commit this round the 16th Feb.
Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 2745 bytes --]

2004-02-10  Andrew Cagney  <cagney@redhat.com>

	* configure.in: Always check for curses.  Enable TUI when curses
	is available.

Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.144
diff -u -r1.144 configure.in
--- configure.in	8 Feb 2004 17:53:08 -0000	1.144
+++ configure.in	10 Feb 2004 19:57:34 -0000
@@ -135,6 +135,17 @@
   fi
 fi
 
+# FIXME: kettenis/20030102: We seem to prefer HP curses (Hcurses) over
+# Xcurses on HP-UX; see the `-D__HP_CURSES' in the relevant host
+# Makefile fragments.  That's why we need to have `Hcurses' before
+# `curses'.  I don't see why we should use HP curses if a more
+# standard curses is available, except that according to HP's
+# documentation one needs to compile `-D_XOPEN_SOURCE_EXTENDED' on
+# HP-UX 10.10 and 10.20.
+
+AC_SEARCH_LIBS(initscr, [ncurses Hcurses curses], [],
+    [AC_MSG_ERROR([no curses library found])])
+
 # Enable TUI.
 AC_ARG_ENABLE(tui,
 [  --enable-tui            enable full-screen terminal user interface (TUI)],
@@ -143,14 +154,16 @@
       ;;
     *)
       AC_MSG_ERROR([bad value $enableval for --enable-tui]) ;;
-  esac])
+  esac],enable_tui=yes)
 if test x"$enable_tui" = xyes; then
   if test -d $srcdir/tui; then
-    CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
-    CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
-    CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
-    ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
-    need_curses=yes
+    if test "$ac_cv_search_initscr" != no; then
+      CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
+      CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
+      CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
+      CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)"
+      ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
+    fi
   fi
 fi
 
@@ -279,20 +292,7 @@
 
 # Since GDB uses Readline, we need termcap functionality, so we need
 # to find a library that provides that.  When GDB is configured with
-# --enable-tui, we need full curses functionality.
-#
-# FIXME: kettenis/20030102: We seem to prefer HP curses (Hcurses) over
-# Xcurses on HP-UX; see the `-D__HP_CURSES' in the relevant host
-# Makefile fragments.  That's why we need to have `Hcurses' before
-# `curses'.  I don't see why we should use HP curses if a more
-# standard curses is available, except that according to HP's
-# documentation one needs to compile `-D_XOPEN_SOURCE_EXTENDED' on
-# HP-UX 10.10 and 10.20.
-
-if test "$need_curses" = yes; then
-  AC_SEARCH_LIBS(initscr, [ncurses Hcurses curses], [],
-    [AC_MSG_ERROR([no curses library found])])
-fi
+# the TUI, we need full curses functionality.
 
 case $host_os in
   cygwin*)

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

* Re: [patch/rfc] Build TUI when curses
  2004-02-10 20:10 [patch/rfc] Build TUI when curses Andrew Cagney
@ 2004-02-11  6:38 ` Eli Zaretskii
  2004-02-11 14:52   ` Andrew Cagney
  2004-02-16 19:36   ` Andrew Cagney
  0 siblings, 2 replies; 9+ messages in thread
From: Eli Zaretskii @ 2004-02-11  6:38 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: gdb-patches

> Date: Tue, 10 Feb 2004 15:10:52 -0500
> From: Andrew Cagney <cagney@gnu.org>
> 
> +AC_SEARCH_LIBS(initscr, [ncurses Hcurses curses], [],

Could we please have pdcurses in this list as well?  That would
certainly make DJGPP users happy, but I believe PDCurses can be built
on Unix and other systems as well, so it is not limited to DJGPP.

> +    [AC_MSG_ERROR([no curses library found])])

Does that mean the configury will abort after this message?  If so,
I'd suggest instead to display a message to the effect that only a
command-line version will be built, and continue with building as if
they asked for --disable-tui.


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

* Re: [patch/rfc] Build TUI when curses
  2004-02-11  6:38 ` Eli Zaretskii
@ 2004-02-11 14:52   ` Andrew Cagney
  2004-02-16 19:36   ` Andrew Cagney
  1 sibling, 0 replies; 9+ messages in thread
From: Andrew Cagney @ 2004-02-11 14:52 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

> Date: Tue, 10 Feb 2004 15:10:52 -0500
>> From: Andrew Cagney <cagney@gnu.org>
>> 
>> +AC_SEARCH_LIBS(initscr, [ncurses Hcurses curses], [],
> 
> 
> Could we please have pdcurses in this list as well?  That would
> certainly make DJGPP users happy, but I believe PDCurses can be built
> on Unix and other systems as well, so it is not limited to DJGPP.

Will do.

>> +    [AC_MSG_ERROR([no curses library found])])
> 
> 
> Does that mean the configury will abort after this message?  If so,
> I'd suggest instead to display a message to the effect that only a
> command-line version will be built, and continue with building as if
> they asked for --disable-tui.

Good question/point, aborting the configure script certainly wasn't the 
intent.  It's ment to stumble on regardless but without the TUI.  I'll 
check and adjust accordingly.

Andrew



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

* Re: [patch/rfc] Build TUI when curses
  2004-02-11  6:38 ` Eli Zaretskii
  2004-02-11 14:52   ` Andrew Cagney
@ 2004-02-16 19:36   ` Andrew Cagney
  1 sibling, 0 replies; 9+ messages in thread
From: Andrew Cagney @ 2004-02-16 19:36 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: gdb-patches

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

> Date: Tue, 10 Feb 2004 15:10:52 -0500
>> From: Andrew Cagney <cagney@gnu.org>
>> 
>> +AC_SEARCH_LIBS(initscr, [ncurses Hcurses curses], [],
> 
> 
> Could we please have pdcurses in this list as well?  That would
> certainly make DJGPP users happy, but I believe PDCurses can be built
> on Unix and other systems as well, so it is not limited to DJGPP.
> 
> 
>> +    [AC_MSG_ERROR([no curses library found])])
> 
> 
> Does that mean the configury will abort after this message?  If so,
> I'd suggest instead to display a message to the effect that only a
> command-line version will be built, and continue with building as if
> they asked for --disable-tui.

Here's what I've committed (which means that gdb -i=tui) starts the tui now.

Andrew


[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 2879 bytes --]

2004-02-16  Andrew Cagney  <cagney@redhat.com>

	* configure.in: Always check for curses, including pdcurses.
	Warn, instead of error, when no curses are found.  Enable TUI when
	curses is available.
	* configure: Re-generate.

Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -r1.145 -r1.146
--- configure.in	15 Feb 2004 23:45:24 -0000	1.145
+++ configure.in	16 Feb 2004 19:33:42 -0000	1.146
@@ -135,6 +135,17 @@
   fi
 fi
 
+# FIXME: kettenis/20030102: We seem to prefer HP curses (Hcurses) over
+# Xcurses on HP-UX; see the `-D__HP_CURSES' in the relevant host
+# Makefile fragments.  That's why we need to have `Hcurses' before
+# `curses'.  I don't see why we should use HP curses if a more
+# standard curses is available, except that according to HP's
+# documentation one needs to compile `-D_XOPEN_SOURCE_EXTENDED' on
+# HP-UX 10.10 and 10.20.
+
+AC_SEARCH_LIBS(initscr, [ncurses Hcurses curses pdcurses], [],
+    [AC_MSG_WARN([no curses library found])])
+
 # Enable TUI.
 AC_ARG_ENABLE(tui,
 [  --enable-tui            enable full-screen terminal user interface (TUI)],
@@ -143,14 +154,16 @@
       ;;
     *)
       AC_MSG_ERROR([bad value $enableval for --enable-tui]) ;;
-  esac])
+  esac],enable_tui=yes)
 if test x"$enable_tui" = xyes; then
   if test -d $srcdir/tui; then
-    CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
-    CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
-    CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
-    ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
-    need_curses=yes
+    if test "$ac_cv_search_initscr" != no; then
+      CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)"
+      CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_TUI_DEPS)"
+      CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_TUI_SRCS)"
+      CONFIG_INITS="$CONFIG_INITS \$(SUBDIR_TUI_INITS)"
+      ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_TUI_CFLAGS)"
+    fi
   fi
 fi
 
@@ -279,20 +292,7 @@
 
 # Since GDB uses Readline, we need termcap functionality, so we need
 # to find a library that provides that.  When GDB is configured with
-# --enable-tui, we need full curses functionality.
-#
-# FIXME: kettenis/20030102: We seem to prefer HP curses (Hcurses) over
-# Xcurses on HP-UX; see the `-D__HP_CURSES' in the relevant host
-# Makefile fragments.  That's why we need to have `Hcurses' before
-# `curses'.  I don't see why we should use HP curses if a more
-# standard curses is available, except that according to HP's
-# documentation one needs to compile `-D_XOPEN_SOURCE_EXTENDED' on
-# HP-UX 10.10 and 10.20.
-
-if test "$need_curses" = yes; then
-  AC_SEARCH_LIBS(initscr, [ncurses Hcurses curses], [],
-    [AC_MSG_ERROR([no curses library found])])
-fi
+# the TUI, we need full curses functionality.
 
 case $host_os in
   cygwin*)

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

* Re: [patch/rfc] Build TUI when curses
  2004-02-11 15:18 Michael Elizabeth Chastain
  2004-02-11 15:43 ` Bob Rossi
@ 2004-02-11 19:26 ` Eli Zaretskii
  1 sibling, 0 replies; 9+ messages in thread
From: Eli Zaretskii @ 2004-02-11 19:26 UTC (permalink / raw)
  To: Michael Elizabeth Chastain; +Cc: cagney, gdb-patches

> Date: Wed, 11 Feb 2004 10:18:16 -0500 (EST)
> From: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
> 
> If there is no curses library, then readline won't build

That is true for Unix perhaps, but not for other systems.

> so it's okay
> for gdb to require curses as well (until someone reorganizes gdb so that
> it can be built without readline).
> 
> My two cents: it's okay to clean it up, and it's also okay to let it
> abort.  It's all good.

My take on this is that we shouldn't add constraints that some day
will need to be lifted, like if we will have an option to build an
MI-only version or something.


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

* Re: [patch/rfc] Build TUI when curses
@ 2004-02-11 15:58 Michael Elizabeth Chastain
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Elizabeth Chastain @ 2004-02-11 15:58 UTC (permalink / raw)
  To: bob, mec.gnu; +Cc: cagney, eliz, gdb-patches

mec> If there is no curses library, then readline won't build, so it's okay
mec> for gdb to require curses as well (until someone reorganizes gdb so that
mec> it can be built without readline).

rossi> Are you sure readline requires curses to build?

I stand corrected, it needs only termcap.

I have built gdb on systems without curses or termcap development
libraries installed (i686-pc-linux-gnu even!) and gdb would not link
until I brought in some version of termcap and linked against it.
I happened to use ncurses 5.3 to satisfy that requirement and that's
I'm thinking "needs curses".

Michael C


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

* Re: [patch/rfc] Build TUI when curses
  2004-02-11 15:43 ` Bob Rossi
@ 2004-02-11 15:55   ` Andrew Cagney
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Cagney @ 2004-02-11 15:55 UTC (permalink / raw)
  To: Bob Rossi, Michael Elizabeth Chastain; +Cc: eliz, gdb-patches

> On Wed, Feb 11, 2004 at 10:18:16AM -0500, Michael Elizabeth Chastain wrote:
> 
>> If there is no curses library, then readline won't build, so it's okay
>> for gdb to require curses as well (until someone reorganizes gdb so that
>> it can be built without readline).
> 
> 
> Are you sure readline requires curses to build?
> 
> This is in readline's ./configure --help
> Optional Packages:
> --with-curses           use the curses library instead of the termcap
>                           library
> 
> Also, this is from readline's INSTALL file,
> 
> `--with-curses'
>     This tells readline that it can find the termcap library functions
>     (tgetent, et al.) in the curses library, rather than a separate
>     termcap library.  Readline uses the termcap functions, but does not
>     link with the termcap or curses library itself, allowing applications
>     which link with readline the to choose an appropriate library.
>     This option tells readline to link the example programs with the
>     curses library rather than libtermcap.

That matches my reading of GDB's configure.in (look for "termcap").

Andrew



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

* Re: [patch/rfc] Build TUI when curses
  2004-02-11 15:18 Michael Elizabeth Chastain
@ 2004-02-11 15:43 ` Bob Rossi
  2004-02-11 15:55   ` Andrew Cagney
  2004-02-11 19:26 ` Eli Zaretskii
  1 sibling, 1 reply; 9+ messages in thread
From: Bob Rossi @ 2004-02-11 15:43 UTC (permalink / raw)
  To: Michael Elizabeth Chastain; +Cc: cagney, eliz, gdb-patches

On Wed, Feb 11, 2004 at 10:18:16AM -0500, Michael Elizabeth Chastain wrote:
> If there is no curses library, then readline won't build, so it's okay
> for gdb to require curses as well (until someone reorganizes gdb so that
> it can be built without readline).

Are you sure readline requires curses to build?

This is in readline's ./configure --help
Optional Packages:
--with-curses           use the curses library instead of the termcap
                          library

Also, this is from readline's INSTALL file,

`--with-curses'
    This tells readline that it can find the termcap library functions
    (tgetent, et al.) in the curses library, rather than a separate
    termcap library.  Readline uses the termcap functions, but does not
    link with the termcap or curses library itself, allowing applications
    which link with readline the to choose an appropriate library.
    This option tells readline to link the example programs with the
    curses library rather than libtermcap.

Bob Rossi


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

* Re: [patch/rfc] Build TUI when curses
@ 2004-02-11 15:18 Michael Elizabeth Chastain
  2004-02-11 15:43 ` Bob Rossi
  2004-02-11 19:26 ` Eli Zaretskii
  0 siblings, 2 replies; 9+ messages in thread
From: Michael Elizabeth Chastain @ 2004-02-11 15:18 UTC (permalink / raw)
  To: cagney, eliz; +Cc: gdb-patches

If there is no curses library, then readline won't build, so it's okay
for gdb to require curses as well (until someone reorganizes gdb so that
it can be built without readline).

My two cents: it's okay to clean it up, and it's also okay to let it
abort.  It's all good.

Michael C


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

end of thread, other threads:[~2004-02-16 19:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-10 20:10 [patch/rfc] Build TUI when curses Andrew Cagney
2004-02-11  6:38 ` Eli Zaretskii
2004-02-11 14:52   ` Andrew Cagney
2004-02-16 19:36   ` Andrew Cagney
2004-02-11 15:18 Michael Elizabeth Chastain
2004-02-11 15:43 ` Bob Rossi
2004-02-11 15:55   ` Andrew Cagney
2004-02-11 19:26 ` Eli Zaretskii
2004-02-11 15:58 Michael Elizabeth Chastain

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