GNOME Bugzilla – Bug 782894
configure.ac uses '${PARAMETER/PATTERN/STRING}', but it is not supported by POSIX shell
Last modified: 2017-06-05 04:45:19 UTC
'${PARAMETER/PATTERN/STRING}' syntax is supported by bash, but not all systems use bash as /bin/sh. It causes the following error messages to be shown when running configure. checking for itstool... itstool checking for xmllint... /usr/local/bin/xmllint ./configure: ${GLIB_MIN_REQUIRED/...}: Bad substitution ./configure: ${GLIB_MAX_ALLOWED/...}: Bad substitution ./configure: ${GTK_MIN_REQUIRED/...}: Bad substitution ./configure: ${GTK_MAX_ALLOWED/...}: Bad substitution configure script still finishes successfully, but these 4 macros are undefined in the generated config.h file. This problem can be resolved by using tr or sed command to replace strings.
Created attachment 352254 [details] [review] build: Use tr command to replace strings '${PARAMETER/PATTERN/STRING}' syntax is not supported by POSIX shell, so it can cause syntax error if /bin/sh is not bash.
Why not just set CONFIG_SHELL to bash? I can add a check for that like in bug 726780 (aisleriot).
Isn't it better to keep configure script portable, so it can be run without installing additional dependencies or doing manual configuration? Requiring bash means we have to add bash to BUILD_DEPENDS because FreeBSD doesn't include it in the base system. This also means jhbuild users have to manually add code like module_extra_env['gnome-terminal'] = {'CONFIG_SHELL': '/usr/local/bin/bash'} to jhbuildrc because it cannot be configured by jhbuild modulesets.
Comment on attachment 352254 [details] [review] build: Use tr command to replace strings Alright then.
Attachment 352254 [details] pushed as cda8ee2 - build: Use tr command to replace strings