From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 9 22:20:10 2008 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 010FD1065670 for ; Sun, 9 Mar 2008 22:20:10 +0000 (UTC) (envelope-from chuckr@chuckr.org) Received: from mail6.sea5.speakeasy.net (mail6.sea5.speakeasy.net [69.17.117.8]) by mx1.freebsd.org (Postfix) with ESMTP id D38098FC1A for ; Sun, 9 Mar 2008 22:20:09 +0000 (UTC) (envelope-from chuckr@chuckr.org) Received: (qmail 11839 invoked from network); 9 Mar 2008 22:20:09 -0000 Received: from april.chuckr.org (chuckr@[66.92.151.30]) (envelope-sender ) by mail6.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 9 Mar 2008 22:20:08 -0000 Message-ID: <47D46127.2030802@chuckr.org> Date: Sun, 09 Mar 2008 18:13:59 -0400 From: Chuck Robey User-Agent: Thunderbird 2.0.0.6 (X11/20071107) MIME-Version: 1.0 To: Mike Meyer References: <20080309152712.42752293@bhuda.mired.org> In-Reply-To: <20080309152712.42752293@bhuda.mired.org> X-Enigmail-Version: 0.95.5 OpenPGP: id=F3DCA0E9; url=http://pgp.mit.edu Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: hackers@freebsd.org Subject: Re: Why doesn't autoconf like our /bin/sh? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Mar 2008 22:20:10 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mike Meyer wrote: > I've stumbled on to an obscure problem with autoconf 2.61, and I'm not > sure quite what to do with it. I've already sent mail to the autoconf > folks, but I'd like to understand what's going on. > > The problem is that, on a FreeBSD system with only /bin/sh and the > ports zsh as installed shells, if you have SHELL set to zsh when > invoking the autoconf-generated configure script, the script produces > a broken Makefile. It doesn't generate an error, it just complains > that: > > as_func_failure succeeded. > as_func_failure succeeded. > No shell found that supports shell functions. > Please tell autoconf@gnu.org about your system, > including any error possibly output before this > message > > and then runs to completion, with no other indication of an error, and > non in the config.log file either. This has happened on multiple > different FreeBSD systems (including both 6-STABLE and 7-RELEASE), on > multiple autoconf scripts (possibly from multiple versions of > autoconf). > > Installing bash (or presumably any of the other shells that the > configure script looks for) changes this, and it works fine. Setting > SHELL to /bin/sh, or unsetting it, also solves this. > > And of course, if you build from ports, SHELL gets set to /bin/sh, so > there isn't a problem at all (which probably has a lot to do with why > I never noticed it before - the ports systems pretty much covers most > of my needs). > > From poking at things it seems that autoconf isn't happy with /bin/sh > for some reason, even though it works. With SHELL set to zsh, it then > tries that - and again isn't happy. However, it's not so unhappy that > it fails completely, so it tries to run with whatever shell it tried > last. > > My question is, why doesn't the configure script just accept /bin/sh? > After all, it's going to work. Is there an autoconf person who knows > this one? > The top of the configure script I just inspected (the one from print/libxslt) called out, on the top line: #!/bin/sh and so, as long as you do have a real shell there (which you have to have) should really work, BUT I know, from past experience, that many, many Linuxers, when told that their script doesn't work with any shell but Bash, will just tell you "but why don't you run Bash?" as if no one should ever run any other shell. I went to far, back when I ran Gentoo, to try to fix some broken scripts wrt non-bash usage, but no one really cared to fix that kind of thing. It's not going to be a proboem with configure, but it's possible that soome script called by configure is setting it's own shell. Configure probably needs, way up at the top, something like "export SHELL=/bin/sh" but don't hold your breath, and if Linuxers gave it a try, they'd probably want to peg it to bash, and that'd cause worse problems, because Linux and FreeBSD store bash in a different places. But if you're considering some holy war to try to convince Linux folks to correct this, DING DING, let me off at the next stop, please. > Thanks, >