emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113252: Simplify buildobj processing.


From: Paul Eggert
Subject: [Emacs-diffs] trunk r113252: Simplify buildobj processing.
Date: Tue, 02 Jul 2013 00:57:50 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113252
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Mon 2013-07-01 17:57:46 -0700
message:
  Simplify buildobj processing.
  
  * Makefile.in (buildobj.h): Make it a sequence of strings each
  followed by comma, rather than a single string.  Put it into a
  .tmp file in case there's an error while generating it.
  (gl-stamp): Use .tmp for temp files.
  (mostlyclean): Clean .tmp files.
  * doc.c (buildobj): Move to just the routine that needs it.
  It's now an array of strings, so processing is simpler.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/Makefile.in                makefile.in-20091113204419-o5vbwnq5f7feedwu-631
  src/doc.c                      doc.c-20091113204419-o5vbwnq5f7feedwu-250
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-07-01 21:44:44 +0000
+++ b/src/ChangeLog     2013-07-02 00:57:46 +0000
@@ -1,3 +1,14 @@
+2013-07-02  Paul Eggert  <address@hidden>
+
+       Simplify buildobj processing.
+       * Makefile.in (buildobj.h): Make it a sequence of strings each
+       followed by comma, rather than a single string.  Put it into a
+       .tmp file in case there's an error while generating it.
+       (gl-stamp): Use .tmp for temp files.
+       (mostlyclean): Clean .tmp files.
+       * doc.c (buildobj): Move to just the routine that needs it.
+       It's now an array of strings, so processing is simpler.
+
 2013-07-01  Paul Eggert  <address@hidden>
 
        Fix bug re noninteractive multithreaded memory allocation (Bug#14569).

=== modified file 'src/Makefile.in'
--- a/src/Makefile.in   2013-06-07 09:26:02 +0000
+++ b/src/Makefile.in   2013-07-02 00:57:46 +0000
@@ -477,16 +477,19 @@
        cd $(libsrc); $(MAKE) $(MFLAGS) make-docfile$(EXEEXT)
 
 buildobj.h: Makefile
-       echo "#define BUILDOBJ \"$(ALLOBJS) " "\"" >$@
+       for i in $(ALLOBJS); do \
+         echo "$$i" | sed 's,.*/,,; s/\.obj$$/\.o/; s/^/"/; s/$$/",/' \
+           || exit; \
+       done >address@hidden
+       mv address@hidden $@
 
 globals.h: gl-stamp; @true
 
 GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m)
 
 gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES)
-       @rm -f gl-tmp
-       $(libsrc)/make-docfile -d $(srcdir) -g $(obj) > gl-tmp
-       $(srcdir)/../build-aux/move-if-change gl-tmp globals.h
+       $(libsrc)/make-docfile -d $(srcdir) -g $(obj) > gl.tmp
+       $(srcdir)/../build-aux/move-if-change gl.tmp globals.h
        echo timestamp > $@
 
 $(ALLOBJS): globals.h
@@ -557,7 +560,7 @@
        rm -f bootstrap-emacs$(EXEEXT) emacs-$(version)$(EXEEXT)
        rm -f buildobj.h
        rm -f globals.h gl-stamp
-       rm -f *.res
+       rm -f *.res *.tmp
 clean: mostlyclean
        rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT)
        -rm -rf $(DEPDIR)

=== modified file 'src/doc.c'
--- a/src/doc.c 2013-06-05 01:58:43 +0000
+++ b/src/doc.c 2013-07-02 00:57:46 +0000
@@ -33,7 +33,6 @@
 #include "buffer.h"
 #include "keyboard.h"
 #include "keymap.h"
-#include "buildobj.h"
 
 Lisp_Object Qfunction_documentation;
 
@@ -555,7 +554,6 @@
     }
 }
 
-static const char buildobj[] = BUILDOBJ;
 
 DEFUN ("Snarf-documentation", Fsnarf_documentation, Ssnarf_documentation,
        1, 1, 0,
@@ -598,27 +596,16 @@
 
   /* Vbuild_files is nil when temacs is run, and non-nil after that.  */
   if (NILP (Vbuild_files))
-  {
-    const char *beg, *end;
-
-    for (beg = buildobj; *beg; beg = end)
-      {
-        ptrdiff_t len;
-
-        while (*beg && c_isspace (*beg)) ++beg;
-
-        for (end = beg; *end && ! c_isspace (*end); ++end)
-          if (*end == '/') beg = end + 1;  /* Skip directory part.  */
-
-        len = end - beg;
-        if (len > 4 && end[-4] == '.' && end[-3] == 'o')
-          len -= 2;  /* Just take .o if it ends in .obj  */
-
-        if (len > 0)
-          Vbuild_files = Fcons (make_string (beg, len), Vbuild_files);
-      }
-    Vbuild_files = Fpurecopy (Vbuild_files);
-  }
+    {
+      static char const *const buildobj[] =
+       {
+         #include "buildobj.h"
+       };
+      int i = sizeof buildobj / sizeof *buildobj;
+      while (0 <= --i)
+       Vbuild_files = Fcons (build_string (buildobj[i]), Vbuild_files);
+      Vbuild_files = Fpurecopy (Vbuild_files);
+    }
 
   fd = emacs_open (name, O_RDONLY, 0);
   if (fd < 0)


reply via email to

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