summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2006-06-21 13:57:21 +0000
committerDaniel Jacobowitz <dan@debian.org>2006-06-21 13:57:21 +0000
commit134efc9aa4852768acccde71b80d74b85999b4ab (patch)
tree89a236b0b1ebeec21bbaad203567ce3d32142c20 /gdb
parent1a3120d7eac289a93e3e0a3f476661186b816f65 (diff)
downloadgdb-134efc9aa4852768acccde71b80d74b85999b4ab.tar.gz
gdb/
* NEWS: Mention qSupported. * remote.c (struct remote_state): Add explicit_packet_size. (get_remote_packet_size): Check explicit_packet_size. (get_memory_packet_size): Likewise. (PACKET_qSupported): New enum value. (struct protocol_feature, remote_supported_packet) (remote_packet_size, remote_protocol_features) (remote_query_supported): New. (remote_open_1): Reset explicit_packet_size. Call remote_query_supported. (_initialize_remote): Register qSupported. gdb/doc/ * gdb.texinfo (Remote configuration): Document set / show remote supported-packets. (General Query Packets): Document qSupported packet. gdb/gdbserver/ * server.c (handle_query): Handle qSupported.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog14
-rw-r--r--gdb/NEWS9
-rw-r--r--gdb/doc/ChangeLog6
-rw-r--r--gdb/doc/gdb.texinfo134
-rw-r--r--gdb/gdbserver/ChangeLog4
-rw-r--r--gdb/gdbserver/server.c8
-rw-r--r--gdb/remote.c249
-rw-r--r--gdb/testsuite/Makefile.in4
-rw-r--r--gdb/testsuite/aclocal.m4584
-rwxr-xr-xgdb/testsuite/configure63
-rw-r--r--gdb/testsuite/configure.ac2
-rw-r--r--gdb/testsuite/lib/gdb.exp3
12 files changed, 472 insertions, 608 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 000705858d7..92116e75044 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,17 @@
+2006-06-21 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * NEWS: Mention qSupported.
+ * remote.c (struct remote_state): Add explicit_packet_size.
+ (get_remote_packet_size): Check explicit_packet_size.
+ (get_memory_packet_size): Likewise.
+ (PACKET_qSupported): New enum value.
+ (struct protocol_feature, remote_supported_packet)
+ (remote_packet_size, remote_protocol_features)
+ (remote_query_supported): New.
+ (remote_open_1): Reset explicit_packet_size. Call
+ remote_query_supported.
+ (_initialize_remote): Register qSupported.
+
2006-06-21 Andrew Stubbs <andrew.stubbs@st.com>
* cli/cli-script.c (realloc_body_list): Zero new parts of body_list.
diff --git a/gdb/NEWS b/gdb/NEWS
index f3b26303427..01fddf1227b 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -7,6 +7,15 @@
The ARM Demon monitor support (RDP protocol, "target rdp").
+* New remote packets
+
+qSupported:
+ Tell a stub about GDB client features, and request remote target features.
+ The first feature implemented is PacketSize, which allows the target to
+ specify the size of packets it can handle - to minimize the number of
+ packets required and improve performance when connected to a remote
+ target.
+
*** Changes in GDB 6.5
* New targets
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index a3df08ee32f..26b72967d78 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,9 @@
+2006-06-21 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * gdb.texinfo (Remote configuration): Document set / show
+ remote supported-packets.
+ (General Query Packets): Document qSupported packet.
+
2006-06-10 Sandra Loosemore <sandra@codesourcery.com>
* gdb.texinfo (File-I/O overview): Copy edit for grammar, spelling,
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 6935d82c38c..21267f8779a 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -12782,6 +12782,17 @@ packet.
@item show remote get-thread-local-storage-address
@kindex show remote get-thread-local-storage-address
Show the current setting of @samp{qGetTLSAddr} packet usage.
+
+@item set remote supported-packets
+@kindex set remote supported-packets
+@cindex query supported packets of remote targets
+This command enables or disables the use of the @samp{qSupported}
+request packet. @xref{General Query Packets, qSupported}, for more
+details about this packet. The default is to use @samp{qSupported}.
+
+@item show remote supported-packets
+@kindex show remote supported-packets
+Show the current setting of @samp{qSupported} packet usage.
@end table
@node remote stub
@@ -23623,6 +23634,129 @@ command by a @samp{,}, not a @samp{:}, contrary to the naming
conventions above. Please don't use this packet as a model for new
packets.)
+@item qSupported @r{[}:@var{gdbfeature} @r{[};@var{gdbfeature}@r{]}@dots{} @r{]}
+@cindex supported packets, remote query
+@cindex features of the remote protocol
+@cindex @samp{qSupported} packet
+Tell the remote stub about features supported by @value{GDBN}, and
+query the stub for features it supports. This packet allows
+@value{GDBN} and the remote stub to take advantage of each others'
+features. @samp{qSupported} also consolidates multiple feature probes
+at startup, to improve @value{GDBN} performance---a single larger
+packet performs better than multiple smaller probe packets on
+high-latency links. Some features may enable behavior which must not
+be on by default, e.g.@: because it would confuse older clients or
+stubs. Other features may describe packets which could be
+automatically probed for, but are not. These features must be
+reported before @value{GDBN} will use them. This ``default
+unsupported'' behavior is not appropriate for all packets, but it
+helps to keep the initial connection time under control with new
+versions of @value{GDBN} which support increasing numbers of packets.
+
+Reply:
+@table @samp
+@item @var{stubfeature} @r{[};@var{stubfeature}@r{]}@dots{}
+The stub supports or does not support each returned @var{stubfeature},
+depending on the form of each @var{stubfeature} (see below for the
+possible forms).
+@item
+An empty reply indicates that @samp{qSupported} is not recognized,
+or that no features needed to be reported to @value{GDBN}.
+@end table
+
+The allowed forms for each feature (either a @var{gdbfeature} in the
+@samp{qSupported} packet, or a @var{stubfeature} in the response)
+are:
+
+@table @samp
+@item @var{name}=@var{value}
+The remote protocol feature @var{name} is supported, and associated
+with the specified @var{value}. The format of @var{value} depends
+on the feature, but it must not include a semicolon.
+@item @var{name}+
+The remote protocol feature @var{name} is supported, and does not
+need an associated value.
+@item @var{name}-
+The remote protocol feature @var{name} is not supported.
+@item @var{name}?
+The remote protocol feature @var{name} may be supported, and
+@value{GDBN} should auto-detect support in some other way when it is
+needed. This form will not be used for @var{gdbfeature} notifications,
+but may be used for @var{stubfeature} responses.
+@end table
+
+Whenever the stub receives a @samp{qSupported} request, the
+supplied set of @value{GDBN} features should override any previous
+request. This allows @value{GDBN} to put the stub in a known
+state, even if the stub had previously been communicating with
+a different version of @value{GDBN}.
+
+No values of @var{gdbfeature} (for the packet sent by @value{GDBN})
+are defined yet. Stubs should ignore any unknown values for
+@var{gdbfeature}. Any @value{GDBN} which sends a @samp{qSupported}
+packet supports receiving packets of unlimited length (earlier
+versions of @value{GDBN} may reject overly long responses). Values
+for @var{gdbfeature} may be defined in the future to let the stub take
+advantage of new features in @value{GDBN}, e.g.@: incompatible
+improvements in the remote protocol---support for unlimited length
+responses would be a @var{gdbfeature} example, if it were not implied by
+the @samp{qSupported} query. The stub's reply should be independent
+of the @var{gdbfeature} entries sent by @value{GDBN}; first @value{GDBN}
+describes all the features it supports, and then the stub replies with
+all the features it supports.
+
+Similarly, @value{GDBN} will silently ignore unrecognized stub feature
+responses, as long as each response uses one of the standard forms.
+
+Some features are flags. A stub which supports a flag feature
+should respond with a @samp{+} form response. Other features
+require values, and the stub should respond with an @samp{=}
+form response.
+
+Each feature has a default value, which @value{GDBN} will use if
+@samp{qSupported} is not available or if the feature is not mentioned
+in the @samp{qSupported} response. The default values are fixed; a
+stub is free to omit any feature responses that match the defaults.
+
+Not all features can be probed, but for those which can, the probing
+mechanism is useful: in some cases, a stub's internal
+architecture may not allow the protocol layer to know some information
+about the underlying target in advance. This is especially common in
+stubs which may be configured for multiple targets.
+
+These are the currently defined stub features and their properties:
+
+@multitable @columnfractions 0.25 0.2 0.2 0.2
+@c NOTE: The first row should be @headitem, but we do not yet require
+@c a new enough version of Texinfo (4.7) to use @headitem.
+@item Packet Name
+@tab Value Required
+@tab Default
+@tab Probe Allowed
+
+@item @samp{PacketSize}
+@tab Yes
+@tab @samp{-}
+@tab No
+
+@end multitable
+
+These are the currently defined stub features, in more detail:
+
+@table @samp
+@cindex packet size, remote protocol
+@item PacketSize=@var{bytes}
+The remote stub can accept packets up to at least @var{bytes} in
+length. @value{GDBN} will send packets up to this size for bulk
+transfers, and will never send larger packets. This is a limit on the
+data characters in the packet, including the frame and checksum.
+There is no trailing NUL byte in a remote protocol packet; if the stub
+stores packets in a NUL-terminated format, it should allow an extra
+byte in its buffer for the NUL. If this stub feature is not supported,
+@value{GDBN} guesses based on the size of the @samp{g} packet response.
+
+@end table
+
@item qSymbol::
@cindex symbol lookup, remote request
@cindex @samp{qSymbol} packet
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 2881a26ae31..1cf91b5018a 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,7 @@
+2006-06-21 Daniel Jacobowitz <dan@codesourcery.com>
+
+ * server.c (handle_query): Handle qSupported.
+
2006-05-30 Daniel Jacobowitz <dan@codesourcery.com>
* remote-utils.c (all_symbols_looked_up): New variable.
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 51b87642a83..8099ef41898 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -163,6 +163,14 @@ handle_query (char *own_buf)
return;
}
+ /* Protocol features query. */
+ if (strncmp ("qSupported", own_buf, 10) == 0
+ && (own_buf[10] == ':' || own_buf[10] == '\0'))
+ {
+ sprintf (own_buf, "PacketSize=%x", PBUFSIZ - 1);
+ return;
+ }
+
/* Otherwise we didn't know what packet it was. Say we didn't
understand it. */
own_buf[0] = 0;
diff --git a/gdb/remote.c b/gdb/remote.c
index 3811f430d71..f9b43b1fdf9 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -215,6 +215,12 @@ struct remote_state
packets. */
char *buf;
long buf_size;
+
+ /* If we negotiated packet size explicitly (and thus can bypass
+ heuristics for the largest packet size that will not overflow
+ a buffer in the stub), this will be set to that packet size.
+ Otherwise zero, meaning to use the guessed size. */
+ long explicit_packet_size;
};
/* This data could be associated with a target, but we do not always
@@ -340,8 +346,12 @@ init_remote_state (struct gdbarch *gdbarch)
static long
get_remote_packet_size (void)
{
+ struct remote_state *rs = get_remote_state ();
struct remote_arch_state *rsa = get_remote_arch_state ();
+ if (rs->explicit_packet_size)
+ return rs->explicit_packet_size;
+
return rsa->remote_packet_size;
}
@@ -484,10 +494,13 @@ get_memory_packet_size (struct memory_packet_config *config)
if (config->size > 0
&& what_they_get > config->size)
what_they_get = config->size;
- /* Limit it to the size of the targets ``g'' response. */
- if ((rsa->actual_register_packet_size) > 0
- && what_they_get > (rsa->actual_register_packet_size))
- what_they_get = (rsa->actual_register_packet_size);
+
+ /* Limit it to the size of the targets ``g'' response unless we have
+ permission from the stub to use a larger packet size. */
+ if (rs->explicit_packet_size == 0
+ && rsa->actual_register_packet_size > 0
+ && what_they_get > rsa->actual_register_packet_size)
+ what_they_get = rsa->actual_register_packet_size;
}
if (what_they_get > MAX_REMOTE_PACKET_SIZE)
what_they_get = MAX_REMOTE_PACKET_SIZE;
@@ -802,6 +815,7 @@ enum {
PACKET_Z4,
PACKET_qPart_auxv,
PACKET_qGetTLSAddr,
+ PACKET_qSupported,
PACKET_MAX
};
@@ -2065,6 +2079,222 @@ Some events may be lost, rendering further debugging impossible."));
return serial_open (name);
}
+/* This type describes each known response to the qSupported
+ packet. */
+struct protocol_feature
+{
+ /* The name of this protocol feature. */
+ const char *name;
+
+ /* The default for this protocol feature. */
+ enum packet_support default_support;
+
+ /* The function to call when this feature is reported, or after
+ qSupported processing if the feature is not supported.
+ The first argument points to this structure. The second
+ argument indicates whether the packet requested support be
+ enabled, disabled, or probed (or the default, if this function
+ is being called at the end of processing and this feature was
+ not reported). The third argument may be NULL; if not NULL, it
+ is a NUL-terminated string taken from the packet following
+ this feature's name and an equals sign. */
+ void (*func) (const struct protocol_feature *, enum packet_support,
+ const char *);
+
+ /* The corresponding packet for this feature. Only used if
+ FUNC is remote_supported_packet. */
+ int packet;
+};
+
+#if 0
+static void
+remote_supported_packet (const struct protocol_feature *feature,
+ enum packet_support support,
+ const char *argument)
+{
+ if (argument)
+ {
+ warning (_("Remote qSupported response supplied an unexpected value for"
+ " \"%s\"."), feature->name);
+ return;
+ }
+
+ if (remote_protocol_packets[feature->packet].support
+ == PACKET_SUPPORT_UNKNOWN)
+ remote_protocol_packets[feature->packet].support = support;
+}
+#endif
+
+static void
+remote_packet_size (const struct protocol_feature *feature,
+ enum packet_support support, const char *value)
+{
+ struct remote_state *rs = get_remote_state ();
+
+ int packet_size;
+ char *value_end;
+
+ if (support != PACKET_ENABLE)
+ return;
+
+ if (value == NULL || *value == '\0')
+ {
+ warning (_("Remote target reported \"%s\" without a size."),
+ feature->name);
+ return;
+ }
+
+ errno = 0;
+ packet_size = strtol (value, &value_end, 16);
+ if (errno != 0 || *value_end != '\0' || packet_size < 0)
+ {
+ warning (_("Remote target reported \"%s\" with a bad size: \"%s\"."),
+ feature->name, value);
+ return;
+ }
+
+ if (packet_size > MAX_REMOTE_PACKET_SIZE)
+ {
+ warning (_("limiting remote suggested packet size (%d bytes) to %d"),
+ packet_size, MAX_REMOTE_PACKET_SIZE);
+ packet_size = MAX_REMOTE_PACKET_SIZE;
+ }
+
+ /* Record the new maximum packet size. */
+ rs->explicit_packet_size = packet_size;
+}
+
+static struct protocol_feature remote_protocol_features[] = {
+ { "PacketSize", PACKET_DISABLE, remote_packet_size, -1 }
+};
+
+static void
+remote_query_supported (void)
+{
+ struct remote_state *rs = get_remote_state ();
+ char *next;
+ int i;
+ unsigned char seen [ARRAY_SIZE (remote_protocol_features)];
+
+ /* The packet support flags are handled differently for this packet
+ than for most others. We treat an error, a disabled packet, and
+ an empty response identically: any features which must be reported
+ to be used will be automatically disabled. An empty buffer
+ accomplishes this, since that is also the representation for a list
+ containing no features. */
+
+ rs->buf[0] = 0;
+ if (remote_protocol_packets[PACKET_qSupported].support != PACKET_DISABLE)
+ {
+ putpkt ("qSupported");
+ getpkt (&rs->buf, &rs->buf_size, 0);
+
+ /* If an error occured, warn, but do not return - just reset the
+ buffer to empty and go on to disable features. */
+ if (packet_ok (rs->buf, &remote_protocol_packets[PACKET_qSupported])
+ == PACKET_ERROR)
+ {
+ warning (_("Remote failure reply: %s"), rs->buf);
+ rs->buf[0] = 0;
+ }
+ }
+
+ memset (seen, 0, sizeof (seen));
+
+ next = rs->buf;
+ while (*next)
+ {
+ enum packet_support is_supported;
+ char *p, *end, *name_end, *value;
+
+ /* First separate out this item from the rest of the packet. If
+ there's another item after this, we overwrite the separator
+ (terminated strings are much easier to work with). */
+ p = next;
+ end = strchr (p, ';');
+ if (end == NULL)
+ {
+ end = p + strlen (p);
+ next = end;
+ }
+ else
+ {
+ if (end == p)
+ {
+ warning (_("empty item in \"qSupported\" response"));
+ continue;
+ }
+
+ *end = '\0';
+ next = end + 1;
+ }
+
+ name_end = strchr (p, '=');
+ if (name_end)
+ {
+ /* This is a name=value entry. */
+ is_supported = PACKET_ENABLE;
+ value = name_end + 1;
+ *name_end = '\0';
+ }
+ else
+ {
+ value = NULL;
+ switch (end[-1])
+ {
+ case '+':
+ is_supported = PACKET_ENABLE;
+ break;
+
+ case '-':
+ is_supported = PACKET_DISABLE;
+ break;
+
+ case '?':
+ is_supported = PACKET_SUPPORT_UNKNOWN;
+ break;
+
+ default:
+ warning (_("unrecognized item \"%s\" in \"qSupported\" response"), p);
+ continue;
+ }
+ end[-1] = '\0';
+ }
+
+ for (i = 0; i < ARRAY_SIZE (remote_protocol_features); i++)
+ if (strcmp (remote_protocol_features[i].name, p) == 0)
+ {
+ const struct protocol_feature *feature;
+
+ seen[i] = 1;
+ feature = &remote_protocol_features[i];
+ feature->func (feature, is_supported, value);
+ break;
+ }
+ }
+
+ /* If we increased the packet size, make sure to increase the global
+ buffer size also. We delay this until after parsing the entire
+ qSupported packet, because this is the same buffer we were
+ parsing. */
+ if (rs->buf_size < rs->explicit_packet_size)
+ {
+ rs->buf_size = rs->explicit_packet_size;
+ rs->buf = xrealloc (rs->buf, rs->buf_size);
+ }
+
+ /* Handle the defaults for unmentioned features. */
+ for (i = 0; i < ARRAY_SIZE (remote_protocol_features); i++)
+ if (!seen[i])
+ {
+ const struct protocol_feature *feature;
+
+ feature = &remote_protocol_features[i];
+ feature->func (feature, feature->default_support, NULL);
+ }
+}
+
+
static void
remote_open_1 (char *name, int from_tty, struct target_ops *target,
int extended_p, int async_p)
@@ -2119,7 +2349,10 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target,
}
push_target (target); /* Switch to using remote target now. */
+ /* Reset the target state; these things will be queried either by
+ remote_query_supported or as they are needed. */
init_all_packet_configs ();
+ rs->explicit_packet_size = 0;
general_thread = -2;
continue_thread = -2;
@@ -2128,6 +2361,11 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target,
use_threadinfo_query = 1;
use_threadextra_query = 1;
+ /* The first packet we send to the target is the optional "supported
+ packets" request. If the target can answer this, it will tell us
+ which later probes to skip. */
+ remote_query_supported ();
+
/* Without this, some commands which require an active target (such
as kill) won't work. This variable serves (at least) double duty
as both the pid of the target process (if it has such), and as a
@@ -5675,6 +5913,9 @@ Show the maximum size of the address (in bits) in a memory packet."), NULL,
"qGetTLSAddr", "get-thread-local-storage-address",
0);
+ add_packet_config_cmd (&remote_protocol_packets[PACKET_qSupported],
+ "qSupported", "supported-packets", 0);
+
/* Keep the old ``set remote Z-packet ...'' working. Each individual
Z sub-packet has its own set and show commands, but users may
have sets to this variable in their .gdbinit files (or in their
diff --git a/gdb/testsuite/Makefile.in b/gdb/testsuite/Makefile.in
index b92b91686f8..8065346489f 100644
--- a/gdb/testsuite/Makefile.in
+++ b/gdb/testsuite/Makefile.in
@@ -24,8 +24,7 @@ srcdir = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
-host_alias = @host_alias@
-target_alias = @target_alias@
+target_alias = @target_noncanonical@
program_transform_name = @program_transform_name@
build_canonical = @build@
host_canonical = @host@
@@ -108,7 +107,6 @@ site.exp: ./config.status Makefile
@echo "## these variables are automatically generated by make ##" > ./tmp0
@echo "# Do not edit here. If you wish to override these values" >> ./tmp0
@echo "# add them to the last section" >> ./tmp0
- @echo "set host_alias $(host_alias)" >> ./tmp0
@echo "set host_triplet ${host_canonical}" >> ./tmp0
@echo "set target_alias $(target_alias)" >> ./tmp0
@echo "set target_triplet ${target_canonical}" >> ./tmp0
diff --git a/gdb/testsuite/aclocal.m4 b/gdb/testsuite/aclocal.m4
index c754fdcf2f7..1b10180c3ef 100644
--- a/gdb/testsuite/aclocal.m4
+++ b/gdb/testsuite/aclocal.m4
@@ -1,583 +1 @@
-dnl This file is duplicated in four places:
-dnl * gdb/aclocal.m4
-dnl * gdb/testsuite/aclocal.m4
-dnl * expect/aclocal.m4
-dnl * dejagnu/aclocal.m4
-dnl Consider modifying all copies in parallel.
-dnl written by Rob Savoye <rob@cygnus.com> for Cygnus Support
-dnl CYGNUS LOCAL: This gets the right posix flag for gcc
-AC_DEFUN(CY_AC_TCL_LYNX_POSIX,
-[AC_REQUIRE([AC_PROG_CC])AC_REQUIRE([AC_PROG_CPP])
-AC_MSG_CHECKING([to see if this is LynxOS])
-AC_CACHE_VAL(ac_cv_os_lynx,
-[AC_EGREP_CPP(yes,
-[/*
- * The old Lynx "cc" only defines "Lynx", but the newer one uses "__Lynx__"
- */
-#if defined(__Lynx__) || defined(Lynx)
-yes
-#endif
-], ac_cv_os_lynx=yes, ac_cv_os_lynx=no)])
-#
-if test "$ac_cv_os_lynx" = "yes" ; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(LYNX)
- AC_MSG_CHECKING([whether -mposix or -X is available])
- AC_CACHE_VAL(ac_cv_c_posix_flag,
- [AC_TRY_COMPILE(,[
- /*
- * This flag varies depending on how old the compiler is.
- * -X is for the old "cc" and "gcc" (based on 1.42).
- * -mposix is for the new gcc (at least 2.5.8).
- */
- #if defined(__GNUC__) && __GNUC__ >= 2
- choke me
- #endif
- ], ac_cv_c_posix_flag=" -mposix", ac_cv_c_posix_flag=" -X")])
- CC="$CC $ac_cv_c_posix_flag"
- AC_MSG_RESULT($ac_cv_c_posix_flag)
- else
- AC_MSG_RESULT(no)
-fi
-])
-
-AC_DEFUN(CY_AC_PATH_TCLH, [
-#
-# Ok, lets find the tcl source trees so we can use the headers
-# Warning: transition of version 9 to 10 will break this algorithm
-# because 10 sorts before 9. We also look for just tcl. We have to
-# be careful that we don't match stuff like tclX by accident.
-# the alternative search directory is involked by --with-tclinclude
-#
-no_tcl=true
-AC_MSG_CHECKING(for Tcl private headers)
-AC_ARG_WITH(tclinclude, [ --with-tclinclude directory where tcl private headers are], with_tclinclude=${withval})
-AC_CACHE_VAL(ac_cv_c_tclh,[
-# first check to see if --with-tclinclude was specified
-if test x"${with_tclinclude}" != x ; then
- if test -f ${with_tclinclude}/tclInt.h ; then
- ac_cv_c_tclh=`(cd ${with_tclinclude}; pwd)`
- else
- AC_MSG_ERROR([${with_tclinclude} directory doesn't contain private headers])
- fi
-fi
-# next check in private source directory
-#
-# since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_tclh}" = x ; then
- for i in \
- ${srcdir}/../tcl \
- `ls -dr ${srcdir}/../tcl[[0-9]]* 2>/dev/null` \
- ${srcdir}/../../tcl \
- `ls -dr ${srcdir}/../../tcl[[0-9]]* 2>/dev/null` \
- ${srcdir}/../../../tcl \
- `ls -dr ${srcdir}/../../../tcl[[0-9]]* 2>/dev/null ` ; do
- if test -f $i/tclInt.h ; then
- ac_cv_c_tclh=`(cd $i; pwd)`
- break
- fi
- # Tcl 7.5 and greater puts headers in subdirectory.
- if test -f $i/generic/tclInt.h ; then
- ac_cv_c_tclh=`(cd $i; pwd)`/generic
- break
- fi
- done
-fi
-# finally check in a few common install locations
-#
-# since ls returns lowest version numbers first, reverse its output
-if test x"${ac_cv_c_tclh}" = x ; then
- for i in \
- `ls -dr /usr/local/src/tcl[[0-9]]* 2>/dev/null` \
- `ls -dr /usr/local/lib/tcl[[0-9]]* 2>/dev/null` \
- /usr/local/src/tcl \
- /usr/local/lib/tcl \
- ${prefix}/include ; do
- if test -f $i/tclInt.h ; then
- ac_cv_c_tclh=`(cd $i; pwd)`
- break
- fi
- done
-fi
-# see if one is installed
-if test x"${ac_cv_c_tclh}" = x ; then
- AC_HEADER_CHECK(tclInt.h, ac_cv_c_tclh=installed, ac_cv_c_tclh="")
-fi
-])
-if test x"${ac_cv_c_tclh}" = x ; then
- TCLHDIR="# no Tcl private headers found"
- AC_MSG_ERROR([Can't find Tcl private headers])
-fi
-if test x"${ac_cv_c_tclh}" != x ; then
- no_tcl=""
- if test x"${ac_cv_c_tclh}" = x"installed" ; then
- AC_MSG_RESULT([is installed])
- TCLHDIR=""
- else
- AC_MSG_RESULT([found in ${ac_cv_c_tclh}])
- # this hack is cause the TCLHDIR won't print if there is a "-I" in it.
- TCLHDIR="-I${ac_cv_c_tclh}"
- fi
-fi
-
-AC_MSG_CHECKING([Tcl version])
-orig_includes="$CPPFLAGS"
-
-if test x"${TCLHDIR}" != x ; then
- CPPFLAGS="$CPPFLAGS $TCLHDIR"
-fi
-
-# Get major and minor versions of Tcl. Use funny names to avoid
-# clashes with eg SunOS.
-cat > conftest.c <<'EOF'
-#include "tcl.h"
-MaJor = TCL_MAJOR_VERSION
-MiNor = TCL_MINOR_VERSION
-EOF
-
-tclmajor=
-tclminor=
-if (eval "$CPP $CPPFLAGS conftest.c") 2>/dev/null >conftest.out; then
- # Success.
- tclmajor=`egrep '^MaJor = ' conftest.out | sed -e 's/^MaJor = *//' -e 's/ *$//'`
- tclminor=`egrep '^MiNor = ' conftest.out | sed -e 's/^MiNor = *//' -e 's/ *$//'`
-fi
-rm -f conftest.c conftest.out
-
-if test -z "$tclmajor" || test -z "$tclminor"; then
- AC_MSG_RESULT([fatal error: could not find major or minor version number of Tcl])
- exit 1
-fi
-AC_MSG_RESULT(${tclmajor}.${tclminor})
-
-CPPFLAGS="${orig_includes}"
-
-AC_PROVIDE([$0])
-AC_SUBST(TCLHDIR)
-])
-AC_DEFUN(CY_AC_PATH_TCLLIB, [
-#
-# Ok, lets find the tcl library
-# First, look for one uninstalled.
-# the alternative search directory is invoked by --with-tcllib
-#
-
-if test $tclmajor -ge 7 -a $tclminor -ge 4 ; then
- installedtcllibroot=tcl$tclversion
-else
- installedtcllibroot=tcl
-fi
-
-if test x"${no_tcl}" = x ; then
- # we reset no_tcl incase something fails here
- no_tcl=true
- AC_ARG_WITH(tcllib, [ --with-tcllib directory where the tcl library is],
- with_tcllib=${withval})
- AC_MSG_CHECKING([for Tcl library])
- AC_CACHE_VAL(ac_cv_c_tcllib,[
- # First check to see if --with-tcllib was specified.
- # This requires checking for both the installed and uninstalled name-styles
- # since we have no idea if it's installed or not.
- if test x"${with_tcllib}" != x ; then
- if test -f "${with_tcllib}/lib$installedtcllibroot.so" ; then
- ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/lib$installedtcllibroot.so
- elif test -f "${with_tcllib}/libtcl.so" ; then
- ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/libtcl.so
- # then look for a freshly built statically linked library
- # if Makefile exists we assume its configured and libtcl will be built first.
- elif test -f "${with_tcllib}/lib$installedtcllibroot.a" ; then
- ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/lib$installedtcllibroot.a
- elif test -f "${with_tcllib}/libtcl.a" ; then
- ac_cv_c_tcllib=`(cd ${with_tcllib}; pwd)`/libtcl.a
- else
- AC_MSG_ERROR([${with_tcllib} directory doesn't contain libraries])
- fi
- fi
- # then check for a private Tcl library
- # Since these are uninstalled, use the simple lib name root.
- if test x"${ac_cv_c_tcllib}" = x ; then
- for i in \
- ../tcl \
- `ls -dr ../tcl[[0-9]]* 2>/dev/null` \
- ../../tcl \
- `ls -dr ../../tcl[[0-9]]* 2>/dev/null` \
- ../../../tcl \
- `ls -dr ../../../tcl[[0-9]]* 2>/dev/null` ; do
- # Tcl 7.5 and greater puts library in subdir. Look there first.
- if test -f "$i/unix/libtcl.so" ; then
- ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.so
- break
- elif test -f "$i/unix/libtcl.a" -o -f "$i/unix/Makefile"; then
- ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.a
- break
- # look for a freshly built dynamically linked library
- elif test -f "$i/libtcl.so" ; then
- ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.so
- break
-
- # then look for a freshly built statically linked library
- # if Makefile exists we assume its configured and libtcl will be
- # built first.
- elif test -f "$i/libtcl.a" -o -f "$i/Makefile" ; then
- ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.a
- break
- fi
- done
- fi
- # check in a few common install locations
- if test x"${ac_cv_c_tcllib}" = x ; then
- for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
- # first look for a freshly built dynamically linked library
- if test -f "$i/lib$installedtcllibroot.so" ; then
- ac_cv_c_tcllib=`(cd $i; pwd)`/lib$installedtcllibroot.so
- break
- # then look for a freshly built statically linked library
- # if Makefile exists we assume its configured and libtcl will be built first.
- elif test -f "$i/lib$installedtcllibroot.a" -o -f "$i/Makefile" ; then
- ac_cv_c_tcllib=`(cd $i; pwd)`/lib$installedtcllibroot.a
- break
- fi
- done
- fi
- # check in a few other private locations
- if test x"${ac_cv_c_tcllib}" = x ; then
- for i in \
- ${srcdir}/../tcl \
- `ls -dr ${srcdir}/../tcl[[0-9]]* 2>/dev/null` ; do
- # Tcl 7.5 and greater puts library in subdir. Look there first.
- if test -f "$i/unix/libtcl.so" ; then
- ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.so
- break
- elif test -f "$i/unix/libtcl.a" -o -f "$i/unix/Makefile"; then
- ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtcl.a
- break
- # look for a freshly built dynamically linked library
- elif test -f "$i/libtcl.so" ; then
- ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.so
- break
-
- # then look for a freshly built statically linked library
- # if Makefile exists we assume its configured and libtcl will be
- # built first.
- elif test -f "$i/libtcl.a" -o -f "$i/Makefile" ; then
- ac_cv_c_tcllib=`(cd $i; pwd)`/libtcl.a
- break
- fi
- done
- fi
-
- # see if one is conveniently installed with the compiler
- if test x"${ac_cv_c_tcllib}" = x ; then
- orig_libs="$LIBS"
- LIBS="$LIBS -l$installedtcllibroot -lm"
- AC_TRY_RUN([
- Tcl_AppInit()
- { exit(0); }], ac_cv_c_tcllib="-l$installedtcllibroot", ac_cv_c_tcllib=""
- , ac_cv_c_tclib="-l$installedtcllibroot")
- LIBS="${orig_libs}"
- fi
- ])
- if test x"${ac_cv_c_tcllib}" = x ; then
- TCLLIB="# no Tcl library found"
- AC_MSG_WARN(Can't find Tcl library)
- else
- TCLLIB=${ac_cv_c_tcllib}
- AC_MSG_RESULT(found $TCLLIB)
- no_tcl=
- fi
-fi
-
-AC_PROVIDE([$0])
-AC_SUBST(TCLLIB)
-])
-AC_DEFUN(CY_AC_PATH_TKH, [
-#
-# Ok, lets find the tk source trees so we can use the headers
-# If the directory (presumably symlink) named "tk" exists, use that one
-# in preference to any others. Same logic is used when choosing library
-# and again with Tcl. The search order is the best place to look first, then in
-# decreasing significance. The loop breaks if the trigger file is found.
-# Note the gross little conversion here of srcdir by cd'ing to the found
-# directory. This converts the path from a relative to an absolute, so
-# recursive cache variables for the path will work right. We check all
-# the possible paths in one loop rather than many seperate loops to speed
-# things up.
-# the alternative search directory is invoked by --with-tkinclude
-#
-AC_MSG_CHECKING(for Tk private headers)
-AC_ARG_WITH(tkinclude, [ --with-tkinclude directory where the tk private headers are],
- with_tkinclude=${withval})
-no_tk=true
-AC_CACHE_VAL(ac_cv_c_tkh,[
-# first check to see if --with-tkinclude was specified
-if test x"${with_tkinclude}" != x ; then
- if test -f ${with_tkinclude}/tk.h ; then
- ac_cv_c_tkh=`(cd ${with_tkinclude}; pwd)`
- else
- AC_MSG_ERROR([${with_tkinclude} directory doesn't contain private headers])
- fi
-fi
-# next check in private source directory
-#
-# since ls returns lowest version numbers first, reverse the entire list
-# and search for the worst fit, overwriting it with better fits as we find them
-if test x"${ac_cv_c_tkh}" = x ; then
- for i in \
- ${srcdir}/../tk \
- `ls -dr ${srcdir}/../tk[[0-9]]* 2>/dev/null` \
- ${srcdir}/../../tk \
- `ls -dr ${srcdir}/../../tk[[0-9]]* 2>/dev/null` \
- ${srcdir}/../../../tk \
- `ls -dr ${srcdir}/../../../tk[[0-9]]* 2>/dev/null ` ; do
- if test -f $i/tk.h ; then
- ac_cv_c_tkh=`(cd $i; pwd)`
- break
- fi
- # Tk 4.1 and greater puts this in a subdir.
- if test -f $i/generic/tk.h; then
- ac_cv_c_tkh=`(cd $i; pwd)`/generic
- fi
- done
-fi
-# finally check in a few common install locations
-#
-# since ls returns lowest version numbers first, reverse the entire list
-# and search for the worst fit, overwriting it with better fits as we find them
-if test x"${ac_cv_c_tkh}" = x ; then
- for i in \
- `ls -dr /usr/local/src/tk[[0-9]]* 2>/dev/null` \
- `ls -dr /usr/local/lib/tk[[0-9]]* 2>/dev/null` \
- /usr/local/src/tk \
- /usr/local/lib/tk \
- ${prefix}/include ; do
- if test -f $i/tk.h ; then
- ac_cv_c_tkh=`(cd $i; pwd)`
- break
- fi
- done
-fi
-# see if one is installed
-if test x"${ac_cv_c_tkh}" = x ; then
- AC_HEADER_CHECK(tk.h, ac_cv_c_tkh=installed)
-fi
-])
-if test x"${ac_cv_c_tkh}" != x ; then
- no_tk=""
- if test x"${ac_cv_c_tkh}" = x"installed" ; then
- AC_MSG_RESULT([is installed])
- TKHDIR=""
- else
- AC_MSG_RESULT([found in $ac_cv_c_tkh])
- # this hack is cause the TKHDIR won't print if there is a "-I" in it.
- TKHDIR="-I${ac_cv_c_tkh}"
- fi
-else
- TKHDIR="# no Tk directory found"
- AC_MSG_WARN([Can't find Tk private headers])
- no_tk=true
-fi
-
-# if Tk is installed, extract the major/minor version
-if test x"${no_tk}" = x ; then
-AC_MSG_CHECKING([Tk version])
-orig_includes="$CPPFLAGS"
-
-if test x"${TCLHDIR}" != x ; then
- CPPFLAGS="$CPPFLAGS $TCLHDIR"
-fi
-if test x"${TKHDIR}" != x ; then
- CPPFLAGS="$CPPFLAGS $TKHDIR"
-fi
-if test x"${x_includes}" != x -a x"${x_includes}" != xNONE ; then
- CPPFLAGS="$CPPFLAGS -I$x_includes"
-fi
-
-# Get major and minor versions of Tk. Use funny names to avoid
-# clashes with eg SunOS.
-cat > conftest.c <<'EOF'
-#include "tk.h"
-MaJor = TK_MAJOR_VERSION
-MiNor = TK_MINOR_VERSION
-EOF
-
-tkmajor=
-tkminor=
-if (eval "$CPP $CPPFLAGS conftest.c") 2>/dev/null >conftest.out; then
- # Success.
- tkmajor=`egrep '^MaJor = ' conftest.out | sed -e 's/^MaJor = *//' -e 's/ *$//'`
- tkminor=`egrep '^MiNor = ' conftest.out | sed -e 's/^MiNor = *//' -e 's/ *$//'`
-fi
-rm -f conftest.c conftest.out
-
-if test -z "$tkmajor" || test -z "$tkminor"; then
- AC_MSG_RESULT([fatal error: could not find major or minor version number of Tk])
- exit 1
-fi
-AC_MSG_RESULT(${tkmajor}.${tkminor})
-
-CPPFLAGS="${orig_includes}"
-fi
-
-AC_PROVIDE([$0])
-AC_SUBST(TKHDIR)
-])
-AC_DEFUN(CY_AC_PATH_TKLIB, [
-AC_REQUIRE([CY_AC_PATH_TCL])
-#
-# Ok, lets find the tk library
-# First, look for the latest private (uninstalled) copy
-# Notice that the destinations in backwards priority since the tests have
-# no break.
-# Then we look for either .a, .so, or Makefile. A Makefile is acceptable
-# is it indicates the target has been configured and will (probably)
-# soon be built. This allows an entire tree of Tcl software to be
-# configured at once and then built.
-# the alternative search directory is invoked by --with-tklib
-#
-
-if test x"${no_tk}" = x ; then
- # reset no_tk incase something fails here
- no_tk="true"
-
- if test $tkmajor -ge 4 ; then
- installedtklibroot=tk$tkversion
- else
- installedtkllibroot=tk
- fi
-
- AC_ARG_WITH(tklib, [ --with-tklib directory where the tk library is],
- with_tklib=${withval})
- AC_MSG_CHECKING([for Tk library])
- AC_CACHE_VAL(ac_cv_c_tklib,[
- # first check to see if --with-tklib was specified
- # This requires checking for both the installed and uninstalled name-styles
- # since we have no idea if it's installed or not.
- if test x"${with_tklib}" != x ; then
- if test -f "${with_tklib}/lib$installedtklibroot.so" ; then
- ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/lib$installedtklibroot.so
- no_tk=""
- elif test -f "${with_tklib}/libtk.so" ; then
- ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/libtk.so
- no_tk=""
- # then look for a freshly built statically linked library
- # if Makefile exists we assume its configured and libtk will be built
- elif test -f "${with_tklib}/lib$installedtklibroot.a" ; then
- ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/lib$installedtklibroot.a
- no_tk=""
- elif test -f "${with_tklib}/libtk.a" ; then
- ac_cv_c_tklib=`(cd ${with_tklib}; pwd)`/libtk.a
- no_tk=""
- else
- AC_MSG_ERROR([${with_tklib} directory doesn't contain libraries])
- fi
- fi
- # then check for a private Tk library
- # Since these are uninstalled, use the simple lib name root.
- if test x"${ac_cv_c_tklib}" = x ; then
- for i in \
- ../tk \
- `ls -dr ../tk[[0-9]]* 2>/dev/null` \
- ../../tk \
- `ls -dr ../../tk[[0-9]]* 2>/dev/null` \
- ../../../tk \
- `ls -dr ../../../tk[[0-9]]* 2>/dev/null` ; do
- # Tk 4.1 and greater puts things in subdirs. Check these first.
- if test -f "$i/unix/libtk.so" ; then
- ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.so
- no_tk=
- break
- elif test -f "$i/unix/libtk.a" -o -f "$i/unix/Makefile"; then
- ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.a
- no_tk=
- break
- # look for a freshly built dynamically linked library
- elif test -f "$i/libtk.so" ; then
- ac_cv_c_tklib=`(cd $i; pwd)`/libtk.so
- no_tk=
- break
- # then look for a freshly built statically linked library
- # if Makefile exists we assume its configured and libtk will be built
- elif test -f "$i/libtk.a" -o -f "$i/Makefile" ; then
- ac_cv_c_tklib=`(cd $i; pwd)`/libtk.a
- no_tk=""
- break
- fi
- done
- fi
- # finally check in a few common install locations
- if test x"${ac_cv_c_tklib}" = x ; then
- for i in `ls -d ${prefix}/lib /usr/local/lib 2>/dev/null` ; do
- # first look for a freshly built dynamically linked library
- if test -f "$i/lib$installedtklibroot.so" ; then
- ac_cv_c_tklib=`(cd $i; pwd)`/lib$installedtklibroot.so
- no_tk=""
- break
- # then look for a freshly built statically linked library
- # if Makefile exists, we assume it's configured and libtcl will be built
- elif test -f "$i/lib$installedtklibroot.a" -o -f "$i/Makefile" ; then
- ac_cv_c_tklib=`(cd $i; pwd)`/lib$installedtklibroot.a
- no_tk=""
- break
- fi
- done
- fi
- # check in a few other private locations
- if test x"${ac_cv_c_tklib}" = x ; then
- for i in \
- ${srcdir}/../tk \
- `ls -dr ${srcdir}/../tk[[0-9]]* 2>/dev/null` ; do
- # Tk 4.1 and greater puts things in subdirs. Check these first.
- if test -f "$i/unix/libtk.so" ; then
- ac_cv_c_tklib=`(cd $i; pwd)`/unix/libtk.so
- no_tk=
- break
- elif test -f "$i/unix/libtk.a" -o -f "$i/unix/Makefile"; then
- ac_cv_c_tcllib=`(cd $i; pwd)`/unix/libtk.a
- no_tk=
- break
- # look for a freshly built dynamically linked library
- elif test -f "$i/libtk.so" ; then
- ac_cv_c_tklib=`(cd $i; pwd)`/libtk.so
- no_tk=""
- break
- # then look for a freshly built statically linked library
- # if Makefile exists, we assume it's configured and libtcl will be built
- elif test -f "$i/libtk.a" -o -f "$i/Makefile" ; then
- ac_cv_c_tklib=`(cd $i; pwd)`/libtk.a
- no_tk=""
- break
- fi
- done
- fi
- # see if one is conveniently installed with the compiler
- if test x"${ac_cv_c_tklib}" = x ; then
- AC_REQUIRE([AC_PATH_X])
- orig_libs="$LIBS"
- LIBS="$LIBS -l$installedtklibroot $x_libraries $ac_cv_c_tcllib -lm"
- AC_TRY_RUN([
- Tcl_AppInit()
- { exit(0); }], ac_cv_c_tklib="-l$installedtklibroot", ac_cv_c_tklib=""
- , ac_cv_c_tklib="-l$installedtklibroot")
- LIBS="${orig_libs}"
- fi
- ])
- if test x"${ac_cv_c_tklib}" = x ; then
- TKLIB="# no Tk library found"
- AC_MSG_WARN(Can't find Tk library)
- else
- TKLIB=$ac_cv_c_tklib
- AC_MSG_RESULT(found $TKLIB)
- no_tk=
- fi
-fi
-AC_PROVIDE([$0])
-AC_SUBST(TKLIB)
-])
-AC_DEFUN(CY_AC_PATH_TK, [
- CY_AC_PATH_TKH
- CY_AC_PATH_TKLIB
-])
-AC_DEFUN(CY_AC_PATH_TCL, [
- CY_AC_PATH_TCLH
- CY_AC_PATH_TCLLIB
-])
+sinclude(../../config/acx.m4)
diff --git a/gdb/testsuite/configure b/gdb/testsuite/configure
index fbf77b52994..3370ef049e6 100755
--- a/gdb/testsuite/configure
+++ b/gdb/testsuite/configure
@@ -312,7 +312,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os subdirs RPATH_ENVVAR CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical subdirs RPATH_ENVVAR CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -956,7 +956,7 @@ esac
else
echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi
- cd "$ac_popdir"
+ cd $ac_popdir
done
fi
@@ -1412,6 +1412,24 @@ test -n "$target_alias" &&
NONENONEs,x,x, &&
program_prefix=${target_alias}-
+ case ${build_alias} in
+ "") build_noncanonical=${build} ;;
+ *) build_noncanonical=${build_alias} ;;
+esac
+
+ case ${host_alias} in
+ "") host_noncanonical=${build_noncanonical} ;;
+ *) host_noncanonical=${host_alias} ;;
+esac
+
+ case ${target_alias} in
+ "") target_noncanonical=${host_noncanonical} ;;
+ *) target_noncanonical=${target_alias} ;;
+esac
+
+
+
+
# Add HP-specific tests when appropriate.
case $target in
hppa*-*-hpux*)
@@ -2080,7 +2098,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2138,7 +2157,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2254,7 +2274,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2308,7 +2329,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2353,7 +2375,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2397,7 +2420,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2720,7 +2744,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2890,7 +2915,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -2957,7 +2983,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -3736,6 +3763,7 @@ s,@target@,$target,;t t
s,@target_cpu@,$target_cpu,;t t
s,@target_vendor@,$target_vendor,;t t
s,@target_os@,$target_os,;t t
+s,@target_noncanonical@,$target_noncanonical,;t t
s,@subdirs@,$subdirs,;t t
s,@RPATH_ENVVAR@,$RPATH_ENVVAR,;t t
s,@CC@,$CC,;t t
@@ -3911,6 +3939,11 @@ esac
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
@@ -3949,12 +3982,6 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
fi;;
esac
done` || { (exit 1); exit 1; }
-
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
sed "$ac_vpsub
@@ -4186,7 +4213,7 @@ echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;}
{ (exit 1); exit 1; }; }
fi
- cd "$ac_popdir"
+ cd $ac_popdir
done
fi
diff --git a/gdb/testsuite/configure.ac b/gdb/testsuite/configure.ac
index 0c89789df11..15369d39934 100644
--- a/gdb/testsuite/configure.ac
+++ b/gdb/testsuite/configure.ac
@@ -26,6 +26,8 @@ AC_CANONICAL_BUILD
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
+ACX_NONCANONICAL_TARGET
+
# Add HP-specific tests when appropriate.
case $target in
hppa*-*-hpux*)
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index eca2a504666..86f9a6c0754 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1509,6 +1509,9 @@ proc gdb_compile {source dest type options} {
set options [lreplace $options $nowarnings $nowarnings $flag]
}
+# # Make sure the target directory exists, in case the testsuite
+# # was not configured.
+
set result [target_compile $source $dest $type $options];
regsub "\[\r\n\]*$" "$result" "" result;
regsub "^\[\r\n\]*" "$result" "" result;