From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24149 invoked by alias); 26 Jun 2013 02:08:08 -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 24092 invoked by uid 89); 26 Jun 2013 02:08:02 -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, 26 Jun 2013 02:08:00 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Urf9K-0000mZ-P7 from Yao_Qi@mentor.com ; Tue, 25 Jun 2013 19:07:58 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 25 Jun 2013 19:07:58 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.2.247.3; Tue, 25 Jun 2013 19:07:57 -0700 Message-ID: <51CA4CDB.6010405@codesourcery.com> Date: Wed, 26 Jun 2013 02:45: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: Tom Tromey CC: Subject: Re: [PATCH v5] don't keep a gdb-specific date References: <1371835865-15879-1-git-send-email-tromey@redhat.com> In-Reply-To: <1371835865-15879-1-git-send-email-tromey@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-SW-Source: 2013-06/txt/msg00751.txt.bz2 On 06/22/2013 01:31 AM, Tom Tromey wrote: > +# Create version.c from version.in. > +# Usage: > +# create-version.sh PATH-TO-GDB-SRCDIR HOST_ALIAS \ > +# TARGET_ALIAS OUTPUT-FILE-NAME > + > +srcdir="$1" > +host_alias="$2" > +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` > +sed -e "s/DATE/$date/" < $srcdir/common/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 > +echo 'const char target_name[] = "$target_alias";' >> version.c-tmp > +mv version.c-tmp $output > +rm -f version.tmp This script breaks the build of GDBServer, /bin/sh ../../git/gdb/gdbserver/../common/create-version.sh ../../git/gdb/gdbserver/.. \ mips-linux version.c mv: missing destination file operand after `version.c-tmp' Try `mv --help' for more information. mips-linux-gnu-gcc -g -O2 -I. -I../../git/gdb/gdbserver -I../../git/gdb/gdbserver/../common -I../../git/gdb/gdbserver/../regformats -I../../git/gdb/gdbserver/../../include -I../../git/gdb/gdbserver/../gnulib/import -Ibuild-gnulib-gdbserver/import -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Wempty-body -Werror -DGDBSERVER -c -o version.o -MT version.o -MMD -MP -MF .deps/version.Tpo version.c mips-linux-gnu-gcc: error: version.c: No such file or directory the gdbserver is configured as ../../git/gdb/gdbserver/configure --host=mips-linux the target_alias is empty. The doc of autoconf says "The variables ‘build_alias’, ‘host_alias’, and ‘target_alias’ are always exactly the arguments of --build, --host, and --target; in particular, they are left empty if the user did not use them, even if the corresponding AC_CANONICAL macro was run.", so target_alias can be empty. > diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in > index e8470a8..e5ecdd3 100644 > --- a/gdb/gdbserver/Makefile.in > +++ b/gdb/gdbserver/Makefile.in > @@ -389,13 +389,9 @@ am--refresh: > > force: > > -version.c: Makefile $(srcdir)/../version.in > - rm -f version.c-tmp version.c > - echo '#include "server.h"' >> version.c-tmp > - echo 'const char version[] = "'"`sed q ${srcdir}/../version.in`"'";' >> version.c-tmp > - echo 'const char host_name[] = "$(host_alias)";' >> version.c-tmp > - mv version.c-tmp version.c > -version.o: version.c $(server_h) > +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 On the other hand, original code here only echo 'host_alias' to version.c. This patch is to handle the case that 'target_alias' is empty, and unbreak the gdbserver build. -- Yao (齐尧) gdb: 2013-06-26 Yao Qi * common/create-version.sh: Update comments. Handle the case that TARGET_ALIAS is empty. --- gdb/common/create-version.sh | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/gdb/common/create-version.sh b/gdb/common/create-version.sh index 2bf1a9b..53d6173 100755 --- a/gdb/common/create-version.sh +++ b/gdb/common/create-version.sh @@ -20,12 +20,17 @@ # 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" -target_alias="$3" -output="$4" + +if [ "$#" = "4" ]; then + target_alias="$3" + output="$4" +else + output="$3" +fi rm -f version.c-tmp $output version.tmp date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$/\1/p' $srcdir/../bfd/version.h` @@ -33,6 +38,10 @@ sed -e "s/DATE/$date/" < $srcdir/common/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 -echo 'const char target_name[] = "'"$target_alias"'";' >> version.c-tmp + +if [ "$#" = "4" ]; then + echo 'const char target_name[] = "'"$target_alias"'";' >> version.c-tmp +fi + mv version.c-tmp $output rm -f version.tmp -- 1.7.7.6