Further reduce number of versioned files storing Emacs version number.

* configure.ac (comma_version, comma_space_version) [mingw32]:
New output variables.
(nt/emacs.rc, nt/emacsclient.rc) [mingw32]: New output files.

* make-dist: Update nt/ for *.rc -> *.rc.in changes.

* nt/emacs.rc.in, nt/emacsclient.rc.in: Rename from nt/emacs.rc, emacsclient.rc.
Let configure generate the real files, and set the version numbers.

* lib-src/Makefile.in (emacsclient.res): Update deps for nt/emacsclient.rc
now being in the build directory, not the source directory.

* nt/Makefile.in (distclean): Delete *.rc.
(emacs.res): Update deps for nt/emacsclient.rc now being in the
build directory, not the source directory.

* admin/admin.el (set-version): No more need to update nt/*.rc.

* admin/authors.el (authors-renamed-files-alist): Add .rc.in files.
This commit is contained in:
Glenn Morris 2014-11-22 14:04:32 -08:00
parent 239cd5b627
commit 84e2f13cd5
13 changed files with 127 additions and 51 deletions

View file

@ -1,3 +1,11 @@
2014-11-22 Glenn Morris <rgm@gnu.org>
Further reduce number of versioned files storing Emacs version number.
* configure.ac (comma_version, comma_space_version) [mingw32]:
New output variables.
(nt/emacs.rc, nt/emacsclient.rc) [mingw32]: New output files.
* make-dist: Update nt/ for *.rc -> *.rc.in changes.
2014-11-19 Dani Moncayo <dmoncayo@gmail.com>
* build-aux/msys-to-w32: Simplify implementation and docstring;

View file

@ -1,3 +1,8 @@
2014-11-22 Glenn Morris <rgm@gnu.org>
* admin.el (set-version): No more need to update nt/*.rc.
* authors.el (authors-renamed-files-alist): Add .rc.in files.
2014-11-16 Glenn Morris <rgm@gnu.org>
* update_autogen: Auto-detect VCS in use.

View file

@ -99,6 +99,8 @@ Root must be the root of an Emacs source tree."
(rx (and bol "#" (0+ blank) "define" (1+ blank)
"VERSION" (1+ blank) "\""
(submatch (1+ (in "0-9."))))))
;; TODO: msdos could easily extract the version number from
;; configure.ac with sed, rather than duplicating the information.
(set-version-in-file root "msdos/sed2v2.inp" version
(rx (and bol "/^#undef " (1+ not-newline)
"define VERSION" (1+ space) "\""
@ -107,49 +109,6 @@ Root must be the root of an Emacs source tree."
(set-version-in-file root "nt/makefile.w32-in" version
(rx (and "VERSION" (0+ space) "=" (0+ space)
(submatch (1+ (in "0-9."))))))
;; nt/emacs.rc also contains the version number, but in an awkward
;; format. It must contain four components, separated by commas, and
;; in two places those commas are followed by space, in two other
;; places they are not.
(let* ((version-components (append (split-string version "\\.")
'("0" "0")))
(comma-version
(concat (car version-components) ","
(cadr version-components) ","
(cadr (cdr version-components)) ","
(cadr (cdr (cdr version-components)))))
(comma-space-version
(concat (car version-components) ", "
(cadr version-components) ", "
(cadr (cdr version-components)) ", "
(cadr (cdr (cdr version-components))))))
(set-version-in-file root "nt/emacs.rc" comma-version
(rx (and "FILEVERSION" (1+ space)
(submatch (1+ (in "0-9,"))))))
(set-version-in-file root "nt/emacs.rc" comma-version
(rx (and "PRODUCTVERSION" (1+ space)
(submatch (1+ (in "0-9,"))))))
(set-version-in-file root "nt/emacs.rc" comma-space-version
(rx (and "\"FileVersion\"" (0+ space) ?, (0+ space)
?\" (submatch (1+ (in "0-9, "))) "\\0\"")))
(set-version-in-file root "nt/emacs.rc" comma-space-version
(rx (and "\"ProductVersion\"" (0+ space) ?,
(0+ space) ?\" (submatch (1+ (in "0-9, ")))
"\\0\"")))
;; Likewise for emacsclient.rc
(set-version-in-file root "nt/emacsclient.rc" comma-version
(rx (and "FILEVERSION" (1+ space)
(submatch (1+ (in "0-9,"))))))
(set-version-in-file root "nt/emacsclient.rc" comma-version
(rx (and "PRODUCTVERSION" (1+ space)
(submatch (1+ (in "0-9,"))))))
(set-version-in-file root "nt/emacsclient.rc" comma-space-version
(rx (and "\"FileVersion\"" (0+ space) ?, (0+ space)
?\" (submatch (1+ (in "0-9, "))) "\\0\"")))
(set-version-in-file root "nt/emacsclient.rc" comma-space-version
(rx (and "\"ProductVersion\"" (0+ space) ?,
(0+ space) ?\" (submatch (1+ (in "0-9, ")))
"\\0\"")))
;; Major version only.
(when (string-match "\\([0-9]\\{2,\\}\\)" version)
(setq version (match-string 1 version))

View file

@ -730,6 +730,8 @@ in the repository.")
("paths.h-dist" . "epaths.in")
("paths.h.in" . "epaths.in")
("paths.in" . "epaths.in")
("emacs.rc" . "emacs.rc.in")
("emacsclient.rc" . "emacsclient.rc.in")
("patch1" . "sed1.inp")
("INSTALL.MSYS" . "INSTALL")
("server.c" . "emacsserver.c")

View file

@ -4679,6 +4679,15 @@ AH_TEMPLATE(config_opsysfile, [Some platforms that do not use configure
case $opsys in
mingw32)
AC_DEFINE(config_opsysfile, <ms-w32.h>, [])
dnl Construct something of the form "24,4,0,0" with 4 components.
comma_version=`echo "$version.0.0" | sed -e 's/\./,/g' -e 's/^\([[^,]]*,[[^,]]*,[[^,]]*,[[^,]]*\).*/\1/'`
comma_space_version=`echo "$comma_version" | sed 's/,/, /g'`
AC_SUBST(comma_version)
AC_SUBST(comma_space_version)
AC_CONFIG_FILES([nt/emacs.rc nt/emacsclient.rc])
;;
esac

View file

@ -1,5 +1,8 @@
2014-11-22 Glenn Morris <rgm@gnu.org>
* Makefile.in (emacsclient.res): Update deps for nt/emacsclient.rc
now being in the build directory, not the source directory.
* Makefile.in (emacsclient.res): Add dependency on icons/emacs.ico.
2014-10-20 Glenn Morris <rgm@gnu.org>

View file

@ -388,7 +388,7 @@ update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h)
-DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \
$< $(LOADLIBES) $(NTLIB) -o $@
emacsclient.res: $(NTINC)/../emacsclient.rc ${srcdir}/icons/emacs.ico
emacsclient.res: ../nt/emacsclient.rc ${srcdir}/icons/emacs.ico
$(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ $<
## Makefile ends here.

View file

@ -392,10 +392,10 @@ echo "Making links to \`m4'"
echo "Making links to \`nt'"
(cd nt
ln emacs-x86.manifest emacs-x64.manifest emacs.rc ../${tempdir}/nt
ln config.nt emacsclient.rc emacs-src.tags ../${tempdir}/nt
ln emacs-x86.manifest emacs-x64.manifest ../${tempdir}/nt
ln config.nt emacs-src.tags ../${tempdir}/nt
ln nmake.defs gmake.defs subdirs.el [a-z]*.bat [a-z]*.[ch] ../${tempdir}/nt
ln Makefile.in gnulib.mk ../${tempdir}/nt
ln *.in gnulib.mk ../${tempdir}/nt
ln mingw-cfg.site epaths.nt INSTALL.OLD ../${tempdir}/nt
ln ChangeLog INSTALL README README.W32 makefile.w32-in ../${tempdir}/nt)

View file

@ -1,5 +1,11 @@
2014-11-22 Glenn Morris <rgm@gnu.org>
* emacs.rc.in, emacsclient.rc.in: Rename from emacs.rc, emacsclient.rc.
Let configure generate the real files, and set the version numbers.
* Makefile.in (distclean): Delete *.rc.
(emacs.res): Update deps for nt/emacsclient.rc now being in the
build directory, not the source directory.
* Makefile.in (emacs.res): Add dependency on icons/hand.cur.
2014-11-18 Glenn Morris <rgm@gnu.org>

View file

@ -195,8 +195,7 @@ clean: mostlyclean
-rm -f ${EXE_FILES}
distclean: clean
-rm -f TAGS
-rm -f Makefile
-rm -f TAGS Makefile *.rc
bootstrap-clean maintainer-clean: distclean
true
@ -225,6 +224,7 @@ cmdproxy${EXEEXT}: ${srcdir}/cmdproxy.c
runemacs${EXEEXT}: ${srcdir}/runemacs.c $(EMACSRES)
$(CC) ${ALL_CFLAGS} $^ -mwindows -o $@
emacs.res: ${srcdir}/emacs.rc ${srcdir}/icons/emacs.ico \
## This rule (and file) is duplicated in src/: why?
emacs.res: emacs.rc ${srcdir}/icons/emacs.ico \
${srcdir}/icons/hand.cur ${srcdir}/$(EMACS_MANIFEST)
${WINDRES} -I ${srcdir} -O coff -o $@ $<

45
nt/emacs.rc.in Normal file
View file

@ -0,0 +1,45 @@
Emacs ICON icons/emacs.ico
32649 CURSOR icons/hand.cur
#if defined (WIN64) || defined (__x86_64__)
1 24 "emacs-x64.manifest"
#else
1 24 "emacs-x86.manifest"
#endif
#ifndef VS_VERSION_INFO
#define VS_VERSION_INFO 1
#endif
VS_VERSION_INFO VERSIONINFO
FILEVERSION @comma_version@
PRODUCTVERSION @comma_version@
FILEFLAGSMASK 0x3FL
#ifdef EMACSDEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "Free Software Foundation\0"
VALUE "FileDescription", "GNU Emacs: The extensible self-documenting text editor\0"
VALUE "FileVersion", "@comma_space_version@\0"
VALUE "InternalName", "Emacs\0"
VALUE "LegalCopyright", "Copyright (C) 2001-2014\0"
VALUE "OriginalFilename", "emacs.exe"
VALUE "ProductName", "Emacs\0"
VALUE "ProductVersion", "@comma_space_version@\0"
VALUE "OLESelfRegister", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

39
nt/emacsclient.rc.in Normal file
View file

@ -0,0 +1,39 @@
Emacs ICON icons\emacs.ico
#ifndef VS_VERSION_INFO
#define VS_VERSION_INFO 1
#endif
VS_VERSION_INFO VERSIONINFO
FILEVERSION @comma_version@
PRODUCTVERSION @comma_version@
FILEFLAGSMASK 0x3FL
#ifdef EMACSDEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904B0"
BEGIN
VALUE "CompanyName", "Free Software Foundation\0"
VALUE "FileDescription", "GNU EmacsClient: Client for the extensible self-documenting text editor\0"
VALUE "FileVersion", "@comma_space_version@\0"
VALUE "InternalName", "EmacsClient\0"
VALUE "LegalCopyright", "Copyright (C) 2001-2014\0"
VALUE "OriginalFilename", "emacsclientw.exe"
VALUE "ProductName", "EmacsClient\0"
VALUE "ProductVersion", "@comma_space_version@\0"
VALUE "OLESelfRegister", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END

View file

@ -549,7 +549,7 @@ $(top_srcdir)/aclocal.m4 $(top_srcdir)/configure config.in ../config.status \
doc.o: buildobj.h
## This rule (and file) is duplicated in nt/: why?
emacs.res: $(ntsource)/emacs.rc \
emacs.res: ../nt/emacs.rc \
$(ntsource)/icons/emacs.ico \
$(ntsource)/icons/hand.cur \
$(ntsource)/$(EMACS_MANIFEST)