From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32041 invoked by alias); 28 Jun 2013 10:28:18 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 31978 invoked by uid 89); 28 Jun 2013 10:28:17 -0000 X-Spam-SWARE-Status: No, score=-8.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 28 Jun 2013 10:28:16 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5SASDsD007577 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 28 Jun 2013 06:28:13 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r5SASBEd016117; Fri, 28 Jun 2013 06:28:11 -0400 Message-ID: <51CD653A.6040005@redhat.com> Date: Fri, 28 Jun 2013 12:00:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130514 Thunderbird/17.0.6 MIME-Version: 1.0 To: Mircea Gherzan CC: yao@codesourcery.com, tromey@redhat.com, gdb-patches@sourceware.org Subject: Re: [PATCH v2] gdbserver: fix the standalone build References: <1372412908-13829-1-git-send-email-mircea.gherzan@intel.com> In-Reply-To: <1372412908-13829-1-git-send-email-mircea.gherzan@intel.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-06/txt/msg00872.txt.bz2 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 > > 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 > --- > 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