Subject: bug#5191: 23.1.90; Make target compile-main fails under GNU/Linux Kernel 2.6.16

From: Chong Yidong <[email-masked]>
Date: Sat, 12 Dec 2009 15:24:25 -0500

Does this patch fix it?  Instead of passing ELCFILES on the command
line, it saves it to a .elcfiles file, and the recursive Make includes
that.  (I am assuming the "-include" directive is supported, but we seem
to use it in src/Makefile already anyhow.)

*** emacs/lisp/Makefile.in.~1.215.~	2009-12-09 09:21:04.000000000 -0500
--- emacs/lisp/Makefile.in	2009-12-12 15:13:02.000000000 -0500
***************
*** 211,216 ****
--- 211,218 ----
  
  compile-first: $(COMPILE_FIRST)
  
+ -include $(lisp)/.elcfiles
+ 
  # ELCFILES is set dynamically in the recursive call from `compile-main'.
  compile-elcfiles: $(ELCFILES)
  
***************
*** 219,230 ****
  compile-main:
  	@wd=$(lisp); $(setwins); \
  	els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
  	for el in $$els; do \
  	  test -f $$el || continue; \
  	  test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
! 	  files="$$files $${el}c"; \
  	done; \
! 	$(MAKE) $(MFLAGS) compile-elcfiles EMACS=$(EMACS) ELCFILES="$$files"
  
  # Erase left-over .elc files that do not have a corresponding .el file.
  compile-clean:
--- 221,233 ----
  compile-main:
  	@wd=$(lisp); $(setwins); \
  	els=`echo "$$wins " | sed -e 's|/\./|/|g' -e 's|/\. | |g' -e 's| |/*.el |g'`; \
+ 	echo -n "ELCFILES=" > $(lisp)/.elcfiles; \
  	for el in $$els; do \
  	  test -f $$el || continue; \
  	  test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
! 	  echo -n "$${el}c " >> $(lisp)/.elcfiles; \
  	done; \
! 	$(MAKE) $(MFLAGS) compile-elcfiles EMACS=$(EMACS)
  
  # Erase left-over .elc files that do not have a corresponding .el file.
  compile-clean: