summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2014-12-22 17:56:22 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2014-12-22 17:56:22 +0100
commit88ac92b2d5beaf4aee7d7bb4f3dc9a86da823550 (patch)
tree16c1527969be06b21275e997f559333b738c8be5 /lib
parent4179284a3de093f3578a67c9b258a0d91eb4b6be (diff)
parent912383451a4a394383a8e95240e3e98ee68faf72 (diff)
downloadautomake-88ac92b2d5beaf4aee7d7bb4f3dc9a86da823550.tar.gz
Merge branch 'micro' into minor
* micro: cleanup: refactor code to initialize DIST_COMMON dist: ordering of files in DIST_COMMON is deterministic now tests: refactor some tests on DIST_COMMON maint: make output of 'gen-testsuite-part' deterministic When computing lispdir, don't load emacs site wide init file. PATH: quote $(PATH_SEPARATOR) as well Improve detection of GNU make, avoiding "Arg list too long" errors.
Diffstat (limited to 'lib')
-rw-r--r--lib/am/distdir.am1
-rw-r--r--lib/am/header-vars.am33
2 files changed, 31 insertions, 3 deletions
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index 7834f3db8..3441a7c98 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -14,6 +14,7 @@
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
+DIST_COMMON += $(am__DIST_COMMON)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
if %?TOPDIR_P%
diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am
index 463531a90..9283903a1 100644
--- a/lib/am/header-vars.am
+++ b/lib/am/header-vars.am
@@ -27,9 +27,36 @@ VPATH = @srcdir@
## DESTDIR =
## Shell code that determines whether we are running under GNU make.
-## This is somewhat of an hack, and might be improved, but is good
-## enough for now.
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+##
+## Why the this needs to be so convoluted?
+##
+## (1) We can't unconditionally use make functions or special variables
+## starting with a dot, as those cause non-GNU implmentations to
+## crash hard.
+##
+## (2) We can't use $(MAKE_VERSION) here, as it is also defined in some
+## non-GNU make implementations (e.g., FreeBSD make). But at least
+## BSD make does *not* define the $(CURDIR) variable -- it uses
+## $(.CURDIR) instead.
+##
+## (3) We can't use $(MAKEFILE_LIST) here, as in some situations it
+## might cause the shell to die with "Arg list too long" (see
+## automake bug#18744).
+##
+## (4) We can't use $(MAKE_HOST) unconditionally, as it is only
+## defined in GNU make 4.0 or later.
+##
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
## Shell code that determines whether the current make instance is
## running with a given one-letter option (e.g., -k, -n) that takes