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
73 lines
2.0 KiB
C
73 lines
2.0 KiB
C
/* Generate gcov version string from version.c. See gcov-io.h for
|
|
description of how the version string is generated.
|
|
Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
|
Contributed by Nathan Sidwell <nathan@codesourcery.com>
|
|
|
|
This file is part of GCC.
|
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
the terms of the GNU General Public License as published by the Free
|
|
Software Foundation; either version 2, or (at your option) any later
|
|
version.
|
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
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 <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
/* Command line arguments are the base GCC version and the development
|
|
phase (the latter may be an empty string). */
|
|
|
|
int
|
|
main (int argc, char **argv)
|
|
{
|
|
unsigned int version = 0;
|
|
unsigned char v[4];
|
|
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] = 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 (%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);
|
|
|
|
return 0;
|
|
}
|