diff options
author | Zack Weinberg <zack@gcc.gnu.org> | 2005-03-16 06:04:10 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2005-03-16 06:04:10 +0000 |
commit | a1286ef574be4a388b14de74a406dc60391a8b91 (patch) | |
tree | 261d633ad9cd4145625ba80071dde15ca1e1f6ca /gcc/gcov-iov.c | |
parent | 0ebfd2c928fda823acdd4b5b073a84e5ce92ba39 (diff) | |
download | gcc-a1286ef574be4a388b14de74a406dc60391a8b91.zip gcc-a1286ef574be4a388b14de74a406dc60391a8b91.tar.gz gcc-a1286ef574be4a388b14de74a406dc60391a8b91.tar.bz2 |
gcc-version.m4: Delete.
config:
* gcc-version.m4: Delete.
fastjar:
* Makefile.am (fastjar_TEXINFOS): Add gcc-vers.texi.
(BASEVER, DEVPHASE): New variables.
(POD2MAN): Adjust setting of --release option.
(fastjar.1, grepjar.1, gcc-vers.texi): New rules.
* Makefile.in: Regenerate.
* configure.ac: Do not invoke TL_AC_GCC_VERSION.
* aclocal.m4, configure: Regenerate.
gcc:
* BASE-VER, DATESTAMP, DEV-PHASE: New files.
* Makefile.in (gcc_version, gcc_version_trigger, ): Delete.
(BASEVER, DEVPHASE, DATESTAMP, BASEVER_c, DEVPHASE_c, DATESTAMP_c)
(BASEVER_s, DEVPHASE_s, DATESTAMP_s): New variables.
(version): Define using $(BASEVER_c).
(Makefile, config.status, build/gcov-iov.o): No longer depends on
version.c.
(version.o): Depend on version files; add custom generation command.
(prefix.o): Define BASEVER on command line.
(s-iov): Depend on version files; adjust command.
(TEXI_CPP_FILES, TEX_IGCC_FILES, TEXI_GCCINT_FILES, TEXI_CPPINT_FILES):
Add gcc-vers.texi.
(gcc-vers.texi): New rule.
(doc/%.info, doc/%.dvi): Add -I . to command line.
(doc/gccinstall.dvi): Likewise.
(PACKAGE): Delete. All uses replaced with "gcc".
* aclocal.m4: Do not include gcc-version.m4.
* configure.ac: Do not invoke TL_AC_GCC_VERSION.
Do not AC_SUBST nor AC_DEFINE PACKAGE or VERSION.
Set is_release based on contents of DEV-PHASE.
Set gcc_version based on contents of BASE-VER.
Define WIN32_REGISTRY_KEY only if the user overrode the default.
* config.in, configure: Regenerate.
* gccbug.in: Determine version of GCC in use at runtime.
* gcov-iov.c: Get version number and development phase from
command line, not by including version.c.
* intl.c: Replace all uses of PACKAGE with "gcc".
* libada-mk.in: Delete unused "gcc_version" variable.
* prefix.c: Default WIN32_REGISTRY_KEY to BASEVER.
* version.c: (VERSUFFIX): New hook for redistributors; adjust
commentary to match.
(version_string): Put together from pieces.
* config/alpha/x-vms: Do not use $(gcc_version).
* config/i386/t-nwld: Likewise.
* doc/include/gcc-common.texi: Include gcc-vers.texi for
version-GCC and DEVELOPMENT.
gcc/ada:
* Make-lang.in (doc/gnat_ugn_unw.info, doc/gnat_rm.info)
(doc/gnat_ugn_unw.dvi, doc/gnat_rm.dvi): Add gcc-vers.texi
to dependencies.
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.
libstdc++-v3:
* include/Makefile.am (c++config.h): Depend on DATESTAMP from gcc
subdirectory. Generate #define of __GLIBCXX__ from contents of
that file.
* include/Makefile.in: Regenerate.
* include/bits/c++config: Do not define __GLIBCXX__.
maintainer-scripts:
* README: Update.
* gcc_release: Update gcc/DEV-PHASE if that file exists, instead
of gcc/version.c.
* update_version: Handle updating gcc/DATESTAMP.
* update_web_docs: Generate gcc-vers.texi first.
From-SVN: r96549
Diffstat (limited to 'gcc/gcov-iov.c')
-rw-r--r-- | gcc/gcov-iov.c | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/gcc/gcov-iov.c b/gcc/gcov-iov.c index d6b39de..df90b5c 100644 --- a/gcc/gcov-iov.c +++ b/gcc/gcov-iov.c @@ -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. If not, write to the Free 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; + unsigned int ix; + unsigned long major; + unsigned long minor = 0; + char phase = 0; + char *ptr; - major = atoi (ptr); - while (*ptr && *ptr != '.') - ptr++; - if (*ptr) - minor = atoi (ptr + 1); - while (*ptr) - if (*ptr++ == '(') - { - s = *ptr; - break; - } + 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); |