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

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

 




I saw in the recent Automake release notes that there’s a tentative plan that
Autoconf 2.0 will require at least a POSIX shell.

Herr Diez, is this close enough to “Bash” to suit your purposes?
That is, are you just looking for things like $() instead of ``, > or are you intending to commit outright bash-isms?

First of all, thanks for your answer.

I know that Autoconf developers want to write extremely portable scripts. But that is a huge barrier for somebody like me. I am a user, not a shell expert.

I have heard that the POSIX standard, or maybe its implementation, is not exactly the same across all shells. There are subtle differences.

The generated 'configure' script changes shells on start-up. The logic is not documented. I looked inside, and it was not immediately obvious on what grounds some shells are preferred. Depending on what is installed, I seems possible that zsh is taken, for example.

I am unwilling to test my configure.ac on several shells. Furthermore, the features in the POSIX standard are very limited. I am using arrays and regular expressions, for example. An my scripts are not really that complex.

In any case, the behaviour of my configure.ac script cannot depend on what shells the end-user has currently installed. I do not know of any shell linters like ShellCheck that accept configure.ac files.

I would be very happy if my software ran on 10 % of the platforms where Bash is installed by default. Therefore, demanding Bash is for me the best solution.

In fact, it is the only sane solution. Not even hard-core Autoconf developers should take such risks. My guess is that Autoconf-generated 'configure' scripts usually work because they tend to switch to Bash on start-up.

Even if you really wanted, there is no way to properly test your configure.ac scripts. Autoconf requires a Bourne shell, but exactly what is required, is not documented. There is no guide as to what shells and shell versions you should be testing against.

Autoconf works because most bugs have been reported and fixed over many years. But trying to change the shell requirement now is probably a big nightmare.

Requiring a POSIX shell in the next version is an improvement, but POSIX is too limiting to really help. It is 2018. No wonder so many people want to ditch Autoconf!

Best regards,
  R. Diez

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux