diff options
| author | Ken Raeburn <raeburn@raeburn.org> | 2010-05-15 17:11:37 -0400 |
|---|---|---|
| committer | Ken Raeburn <raeburn@raeburn.org> | 2010-05-15 17:11:37 -0400 |
| commit | 8c5ff6dd241db176fb178b4d84dbab93ad2475c9 (patch) | |
| tree | 4c52177fac2371274af2370992edfb8353936e3c /src | |
| parent | 2e9abc3d5340f07c181d3cbeba5d92d36dea5a34 (diff) | |
| download | emacs-8c5ff6dd241db176fb178b4d84dbab93ad2475c9.tar.gz | |
Handle --version reasonably in CANNOT_DUMP configuration.
* src/emacs.c (emacs_version, emacs_copyright): New string
variables.
(Vemacs_version, Vemacs_copyright): New Lisp_Object variables.
(syms_of_emacs): Defvar them, and initialize them from the C
string variables.
(main): If initialization hasn't been done, print initial version
info from the C strings, instead of starting an interactive session.
* lisp/version.el (emacs-copyright, emacs-version): Don't define
here.
* configure.in: Look for version string in its new place.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/config.in | 65 | ||||
| -rw-r--r-- | src/emacs.c | 69 |
3 files changed, 90 insertions, 54 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 30bd78e208c..31084286ddb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2010-05-15 Ken Raeburn <raeburn@raeburn.org> + + Handle --version reasonably in CANNOT_DUMP configuration. + * emacs.c (emacs_version, emacs_copyright): New string variables. + (Vemacs_version, Vemacs_copyright): New Lisp_Object variables. + (syms_of_emacs): Defvar them, and initialize them from the C + string variables. + (main): If initialization hasn't been done, print initial version + info from the C strings, instead of starting an interactive session. + 2010-05-15 Eli Zaretskii <eliz@gnu.org> * bidi.c (bidi_paragraph_init): Don't leave alone garbage values diff --git a/src/config.in b/src/config.in index 35530943682..4a0f58cc7da 100644 --- a/src/config.in +++ b/src/config.in @@ -315,10 +315,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Define to 1 if you have the <kerberos/krb.h> header file. */ #undef HAVE_KERBEROS_KRB_H -/* Define to 1 if `e_text' is member of `krb5_error'. */ +/* Define to 1 if `e_text' is a member of `krb5_error'. */ #undef HAVE_KRB5_ERROR_E_TEXT -/* Define to 1 if `text' is member of `krb5_error'. */ +/* Define to 1 if `text' is a member of `krb5_error'. */ #undef HAVE_KRB5_ERROR_TEXT /* Define to 1 if you have the <krb5.h> header file. */ @@ -609,25 +609,25 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Define to 1 if you have the `strsignal' function. */ #undef HAVE_STRSIGNAL -/* Define to 1 if `ifr_addr' is member of `struct ifreq'. */ +/* Define to 1 if `ifr_addr' is a member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_ADDR -/* Define to 1 if `ifr_broadaddr' is member of `struct ifreq'. */ +/* Define to 1 if `ifr_broadaddr' is a member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_BROADADDR -/* Define to 1 if `ifr_flags' is member of `struct ifreq'. */ +/* Define to 1 if `ifr_flags' is a member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_FLAGS -/* Define to 1 if `ifr_hwaddr' is member of `struct ifreq'. */ +/* Define to 1 if `ifr_hwaddr' is a member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_HWADDR -/* Define to 1 if `ifr_netmask' is member of `struct ifreq'. */ +/* Define to 1 if `ifr_netmask' is a member of `struct ifreq'. */ #undef HAVE_STRUCT_IFREQ_IFR_NETMASK -/* Define to 1 if `n_un.n_name' is member of `struct nlist'. */ +/* Define to 1 if `n_un.n_name' is a member of `struct nlist'. */ #undef HAVE_STRUCT_NLIST_N_UN_N_NAME -/* Define to 1 if `tm_zone' is member of `struct tm'. */ +/* Define to 1 if `tm_zone' is a member of `struct tm'. */ #undef HAVE_STRUCT_TM_TM_ZONE /* Define to 1 if `struct utimbuf' is declared by <utime.h>. */ @@ -853,6 +853,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME +/* Define to the home page for this package. */ +#undef PACKAGE_URL + /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -912,6 +915,28 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Define to 1 if using the Motif X toolkit. */ #undef USE_MOTIF +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + /* Define to 1 if we should use toolkit scroll bars. */ #undef USE_TOOLKIT_SCROLL_BARS @@ -947,28 +972,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif - - /* Define to rpl_ if the getopt replacement functions and variables should be used. */ #undef __GETOPT_PREFIX diff --git a/src/emacs.c b/src/emacs.c index 6b19b45d0b0..36db274adf6 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -87,6 +87,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ #endif #endif +const char emacs_copyright[] = "Copyright (C) 2010 Free Software Foundation, Inc."; +const char emacs_version[] = "24.0.50"; + extern void malloc_warning P_ ((char *)); extern void set_time_zone_rule P_ ((char *)); #ifdef HAVE_INDEX @@ -180,6 +183,10 @@ Lisp_Object Vprevious_system_messages_locale; Lisp_Object Vsystem_time_locale; Lisp_Object Vprevious_system_time_locale; +/* Copyright and version info. The version number may be updated by + Lisp code. */ +Lisp_Object Vemacs_copyright, Vemacs_version; + /* If non-zero, emacs should not attempt to use a window-specific code, but instead should use the virtual terminal under which it was started. */ int inhibit_window_system; @@ -802,35 +809,43 @@ main (int argc, char **argv) argc = 0; while (argv[argc]) argc++; - if (argmatch (argv, argc, "-version", "--version", 3, NULL, &skip_args) - /* We don't know the version number unless this is a dumped Emacs. - So ignore --version otherwise. */ - && initialized) + if (argmatch (argv, argc, "-version", "--version", 3, NULL, &skip_args)) { - Lisp_Object tem, tem2; - tem = Fsymbol_value (intern_c_string ("emacs-version")); - tem2 = Fsymbol_value (intern_c_string ("emacs-copyright")); - if (!STRINGP (tem)) - { - fprintf (stderr, "Invalid value of `emacs-version'\n"); - exit (1); - } - if (!STRINGP (tem2)) + const char *version, *copyright; + if (initialized) { - fprintf (stderr, "Invalid value of `emacs-copyright'\n"); - exit (1); + Lisp_Object tem, tem2; + tem = Fsymbol_value (intern_c_string ("emacs-version")); + tem2 = Fsymbol_value (intern_c_string ("emacs-copyright")); + if (!STRINGP (tem)) + { + fprintf (stderr, "Invalid value of `emacs-version'\n"); + exit (1); + } + if (!STRINGP (tem2)) + { + fprintf (stderr, "Invalid value of `emacs-copyright'\n"); + exit (1); + } + else + { + version = SDATA (tem); + copyright = SDATA (tem2); + } } else { - printf ("GNU Emacs %s\n", SDATA (tem)); - printf ("%s\n", SDATA(tem2)); - printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n"); - printf ("You may redistribute copies of Emacs\n"); - printf ("under the terms of the GNU General Public License.\n"); - printf ("For more information about these matters, "); - printf ("see the file named COPYING.\n"); - exit (0); + version = emacs_version; + copyright = emacs_copyright; } + printf ("GNU Emacs %s\n", version); + printf ("%s\n", copyright); + printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n"); + printf ("You may redistribute copies of Emacs\n"); + printf ("under the terms of the GNU General Public License.\n"); + printf ("For more information about these matters, "); + printf ("see the file named COPYING.\n"); + exit (0); } if (argmatch (argv, argc, "-chdir", "--chdir", 2, &ch_to_dir, &skip_args)) if (chdir (ch_to_dir) == -1) @@ -2577,6 +2592,14 @@ This is nil during initialization. */); doc: /* If non-nil, X resources, Windows Registry settings, and NS defaults are not used. */); inhibit_x_resources = 0; + DEFVAR_LISP ("emacs-copyright", &Vemacs_copyright, + doc: /* Short copyright string for this version of Emacs. */); + Vemacs_copyright = build_string (emacs_copyright); + + DEFVAR_LISP ("emacs-version", &Vemacs_version, + doc: /* Version numbers of this version of Emacs. */); + Vemacs_version = build_string (emacs_version); + /* Make sure IS_DAEMON starts up as false. */ daemon_pipe[1] = 0; } |
