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.
This commit is contained in:
Ken Raeburn 2010-05-15 17:11:37 -04:00
parent 2e9abc3d53
commit 8c5ff6dd24
8 changed files with 3402 additions and 15960 deletions

View file

@ -1,3 +1,7 @@
2010-05-15 Ken Raeburn <raeburn@raeburn.org>
* configure.in: Look for version string in its new location.
2010-05-15 Eli Zaretskii <eliz@gnu.org>
* config.bat: Remove support for DJGPP v1.x.

19197
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -3008,13 +3008,13 @@ if test "x$GCC" = xyes \
fi
#### Find out which version of Emacs this is.
[version=`grep 'defconst[ ]*emacs-version' ${srcdir}/lisp/version.el \
[version=`grep 'const char emacs_version' ${srcdir}/src/emacs.c \
| sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`]
if test x"${version}" = x; then
AC_MSG_ERROR([can't find current emacs version in `${srcdir}/lisp/version.el'.])
AC_MSG_ERROR([can't find current emacs version in `${srcdir}/src/emacs.c'.])
fi
if test x"${version}" != x"$PACKAGE_VERSION"; then
AC_MSG_WARN([version mismatch between `${srcdir}/configure.in' and `${srcdir}/lisp/version.el'.])
AC_MSG_WARN([version mismatch between `${srcdir}/configure.in' and `${srcdir}/src/emacs.c'.])
fi
### Specify what sort of things we'll be editing into Makefile and config.h.

View file

@ -1,3 +1,8 @@
2010-05-15 Ken Raeburn <raeburn@raeburn.org>
* version.el (emacs-copyright, emacs-version): Don't define here,
now that emacs.c defines it.
2010-05-15 Eli Zaretskii <eliz@gnu.org>
* international/mule-cmds.el (mule-menu-keymap): Fix definition of

View file

@ -29,12 +29,6 @@
;;; Code:
(defconst emacs-copyright "Copyright (C) 2010 Free Software Foundation, Inc." "\
Short copyright string for this version of Emacs.")
(defconst emacs-version "24.0.50" "\
Version numbers of this version of Emacs.")
(defconst emacs-major-version (progn (string-match "^[0-9]+" emacs-version) (string-to-number (match-string 0 emacs-version))) "\
Major version number of this version of Emacs.
This variable first existed in version 19.23.")

View file

@ -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

View file

@ -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

View file

@ -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))
const char *version, *copyright;
if (initialized)
{
fprintf (stderr, "Invalid value of `emacs-version'\n");
exit (1);
}
if (!STRINGP (tem2))
{
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;
}