]> git.ipfire.org Git - thirdparty/bash.git/blame - version.c
Imported from ../bash-2.02.tar.gz.
[thirdparty/bash.git] / version.c
CommitLineData
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
9 Software Foundation; either version 1, or (at your option) any later
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
19 Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20
ccc6cda3
JA
21#include <stdio.h>
22
726f6388
JA
23#include "version.h"
24
ccc6cda3
JA
25extern char *shell_name;
26
27/* Defines from version.h */
726f6388
JA
28char *dist_version = DISTVERSION;
29int patch_level = PATCHLEVEL;
30int build_version = BUILDVERSION;
ccc6cda3
JA
31#ifdef RELSTATUS
32char *release_status = RELSTATUS;
33#else
34char *release_status = (char *)0;
35#endif
726f6388 36char *sccs_version = SCCSVERSION;
ccc6cda3
JA
37
38/* Functions for getting, setting, and displaying the shell version. */
39
40/* Give version information about this shell. */
41char *
42shell_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)
57# define MACHTYPE "unknown"
58#endif
59
60void
61show_shell_version (extended)
62 int extended;
63{
64 printf ("GNU bash, version %s (%s)\n", shell_version_string (), MACHTYPE);
65 if (extended)
cce855bc 66 printf ("Copyright 1998 Free Software Foundation, Inc.\n");
ccc6cda3 67}