Devang Patel
2008-Jul-10 00:58 UTC
[LLVMdev] Including svn version number in --version output
It is very useful to have svn version number encoded in llvm-gcc's -- version output. Here is one approach. Anyone has a better patch ? - Devang Index: Makefile.in ==================================================================--- Makefile.in (revision 53385) +++ Makefile.in (working copy) @@ -802,6 +802,9 @@ DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\"" DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\"" +SVNVER_c := $(shell svnversion $(abs_srcdir) ) +SVNVER_s := "\"$(if $(SVNVER_c), $(SVNVER_c))\"" + # Shorthand variables for dependency lists. TARGET_H = $(TM_H) target.h insn-modes.h MACHMODE_H = machmode.h mode-classes.def insn-modes.h @@ -2048,9 +2051,11 @@ dumpvers: dumpvers.c -version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) +.PHONY: version.o +version.o: $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ + -DSVNVER=$(SVNVER_s) \ -DDEVPHASE=$(DEVPHASE_s) -c $(srcdir)/version.c $(OUTPUT_OPTION) gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $ (TM_H) \ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080709/d8787d5a/attachment.html>
Mike Stump
2008-Jul-10 01:04 UTC
[LLVMdev] Including svn version number in --version output
On Jul 9, 2008, at 5:58 PM, Devang Patel wrote:> It is very useful to have svn version number encoded in llvm-gcc's -- > version output. Here is one approach. > > Anyone has a better patch ?Nope. I looked at how to do this and didn't find a good solution, so I think this is around the best that can be done.
Devang Patel
2008-Jul-10 01:13 UTC
[LLVMdev] Including svn version number in --version output
On Jul 9, 2008, at 6:13 PM, Tanya M. Lattner wrote:> > Why not set the VERSUFFIX to be " (Based on Apple Inc. build 5555) > (LLVM > rXXXX)" > > Where you set the revision number?I do not want to set the revision number in a source file every time I do 'svn update' :)> We currently use LLVM_VERSION_INFO to set this sort of information > and to > me it makes more sense to have the svn rev number there instead of > just > saying LLVM build like it does now.LLVM_VERSION_INFO indicates build numbers.> -Tanya > > On Wed, 9 Jul 2008, Devang Patel wrote: > >> It is very useful to have svn version number encoded in llvm-gcc's >> --version >> output. Here is one approach. >> >> Anyone has a better patch ? >> - >> Devang >> >> >> >> Index: Makefile.in >> ==================================================================>> --- Makefile.in (revision 53385) >> +++ Makefile.in (working copy) >> @@ -802,6 +802,9 @@ >> DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\"" >> DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\"" >> >> +SVNVER_c := $(shell svnversion $(abs_srcdir) ) >> +SVNVER_s := "\"$(if $(SVNVER_c), $(SVNVER_c))\"" >> + >> # Shorthand variables for dependency lists. >> TARGET_H = $(TM_H) target.h insn-modes.h >> MACHMODE_H = machmode.h mode-classes.def insn-modes.h >> @@ -2048,9 +2051,11 @@ >> >> dumpvers: dumpvers.c >> >> -version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) >> +.PHONY: version.o >> +version.o: >> $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ >> -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ >> + -DSVNVER=$(SVNVER_s) \ >> -DDEVPHASE=$(DEVPHASE_s) -c $(srcdir)/version.c $(OUTPUT_OPTION) >> >> gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $ >> (TM_H) \ >> >> >> > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev- Devang
Tanya M. Lattner
2008-Jul-10 01:13 UTC
[LLVMdev] Including svn version number in --version output
Why not set the VERSUFFIX to be " (Based on Apple Inc. build 5555) (LLVM rXXXX)" Where you set the revision number? We currently use LLVM_VERSION_INFO to set this sort of information and to me it makes more sense to have the svn rev number there instead of just saying LLVM build like it does now. -Tanya On Wed, 9 Jul 2008, Devang Patel wrote:> It is very useful to have svn version number encoded in llvm-gcc's --version > output. Here is one approach. > > Anyone has a better patch ? > - > Devang > > > > Index: Makefile.in > ==================================================================> --- Makefile.in (revision 53385) > +++ Makefile.in (working copy) > @@ -802,6 +802,9 @@ > DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\"" > DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\"" > > +SVNVER_c := $(shell svnversion $(abs_srcdir) ) > +SVNVER_s := "\"$(if $(SVNVER_c), $(SVNVER_c))\"" > + > # Shorthand variables for dependency lists. > TARGET_H = $(TM_H) target.h insn-modes.h > MACHMODE_H = machmode.h mode-classes.def insn-modes.h > @@ -2048,9 +2051,11 @@ > > dumpvers: dumpvers.c > > -version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE) > +.PHONY: version.o > +version.o: > $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) \ > -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \ > + -DSVNVER=$(SVNVER_s) \ > -DDEVPHASE=$(DEVPHASE_s) -c $(srcdir)/version.c $(OUTPUT_OPTION) > > gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ > > >
Possibly Parallel Threads
- [LLVMdev] Including svn version number in --version output
- [LLVMdev] Including svn version number in --version output
- [LLVMdev] Including svn version number in --version output
- [LLVMdev] Including svn version number in --version output
- [LLVMdev] Including svn version number in --version output