Commit 16fab143 authored by Paul Eggert's avatar Paul Eggert

src/emacs.c now gets version number from configure.in

parent 3370edca
2011-01-31 Paul Eggert <eggert@cs.ucla.edu>
src/emacs.c now gets version number from configure.in
* configure.in (version): Set this from $PACKAGE_VERSION,
which is set from AC_INIT, rather than scouting through src/emacs.c.
* configure: Regenerate.
* make-dist (version): Get it from configure.in, not src/emacs.c.
2011-01-30 Paul Eggert <eggert@cs.ucla.edu> 2011-01-30 Paul Eggert <eggert@cs.ucla.edu>
strftime: import from gnulib strftime: import from gnulib
......
2011-01-31 Paul Eggert <eggert@cs.ucla.edu>
src/emacs.c now gets version number from configure.in
* admin.el (set-version): Don't update src/emacs.c.
* quick-install-emacs (VERSION): Get it from configure.in, not from
src/emacs.c.
2011-01-30 Paul Eggert <eggert@cs.ucla.edu> 2011-01-30 Paul Eggert <eggert@cs.ucla.edu>
strftime: import from gnulib strftime: import from gnulib
......
...@@ -59,9 +59,6 @@ Root must be the root of an Emacs source tree." ...@@ -59,9 +59,6 @@ Root must be the root of an Emacs source tree."
(interactive "DEmacs root directory: \nsVersion number: ") (interactive "DEmacs root directory: \nsVersion number: ")
(unless (file-exists-p (expand-file-name "src/emacs.c" root)) (unless (file-exists-p (expand-file-name "src/emacs.c" root))
(error "%s doesn't seem to be the root of an Emacs source tree" root)) (error "%s doesn't seem to be the root of an Emacs source tree" root))
(set-version-in-file root "src/emacs.c" version
(rx (and "emacs_version" (0+ (not (in ?\")))
?\" (submatch (1+ (not (in ?\")))) ?\")))
(set-version-in-file root "README" version (set-version-in-file root "README" version
(rx (and "version" (1+ space) (rx (and "version" (1+ space)
(submatch (1+ (in "0-9.")))))) (submatch (1+ (in "0-9."))))))
......
...@@ -170,8 +170,10 @@ test x"$SRC" = x && { SRC="`get_config_var srcdir`" || exit 4 ; } ...@@ -170,8 +170,10 @@ test x"$SRC" = x && { SRC="`get_config_var srcdir`" || exit 4 ; }
test x"$prefix" = x && { prefix="`get_config_var prefix`" || exit 4 ; } test x"$prefix" = x && { prefix="`get_config_var prefix`" || exit 4 ; }
test x"$ARCH" = x && { ARCH="`get_config_var host`" || exit 4 ; } test x"$ARCH" = x && { ARCH="`get_config_var host`" || exit 4 ; }
VERSION=`grep 'char emacs_version' $SRC/src/emacs.c \ VERSION=`
| sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'` sed -n 's/^AC_INIT(emacs,[ ]*\([^ )]*\).*/\1/p' <$SRC/configure.in
` || exit 4
test -n "$VERSION" || { echo >&2 "$me: no version in configure.in"; exit 4; }
DST_SHARE="$prefix/share/emacs/$VERSION" DST_SHARE="$prefix/share/emacs/$VERSION"
DST_BIN="$prefix/bin" DST_BIN="$prefix/bin"
......
...@@ -16986,16 +16986,7 @@ if test "x$GCC" = xyes \ ...@@ -16986,16 +16986,7 @@ if test "x$GCC" = xyes \
as_fn_error $? "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5 as_fn_error $? "GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'." "$LINENO" 5
fi fi
#### Find out which version of Emacs this is. version=$PACKAGE_VERSION
version=`grep 'const char emacs_version' ${srcdir}/src/emacs.c \
| sed -e 's/^[^"]*"\([^"]*\)".*$/\1/'`
if test x"${version}" = x; then
as_fn_error $? "can't find current emacs version in \`${srcdir}/src/emacs.c'." "$LINENO" 5
fi
if test x"${version}" != x"$PACKAGE_VERSION"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/src/emacs.c'." >&5
$as_echo "$as_me: WARNING: version mismatch between \`${srcdir}/configure.in' and \`${srcdir}/src/emacs.c'." >&2;}
fi
### Specify what sort of things we'll be editing into Makefile and config.h. ### Specify what sort of things we'll be editing into Makefile and config.h.
### Use configuration here uncanonicalized to avoid exceeding size limits. ### Use configuration here uncanonicalized to avoid exceeding size limits.
......
...@@ -3070,15 +3070,7 @@ if test "x$GCC" = xyes \ ...@@ -3070,15 +3070,7 @@ if test "x$GCC" = xyes \
AC_MSG_ERROR([GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'.]) AC_MSG_ERROR([GCC 4.5.0 has problems compiling Emacs; see etc/PROBLEMS'.])
fi fi
#### Find out which version of Emacs this is. version=$PACKAGE_VERSION
[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}/src/emacs.c'.])
fi
if test x"${version}" != x"$PACKAGE_VERSION"; then
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. ### Specify what sort of things we'll be editing into Makefile and config.h.
### Use configuration here uncanonicalized to avoid exceeding size limits. ### Use configuration here uncanonicalized to avoid exceeding size limits.
......
2011-01-31 Paul Eggert <eggert@cs.ucla.edu>
src/emacs.c now gets version number from configure.in
* ebrowse.c: Adjust comment to say that.
2011-01-30 Jim Meyering <meyering@redhat.com> 2011-01-30 Jim Meyering <meyering@redhat.com>
make-docfile: don't corrupt heap for an invalid .elc file make-docfile: don't corrupt heap for an invalid .elc file
......
...@@ -3565,7 +3565,7 @@ usage (int error) ...@@ -3565,7 +3565,7 @@ usage (int error)
/* Display version and copyright info. The VERSION macro is set /* Display version and copyright info. The VERSION macro is set
from the Makefile and contains the Emacs version. */ from config.h and contains the Emacs version. */
#ifndef VERSION #ifndef VERSION
# define VERSION "21" # define VERSION "21"
...@@ -3812,7 +3812,7 @@ main (int argc, char **argv) ...@@ -3812,7 +3812,7 @@ main (int argc, char **argv)
yyerror ("error getting size of file `%s'", out_filename); yyerror ("error getting size of file `%s'", out_filename);
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
} }
else if (rc == 0) else if (rc == 0)
{ {
yyerror ("file `%s' is empty", out_filename); yyerror ("file `%s' is empty", out_filename);
......
...@@ -146,7 +146,9 @@ then ...@@ -146,7 +146,9 @@ then
fi fi
### Find out which version of Emacs this is. ### Find out which version of Emacs this is.
version=`sed -n '/char emacs_version/ s/^[^"]*"\([^"]*\)".*$/\1/p' src/emacs.c` version=`
sed -n 's/^AC_INIT(emacs,[ ]*\([^ )]*\).*/\1/p' <configure.in
` || version=
if [ ! "${version}" ]; then if [ ! "${version}" ]; then
echo "${progname}: can't find current Emacs version in \`./src/emacs.c'" >&2 echo "${progname}: can't find current Emacs version in \`./src/emacs.c'" >&2
exit 1 exit 1
......
2011-01-31 Paul Eggert <eggert@cs.ucla.edu>
src/emacs.c now gets version number from configure.in
* emacs.c (emacs_version): Set to VERSION so that it
is determined automatically from ../configure.in.
2011-01-30 Paul Eggert <eggert@cs.ucla.edu> 2011-01-30 Paul Eggert <eggert@cs.ucla.edu>
strftime: import from gnulib strftime: import from gnulib
...@@ -88,9 +88,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ ...@@ -88,9 +88,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif #endif
#endif #endif
/* If you change the following line, remember to update static const char emacs_version[] = VERSION;
msdos/mainmake.v2 which gleans the Emacs version from it! */
static const char emacs_version[] = "24.0.50";
static const char emacs_copyright[] = "Copyright (C) 2011 Free Software Foundation, Inc."; static const char emacs_copyright[] = "Copyright (C) 2011 Free Software Foundation, Inc.";
/* Make these values available in GDB, which doesn't see macros. */ /* Make these values available in GDB, which doesn't see macros. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment