GNU Binutils with patches for OS216
リビジョン | 975c2216a1c8baa37b4c05695b4c66e455e4eec9 (tree) |
---|---|
日時 | 2015-01-07 03:18:22 |
作者 | H.J. Lu <hjl.tools@gmai...> |
コミッター | H.J. Lu |
Add git commit info to BFD_VERSION_STRING
GNU ld (GNU Binutils) 2.25.51.20150106
@@ -1037,8 +1037,23 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in | ||
1037 | 1037 | report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ |
1038 | 1038 | . $(srcdir)/development.sh ;\ |
1039 | 1039 | if test "$$development" = true ; then \ |
1040 | - bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\ | |
1041 | - bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\ | |
1040 | + if test -e $(srcdir)/../.git; then \ | |
1041 | + here=`pwd`; \ | |
1042 | + cd $(srcdir); \ | |
1043 | + bfd_version_date=`git log -1 --pretty=%ci | awk '{ print $$1 }' | sed -e "s/-//g"` ;\ | |
1044 | + bfd_remote_git_repo=`git remote -v | grep fetch | awk '{ print $$2 }'` ;\ | |
1045 | + case $$bfd_remote_git_repo in \ | |
1046 | + *sourceware.org/git/binutils-gdb.git) \ | |
1047 | + bfd_remote_git_repo="git://sourceware.org/git/binutils.git";; \ | |
1048 | + esac; \ | |
1049 | + bfd_git_branch=`git status | grep "On branch" | sed -e "s/.*On branch //"` ;\ | |
1050 | + bfd_git_commit=`git log -1 --pretty=%H` ;\ | |
1051 | + bfd_version_string="\"$(VERSION).$${bfd_version_date}\\\n from $$bfd_remote_git_repo commit $$bfd_git_commit on $$bfd_git_branch\"" ;\ | |
1052 | + cd $$here; \ | |
1053 | + else \ | |
1054 | + bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\ | |
1055 | + bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\ | |
1056 | + fi ;\ | |
1042 | 1057 | bfd_soversion="$(VERSION).$${bfd_version_date}" ;\ |
1043 | 1058 | fi ;\ |
1044 | 1059 | sed -e "s,@bfd_version@,$$bfd_version," \ |
@@ -2099,8 +2099,23 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in | ||
2099 | 2099 | report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ |
2100 | 2100 | . $(srcdir)/development.sh ;\ |
2101 | 2101 | if test "$$development" = true ; then \ |
2102 | - bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\ | |
2103 | - bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\ | |
2102 | + if test -e $(srcdir)/../.git; then \ | |
2103 | + here=`pwd`; \ | |
2104 | + cd $(srcdir); \ | |
2105 | + bfd_version_date=`git log -1 --pretty=%ci | awk '{ print $$1 }' | sed -e "s/-//g"` ;\ | |
2106 | + bfd_remote_git_repo=`git remote -v | grep fetch | awk '{ print $$2 }'` ;\ | |
2107 | + case $$bfd_remote_git_repo in \ | |
2108 | + *sourceware.org/git/binutils-gdb.git) \ | |
2109 | + bfd_remote_git_repo="git://sourceware.org/git/binutils.git";; \ | |
2110 | + esac; \ | |
2111 | + bfd_git_branch=`git status | grep "On branch" | sed -e "s/.*On branch //"` ;\ | |
2112 | + bfd_git_commit=`git log -1 --pretty=%H` ;\ | |
2113 | + bfd_version_string="\"$(VERSION).$${bfd_version_date}\\\n from $$bfd_remote_git_repo commit $$bfd_git_commit on $$bfd_git_branch\"" ;\ | |
2114 | + cd $$here; \ | |
2115 | + else \ | |
2116 | + bfd_version_date=`sed -n -e 's/.*DATE //p' < $(srcdir)/version.h` ;\ | |
2117 | + bfd_version_string="\"$(VERSION).$${bfd_version_date}\"" ;\ | |
2118 | + fi ;\ | |
2104 | 2119 | bfd_soversion="$(VERSION).$${bfd_version_date}" ;\ |
2105 | 2120 | fi ;\ |
2106 | 2121 | sed -e "s,@bfd_version@,$$bfd_version," \ |