This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH: bfdver.h fix
- From: Ben Elliston <bje at au dot ibm dot com>
- To: binutils at sources dot redhat dot com
- Date: 22 May 2004 22:19:04 +1000
- Subject: PATCH: bfdver.h fix
My patch earlier today to remove the config.status dependency on
version.h was a good first step, but not complete. Here is a patch
that makes it work correctly. It's still by no means beautiful, but
it's slightly cleaner than generating bfdver.h from configure and is
faster.
Okay to commit? BTW, will this upset any release scripts?
Ben
2004-05-22 Ben Elliston <bje@au.ibm.com>
* configure.in (is_release): Remove.
(bfd_version_date, bfd_version, bfd_version_string): Likewise.
(AC_OUTPUT): Don't output bfdver.h from version.h.
* configure: Regenerate.
* Makefile.am (RELEASE): New variable.
(bfdver.h): New target.
* Makefile.in: Regenerate.
Index: configure.in
===================================================================
RCS file: /cvs/src/src/bfd/configure.in,v
retrieving revision 1.151
diff -u -r1.151 configure.in
--- configure.in 6 May 2004 02:46:29 -0000 1.151
+++ configure.in 22 May 2004 12:14:33 -0000
@@ -8,20 +8,6 @@
AC_ISC_POSIX
AM_INIT_AUTOMAKE(bfd, 2.15.91)
-# Uncomment the next line to remove the date from the reported bfd version
-#is_release=y
-
-changequote(,)dnl
-bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$/\1\2\3\4\5/'`
-changequote([,])dnl
-
-bfd_version_string="\"${VERSION}\""
-if test x${is_release} = x; then
- bfd_version_date=`sed -n -e 's/.*DATE //p' < ${srcdir}/version.h`
- bfd_version_string="\"${VERSION} ${bfd_version_date}\""
-fi
-AC_SUBST(bfd_version)
-AC_SUBST(bfd_version_string)
dnl These must be called before AM_PROG_LIBTOOL, because it may want
dnl to call AC_CHECK_PROG.
@@ -945,6 +931,6 @@
esac
rm -f doc/config.status
-AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h bfdver.h:version.h po/Makefile.in:po/Make-in,
+AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in,
[sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile])
Index: Makefile.am
===================================================================
RCS file: /cvs/src/src/bfd/Makefile.am,v
retrieving revision 1.133
diff -u -r1.133 Makefile.am
--- Makefile.am 22 May 2004 06:06:22 -0000 1.133
+++ Makefile.am 22 May 2004 12:14:36 -0000
@@ -2,6 +2,9 @@
AUTOMAKE_OPTIONS = cygnus
+# Uncomment the following line when doing a release.
+# RELEASE=y
+
INCDIR = $(srcdir)/../include
CSEARCH = -I. -I$(srcdir) -I$(INCDIR)
MKDEP = gcc -MM
@@ -863,6 +866,16 @@
# We want to rerun configure if configure, config.bfd or configure.host change.
config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host
$(SHELL) ./config.status --recheck
+
+bfdver.h: version.h
+ @echo "creating $@"
+ @bfd_version=`echo "$(VERSION)" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\
+ bfd_version_string="\"$(VERSION)\"" ;\
+ if test "x$(RELEASE)" = x ; then \
+ bfd_version_date=`sed -n -e 's/.*DATE //p' < $<` ;\
+ bfd_version_string="\"$(VERSION) $${bfd_version_date}\"" ;\
+ fi ;\
+ sed -e "s/@bfd_version@/$$bfd_version/" -e "s/@bfd_version_string@/$$bfd_version_string/" < $< > $@
# What appears below is generated by a hacked mkdep using gcc -MM.