]>
Commit | Line | Data |
---|---|---|
726f6388 JA |
1 | /* version.c -- distribution and version numbers. */ |
2 | ||
3 | /* Copyright (C) 1989 Free Software Foundation, Inc. | |
4 | ||
5 | This file is part of GNU Bash, the Bourne Again SHell. | |
6 | ||
7 | Bash is free software; you can redistribute it and/or modify it under | |
8 | the terms of the GNU General Public License as published by the Free | |
bb70624e | 9 | Software Foundation; either version 2, or (at your option) any later |
726f6388 JA |
10 | version. |
11 | ||
12 | Bash is distributed in the hope that it will be useful, but WITHOUT ANY | |
13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 | for more details. | |
16 | ||
17 | You should have received a copy of the GNU General Public License along | |
18 | with Bash; see the file COPYING. If not, write to the Free Software | |
bb70624e | 19 | Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ |
726f6388 | 20 | |
ccc6cda3 JA |
21 | #include <stdio.h> |
22 | ||
726f6388 JA |
23 | #include "version.h" |
24 | ||
ccc6cda3 JA |
25 | extern char *shell_name; |
26 | ||
27 | /* Defines from version.h */ | |
726f6388 JA |
28 | char *dist_version = DISTVERSION; |
29 | int patch_level = PATCHLEVEL; | |
30 | int build_version = BUILDVERSION; | |
ccc6cda3 JA |
31 | #ifdef RELSTATUS |
32 | char *release_status = RELSTATUS; | |
33 | #else | |
34 | char *release_status = (char *)0; | |
35 | #endif | |
726f6388 | 36 | char *sccs_version = SCCSVERSION; |
ccc6cda3 JA |
37 | |
38 | /* Functions for getting, setting, and displaying the shell version. */ | |
39 | ||
40 | /* Give version information about this shell. */ | |
41 | char * | |
42 | shell_version_string () | |
43 | { | |
44 | static char tt[32] = { '\0' }; | |
45 | ||
46 | if (tt[0] == '\0') | |
47 | { | |
48 | if (release_status) | |
49 | sprintf (tt, "%s.%d(%d)-%s", dist_version, patch_level, build_version, release_status); | |
50 | else | |
51 | sprintf (tt, "%s.%d(%d)", dist_version, patch_level, build_version); | |
52 | } | |
53 | return tt; | |
54 | } | |
55 | ||
56 | #if !defined (MACHTYPE) | |
b72432fd JA |
57 | # if defined (CONF_MACHTYPE) |
58 | # define MACHTYPE CONF_MACHTYPE | |
59 | # else | |
60 | # define MACHTYPE "unknown" | |
61 | # endif | |
ccc6cda3 JA |
62 | #endif |
63 | ||
64 | void | |
65 | show_shell_version (extended) | |
66 | int extended; | |
67 | { | |
68 | printf ("GNU bash, version %s (%s)\n", shell_version_string (), MACHTYPE); | |
69 | if (extended) | |
28ef6c31 | 70 | printf ("Copyright 2000 Free Software Foundation, Inc.\n"); |
ccc6cda3 | 71 | } |