From: Eli Zaretskii Date: Sun, 14 Apr 2013 15:05:42 +0000 (+0300) Subject: Fixed autoloads and byte compilation due to MSYS filename-butchering and xargs limita... X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~229^2~63^2~44 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5e00cfa51043b42d59061525fecd461d0b2d44f9;p=emacs.git Fixed autoloads and byte compilation due to MSYS filename-butchering and xargs limitations. --- diff --git a/configure.ac b/configure.ac index 67cb02c068e..295e4198e24 100644 --- a/configure.ac +++ b/configure.ac @@ -1573,6 +1573,7 @@ LIBS_ECLIENT= LIB_WSOCK32= NTLIB= CM_OBJ="cm.o" +XARGS_LIMIT= if test "${HAVE_W32}" = "yes"; then AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.]) AC_CHECK_TOOL(WINDRES, [windres], @@ -1603,6 +1604,7 @@ if test "${HAVE_W32}" = "yes"; then LIBS_ECLIENT="-lcomctl32" LIB_WSOCK32="-lwsock32" NTLIB="ntlib.$ac_objext" + XARGS_LIMIT="-s 10000" fi fi AC_SUBST(W32_OBJ) @@ -1618,6 +1620,7 @@ AC_SUBST(CM_OBJ) AC_SUBST(LIBS_ECLIENT) AC_SUBST(LIB_WSOCK32) AC_SUBST(NTLIB) +AC_SUBST(XARGS_LIMIT) if test "${HAVE_W32}" = "yes"; then window_system=w32 diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 1e701df348f..1a411e67ff4 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -24,6 +24,10 @@ abs_top_builddir = @abs_top_builddir@ lisp = $(srcdir) VPATH = $(srcdir) +# Empty for all systems except MinGW, where xargs needs an explicit +# limitation. +XARGS_LIMIT = @XARGS_LIMIT@ + # You can specify a different executable on the make command line, # e.g. "make EMACS=../src/emacs ...". @@ -160,21 +164,21 @@ $(lisp)/cus-load.el: custom-deps: doit cd $(lisp); $(setwins_almost); \ echo Directories: $$wins; \ - $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins + $(emacs) -l cus-dep --eval '(set-generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins $(lisp)/finder-inf.el: $(MAKE) $(MFLAGS) finder-data finder-data: doit cd $(lisp); $(setwins_almost); \ echo Directories: $$wins; \ - $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins + $(emacs) -l finder --eval '(set-generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins # The chmod +w is to handle env var CVSREAD=1. autoloads: $(LOADDEFS) doit cd $(lisp) && chmod +w $(AUTOGEN_VCS) cd $(lisp); $(setwins_almost); \ echo Directories: $$wins; \ - $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins + $(emacs) -l autoload --eval '(set-generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins # This is required by the bootstrap-emacs target in ../src/Makefile, so # we know that if we have an emacs executable, we also have a subdirs.el. @@ -274,7 +278,7 @@ compile-main: compile-clean test -f $$el || continue; \ test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \ echo "$${el}c"; \ - done | xargs echo) | \ + done | xargs $(XARGS_LIMIT) echo) | \ while read chunk; do \ $(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \ done @@ -369,7 +373,7 @@ mh-autoloads: $(MH_E_DIR)/mh-loaddefs.el $(MH_E_DIR)/mh-loaddefs.el: $(MH_E_SRC) $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \ - --eval "(setq generated-autoload-file \"$@\")" \ + --eval "(set-generated-autoload-file \"$@\")" \ --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(MH_E_DIR) @@ -387,7 +391,7 @@ TRAMP_SRC = $(TRAMP_DIR)/tramp.el $(TRAMP_DIR)/tramp-adb.el \ $(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC) $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###tramp-autoload\")" \ - --eval "(setq generated-autoload-file \"$@\")" \ + --eval "(set-generated-autoload-file \"$@\")" \ --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(TRAMP_DIR) @@ -409,21 +413,21 @@ CAL_SRC = $(CAL_DIR)/cal-bahai.el $(CAL_DIR)/cal-china.el \ $(CAL_DIR)/cal-loaddefs.el: $(CAL_SRC) $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \ - --eval "(setq generated-autoload-file \"$@\")" \ + --eval "(set-generated-autoload-file \"$@\")" \ --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(CAL_DIR) $(CAL_DIR)/diary-loaddefs.el: $(CAL_SRC) $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \ - --eval "(setq generated-autoload-file \"$@\")" \ + --eval "(set-generated-autoload-file \"$@\")" \ --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(CAL_DIR) $(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC) $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \ - --eval "(setq generated-autoload-file \"$@\")" \ + --eval "(set-generated-autoload-file \"$@\")" \ --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(CAL_DIR) diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el index 60b427344ea..fd679ee3088 100644 --- a/lisp/cus-dep.el +++ b/lisp/cus-dep.el @@ -38,6 +38,18 @@ ldefs-boot\\|cus-load\\|finder-inf\\|esh-groups\\|subdirs\\)\\.el$\\)" (autoload 'autoload-rubric "autoload") +(defun set-generated-custom-dependencies-file (file) + "Set value of `generated-custom-dependencies-file' from FILE. + +On systems other than MS-Windows, just sets the value +of `generated-custom-dependencies-file'. On MS-Windows, converts +/d/foo/bar form passed by MSYS Make into d:/foo/bar that Emacs can +grok. This function is called from lisp/Makefile." + (when (and (eq system-type 'windows-nt) + (string-match "\\`/[a-zA-Z]/" file)) + (setq file (concat (substring file 1 2) ":" (substring file 2)))) + (setq generated-custom-dependencies-file file)) + (defun custom-make-dependencies () "Batch function to extract custom dependencies from .el files. Usage: emacs -batch -l ./cus-dep.el -f custom-make-dependencies DIRS" diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index edaecd7ff19..f9e691c153c 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -86,6 +86,18 @@ that text will be copied verbatim to `generated-autoload-file'.") (defvar autoload-modified-buffers) ;Dynamically scoped var. +(defun set-generated-autoload-file (file) + "Set value of `generated-autoload-file' from FILE. + +On systems other than MS-Windows, just sets the value +of `generated-autoload-file'. On MS-Windows, converts /d/foo/bar +form passed by MSYS Make into d:/foo/bar that Emacs can grok. +This function is called from lisp/Makefile." + (when (and (eq system-type 'windows-nt) + (string-match "\\`/[a-zA-Z]/" file)) + (setq file (concat (substring file 1 2) ":" (substring file 2)))) + (setq generated-autoload-file file)) + (defun make-autoload (form file &optional expansion) "Turn FORM into an autoload or defvar for source file FILE. Returns nil if FORM is not a special autoload form (i.e. a function definition diff --git a/lisp/finder.el b/lisp/finder.el index 3d988b41bde..8da589655d7 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -138,6 +138,18 @@ cus-load\\|finder-inf\\|esh-groups\\|subdirs\\)\\.el$\\)" (autoload 'autoload-rubric "autoload") +(defun set-generated-finder-keywords-file (file) + "Set value of `generated-finder-keywords-file' from FILE. + +On systems other than MS-Windows, just sets the value +of `generated-finder-keywords-file'. On MS-Windows, converts +/d/foo/bar form passed by MSYS Make into d:/foo/bar that Emacs +can grok. This function is called from lisp/Makefile." + (when (and (eq system-type 'windows-nt) + (string-match "\\`/[a-zA-Z]/" file)) + (setq file (concat (substring file 1 2) ":" (substring file 2)))) + (setq generated-finder-keywords-file file)) + (defvar finder--builtins-alist '(("calc" . calc) ("ede" . ede)