emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 01/01: Further reduce number of versioned files sto


From: Glenn Morris
Subject: [Emacs-diffs] master 01/01: Further reduce number of versioned files storing Emacs version number.
Date: Sat, 22 Nov 2014 22:09:35 +0000

branch: master
commit 84e2f13cd50a7ef6af736559107f0a8e6bcec6c5
Author: Glenn Morris <address@hidden>
Date:   Sat Nov 22 14:04:32 2014 -0800

    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.
---
 ChangeLog            |    8 ++++++++
 admin/ChangeLog      |    5 +++++
 admin/admin.el       |   45 ++-------------------------------------------
 admin/authors.el     |    2 ++
 configure.ac         |    9 +++++++++
 lib-src/ChangeLog    |    3 +++
 lib-src/Makefile.in  |    2 +-
 make-dist            |    6 +++---
 nt/ChangeLog         |    6 ++++++
 nt/Makefile.in       |    6 +++---
 nt/emacs.rc.in       |   45 +++++++++++++++++++++++++++++++++++++++++++++
 nt/emacsclient.rc.in |   39 +++++++++++++++++++++++++++++++++++++++
 src/Makefile.in      |    2 +-
 13 files changed, 127 insertions(+), 51 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 749c020..f40624c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-11-22  Glenn Morris  <address@hidden>
+
+       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  <address@hidden>
 
        * build-aux/msys-to-w32: Simplify implementation and docstring;
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 96a98e5..cc69367 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-22  Glenn Morris  <address@hidden>
+
+       * 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  <address@hidden>
 
        * update_autogen: Auto-detect VCS in use.
diff --git a/admin/admin.el b/admin/admin.el
index b22160e..d6c702a 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -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))
diff --git a/admin/authors.el b/admin/authors.el
index aefd947..b05f37b 100644
--- a/admin/authors.el
+++ b/admin/authors.el
@@ -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")
diff --git a/configure.ac b/configure.ac
index 5d71c2f..85d1123 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
 
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index a8281a5..4fc3b4d 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,5 +1,8 @@
 2014-11-22  Glenn Morris  <address@hidden>
 
+       * 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  <address@hidden>
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index eb16c33..432314f 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -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.
diff --git a/make-dist b/make-dist
index 45df561..6e85f1d 100755
--- 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)
 
diff --git a/nt/ChangeLog b/nt/ChangeLog
index 49ef65a..168f1dd 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,5 +1,11 @@
 2014-11-22  Glenn Morris  <address@hidden>
 
+       * 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  <address@hidden>
diff --git a/nt/Makefile.in b/nt/Makefile.in
index c456d55..c6b2f0b 100644
--- a/nt/Makefile.in
+++ b/nt/Makefile.in
@@ -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
index 0000000..d2d17b8
--- /dev/null
+++ b/nt/emacs.rc.in
@@ -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", "@address@hidden"
+           VALUE "InternalName", "Emacs\0"
+           VALUE "LegalCopyright", "Copyright (C) 2001-2014\0"
+           VALUE "OriginalFilename", "emacs.exe"
+           VALUE "ProductName", "Emacs\0"
+           VALUE "ProductVersion", "@address@hidden"
+           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
index 0000000..5c3b65d
--- /dev/null
+++ b/nt/emacsclient.rc.in
@@ -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", "@address@hidden"
+           VALUE "InternalName", "EmacsClient\0"
+           VALUE "LegalCopyright", "Copyright (C) 2001-2014\0"
+           VALUE "OriginalFilename", "emacsclientw.exe"
+           VALUE "ProductName", "EmacsClient\0"
+           VALUE "ProductVersion", "@address@hidden"
+           VALUE "OLESelfRegister", "\0"
+        END
+     END
+     BLOCK "VarFileInfo"
+     BEGIN
+         VALUE "Translation", 0x409, 1200
+     END
+END
diff --git a/src/Makefile.in b/src/Makefile.in
index 7defb4d..4bc5fdfa 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]