[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Choose SET_MAKE correctly when there is no `make'
From: |
Noah Misch |
Subject: |
Choose SET_MAKE correctly when there is no `make' |
Date: |
Tue, 4 Jan 2005 08:08:40 -0800 |
User-agent: |
Mutt/1.5.6i |
I tried configuring Autoconf on a system with `gmake' but no `make'. Automake
requires AC_PROG_SET_MAKE, which decided that `make' did not predefine $(MAKE).
It substituted `MAKE=make' into @SET_MAKE@ in the Makefile as a workaround, and
running `gmake' then failed for lack a `make'. As an immediate workaround, I
did `./configure MAKE=gmake'.
I fixed the problem by only assuming `make' fails to define $(MAKE) if it does
run the test Makefile but expands $(MAKE) to the empty string. I also made
`MAKE' precious so --recheck will propagate it, should a user happen to have a
Make that is not called `make' and does not set $(MAKE).
2005-01-04 Noah Misch <address@hidden>
* lib/autoconf/programs.m4 (AC_PROG_MAKE_SET): If the Make program does
not seem to work, assume it does set $(MAKE). Make `MAKE' precious.
* doc/autoconf.texi (AC_PROG_MAKE_SET): Update.
diff -urp -X dontdiff ac-clean/doc/autoconf.texi ac-setmake/doc/autoconf.texi
--- ac-clean/doc/autoconf.texi 2005-01-03 07:02:43.210621705 -0500
+++ ac-setmake/doc/autoconf.texi 2005-01-04 10:26:50.781630692 -0500
@@ -1835,9 +1835,10 @@ following macro allows you to use it eve
@defmac AC_PROG_MAKE_SET
@acindex{PROG_MAKE_SET}
@ovindex SET_MAKE
-If @command{make} predefines the Make variable @code{MAKE}, define
-output variable @code{SET_MAKE} to be empty. Otherwise, define
address@hidden to contain @samp{MAKE=make}. Calls @code{AC_SUBST} for
+If the Make command, @code{$MAKE} if set or else @samp{make}, predefines
address@hidden(MAKE)}, define output variable @code{SET_MAKE} to be empty.
+Otherwise, define @code{SET_MAKE} to a macro definition that sets
address@hidden(MAKE)}, such as @samp{MAKE=make}. Calls @code{AC_SUBST} for
@code{SET_MAKE}.
@end defmac
diff -urp -X dontdiff ac-clean/lib/autoconf/programs.m4
ac-setmake/lib/autoconf/programs.m4
--- ac-clean/lib/autoconf/programs.m4 2005-01-02 12:39:22.000000000 -0500
+++ ac-setmake/lib/autoconf/programs.m4 2005-01-04 10:46:54.925774061 -0500
@@ -2,7 +2,7 @@
# Checking for programs.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2004 Free Software Foundation, Inc.
+# 2002, 2004, 2005 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -672,21 +672,25 @@ fi
# AC_PROG_MAKE_SET
# ----------------
-# Define SET_MAKE to set ${MAKE} if make doesn't.
+# Define SET_MAKE to set ${MAKE} if Make does not do so automatically. If Make
+# does not run the test Makefile, we assume that the Make program the user will
+# invoke does set $(MAKE). This is typical, and emitting `MAKE=foomake' is
+# always wrong if `foomake' is not available or does not work.
AN_MAKEVAR([MAKE], [AC_PROG_MAKE_SET])
AN_PROGRAM([make], [AC_PROG_MAKE_SET])
AC_DEFUN([AC_PROG_MAKE_SET],
[AC_MSG_CHECKING([whether ${MAKE-make} sets \$(MAKE)])
+AC_ARG_VAR([MAKE], [Program maintenance utility])
set dummy ${MAKE-make}; ac_make=`echo "$[2]" | sed 'y,:./+-,___p_,'`
AC_CACHE_VAL(ac_cv_prog_make_${ac_make}_set,
[cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
- @echo 'ac_maketemp="$(MAKE)"'
+ @echo 'ac_maketemp=X"$(MAKE)"'
_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
+if test "$ac_maketemp" != X ; then
eval ac_cv_prog_make_${ac_make}_set=yes
else
eval ac_cv_prog_make_${ac_make}_set=no
- Choose SET_MAKE correctly when there is no `make',
Noah Misch <=