[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A better autogen.sh

From: Jim Meyering
Subject: Re: A better autogen.sh
Date: Tue, 29 Mar 2011 14:09:24 +0200

Glenn Morris wrote:
> Stefan Monnier wrote:
>>> configure: error: cannot find install-sh, install.sh, or shtool in "." 
>>> "./.." "./../.."
>> We're miscommunicating: the original report showed the error to be the
>> lack of install-sh and doesn't mention automake.  So the missing rule is
>> to call autogen.sh or autoreconf or something when install-sh
>> is missing.
> (autogen.sh calls autoreconf which calls automake to add the files)
> Well, there's nothing to be done about it now. Any new make rule would
> only take effect after running configure, and anyone who can run
> configure does not need such a rule. Anyone would ran autogen.sh between
> ~ Mar 20 and 25 should simply run it again if they have this issue.

Hi Glenn,

Actually, you *can* do something, assuming the victim has GNU make.
Put something like the following in GNUmakefile, and then "make" works
even before ./configure is run, even if it's just to instruct the user
to run ./configure.

[The following is part of gnulib's top/GNUmakefile, which is
included automatically when you use its "gnumakefile" module. ]

# Having a separate GNUmakefile lets me `include' the dynamically
# generated rules created via cfg.mk (package-local configuration)
# as well as maint.mk (generic maintainer rules).
# This makefile is used only if you run GNU Make.
# It is necessary if you want to build targets usually of interest
# only to the maintainer.

# Copyright (C) 2001, 2003, 2006-2011 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
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Systems where /bin/sh is not the default shell need this.  The $(shell)
# command below won't work with e.g. stock DOS/Windows shells.
ifeq ($(wildcard /bin/s[h]),/bin/sh)
SHELL = /bin/sh
# will be used only with the next shell-test line, then overwritten
# by a configured-in value
SHELL = sh

# If the user runs GNU make but has not yet run ./configure,
# give them a diagnostic.
_have-Makefile := $(shell test -f Makefile && echo yes)
ifeq ($(_have-Makefile),yes)

# Allow the user to add to this in the Makefile.

include Makefile

.DEFAULT_GOAL := abort-due-to-no-makefile

# The package can override .DEFAULT_GOAL to run actions like autoreconf.
-include ./cfg.mk
include ./maint.mk

ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
$(MAKECMDGOALS): abort-due-to-no-makefile

        @echo There seems to be no Makefile in this directory.   1>&2
        @echo "You must run ./configure before running \`make'." 1>&2
        @exit 1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]