From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30827 invoked by alias); 3 Jul 2013 15:04:53 -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 30797 invoked by uid 89); 3 Jul 2013 15:04:47 -0000 X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL autolearn=ham version=3.3.1 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 03 Jul 2013 15:04:46 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1UuObs-0001jV-BK from Yao_Qi@mentor.com ; Wed, 03 Jul 2013 08:04:44 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 3 Jul 2013 08:04:44 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Wed, 3 Jul 2013 08:04:43 -0700 Message-ID: <51D43D76.8050309@codesourcery.com> Date: Wed, 03 Jul 2013 15:04:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Pedro Alves CC: Mircea Gherzan , , Subject: Re: [PATCH v3] gdbserver: fix the standalone build References: <1372420771-942-1-git-send-email-mircea.gherzan@intel.com> <51CD7ED4.6070104@codesourcery.com> <51CD8023.3030308@redhat.com> <51CE4252.7050305@codesourcery.com> <51D1A293.6000901@redhat.com> In-Reply-To: <51D1A293.6000901@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-SW-Source: 2013-07/txt/msg00142.txt.bz2 On 07/01/2013 11:38 PM, Pedro Alves wrote: > Hmm, gdb/testsuite/configure.ac is also using that, added here: > > http://www.sourceware.org/ml/gdb-patches/2006-06/msg00330.html > > Sounds like we should be making gdbserver use that too, instead > of reinventing our own... The following patches are to use @target_noncanonical@ and @host_noncanonical@ in GDBserver. In order to make review easier, I split the patch into two, #1 is to revert two previous commits, and #2 is to use noncanonical stuff. These two patches should be committed to cvs in one go. Here is the patch 1/2. I tested these patches by build gdb via 'configure & make' and 'configure --host=mips-linux & make', the generated version.c looks right to me. -- Yao (齐尧) gdb: 2013-07-03 Yao Qi Revert: 2013-06-27 Yao Qi * common/create-version.sh: Update comments. Handle the case that TARGET_ALIAS is empty. gdb/gdbserver: 2013-07-03 Yao Qi Revert: 2013-06-28 Mircea Gherzan * configure.ac (version_host, version_target): Set and AC_SUBST them. * configure: Rebuild. * Makefile.in (version_host, version_target): Get from configure. (version.c): Use $(version_host) and $(version_target). --- gdb/common/create-version.sh | 17 ++++------------- gdb/gdbserver/Makefile.in | 4 +--- gdb/gdbserver/configure | 10 ---------- gdb/gdbserver/configure.ac | 8 -------- 4 files changed, 5 insertions(+), 34 deletions(-) diff --git a/gdb/common/create-version.sh b/gdb/common/create-version.sh index 0bdd0fd..ad50946 100755 --- a/gdb/common/create-version.sh +++ b/gdb/common/create-version.sh @@ -20,17 +20,12 @@ # Create version.c from version.in. # Usage: # create-version.sh PATH-TO-GDB-SRCDIR HOST_ALIAS \ -# [TARGET_ALIAS] OUTPUT-FILE-NAME +# TARGET_ALIAS OUTPUT-FILE-NAME srcdir="$1" host_alias="$2" - -if [ "$#" = "4" ]; then - target_alias="$3" - output="$4" -else - output="$3" -fi +target_alias="$3" +output="$4" rm -f version.c-tmp $output version.tmp date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$/\1/p' $srcdir/../bfd/version.h` @@ -38,10 +33,6 @@ sed -e "s/DATE/$date/" < $srcdir/version.in > version.tmp echo '#include "version.h"' >> version.c-tmp echo 'const char version[] = "'"`sed q version.tmp`"'";' >> version.c-tmp echo 'const char host_name[] = "'"$host_alias"'";' >> version.c-tmp - -if [ "$#" = "4" ]; then - echo 'const char target_name[] = "'"$target_alias"'";' >> version.c-tmp -fi - +echo 'const char target_name[] = "'"$target_alias"'";' >> version.c-tmp mv version.c-tmp $output rm -f version.tmp diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index db4e086..d6c3ea8 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -20,8 +20,6 @@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ target_alias = @target_alias@ -version_host = @version_host@ -version_target = @version_target@ program_transform_name = @program_transform_name@ bindir = @bindir@ libdir = @libdir@ @@ -393,7 +391,7 @@ force: version.c: Makefile $(srcdir)/../version.in $(srcdir)/../../bfd/version.h $(srcdir)/../common/create-version.sh $(SHELL) $(srcdir)/../common/create-version.sh $(srcdir)/.. \ - $(version_host) $(version_target) version.c + $(host_alias) $(target_alias) version.c xml-builtin.c: stamp-xml; @true stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES) diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index 49b9ab6..173797a 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -589,8 +589,6 @@ ac_includes_default="\ #endif" ac_subst_vars='LTLIBOBJS -version_target -version_host GNULIB_STDINT_H extra_libraries IPA_DEPFILES @@ -5928,14 +5926,6 @@ if test x"$STDINT_H" != x; then fi -# 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_config_files="$ac_config_files Makefile" ac_config_commands="$ac_config_commands default" diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac index 2658bef..95bb0c6 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac @@ -471,14 +471,6 @@ if test x"$STDINT_H" != x; then fi AC_SUBST(GNULIB_STDINT_H) -# 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) - AC_OUTPUT(Makefile, [case x$CONFIG_HEADERS in xconfig.h:config.in) -- 1.7.7.6