autoconf
[Top][All Lists]
Advanced

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

Re: How to change the shebang in 'configure' to require Bash


From: Eric Blake
Subject: Re: How to change the shebang in 'configure' to require Bash
Date: Mon, 19 Mar 2018 08:57:42 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 03/18/2018 10:39 AM, R. Diez wrote:
I realise that this decision goes against Autoconf's portability principle. But even as a humble user, I am entitled to some freedom of choice. 8-)

I could write some code in configure.ac to detect the current shell. But is there any way to tell Autoconf to output a Bash shebang in the generated 'configure' script, instead of the standard "#! /bin/sh".

Not any easy way that I know of, precisely because it goes against autoconf's portability. If you're going to write in plain bash rather than a portable shell script, then do you need the additional layer of autoconf in the first place?


I read about variable CONFIG_SHELL, but that looks like it's meant for the user. Or can I set that variable inside configure.ac?

If you want to muck in the internals of autoconf, lib/m4sugar/m4sh.m4 emits the shebang lines during AS_INIT_GENERATED (for subsidiary scripts produced by the primary, such as config.status), and during AS_INIT (for the primary script, such as configure). Those macros are not set up to easily hook in a replacement, so you'd have to rewrite your m4 library to redefine those macros the way you want. If you think that other people would commonly want to hook in a different default shell than /bin/sh, you're welcome to turn it into a formal patch against autoconf instead of something you just override locally, but I'm not yet convinced that it is common to throw away portability.


Please copy me on all the answers, as I am not subscribed to this mailing list.

It's already list policy to reply-to-all, precisely for that reason.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

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