]> git.eshelyaron.com Git - emacs.git/commitdiff
Further reduce number of versioned files storing Emacs version number.
authorGlenn Morris <rgm@gnu.org>
Sat, 22 Nov 2014 22:04:32 +0000 (14:04 -0800)
committerGlenn Morris <rgm@gnu.org>
Sat, 22 Nov 2014 22:07:48 +0000 (14:07 -0800)
* 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.

13 files changed:
ChangeLog
admin/ChangeLog
admin/admin.el
admin/authors.el
configure.ac
lib-src/ChangeLog
lib-src/Makefile.in
make-dist
nt/ChangeLog
nt/Makefile.in
nt/emacs.rc.in [new file with mode: 0644]
nt/emacsclient.rc.in [new file with mode: 0644]
src/Makefile.in

index 749c020b69890506fb38b974377cad83f65bb198..f40624c42e94f092475ba4b3aa4d2085a1d63fec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;
index 96a98e561095a02560c1a8481932bb65fcc51fd3..cc69367555fc58856da558ad327e567ddb2bf74c 100644 (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.
index b22160ef47877c6ada4c73081083884182110467..d6c702a3bdfd6c501076229af91df6350b428b2e 100644 (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))
index aefd947e802cf0883cd2938c8f32069608e49f1f..b05f37ba8ddbbc27b4e2dfc132de18ed590802f4 100644 (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")
index 5d71c2f6a6e6a394fffd2d87cf1b972901a68a1f..85d11234035e9b79b8803b5602753d6f7fc601d6 100644 (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
 
index a8281a579f1f318fe4c2cd47899c328a4eb06e84..4fc3b4dbe574570c53007975ad79c72f1c2eff99 100644 (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>
index eb16c3305ae3b426d89d07a5d14d1cffb2ff3263..432314f02dd835e033a1a3153a4be765866eb446 100644 (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.
index 45df561ce13be0fff724ab1094fd6adc7226bbde..6e85f1dc21680a1f53b4c2686f4c41cfe37c4e5f 100755 (executable)
--- a/make-dist
+++ b/make-dist
@@ -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)
 
index 49ef65afe6e21694a1acf8ae995c36c583ed224e..168f1dd9ed397512a8f074bd523ddc7a813682bf 100644 (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>
index c456d55e4f816d6b33b1d3739927304611ade017..c6b2f0bea0e31a20968191f27907c71359677616 100644 (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 $@ $<
diff --git a/nt/emacs.rc.in b/nt/emacs.rc.in
new file mode 100644 (file)
index 0000000..d2d17b8
--- /dev/null
@@ -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
diff --git a/nt/emacsclient.rc.in b/nt/emacsclient.rc.in
new file mode 100644 (file)
index 0000000..5c3b65d
--- /dev/null
@@ -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
index 7defb4d1a75591adc45b68bb6be73c273ea8009e..4bc5fdfaaf54da5e96abbf8f3e2c461efcbcc2a2 100644 (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)