config-patches
[Top][All Lists]
Advanced

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

Re: [PATCH 2/3] config.sub: Factor out `invalid_config` function


From: John Cotton Ericson
Subject: Re: [PATCH 2/3] config.sub: Factor out `invalid_config` function
Date: Fri, 22 Sep 2023 17:14:27 -0400
User-agent: Mozilla Thunderbird

On 9/21/23 22:31, Jacob Bachmeyer wrote:
Zack Weinberg wrote:
On Thu, Sep 21, 2023, at 3:52 PM, John Ericson wrote:
...
 # Functions
 ###########

+# Invalid configuration; display a message and exit
+#
+# Param 1: configuration
+# Param 2: message
+invalid_config () {
+    echo "Invalid configuration '$1': $2" 1>&2
+    exit 1
+}

Um. I don't think you can use shell functions in this file (or in config.guess), for the same reason you can't use $(...).

Not quite the same reason, although Zack *could* be right here, at least according to the Shell Differences FAQ mentioned in the Autoconf manual at <URL:http://www.faqs.org/faqs/unix-faq/shell/shell-differences/>: while the Bourne shell now almost always supports shell functions, the original Bourne shell did not have that feature.

It may be worth noting that the Solaris 10 sh does not support $(...) but *does* support at least simple shell functions; I just tested this at gcc210 on the GCC compile farm.  Similarly, the "bsh" AIX shell on gcc111 also supports functions but not $(...); the default "ksh" login shell on gcc111 supports both, as does the default "bash" login shell on gcc210.

I think we *can* use shell functions in these files, since even the Solaris 10 and AIX7.1 Bourne shells support them despite lacking support for $(...); I do not have convenient access to anything more ancient at the moment for further testing.

Oh whew, that's good to hear Jacob. I suppose I hope we can try it, and wait for anyone to report things broke (that didn't take too long with $(...)) and then revert it if we get any such report?

John




reply via email to

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