This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: One version number to rule them all
- From: Zack Weinberg <zack at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Mark Mitchell <mark at codesourcery dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>, DJ Delorie <dj at delorie dot com>
- Date: Wed, 02 Mar 2005 22:20:35 -0800
- Subject: Patch: One version number to rule them all
... sort of.
This patch establishes three files in the toplevel config/ directory,
named GCC-BASE-VER, GCC-DEV-PHASE, and DATESTAMP. These contain,
respectively, the base version number; "experimental", "prerelease",
or nothing; and the datestamp or nothing; in all cases with no
additional characters. version.c and gcc-common.texi determine what
they need to know from these files (with help from the Makefile) and
everything else in the gcc subdirectory that used to dig through
version.c now reads one or more of these files (notably, the Makefile
and gcov-iov.c) or has had its need for a hardcoded version number
eliminated (gccbug, formerly gccbug.in). I also attempted to update
the update_version and update_web_docs maintainer scripts.
There is still a second copy of the datestamp in
libstdc++/include/bits/c++config, and I have not updated any
documentation nor the gcc_release script. Also, due to the absence of
a TeX installation on the machine I was testing on, I was not able to
verify that 'make dvi' still works.
I would appreciate help as follows:
- Advice as to the best way to deal with c++config.
- Advice as to how to make gcc_release work with this new scheme
without breaking for older release branches.
- Help finding all the places where the documentation needs updating.
- A close eye over all of these changes, especially the maintainer
scripts which cannot be tested in advance of commitment.
- Pointing out any other scripts (except gcc_release) which need
updating.
- Better ideas for dealing with gcc-common.texi.
I propose to leave updating gcc_release until after all these changes
have gone in and are demonstrated to be stable. That script is very
complicated and I don't want to mess with it until I'm sure what the
final arrangement looks like.
N.B. I had to update fastjar/Makefile.in by hand because it wants yet
another version of automake I don't have. Grumble.
zw
config:
* DATESTAMP, GCC-BASE-VER, GCC-DEV-PHASE: New files.
* gcc-version.m4: Delete.
fastjar:
* Makefile.am (BASEVER, DEVPHASE): New variables.
(fastjar_TEXINFOS): Add gcc-vers.texi.
(gcc-vers.texi): New rule.
* Makefile.in: Regenerate (by hand).
gcc:
* Makefile.in (gcc_version, gcc_version_trigger): Delete.
(BASEVER, DATESTAMP, DEVPHASE, BASEVER_c, DATESTAMP_c, DEVPHASE_c)
(BASEVER_s, DATESTAMP_s, DEVPHASE_s): New variables.
(version): Define in terms of above.
(gccbug): Delete rule.
(Makefile, config.status, build/gcov-iov.o): No longer depends
on version.c.
(version.o): Depend on $(BASEVER), $(DATESTAMP), $(DEVPHASE).
Add custom compile command.
(prefix.o): Depend on $(BASEVER). Add -DBASEVER to compile command.
(s-iov): Depend on $(BASEVER) and $(DEVPHASE); adjust
invocation of gcov-iov.
(TEXI_CPP_FILES, TEXI_GCC_FILES, TEXI_GCCINT_FILES): Add gcc-vers.texi.
(gcc-vers.texi): New rule.
(doc/%.info, doc/%.dvi, doc/gccinstall.dvi): Add -I . for gcc-vers.texi.
(PACKAGE): Delete variable. All uses replaced with "gcc".
* aclocal.m4: Don't include gcc-version.m4.
* configure.ac: Don't invoke TL_AC_GCC_VERSION. Don't provide
PACKAGE, VERSION, gcc_version, gcc_version_trigger; all
references to gcc_version replaced with plain version.
Restructure code for --enable-win32-registry. When absolutely
necessary, look in $srcdir/../config/GCC-BASE-VER for GCC
version number. Do not generate gccbug.
* config.in, configure: Regenerate.
* gccbug.in: Rename to ...
* gccbug: ... this. Probe associated GCC for its version
number at invocation time.
* gcov-iov.c: Unconditionally include stdio.h and stdlib.h,
and no others. Get the version number from argv[1] and the
development phase from argv[2].
* intl.c: Replace PACKAGE with "gcc" throughout.
* libada-mk.in: Remove gcc_version, unused.
* prefix.c: Default WIN32_REGISTRY_KEY to BASEVER.
* version.c (VERSUFFIX): New, hook for convenient modification
of version string by redistributors. Update commentary to match.
(version_string): Build up from BASEVER, DATESTAMP, DEVPHASE,
VERSUFFIX; former three are defined by Makefile.
* config/alpha/x-vms: Use $(BASEVER_c), not $(gcc_version).
* config/i386/t-nwld: Use $(version), not $(gcc_version).
* doc/include/gcc-common.texi: Include gcc-vers.texi for
version-GCC and DEVELOPMENT flag.
gcc/ada:
* Make-lang.in (doc/gnat_ugn_unw.info, doc/gnat_rm.info)
(doc/gnat_ugn_unw.dvi, doc/gnat_rm.dvi): Depend on gcc-vers.texi.
gcc/fortran:
* Make-lang.in (GFORTRAN_TEXI): Add gcc-vers.texi.
gcc/java:
* Make-lang.in (TEXI_JAVA_FILES): Add gcc-vers.texi.
gcc/treelang:
* Make-lang.in (TEXI_TREELANG_FILES): Add gcc-vers.texi.
maintainer-scripts:
* update_version: Also process gcc/config/DATESTAMP if it exists.
* update-web-docs: Get config/GCC-BASE-VER and config/GCC-DEV-PHASE
as well, and generate gcc-vers.texi from them.
===================================================================
Index: config/DATESTAMP
--- config/DATESTAMP 1 Jan 1970 00:00:00 -0000
+++ config/DATESTAMP 3 Mar 2005 05:51:59 -0000
@@ -0,0 +1 @@
+20050302
===================================================================
Index: config/GCC-BASE-VER
--- config/GCC-BASE-VER 1 Jan 1970 00:00:00 -0000
+++ config/GCC-BASE-VER 3 Mar 2005 05:51:59 -0000
@@ -0,0 +1 @@
+4.1.0
===================================================================
Index: config/GCC-DEV-PHASE
--- config/GCC-DEV-PHASE 1 Jan 1970 00:00:00 -0000
+++ config/GCC-DEV-PHASE 3 Mar 2005 05:51:59 -0000
@@ -0,0 +1 @@
+experimental
===================================================================
Index: config/gcc-version.m4
--- config/gcc-version.m4 2 Dec 2004 11:03:18 -0000 1.1
+++ config/gcc-version.m4 1 Jan 1970 00:00:00 -0000
@@ -1,28 +0,0 @@
-dnl Usage: TL_AC_GCC_VERSION(TOPSRCDIR)
-dnl
-dnl Set up the variables:
-dnl
-dnl gcc_version_trigger: pathname of gcc's version.c, if available
-dnl gcc_version_full: full gcc version string
-dnl gcc_version: the first "word" in $gcc_version_full
-dnl
-dnl TOPSRCDIR is the top-level source directory.
-AC_DEFUN([TL_AC_GCC_VERSION],
-[
-changequote(,)dnl
-if test "${with_gcc_version_trigger+set}" = set; then
- gcc_version_trigger=$with_gcc_version_trigger
-else
- gcc_version_trigger=$1/gcc/version.c
-fi
-if test -f "${gcc_version_trigger}"; then
- gcc_version_full=`grep version_string "${gcc_version_trigger}" | sed -e 's/.*"\([^"]*\)".*/\1/'`
-else
- gcc_version_full=`$CC -v 2>&1 | sed -n 's/^gcc version //p'`
-fi
-gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
-changequote([,])dnl
-AC_SUBST(gcc_version_trigger)
-AC_SUBST(gcc_version_full)
-AC_SUBST(gcc_version)
-])dnl
===================================================================
Index: fastjar/Makefile.am
--- fastjar/Makefile.am 15 Nov 2004 23:50:05 -0000 1.22
+++ fastjar/Makefile.am 3 Mar 2005 05:52:00 -0000
@@ -63,7 +63,8 @@ TEXINFO_TEX = ../gcc/doc/include/texinfo
info_TEXINFOS = fastjar.texi
fastjar_TEXINFOS = \
../gcc/doc/include/gcc-common.texi \
- ../gcc/doc/include/gpl.texi
+ ../gcc/doc/include/gpl.texi \
+ gcc-vers.texi
man_MANS = fastjar.1 grepjar.1
EXTRA_DIST = $(man_MANS)
@@ -83,6 +84,17 @@ fastjar.pod: $(srcdir)/fastjar.texi
grepjar.pod: $(srcdir)/fastjar.texi
-$(TEXI2POD) -D grepjar $< > $@
+# gcc-vers.texi is generated from the version files.
+BASEVER = $(srcdir)/../config/GCC-BASE-VER
+DEVPHASE = $(srcdir)/../config/GCC-DEV-PHASE
+gcc-vers.texi: $(BASEVER) $(DEVPHASE)
+ (echo "@set version-GCC $(shell cat $(BASEVER))"; \
+ if [ "$(shell cat $(DEVPHASE))" = "experimental" ]; \
+ then echo "@set DEVELOPMENT"; \
+ else echo "@clear DEVELOPMENT"; \
+ fi) > $@T
+ mv -f $@T $@
+
# GCC LOCAL CHANGE
# The following commands allow us to release tarballs with the man pages
# and info documentation prebuilt. This feature is enabled via
===================================================================
Index: fastjar/Makefile.in
--- fastjar/Makefile.in 2 Dec 2004 11:03:20 -0000 1.30
+++ fastjar/Makefile.in 3 Mar 2005 05:52:00 -0000
@@ -253,12 +253,14 @@ TEXINFO_TEX = ../gcc/doc/include/texinfo
info_TEXINFOS = fastjar.texi
fastjar_TEXINFOS = \
../gcc/doc/include/gcc-common.texi \
- ../gcc/doc/include/gpl.texi
-
+ ../gcc/doc/include/gpl.texi \
+ gcc-vers.texi
man_MANS = fastjar.1 grepjar.1
EXTRA_DIST = $(man_MANS)
TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
POD2MAN = pod2man --center="GNU" --release="gcc-@gcc_version@"
+BASEVER = $(srcdir)/../config/GCC-BASE-VER
+DEVPHASE = $(srcdir)/../config/GCC-DEV-PHASE
@GENINSRC_FALSE@STAMP_GENINSRC =
# GCC LOCAL CHANGE
@@ -924,6 +926,15 @@ fastjar.pod: $(srcdir)/fastjar.texi
grepjar.pod: $(srcdir)/fastjar.texi
-$(TEXI2POD) -D grepjar $< > $@
+# gcc-vers.texi is generated from the version files.
+gcc-vers.texi: $(BASEVER) $(DEVPHASE)
+ (echo "@set version-GCC $(shell cat $(BASEVER))"; \
+ if [ "$(shell cat $(DEVPHASE))" = "experimental" ]; \
+ then echo "@set DEVELOPMENT"; \
+ else echo "@clear DEVELOPMENT"; \
+ fi) > $@T
+ mv -f $@T $@
+
all-local: $(STAMP_GENINSRC)
stamp-geninsrc: fastjar.1 grepjar.1 fastjar.info
===================================================================
Index: gcc/Makefile.in
--- gcc/Makefile.in 1 Mar 2005 17:58:59 -0000 1.1450
+++ gcc/Makefile.in 3 Mar 2005 05:52:00 -0000
@@ -426,10 +426,6 @@ OBJC_BOEHM_GC=@objc_boehm_gc@
GTHREAD_FLAGS=@gthread_flags@
extra_modes_file=@extra_modes_file@
host_hook_obj=@out_host_hook_obj@
-# Be prepared for gcc2 merges.
-gcc_version=@gcc_version@
-gcc_version_trigger=@gcc_version_trigger@
-version=$(gcc_version)
# ------------------------
# Installation directories
@@ -687,6 +683,27 @@ TM_P_H = tm_p.h $(tm_p_file_list)
GTM_H = tm.h $(tm_file_list)
TM_H = $(GTM_H) insn-constants.h insn-flags.h
+# Variables for version information.
+BASEVER = $(srcdir)/../config/GCC-BASE-VER # 4.x.y
+DATESTAMP = $(srcdir)/../config/DATESTAMP # YYYYMMDD or empty
+DEVPHASE = $(srcdir)/../config/GCC-DEV-PHASE # experimental, prerelease, ""
+
+BASEVER_c = $(shell cat $(BASEVER))
+DATESTAMP_c = $(shell cat $(DATESTAMP))
+DEVPHASE_c = $(shell cat $(DEVPHASE))
+
+version = $(BASEVER_c)
+
+# For use in version.c - double quoted strings, with a leading space
+# on the datestamp if it is nonempty, and a leading space and
+# parentheses around the development phase if it is nonempty. The
+# space immediately after the comma in the $(if ...) constructs is
+# significant - do not remove it.
+BASEVER_s = "\"$(BASEVER_c)\""
+DATESTAMP_s = "\"$(if $(DATESTAMP_c), $(DATESTAMP_c))\""
+DEVPHASE_s = "\"$(if $(DEVPHASE_c), ($(DEVPHASE_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
HOOKS_H = hooks.h $(MACHMODE_H)
@@ -1038,7 +1055,7 @@ endif
# Rebuilding this configuration
# -----------------------------
-Makefile: config.status $(srcdir)/Makefile.in $(srcdir)/version.c $(LANG_MAKEFRAGS)
+Makefile: config.status $(srcdir)/Makefile.in $(LANG_MAKEFRAGS)
LANGUAGES="$(CONFIG_LANGUAGES)" \
CONFIG_HEADERS= \
CONFIG_SHELL="$(SHELL)" \
@@ -1083,9 +1100,6 @@ cs-tm_p.h: Makefile
$(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac
(cd $(srcdir) && autoconf)
-gccbug: $(srcdir)/gccbug.in
- CONFIG_FILES=gccbug CONFIG_HEADERS= ./config.status
-
mklibgcc: $(srcdir)/mklibgcc.in
CONFIG_FILES=mklibgcc CONFIG_HEADERS= ./config.status
@@ -1115,7 +1129,7 @@ cstamp-h: config.in config.status
# Really, really stupid make features, such as SUN's KEEP_STATE, may force
# a target to build even if it is up-to-date. So we must verify that
# config.status does not exist before failing.
-config.status: $(srcdir)/configure $(srcdir)/config.gcc version.c
+config.status: $(srcdir)/configure $(srcdir)/config.gcc
@if [ ! -f config.status ] ; then \
echo You must configure gcc. Look at http://gcc.gnu.org/install/ for details.; \
false; \
@@ -1547,7 +1561,12 @@ options.o: options.c options.h opts.h in
dumpvers: dumpvers.c
-version.o: version.c version.h
+# The space between the comma and the $(shell cat $(DATESTAMP)) below
+# is significant. Do not reformat that line.
+version.o: version.c version.h $(DATESTAMP) $(BASEVER) $(DEVPHASE)
+ $(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+ -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
+ -DDEVPHASE=$(DEVPHASE_s) -c $(srcdir)/version.c $(OUTPUT_OPTION)
gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
varray.h $(HASHTAB_H) $(SPLAY_TREE_H) bitmap.h $(TREE_H) $(RTL_H) \
@@ -1569,9 +1588,10 @@ ggc-none.o: ggc-none.c $(CONFIG_H) $(SYS
stringpool.o: stringpool.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) $(GGC_H) gt-stringpool.h
-prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) Makefile prefix.h
+prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) prefix.h \
+ Makefile $(BASEVER)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
- -DPREFIX=\"$(prefix)\" \
+ -DPREFIX=\"$(prefix)\" -DBASEVER=$(BASEVER_s) \
-c $(srcdir)/prefix.c $(OUTPUT_OPTION)
convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(FLAGS_H) \
@@ -2759,15 +2779,16 @@ test-protoize-simple: ./protoize ./unpro
-rm -f tmp-proto.[cs] tmp-proto$(objext)
# gcov-iov.c is run on the build machine to generate gcov-iov.h from version.c
-build/gcov-iov.o: gcov-iov.c version.c $(BCONFIG_H) coretypes.h $(GTM_H) \
+build/gcov-iov.o: gcov-iov.c $(BCONFIG_H) coretypes.h $(GTM_H) \
$(SYSTEM_H) coretypes.h $(TM_H)
build/gcov-iov$(build_exeext): build/gcov-iov.o
$(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) build/gcov-iov.o -o $@
gcov-iov.h: s-iov
-s-iov: build/gcov-iov$(build_exeext)
- build/gcov-iov$(build_exeext) > tmp-gcov-iov.h
+s-iov: build/gcov-iov$(build_exeext) $(BASEVER) $(DEVPHASE)
+ build/gcov-iov$(build_exeext) '$(BASEVER_c)' '$(DEVPHASE_c)' \
+ > tmp-gcov-iov.h
$(SHELL) $(srcdir)/../move-if-change tmp-gcov-iov.h gcov-iov.h
$(STAMP) s-iov
@@ -2964,24 +2985,37 @@ info: $(INFOFILES) lang.info @GENINSRC@
srcinfo: $(INFOFILES)
-cp -p $^ $(srcdir)/doc
-TEXI_CPP_FILES = cpp.texi fdl.texi cppenv.texi cppopts.texi
+TEXI_CPP_FILES = cpp.texi fdl.texi cppenv.texi cppopts.texi \
+ gcc-common.texi gcc-vers.texi
-TEXI_GCC_FILES = gcc.texi gcc-common.texi frontends.texi standards.texi \
- invoke.texi extend.texi md.texi objc.texi gcov.texi trouble.texi \
- bugreport.texi service.texi contribute.texi compat.texi funding.texi \
- gnu.texi gpl.texi fdl.texi contrib.texi cppenv.texi cppopts.texi \
+TEXI_GCC_FILES = gcc.texi gcc-common.texi gcc-vers.texi frontends.texi \
+ standards.texi invoke.texi extend.texi md.texi objc.texi \
+ gcov.texi trouble.texi bugreport.texi service.texi \
+ contribute.texi compat.texi funding.texi gnu.texi gpl.texi \
+ fdl.texi contrib.texi cppenv.texi cppopts.texi \
implement-c.texi
-TEXI_GCCINT_FILES = gccint.texi gcc-common.texi contribute.texi makefile.texi \
- configterms.texi portability.texi interface.texi passes.texi \
- c-tree.texi rtl.texi md.texi tm.texi hostconfig.texi fragments.texi \
- configfiles.texi collect2.texi headerdirs.texi funding.texi gnu.texi \
- gpl.texi fdl.texi contrib.texi languages.texi sourcebuild.texi \
- gty.texi libgcc.texi cfg.texi tree-ssa.texi
+TEXI_GCCINT_FILES = gccint.texi gcc-common.texi gcc-vers.texi \
+ contribute.texi makefile.texi configterms.texi \
+ portability.texi interface.texi passes.texi c-tree.texi \
+ rtl.texi md.texi tm.texi hostconfig.texi fragments.texi \
+ configfiles.texi collect2.texi headerdirs.texi funding.texi \
+ gnu.texi gpl.texi fdl.texi contrib.texi languages.texi \
+ sourcebuild.texi gty.texi libgcc.texi cfg.texi tree-ssa.texi
TEXI_GCCINSTALL_FILES = install.texi install-old.texi fdl.texi
-TEXI_CPPINT_FILES = cppinternals.texi
+TEXI_CPPINT_FILES = cppinternals.texi gcc-common.texi gcc-vers.texi
+
+# gcc-vers.texi is generated from the version files.
+gcc-vers.texi: $(BASEVER) $(DEVPHASE)
+ (echo "@set version-GCC $(BASEVER_c)"; \
+ if [ "$(DEVPHASE_c)" = "experimental" ]; \
+ then echo "@set DEVELOPMENT"; \
+ else echo "@clear DEVELOPMENT"; \
+ fi) > $@T
+ mv -f $@T $@
+
# The *.1, *.7, *.info, and *.dvi files are being generated from implicit
# patterns. To use them, put each of the specific targets with its
@@ -2994,7 +3028,7 @@ doc/cppinternals.info: $(TEXI_CPPINT_FIL
doc/%.info: %.texi
if [ x$(BUILD_INFO) = xinfo ]; then \
- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir) \
+ $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(docdir) \
-I $(docdir)/include -o $@ $<; \
fi
@@ -3019,11 +3053,11 @@ dvi:: doc/gcc.dvi doc/gccint.dvi doc/gcc
doc/cppinternals.dvi
doc/%.dvi: %.texi
- $(TEXI2DVI) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
+ $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
# Duplicate entry to handle renaming of gccinstall.dvi
doc/gccinstall.dvi: $(TEXI_GCCINSTALL_FILES)
- $(TEXI2DVI) -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
+ $(TEXI2DVI) -I . -I $(abs_docdir) -I $(abs_docdir)/include -o $@ $<
html:: $(htmldir)/cpp/index.html $(htmldir)/gcc/index.html \
$(htmldir)/gccinstall/index.html $(htmldir)/gccint/index.html \
@@ -4179,8 +4213,6 @@ risky-stage4: stage4
XGETTEXT = @XGETTEXT@
GMSGFMT = @GMSGFMT@
MSGMERGE = msgmerge
-
-PACKAGE = @PACKAGE@
CATALOGS = @CATALOGS@
.PHONY: build- install- build-po install-po update-po
@@ -4204,13 +4236,13 @@ update-po: $(CATALOGS:.gmo=.pox)
# The new .po has to be gone over by hand, so we deposit it into
# build/po with a different extension.
-# If build/po/$(PACKAGE).pot exists, use it (it was just created),
+# If build/po/gcc.pot exists, use it (it was just created),
# else use the one in srcdir.
.po.pox:
-test -d po || mkdir po
- $(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \
- then echo po/$(PACKAGE).pot; \
- else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@
+ $(MSGMERGE) $< `if test -f po/gcc.pot; \
+ then echo po/gcc.pot; \
+ else echo $(srcdir)/po/gcc.pot; fi` -o $@
# This rule has to look for .gmo modules in both srcdir and
# the cwd, and has to check that we actually have a catalog
@@ -4227,8 +4259,8 @@ install-po:
dir=$(localedir)/$$lang/LC_MESSAGES; \
echo $(mkinstalldirs) $(DESTDIR)$$dir; \
$(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \
- echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
- $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
+ echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
+ $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/gcc.mo; \
done
# Rule for regenerating the message template (gcc.pot).
@@ -4238,9 +4270,9 @@ install-po:
# Note that exgettext has an awk script embedded in it which requires a
# fairly modern (POSIX-compliant) awk.
# The .pot file is left in the build directory.
-$(PACKAGE).pot: po/$(PACKAGE).pot
-po/$(PACKAGE).pot: force options.c
+gcc.pot: po/gcc.pot
+po/gcc.pot: force options.c
-test -d po || mkdir po
$(MAKE) srcextra
AWK=$(AWK) $(SHELL) $(srcdir)/po/exgettext \
- $(XGETTEXT) $(PACKAGE) $(srcdir)
+ $(XGETTEXT) gcc $(srcdir)
===================================================================
Index: gcc/aclocal.m4
--- gcc/aclocal.m4 2 Dec 2004 11:04:01 -0000 1.100
+++ gcc/aclocal.m4 3 Mar 2005 05:52:00 -0000
@@ -2,7 +2,6 @@ m4_include([../config/accross.m4])
m4_include([../config/acx.m4])
m4_include([../config/gettext-sister.m4])
m4_include([../config/gcc-lib-path.m4])
-m4_include([../config/gcc-version.m4])
m4_include([../config/iconv.m4])
m4_include([../config/lcmessage.m4])
m4_include([../config/lib-ld.m4])
===================================================================
Index: gcc/configure.ac
--- gcc/configure.ac 26 Feb 2005 21:43:29 -0000 2.95
+++ gcc/configure.ac 3 Mar 2005 05:52:00 -0000
@@ -100,8 +100,6 @@ AC_MSG_ERROR([
*** and run configure again.])
fi
-TL_AC_GCC_VERSION([$srcdir/..])
-
# -----------
# Directories
# -----------
@@ -139,7 +137,7 @@ if test x${gcc_gxx_include_dir} = x; the
if test x${enable_version_specific_runtime_libs} = xyes; then
gcc_gxx_include_dir='${libsubdir}/include/c++'
else
- libstdcxx_incdir=c++/${gcc_version}
+ libstdcxx_incdir='c++/$(version)'
changequote(<<, >>)dnl
gcc_gxx_include_dir="\$(libsubdir)/\$(unlibsubdir)/..\`echo \$(exec_prefix) | sed -e 's|^\$(prefix)||' -e 's|/[^/]*|/..|g'\`/include/"${libstdcxx_incdir}
changequote([, ])dnl
@@ -1411,13 +1409,6 @@ EOF
changequote([,])dnl
# Internationalization
-PACKAGE=gcc
-VERSION="$gcc_version"
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE",
- [The name of this program for internationalization purposes.])
-AC_SUBST(PACKAGE)
-AC_SUBST(VERSION)
-
ZW_GNU_GETTEXT_SISTER_DIR
# If LIBINTL contains LIBICONV, then clear LIBICONV so we don't get
@@ -1435,44 +1426,30 @@ AC_ARG_ENABLE(win32-registry,
--enable-win32-registry=KEY
use KEY instead of GCC version as the last portion
of the registry key],,)
+
case $host_os in
- win32 | pe | cygwin* | mingw32* | uwin*)
-AC_MSG_CHECKING(whether windows registry support is requested)
-if test "x$enable_win32_registry" != xno; then
- AC_DEFINE(ENABLE_WIN32_REGISTRY, 1,
-[Define to 1 if installation paths should be looked up in Windows32
- Registry. Ignored on non windows32 hosts.])
- AC_MSG_RESULT(yes)
- AC_SEARCH_LIBS(RegOpenKeyExA, advapi32)
-else
- AC_MSG_RESULT(no)
-fi
+ win32 | pe | cygwin* | mingw32* | uwin*)
+ if test "x$enable_win32_registry" != xno; then
+ AC_SEARCH_LIBS(RegOpenKeyExA, advapi32,, [enable_win32_registry=no])
+ fi
-# Check if user specified a different registry key.
-case "x${enable_win32_registry}" in
-x | xyes)
- # default.
- gcc_cv_win32_registry_key="$VERSION"
- ;;
-xno)
- # no registry lookup.
- gcc_cv_win32_registry_key=''
- ;;
-*)
- # user-specified key.
- gcc_cv_win32_registry_key="$enable_win32_registry"
+ if test "x$enable_win32_registry" != xno; then
+ AC_DEFINE(ENABLE_WIN32_REGISTRY, 1,
+ [Define to 1 if installation paths should be looked up in the Windows
+ Registry. Ignored on non-Windows hosts.])
+
+ if test "x$enable_win32_registry" != xyes \
+ && test "x$enable_win32_registry" != x; then
+ AC_DEFINE_UNQUOTED(WIN32_REGISTRY_KEY, "$enable_win32_registry",
+ [Define to be the last component of the Windows registry key under which
+ to look for installation paths. The full key used will be
+ HKEY_LOCAL_MACHINE/SOFTWARE/Free Software Foundation/{WIN32_REGISTRY_KEY}.
+ The default is the GCC version number.])
+ fi
+ fi
;;
esac
-if test "x$enable_win32_registry" != xno; then
- AC_MSG_CHECKING(registry key on windows hosts)
- AC_DEFINE_UNQUOTED(WIN32_REGISTRY_KEY, "$gcc_cv_win32_registry_key",
- [Define to be the last portion of registry key on windows hosts.])
- AC_MSG_RESULT($gcc_cv_win32_registry_key)
-fi
-;;
-esac
-
# Get an absolute path to the GCC top-level source directory
holddir=`${PWDCMD-pwd}`
cd $srcdir
@@ -1769,6 +1746,8 @@ elif test -x "$AS" && test x$host = x$ta
gcc_cv_as="$AS"
fi
+gcc_version=`cat $srcdir/../config/GCC-BASE-VER`
+
if test "x$gcc_cv_as" = x; then
# Search the same directories that the installed compiler will
# search. Else we may find the wrong assembler and lose. If we
@@ -3073,7 +3052,7 @@ all_languages=
all_boot_languages=
all_compilers=
all_stagestuff=
-all_outputs='Makefile gccbug mklibgcc libada-mk'
+all_outputs='Makefile mklibgcc libada-mk'
# List of language makefile fragments.
all_lang_makefrags=
# List of language subdirectory makefiles. Deprecated.
===================================================================
Index: gcc/gccbug
--- gcc/gccbug.in 15 Jul 2004 16:52:43 -0000 1.20
+++ gcc/gccbug 3 Mar 2005 05:52:00 -0000
@@ -31,7 +31,11 @@
GNATS_ADDR=gcc-gnats@gcc.gnu.org
# The default release for this host.
-DEFAULT_RELEASE="@gcc_version_full@"
+# We have to guess at what program_transform_name might have done.
+# "sed 1q" because neither "head -1" nor "head -n 1" is universal, argh.
+
+DEFAULT_GCC="`echo $0 | sed -e 's/bug//'`"
+DEFAULT_RELEASE="`$DEFAULT_GCC --version | sed 1q`"
# The default organization.
DEFAULT_ORGANIZATION=
===================================================================
Index: gcc/gcov-iov.c
--- gcc/gcov-iov.c 9 Jul 2003 12:12:29 -0000 1.4
+++ gcc/gcov-iov.c 3 Mar 2005 05:52:01 -0000
@@ -1,6 +1,6 @@
/* Generate gcov version string from version.c. See gcov-io.h for
description of how the version string is generated.
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
Contributed by Nathan Sidwell <nathan@codesourcery.com>
This file is part of GCC.
@@ -20,46 +20,50 @@ along with GCC; see the file COPYING. I
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
-#include "bconfig.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-#include "version.c" /* We want the actual string. */
+#include <stdio.h>
+#include <stdlib.h>
-int main (int, char **);
+/* Command line arguments are the base GCC version and the development
+ phase (the latter may be an empty string). */
int
-main (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
+main (int argc, char **argv)
{
- unsigned version = 0;
+ unsigned int version = 0;
unsigned char v[4];
- unsigned ix;
- char const *ptr = version_string;
- unsigned major, minor = 0;
- char s = 0;
-
- major = atoi (ptr);
- while (*ptr && *ptr != '.')
- ptr++;
- if (*ptr)
- minor = atoi (ptr + 1);
- while (*ptr)
- if (*ptr++ == '(')
- {
- s = *ptr;
- break;
- }
+ unsigned int ix;
+ unsigned long major;
+ unsigned long minor = 0;
+ char phase = 0;
+ char *ptr;
+
+ if (argc != 3)
+ {
+ fprintf (stderr, "usage: %s 'version' 'phase'\n", argv[0]);
+ return 1;
+ }
+
+ ptr = argv[1];
+ major = strtoul (ptr, &ptr, 10);
+
+ if (*ptr == '.')
+ minor = strtoul (ptr + 1, 0, 10);
+
+ phase = argv[2][0];
+ if (phase == '\0')
+ phase = '*';
v[0] = (major < 10 ? '0' : 'A' - 10) + major;
v[1] = (minor / 10) + '0';
v[2] = (minor % 10) + '0';
- v[3] = s ? s : '*';
+ v[3] = phase;
for (ix = 0; ix != 4; ix++)
version = (version << 8) | v[ix];
printf ("/* Generated automatically by the program `%s'\n", argv[0]);
- printf (" from `%s'. */\n", version_string);
+ printf (" from `%s (%lu %lu) and %s (%c)'. */\n",
+ argv[1], major, minor, argv[2], phase);
printf ("\n");
printf ("#define GCOV_VERSION ((gcov_unsigned_t)%#08x) /* %.4s */\n",
version, v);
===================================================================
Index: gcc/intl.c
--- gcc/intl.c 23 Jul 2004 06:59:34 -0000 1.11
+++ gcc/intl.c 3 Mar 2005 05:52:01 -0000
@@ -51,8 +51,8 @@ gcc_init_libintl (void)
setlocale (LC_ALL, "");
#endif
- (void) bindtextdomain (PACKAGE, LOCALEDIR);
- (void) textdomain (PACKAGE);
+ (void) bindtextdomain ("gcc", LOCALEDIR);
+ (void) textdomain ("gcc");
/* Opening quotation mark. */
open_quote = _("`");
===================================================================
Index: gcc/libada-mk.in
--- gcc/libada-mk.in 26 Feb 2005 21:43:30 -0000 2.3
+++ gcc/libada-mk.in 3 Mar 2005 05:52:01 -0000
@@ -23,7 +23,6 @@
exeext=@host_exeext@
libdir=@libdir@
-gcc_version=@gcc_version@
NOCOMMON_FLAG=@nocommon_flag@
WARN_CFLAGS=@warn_cflags@
gcc_tmake_file=@tmake_file@
===================================================================
Index: gcc/prefix.c
--- gcc/prefix.c 30 Jun 2004 18:45:57 -0000 1.44
+++ gcc/prefix.c 3 Mar 2005 05:52:01 -0000
@@ -124,6 +124,10 @@ save_string (const char *s, int len)
#if defined(_WIN32) && defined(ENABLE_WIN32_REGISTRY)
+#ifndef WIN32_REGISTRY_KEY
+# define WIN32_REGISTRY_KEY BASEVER
+#endif
+
/* Look up "key" in the registry, as above. */
static char *
===================================================================
Index: gcc/version.c
--- gcc/version.c 3 Mar 2005 00:17:14 -0000 1.2622
+++ gcc/version.c 3 Mar 2005 05:52:01 -0000
@@ -1,11 +1,14 @@
#include "version.h"
-/* This is the string reported as the version number by all components
- of the compiler. If you distribute a modified version of GCC,
- please modify this string to indicate that, e.g. by putting your
- organization's name in parentheses at the end of the string. */
+/* This is the trailing component of the string reported as the
+ version number by all components of the compiler. For an official
+ FSF release, it is empty. If you distribute a modified version of
+ GCC, please change this string to indicate that. The suggested
+ format is a leading space, followed by your organization's name
+ in parentheses. You may also wish to include a number indicating
+ the revision of your modified compiler. */
-const char version_string[] = "4.1.0 20050303 (experimental)";
+#define VERSUFFIX ""
/* This is the location of the online document giving instructions for
reporting bugs. If you distribute a modified version of GCC,
@@ -15,3 +18,8 @@ const char version_string[] = "4.1.0 200
not bugs in your modifications.) */
const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>";
+
+/* The complete version string, assembled from several pieces.
+ BASEVER, DATESTAMP, and DEVPHASE are defined by the Makefile. */
+
+const char version_string[] = BASEVER DATESTAMP DEVPHASE VERSUFFIX;
===================================================================
Index: gcc/ada/Make-lang.in
--- gcc/ada/Make-lang.in 10 Feb 2005 13:54:45 -0000 1.98
+++ gcc/ada/Make-lang.in 3 Mar 2005 05:52:02 -0000
@@ -377,16 +377,18 @@ doc/gnat_ugn_unw.texi: $(srcdir)/ada/gna
ada/doctools/xgnatugn unw $(srcdir)/ada/gnat_ugn.texi \
$(srcdir)/ada/ug_words doc/gnat_ugn_unw.texi
-doc/gnat_ugn_unw.info: doc/gnat_ugn_unw.texi \
- $(docdir)/include/fdl.texi $(docdir)/include/gcc-common.texi
+doc/gnat_ugn_unw.info: doc/gnat_ugn_unw.texi \
+ $(docdir)/include/fdl.texi $(docdir)/include/gcc-common.texi \
+ gcc-vers.texi
+
if [ x$(BUILD_INFO) = xinfo ]; then \
rm -f $(@)*; \
$(MAKEINFO) $(MAKEINFOFLAGS) -I$(docdir)/include \
-I$(srcdir)/ada -o $@ $<; \
else true; fi
-doc/gnat_rm.info: ada/gnat_rm.texi $(docdir)/include/fdl.texi \
- $(docdir)/include/gcc-common.texi
+doc/gnat_rm.info: ada/gnat_rm.texi $(docdir)/include/fdl.texi \
+ $(docdir)/include/gcc-common.texi gcc-vers.texi
if [ x$(BUILD_INFO) = xinfo ]; then \
rm -f $(@)*; \
$(MAKEINFO) $(MAKEINFOFLAGS) -I$(docdir)/include \
@@ -415,12 +417,12 @@ install-info:: $(DESTDIR)$(infodir)/gnat
dvi:: doc/gnat_ugn_unw.dvi \
doc/gnat_rm.dvi doc/gnat-style.dvi
-doc/gnat_ugn_unw.dvi: doc/gnat_ugn_unw.texi \
- $(docdir)/include/fdl.texi $(docdir)/include/gcc-common.texi
+doc/gnat_ugn_unw.dvi: doc/gnat_ugn_unw.texi $(docdir)/include/fdl.texi \
+ $(docdir)/include/gcc-common.texi gcc-vers.texi
$(TEXI2DVI) -c -I $(abs_docdir)/include -o $@ $<
-doc/gnat_rm.dvi: ada/gnat_rm.texi \
- $(docdir)/include/fdl.texi $(docdir)/include/gcc-common.texi
+doc/gnat_rm.dvi: ada/gnat_rm.texi $(docdir)/include/fdl.texi \
+ $(docdir)/include/gcc-common.texi gcc-vers.texi
$(TEXI2DVI) -c -I $(abs_docdir)/include -o $@ $<
doc/gnat-style.dvi: ada/gnat-style.texi $(docdir)/include/fdl.texi
===================================================================
Index: gcc/config/alpha/x-vms
--- gcc/config/alpha/x-vms 5 Apr 2004 03:58:44 -0000 1.9
+++ gcc/config/alpha/x-vms 3 Mar 2005 05:52:04 -0000
@@ -1,5 +1,5 @@
# Under VMS, directory names cannot contain dots.
-version:=$(shell echo $(gcc_version) | sed -e 's/\./_/g')
+version:=$(shell echo $(BASEVER_c) | sed -e 's/\./_/g')
libsubdir=$(libdir)/gcc-lib
===================================================================
Index: gcc/config/i386/t-nwld
--- gcc/config/i386/t-nwld 19 Feb 2005 11:44:06 -0000 1.6
+++ gcc/config/i386/t-nwld 3 Mar 2005 05:52:04 -0000
@@ -38,7 +38,7 @@ SHLIB_SRC = $(srcdir)/config/i386/netwar
SHLIB_LINK = set -e; \
cat $(SHLIB_DEF) >@shlib_base_name@.def; \
echo "name $(SHLIB_NAME)" >>@shlib_base_name@.def; \
- echo "version $(gcc_version)" | sed "s!\.!,!g" >>@shlib_base_name@.def; \
+ echo "version $(version)" | sed "s!\.!,!g" >>@shlib_base_name@.def; \
touch libgcc/build; \
echo "build $$$$(($$$$(<libgcc/build)+0))" >>@shlib_base_name@.def; \
echo "export @$(SHLIB_MAP)" >>@shlib_base_name@.def; \
===================================================================
Index: gcc/doc/include/gcc-common.texi
--- gcc/doc/include/gcc-common.texi 2 Mar 2005 14:03:44 -0000 1.12
+++ gcc/doc/include/gcc-common.texi 3 Mar 2005 05:52:04 -0000
@@ -2,14 +2,13 @@
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
-@c Common values used in the GCC manuals:
+@c Version number and development mode.
+@c version-GCC is @set to the base GCC version number.
+@c DEVELOPMENT is @set for an in-development version, @clear for a
+@c release version (corresponding to ``experimental''/anything else
+@c in toplevel/config/GCC-DEV-PHASE).
-@set version-GCC 4.1.0
-
-@c DEVELOPMENT is set to indicate an in-development version,
-@c as compared to a release version. When making a release
-@c branch, clear this.
-@set DEVELOPMENT
+@include gcc-vers.texi
@c Common macros to support generating man pages:
===================================================================
Index: gcc/fortran/Make-lang.in
--- gcc/fortran/Make-lang.in 13 Nov 2004 07:35:54 -0000 1.12
+++ gcc/fortran/Make-lang.in 3 Mar 2005 05:52:08 -0000
@@ -153,7 +153,8 @@ GFORTRAN_TEXI = \
$(srcdir)/doc/include/fdl.texi \
$(srcdir)/doc/include/gpl.texi \
$(srcdir)/doc/include/funding.texi \
- $(srcdir)/doc/include/gcc-common.texi
+ $(srcdir)/doc/include/gcc-common.texi \
+ gcc-vers.texi
doc/gfortran.info: $(GFORTRAN_TEXI)
if [ x$(BUILD_INFO) = xinfo ]; then \
===================================================================
Index: gcc/java/Make-lang.in
--- gcc/java/Make-lang.in 3 Mar 2005 00:27:03 -0000 1.153
+++ gcc/java/Make-lang.in 3 Mar 2005 05:52:08 -0000
@@ -372,8 +372,9 @@ java/jcf-path.o: java/jcf-path.c $(CONFI
-DDEFAULT_TARGET_VERSION=\"$(version)\" \
$(srcdir)/java/jcf-path.c $(OUTPUT_OPTION)
-TEXI_JAVA_FILES = java/gcj.texi $(docdir)/include/fdl.texi $(docdir)/include/gpl.texi \
- $(docdir)/include/gcc-common.texi
+TEXI_JAVA_FILES = java/gcj.texi $(docdir)/include/fdl.texi \
+ $(docdir)/include/gpl.texi $(docdir)/include/gcc-common.texi \
+ gcc-vers.texi
# Documentation
doc/gcj.info: $(TEXI_JAVA_FILES)
===================================================================
Index: gcc/treelang/Make-lang.in
--- gcc/treelang/Make-lang.in 26 Feb 2005 13:43:39 -0000 1.51
+++ gcc/treelang/Make-lang.in 3 Mar 2005 05:52:22 -0000
@@ -153,7 +153,8 @@ TEXI_TREELANG_FILES = treelang/treelang.
$(docdir)/include/gcc-common.texi \
$(docdir)/include/gpl.texi \
$(docdir)/include/fdl.texi \
- $(docdir)/include/funding.texi
+ $(docdir)/include/funding.texi \
+ gcc-vers.texi
doc/treelang.info: $(TEXI_TREELANG_FILES)
$(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir)/include -o $@ $<
===================================================================
Index: maintainer-scripts/update_version
--- maintainer-scripts/update_version 31 Dec 2004 00:11:08 -0000 1.15
+++ maintainer-scripts/update_version 3 Mar 2005 05:52:45 -0000
@@ -36,6 +36,11 @@ textstring_FILES="gcc/gcc/version.c"
# version is contained within a #define
cppdefine_FILES="gcc/libstdc++-v3/include/bits/c++config"
+# version is all there is
+datestamp_FILES="gcc/config/DATESTAMP"
+
+FILES="$textstring_FILES $cppdefine_FILES $datestamp_FILES"
+
# Assume all will go well.
RESULT=0
@@ -45,9 +50,9 @@ for BRANCH in $BRANCHES; do
# you check out files with -r HEAD, CVS will not let you check
# in changes.
if test "$BRANCH" = HEAD; then
- ${CVS} co $textstring_FILES $cppdefine_FILES
+ ${CVS} co $FILES
else
- ${CVS} co -r $BRANCH $textstring_FILES $cppdefine_FILES
+ ${CVS} co -r $BRANCH $FILES
fi
# There are no files to commit yet.
@@ -81,6 +86,19 @@ for BRANCH in $BRANCHES; do
fi
done
+ for file in $datestamp_FILES; do
+ if test -f $file; then
+ echo ${CURR_DATE} > $file.new
+
+ if /usr/bin/cmp -s $file $file.new; then
+ rm -f $file.new
+ else
+ mv -f $file.new $file
+ COMMIT_FILES="$COMMIT_FILES $file"
+ fi
+ fi
+ done
+
if test -n "$COMMIT_FILES" \
&& ! ${CVS} commit -m "Daily bump." $COMMIT_FILES; then
# If we could not commit the files, indicate failure.
===================================================================
Index: maintainer-scripts/update_web_docs
--- maintainer-scripts/update_web_docs 13 May 2004 10:30:28 -0000 1.24
+++ maintainer-scripts/update_web_docs 3 Mar 2005 05:52:45 -0000
@@ -88,7 +88,7 @@ find $CVSROOT/gcc -name \*.texi,v -print
# Checkout all the texi files.
-cvs -Q export -r$RELEASE `cat FILES` gcc/gcc/doc/install.texi2html gcc/gcc/doc/include/texinfo.tex gcc/gcc/ada/xgnatugn.adb gcc/gcc/ada/ug_words
+cvs -Q export -r$RELEASE `cat FILES` gcc/gcc/doc/install.texi2html gcc/gcc/doc/include/texinfo.tex gcc/gcc/ada/xgnatugn.adb gcc/gcc/ada/ug_words gcc/config/GCC-BASE-VER gcc/config/GCC-DEV-PHASE
# Build a tarball of the sources.
tar cf docs-sources.tar gcc
@@ -107,6 +107,16 @@ if [ -f gcc/gcc/ada/xgnatugn.adb ]; then
gcc/gcc/ada/ug_words gnat_ugn_unw.texi
fi
+# Generate gcc-vers.texi.
+(
+ echo "@set version-GCC $(cat gcc/config/GCC-BASE-VER)"
+ if "$(cat gcc/config/GCC-DEV-PHASE)" = "experimental"; then
+ echo "@set DEVELOPMENT"
+ else
+ echo "@clear DEVELOPMENT"
+ fi
+) > $includedir/gcc-vers.texi
+
# Now convert the relevant files from texi to HTML and PostScript.
for file in $MANUALS; do
filename=`find . -name ${file}.texi`