Avoid EMACSDATA in user environment interfering with building
[bpt/emacs.git] / test / automated / Makefile.in
index 6177689..9d9f60e 100644 (file)
@@ -1,6 +1,6 @@
 ### @configure_input@
 
-# Copyright (C) 2010-2013 Free Software Foundation, Inc.
+# Copyright (C) 2010-2014 Free Software Foundation, Inc.
 
 # This file is part of GNU Emacs.
 
@@ -22,21 +22,31 @@ SHELL = @SHELL@
 srcdir = @srcdir@
 VPATH = $(srcdir)
 
+SEPCHAR = @SEPCHAR@
+
+# Empty for all systems except MinGW, where xargs needs an explicit
+# limitation.
+XARGS_LIMIT = @XARGS_LIMIT@
+
 # We never change directory before running Emacs, so a relative file
 # name is fine, and makes life easier.  If we need to change
 # directory, we can use emacs --chdir.
 EMACS = ../../src/emacs
 
 # Command line flags for Emacs.
-EMACSOPT = -batch --no-site-file --no-site-lisp -L :$(srcdir)
+# Apparently MSYS bash would convert "-L :" to "-L ;" anyway,
+# but we might as well be explicit.
+EMACSOPT = -batch --no-site-file --no-site-lisp -L "$(SEPCHAR)$(srcdir)"
 
 # Extra flags to pass to the byte compiler.
 BYTE_COMPILE_EXTRA_FLAGS =
 
+# Prevent any settings in the user environment causing problems.
+unexport EMACSDATA EMACSDOC EMACSPATH
+
 # The actual Emacs command run in the targets below.
 # Prevent any setting of EMACSLOADPATH in user environment causing problems.
-emacs = unset EMACSLOADPATH; \
-       LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) "$(EMACS)" $(EMACSOPT)
+emacs = EMACSLOADPATH= LC_ALL=C EMACS_TEST_DIRECTORY=$(srcdir) "$(EMACS)" $(EMACSOPT)
 
 # Common command to find subdirectories
 setwins=for file in `find $(srcdir) -type d -print`; do \
@@ -72,7 +82,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