autoconf
[Top][All Lists]
Advanced

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

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


From: R. Diez
Subject: How to change the shebang in 'configure' to require Bash
Date: Sun, 18 Mar 2018 16:39:16 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Hi all:

I find it hard to write POSIX-compliant shell scripts. The lack of the 'pipefail' flag is specially problematic. I have described this issue here:

http://rdiez.shoutwiki.com/wiki/Error_Handling_in_General_and_C%2B%2B_Exceptions_in_Particular#Set_the_pipefail_flag

Therefore, I write most of my shell scripts exclusively for Bash. I also find some bashisms very convenient. I only test my scripts against Bash anyway, as I haven't got the time nor the inclination for more extensive testing. I never had a big problem in this respect, as the Bash shell is everywhere.

I find configure.ac scripts even harder to write than normal Bash scripts. Furthermore, ShellCheck cannot analyse them. Therefore, I want to limit my Autoconf 'configure' scripts to Bash.

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".

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?

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

Thanks in advance,
  rdiez



reply via email to

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