public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFA/commit] Allow disabling of gdbserver build (--enable-gdbserver=yes/no/auto).
@ 2010-08-19 12:55 Joel Brobecker
  2010-09-22 18:25 ` Joel Brobecker
  0 siblings, 1 reply; 2+ messages in thread
From: Joel Brobecker @ 2010-08-19 12:55 UTC (permalink / raw)
  To: gdb-patches; +Cc: Joel Brobecker

Hello,

This patch adds a new --enable-gdbserver=yes/no/auto command-line switch
in gdb/configure.  The primary purpose is to allow a user to disable the
build & install of gdbserver when not desired.  It also allows the user
to request gdbserver in which case the configure script will abort if
automatic building of gdbserver is not supported for that configuration.

The default keeps things as is: We automatically build gdbserver if
building for a native configuration and if gdbserver is supported for
that configuration.

gdb/ChangeLog:

        * configure.ac: Add support for --enable-gdbserver.
        * configure: Regenerate.

This was tested on x86_64-linux with the following combinations:
  - ./configure
  - ./configure --enable-gdbserver
  - ./configure --enable-gdbserver=toto [error]
  - ./configure --disable-gdbserver
  - ./configure --target=erc32-elf
  - ./configure --enable-gdbserver --target=erc32-elf [error]
  - ./configure --disable-gdbserver --target=erc32-elf

Any objection to this change? I'd like to commit sometime in
the next few days if not.

---
 gdb/configure    |   26 ++++++++++++++++++++++++--
 gdb/configure.ac |   20 ++++++++++++++++++--
 2 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/gdb/configure b/gdb/configure
index 5563bae..a634ca0 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -975,6 +975,7 @@ with_tk
 with_x
 enable_sim
 enable_multi_ice
+enable_gdbserver
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1635,6 +1636,8 @@ Optional Features:
                           gcc is used
   --enable-sim            link gdb with simulator
   --enable-multi-ice      build the multi-ice-gdb-server
+  --enable-gdbserver      automatically build gdbserver (yes/no/auto, default
+                          is auto)
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -15816,8 +15819,20 @@ if test "x$enable_multi_ice" = xyes; then
 
 fi
 
-# We only build gdbserver automatically in a native configuration.
-if test "$gdb_native" = "yes"; then
+# Check whether --enable-gdbserver was given.
+if test "${enable_gdbserver+set}" = set; then :
+  enableval=$enable_gdbserver; case "${enableval}" in
+  yes| no|auto) ;;
+  *) as_fn_error "bad value ${enableval} for --enable-gdbserver option" "$LINENO" 5 ;;
+esac
+else
+  enable_gdbserver=auto
+fi
+
+
+# We only build gdbserver automatically in a native configuration, and
+# only if the user did not explicitly disable its build.
+if test "$gdb_native" = "yes" -a "$enable_gdbserver" != "no"; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gdbserver is supported on this host" >&5
 $as_echo_n "checking whether gdbserver is supported on this host... " >&6; }
   if test "x$build_gdbserver" = xyes; then
@@ -15825,12 +15840,19 @@ $as_echo_n "checking whether gdbserver is supported on this host... " >&6; }
 $as_echo "yes" >&6; }
     subdirs="$subdirs gdbserver"
 
+    gdbserver_build_enabled=yes
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
   fi
 fi
 
+# If the user explicitly request the gdbserver to be built, verify that
+# we were in fact able to enable it.
+if test "$enable_gdbserver" = "yes" -a "$gdbserver_build_enabled" != "yes"; then
+  as_fn_error "Automatic gdbserver build is not supported for this configuration" "$LINENO" 5
+fi
+
 # If nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link
 # to an empty version.
 
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 4b779aa..0ed5645 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -2085,17 +2085,33 @@ if test "x$enable_multi_ice" = xyes; then
    AC_CONFIG_SUBDIRS(multi-ice)
 fi
 
-# We only build gdbserver automatically in a native configuration. 
-if test "$gdb_native" = "yes"; then
+AC_ARG_ENABLE(gdbserver,
+AS_HELP_STRING([--enable-gdbserver],
+               [automatically build gdbserver (yes/no/auto, default is auto)]),
+[case "${enableval}" in
+  yes| no|auto) ;;
+  *) AC_MSG_ERROR(bad value ${enableval} for --enable-gdbserver option) ;;
+esac],[enable_gdbserver=auto])
+
+# We only build gdbserver automatically in a native configuration, and
+# only if the user did not explicitly disable its build.
+if test "$gdb_native" = "yes" -a "$enable_gdbserver" != "no"; then
   AC_MSG_CHECKING(whether gdbserver is supported on this host)
   if test "x$build_gdbserver" = xyes; then
     AC_MSG_RESULT(yes)
     AC_CONFIG_SUBDIRS(gdbserver)
+    gdbserver_build_enabled=yes
   else
     AC_MSG_RESULT(no)
   fi
 fi
 
+# If the user explicitly request the gdbserver to be built, verify that
+# we were in fact able to enable it.
+if test "$enable_gdbserver" = "yes" -a "$gdbserver_build_enabled" != "yes"; then
+  AC_MSG_ERROR(Automatic gdbserver build is not supported for this configuration)
+fi
+
 # If nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link
 # to an empty version.
 
-- 
1.7.1

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

* Re: [RFA/commit] Allow disabling of gdbserver build (--enable-gdbserver=yes/no/auto).
  2010-08-19 12:55 [RFA/commit] Allow disabling of gdbserver build (--enable-gdbserver=yes/no/auto) Joel Brobecker
@ 2010-09-22 18:25 ` Joel Brobecker
  0 siblings, 0 replies; 2+ messages in thread
From: Joel Brobecker @ 2010-09-22 18:25 UTC (permalink / raw)
  To: gdb-patches

On Thu, Aug 19, 2010 at 02:55:45PM +0200, Joel Brobecker wrote:
> gdb/ChangeLog:
> 
>         * configure.ac: Add support for --enable-gdbserver.
>         * configure: Regenerate.

No objection after a month, so I checked this one in.

-- 
Joel

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

end of thread, other threads:[~2010-09-22 16:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-19 12:55 [RFA/commit] Allow disabling of gdbserver build (--enable-gdbserver=yes/no/auto) Joel Brobecker
2010-09-22 18:25 ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).