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.


-- Jacob


Reply via email to