diff options
| author | Paul Eggert | 2013-07-01 17:57:46 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-07-01 17:57:46 -0700 |
| commit | c2418359b3e9f2eb7a72f4ea5245637190571cc8 (patch) | |
| tree | ca95673e0a271b9e1e53b8b1a708184b10ec824b /src | |
| parent | 37afa042f9f56e3b3f22511ff222b49d728558d9 (diff) | |
| download | emacs-c2418359b3e9f2eb7a72f4ea5245637190571cc8.tar.gz emacs-c2418359b3e9f2eb7a72f4ea5245637190571cc8.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 11 | ||||
| -rw-r--r-- | src/Makefile.in | 13 | ||||
| -rw-r--r-- | src/doc.c | 33 |
3 files changed, 29 insertions, 28 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 552ce4f70a2..2dc1af6d02b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2013-07-02 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Simplify buildobj processing. | ||
| 4 | * Makefile.in (buildobj.h): Make it a sequence of strings each | ||
| 5 | followed by comma, rather than a single string. Put it into a | ||
| 6 | .tmp file in case there's an error while generating it. | ||
| 7 | (gl-stamp): Use .tmp for temp files. | ||
| 8 | (mostlyclean): Clean .tmp files. | ||
| 9 | * doc.c (buildobj): Move to just the routine that needs it. | ||
| 10 | It's now an array of strings, so processing is simpler. | ||
| 11 | |||
| 1 | 2013-07-01 Paul Eggert <eggert@cs.ucla.edu> | 12 | 2013-07-01 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 13 | ||
| 3 | Fix bug re noninteractive multithreaded memory allocation (Bug#14569). | 14 | Fix bug re noninteractive multithreaded memory allocation (Bug#14569). |
diff --git a/src/Makefile.in b/src/Makefile.in index 90083eb910f..931b3e71d66 100644 --- a/src/Makefile.in +++ b/src/Makefile.in | |||
| @@ -477,16 +477,19 @@ $(libsrc)/make-docfile$(EXEEXT): | |||
| 477 | cd $(libsrc); $(MAKE) $(MFLAGS) make-docfile$(EXEEXT) | 477 | cd $(libsrc); $(MAKE) $(MFLAGS) make-docfile$(EXEEXT) |
| 478 | 478 | ||
| 479 | buildobj.h: Makefile | 479 | buildobj.h: Makefile |
| 480 | echo "#define BUILDOBJ \"$(ALLOBJS) " "\"" >$@ | 480 | for i in $(ALLOBJS); do \ |
| 481 | echo "$$i" | sed 's,.*/,,; s/\.obj$$/\.o/; s/^/"/; s/$$/",/' \ | ||
| 482 | || exit; \ | ||
| 483 | done >$@.tmp | ||
| 484 | mv $@.tmp $@ | ||
| 481 | 485 | ||
| 482 | globals.h: gl-stamp; @true | 486 | globals.h: gl-stamp; @true |
| 483 | 487 | ||
| 484 | GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m) | 488 | GLOBAL_SOURCES = $(base_obj:.o=.c) $(NS_OBJC_OBJ:.o=.m) |
| 485 | 489 | ||
| 486 | gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES) | 490 | gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES) |
| 487 | @rm -f gl-tmp | 491 | $(libsrc)/make-docfile -d $(srcdir) -g $(obj) > gl.tmp |
| 488 | $(libsrc)/make-docfile -d $(srcdir) -g $(obj) > gl-tmp | 492 | $(srcdir)/../build-aux/move-if-change gl.tmp globals.h |
| 489 | $(srcdir)/../build-aux/move-if-change gl-tmp globals.h | ||
| 490 | echo timestamp > $@ | 493 | echo timestamp > $@ |
| 491 | 494 | ||
| 492 | $(ALLOBJS): globals.h | 495 | $(ALLOBJS): globals.h |
| @@ -557,7 +560,7 @@ mostlyclean: | |||
| 557 | rm -f bootstrap-emacs$(EXEEXT) emacs-$(version)$(EXEEXT) | 560 | rm -f bootstrap-emacs$(EXEEXT) emacs-$(version)$(EXEEXT) |
| 558 | rm -f buildobj.h | 561 | rm -f buildobj.h |
| 559 | rm -f globals.h gl-stamp | 562 | rm -f globals.h gl-stamp |
| 560 | rm -f *.res | 563 | rm -f *.res *.tmp |
| 561 | clean: mostlyclean | 564 | clean: mostlyclean |
| 562 | rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT) | 565 | rm -f emacs-*.*.*$(EXEEXT) emacs$(EXEEXT) |
| 563 | -rm -rf $(DEPDIR) | 566 | -rm -rf $(DEPDIR) |
| @@ -33,7 +33,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 33 | #include "buffer.h" | 33 | #include "buffer.h" |
| 34 | #include "keyboard.h" | 34 | #include "keyboard.h" |
| 35 | #include "keymap.h" | 35 | #include "keymap.h" |
| 36 | #include "buildobj.h" | ||
| 37 | 36 | ||
| 38 | Lisp_Object Qfunction_documentation; | 37 | Lisp_Object Qfunction_documentation; |
| 39 | 38 | ||
| @@ -555,7 +554,6 @@ store_function_docstring (Lisp_Object obj, ptrdiff_t offset) | |||
| 555 | } | 554 | } |
| 556 | } | 555 | } |
| 557 | 556 | ||
| 558 | static const char buildobj[] = BUILDOBJ; | ||
| 559 | 557 | ||
| 560 | DEFUN ("Snarf-documentation", Fsnarf_documentation, Ssnarf_documentation, | 558 | DEFUN ("Snarf-documentation", Fsnarf_documentation, Ssnarf_documentation, |
| 561 | 1, 1, 0, | 559 | 1, 1, 0, |
| @@ -598,27 +596,16 @@ the same file name is found in the `doc-directory'. */) | |||
| 598 | 596 | ||
| 599 | /* Vbuild_files is nil when temacs is run, and non-nil after that. */ | 597 | /* Vbuild_files is nil when temacs is run, and non-nil after that. */ |
| 600 | if (NILP (Vbuild_files)) | 598 | if (NILP (Vbuild_files)) |
| 601 | { | 599 | { |
| 602 | const char *beg, *end; | 600 | static char const *const buildobj[] = |
| 603 | 601 | { | |
| 604 | for (beg = buildobj; *beg; beg = end) | 602 | #include "buildobj.h" |
| 605 | { | 603 | }; |
| 606 | ptrdiff_t len; | 604 | int i = sizeof buildobj / sizeof *buildobj; |
| 607 | 605 | while (0 <= --i) | |
| 608 | while (*beg && c_isspace (*beg)) ++beg; | 606 | Vbuild_files = Fcons (build_string (buildobj[i]), Vbuild_files); |
| 609 | 607 | Vbuild_files = Fpurecopy (Vbuild_files); | |
| 610 | for (end = beg; *end && ! c_isspace (*end); ++end) | 608 | } |
| 611 | if (*end == '/') beg = end + 1; /* Skip directory part. */ | ||
| 612 | |||
| 613 | len = end - beg; | ||
| 614 | if (len > 4 && end[-4] == '.' && end[-3] == 'o') | ||
| 615 | len -= 2; /* Just take .o if it ends in .obj */ | ||
| 616 | |||
| 617 | if (len > 0) | ||
| 618 | Vbuild_files = Fcons (make_string (beg, len), Vbuild_files); | ||
| 619 | } | ||
| 620 | Vbuild_files = Fpurecopy (Vbuild_files); | ||
| 621 | } | ||
| 622 | 609 | ||
| 623 | fd = emacs_open (name, O_RDONLY, 0); | 610 | fd = emacs_open (name, O_RDONLY, 0); |
| 624 | if (fd < 0) | 611 | if (fd < 0) |