This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH, RFC: align sim/common/create-version.sh with gdb/common/create-version.sh


There are two create-version.sh; {sim,gdb}/common/create-version.sh.

The toplevel src-release script, when building a release-style
tarball, makes use of any $(TOOL)/common/create-version.sh and assumes
a single calling convention, that of the gdb one.  This aligns
sim/common/create-version.sh and its users to the gdb one, in
preparation for src-release support for creating a release-style sim
tarball.  There are no releases of sim, but that will be useful for
those of us who need or want an official kind-of source-level
separation when we no longer can use the cvs "sim" checkout module.
(The gdb one as you know, includes sim, and the planned binutils+gdb
git will not have that kind of separation.  Please, no lectures on git
sparse checkouts.)

Tested by building sim for ppc-eabisim and cris-elf and checking
specifically that sim/<simsubdir>/version.c still is created as
intended and has the intended contents.

I'll commit this before or soon after the git move, or as soon as the
src-release patch is approved.  Or not at all if there's a convincing
argument.

Less non-obvious changes to src-release and not fibbing with CVS
modules are two reasons why this is simpler and more desirable than
removing sim/common/create-version.sh and instead making
sim/{common,ppc}/Makefile.in directly call
../../gdb/common/create-version.sh.  A third one is that sharing that
file would be *less* separation...

sim/common:
	* create-version.sh: Align parameters to match those of
	../../gdb/common/create-version.sh.
	* Make-common.in (srcsim): New variable.
	(version.c): Adjust call to create-version.sh as per above.

sim/ppc:
	* Makefile.in (srcsim): New variable.
	(version.c): Adjust call to $(srccom)/create-version.sh as per change.

Index: sim/common/Make-common.in
===================================================================
RCS file: /cvs/src/src/sim/common/Make-common.in,v
retrieving revision 1.47
diff -p -u -r1.47 Make-common.in
--- sim/common/Make-common.in	28 Jun 2013 18:59:51 -0000	1.47
+++ sim/common/Make-common.in	6 Sep 2013 23:00:01 -0000
@@ -38,6 +38,7 @@ VPATH = @srcdir@:$(srccom)
 srcdir = @srcdir@
 srccom = $(srcdir)/../common
 srcroot = $(srcdir)/../..
+srcsim = $(srcdir)/..

 prefix = @prefix@
 exec_prefix = @exec_prefix@
@@ -301,7 +302,7 @@ stamp-tvals: gentmap
 	touch stamp-tvals

 version.c: Makefile $(srccom)/create-version.sh ../../bfd/version.h ../../gdb/version.in
-	$(SHELL) $(srccom)/create-version.sh $(srccom) version.c
+	$(SHELL) $(srccom)/create-version.sh $(srcsim) $(host_alias) $(target_alias) version.c

 #
 # Rules for building sim-* components.  Triggered by listing the corresponding
Index: sim/common/create-version.sh
===================================================================
RCS file: /cvs/src/src/sim/common/create-version.sh,v
retrieving revision 1.2
diff -p -u -r1.2 create-version.sh
--- sim/common/create-version.sh	28 Jun 2013 18:59:51 -0000	1.2
+++ sim/common/create-version.sh	6 Sep 2013 23:00:01 -0000
@@ -17,16 +17,21 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.

-# Create version.c from version.in.
+# Create version.c from $1/../gdb/version.in.
+# Please keep the same API as $1/../gdb/common/create-version.sh so
+# they can be called the same way, from e.g. $srcroot/src-release.
 # Usage:
-#    create-version.sh PATH-TO-COMMON-SIM-SRCDIR OUTPUT-FILE-NAME
+#    create-version.sh PATH-TO-SIM-SRCDIR HOST_ALIAS \
+#        TARGET_ALIAS OUTPUT-FILE-NAME

 srcdir="$1"
-output="$2"
+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/../../gdb/version.in > version.tmp
+date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$/\1/p' $srcdir/../bfd/version.h`
+sed -e "s/DATE/$date/" < $srcdir/../gdb/version.in > version.tmp
 echo '#include "version.h"' >> version.c-tmp
 echo 'const char version[] = "'"`sed q version.tmp`"'";' >> version.c-tmp
 mv version.c-tmp $output
Index: sim/ppc/Makefile.in
===================================================================
RCS file: /cvs/src/src/sim/ppc/Makefile.in,v
retrieving revision 1.32
diff -p -u -r1.32 Makefile.in
--- sim/ppc/Makefile.in	28 Jun 2013 18:59:51 -0000	1.32
+++ sim/ppc/Makefile.in	6 Sep 2013 23:00:02 -0000
@@ -23,6 +23,7 @@ VPATH = @srcdir@
 srcdir = @srcdir@
 srccom = $(srcdir)/../common
 srcroot = $(srcdir)/../..
+srcsim = $(srcdir)/..

 prefix = @prefix@
 exec_prefix = @exec_prefix@
@@ -564,7 +565,7 @@ $(TARGETLIB): tmp-igen tmp-dgen tmp-hw t
 	$(RANLIB) $(TARGETLIB)

 version.c: Makefile $(srccom)/create-version.sh ../../bfd/version.h ../../gdb/version.in
-	$(SHELL) $(srccom)/create-version.sh $(srccom) version.c
+	$(SHELL) $(srccom)/create-version.sh $(srcsim) $(host_alias) $(target_alias) version.c
 version.o: version.c $(version_h)

 psim.o: psim.c $(CPU_H) $(IDECODE_H) $(OPTIONS_H) $(TREE_H) $(BFD_H)

brgds, H-P
(self-proclaimed sim-separatist, though puns on political parallels are "too soon")


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]