Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v2] gdbserver: fix the standalone build
@ 2013-06-28 10:28 Mircea Gherzan
  2013-06-28 12:00 ` Pedro Alves
  0 siblings, 1 reply; 2+ messages in thread
From: Mircea Gherzan @ 2013-06-28 10:28 UTC (permalink / raw)
  To: yao, tromey, palves; +Cc: gdb-patches, Mircea Gherzan

When directly invoking gdb/gdbserver/configure && make, the build will
fail because the $(host_alias) is empty and thus create-version.sh does
not get enough parameters.

Ok to apply?

2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>

gdbserver:

	* Makefile.in (host): Add it.
	(target): Add it.
	(host_alias): If empty, assign $(host) to it.
	(target_alias): If empty, assign $(target) to it.

Signed-off-by: Mircea Gherzan <mircea.gherzan@intel.com>
---
 gdb/gdbserver/Makefile.in | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index e5ecdd3..4b833bd 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -18,6 +18,8 @@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
 
+host = @host@
+target = @target@
 host_alias = @host_alias@
 target_alias = @target_alias@
 program_transform_name = @program_transform_name@
@@ -25,6 +27,14 @@ bindir = @bindir@
 libdir = @libdir@
 tooldir = $(libdir)/$(target_alias)
 
+ifeq ($(host_alias),)
+  host_alias = $(host)
+endif
+
+ifeq ($(target_alias),)
+  target_alias = $(target)
+endif 
+
 datarootdir = @datarootdir@
 datadir = @datadir@
 mandir = @mandir@
-- 
1.7.12.4


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

* Re: [PATCH v2] gdbserver: fix the standalone build
  2013-06-28 10:28 [PATCH v2] gdbserver: fix the standalone build Mircea Gherzan
@ 2013-06-28 12:00 ` Pedro Alves
  0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2013-06-28 12:00 UTC (permalink / raw)
  To: Mircea Gherzan; +Cc: yao, tromey, gdb-patches

On 06/28/2013 10:48 AM, Mircea Gherzan wrote:
> When directly invoking gdb/gdbserver/configure && make, the build will
> fail because the $(host_alias) is empty and thus create-version.sh does
> not get enough parameters.

Should also mention the behavior change (and pasting an example output
of before after would be nice).

> Ok to apply?
> 
> 2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
> 
> gdbserver:
> 
> 	* Makefile.in (host): Add it.
> 	(target): Add it.
> 	(host_alias): If empty, assign $(host) to it.
> 	(target_alias): If empty, assign $(target) to it.
> 
> Signed-off-by: Mircea Gherzan <mircea.gherzan@intel.com>
> ---
>  gdb/gdbserver/Makefile.in | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
> index e5ecdd3..4b833bd 100644
> --- a/gdb/gdbserver/Makefile.in
> +++ b/gdb/gdbserver/Makefile.in
> @@ -18,6 +18,8 @@
>  prefix = @prefix@
>  exec_prefix = @exec_prefix@
>  
> +host = @host@
> +target = @target@
>  host_alias = @host_alias@
>  target_alias = @target_alias@
>  program_transform_name = @program_transform_name@
> @@ -25,6 +27,14 @@ bindir = @bindir@
>  libdir = @libdir@
>  tooldir = $(libdir)/$(target_alias)
>  
> +ifeq ($(host_alias),)
> +  host_alias = $(host)
> +endif
> +
> +ifeq ($(target_alias),)
> +  target_alias = $(target)
> +endif 
> +

We don't assume GNU make, so we need to do the conditionals
in configure instead.  E.g., in configure.ac:

# For --version, we want to the print --host/--target exactly
# as passed to configure.  But if those were not specified, then
# print the canonical host/target.
version_host=${host_alias:-$host}
version_target=${target_alias:-$target}
AC_SUBST(version_host)
AC_SUBST(version_target)

And then in Makefile.in:

+version_host = @version_host@
+version_target = @version_target@

...

version.c: Makefile $(srcdir)/../common/version.in $(srcdir)/../../bfd/version.h $(srcdir)/../common/create-version.sh
	$(SHELL) $(srcdir)/../common/create-version.sh $(srcdir)/.. \
-	    $(host_alias) $(target_alias) version.c
+	    $(version_host) $(version_target) version.c

-- 
Pedro Alves


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

end of thread, other threads:[~2013-06-28 10:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-28 10:28 [PATCH v2] gdbserver: fix the standalone build Mircea Gherzan
2013-06-28 12:00 ` Pedro Alves

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